/* =====================================================================
   style.css: Horogle theme (light + dark), print-ready
   Premium editorial look: midnight navy + champagne gold, serif display.
   Change brand colours in :root below.
   ===================================================================== */
:root {
  --brand-1: #0e1430;          /* midnight navy */
  --brand-2: #1c2550;          /* deep indigo */
  --gold: #c9a24b;             /* champagne gold */
  --gold-dark: color-mix(in srgb, var(--gold) 72%, #000);
  --gold-soft: color-mix(in srgb, var(--gold) 35%, #fff);
  --accent: #2f3d8f;           /* indigo for active states */
  --bg: #f7f5f0;               /* warm ivory */
  --surface: #ffffff;
  --surface-2: #f2efe8;
  --text: #141a2e;
  --text-2: #5b6175;
  --border: rgba(20, 26, 46, 0.10);
  --shadow: 0 1px 2px rgba(14, 20, 48, .04), 0 8px 28px rgba(14, 20, 48, .06);
  /* status (fixed; always shown with icon + label) */
  --good: #1f9d55; --good-text: #12713b;
  --warning: #e0a526;
  --serious: #e7864f;
  --critical: #d14343;
  --radius: 14px;
  --header-h: 64px;
  --serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: color-mix(in srgb, var(--brand-1) 72%, #000);
  --surface: color-mix(in srgb, var(--brand-1) 88%, #fff 4%);
  --surface-2: color-mix(in srgb, var(--brand-2) 55%, var(--brand-1));
  --text: #eef0f7;
  --text-2: #a9afc4;
  --accent: color-mix(in srgb, var(--gold) 70%, #fff);
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --good-text: #5fd38d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 60px); }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, .stat .v, .ring b, .trust b, .logo, .loshu > div { font-variant-numeric: lining-nums tabular-nums; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5rem; letter-spacing: .005em; }
h3 { font-size: 1.5rem; }
h4 { font-size: .95rem; font-weight: 600; line-height: 1.3; margin: 0 0 .5rem; letter-spacing: .01em; }
p { margin: 0 0 .8rem; }
a { color: var(--accent); }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
::selection { background: var(--gold); color: var(--brand-1); }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); display: flex; align-items: center;
  background: color-mix(in srgb, var(--brand-1) 92%, transparent); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 20%, transparent); color: #fff; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.6rem; font-weight: 700;
  color: inherit; text-decoration: none; letter-spacing: .02em; }
.logo-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--brand-1);
  background: radial-gradient(circle at 35% 30%, var(--gold-soft), var(--gold) 60%, var(--gold-dark));
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700; box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 0 18px color-mix(in srgb, var(--gold) 40%, transparent); }
.top-actions { display: flex; gap: 8px; }
.icon-btn { background: transparent; border: 1px solid rgba(255,255,255,.22); color: #e8eaf3; border-radius: 8px;
  padding: 7px 14px; cursor: pointer; font: inherit; font-size: .82rem; font-weight: 500; transition: .2s; }
.icon-btn:hover { border-color: rgba(255,255,255,.5); color: #fff; }
.icon-btn-gold { background: var(--gold); border-color: var(--gold); color: var(--brand-1); font-weight: 600; }
.icon-btn-gold:hover { filter: brightness(1.08); color: var(--brand-1); }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; color: #fff; padding: 56px 0 110px;
  background:
    radial-gradient(1px 1px at 12% 22%, #fff9 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 68%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 48% 18%, #fffa 50%, transparent 51%),
    radial-gradient(1px 1px at 62% 82%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 30%, #fff8 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 78%, #fff8 50%, transparent 51%),
    radial-gradient(60% 80% at 80% 40%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 70%),
    linear-gradient(160deg, var(--brand-1) 0%, var(--brand-2) 55%, var(--brand-1) 100%); }
.hero-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); padding: 6px 12px; border-radius: 999px; }
.hero-text h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 600; margin: 18px 0 14px; }
.hero-text h1 span { color: var(--gold); font-style: italic; }
.hero-text p { color: #c9cde0; max-width: 560px; font-size: 1.02rem; }
.trust { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 28px; }
.trust li { display: flex; flex-direction: column; padding-left: 14px; border-left: 2px solid var(--gold); }
.trust b { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.trust span { font-size: .78rem; color: #a9afc8; }
.hero-art { display: grid; place-items: center; }
.wheel { width: 100%; max-width: 340px; }
.wheel .w-ring { fill: none; stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: 1.2; }
.wheel .w-ring.thin { stroke: color-mix(in srgb, var(--gold) 25%, transparent); stroke-width: 1; }
.wheel .w-ticks line { stroke: color-mix(in srgb, var(--gold) 45%, transparent); stroke-width: 1; }
.wheel .w-signs .ws > g { fill: none; stroke: var(--gold-soft); stroke-width: 4.6; stroke-linecap: round; stroke-linejoin: round; }
.wheel .w-signs.indian .ws > g { stroke-width: 4; }
.wheel .w-signs .ws .f { fill: var(--gold-soft); stroke: none; }
.wheel .w-signs .ws .t { stroke: var(--gold); }
.wheel .w-signs .ws-hi { fill: var(--gold); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold) 70%, transparent)); }
.wheel .w-signs .ws.mine > g { stroke: var(--brand-1); } .wheel .w-signs .ws.mine .f { fill: var(--brand-1); }
.wheel .w-stars circle { fill: #fff; opacity: .75; }
.wheel .w-sun { fill: var(--gold); filter: drop-shadow(0 0 14px var(--gold)); }
.wheel-spin { transform-origin: 200px 200px; animation: spin 140s linear infinite; }
@media (prefers-reduced-motion: reduce) { .wheel-spin { animation: none; } }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { display: none; } .hero { padding: 40px 0 96px; } }

