/* GoldBillDoctor stylesheet.
   Light: ivory, espresso and champagne gold. Gold Mode: deep antique gold with bright gold accents. No blue. */
:root {
  --ivory: #F7F3EC;
  --porcelain: #FCFAF6;
  --field: #FFFFFF;
  --linen: #E6DCCB;
  --espresso: #2B2420;
  --taupe: #6B6158;
  --champagne: #B08D57;
  --gold-text: #84642F;
  --gold-hover: #5F4720;
  --gold-light: #D2B482;
  --leaf: #3D6B47;
  --leaf-tint: #E7EFE6;
  --leaf-line: #C8D8C6;
  --garnet: #8E3B3B;
  --garnet-tint: #F6E6E3;
  --garnet-line: #E7C9C3;
  --amber-tint: #F6EEDD;
  --amber-line: #E8D7B4;
  --placeholder: #A39A8F;
  --row-line: rgba(43, 36, 32, .09);
  --bar-bg: rgba(247, 243, 236, .95);
  /* filled controls: buttons, selected chips, current menu item */
  --solid: #2B2420;
  --solid-hover: #1E1916;
  --on-solid: #F7F3EC;
  --on-solid-icon: #D2B482;
  /* logo */
  --logo-top: #F3E9D6;
  --logo-body: #EADBBE;
  --logo-edge: #B08D57;
  --logo-pulse: #84642F;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43, 36, 32, .05), 0 8px 24px rgba(43, 36, 32, .06);
  --sidebar: 264px;
  --display: "Bodoni Moda", "Bodoni 72", Didot, "Libre Bodoni", Georgia, serif;
  --text: "Jost", Futura, "Century Gothic", "Avenir Next", "Trebuchet MS", sans-serif;
}

html[data-mode="gold"] {
  --ivory: #0F0C08;
  --porcelain: #18130C;
  --field: #120E09;
  --linen: #3A2D18;
  --espresso: #F4E9D2;
  --taupe: #C2AE88;
  --champagne: #D4A953;
  --gold-text: #E6C27A;
  --gold-hover: #F5DCA6;
  --gold-light: #EBCB86;
  --leaf: #9FD6A8;
  --leaf-tint: #122015;
  --leaf-line: #2E4A31;
  --garnet: #F0A796;
  --garnet-tint: #26120E;
  --garnet-line: #5A2C22;
  --amber-tint: #22190C;
  --amber-line: #4A3818;
  --placeholder: #857555;
  --row-line: rgba(244, 233, 210, .12);
  --bar-bg: rgba(15, 12, 8, .92);
  --solid: #D4A953;
  --solid-hover: #E6C27A;
  --on-solid: #17110A;
  --on-solid-icon: #17110A;
  --logo-top: #EBCB86;
  --logo-body: #C9993F;
  --logo-edge: #F3D99B;
  --logo-pulse: #FFF1CF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
html[data-mode="gold"] body {
  background:
    radial-gradient(1000px 560px at 88% -10%, rgba(212, 169, 83, .16), transparent 60%),
    radial-gradient(760px 520px at -12% 45%, rgba(201, 153, 63, .09), transparent 60%),
    #0F0C08;
  background-attachment: fixed;
}
html[data-mode="gold"] h1, html[data-mode="gold"] h2, html[data-mode="gold"] .brand-name { color: #F0D9A3; }
html[data-mode="gold"] .panel { background: linear-gradient(180deg, #1D170E, #15110A); border-color: #4A3A1F; }
html[data-mode="gold"] .sidenav, html[data-mode="gold"] footer { background: #130F09; }
html[data-mode="gold"] .verdict h2 { color: inherit; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
@media (min-width: 1024px) { html { scroll-padding-top: 20px; } }
body {
  margin: 0;
  font-family: var(--text);
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--espresso);
  background: var(--ivory);
  transition: background-color .25s, color .25s;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--gold-text); text-underline-offset: 3px; }
a:hover { color: var(--gold-hover); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2.05rem, 7.4vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 4.6vw, 1.95rem); margin-top: 1.6em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--champagne); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--porcelain); padding: 8px 12px; z-index: 100; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--espresso); }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 1.45rem; }
.brand-sub { font-family: var(--text); font-size: 10px; font-weight: 500; letter-spacing: .46em; color: var(--gold-text); margin-top: 4px; }
.lg-top { fill: var(--logo-top); stroke: var(--logo-edge); }
.lg-body { fill: var(--logo-body); stroke: var(--logo-edge); }
.lg-pulse { stroke: var(--logo-pulse); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 66px; padding: 10px 16px;
  background: var(--bar-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--linen);
}
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border: 1px solid var(--linen); border-radius: 999px;
  background: var(--porcelain); color: var(--espresso); cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; }

