/* ============================================================
   Fincal Hub — Premium Black & Gold Design System
   Light + Dark themes via [data-theme] on <html>
   ============================================================ */

:root {
  --gold: #D4AF37;
  --gold-hi: #F2D675;
  --gold-deep: #A67C18;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.18);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --transition: .25s ease;
}

/* ---------- DARK (default) ---------- */
:root, :root[data-theme="dark"] {
  --bg: #0B0B0D;
  --bg-2: #121216;
  --card: #18181D;
  --elev: #202026;
  --border: #2A2A32;
  --text: #F5F5F5;
  --text-2: #B8B8C2;
  --text-3: #7A7A86;
  --gold-contrast: #F2D675;
  --input-bg: #0F0F13;
  --input-border: #2E2E38;
  --success: #4ADE80;
  --danger: #F87171;
  --chip: rgba(212,175,55,.12);
  --hero-grad: radial-gradient(1200px 500px at 80% -10%, rgba(212,175,55,.18), transparent 60%),
               radial-gradient(900px 400px at 10% 0%, rgba(242,214,117,.08), transparent 55%);
}

/* ---------- LIGHT ---------- */
:root[data-theme="light"] {
  --bg: #FAF9F6;
  --bg-2: #F2EFE7;
  --card: #FFFFFF;
  --elev: #FFFFFF;
  --border: #E5E0D2;
  --text: #191919;
  --text-2: #626262;
  --text-3: #8A8A8A;
  --gold: #A67C18;
  --gold-hi: #C99A1E;
  --gold-contrast: #A67C18;
  --input-bg: #FFFFFF;
  --input-border: #D8D2C0;
  --success: #15803D;
  --danger: #B91C1C;
  --chip: rgba(166,124,24,.10);
  --shadow: 0 10px 30px rgba(60,50,20,.10);
  --shadow-sm: 0 2px 10px rgba(60,50,20,.08);
  --hero-grad: radial-gradient(1200px 500px at 80% -10%, rgba(166,124,24,.14), transparent 60%),
               radial-gradient(900px 400px at 10% 0%, rgba(201,154,30,.10), transparent 55%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold-contrast); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
main { flex: 1; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Typography ---------- */
h1,h2,h3,h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.01em; }
.display { font-family: var(--font-display); }
.eyebrow {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-contrast); margin-bottom: 14px;
}
.lead { color: var(--text-2); font-size: 1.06rem; max-width: 62ch; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); font-size: .86rem; }
.gold { color: var(--gold-contrast); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 22px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.18rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  display: grid; place-items: center; color: #0B0B0D; font-weight: 900; font-size: 1.05rem;
  box-shadow: 0 4px 14px rgba(212,175,55,.35);
}
.brand .hub { color: var(--gold-contrast); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--text-2); padding: 8px 13px; border-radius: 8px; font-size: .92rem; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--elev); text-decoration: none; }
.nav-links a.active { color: var(--gold-contrast); background: var(--chip); }

.theme-toggle {
  background: var(--elev); border: 1px solid var(--border); color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; display: grid; place-items: center;
  transition: transform var(--transition), border-color var(--transition); flex: none;
}
.theme-toggle:hover { border-color: var(--gold); transform: translateY(-1px); }
.theme-toggle svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 2; }
:root[data-theme="dark"] .icon-sun { display: block; } :root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; } :root[data-theme="light"] .icon-moon { display: block; }

.menu-btn { display: none; background: none; border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px;
  font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none; font-family: var(--font-sans);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 60%, var(--gold-deep));
  color: #0B0B0D; box-shadow: 0 6px 20px rgba(212,175,55,.30);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(212,175,55,.42); }
.btn-ghost { background: var(--elev); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--gold); }
.btn-sm { padding: 8px 14px; font-size: .85rem; border-radius: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; background: var(--hero-grad); position: relative; overflow: hidden; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); max-width: 16ch; margin-bottom: 18px; }
.hero h1 .accent {
  background: linear-gradient(120deg, var(--gold-hi), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 34px; margin-top: 44px; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 1.7rem; font-family: var(--font-display); color: var(--gold-contrast); }
.hero-stats .stat span { font-size: .82rem; color: var(--text-2); }

/* ---------- Search ---------- */
.search-wrap { position: relative; max-width: 560px; margin-top: 30px; }
.search-wrap input {
  width: 100%; padding: 15px 18px 15px 46px; border-radius: 12px; border: 1px solid var(--input-border);
  background: var(--input-bg); color: var(--text); font-size: 1rem; font-family: var(--font-sans);
}
.search-wrap input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--chip); }
.search-wrap .s-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
  max-height: 340px; overflow-y: auto; z-index: 40; display: none;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 12px 16px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--elev); text-decoration: none; }