/* ---------------------------------------------------------------- cards & form */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.form-card { margin-top: -72px; position: relative; z-index: 35; /* above the sticky tab menu so the city list is never hidden */ padding: 28px 30px; border-top: 3px solid var(--gold); }
.form-head { margin-bottom: 18px; }
.form-head h2 { font-size: 1.75rem; margin-bottom: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 18px; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 900px) { .form-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span-2 { grid-column: span 1; } }
label { display: block; font-size: .74rem; font-weight: 600; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .07em; }
input, select { width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
[data-theme="dark"] input, [data-theme="dark"] select { background: var(--surface-2); }
input:hover, select:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
input[type=file] { padding: 8px; }
input[type=file]::file-selector-button { border: 0; background: var(--surface-2); color: var(--text); padding: 6px 12px;
  border-radius: 6px; margin-right: 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.form-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 20px; }
.btn { border: 0; border-radius: 8px; padding: 12px 24px; font: inherit; font-weight: 600; cursor: pointer; transition: .2s; letter-spacing: .01em; }
.btn-primary { background: var(--brand-1); color: var(--gold-soft); box-shadow: 0 6px 18px rgba(14,20,48,.22); padding: 13px 28px; }
.btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); }
[data-theme="dark"] .btn-primary { background: var(--gold); color: var(--brand-1); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold); }
.face-input { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.face-input input[type=file] { flex: 1; min-width: 200px; }
#camBox { margin-top: 10px; }
#camBox video { width: 100%; max-width: 360px; border-radius: 10px; display: block; }

/* ---------------------------------------------------------------- tabs (sticky underline nav) */
.tabs { position: sticky; top: var(--header-h); z-index: 30; display: flex; gap: 2px; overflow-x: auto; margin: 30px 0 22px;
  padding: 0 4px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; border: 0; background: none; color: var(--text-2); padding: 14px 16px 13px; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 600; border-bottom-color: var(--gold); }
.subtabs { display: inline-flex; gap: 2px; flex-wrap: wrap; margin-bottom: 18px; padding: 4px; background: var(--surface-2); border-radius: 10px; }
.subtab { border: 0; background: transparent; color: var(--text-2); padding: 7px 16px; border-radius: 7px; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 500; }
.subtab:hover { color: var(--text); }
.subtab.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(14,20,48,.12); }
.panel { display: none; animation: fade .3s ease; }
.panel.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- layout helpers */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 18px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card h4 { margin-top: 8px; padding-top: 4px; }
.card h4[style*="margin-top"] { padding-top: 14px; border-top: 1px solid var(--border); }

/* stat tiles */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; position: relative; overflow: hidden; transition: .2s; }
.stat:hover { border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); }
.stat .k { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--gold-dark); font-weight: 600; }
[data-theme="dark"] .stat .k, [data-theme="dark"] .si-chart .pl { color: var(--gold); }
.stat .v { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; margin-top: 2px; line-height: 1.25; }
.stat .s { font-size: .82rem; color: var(--text-2); }

