/* KundaliHelp v2 — mobile-first. Night-sky shell, parchment readings, sindoor-ink charts. */
:root {
  --night: #17123a; --night-2: #201a4d; --night-3: #2b2463; --line: rgba(242,165,65,.22);
  --marigold: #f2a541; --marigold-2: #ffc46b; --sindoor: #b3122b; --leaf: #2f8f5b;
  --text: #ece6ff; --dim: #b4abd8; --faint: #7f77a8;
  --paper: #f8efdc; --paper-2: #efe1c3; --ink: #2b1d14; --ink-dim: #6c5644;
  --r-lg: 22px; --r: 14px; --r-sm: 10px;
  --display: 'Tiro Devanagari Hindi', 'Tiro Bangla', Georgia, serif;
  --body: 'Hind', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 64px;
  color-scheme: dark;
}
:root[lang="bn"] { --display: 'Tiro Bangla', 'Tiro Devanagari Hindi', Georgia, serif; --body: 'Hind Siliguri', 'Hind', system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--nav-h) + 20px); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; font: 16px/1.6 var(--body); color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, #3a2a7a 0%, transparent 60%), radial-gradient(900px 500px at -10% 10%, #2a1d5e 0%, transparent 55%), var(--night);
  background-attachment: fixed;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; }
a { color: var(--marigold-2); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--marigold-2); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: rgba(23,18,58,.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); min-width: 0; flex: 1; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font: 600 1.18rem/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 999px; height: 38px; min-width: 38px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--text); }
.icon-btn:active { transform: scale(.97); }
.lang-select { appearance: none; -webkit-appearance: none; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 999px; height: 38px; padding: 0 14px; cursor: pointer; }
.lang-select option { background: var(--night-2); }