.search-results .cat { font-size: .72rem; color: var(--gold-contrast); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.section-head p { color: var(--text-2); max-width: 55ch; margin-top: 8px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow-sm); }
.card .icon-tile {
  width: 46px; height: 46px; border-radius: 12px; background: var(--chip); color: var(--gold-contrast);
  display: grid; place-items: center; margin-bottom: 16px; font-size: 1.3rem;
}
.card h3 { font-size: 1.12rem; margin-bottom: 8px; font-family: var(--font-sans); font-weight: 700; letter-spacing: 0; }
.card p { color: var(--text-2); font-size: .9rem; flex: 1; }
.card .card-link { margin-top: 16px; font-weight: 600; font-size: .88rem; color: var(--gold-contrast); display: inline-flex; align-items: center; gap: 6px; }
.badge-new {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: #0B0B0D; padding: 3px 8px; border-radius: 20px; margin-left: 8px; vertical-align: middle;
}

/* ---------- Category chips ---------- */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.chip {
  padding: 8px 16px; border-radius: 30px; background: var(--elev); border: 1px solid var(--border);
  color: var(--text-2); font-size: .86rem; font-weight: 500;
}
.chip:hover { border-color: var(--gold); color: var(--gold-contrast); text-decoration: none; }

/* ---------- Calculator layout ---------- */
.calc-hero { padding: 40px 0 24px; }
.calc-hero h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 10px; }
.breadcrumb { font-size: .82rem; color: var(--text-3); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-2); }
.calc-layout { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; padding-bottom: 40px; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.panel h2 { font-size: 1.05rem; margin-bottom: 18px; font-family: var(--font-sans); font-weight: 700; letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.panel h2::before { content: ""; width: 4px; height: 18px; background: linear-gradient(var(--gold-hi), var(--gold-deep)); border-radius: 2px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.field .hint { font-weight: 400; color: var(--text-3); font-size: .76rem; margin-left: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--input-border);
  background: var(--input-bg); color: var(--text); font-size: .95rem; font-family: var(--font-sans);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--chip); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--gold); }