/* rating */
.stars { color: var(--gold); letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: color-mix(in srgb, var(--text) 14%, transparent); }
.area-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .area-row { grid-template-columns: repeat(2, 1fr); } }
.area { background: var(--surface-2); border-radius: 10px; padding: 14px 12px; text-align: center; }
.area .name { font-size: .78rem; font-weight: 600; color: var(--text-2); letter-spacing: .03em; }
.meter { height: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }

/* callouts */
.note { border-radius: 10px; padding: 13px 16px; display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; border-left: 3px solid transparent; }
.note ul { padding-left: 0 !important; }
.note.good { background: color-mix(in srgb, var(--good) 8%, var(--surface)); border-left-color: var(--good); }
.note.warn { background: color-mix(in srgb, var(--warning) 12%, var(--surface)); border-left-color: var(--warning); }
.note.bad { background: color-mix(in srgb, var(--critical) 8%, var(--surface)); border-left-color: var(--critical); }
.note.info { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-left-color: var(--accent); }
.badge { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-text); }
.badge.mid { background: color-mix(in srgb, var(--warning) 20%, transparent); color: var(--text); }
.badge.slow { background: color-mix(in srgb, var(--serious) 20%, transparent); color: var(--text); }
.badge.bad { background: color-mix(in srgb, var(--critical) 14%, transparent); color: var(--critical); }
.badge.now { background: var(--critical); color: #fff; }
.badge.gold { background: color-mix(in srgb, var(--gold) 25%, transparent); color: var(--text); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2);
  background: var(--surface-2); padding: 10px 14px; font-weight: 600; }
table.data td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--gold) 6%, transparent); }
table.data tr.current td { background: color-mix(in srgb, var(--gold) 14%, transparent); font-weight: 600; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .hd { text-align: center; font-size: .7rem; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .08em; padding-bottom: 4px; }
.cal .day { border-radius: 8px; padding: 8px 8px; min-height: 62px; font-size: .8rem; position: relative; border: 1px solid var(--border); background: var(--surface); transition: .15s; }
.cal .day:hover { border-color: var(--gold); }
.cal .day b { display: block; font-size: .95rem; }
.cal .day.good { box-shadow: inset 3px 0 0 var(--good); }
.cal .day.mid { box-shadow: inset 3px 0 0 var(--warning); }
.cal .day.slow { box-shadow: inset 3px 0 0 var(--serious); }
.cal .day.bad { box-shadow: inset 3px 0 0 var(--critical); background: color-mix(in srgb, var(--critical) 6%, var(--surface)); }
.cal .day.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; }

/* timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding: 6px 0 14px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 12px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--text-2); }
.tl-item.current::before { background: var(--gold); border-color: var(--gold-dark); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
.tl-item.past { opacity: .55; }

/* dasha bar */
.dasha-bar { display: flex; height: 34px; border-radius: 8px; overflow: hidden; gap: 2px; margin: 10px 0 4px; }
.dasha-bar > div { display: grid; place-items: center; font-size: .72rem; color: #fff; font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; }
.dasha-bar > div.cur { outline: 3px solid var(--gold); outline-offset: -3px; }

/* south indian chart */
.si-chart { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); aspect-ratio: 1;
  border: 1.5px solid var(--gold-dark); border-radius: 8px; overflow: hidden; max-width: 440px; background: var(--surface); }
.si-chart > div { border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--border)); padding: 6px; font-size: .8rem; }
.si-chart .sign { font-size: .62rem; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; }
.si-chart .pl { font-weight: 700; color: var(--brand-2); }
[data-theme="dark"] .si-chart .pl { color: var(--gold); }
.si-chart .asc { color: var(--critical); font-weight: 700; }
.si-chart .center { grid-column: 2 / span 2; grid-row: 2 / span 2; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, var(--brand-2), var(--brand-1)); color: var(--gold-soft); font-family: var(--serif); font-size: 1.1rem; }

/* lo shu */
.loshu { display: grid; grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(3, 64px); gap: 4px; }
.loshu > div { display: grid; place-items: center; border-radius: 8px; font-family: var(--serif); font-size: 1.4rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border); }
.loshu > div.empty { color: var(--text-2); font-family: inherit; font-weight: 400; font-size: .8rem; }

