/* احسبلي - Modern Arabic Calculator Platform */
/* Google Fonts loaded via <link> in HTML for performance */

:root {
  --primary: #1a5276;
  --primary-light: #2471a3;
  --accent: #f39c12;
  --accent-light: #f7c948;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eaf0f8;
  --text: #1a202c;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #27ae60;
  --highlight-bg: linear-gradient(135deg, #1a5276, #2471a3);
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(26,82,118,0.10);
  --shadow-lg: 0 8px 40px rgba(26,82,118,0.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Tajawal', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--primary);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  position: relative;
}
.logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active { background: rgba(255,255,255,0.15); color: #fff; }
.nav-links .nav-separator {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.2);
  margin: 0 4px;
}

/* Hamburger Button */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  margin: 5px 0;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #0d3b6e 0%, #1a5276 50%, #1f618d 100%);
  padding: 64px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 2.8rem; font-weight: 900; color: #fff; margin-bottom: 16px; line-height: 1.3; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,0.8); margin-bottom: 32px; }
.search-bar {
  display: flex;
  gap: 0;
  background: #fff;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 500px;
  margin: 0 auto;
}
.search-bar input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-family: inherit;
  font-size: 1rem;
  direction: rtl;
  outline: none;
  color: var(--text);
}
.search-bar button {
  background: var(--accent);
  border: none;
  padding: 14px 24px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}
.search-bar button:hover { background: #e67e22; }

/* ===== CATEGORIES ===== */
.categories {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 24px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}
.cat-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.cat-btn:hover, .cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== TRUST SIGNALS ===== */
.trust-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
.trust-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.trust-icon.green { background: rgba(39,174,96,0.12); }
.trust-icon.blue { background: rgba(26,82,118,0.12); }
.trust-icon.orange { background: rgba(243,156,18,0.12); }

/* ===== FEATURED TOOL ===== */
.featured-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 0;
}
.featured-card {
  display: flex;
  align-items: center;
  gap: 40px;
  background: linear-gradient(135deg, #0d3b6e 0%, #1a5276 40%, #1f618d 100%);
  border-radius: var(--radius);
  padding: 40px 48px;
  text-decoration: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(13,59,110,0.25);
  transition: transform 0.3s, box-shadow 0.3s;
}
.featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 56px rgba(13,59,110,0.35);
}
.featured-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.featured-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: 0.5px;
}
.featured-icon {
  font-size: 4rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-info {
  position: relative;
  z-index: 1;
  flex: 1;
}
.featured-info h3 {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 8px;
  color: #fff;
}
.featured-info p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 16px;
}
.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s;
}
.featured-card:hover .featured-cta { background: #e67e22; }

/* ===== CATEGORY COLORS ===== */
.tool-card[data-category="رواتب"] { border-top: 3px solid #2471a3; }
.tool-card[data-category="رواتب"] .tool-tag { background: rgba(36,113,163,0.1); color: #2471a3; }
.tool-card[data-category="رواتب"] .tool-icon-wrap { background: rgba(36,113,163,0.08); }

.tool-card[data-category="قروض"] { border-top: 3px solid #8e44ad; }
.tool-card[data-category="قروض"] .tool-tag { background: rgba(142,68,173,0.1); color: #8e44ad; }
.tool-card[data-category="قروض"] .tool-icon-wrap { background: rgba(142,68,173,0.08); }

.tool-card[data-category="زكاة"] { border-top: 3px solid #27ae60; }
.tool-card[data-category="زكاة"] .tool-tag { background: rgba(39,174,96,0.1); color: #27ae60; }
.tool-card[data-category="زكاة"] .tool-icon-wrap { background: rgba(39,174,96,0.08); }

.tool-card[data-category="ضرائب"] { border-top: 3px solid #e67e22; }
.tool-card[data-category="ضرائب"] .tool-tag { background: rgba(230,126,34,0.1); color: #e67e22; }
.tool-card[data-category="ضرائب"] .tool-icon-wrap { background: rgba(230,126,34,0.08); }

.tool-card[data-category="ذهب"] { border-top: 3px solid #f1c40f; }
.tool-card[data-category="ذهب"] .tool-tag { background: rgba(241,196,15,0.12); color: #b7950b; }
.tool-card[data-category="ذهب"] .tool-icon-wrap { background: rgba(241,196,15,0.08); }

.tool-card[data-category="عملات"] { border-top: 3px solid #16a085; }
.tool-card[data-category="عملات"] .tool-tag { background: rgba(22,160,133,0.1); color: #16a085; }
.tool-card[data-category="عملات"] .tool-icon-wrap { background: rgba(22,160,133,0.08); }

.tool-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  margin-bottom: 4px;
}

/* ===== TOOLS GRID ===== */
.section { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.section-title { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 24px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.tool-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.tool-icon { font-size: 2.2rem; }
.tool-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--primary); line-height: 1.4; }
.tool-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }
.tool-tag {
  display: inline-block;
  background: var(--surface-2);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  width: fit-content;
}
.tool-arrow { color: var(--accent); font-size: 1.2rem; margin-top: auto; text-align: left; }

@media (max-width: 768px) {
  .featured-card { flex-direction: column; text-align: center; padding: 32px 24px; gap: 20px; }
  .trust-inner { gap: 20px; }
  .trust-item { font-size: 0.82rem; }
}

/* ===== AD SLOT ===== */
.ad-slot {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 24px 0;
}

/* ===== TOOL PAGE ===== */
.tool-page { max-width: 860px; margin: 0 auto; padding: 32px 24px; }
.breadcrumb { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb span { margin: 0 8px; }
.tool-header { margin-bottom: 32px; }
.tool-header h1 { font-size: 2rem; font-weight: 900; color: var(--primary); margin-bottom: 10px; line-height: 1.3; }
.tool-header .desc { color: var(--text-muted); font-size: 1rem; }

/* CALCULATOR WIDGET */
.calculator-widget {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid var(--border);
}
.widget-header {
  background: var(--highlight-bg);
  padding: 20px 28px;
  color: #fff;
}
.widget-header h2 { font-size: 1.1rem; font-weight: 700; }
.widget-body { padding: 28px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group select {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  direction: rtl;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus { border-color: var(--primary); background: #fff; }
.calc-btn {
  background: var(--highlight-bg);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s, transform 0.1s;
  width: 100%;
}
.calc-btn:hover { opacity: 0.9; transform: scale(1.01); }
.calc-btn:active { transform: scale(0.99); }

/* RESULTS */
.results-area { margin-top: 24px; display: none; }
.results-area.show { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.result-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  border-right: 4px solid var(--border);
}
.result-item.highlight {
  background: linear-gradient(135deg, #1a5276, #2471a3);
  color: #fff;
  border-right-color: var(--accent);
}
.result-item .r-label { font-size: 0.8rem; opacity: 0.75; margin-bottom: 4px; }
.result-item.highlight .r-label { opacity: 0.85; }
.result-item .r-value { font-size: 1.2rem; font-weight: 800; }

/* LONG DESC & FAQ */
.content-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.content-section h2 { font-size: 1.25rem; font-weight: 800; color: var(--primary); margin-bottom: 14px; }
.content-section p { color: #4a5568; line-height: 1.8; }
.faq-item { border-top: 1px solid var(--border); padding: 16px 0; }
.faq-item:first-child { border-top: none; }
.faq-q { font-weight: 700; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-a { color: var(--text-muted); margin-top: 8px; display: none; line-height: 1.7; }
.faq-a.open { display: block; animation: fadeIn 0.3s ease; }

/* RELATED TOOLS */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.related-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid transparent;
}
.related-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.related-card .r-icon { font-size: 1.6rem; }
.related-card .r-title { font-size: 0.9rem; font-weight: 700; color: var(--primary); }

/* ===== FOOTER ===== */
.site-footer {
  background: linear-gradient(165deg, #0a1628 0%, #0d2137 40%, #132d4a 100%);
  color: rgba(255,255,255,0.7);
  padding: 0;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light), var(--accent));
}
.site-footer::after {
  content: '';
  position: absolute;
  bottom: -120px;
  right: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(243,156,18,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand .footer-logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.footer-brand .footer-logo span {
  color: var(--accent);
}
.footer-brand-desc {
  font-size: 0.88rem;
  line-height: 1.9;
  color: rgba(255,255,255,0.5);
  margin: 0;
}
.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 12px;
}
.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.footer-col a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.86rem;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-col a:hover {
  color: var(--accent);
  transform: translateX(-3px);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.15);
}
.footer-bottom a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-bottom a:hover {
  color: var(--accent);
}
.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-heart {
  color: #e74c3c;
  display: inline-block;
  animation: heartbeat 1.5s ease infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Footer responsive */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 550px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-inner {
    padding: 40px 20px 32px;
  }
  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom-inner { justify-content: center; text-align: center; flex-direction: column; }
  .footer-keywords { justify-content: center; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.9rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  
  .hamburger { display: block; }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    padding: 16px 24px;
    gap: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
  }
  .nav-links.open {
    display: flex;
    animation: slideDown 0.3s ease;
  }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .nav-links li {
    width: 100%;
  }
  .nav-links a {
    display: block;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1rem;
  }
  .nav-links a:hover {
    background: rgba(255,255,255,0.1);
  }
  .nav-links .nav-separator {
    width: 100%;
    height: 1px;
    margin: 8px 0;
  }
  
  .header-inner { justify-content: space-between; }
}

/* ===== UTILS ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(243,156,18,0.15); color: var(--accent); padding: 4px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }

/* ===== TOOL ARTICLE (YMYL CONTENT) ===== */
.tool-article {
  line-height: 2;
  font-size: 1rem;
}
.tool-article h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.tool-article h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-light);
  margin: 20px 0 8px;
}
.tool-article p {
  margin-bottom: 12px;
  color: var(--text);
}
.tool-article ul {
  padding-right: 22px;
  margin-bottom: 14px;
}
.tool-article li {
  margin-bottom: 8px;
  line-height: 1.9;
}
.tool-article strong {
  color: var(--primary);
}
.tool-article em {
  color: var(--text-muted);
  font-style: normal;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.92rem;
}

/* ===== CATEGORY PILLAR PAGES ===== */
.category-page { max-width: 900px; }

.category-hero {
  background: var(--surface);
  padding: 40px 32px;
  border-radius: var(--radius);
  border-right: 5px solid var(--primary);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  text-align: center;
}
.category-hero-icon { font-size: 3rem; margin-bottom: 12px; }
.category-hero h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 12px;
  line-height: 1.5;
}
.category-hero-desc {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
}

.category-tools-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.category-tool-card {
  flex-direction: column;
  text-align: center;
  padding: 20px 16px;
}
.category-tool-card .r-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.6;
}

.category-article {
  line-height: 2;
  font-size: 1rem;
}
.category-article h2 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.category-article p {
  margin-bottom: 14px;
  color: var(--text);
}
.category-article ul {
  padding-right: 24px;
  margin-bottom: 16px;
}
.category-article li {
  margin-bottom: 8px;
  line-height: 1.9;
}
.category-article strong {
  color: var(--primary);
}

/* Category links grid (other categories) */
.other-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.cat-link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border-right: 4px solid var(--primary);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.cat-link-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.cat-link-icon { font-size: 1.4rem; }
.cat-link-name { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }

/* Homepage categories grid */
.home-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.home-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  transition: all 0.25s;
}
.home-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.home-cat-icon { font-size: 2rem; }
.home-cat-card strong { font-size: 1rem; }
.home-cat-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 2px 10px;
  border-radius: 12px;
}

@media (max-width: 768px) {
  .category-hero h1 { font-size: 1.4rem; }
  .category-hero { padding: 24px 16px; }
  .category-tools-grid { grid-template-columns: 1fr; }
  .other-categories-grid { grid-template-columns: 1fr 1fr; }
  .home-categories-grid { grid-template-columns: repeat(3, 1fr); }
}