.range-val { font-weight: 700; color: var(--gold-contrast); min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Results ---------- */
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.result-tile {
  background: var(--elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px;
}
.result-tile .lbl { font-size: .74rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.result-tile .val { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.result-tile.highlight { border-color: var(--gold); background: var(--chip); }
.result-tile.highlight .val { color: var(--gold-contrast); }
.result-tile .sub { font-size: .76rem; color: var(--text-3); margin-top: 4px; }

.chart-box { background: var(--elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 20px; }
.chart-box h3 { font-size: .9rem; color: var(--text-2); margin-bottom: 12px; font-family: var(--font-sans); font-weight: 600; }
.chart-box svg { width: 100%; height: auto; display: block; }

table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th, table.data td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { color: var(--text-2); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--elev); position: sticky; top: 0; }
.table-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.compare .col { background: var(--elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.compare .col.win { border-color: var(--success); }
.compare .col h4 { font-size: .85rem; color: var(--text-2); margin-bottom: 8px; font-family: var(--font-sans); font-weight: 600; }
.compare .col .big { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.assumption {
  margin-top: 18px; padding: 14px 16px; border-left: 3px solid var(--gold); background: var(--chip);
  border-radius: 0 8px 8px 0; font-size: .84rem; color: var(--text-2);
}
.assumption b { color: var(--text); }

/* ---------- Ad slots (placeholders, clearly labelled) ---------- */
.ad-slot {
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-2);
  color: var(--text-3); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  display: grid; place-items: center; text-align: center; padding: 10px; min-height: 60px;
}
.ad-slot.leaderboard { min-height: 100px; margin: 26px 0; }
.ad-slot.sidebar { min-height: 250px; margin-top: 18px; }
.ad-label { font-weight: 700; }

/* ---------- Article / prose ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.5rem; margin: 34px 0 14px; }
.prose h3 { font-size: 1.18rem; margin: 26px 0 10px; font-family: var(--font-sans); }
.prose p { margin-bottom: 16px; color: var(--text-2); }
.prose ul, .prose ol { margin: 0 0 16px 22px; color: var(--text-2); }
.prose li { margin-bottom: 8px; }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .9rem; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; }
.prose th { background: var(--elev); }
.callout {
  background: var(--chip); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 16px 18px; margin: 20px 0; font-size: .92rem; color: var(--text-2);
}
.faq details { border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; background: var(--card); }
.faq summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq details[open] summary { color: var(--gold-contrast); margin-bottom: 10px; }
.faq p { color: var(--text-2); font-size: .92rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--border); padding: 50px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 14px; font-family: var(--font-sans); }
.footer-grid a { display: block; color: var(--text-2); font-size: .88rem; padding: 4px 0; }
.footer-grid a:hover { color: var(--gold-contrast); text-decoration: none; }
.footer-brand p { color: var(--text-2); font-size: .88rem; margin-top: 12px; max-width: 34ch; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }

/* ---------- Trust strip ---------- */
.trust-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 30px 0; }
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item .ic { width: 42px; height: 42px; flex: none; border-radius: 10px; background: var(--chip); color: var(--gold-contrast); display: grid; place-items: center; font-size: 1.1rem; }
.trust-item b { display: block; font-size: .95rem; margin-bottom: 3px; }
.trust-item span { font-size: .84rem; color: var(--text-2); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .calc-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trust-strip { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 14px 22px; gap: 6px; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .menu-btn { display: grid; place-items: center; margin-left: auto; }
  .theme-toggle { margin-left: 0; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 36px; }
}

/* print-friendly */
@media print { .site-header, .site-footer, .ad-slot, .theme-toggle, .menu-btn { display: none; } body { background: #fff; color: #000; } }

/* ---- calc action buttons (PDF / WhatsApp) ---- */
.calc-actions{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0 4px;}
.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 18px;border-radius:8px;font-size:.9rem;font-weight:600;cursor:pointer;text-decoration:none;border:1px solid var(--gold);background:transparent;color:var(--gold);transition:.2s;}
.btn:hover{background:var(--gold);color:#0B0B0D;}
.btn-pdf{background:var(--gold);color:#0B0B0D;}
.btn-pdf:hover{background:var(--gold-hi);}
.btn-whatsapp{border-color:#25D366;color:#25D366;}
.btn-whatsapp:hover{background:#25D366;color:#fff;}
/* ---- print (Save as PDF) ---- */
@media print{
  .no-print, header.site-header, .site-footer, .ad-slot, .breadcrumb, .search-box, .theme-toggle, #menu-btn, .calc-actions, .prose, .faq{display:none !important;}
  body{background:#fff !important;color:#111 !important;}
  .container{max-width:100% !important;padding:0 !important;}
  .calc-layout{display:block !important;gap:0 !important;}
  .panel{border:1px solid #bbb !important;box-shadow:none !important;break-inside:avoid;margin-bottom:14px;}
  .result-tile{border:1px solid #ddd !important;}
  a{color:#111 !important;text-decoration:none !important;}
  h1{font-size:18pt !important;}
  .assumption{font-size:9pt;color:#444 !important;}
  svg{max-width:100% !important;}
}

/* ---- PART B: Mobile horizontal-scroll fix (360/390px) ---- */
.calc-layout > * { min-width: 0; max-width: 100%; }
.panel { min-width: 0; overflow: hidden; }
.panel > * { max-width: 100%; }
#calc-form, #calc-form input, #calc-form select, #calc-form textarea { max-width: 100%; box-sizing: border-box; }
#calc-form input, #calc-form select { width: 100%; }
.field-row { min-width: 0; }
.field-row > * { min-width: 0; }
.result-grid { min-width: 0; }
.result-tile { min-width: 0; overflow: hidden; word-break: break-word; }
/* tables scroll inside their own box */
.table-scroll, .panel .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
.prose table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; max-width: 100%; }
.compare { min-width: 0; }
.compare > * { min-width: 0; overflow: hidden; }
/* safety net */
html, body { overflow-x: hidden; max-width: 100%; }
.container { max-width: 100%; overflow-x: hidden; }
@media (max-width: 560px) {
  .panel { padding: 16px 14px; }
  .range-val { min-width: 60px; font-size: .8rem; }
}

/* ============================================================
   v5: Header re-layout, dropdown fix, font + theme polish
   ============================================================ */

/* --- Header (unified fix): desktop = brand left + nav inline + controls right (no overlap); mobile = burger left + logo center + theme+lang right --- */
.site-header { z-index: 900 !important; overflow: visible !important; }
.nav-inner { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 14px; height: 64px; }
.site-header .brand { position: static; order: 0; flex: none; transform: none; margin: 0; }
.menu-btn { order: 1; flex: none; margin-left: 0; }
.nav-links { order: 2; margin-left: auto; }
.theme-toggle { order: 3; flex: none; margin-left: 6px; }
.lang-switch { order: 4; flex: none; margin-left: 4px; }
/* Desktop (>=901px): hide burger, keep nav inline. Brand stays left — absolute centering removed (it caused overlap with nav) */
@media (min-width: 901px) {
  .menu-btn { display: none !important; }
  .nav-links { display: flex; margin-left: auto; }
}
/* Mobile (<=900px): burger LEFT, logo truly CENTERED, theme + language RIGHT; nav links hidden until burger tapped */
@media (max-width: 900px) {
  .nav-inner { gap: 8px; }
  .menu-btn { display: grid; place-items: center; order: 0; margin-left: 0 !important; width: 36px; height: 36px; }
  .site-header .brand { position: absolute; left: 50%; transform: translateX(-50%); z-index: 2; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; gap: 7px; }
  .site-header .brand-mark { width: 30px; height: 30px; font-size: .88rem; flex: none; }
  .nav-links { display: none; order: 5; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 14px 22px; gap: 6px; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; }
  .theme-toggle { order: 3; margin-left: auto; width: 36px; height: 36px; }
  .lang-switch { order: 4; }
  .lang-btn { padding: 5px 6px; gap: 4px; }
  .lang-current { min-width: 18px; font-size: 11px; }
}
/* Phones & small tablets: hide the "EN" label, keep globe + chevron so the language button never crowds the centered logo */
@media (max-width: 600px) {
  .site-header .brand { font-size: 1rem; max-width: 44%; }
  .lang-current { display: none; }
  .lang-btn { padding: 5px 6px; }
}
/* Very small phones (<=380px): most compact — globe icon only */
@media (max-width: 380px) {
  .site-header .brand { font-size: .88rem; max-width: 40%; gap: 6px; }
  .site-header .brand-mark { width: 28px; height: 28px; font-size: .82rem; }
  .theme-toggle, .menu-btn { width: 32px; height: 32px; }
  .lang-btn { padding: 4px 5px; }
  .lang-btn svg:last-child { display: none; }
}

/* --- Language dropdown: fix z-index / behind-content bug --- */
.lang-switch { position: relative !important; z-index: 9999 !important; }
.lang-dropdown {
  z-index: 999999 !important;
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 10px) !important;
  min-width: 210px !important;
  display: block !important;
  box-shadow: 0 16px 40px rgba(0,0,0,.25) !important;
}
.lang-dropdown[hidden] { display: none !important; }
.lang-btn { position: relative; z-index: 1000000; }

/* --- Font: Inter throughout (drop generic serif headings) --- */
:root { --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
h1, h2, h3, h4, .display, .hero-stats .stat b {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  letter-spacing: -0.03em;
  font-weight: 800;
}
h1 { font-weight: 900; letter-spacing: -0.04em; }
h2 { font-weight: 800; }
h3 { font-weight: 700; }
body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.result-tile .val, .hero-stats b { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* --- Theme polish: refined shadows, hover, focus --- */
.site-header { box-shadow: 0 1px 0 var(--border), 0 8px 24px -12px rgba(0,0,0,.15); }
.card { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -10px rgba(0,0,0,.22); border-color: var(--gold); }
.panel { box-shadow: 0 4px 24px -8px rgba(0,0,0,.12); border-radius: 16px; }
.btn { transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -4px rgba(212,175,55,.4); }
input:focus, select:focus { outline: none; border-color: var(--gold) !important; box-shadow: 0 0 0 3px rgba(212,175,55,.18); }
.brand-mark { box-shadow: 0 4px 14px rgba(212,175,55,.4), inset 0 1px 0 rgba(255,255,255,.25); }
.hero h1 .accent { background: linear-gradient(120deg, var(--gold-hi), var(--gold-contrast)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ============================================================
   v6: Header overlap fix + dropdown z-index fix + theme polish
   ============================================================ */

/* (v6 header overlap rules removed — superseded by the unified header block above) */

/* --- Dropdown: kill backdrop-filter clipping + max z-index --- */
.site-header { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: var(--bg) !important; z-index: 2147483647 !important; overflow: visible !important; }
.nav-inner { overflow: visible !important; }
.lang-switch { overflow: visible !important; }
.lang-dropdown { z-index: 2147483647 !important; position: absolute !important; right: 0 !important; top: calc(100% + 10px) !important; display: block !important; }
.lang-dropdown[hidden] { display: none !important; }
main, .hero { position: relative; z-index: 0; }

/* --- Theme polish: richer dark, refined gold, depth --- */
:root { --gold: #E9C46A; --gold-hi: #F4D58D; --gold-deep: #C9A227; --gold-contrast: #E9C46A; }
:root[data-theme="dark"] { --bg: #0C0F14; --bg-2: #12161D; --card: #161B23; --elev: #1A2029; --border: #262D38; }
.panel { border: 1px solid var(--border); background: var(--card); }
.card { background: var(--card); border: 1px solid var(--border); }
.hero { background: radial-gradient(ellipse at top, rgba(233,196,106,.08), transparent 60%), var(--bg-2) !important; }
.btn-pdf { background: linear-gradient(135deg, var(--gold-hi), var(--gold)); color: #0C0F14; font-weight: 700; }
.result-tile { border: 1px solid var(--border); background: var(--elev); }
.result-tile.hl { border-color: var(--gold); background: linear-gradient(135deg, rgba(233,196,106,.12), var(--elev)); }