/* score ring */
.ring { --p: 50; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), color-mix(in srgb, var(--text) 8%, transparent) 0); }
.ring > div { width: 130px; height: 130px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; align-content: center; text-align: center; }
.ring b { font-family: var(--serif); font-size: 2.3rem; font-weight: 600; display: block; line-height: 1; }

/* face */
#faceCanvas { width: 100%; border-radius: 10px; }
.trait-list { list-style: none; padding: 0; margin: 0; }
.trait-list li { padding: 9px 0 9px 28px; border-bottom: 1px solid var(--border); position: relative; }
.trait-list li::before { content: "✦"; position: absolute; left: 6px; color: var(--gold); }

/* empty state + footer */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty-state .big { font-size: 2.6rem; opacity: .85; }
.empty-state h3 { color: var(--text); }
.site-footer { margin-top: 56px; background: var(--brand-1); color: #a9afc8; font-size: .86rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 36px; padding-top: 44px; padding-bottom: 30px; }
.footer-grid .logo { color: #fff; margin-bottom: 10px; }
.footer-grid h5 { color: var(--gold); font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; margin: 6px 0 10px; }
.footer-base { border-top: 1px solid rgba(255,255,255,.08); padding-top: 16px; padding-bottom: 22px; font-size: .78rem; color: #7d84a3; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- print / PDF report */
@media print {
  /* Panels fade in with an animation; in print the animation never runs, so hidden tabs would stay at opacity 0 (blank pages). */
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* Always print in light colours, even in dark mode or a dark palette, and keep rings/meters/badges coloured */
  html:root, html[data-theme="dark"], html[data-theme="dark"][data-palette] { --bg: #fff; --surface: #fff; --surface-2: #f5f3ee; --text: #141a2e; --text-2: #555b6e; --border: #dcd8cf; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .btn, details > summary::after { display: none !important; }
  .site-header, .hero, .form-card, .tabs, .subtabs, .no-print, .site-footer .footer-grid { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .site-footer { background: none; color: #555; margin-top: 20px; }
  .panel, .subpanel { display: block !important; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  .print-title { display: block !important; }
  .panel { page-break-before: always; }
  #p-overview { page-break-before: auto !important; }
}
.print-title { display: none; }

/* sub-panels inside a tab */
.subpanel { display: none; }
.subpanel.active { display: block; animation: fade .25s ease; }
@media print { .subpanel { display: block !important; margin-bottom: 18px; } }

/* small screens */
@media (max-width: 560px) {
  :root { --header-h: 56px; }
  .wrap { padding: 0 16px; }
  .card { padding: 20px; }
  .form-card { padding: 22px 18px; }
  .logo { font-size: 1.3rem; } .logo-mark { width: 30px; height: 30px; font-size: 1rem; }
  .icon-btn { padding: 6px 10px; font-size: .74rem; white-space: nowrap; }
  #printBtn { font-size: 0; } #printBtn::after { content: "PDF"; font-size: .74rem; }
  .trust { gap: 18px; }
  .eyebrow { font-size: .6rem; letter-spacing: .1em; }
}


/* ---------------------------------------------------------------- colour palettes (pick in the Theme menu) */
[data-palette="saffron"]  { --brand-1: #3d0c11; --brand-2: #6b1420; --gold: #e0a43a; --accent: #8a1c2b; --bg: #faf6f0; --surface-2: #f5ede3; }
[data-palette="emerald"]  { --brand-1: #0b2b26; --brand-2: #134e45; --gold: #d4af37; --accent: #1d6b5f; --bg: #f5f7f3; --surface-2: #ecf1ea; }
[data-palette="violet"]   { --brand-1: #1a1033; --brand-2: #3a1f6e; --gold: #e9b949; --accent: #6d4bd8; --bg: #f7f5fb; --surface-2: #efebf8; }
[data-palette="sapphire"] { --brand-1: #0a2540; --brand-2: #0f4c81; --gold: #f2c14e; --accent: #0f6bb5; --bg: #f4f7fb; --surface-2: #e9f0f8; }
[data-palette="rose"]     { --brand-1: #3b1d2e; --brand-2: #6d2e4f; --gold: #e7b27a; --accent: #b0476f; --bg: #fbf5f6; --surface-2: #f6ebee; }
/* dark mode must win over each palette's light background */
[data-theme="dark"][data-palette] { --bg: color-mix(in srgb, var(--brand-1) 72%, #000); --surface-2: color-mix(in srgb, var(--brand-2) 55%, var(--brand-1));
  --accent: color-mix(in srgb, var(--gold) 70%, #fff); }

/* theme menu */
.theme-menu { position: relative; }
.icon-btn .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px;
  background: linear-gradient(135deg, var(--brand-2) 50%, var(--gold) 50%); box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.theme-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 240px; padding: 14px; z-index: 60; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.pop-title { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin-bottom: 8px; }
.swatch-list { display: grid; gap: 2px; }
.swatch-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; text-align: left; }
.swatch-list button:hover { background: var(--surface-2); }
.swatch-list button.on { background: var(--surface-2); font-weight: 600; }
.swatch-list button.on::after { content: "✓"; margin-left: auto; color: var(--gold-dark); }
.swatch-list i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.switch { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 10px 10px 2px; border-top: 1px solid var(--border);
  text-transform: none; letter-spacing: 0; font-size: .88rem; font-weight: 500; color: var(--text); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: color-mix(in srgb, var(--text) 20%, transparent); position: relative; transition: .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }

/* yearly month cards */
.month-card { border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; background: var(--surface); overflow: hidden; }
.month-card summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; cursor: pointer; transition: background .15s; }
.month-card summary::-webkit-details-marker { display: none; }
.month-card summary:hover { background: var(--surface-2); }
.month-card summary::after { content: "⌄"; font-size: 1.2rem; color: var(--text-2); transition: transform .2s; line-height: 1; }
.month-card[open] summary::after { transform: rotate(180deg); }
.month-card[open] summary { border-bottom: 1px solid var(--border); }
.mc-name { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; flex: 1; }
.mc-name .badge { font-family: Inter, system-ui, sans-serif; vertical-align: middle; margin-left: 6px; }
.mc-meta { display: flex; align-items: center; gap: 12px; }
.mc-body { padding: 16px 18px 6px; }
.mc-areas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
@media (max-width: 640px) { .mc-areas { grid-template-columns: 1fr; } }
.mc-area { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.mc-area-h { font-weight: 600; font-size: .88rem; margin-bottom: 4px; display: flex; gap: 8px; align-items: center; }
.mc-area p { margin: 0; font-size: .88rem; color: var(--text-2); }

/* lucky guide */
.compass { width: 100%; max-width: 300px; display: block; margin: 0 auto; }
.compass .c-ring { fill: none; stroke: color-mix(in srgb, var(--gold) 45%, var(--border)); stroke-width: 1.5; }
.compass .c-ring.thin { stroke-dasharray: 3 4; stroke-width: 1; }
.compass .c-rays line { stroke: var(--border); stroke-width: 1; }
.compass .c-hub { fill: var(--gold); }
.compass .c-pt circle { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; }
.compass .c-pt text { font: 600 12px Inter, system-ui, sans-serif; fill: var(--text-2); text-anchor: middle; dominant-baseline: central; }
.compass .c-best circle { fill: var(--gold); stroke: var(--gold-dark); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--gold) 60%, transparent)); }
.compass .c-best text { fill: var(--brand-1); font-size: 14px; }
.compass .c-good circle { fill: color-mix(in srgb, var(--gold) 40%, var(--surface)); stroke: var(--gold); }
.compass .c-good text { fill: var(--text); }
.compass .c-avoid circle { fill: color-mix(in srgb, var(--critical) 18%, var(--surface)); stroke: var(--critical); }
.compass .c-avoid text { fill: var(--critical); }
.partner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.partner b { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; }
.p-rank { font-size: 1.6rem; line-height: 1; }
.syllables { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.syllables span { min-width: 64px; text-align: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600; background: var(--surface-2); }
.syllables span.on { background: var(--gold); color: var(--brand-1); border-color: var(--gold-dark); }
@media print { .month-card { break-inside: avoid; } .month-card .mc-body { display: block !important; } }


/* do's & don'ts */
.dodont { margin: 16px 0; }
.dd { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--border); }
.dd.do { background: color-mix(in srgb, var(--good) 7%, var(--surface)); border-top: 3px solid var(--good); }
.dd.dont { background: color-mix(in srgb, var(--critical) 6%, var(--surface)); border-top: 3px solid var(--critical); }
.dd-h { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.dd ul { margin: 0; padding-left: 20px; }
.dd li { margin: 5px 0; font-size: .92rem; }
.dd li::marker { color: var(--text-2); }

/* prediction basis switch (Moon sign / Sun sign) */
.basis-bar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: -8px 0 18px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.basis-label { font-weight: 600; font-size: .88rem; }
.basis-seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: 10px; }
.basis-btn { border: 0; background: transparent; color: var(--text-2); padding: 7px 12px; border-radius: 8px; cursor: pointer;
  font: inherit; font-size: .88rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.basis-btn:hover { color: var(--text); }
.basis-btn.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(14,20,48,.14); }
.basis-sign { color: var(--text-2); font-weight: 500; font-size: .82rem; }
.basis-note { flex: 1 1 260px; }

/* Indian rasi medallions (SVG). Gradient lives once in index.html (#rasiGrad). */
.rasi-icon { display: inline-block; width: 1.9em; height: 1.9em; vertical-align: -0.6em; flex: none; }
.rasi-icon.sm { width: 1.75em; height: 1.75em; vertical-align: -0.55em; }
.rasi-icon.lg { width: 72px; height: 72px; }
.rasi-icon .ri-bg { fill: url(#rasiGrad); }
.rasi-icon .ri-edge { fill: none; stroke: #7a1f1f; stroke-width: 2.2; }
.rasi-icon .ri-ring { fill: none; stroke: #7a1f1f; stroke-width: 1.6; stroke-dasharray: .1 4.2; stroke-linecap: round; }
.rasi-icon .ri-m { fill: none; stroke: #7a1f1f; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.rasi-icon .ri-m .f { fill: #7a1f1f; stroke: none; }
.rasi-icon .ri-m .t { stroke: #c0392b; stroke-width: 3.2; }
table.data td:has(> .rasi-icon) { white-space: nowrap; } /* keep icon + sign name on one line */
/* Western medallion (English): midnight disc, gold ring and zodiac glyph */
.rasi-icon.west .rw-bg { fill: url(#zodiacGrad); }
.rasi-icon.west .rw-edge { fill: none; stroke: #c9a24b; stroke-width: 2.4; }
.rasi-icon.west .rw-ring { fill: none; stroke: #c9a24b; stroke-width: 1; opacity: .55; }
.rasi-icon.west .rw-g { fill: none; stroke: #f3d58a; stroke-width: 4.4; stroke-linecap: round; stroke-linejoin: round; }
.rasi-hero { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.rasi-hero b { font-family: var(--serif); font-size: 1.35rem; }
.si-chart .sign { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-size: .72rem; }
.si-chart .moon-cell { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.si-chart .pl span { margin-right: 2px; }

/* face zones */
.long-stats .stat .v { font-family: inherit; font-size: 1rem !important; font-weight: 500; line-height: 1.55; }
.zone { margin: 10px 0; padding: 8px 10px; border-radius: 8px; }
.zone.on { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.zone-h { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; }
.zone-h b { font-family: var(--serif); font-size: 1.1rem; }
.stat .v:where(:not(:has(.stars))) { overflow-wrap: anywhere; }

/* language selector (header) */
.lang-sel { width: auto; padding: 7px 28px 7px 12px; border-radius: 8px; font-size: .82rem; font-weight: 500; cursor: pointer;
  background-color: transparent; color: #e8eaf3; border: 1px solid rgba(255,255,255,.22); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #e8eaf3 50%), linear-gradient(135deg, #e8eaf3 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.lang-sel:hover { border-color: rgba(255,255,255,.5); }
.lang-sel option { color: #141a2e; background: #fff; }
[data-theme="dark"] .lang-sel { background-color: transparent; }

/* Indic scripts: Noto fonts (loaded on demand); keep labels readable without letter-spacing */
html[lang="te"] { --serif: "Noto Serif Telugu", "Noto Sans Telugu", serif; font-family: "Noto Sans Telugu", "Inter", sans-serif; }
html[lang="hi"] { --serif: "Noto Serif Devanagari", "Noto Sans Devanagari", serif; font-family: "Noto Sans Devanagari", "Inter", sans-serif; }
html[lang="ta"] { --serif: "Noto Serif Tamil", "Noto Sans Tamil", serif; font-family: "Noto Sans Tamil", "Inter", sans-serif; }
html[lang="kn"] { --serif: "Noto Serif Kannada", "Noto Sans Kannada", serif; font-family: "Noto Sans Kannada", "Inter", sans-serif; }
html:not([lang="en"]) label, html:not([lang="en"]) .stat .k, html:not([lang="en"]) table.data th, html:not([lang="en"]) .eyebrow { letter-spacing: 0; text-transform: none; }
html:not([lang="en"]) .hero-text h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.35; }
html:not([lang="en"]) .hero-text h1 span { font-style: normal; } /* no fake italics for Indic scripts */
html[lang="ta"] .hero-text h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
html:not([lang="en"]) .stat .v { font-size: 1.2rem; line-height: 1.45; }
html:not([lang="en"]) h3 { font-size: 1.3rem; line-height: 1.4; }
html:not([lang="en"]) .mc-name, html:not([lang="en"]) .partner b { font-size: 1.1rem; }
@media (max-width: 560px) { .lang-sel { padding: 6px 22px 6px 8px; font-size: .74rem; } .theme-menu #themeBtn span[data-i18n] { display: none; } }


/* ---------------------------------------------------------------- responsive hardening (all languages)
   Grid items default to min-width:auto, so long Telugu/Tamil/Kannada words could push columns off-screen. */
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.grid > *, .form-grid > *, .area-row > *, .mc-areas > *, .stat, .card, .note > div { min-width: 0; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
input, select { min-width: 0; max-width: 100%; }
h1, h2, h3, h4, p, li, td, .stat .v, .stat .s, .note { overflow-wrap: anywhere; word-break: normal; }
.section-title > div.no-print { flex-wrap: wrap; }

/* monthly calendar: 7 equal columns that can shrink */
.cal { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .hd, .cal .day { min-width: 0; overflow: hidden; }
.cal .hd { white-space: nowrap; text-overflow: ellipsis; }

/* rasi chart: 4 equal shrinkable columns */
.si-chart { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.si-chart > div { min-width: 0; overflow: hidden; }
.si-chart .sign { overflow-wrap: anywhere; }

@media (max-width: 640px) {
  .cal { gap: 3px; }
  .cal .day { min-height: 46px; padding: 5px 4px; font-size: .72rem; }
  .cal .day b { font-size: .85rem; }
  .cal .day .small { display: none; }              /* colour bar + legend carry the status on phones */
  .cal .hd { font-size: .62rem; letter-spacing: 0; }
  .si-chart > div { padding: 4px; font-size: .7rem; }
  .si-chart .sign { font-size: .62rem; gap: 2px; }
  .si-chart .sign .rasi-icon { width: 1.5em; height: 1.5em; }
  .si-chart .center { font-size: .85rem; }
  .section-title { align-items: flex-start; }
  .section-title > div.no-print { width: 100%; }
  .section-title > div.no-print input[type=date] { flex: 1 1 140px; }
  .basis-bar { padding: 10px; }
  .basis-btn { padding: 6px 8px; font-size: .8rem; }
  .basis-sign .rasi-icon + * { display: none; }
  .mc-meta { gap: 6px; }
  .card { padding: 18px 16px; }
  .ring { width: 130px; height: 130px; } .ring > div { width: 112px; height: 112px; }
}
@media (max-width: 400px) {
  .form-grid.two { grid-template-columns: minmax(0, 1fr); } .form-grid.two .span-2 { grid-column: span 1; }
  .top-actions { gap: 5px; }
  .lang-sel { max-width: 92px; }
}


/* Brand logo: identical in every language (Indic font rules must not change it) */
.logo, html[lang] .logo { font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif; font-size: 1.6rem; font-weight: 700; line-height: 1; letter-spacing: .02em; }
.logo-mark, html[lang] .logo-mark { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.25rem; line-height: 1; }
@media (max-width: 560px) { .logo, html[lang] .logo { font-size: 1.3rem; } .logo-mark, html[lang] .logo-mark { font-size: 1rem; } }

/* searchable city picker */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 240px; }
.picker-list .opt { padding: 9px 13px; cursor: pointer; font-size: .9rem; border-bottom: 1px solid var(--border); }
.picker-list .opt:last-child { border-bottom: 0; }
.picker-list .opt.hi, .picker-list .opt:hover { background: var(--surface-2); }
.picker-list.up { top: auto; bottom: calc(100% + 4px); box-shadow: 0 -8px 28px rgba(14, 20, 48, .14); }
.picker-list .opt .muted { font-size: .82rem; }
