/* ============================================
   Hesap Cebimde — Stylesheet
   Modern, mobil-first, light theme
   ============================================ */

:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #2563eb;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-soft: #6b7280;
  --text-muted: #64748b;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --success: #059669;
  --shadow: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 10px;
  --radius-lg: 14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-dark); }

h1, h2, h3, h4 { color: var(--text); line-height: 1.3; font-weight: 700; }

/* HEADER */
.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 420px;
  margin: 0 20px;
}

.header-search input,
.mobile-nav-search input {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.header-search input:focus,
.mobile-nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.site-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 250;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.site-search-results a,
.site-search-empty {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}

.site-search-results a:hover {
  background: #f0fdfa;
  color: var(--primary);
}

.site-search-empty {
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  color: var(--text-soft);
  font-weight: 500;
  font-size: 15px;
}

.main-nav a:hover { color: var(--primary); }

.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown summary {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker { display: none; }

.nav-dropdown summary::after {
  content: "▾";
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.nav-dropdown:hover summary,
.nav-dropdown[open] summary,
.nav-dropdown.active summary {
  background: #ecfdf5;
  color: var(--primary);
}

.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  width: min(760px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.nav-all-pages-list {
  min-width: 0;
}

.nav-page-columns {
  column-count: 3;
  column-gap: 12px;
}

.nav-dropdown-panel strong {
  display: block;
  margin: 0 0 6px;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.nav-dropdown-panel a {
  display: block;
  break-inside: avoid;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 14px;
}

.nav-dropdown-panel a:hover {
  background: #f0fdfa;
  color: var(--primary);
}

.nav-all-tools {
  padding: 8px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-all-tools:hover,
.nav-all-tools.soft {
  background: #f9fafb;
}

.mobile-nav-search { display: none; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 74px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: white;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 12px 12px;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
  }
  .header-search { display: none; }
  .mobile-nav-search {
    display: block;
    position: relative;
    margin: 0 0 8px;
  }
  .mobile-results {
    position: static;
    margin-top: 6px;
  }
  .nav-dropdown {
    border-bottom: 1px solid var(--border);
  }
  .nav-dropdown::after {
    display: none;
  }
  .nav-dropdown summary {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    justify-content: space-between;
    padding: 12px 8px;
    border-radius: 0;
  }
  .nav-dropdown-panel {
    position: static;
    display: block;
    min-width: 0;
    width: 100%;
    padding: 4px 0 10px 12px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: 58vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav-page-columns {
    column-count: 1;
  }
  .nav-dropdown-panel div + div {
    margin-top: 8px;
  }
  .mobile-menu-btn { display: block; }
}

/* MAIN */
.main-content { padding: 32px 0 64px; min-height: 80vh; }

/* HERO */
.hero {
  text-align: center;
  padding: 48px 20px;
  background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 28px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search input {
  width: 100%;
  max-width: 480px;
  padding: 14px 20px;
  border-radius: 30px;
  border: 1.5px solid var(--border-strong);
  background: white;
  font-size: 15px;
  outline: none;
  transition: all .15s;
  box-shadow: var(--shadow);
}

.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}

@media (max-width: 640px) {
  .hero { padding: 32px 16px; }
  .hero h1 { font-size: 26px; }
  .hero-subtitle { font-size: 15px; }
}

/* CATEGORIES */
.categories { margin: 40px 0; }
.categories h2,
.popular-calculators h2,
.why-us h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
  text-decoration: none;
  color: var(--text);
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.category-icon { font-size: 36px; margin-bottom: 8px; }
.category-card h3 { font-size: 14px; margin-bottom: 4px; }
.category-count { font-size: 12px; color: var(--text-muted); }

@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

/* CALC GRID */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.calc-card {
  display: block;
  padding: 20px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
  text-decoration: none;
  color: var(--text);
}

.calc-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.calc-card-header { margin-bottom: 12px; }

.calc-category-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #374151 !important;
}

details summary[style*="#10b981"],
details summary[style*="10b981"] {
  color: #047857 !important;
}

.calc-card h3 { font-size: 17px; margin-bottom: 8px; color: var(--text); }
.calc-card p { font-size: 14px; color: var(--text-soft); line-height: 1.5; margin-bottom: 12px; }

.calc-arrow {
  display: inline-block;
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
}

.calc-arrow::after {
  content: " →";
}

@media (max-width: 768px) {
  .calc-grid { grid-template-columns: 1fr; }
}

/* FEATURES */
.why-us { margin: 48px 0; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.feature {
  text-align: center;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #ecfdf5;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}
.feature h3 { font-size: 15px; margin-bottom: 8px; }
.feature p { font-size: 13px; color: var(--text-soft); }

@media (max-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* BREADCRUMB */
.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-soft);
}

.breadcrumb a {
  color: #475569 !important;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}
.breadcrumb a:hover { color: #334155 !important; }

/* CALCULATOR PAGE */
.calculator-page { max-width: 1000px; margin: 0 auto; }

.calc-header {
  text-align: center;
  margin-bottom: 32px;
  padding: 32px 20px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.calc-header h1 { font-size: 30px; margin-bottom: 12px; }

.calc-subtitle {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 600px;
  margin: 0 auto;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.calc-form-card,
.calc-result-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.calc-form-card h2,
.calc-result-card h2 {
  font-size: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group small,
.input-hint,
.result-note,
.data-updated,
.market-update,
.site-search-empty,
.choice-card-desc,
.assistant-loading {
  color: #475569;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: white;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}

.form-group textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-group select {
  appearance: auto;
  line-height: 1.35;
}

.form-group option {
  color: var(--text);
  background: white;
  font-size: 16px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.choice-select-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
}

/* compact doğru/yanlış table */
.dy-table { width: 100%; }
.dy-head,
.dy-row {
  display: grid;
  grid-template-columns: 1fr 64px 64px 52px;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
}
.dy-head {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 4px;
}
.dy-head span:not(:first-child),
.dy-row span:not(:first-child) { text-align: center; }
.dy-row { border-bottom: 1px solid #f3f4f6; }
.dy-row span:first-child { font-size: 14px; color: #374151; }
.dy-row small { color: #64748b; font-size: 11px; }
.dy-row input {
  width: 100%;
  padding: 6px 4px;
  text-align: center;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.dy-net { font-size: 13px; font-weight: 600; color: #0f766e; text-align: center; }

/* custom dropdown (9+ options) */
.cd-trigger {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #111827;
  gap: 8px;
}
.cd-trigger:hover { border-color: var(--primary); }
.cd-trigger:disabled {
  color: #595959;
  cursor: not-allowed;
  background: #f8fafc;
}
.cd-arrow { font-size: 11px; color: #6b7280; flex-shrink: 0; }
.cd-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 300;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}
.cd-opt {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 15px;
  color: #111827;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.cd-opt:last-child { border-bottom: none; }
.cd-opt:hover { background: #f3f4f6; }
.cd-opt-active { color: var(--primary); font-weight: 600; background: #f0fdf4; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}

.form-group .choice-card {
  display: flex;
  margin-bottom: 0;
}

.choice-card:hover {
  border-color: var(--primary);
  background: #f8fffd;
}

.choice-card input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
  min-width: 20px;
}

.calc-btn,
.calc-btn-secondary,
.btn-hesapla,
.btn-primary,
.ai-btn,
.ai-chip,
.assistant-submit,
.assistant-chips .chip,
.category-card,
.calc-card,
.related-card,
.market-tile,
.nav-dropdown summary,
.nav-dropdown-panel a,
.nav-all-tools,
.site-search-results a,
.official-source-links a {
  min-height: 44px;
}

.calc-btn,
.calc-btn-secondary,
.btn-hesapla,
.btn-primary,
.ai-btn,
.ai-chip,
.assistant-submit,
.assistant-chips .chip,
.nav-dropdown summary,
.nav-dropdown-panel a,
.nav-all-tools,
.site-search-results a,
.official-source-links a {
  display: inline-flex;
  align-items: center;
}

.calc-btn,
.btn-hesapla {
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1.5px solid var(--primary);
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.18);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
}

.calc-btn:hover,
.btn-hesapla:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  transform: translateY(-1px);
}

.calc-btn-secondary {
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.calc-btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #111827;
  transform: translateY(-1px);
}

.calc-form-card > .calc-btn,
.calc-form-card > .calc-btn-secondary {
  min-width: 132px;
  margin-top: 4px;
  margin-right: 10px;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.related-card {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
}

.calc-content a,
.calc-section a,
.faq-item a,
.legal-note a,
.page-source-section a,
.source-update-card a,
.static-page a {
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

.calc-content a:hover,
.calc-section a:hover,
.faq-item a:hover,
.legal-note a:hover,
.page-source-section a:hover,
.source-update-card a:hover,
.static-page a:hover {
  text-decoration-thickness: 2px;
}

table caption.sr-only {
  caption-side: top;
}

.choice-card-title,
.choice-card-desc {
  display: block;
}

.choice-card-title {
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
}

.choice-card-desc {
  margin-top: 3px;
  font-size: 14px;
  line-height: 1.35;
  color: #475569;
  font-weight: 500;
}

.choice-card.is-selected,
.choice-card:has(input:checked) {
  border-color: var(--primary);
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

.choice-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.16);
}

@media (max-width: 640px) {
  .choice-grid {
    grid-template-columns: 1fr;
  }
}

/* RESULT */
.result-main {
  text-align: center;
  padding: 20px;
  background: #ecfdf5;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.result-label {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.result-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--success);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 8px;
  font-weight: 700;
  color: var(--text);
}

.result-table tr { border-bottom: 1px solid var(--border); }
.result-table tr:last-child { border-bottom: none; }
.result-table td { padding: 12px 8px; font-size: 14px; }
.result-table td:first-child { color: var(--text-soft); }
.result-table td:last-child { text-align: right; font-weight: 600; color: var(--text); }
.result-table tr.result-total { background: var(--bg-soft); font-weight: 700; }
.result-table strong[style*="#ef4444"],
.result-table strong[style*="ef4444"] {
  color: #991b1b !important;
}

@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }
}

/* CONTENT */
.calc-content {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 40px;
}

.calc-content h2 {
  font-size: 22px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

.calc-content h3 { font-size: 17px; margin-top: 24px; margin-bottom: 10px; }
.calc-content p { margin-bottom: 12px; color: var(--text-soft); line-height: 1.7; }
.calc-content ul { margin: 12px 0; padding-left: 24px; }
.calc-content ul li { margin-bottom: 6px; color: var(--text-soft); }

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.info-table th,
.info-table td {
  padding: 10px 12px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}

.info-table th { background: var(--bg-soft); font-weight: 600; }

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.example-table th,
.example-table td {
  vertical-align: top;
}

.formula-box {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: #f0fdfa;
  color: #134e4a;
  font-weight: 600;
}

.formula-steps {
  margin: 12px 0 20px;
  padding-left: 22px;
}

.formula-steps li {
  margin-bottom: 8px;
  color: var(--text-soft);
}

.attention-list {
  margin: 12px 0 20px;
  padding-left: 22px;
}

.attention-list li {
  margin-bottom: 8px;
  color: var(--text-soft);
}

.decision-support-box {
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #eff6ff;
}

.decision-support-box strong {
  display: block;
  margin-bottom: 6px;
  color: #1e3a8a;
}

.decision-support-box p {
  margin-bottom: 10px;
  color: #1e3a8a;
}

.decision-support-box ul {
  margin: 0;
  padding-left: 18px;
}

.decision-support-box li {
  margin-bottom: 6px;
  color: #1f2937;
}

.source-update-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.source-update-card > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  padding: 14px;
}

.source-update-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
}

.source-update-card p {
  margin: 0;
  font-size: 13px;
}

.official-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.official-source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: white;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.official-source-links a:hover {
  border-color: var(--primary);
  background: #f0fdfa;
}

.page-source-section {
  margin: 32px 0 0;
}

/* RELATED */
.related-calcs { margin-top: 40px; }
.related-calcs h2 { font-size: 22px; margin-bottom: 16px; }

/* CATEGORY PAGE */
.category-hero {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

.category-hero-icon { font-size: 56px; display: block; margin-bottom: 12px; }
.category-hero h1 { font-size: 32px; margin-bottom: 8px; }
.category-hero p { color: var(--text-soft); font-size: 15px; }

/* STATIC PAGES */
.static-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.static-page h1 { margin-bottom: 20px; }
.static-page h2 { margin: 20px 0 10px; font-size: 18px; }
.static-page p { margin-bottom: 12px; color: var(--text-soft); }

/* 404 */
.error-page {
  text-align: center;
  padding: 60px 20px;
}

.error-page h1 {
  font-size: 96px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.error-page h2 { font-size: 24px; margin-bottom: 12px; }
.error-page p { color: var(--text-soft); margin-bottom: 24px; }

.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.btn-primary:hover { background: var(--primary-dark); color: white; }

/* FOOTER */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 32px;
}

.footer-grid h3, .footer-grid h4 { color: white; font-size: 16px; margin-bottom: 12px; }
.footer-grid p { font-size: 14px; line-height: 1.6; }
.footer-trust { margin-top: 10px; color: #d1d5db; }

.footer-grid a {
  display: block;
  color: #9ca3af;
  font-size: 14px;
  padding: 4px 0;
}

.footer-grid a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

.data-updated {
  font-size: 12px;
  opacity: 1;
  color: #4b5563;
}

.site-footer .footer-bottom .data-updated {
  display: inline-block;
  padding: 2px 4px;
  background: #111827;
  color: #e5e7eb;
  opacity: 1;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--text-soft);
  font-weight: 700;
}

.faq-item[open] summary::after { content: "-"; }

.faq-item p {
  padding: 0 16px 14px;
  margin: 0;
  color: var(--text-soft);
}

.legal-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
}

.calc-content .decision-support-box li,
.calc-content .decision-support-box p,
.calc-content .legal-note {
  color: #1f2937;
}

.internal-link-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 32px;
}

.internal-link-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.internal-link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.internal-link-cluster {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg-soft);
}

.internal-link-cluster h3 {
  font-size: 15px;
  margin-bottom: 10px;
}

.internal-link-cluster a {
  display: block;
  color: var(--text-soft);
  font-size: 14px;
  padding: 5px 0;
}

.internal-link-cluster a:hover {
  color: var(--primary);
}

.sponsor-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 16px 18px;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.sponsor-slot strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.sponsor-slot p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.sponsor-slot a {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.sponsor-slot a:hover {
  background: var(--primary-dark);
  color: #fff;
}

@supports (content-visibility: auto) {
  .related-calcs,
  .calc-faq-global,
  .why-us,
  .render-defer-text {
    content-visibility: auto;
    contain-intrinsic-size: auto 640px;
  }

  .render-defer-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
  }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .internal-link-grid { grid-template-columns: 1fr; }
  .sponsor-slot { align-items: flex-start; flex-direction: column; }
  .source-update-card { grid-template-columns: 1fr; }
}

/* ─── AI Assistant Widget ─────────────────────────────────────────────── */
.ai-assistant-bar {
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
  padding: 12px 0;
  box-shadow: 0 2px 8px rgba(15,118,110,0.15);
}
.ai-assistant-bar .assistant-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.assistant-input-wrap {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  padding: 6px 8px 6px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  gap: 8px;
}
.assistant-icon { font-size: 1.2rem; flex-shrink: 0; }
.assistant-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
  color: #1e293b;
  min-width: 0;
}
.assistant-input::placeholder { color: #94a3b8; }
.assistant-submit {
  background: #0f766e;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.assistant-submit:hover { background: #0d9488; }
.assistant-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.assistant-chips .chip {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.assistant-chips .chip:hover { background: rgba(255,255,255,0.28); }
.assistant-result {
  background: white;
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 4px;
  font-size: 0.9rem;
  color: #1e293b;
}
.assistant-result .ai-redirect {
  display: inline-block;
  margin-top: 8px;
  background: #0f766e;
  color: white;
  padding: 7px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.assistant-result .ai-redirect:hover { background: #0d9488; }
.assistant-result .ai-clarify { color: #64748b; }
.assistant-result .ai-suggestions { list-style: none; padding: 0; margin: 6px 0 0; }
.assistant-result .ai-suggestions li a {
  display: block;
  padding: 4px 0;
  color: #0f766e;
  font-weight: 500;
  text-decoration: none;
}
.assistant-result .ai-suggestions li a:hover { text-decoration: underline; }
.assistant-loading { color: #64748b; }
@media (max-width: 600px) {
  .assistant-chips { gap: 4px; }
  .assistant-chips .chip { font-size: 0.72rem; padding: 2px 8px; }
}

/* ─── Loan Comparison Widget ──────────────────────────────────────────── */
.loan-compare-section {
  margin-top: 28px;
  border-top: 2px solid #e2e8f0;
  padding-top: 20px;
}
.loan-compare-section h2 { font-size: 1.1rem; margin-bottom: 12px; }
.loan-compare-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.loan-compare-table th {
  background: #f1f5f9;
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  border-bottom: 2px solid #e2e8f0;
}
.loan-compare-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.loan-compare-table tr:hover td { background: #f8fafc; }
.loan-compare-table .rank-1 td { background: #f0fdf4; }
.loan-compare-table .rank-1 td:first-child { font-weight: 700; color: #16a34a; }
.loan-stale { font-size: 0.75rem; color: #f59e0b; }
.loan-disclaimer { font-size: 0.78rem; color: #94a3b8; margin-top: 10px; }

/* ─── Data Warning Box ────────────────────────────────────────────────── */
.data-warning { background:#fef9c3; border:1px solid #fbbf24; border-radius:6px; padding:10px 14px; font-size:13px; color:#92400e; margin:12px 0; }
.loan-compare-btn { background: #0f766e; color: white; border: none; padding: 8px 20px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; margin-top: 8px; }
.loan-compare-btn:hover { background: #0d9488; }

/* ─── Calculator Share Tools ─────────────────────────────────────────── */
.share-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.share-btn {
  min-height: 44px;
  padding: 9px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.share-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.share-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  margin-right: 3px;
  font-weight: 900;
}
.share-whatsapp { color: #047857; border-color: #bbf7d0; background: #f0fdf4; }
.share-twitter { color: #111827; border-color: #d1d5db; background: #f9fafb; }
.share-facebook { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.share-copy { color: #0f766e; border-color: #99f6e4; background: #f0fdfa; }
.share-embed { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.share-download { color: #0f766e; border-color: #99f6e4; background: #ecfeff; }
@media (max-width: 640px) {
  .share-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