/* ---------- Side menu ---------- */
.sidenav {
  position: fixed; inset: 0 auto 0 0; z-index: 50;
  width: min(86vw, var(--sidebar));
  background: var(--porcelain); border-right: 1px solid var(--linen);
  transform: translateX(-102%); transition: transform .22s ease, background-color .25s;
  overflow-y: auto; padding: 18px 12px 32px;
}
.sidenav.open { transform: none; box-shadow: 0 0 48px rgba(0, 0, 0, .25); }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(20, 14, 8, .45); }
.sidenav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 14px; border-bottom: 1px solid var(--linen); margin-bottom: 6px; }
.close-btn { width: 48px; height: 48px; border: 0; background: none; color: var(--espresso); cursor: pointer; border-radius: 999px; }
.close-btn svg { width: 22px; height: 22px; margin: auto; }
.nav-group { margin: 16px 0 4px; padding: 0 12px; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--taupe); }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 8px 12px; border-radius: 10px;
  color: var(--espresso); text-decoration: none; font-size: 16.5px;
}
.nav-link svg { width: 20px; height: 20px; color: var(--champagne); flex: none; }
.nav-link:hover { background: var(--amber-tint); color: var(--espresso); }
.nav-link[aria-current="page"] { background: var(--solid); color: var(--on-solid); }
.nav-link[aria-current="page"] svg { color: var(--on-solid-icon); }

/* Gold Mode switch */
.mode-row { margin: 18px 4px 0; padding-top: 14px; border-top: 1px solid var(--linen); }
.mode-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 52px; padding: 8px 10px; border: 1px solid var(--linen); border-radius: 12px;
  background: var(--ivory); color: var(--espresso); cursor: pointer;
  font: 500 16.5px var(--text); text-align: left;
}
.mode-toggle:hover { border-color: var(--champagne); }
.mode-toggle > svg { width: 22px; height: 22px; color: var(--champagne); flex: none; }
.mode-label { flex: 1; white-space: nowrap; }
.mode-label small { display: block; font-size: 13px; font-weight: 400; color: var(--taupe); }
.switch { position: relative; width: 46px; height: 26px; flex: none; border-radius: 999px; background: var(--linen); transition: background .2s; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s;
}
.mode-toggle[aria-checked="true"] .switch { background: var(--champagne); }
.mode-toggle[aria-checked="true"] .switch::after { transform: translateX(20px); background: #2A1D0B; }

@media (min-width: 1024px) {
  .sidenav { transform: none; box-shadow: none; width: var(--sidebar); }
  .sidenav-head .close-btn, .menu-btn, .scrim { display: none !important; }
  .page { margin-left: var(--sidebar); }
  .topbar { display: none; }
}

/* ---------- Layout ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 28px 16px 56px; }
.crumbs { font-size: 14.5px; color: var(--taupe); margin: -8px 0 4px; }
.crumbs a { color: var(--taupe); display: inline-flex; align-items: center; min-height: 44px; }
.lead { font-size: 1.12rem; color: var(--taupe); max-width: 38em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 26px;
  border: 1px solid var(--solid); border-radius: 999px;
  background: var(--solid); color: var(--on-solid);
  font: 500 17.5px var(--text); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--solid-hover); border-color: var(--solid-hover); color: var(--on-solid); }
.btn svg { width: 22px; height: 22px; }
.btn.gold { background: var(--champagne); border-color: var(--champagne); color: #1E1916; }
.btn.gold:hover { background: #9C7C49; }
html[data-mode="gold"] .btn.gold { background: transparent; border-color: var(--champagne); color: var(--gold-text); }
html[data-mode="gold"] .btn.gold:hover { background: var(--amber-tint); }
.btn.ghost { background: transparent; color: var(--espresso); border-color: var(--espresso); }
.btn.ghost:hover { background: var(--amber-tint); color: var(--espresso); }
.btn.small { min-height: 46px; font-size: 16px; padding: 0 18px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Page sections ---------- */
.intro { padding: 8px 0 4px; }
.panel { background: var(--porcelain); border: 1px solid var(--linen); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; margin: 20px 0 8px; }
@media (min-width: 640px) { .panel { padding: 28px; } }
.link-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--linen); }
.link-list li { border-bottom: 1px solid var(--linen); }
.link-list a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; text-decoration: none; color: var(--espresso); min-height: 56px; }
.link-list a:hover .ll-title { color: var(--gold-text); text-decoration: underline; }
.link-list svg { width: 22px; height: 22px; color: var(--champagne); flex: none; }
.ll-title { display: block; font-weight: 500; }
.ll-desc { display: block; font-size: 15px; color: var(--taupe); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--linen); }
.faq details { border-bottom: 1px solid var(--linen); }
.faq summary { cursor: pointer; padding: 14px 2px; font-weight: 500; min-height: 52px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 24px var(--display); color: var(--gold-text); }
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding: 0 2px 16px; color: var(--taupe); }