/* ---------- layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 16px 16px 32px; }
.view { display: none; }
.view.on { display: block; animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; margin: 0; }
.page-title { font-size: 1.75rem; margin: 6px 0 4px; }
.page-sub { color: var(--dim); margin: 0 0 18px; max-width: 62ch; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); text-decoration: none; font-size: .95rem; margin-bottom: 6px; background: none; border: 0; padding: 4px 0; cursor: pointer; }

/* ---------- today's sky (home hero) ---------- */
.sky {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 20px 18px 18px;
  background: linear-gradient(160deg, #2c2270 0%, #1d1750 55%, #171240 100%); border: 1px solid var(--line);
}
.sky::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(1.2px 1.2px at 12% 22%, #fff9 50%, transparent 51%), radial-gradient(1px 1px at 72% 18%, #fff8 50%, transparent 51%), radial-gradient(1.4px 1.4px at 88% 64%, #fffa 50%, transparent 51%), radial-gradient(1px 1px at 40% 80%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 58% 44%, #fff7 50%, transparent 51%); pointer-events: none; }
.sky-date { color: var(--dim); font-size: .92rem; }
.sky-tithi { font: 400 clamp(1.7rem, 7vw, 2.6rem)/1.1 var(--display); margin: 4px 0 2px; color: var(--marigold-2); }
.sky-moon { color: var(--text); margin-bottom: 14px; }
.sky-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; position: relative; z-index: 1; }
.sky-grid div { border-top: 1px solid rgba(255,255,255,.08); padding-top: 6px; }
.sky-grid dt { font-size: .78rem; color: var(--faint); }
.sky-grid dd { margin: 0; font-weight: 500; }
.sky-loc { margin-top: 12px; font-size: .82rem; color: var(--faint); position: relative; z-index: 1; }
.sky-loc button { background: none; border: 0; color: var(--marigold-2); padding: 0; cursor: pointer; text-decoration: underline; }

.cta-kundali {
  display: flex; align-items: center; gap: 14px; margin: 14px 0 22px; padding: 16px; border-radius: var(--r-lg);
  background: var(--marigold); color: #2a1606; text-decoration: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.cta-kundali svg { width: 52px; height: 52px; flex: none; }
.cta-kundali b { display: block; font: 600 1.15rem/1.2 var(--display); }
.cta-kundali span { font-size: .9rem; opacity: .8; }

.section-h { font-size: 1.2rem; margin: 6px 0 12px; color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1 / .92;
  padding: 10px 6px; border-radius: var(--r); background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07);
  color: var(--text); text-decoration: none; text-align: center; cursor: pointer; line-height: 1.2; font-size: .9rem;
}
.tile i { font-style: normal; font-size: 1.6rem; }
.tile:active { background: rgba(242,165,65,.12); }
.tile small { color: var(--faint); font-size: .72rem; }

/* ---------- forms ---------- */
.card { background: var(--night-2); border: 1px solid rgba(255,255,255,.07); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.fields { display: grid; gap: 12px; }
.field label { display: block; font-size: .86rem; color: var(--dim); margin-bottom: 5px; }
.input, .select, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 13px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,8,30,.45); color: var(--text); font-size: 16px; /* 16px stops iOS zoom */
}
textarea.input { min-height: 110px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.select option { background: var(--night-2); }
.input:focus, .select:focus { border-color: var(--marigold); outline: none; box-shadow: 0 0 0 3px rgba(242,165,65,.18); }
.input[type=date], .input[type=time] { color-scheme: dark; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--dim); margin-top: 6px; }
.check input { width: 18px; height: 18px; accent-color: var(--marigold); }
.hint { font-size: .8rem; color: var(--faint); margin-top: 4px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-height: 44px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.12); background: transparent; cursor: pointer; padding: 6px 10px; }
.seg button.on { background: var(--marigold); color: #2a1606; border-color: var(--marigold); font-weight: 600; }

.place { position: relative; }
.place-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #2a2361; border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 260px; overflow: auto; box-shadow: 0 16px 40px #0008; display: none; }
.place-list.on { display: block; }
.place-list button { display: block; width: 100%; text-align: left; padding: 11px 13px; background: none; border: 0; border-bottom: 1px solid rgba(255,255,255,.06); cursor: pointer; }
.place-list button small { display: block; color: var(--faint); font-size: .78rem; }
.place-list button:hover, .place-list button:focus { background: rgba(242,165,65,.14); }
.place-ok { color: #8fe3b0; font-size: .8rem; margin-top: 4px; }

.profile-pick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: none; }
.profile-pick::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; font-size: .9rem; }
.chip.on { background: rgba(242,165,65,.18); border-color: var(--marigold); color: var(--marigold-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: var(--r); border: 0; cursor: pointer; font-weight: 600; font-size: 1rem; text-decoration: none; }
.btn-primary { background: var(--marigold); color: #2a1606; width: 100%; }
.btn-primary:active { background: var(--marigold-2); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.18); }
.btn[disabled] { opacity: .55; cursor: wait; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }

/* ---------- chart & data ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 4px -16px 12px; padding: 0 16px; scrollbar-width: none; position: sticky; top: 60px; z-index: 5; background: linear-gradient(var(--night) 70%, transparent); padding-bottom: 8px; padding-top: 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 1px solid rgba(255,255,255,.12); background: transparent; border-radius: 999px; padding: 8px 15px; cursor: pointer; white-space: nowrap; font-size: .92rem; }
.tabs button.on { background: var(--text); color: var(--night); border-color: var(--text); font-weight: 600; }
.tabpane { display: none; } .tabpane.on { display: block; }

.paper { background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: 16px; box-shadow: 0 10px 30px #0005; }
.paper h3 { color: var(--sindoor); font-size: 1.1rem; margin-bottom: 8px; }
.charts { display: grid; gap: 14px; }
.chart-box { text-align: center; }
.chart-box .cap { font: 400 1.05rem var(--display); color: var(--sindoor); margin-bottom: 6px; }
.chart-svg { width: 100%; max-width: 380px; height: auto; display: block; margin: 0 auto; }
.chart-style { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.chart-style button { border: 1px solid #c9b08a; background: transparent; color: var(--ink-dim); padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: .85rem; }
.chart-style button.on { background: var(--sindoor); color: #fff; border-color: var(--sindoor); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.kv div { border-bottom: 1px dashed #d8c39c; padding-bottom: 6px; }
.kv dt { font-size: .76rem; color: var(--ink-dim); }
.kv dd { margin: 0; font-weight: 600; }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 460px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-dim); font-size: .78rem; border-bottom: 2px solid #d8c39c; padding: 6px 6px; }
.tbl td { border-bottom: 1px solid #e6d4b2; padding: 8px 6px; vertical-align: top; }
.tbl td:first-child { font-weight: 600; white-space: nowrap; }
.tag { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 999px; margin: 1px 2px 1px 0; background: #e8d5b0; color: #5a3d22; white-space: nowrap; }
.tag.good { background: #d4ecd9; color: #1e5a33; } .tag.bad { background: #f6d6d6; color: #8a1c1c; }

.dasha-list { list-style: none; padding: 0; margin: 0; }
.dasha-list > li { border-bottom: 1px solid #e3cfa9; }
.dasha-list summary { display: flex; justify-content: space-between; gap: 8px; padding: 11px 2px; cursor: pointer; list-style: none; }
.dasha-list summary::-webkit-details-marker { display: none; }
.dasha-list .now > summary { color: var(--sindoor); font-weight: 700; }
.dasha-list .now > summary::before { content: '●'; margin-right: 6px; }
.dasha-list summary span:last-child { color: var(--ink-dim); font-size: .85rem; white-space: nowrap; }
.dasha-sub { list-style: none; margin: 0 0 10px; padding: 0 0 0 14px; font-size: .88rem; }
.dasha-sub li { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px dotted #e6d4b2; }
.dasha-sub li.now { color: var(--sindoor); font-weight: 700; }

.dosha { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid #e6d4b2; }
.dosha b { display: block; }
.dosha .state { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.state.yes { background: #f6d6d6; color: #8a1c1c; } .state.no { background: #d4ecd9; color: #1e5a33; }
.dosha p { margin: 2px 0 0; font-size: .9rem; color: var(--ink-dim); }

/* ---------- match ---------- */
.score-ring { display: grid; place-items: center; margin: 4px auto 10px; width: 170px; height: 170px; position: relative; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring .num { font: 400 2.6rem/1 var(--display); color: var(--sindoor); }
.score-ring .of { font-size: .85rem; color: var(--ink-dim); text-align: center; }
.verdict { text-align: center; font: 400 1.25rem var(--display); margin-bottom: 10px; }
.koota { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid #e6d4b2; }
.koota .bar { grid-column: 1 / -1; height: 6px; background: #ead8b6; border-radius: 6px; overflow: hidden; }
.koota .bar i { display: block; height: 100%; background: var(--sindoor); border-radius: 6px; }
.koota small { grid-column: 1 / -1; color: var(--ink-dim); font-size: .8rem; }

/* ---------- reading (AI) ---------- */
.reading { background: var(--paper); color: var(--ink); border-radius: var(--r-lg); padding: 20px 18px 22px; box-shadow: 0 14px 40px #0006; position: relative; }
.reading::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: repeating-linear-gradient(90deg, var(--sindoor) 0 14px, var(--marigold) 14px 28px); }
.reading-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.reading-head h2 { font-size: 1.35rem; color: var(--sindoor); }
.reading-head small { color: var(--ink-dim); }
.md { font-size: 1.04rem; line-height: 1.75; }
.md p { margin: 0 0 12px; max-width: 70ch; }
.md .summary { font-size: 1.1rem; background: var(--paper-2); border-left: 4px solid var(--marigold); padding: 12px 14px; border-radius: 0 12px 12px 0; }
.md h3 { font: 400 1.22rem/1.3 var(--display); color: var(--sindoor); margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid #e3cfa9; scroll-margin-top: 80px; }
.md ul { margin: 0 0 12px; padding-left: 1.1em; }
.md li { margin: 0 0 6px; }
.md li::marker { color: var(--marigold); }
.md strong { color: #5b1414; }
.md .why { display: inline-block; font-size: .78rem; line-height: 1.3; padding: 1px 7px; margin: 0 2px; border-radius: 6px; background: #ece0c4; color: #6a4b2e; vertical-align: 1px; }
.toc { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc a { flex: none; font-size: .8rem; padding: 5px 10px; border-radius: 999px; background: #ecdfc2; color: #5a3d22; text-decoration: none; white-space: nowrap; }
.typing::after { content: '▍'; animation: blink 1s steps(2) infinite; color: var(--sindoor); }
@keyframes blink { 50% { opacity: 0; } }
.reading-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.reading-actions button, .reading-actions a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; border-radius: 12px; border: 1px solid #d8c39c; background: transparent; color: var(--ink); font-size: .78rem; cursor: pointer; text-decoration: none; }
.reading-actions i { font-style: normal; font-size: 1.2rem; }

.waiting { text-align: center; padding: 26px 10px; color: var(--ink-dim); }
.waiting .wheel { width: 64px; height: 64px; margin: 0 auto 10px; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err-box { background: #fde2e1; color: #7a1717; border-radius: var(--r); padding: 14px; margin: 10px 0; }
.err-box .btn { margin-top: 10px; }

/* ---------- lists ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list li a, .list li button { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.07); color: var(--text); text-decoration: none; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.list .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(242,165,65,.12); flex: none; font-size: 1.2rem; }
.list small { color: var(--faint); display: block; font-size: .8rem; }
.empty { text-align: center; color: var(--dim); padding: 30px 10px; }

.plans { display: grid; gap: 12px; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: rgba(255,255,255,.03); }
.plan.best { border-color: var(--marigold); background: rgba(242,165,65,.08); }
.plan .price { font: 400 2rem var(--display); color: var(--marigold-2); }
.plan ul { padding-left: 1.1em; color: var(--dim); }

/* ---------- bottom nav ---------- */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(23,18,58,.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); text-decoration: none; font-size: .72rem; }
.bottomnav a svg { width: 24px; height: 24px; }
.bottomnav a.on { color: var(--marigold-2); }

/* ---------- toast / sheet ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: #fff; color: #1b1530; padding: 11px 18px; border-radius: 999px; font-size: .92rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 90; max-width: 90vw; text-align: center; box-shadow: 0 10px 30px #0006; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.sheet-bg { position: fixed; inset: 0; background: rgba(5,3,20,.6); z-index: 80; display: none; }
.sheet-bg.on { display: block; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--night-2); border-radius: 24px 24px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px)); max-height: 92vh; overflow: auto; transform: translateY(105%); visibility: hidden; transition: transform .28s ease, visibility .28s; border-top: 1px solid var(--line); }
.sheet.on { transform: none; visibility: visible; }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.2); margin: 0 auto 14px; }
.sheet h2 { font-size: 1.4rem; margin-bottom: 4px; }
.install-bar { display: none; align-items: center; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); background: rgba(242,165,65,.12); border: 1px solid var(--line); }
.install-bar.on { display: flex; }
.install-bar p { margin: 0; flex: 1; font-size: .9rem; }
.install-bar .btn { min-height: 40px; padding: 0 14px; }

footer.site { max-width: 1080px; margin: 0 auto; padding: 10px 16px 30px; color: var(--faint); font-size: .82rem; }
footer.site a { color: var(--dim); margin-right: 12px; }

/* ---------- larger screens ---------- */
@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .sky-grid { grid-template-columns: repeat(3, 1fr); }
  .charts { grid-template-columns: 1fr 1fr; }
  .reading { padding: 28px 30px; }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .fields.two { grid-template-columns: 1fr 1fr; }
  .fields.two .full { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  body { padding-bottom: 0; }
  .bottomnav { position: sticky; top: 0; bottom: auto; height: auto; grid-template-columns: none; display: flex; justify-content: center; gap: 4px; padding: 0; background: transparent; border: 0; backdrop-filter: none; }
  .bottomnav a { flex-direction: row; font-size: .92rem; padding: 8px 14px; border-radius: 999px; gap: 6px; }
  .bottomnav a svg { width: 18px; height: 18px; }
  .bottomnav a.on { background: rgba(242,165,65,.14); }
  .topbar .nav-slot { flex: 2; }
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .home-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
  .toast { bottom: 24px; }
  .sheet { max-width: 520px; margin: 0 auto; border-radius: 24px; top: 50%; bottom: auto; max-height: 86vh; border: 1px solid var(--line); opacity: 0; transform: translateY(-46%); transition: opacity .2s, transform .2s, visibility .2s; }
  .sheet.on { opacity: 1; transform: translateY(-50%); }
  .tabs { top: 64px; }
}

@media print {
  body { background: #fff; padding: 0; color: #000; }
  .topbar, .bottomnav, .reading-actions, .tabs, .back, .install-bar, footer.site, .no-print { display: none !important; }
  .reading, .paper { box-shadow: none; }
}

/* ---------- v2 additions ---------- */
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
.topbar .nm { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0 0 6px; }
.summary-strip div { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-sm); padding: 8px 10px; }
.summary-strip small { display: block; color: var(--faint); font-size: .74rem; }
.summary-strip b { font-weight: 600; color: var(--marigold-2); }
.sky-planets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; position: relative; z-index: 1; }
.sky-planets span { font-size: .78rem; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--dim); }
.disclaimer { font-size: .78rem; color: var(--faint); margin: 18px 0 0; line-height: 1.5; }
.sheet-links { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.sheet-links button { background: none; border: 0; color: var(--marigold-2); padding: 8px 0; cursor: pointer; text-align: left; }
.sheet .err { color: #ffb3b3; font-size: .9rem; min-height: 1em; }
.tile.on { border-color: var(--marigold); background: rgba(242,165,65,.16); color: var(--marigold-2); }
button.tile { font: inherit; }
.sign-tiles .tile { aspect-ratio: auto; padding: 10px 4px; }
.meta { margin: 6px 0 14px; padding-bottom: 12px; border-bottom: 1px solid #e3cfa9; }
.meta-chart { display: grid; gap: 8px; justify-items: center; }
.meta-chart .chart-svg { max-width: 300px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tcard { border: 1.5px solid #c9a46b; border-radius: 10px; padding: 10px 6px; text-align: center; background: linear-gradient(#fffaf0, #f3e3c3); min-height: 110px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.tcard b { font: 400 .98rem/1.2 var(--display); color: var(--sindoor); }
.tcard small { color: var(--ink-dim); font-size: .72rem; }
.tcard.rev b { transform: rotate(180deg); }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nums div { text-align: center; background: var(--paper-2); border-radius: 12px; padding: 10px 4px; }
.nums b { display: block; font: 400 1.8rem/1 var(--display); color: var(--sindoor); }
.nums small { font-size: .72rem; color: var(--ink-dim); }
.plan-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .85rem; }
.plan-badge.p { background: var(--marigold); color: #2a1606; font-weight: 600; }
.prof-row { display: flex; align-items: center; gap: 6px; }
.prof-row > a { flex: 1; min-width: 0; }
.lang-seg button { flex: 0 0 auto; min-width: 30%; }
.cta-card { margin-top: 14px; border-color: var(--line); background: linear-gradient(160deg, #2c2270, var(--night-2)); }
.plan .btn { width: 100%; margin-top: 6px; }
.plan small { font-size: .9rem; color: var(--dim); }
@media (min-width: 640px) { .summary-strip { grid-template-columns: repeat(4, 1fr); } .nums { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 960px) {
  .bottomnav { position: fixed; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); width: auto; z-index: 45; }
  .topbar { min-height: 60px; }
}
.list li.prof-row > button.icon-btn { width: 38px; min-width: 38px; height: 38px; padding: 0; flex: none; justify-content: center; border: 1px solid var(--line); border-radius: 999px; }
.acct-set summary { list-style: none; cursor: pointer; }
.acct-set summary::-webkit-details-marker { display: none; }
.acct-set summary h3 { margin: 0; display: flex; justify-content: space-between; }
.acct-set summary h3::after { content: '▾'; color: var(--faint); }
.acct-set[open] summary { margin-bottom: 14px; }
.btn.danger { color: #ffb3b3; border-color: rgba(255,120,120,.45); }
.btn.danger-bg { background: #b3122b; color: #fff; }

/* ---------- 2.1.1 layout polish ---------- */
html.notranslate { translate: no; }
.install-bar { gap: 12px; }
.install-bar p { min-width: 0; }
.install-bar .btn, .install-bar .btn-primary { width: auto; flex: none; white-space: nowrap; }
.install-bar .icon-btn { flex: none; }
.sky-grid dt { white-space: nowrap; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.tile { aspect-ratio: auto; min-height: 104px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); } .tile { min-height: 118px; } }
@media (min-width: 960px) {
  main { max-width: 1180px; padding-top: 22px; }
  .home-grid { grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); gap: 28px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
  .tile { min-height: 116px; font-size: .95rem; transition: border-color .15s, background .15s, transform .15s; }
  .tile:hover { border-color: var(--line); background: rgba(242,165,65,.08); transform: translateY(-2px); }
  .install-bar { max-width: 1180px; margin: 0 auto 18px; }
  .sky-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sky-tithi { font-size: 2.3rem; }
  .bottomnav a { color: var(--dim); }
  footer.site { max-width: 1180px; }
}
.alt-link { display: inline-block; margin-top: 4px; font-size: .9rem; }
@media (min-width: 960px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .cta-card { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: end; padding: 22px 24px; }
  .cta-card h3, .cta-card .hint { grid-column: 1 / -1; }
  .cta-card > div:last-child { margin-top: 0 !important; }
  .cta-card .btn-primary { width: auto; min-width: 260px; }
}
