:root {
  --bg: #070B1A; --bg2: #0C1230; --panel: rgba(14, 20, 48, .74); --panel-solid: #0F1636;
  --line: rgba(230, 236, 255, .12); --line2: rgba(230, 236, 255, .22);
  --ink: #E6ECFF; --muted: #A4AFD6; --dim: #6F7BA8;
  --gold: #F2B544; --gold-hi: #FFE7A8; --gold-lo: #9C5F14;
  --c-moon: #D9E1FF; --c-eclipse: #FF6B4A; --c-season: #4FD1C5; --c-sankranti: #F2B544; --c-planet: #6E9BFF;
  --c-conj: #B48CFF; --c-transit: #FFB86B; --c-meteor: #67E8F9; --c-festival: #FF9F43; --c-ekadashi: #7BD88F; --c-special: #FF7EB6;
  --display: 'Cormorant Garamond', Georgia, serif; --sans: 'Inter', system-ui, sans-serif; --deva: 'Tiro Devanagari Sanskrit', serif;
  --r: 14px; --shadow: 0 20px 60px rgba(0, 0, 0, .45); --top: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--sans); }
body { min-height: 100vh; overflow-x: hidden; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[lang="sa"], .dev { font-family: var(--deva); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; }
.muted { color: var(--muted); }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

/* ---------- top bar ---------- */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 40; display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: linear-gradient(180deg, rgba(7, 11, 26, .94), rgba(7, 11, 26, .7)); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; flex: none; }
.brand svg { width: 32px; height: 32px; }
.brand-name { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.brand-dev { color: var(--gold); font-size: 14px; opacity: .9; }
.tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .03); }
.tabs button { background: none; border: 0; color: var(--muted); padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--gold); color: #160E00; }
.controls { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { background: none; border: 0; width: 32px; height: 34px; font-size: 20px; color: var(--muted); }
.stepper button:hover { color: var(--gold-hi); background: rgba(255, 255, 255, .05); }
.stepper output { font-family: var(--display); font-size: 21px; font-weight: 700; min-width: 54px; text-align: center; }
.city select { appearance: none; background: rgba(255, 255, 255, .04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23A4AFD6' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 11px center / 10px;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 30px 7px 13px; font-size: 14px; max-width: 190px; }
.city select option { background: var(--panel-solid); }
.pill { background: rgba(242, 181, 68, .12); border: 1px solid rgba(242, 181, 68, .45); color: var(--gold-hi); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; }
.pill:hover { background: rgba(242, 181, 68, .22); }

/* daily panchang page */
#view-today.on { max-width: 1080px; margin: 0 auto; padding: 22px 24px 8px; }
.td-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; text-align: center; margin-bottom: 18px; }
.td-head h1 { font-size: clamp(36px, 5vw, 58px); }
.td-kick { margin: 0 0 4px; color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; }
.td-head .muted { margin: 6px 0 0; font-size: 14px; }
.td-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.td-hero { grid-row: span 2; display: grid; grid-template-columns: 150px 1fr; gap: 6px 22px; align-items: center; }
.td-moon svg { width: 150px; height: 150px; display: block; }
.td-main p { margin: 0; }
.td-label { color: var(--dim); font-size: 11.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; margin-top: 10px !important; }
.td-label:first-child { margin-top: 0 !important; }
.td-big { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; color: var(--gold-hi); }
.td-mid { font-size: 22px; font-weight: 600; }
.td-mid small { font-size: 13px; color: var(--muted); font-weight: 500; }
.td-until { color: var(--muted); font-size: 14px; }
.td-more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.td-more div { display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.td-more span { color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.td-more em { font-style: normal; color: var(--muted); font-size: 12.5px; }
.td-sun .grid2 { grid-template-columns: 1fr 1fr; }
.td-ev { grid-column: 1 / -1; }
.td-ev ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.td-ev li { display: flex; flex-direction: column; border-left: 3px solid var(--c-festival); padding-left: 12px; }
.td-ev li b { font-size: 17px; }
.td-ev li span { color: var(--muted); font-size: 14px; }
.td-ev li em { font-style: normal; color: var(--gold-hi); font-size: 13.5px; }
.td-ev .muted { margin: 0; }
.td-next { margin: 12px 0 0; color: var(--gold-hi); font-size: 14.5px; }
.td-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 20px 0 6px; }
.btn-wa { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; background: #25D366; color: #052E16; font-weight: 600; font-size: 15px; text-decoration: none; }
.btn-wa svg { width: 20px; height: 20px; }
.btn-wa:hover { background: #3BE07A; }
.pill.ghost { background: transparent; }
.td-wave { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 14px 0 6px; text-decoration: none; color: var(--ink); border-color: rgba(217, 169, 63, .35); }
.td-wave:hover { border-color: var(--gold); }
.td-wave > span { display: flex; flex-direction: column; gap: 2px; }
.td-wave b { font-size: 16px; }
.td-wave small { color: var(--muted); font-size: 13.5px; }
.td-wave em { font-style: normal; color: var(--gold-hi); font-weight: 600; white-space: nowrap; }
.foot .sister { margin: 12px 0 0; color: var(--muted); }
.foot .sister a { color: var(--gold-hi); }
@media (max-width: 760px) { .td-wave { flex-direction: column; align-items: flex-start; gap: 8px; } }
@media (max-width: 760px) {
  #view-today.on { padding: 14px 12px 4px; }
  .td-head { gap: 8px; }
  .td-grid { grid-template-columns: 1fr; }
  .td-hero { grid-row: auto; grid-template-columns: 96px 1fr; gap: 4px 14px; }
  .td-moon svg { width: 96px; height: 96px; }
  .td-big { font-size: 30px; }
  .td-mid { font-size: 19px; }
  .td-more { grid-template-columns: 1fr 1fr; }
  .td-actions .btn-wa, .td-actions .pill { flex: 1 1 100%; justify-content: center; }
}

/* language & month-system menu */
.prefs-wrap { position: relative; }
.prefs-btn { display: inline-flex; align-items: baseline; gap: 1px; height: 34px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--gold-hi); font-weight: 600; font-size: 15px; line-height: 32px; }
.prefs-btn span:first-child { font-family: 'Noto Sans Devanagari', var(--sans); }
.prefs-btn span:last-child { font-size: 12px; color: var(--muted); }
.prefs-btn:hover, .prefs-btn[aria-expanded="true"] { border-color: rgba(242, 181, 68, .55); background: rgba(242, 181, 68, .12); }
.prefs { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 300px; padding: 14px; border-radius: var(--r); background: var(--panel-solid); border: 1px solid var(--line2); box-shadow: var(--shadow); }
.prefs[hidden] { display: none; }
.prefs-h { margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.prefs .seg + .prefs-h { margin-top: 16px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg.col { grid-template-columns: 1fr; }
.seg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--ink); font-size: 14px; }
.seg button[lang="hi"] { font-family: 'Noto Sans Devanagari', var(--sans); }
.seg button small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.seg button:hover { border-color: var(--line2); }
.seg button[aria-pressed="true"] { border-color: var(--gold); background: rgba(242, 181, 68, .14); }
.seg button[aria-pressed="true"] b::after, .seg:not(.col) button[aria-pressed="true"]::after { content: ' ✓'; color: var(--gold); }
.seg:not(.col) button { flex-direction: row; justify-content: center; }
.busy b { font-weight: inherit; }

/* Hindi: Devanagari UI text uses Noto Sans Devanagari; headings keep a serif with Tiro Devanagari. */
html[lang="hi"] { --sans: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif; --display: 'Cormorant Garamond', 'Tiro Devanagari Sanskrit', Georgia, serif; }
html[lang="hi"] body { line-height: 1.6; }
/* Letter-spacing breaks Devanagari conjuncts and the head-line (shirorekha). */
html[lang="hi"] body, html[lang="hi"] body * { letter-spacing: 0 !important; }
html[lang="hi"] .tabs button, html[lang="hi"] .pill, html[lang="hi"] .chip { font-family: 'Noto Sans Devanagari', var(--sans); }
#wheelSvg .mlabel.hi { letter-spacing: 0; font-family: 'Noto Sans Devanagari', var(--sans); font-weight: 500; }

main { position: relative; z-index: 2; padding-top: var(--top); outline: none; min-height: 100vh; }
.view { display: none; }
.view.on { display: block; }
.busy { position: fixed; top: calc(var(--top) + 14px); left: 50%; transform: translateX(-50%); z-index: 30; display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line2); padding: 8px 16px; border-radius: 999px; font-size: 13px; color: var(--muted); backdrop-filter: blur(8px); }
.busy[hidden] { display: none; }
.busy span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- wheel ---------- */
#view-wheel.on { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; padding: 20px 24px 10px; align-items: start; max-width: 1560px; margin: 0 auto; }
/* Festival names sit outside the rim, so leave room above and below the circle. */
.wheel-wrap { aspect-ratio: 1; width: min(100%, max(calc(100vh - var(--top) - 24px), 820px)); margin: 56px auto 64px; }
#wheelSvg { width: 100%; height: 100%; display: block; overflow: visible; touch-action: manipulation; user-select: none; }
#wheelSvg:focus { outline: none; }
#wheelSvg:focus-visible .rim { stroke: var(--gold); stroke-width: 4; }
#wheelSvg text { font-family: var(--sans); }
#wheelSvg .mlabel { font: 600 19px var(--sans); letter-spacing: .14em; fill: var(--muted); text-transform: uppercase; }
#wheelSvg .mlabel.cur { fill: var(--gold-hi); }
#wheelSvg .lmonth { font: 600 17px var(--display); fill: #C9D2F5; letter-spacing: .03em; }
#wheelSvg .lmonth.adhika { fill: var(--c-special); }
#wheelSvg .rashi-name { font: 600 14px var(--sans); fill: #2a1a00; letter-spacing: .03em; }
#wheelSvg .flabel { font: 600 16px var(--sans); letter-spacing: .02em; }
#wheelSvg .wbtn, #wheelSvg .wopen { cursor: pointer; }
#wheelSvg .wbtn circle { fill: rgba(255, 255, 255, .05); stroke: rgba(242, 181, 68, .5); }
#wheelSvg .wbtn text { font: 400 30px var(--sans); fill: var(--gold-hi); }
#wheelSvg .wbtn:hover circle, #wheelSvg .wopen:hover rect { fill: rgba(242, 181, 68, .25); }
#wheelSvg .wopen rect { fill: rgba(242, 181, 68, .12); stroke: rgba(242, 181, 68, .55); }
#wheelSvg .wopen text { font: 500 15px var(--sans); fill: var(--gold-hi); }
#wheelSvg .rashi-glyph { font-size: 15px; fill: #1d1200; }
#wheelSvg .hit { fill: transparent; cursor: pointer; }
#wheelSvg .center-date { font: 700 46px var(--display); fill: var(--ink); }
#wheelSvg .center-sub { font: 500 15px var(--sans); fill: var(--muted); }
#wheelSvg .center-dev { font: 19px var(--deva); fill: var(--gold-hi); }
#wheelSvg .center-small { font: 500 13px var(--sans); fill: var(--dim); letter-spacing: .12em; text-transform: uppercase; }
#wheelSvg .needle { pointer-events: none; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { #wheelSvg .needle { transition: none; } }

.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; backdrop-filter: blur(8px); }
.card-h { font-size: 13px; font-family: var(--sans); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.legend p { margin: 0; color: var(--muted); font-size: 13px; }
.legend b { color: var(--ink); font-weight: 500; }

.focus { display: grid; grid-template-columns: 92px 1fr; gap: 6px 16px; align-items: center; }
.focus .moonbig { width: 92px; height: 92px; grid-row: span 3; }
.focus h2 { font-size: 30px; }
.focus .kick { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.focus .facts { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 8px; font-size: 13.5px; }
.focus .facts div span { display: block; color: var(--dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.focus .tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.focus .actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .03); border-radius: 999px; padding: 4px 11px 4px 9px; font-size: 13px; color: var(--muted); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.chip[aria-pressed="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--c) 70%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
.chip[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 60%, white); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }

.ev-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.ev:first-child { border-top: 0; }
.ev:hover { background: rgba(255, 255, 255, .04); }
.ev .when { font: 700 20px/1 var(--display); color: var(--ink); text-align: center; }
.ev .when small { display: block; font: 600 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-top: 3px; }
.ev .t { font-weight: 500; }
.ev .t::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); transform: translateY(-1px); }
.ev .t .dev { color: var(--gold-hi); font-size: 14px; font-weight: 400; margin-left: 8px; }
.ev .s { color: var(--muted); font-size: 13px; }
.ev .tm { color: var(--dim); font-size: 12px; }

/* ---------- year ---------- */
.view-head { padding: 26px 28px 8px; max-width: 1560px; margin: 0 auto; }
.view-head h1 { font-size: clamp(40px, 5vw, 66px); }
.legend-chips { margin-top: 14px; }
.legend-row { padding-top: 0; padding-bottom: 0; }
.legend-row .legend-chips { margin-top: 4px; }
.today-chip { color: var(--gold-hi) !important; border-color: rgba(242, 181, 68, .55) !important; }
.year-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 16px 28px 30px; max-width: 1560px; margin: 0 auto; }
.mcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 12px; }
.mcard h2 { font-size: 26px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mcard h2 button { all: unset; cursor: pointer; }
.mcard h2 button:hover { color: var(--gold-hi); }
.mcard .lm { font: 13px var(--deva); color: var(--gold); text-align: right; }
.mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 8px; }
.mini .dw { font-size: 10px; color: var(--dim); text-align: center; letter-spacing: .1em; padding-bottom: 2px; }
.cell { position: relative; aspect-ratio: 1 / 1.08; border: 0; background: rgba(255, 255, 255, .02); border-radius: 7px; padding: 3px 0 0; display: flex; flex-direction: column; align-items: center; font-size: 12.5px; color: var(--ink); }
.cell:hover { background: rgba(255, 255, 255, .08); }
.cell svg { width: 13px; height: 13px; margin-top: 1px; }
.cell .dots { display: flex; gap: 2px; margin-top: auto; padding-bottom: 3px; min-height: 8px; }
.cell .dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--c); }
.cell.fest { background: rgba(255, 159, 67, .12); }
.cell.ecl { box-shadow: inset 0 0 0 1.5px var(--c-eclipse); }
.cell.today { box-shadow: inset 0 0 0 1.5px var(--gold); }
.cell.sel { background: rgba(242, 181, 68, .25); }
.cell.sun0 .n { color: #FFB4A0; }

/* ---------- month ---------- */
.month-head { display: flex; align-items: center; gap: 18px; }
.month-head > div { flex: 1; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); font-size: 22px; color: var(--muted); }
.round:hover { color: var(--gold-hi); border-color: var(--gold); }
.dow-row, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; padding: 0 28px; max-width: 1560px; margin: 0 auto; }
.dow-row { padding-top: 12px; padding-bottom: 6px; }
.dow-row span { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); padding-left: 6px; }
.month-grid { padding-bottom: 30px; }
.mday { position: relative; min-height: 148px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 10px 8px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.mday:hover { border-color: var(--line2); background: rgba(20, 28, 64, .85); }
.mday.blank { visibility: hidden; }
.mday.today { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(242, 181, 68, .2); }
.mday .top { display: flex; justify-content: space-between; align-items: flex-start; }
.mday .n { font: 700 28px/1 var(--display); }
.mday .wd { display: none; }
.mday svg { width: 30px; height: 30px; flex: none; }
.mday .ti { font-size: 12.5px; color: var(--ink); }
.mday .ti b { color: var(--gold-hi); font-weight: 600; }
.mday .nk { font-size: 12px; color: var(--muted); }
.mday .rs { font-size: 11px; color: var(--dim); }
.mday .chips-s { display: flex; flex-direction: column; gap: 3px; margin-top: auto; }
.mday .chips-s span { font-size: 11.5px; line-height: 1.3; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 55%, white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- events ---------- */
.sticky-chips { position: sticky; top: var(--top); z-index: 5; padding: 12px 28px; background: linear-gradient(180deg, rgba(7, 11, 26, .95), rgba(7, 11, 26, .75)); max-width: 1560px; margin: 0 auto; backdrop-filter: blur(8px); }
.events-list { max-width: 1000px; margin: 0 auto; padding: 8px 28px 40px; }
.events-list h2 { font-size: 30px; margin: 26px 0 6px; display: flex; gap: 12px; align-items: baseline; }
.events-list h2 small { font: 14px var(--deva); color: var(--gold); }
.events-list .ev { grid-template-columns: 64px 1fr auto; padding: 12px 8px; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(3, 5, 14, .55); backdrop-filter: blur(2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(520px, 100%); background: linear-gradient(180deg, #0E1538, #090E25); border-left: 1px solid var(--line2); box-shadow: var(--shadow);
  overflow-y: auto; transform: translateX(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1); outline: none; overscroll-behavior: contain; }
.drawer.open { transform: none; }
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }
.d-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: rgba(14, 21, 56, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.d-head h2 { font-size: 26px; flex: 1; }
.d-head h2 small { display: block; font: 13px var(--sans); color: var(--muted); margin-top: 2px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); font-size: 18px; color: var(--muted); flex: none; }
.icon-btn:hover { color: var(--gold-hi); border-color: var(--gold); }
.d-body { padding: 18px 18px 40px; display: flex; flex-direction: column; gap: 18px; }
.d-hero { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; }
.d-hero svg { width: 150px; height: 150px; }
.d-hero .ph { font: 600 28px var(--display); }
.d-hero .kv { color: var(--muted); font-size: 13.5px; }
.d-sec h3 { font-size: 12px; font-family: var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.stat span { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.stat b { font-weight: 600; font-size: 16px; }
.limb { display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.limb:first-of-type { border-top: 0; }
.limb > span { color: var(--dim); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; padding-top: 3px; }
.limb .row { display: flex; justify-content: space-between; gap: 10px; }
.limb .row em { font-style: normal; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.limb .dev { color: var(--gold-hi); margin-left: 6px; }
.limb small { color: var(--dim); }
table.grahas { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grahas th { text-align: left; font-weight: 500; color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.grahas td { padding: 6px; border-bottom: 1px solid var(--line); }
.grahas td.g { white-space: nowrap; }
.grahas .sym { display: inline-block; width: 20px; color: var(--gold); }
.grahas .r { color: var(--c-eclipse); font-size: 11px; margin-left: 4px; }
.mu { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.mu span:nth-child(odd) { color: var(--muted); }
.mu .bad { color: #FF9C88; }
.mu .good { color: var(--c-ekadashi); }
.d-ev { border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 9%, transparent); border-radius: 12px; padding: 10px 12px; }
.d-ev + .d-ev { margin-top: 8px; }
.d-ev b { font-weight: 600; }
.d-ev .dev { color: var(--gold-hi); margin-left: 8px; }
.d-ev p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.note { color: var(--dim); font-size: 12px; }
.d-ev p.kala { color: var(--gold-hi); margin-top: 6px; }
.d-ev p.kala b { font-weight: 600; }

.tip { position: fixed; z-index: 70; pointer-events: none; background: rgba(9, 14, 37, .96); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 11px; font-size: 13px; max-width: 280px; box-shadow: var(--shadow); }
.tip b { font-family: var(--display); font-size: 18px; }
.tip .dev { color: var(--gold-hi); }
.tip .x { color: var(--muted); }

.toast { position: fixed; z-index: 80; top: calc(var(--top) + 12px); right: 20px; max-width: min(360px, calc(100vw - 32px)); display: flex; gap: 10px; align-items: flex-start;
  background: rgba(14, 21, 56, .97); border: 1px solid var(--line2); border-left: 3px solid var(--gold); border-radius: 12px; padding: 11px 12px 11px 14px; font-size: 13.5px; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }
.toast.warn { border-left-color: var(--c-eclipse); }
.toast p { margin: 0; flex: 1; }
.toast button { background: none; border: 0; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 4px; }
.toast button:hover { color: var(--ink); }
@media (max-width: 700px) { .toast { left: 16px; right: 16px; max-width: none; } }
.foot { max-width: 980px; margin: 10px auto 0; padding: 10px 28px 40px; color: var(--dim); font-size: 12.5px; text-align: center; }
.copyright { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.copyright p { margin: 0; }
.copyright .dev { color: var(--gold); }
.brand-mini { color: var(--gold); font-size: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .year-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  #view-wheel.on { grid-template-columns: 1fr; }
  .wheel-wrap { position: relative; top: 0; max-width: 820px; max-height: none; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
  .brand-dev { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 108px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--top); padding: 8px 14px; row-gap: 8px; align-content: center; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tabs button { flex: 1; }
  .year-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .brand-name { display: none; }
  .brand svg { width: 28px; height: 28px; }
  .topbar { column-gap: 10px; }
  .tabs button { padding: 6px 4px; font-size: 13.5px; min-width: 0; }
  .controls { gap: 6px; }
  .stepper button { width: 24px; }
  .stepper output { min-width: 48px; font-size: 19px; }
  .city select { max-width: 94px; padding: 7px 22px 7px 10px; background-position: right 8px center; }
  #todayBtn { padding: 7px 9px; font-size: 13px; }
  .prefs-btn { padding: 0 8px; }
  .prefs { position: fixed; left: 16px; right: 16px; top: calc(var(--top) + 6px); width: auto; }
  #view-wheel.on { padding: 8px 6px; gap: 12px; }
  .side { grid-template-columns: 1fr; padding: 0 10px; }
  .wheel-wrap { margin: 30px auto 36px; width: calc(100% - 64px); }
  #wheelSvg .mlabel { font-size: 26px; letter-spacing: .06em; }
  #wheelSvg .lmonth { font-size: 20px; }
  #wheelSvg .flabel { font-size: 19px; }
  #wheelSvg .rashi-name { font-size: 16px; }
  #wheelSvg .wbtn circle { r: 30px; }
  #wheelSvg .wopen text { font-size: 19px; }
  .sticky-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .sticky-chips::-webkit-scrollbar { display: none; }
  .sticky-chips .chip { flex: none; }
  #wheelSvg .center-date { font-size: 54px; }
  #wheelSvg .center-sub { font-size: 18px; }
  #wheelSvg .center-dev { font-size: 22px; }
  .view-head { padding: 18px 16px 6px; }
  .year-grid { grid-template-columns: 1fr; padding: 12px 16px 24px; }
  .dow-row { display: none; }
  .month-grid { grid-template-columns: 1fr; padding: 8px 16px 24px; gap: 6px; }
  .mday { min-height: 0; display: grid; grid-template-columns: 54px 1fr 34px; gap: 2px 10px; align-items: center; }
  .mday.blank { display: none; }
  .mday .top { display: contents; }
  .mday .n { grid-row: 1 / span 3; text-align: center; }
  .mday .wd { display: block; font: 600 10px var(--sans); letter-spacing: .16em; color: var(--dim); text-transform: uppercase; text-align: center; margin-top: 3px; }
  .mday svg { grid-column: 3; grid-row: 1 / span 2; }
  .mday .ti, .mday .nk, .mday .rs { grid-column: 2; }
  .mday .chips-s { grid-column: 2 / -1; }
  .mday .chips-s span { white-space: normal; }
  .sticky-chips { padding: 10px 16px; }
  .events-list { padding: 4px 16px 30px; }
  .events-list .ev { grid-template-columns: 52px 1fr; }
  .events-list .ev .tm { grid-column: 2; }
  .d-hero { grid-template-columns: 110px 1fr; }
  .d-hero svg { width: 110px; height: 110px; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .drawer { top: auto; height: 92vh; width: 100%; border-left: 0; border-top: 1px solid var(--line2); border-radius: 18px 18px 0 0; transform: translateY(105%); }
}
@media (max-width: 360px) { .brand { display: none; } }