/* ---------- Form ---------- */
.step-title { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 4px 0 12px; font-size: 1.08rem; }
.step-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--solid); color: var(--on-solid); font: 600 15px var(--display); }
.section { padding: 18px 0; border-top: 1px solid var(--linen); }
.section:first-child { border-top: 0; padding-top: 0; }
.field { margin-bottom: 14px; }
.field > label, .field > .label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 16px; }
.hint { font-size: 14.5px; color: var(--taupe); margin-top: 6px; }
.hint.form-error { color: var(--garnet); font-weight: 500; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .row.stack-sm { grid-template-columns: 1fr; } }
/* ₹ and % sit in their own fixed boxes joined to the field, never inside the typing space. */
.input-wrap { display: flex; align-items: stretch; cursor: text; }
.input-wrap input { flex: 1 1 auto; min-width: 0; }
.input-wrap .prefix, .input-wrap .suffix {
  flex: none; display: flex; align-items: center; justify-content: center;
  min-width: 50px; padding: 0 12px; border: 1px solid var(--linen); background: var(--amber-tint);
  color: var(--gold-text); font: 500 18px var(--text); user-select: none;
}
.input-wrap .prefix { border-right: 0; border-radius: 12px 0 0 12px; }
.input-wrap .suffix { border-left: 0; border-radius: 0 12px 12px 0; font-size: 16px; }
.input-wrap .prefix + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-wrap.has-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-wrap:focus-within .prefix, .input-wrap:focus-within .suffix { border-color: var(--champagne); }
.input-wrap.invalid .prefix, .input-wrap.invalid .suffix { border-color: var(--garnet); }
input[type=number], input[type=text], select {
  width: 100%; min-height: 54px; padding: 0 14px;
  border: 1px solid var(--linen); border-radius: 12px; background: var(--field);
  font: 500 19px var(--text); color: var(--espresso);
  font-variant-numeric: tabular-nums lining-nums;
}
select option { background: var(--field); color: var(--espresso); }
input:focus, select:focus { border-color: var(--champagne); outline: 2px solid rgba(176, 141, 87, .3); outline-offset: 0; }
input::placeholder { color: var(--placeholder); }
input[aria-invalid="true"] { border-color: var(--garnet); outline: 2px solid var(--garnet-line); outline-offset: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border: 1px solid var(--linen); border-radius: 999px; background: var(--field);
  color: var(--espresso); font: 400 16.5px var(--text); cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--champagne); color: var(--espresso); }
.chip[aria-pressed="true"] { background: var(--solid); border-color: var(--solid); color: var(--on-solid); font-weight: 500; }
.chip svg { width: 22px; height: 22px; }
.chip.icon-chip { flex-direction: column; justify-content: center; min-height: 76px; min-width: 76px; padding: 8px 10px; border-radius: 14px; font-size: 14px; gap: 4px; }
.chip.icon-chip svg { width: 28px; height: 28px; color: var(--champagne); }
.chip.icon-chip[aria-pressed="true"] svg { color: var(--on-solid-icon); }
.chip.small-chip { min-height: 40px; font-size: 15px; padding: 0 12px; }

.more-toggle { background: none; border: 0; padding: 8px 0; color: var(--gold-text); font: 500 16px var(--text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }

/* ---------- Result ---------- */
.result { scroll-margin-top: 88px; border-radius: 16px; padding: 22px; margin-top: 8px; border: 1px solid var(--linen); background: var(--field); }
.result.fair { background: var(--leaf-tint); border-color: var(--leaf-line); }
.result.high { background: var(--garnet-tint); border-color: var(--garnet-line); }
.result.slight, .result.low, .result.neutral { background: var(--amber-tint); border-color: var(--amber-line); }
.verdict { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.verdict svg { width: 38px; height: 38px; flex: none; }
.verdict h2 { margin: 0; font-size: clamp(1.5rem, 5vw, 1.95rem); color: inherit; }
.result.fair .verdict { color: var(--leaf); }
.result.high .verdict { color: var(--garnet); }
.result.slight .verdict, .result.low .verdict, .result.neutral .verdict { color: var(--gold-text); }
.result p { margin: 0 0 10px; }
.big-number { font: 600 clamp(2rem, 8vw, 2.6rem) var(--display); color: var(--espresso); font-variant-numeric: lining-nums; }
.breakdown { width: 100%; border-collapse: collapse; margin: 14px 0 4px; font-size: 16.5px; font-variant-numeric: tabular-nums lining-nums; }
.breakdown td { padding: 9px 0; border-bottom: 1px solid var(--row-line); }
.breakdown td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.breakdown tr.total td { font-weight: 600; border-bottom: 0; padding-top: 12px; }
.breakdown tr.sub td { color: var(--taupe); font-size: 15px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.speak-note { font-size: 14.5px; color: var(--taupe); margin-top: 8px; }

.note { padding: 14px 16px; border-left: 3px solid var(--champagne); background: var(--amber-tint); border-radius: 0 12px 12px 0; margin: 16px 0; }
.prose { max-width: 680px; }
.prose li { margin-bottom: .45em; }
.table-scroll { overflow-x: auto; margin: 0 0 1em; }
table.plain { width: 100%; border-collapse: collapse; background: var(--porcelain); border: 1px solid var(--linen); font-variant-numeric: tabular-nums lining-nums; font-size: 16px; }
table.plain th, table.plain td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--linen); vertical-align: top; }
table.plain th { background: var(--amber-tint); font-weight: 500; }

/* ---------- Ads (hidden until AdSense is approved) ---------- */
.ad-slot { margin: 28px 0; }
.ad-slot:empty { display: none; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--linen); background: var(--porcelain); padding: 30px 16px 40px; font-size: 15px; color: var(--taupe); }
footer .inner { max-width: 900px; margin: 0 auto; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 14px; }
footer nav a { color: var(--espresso); min-height: 36px; display: inline-flex; align-items: center; text-decoration: none; }
footer nav a:hover { text-decoration: underline; }
footer p { margin: 0 0 8px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 60; max-width: calc(100vw - 32px);
  background: var(--solid); color: var(--on-solid); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 15.5px;
}
.hidden { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  html[data-mode="gold"] { --ivory: #fff; --porcelain: #fff; --field: #fff; --espresso: #000; --taupe: #333; --linen: #ccc; }
  .topbar, .sidenav, .scrim, footer, .ad-slot, .result-actions, .btn { display: none !important; }
  .page { margin: 0; }
}

/* Number boxes: no up/down arrows (they crowd the field on desktop and nobody steps a gold rate by 1). */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
