:root {
  --bg: #0b0d14;
  --panel: #12151f;
  --panel-2: #181c28;
  --fg: #e9e6dc;
  --muted: #8d93a3;
  --line: #2a3040;
  --accent: #e8c25a;
  /* aspect colours: Okabe & Ito's colour-blind-safe palette */
  --hard: #e66100;
  --soft: #56b4e9;
  --conj: #f0e442;
  --minor: #cc79a7;
  --fire: #e0614a;
  --earth: #6aa84f;
  --air: #d8b84a;
  --water: #4f8fe6;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --glyph: "Segoe UI Symbol", "Noto Sans Symbols", "Noto Sans Symbols 2", "DejaVu Sans", "Apple Symbols", var(--sans);
  color-scheme: dark;
}
:root[data-theme="light"] { --bg: #f5f2ea; --panel: #fffdf7; --panel-2: #f0ece2; --fg: #22232a; --muted: #6b6f7c; --line: #d9d3c4; color-scheme: light; --hard: #d55e00; --soft: #0072b2; --conj: #9a7400; --minor: #b04f8c; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f5f2ea; --panel: #fffdf7; --panel-2: #f0ece2; --fg: #22232a; --muted: #6b6f7c; --line: #d9d3c4; color-scheme: light; --hard: #d55e00; --soft: #0072b2; --conj: #9a7400; --minor: #b04f8c; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--sans); }
button, select, input { font: inherit; color: inherit; }
button { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: #1a1508; border-color: var(--accent); font-weight: 600; }
button[aria-pressed="true"], button.on { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

#app { display: grid; grid-template-rows: auto 1fr auto; height: 100%; }
.top { display: flex; align-items: center; gap: 16px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: nowrap; height: 52px; contain: layout paint; }
.brand { font-family: var(--serif); font-size: 20px; letter-spacing: .02em; }
.brand .mark { color: var(--accent); }
.moment { flex: 1; min-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; contain: strict; height: 24px; line-height: 24px; }
.moment b { font-family: var(--serif); font-size: 16px; margin-right: 6px; }
.moment span { margin-right: 6px; font-variant-numeric: tabular-nums; }
.views { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.views button { border: 0; background: transparent; padding: 5px 12px; }
.views button[aria-selected="true"] { background: var(--accent); color: #1a1508; font-weight: 600; }
.top-actions { display: flex; gap: 6px; }

.split { display: grid; grid-template-columns: minmax(340px, 40%) 1fr; min-height: 0; }
.left { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; background: var(--bg); contain: strict; }
.wheel-wrap { padding: 8px 12px 0; display: flex; justify-content: center; }
.wheel { width: 100%; max-width: 560px; height: auto; font-family: var(--glyph); }
.tabs { display: flex; gap: 2px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: transparent; color: var(--muted); padding: 5px 9px; }
.tabs button[aria-selected="true"] { color: var(--fg); box-shadow: inset 0 -2px var(--accent); border-radius: 0; }
.tab-body { overflow: auto; padding: 10px 14px 18px; flex: 1; min-height: 120px; }

.right { position: relative; min-height: 0; overflow: hidden; background: #04050a; contain: strict; }
.stage { position: absolute; inset: 0; z-index: 0; }
.stage .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.stage .labels { position: absolute !important; inset: 0; pointer-events: none; }
.stage.picking .gl { cursor: crosshair; }
.fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.fade.on { opacity: 1; }
.badge { position: absolute; left: 12px; bottom: 12px; max-width: min(560px, 70%); font-size: 12px; color: #c9cdd8; background: rgba(8, 10, 18, .72); padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08); pointer-events: none; }
.overlay-toggles { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 20px); }
.overlay-toggles button { background: rgba(14, 17, 27, .82); color: #dfe2ea; border-color: rgba(255,255,255,.12); font-size: 12px; padding: 4px 9px; }
.overlay-toggles button[aria-pressed="true"] { border-color: var(--accent); color: #fff; }
.explain-cap { position: absolute; right: 12px; top: 52px; width: min(340px, 45%); background: rgba(10, 12, 20, .85); color: #e4e6ee; border: 1px solid rgba(232,194,90,.4); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.status { position: absolute; right: 12px; bottom: 12px; font-size: 12px; color: #c9cdd8; }
.status.err { color: #ffb3b3; }
.no-gl { color: var(--muted); padding: 30px; }

/* 3D labels */
.lbl { font: 12px var(--glyph); color: #e8e6df; text-shadow: 0 0 3px #000, 0 0 6px #000; white-space: nowrap; pointer-events: auto; cursor: pointer; user-select: none; }
.lbl.sel { color: var(--accent); font-weight: 600; }
.lbl.sign-lbl { font-size: 18px; color: #e8c25a; pointer-events: none; opacity: .85; }
.lbl.sign-lbl.small { font-size: 14px; }
.lbl.sign-lbl.sky { font-size: 16px; opacity: .7; }
.lbl.ring-tip { font-size: 15px; color: #fff; }
.lbl.aspect-lbl { font-size: 10.5px; color: #cfd6e6; opacity: .9; pointer-events: none; }
.lbl.compass, .lbl.cardinal { font: 600 12px var(--sans); color: #c9e0cf; pointer-events: none; }
.lbl.cardinal.minor { font-weight: 400; opacity: .6; font-size: 10px; }
.lbl.place-lbl { font: 600 12px var(--sans); color: #ffb3b3; pointer-events: none; }
.lbl.angle-lbl { font: 600 11px var(--sans); color: #fff; background: rgba(0,0,0,.45); padding: 1px 5px; border-radius: 4px; }
.lbl.cusp-lbl { font: 10px var(--sans); color: #aab3c6; pointer-events: none; }
.lbl.const-lbl { font: italic 11px var(--serif); color: #8fa4e8; opacity: .75; pointer-events: none; }
.lbl.sky-glyph { font-size: 15px; }
.lbl.below { opacity: .5; }

/* tables */
.tbl { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 500; font-size: 12px; }
.tbl td.num { text-align: right; font-family: var(--glyph); }
.tbl td.g { font: 18px var(--glyph); width: 24px; }
.tbl td.flag { color: var(--hard); font-size: 12px; }
.tbl tr[data-ref] { cursor: pointer; }
.tbl tr.sel td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid { border-collapse: collapse; font-family: var(--glyph); }
.grid th, .grid td { width: 30px; height: 30px; border: 1px solid var(--line); text-align: center; padding: 0; font-size: 15px; }
.grid th { font-weight: 400; cursor: pointer; }
.grid th.sel { color: var(--accent); }
.grid td { cursor: pointer; line-height: 1; }
.grid td small { display: block; font-size: 8.5px; color: var(--muted); }
.grid td.hit { background: color-mix(in srgb, var(--accent) 12%, transparent); }
h3 { font: 600 18px var(--serif); margin: 4px 0 6px; }
.big { font: 17px var(--serif); margin: 4px 0 10px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 8px 0; font-variant-numeric: tabular-nums; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.explain { color: var(--muted); border-left: 2px solid var(--accent); padding-left: 10px; }
.asp { list-style: none; padding: 0; margin: 8px 0; columns: 2; font-family: var(--glyph); }
.asp li { margin-bottom: 3px; break-inside: avoid; }
.warn { color: #f0c27a; }
ul.warn { padding-left: 18px; }
.choice { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* time bar */
.timebar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--panel); flex-wrap: nowrap; height: 50px; contain: layout paint; }
.tgroup { display: flex; gap: 4px; align-items: center; }
.timebar select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; }
.timebar input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.tlabel { font-variant-numeric: tabular-nums; color: var(--muted); width: 330px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; contain: strict; height: 20px; }
.play { min-width: 92px; }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--panel); border-left: 1px solid var(--line); z-index: 20; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.35); }
.drawer[hidden] { display: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 600 18px var(--serif); }
.x { border: 0; background: transparent; font-size: 18px; }
.drawer-body { overflow: auto; padding: 14px 16px 30px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; padding: 10px 12px; }
legend { padding: 0 6px; font: 600 13px var(--serif); color: var(--accent); }
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: 13px; }
label.full { width: 100%; }
.hint { color: var(--muted); font-size: 11px; }
input, select { background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; color: var(--fg); min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.row.three { display: grid; grid-template-columns: repeat(3, 1fr); }
.row.two { display: grid; grid-template-columns: 1fr 1fr; }
.suggest { list-style: none; margin: -4px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); max-height: 260px; overflow: auto; }
.suggest li { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 4px; flex-wrap: wrap; align-items: baseline; }
.suggest li.on, .suggest li:hover { background: var(--panel-2); }
.suggest .tz { margin-left: auto; font-size: 11px; color: var(--muted); }
.place-name { font-size: 12px; }
.confirm p { margin: 4px 0; }
.chart-list { list-style: none; padding: 0; margin: 10px 0; }
.chart-list li { display: flex; gap: 6px; margin-bottom: 6px; }
.chart-list .load { flex: 1; text-align: left; display: flex; flex-direction: column; }
.chart-list .del { width: 34px; }
.filter { width: 100%; margin-top: 10px; }
.file-btn { flex-direction: row; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; cursor: pointer; color: var(--fg); margin: 0; font-size: 14px; }
.settings select { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--accent); padding: 8px 14px; border-radius: 9px; z-index: 30; max-width: 90vw; }

/* wheel */
.w-ring { fill: none; stroke: var(--line); }
.w-inner { stroke: var(--line); }
.w-sign { stroke: var(--line); stroke-width: .6; }
.w-sign.el-0 { fill: color-mix(in srgb, var(--fire) 13%, transparent); }
.w-sign.el-1 { fill: color-mix(in srgb, var(--earth) 13%, transparent); }
.w-sign.el-2 { fill: color-mix(in srgb, var(--air) 13%, transparent); }
.w-sign.el-3 { fill: color-mix(in srgb, var(--water) 13%, transparent); }
.w-sign-glyph { font-size: 22px; }
.w-sign-glyph.el-0 { fill: var(--fire); } .w-sign-glyph.el-1 { fill: var(--earth); } .w-sign-glyph.el-2 { fill: var(--air); } .w-sign-glyph.el-3 { fill: var(--water); }
.w-ticks line { stroke: var(--muted); stroke-width: .6; opacity: .7; }
.w-cusp { stroke: var(--muted); stroke-width: .8; }
.w-angle { stroke: var(--fg); stroke-width: 1.8; }
.w-house-num { font: 11px var(--sans); fill: var(--muted); }
.w-cusp-deg { font: 8.5px var(--sans); fill: var(--muted); }
.w-angle-label { font: 600 12px var(--sans); fill: var(--fg); }
.w-aspect { stroke-width: 1.2; transition: stroke-opacity .2s; }
.w-aspect.minor { stroke-dasharray: 4 3; }
.w-aspect.dim { stroke-opacity: .08 !important; }
.w-aspect.hit { stroke-width: 2.2; }
.w-pglyph { font-size: 21px; fill: var(--fg); }
.w-pdeg { font: 9.5px var(--sans); fill: var(--muted); }
.w-ptick { stroke: var(--fg); stroke-width: 1.4; }
.w-leader { stroke: var(--muted); stroke-width: .5; }
.w-pdot { fill: var(--fg); }
.w-planet { cursor: pointer; }
.w-planet:hover .w-pglyph, .w-planet:focus .w-pglyph { fill: var(--accent); }
.w-planet.sel .w-pglyph { fill: var(--accent); font-weight: 700; }
.w-empty { fill: var(--muted); font: 14px var(--sans); }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 60vh; overflow: auto; }
  .split > * { min-width: 0; }
  body[data-mode="vedic"] .vedic-chart { width: 100%; max-height: none; }
  .left { border-right: 0; order: 2; }
  .right { order: 1; min-height: 60vh; }
  .timebar, .top { flex-wrap: wrap; height: auto; }
  .top-actions, .modes, .views { flex-wrap: wrap; max-width: 100%; }
  .top { row-gap: 6px; }
  .tlabel { width: 100%; text-align: left; }
  .left { contain: none; }
}
@media (prefers-reduced-motion: reduce) { .fade { transition: none; } }


.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-width: min(720px, 100%); max-height: 90%; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.export-img { width: 100%; height: auto; background: var(--bg); border-radius: 8px; }
.export-text { width: 100%; height: 50vh; font: 12px ui-monospace, monospace; }

/* ---------- Show me ---------- */
.left { position: relative; }
.wheel-pop { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 5; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 34px 8px 10px; box-shadow: 0 6px 24px rgba(0,0,0,.35); font-size: 13px; }
.wheel-pop .x { position: absolute; top: 4px; right: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 8px; }
.sm-row, .showme-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.showme-row { margin: 10px 0 4px; }
.sm-pill { font: inherit; font-size: 12.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--fg); cursor: pointer; }
.sm-pill:hover, .sm-pill:focus-visible { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.sm-btn { font-size: 10px; line-height: 1; padding: 3px 5px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: var(--accent); cursor: pointer; }
.sm-btn:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
table.grid td[data-sm] { cursor: pointer; }
.showme { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); width: min(560px, calc(100% - 32px)); z-index: 6; background: rgba(12,14,22,.88); backdrop-filter: blur(8px); color: #ece8dc; border: 1px solid rgba(232,194,90,.35); border-radius: 12px; padding: 12px 14px 10px; box-shadow: 0 10px 34px rgba(0,0,0,.5); }
.showme .sm-title { font-family: var(--glyph); font-weight: 600; color: #e8c25a; font-size: 14px; margin-bottom: 4px; }
.showme .sm-text { font-family: var(--serif); font-size: 15.5px; line-height: 1.45; min-height: 2.9em; }
.showme .sm-text.in { animation: smIn .45s ease; }
@keyframes smIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.showme .sm-learn { font-size: 13px; color: #b9bccb; margin-top: 6px; line-height: 1.4; border-left: 2px solid rgba(232,194,90,.5); padding-left: 8px; }
.showme .sm-learn:empty { display: none; }
.showme .sm-graph:empty { display: none; }
.showme .sm-graph { margin-top: 8px; }
.sm-speed { width: 100%; max-width: 300px; height: 70px; display: block; }
.sm-speed .zero { stroke: #666c80; stroke-dasharray: 3 3; }
.sm-speed .curve { fill: none; stroke: #e8c25a; stroke-width: 1.8; }
.sm-speed .retro { fill: rgba(224,86,91,.16); }
.sm-speed .dot { fill: #fff; }
.sm-speed .lbl { fill: #8d93a3; font-size: 10px; font-family: var(--sans); }
.showme .sm-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.showme .sm-actions button { font: inherit; font-size: 12.5px; padding: 4px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: inherit; cursor: pointer; }
.showme .sm-actions button.primary { background: #e8c25a; color: #1a1610; border-color: #e8c25a; }
.showme:not(.ended) [data-sm="replay"] { opacity: .6; }
.lbl.sm-tip { background: rgba(10,12,20,.82); color: #ffe7a3; border: 1px solid rgba(232,194,90,.5); border-radius: 6px; padding: 2px 6px; font-size: 12px; white-space: nowrap; font-family: var(--glyph); }
.lbl.sm-date { color: #cfe0ff; font-size: 12px; font-family: var(--sans); background: rgba(10,12,20,.7); padding: 1px 5px; border-radius: 4px; }
.lbl.sm-hi { color: #ffe7a3 !important; font-size: 20px; }
.lbl.const-lbl.sm { font-size: 10.5px; color: #c9b9ff; white-space: nowrap; }
@media (max-width: 700px) { .showme { bottom: 12px; padding: 10px; } .showme .sm-text { font-size: 14.5px; } }
.w-outer-ring { fill: none; stroke: var(--line); }
.w-outer-label { font: 12px var(--sans); fill: var(--muted); }
.w-pglyph.outer { fill: #3f9cc4; }
.w-pglyph.outer.small { font: 600 12px var(--sans); }
.w-ptick.outer { stroke: #3f9cc4; }
.w-aspect.cross { stroke-width: 1.3; }

/* ---------- modes & transits ---------- */
.modes { display: flex; gap: 2px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.modes button { border: 0; background: transparent; padding: 5px 12px; }
.modes button[aria-selected="true"] { background: #3f9cc4; color: #fff; font-weight: 600; }
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.subtabs button { font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.subtabs button[aria-selected="true"] { background: color-mix(in srgb, #3f9cc4 30%, var(--panel-2)); border-color: #3f9cc4; }
.tr-moment { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.tr-moment label { margin: 0; }
.tr-moment button.on { border-color: #e0565b; color: #ff8a8e; }
.tr-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.tr-item { border-bottom: 1px solid var(--line); padding: 7px 2px; cursor: pointer; }
.tr-item:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tr-head .g { font: 17px var(--glyph); min-width: 62px; }
.tr-head .sm-btn { margin-left: auto; }
.tr-text { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tr-when { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; padding-left: 70px; }
.tr-item.sky .tr-head .g { min-width: 24px; }
.tr-item.sky .date { margin-left: auto; }
button.date { font-size: 12px; padding: 2px 8px; border-radius: 6px; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, #3f9cc4 25%, transparent); color: var(--fg); }
.tr-month { margin: 14px 0 2px; font: 600 14px var(--serif); color: var(--accent); }
.tr-form details { margin: 8px 0; }
.tr-form summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 8px 0; }
.chip { flex-direction: row; align-items: center; gap: 4px; margin: 0; font-size: 12.5px; color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px 2px 6px; font-family: var(--glyph); }
.chip.strong { border-color: var(--accent); }
.chip input { margin: 0; }
.tl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.tl-wrap.wide { max-height: 80vh; overflow: auto; }
.timeline { display: block; font-family: var(--glyph); }
.timeline .tl-grid { stroke: var(--line); }
.timeline .tl-month { font: 11px var(--sans); fill: var(--muted); }
.timeline .tl-label { font-size: 13px; fill: var(--fg); }
.timeline .tl-bar { opacity: .75; }
.timeline .tl-row { cursor: pointer; }
.timeline .tl-row:hover .tl-bar { opacity: 1; }
.timeline .tl-exact { stroke: #fff; stroke-width: 2; }
.timeline .tl-today { stroke: var(--accent); stroke-width: 2; }
.timeline .tl-today-lbl { font: 10px var(--sans); fill: var(--accent); }
.timeline .tl-current { stroke: #3f9cc4; stroke-width: 1.5; stroke-dasharray: 4 3; }
.timeline .tl-mark { cursor: pointer; font-size: 12px; fill: var(--muted); }
.timeline .tl-mark.hot { fill: var(--accent); }
.report h3 { margin-top: 12px; }
.report h4 { font: 600 14px var(--serif); color: var(--accent); margin: 14px 0 4px; }
.report .rep-item { padding: 4px 0 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.report .rep-item p { margin: 3px 0; }
.modal-box.wide { max-width: 96vw; width: 1360px; }
.print-page { background: #fff; color: #222; padding: 24px 28px; border-radius: 8px; max-width: 800px; margin: 0 auto; }
.print-page .muted { color: #666; }
.print-page h4 { color: #8a6d1d; }
.lbl.sm-sky { font-size: 15px; pointer-events: none; }
.lbl.sm-sky.ghost { color: #9aa3b5; opacity: .75; }
.lbl.sm-sky.now { color: #7fd0f0; }
@media print {
  body * { visibility: hidden !important; }
  .print-page, .print-page * { visibility: visible !important; }
  .print-page { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}
@media (max-width: 900px) { .modes button { padding: 5px 8px; } .top .brand { display: none; } }
body[data-mode="transits"] .wheel, body[data-mode="relationship"] .wheel { max-height: 50vh; width: auto; max-width: 100%; }

/* ---------- relationship ---------- */
.modes button[data-mode="relationship"][aria-selected="true"] { background: #b46cc0; }
.rel-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.rel-who button { font-size: 12px; padding: 3px 9px; }
.who { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font: 700 11px var(--sans); color: #fff; }
.who.a { background: var(--accent); color: #1a1508; }
.who.b { background: #3f9cc4; }
.syn-wrap { overflow-x: auto; }
.grid.syn th.corner { font: 10px var(--sans); white-space: nowrap; padding: 0 4px; }
.grid.syn td[data-x] { cursor: pointer; }
.grid.syn td[data-x]:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.overlays h4 { font: 600 13px var(--serif); margin: 12px 0 4px; }
.overlay-list { list-style: none; padding: 0; margin: 0; font-size: 13px; columns: 2; }
.overlay-list .g { font-family: var(--glyph); width: 18px; display: inline-block; }
.compat-score .bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0; background: var(--line); }
.compat-score .bar .h { background: #4f8fe6; }
.compat-score .bar .c { background: #e0565b; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cmp-col { min-width: 0; }
.cmp-wheel .wheel { max-width: 100%; }
.tbl.compact td { padding: 2px 5px; font-size: 12.5px; }
.chart-list.picker li.sel .load { border-color: var(--accent); }
.lbl.ring-tip.partner { color: #e7a6ec; font-size: 13px; pointer-events: none; }
body[data-mode="relationship"] .timebar { opacity: .45; pointer-events: none; }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } .overlay-list { columns: 1; } }

/* ---------- chart library ---------- */
.lib-nav { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 8px; }
.lib-chip { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; }
.lib-chip.on { background: color-mix(in srgb, var(--accent) 25%, var(--panel-2)); border-color: var(--accent); }
.lib-search { display: flex; gap: 6px; }
.lib-search .filter { margin: 0; flex: 1; }
.chart-list.lib li { display: block; margin-bottom: 6px; }
.lib-row { display: flex; gap: 6px; align-items: stretch; }
.lib-row .load { flex: 1; text-align: left; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lib-row .load b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.star { width: 34px; font-size: 17px; color: var(--muted); padding: 0; }
.star.on { color: var(--accent); }
.more { width: 34px; padding: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.tag { font-size: 11px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, #3f9cc4 22%, transparent); }
.lib-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0 10px; background: var(--panel-2); }
.lib-edit h4 { margin: 0 0 8px; font: 600 15px var(--serif); }
.lib-edit textarea, .lib-backup textarea { width: 100%; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font: inherit; }
.lib-confirm { margin: 6px 0 4px 40px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #f0c27a; }
button.danger { border-color: #e0565b; color: #ff8a8e; }
.lib-backup { border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 12px; margin: 8px 0; }
.lib-backup h4 { margin: 0 0 6px; font: 600 15px var(--serif); }
.rel-picker { margin-top: 4px; }

/* ---------- knowledge badges & glossary ---------- */
.kbs { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.kb { display: inline-block; font: 600 10.5px var(--sans); letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; border: 1px solid; vertical-align: middle; cursor: help; white-space: nowrap; }
.kb-astronomy { color: #5aa8e6; border-color: color-mix(in srgb, #5aa8e6 60%, transparent); background: color-mix(in srgb, #5aa8e6 12%, transparent); }
.kb-tradition { color: #d7a847; border-color: color-mix(in srgb, #d7a847 60%, transparent); background: color-mix(in srgb, #d7a847 12%, transparent); }
.kb-interpretation { color: #c58ad6; border-color: color-mix(in srgb, #c58ad6 60%, transparent); background: color-mix(in srgb, #c58ad6 12%, transparent); }
.showme .sm-kinds { margin-bottom: 4px; }
.term { border-bottom: 1px dotted currentColor; cursor: help; }
.term:hover, .term:focus-visible { color: var(--accent); }
.term-pop { position: fixed; z-index: 50; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.35); font-size: 13px; }
.term-card p { margin: 6px 0; }
.term-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.glossary .term-card { border-bottom: 1px solid var(--line); padding: 10px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: pre; }

/* ---------- Vedic ---------- */
.modes button[data-mode="vedic"][aria-selected="true"] { background: #c46a3c; }
.vedic-wrap { padding: 8px 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vedic-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.vedic-controls select { font-size: 12.5px; padding: 3px 6px; }
.vedic-controls button { font-size: 12.5px; padding: 3px 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button[aria-pressed="true"] { background: color-mix(in srgb, #c46a3c 30%, var(--panel-2)); }
.vedic-chart-host { width: 100%; display: flex; justify-content: center; }
.vedic-chart { width: 100%; max-width: 470px; height: auto; font-family: var(--sans); }
body[data-mode="vedic"] .vedic-chart { max-height: 52vh; width: auto; max-width: 100%; }
.vc-cell { fill: color-mix(in srgb, #c46a3c 4%, var(--bg)); stroke: none; }
.vc-cell.lagna { fill: color-mix(in srgb, #c46a3c 16%, var(--bg)); }
.vc-frame { fill: none; stroke: var(--fg); stroke-opacity: .55; stroke-width: 1.6; }
.vc-line { fill: none; stroke: var(--fg); stroke-opacity: .45; stroke-width: 1.2; }
.vedic-chart.south .vc-cell, .vedic-chart.east .vc-cell { stroke: var(--fg); stroke-opacity: .4; stroke-width: 1.1; }
.vc-signno { font-size: 12px; fill: var(--muted); }
.vc-signname { font-size: 10.5px; fill: var(--muted); }
.vc-asc { font: 600 11px var(--sans); fill: #c46a3c; }
.vc-asc-mark { stroke: #c46a3c; stroke-width: 2; }
.vc-title { font: 600 13px var(--serif); fill: var(--fg); }
.vc-planet { cursor: pointer; }
.vc-pl { font: 600 15px var(--sans); fill: var(--fg); }
.vc-deg { font-size: 9.5px; font-weight: 400; fill: var(--muted); baseline-shift: super; }
.vc-flag { font-size: 10px; fill: #e0565b; }
.vc-planet:hover .vc-pl, .vc-planet:focus .vc-pl { fill: var(--accent); }
.vc-planet.sel .vc-pl { fill: var(--accent); text-decoration: underline; }
.vc-planet.dg-exalted .vc-pl { fill: #4fbf8a; }
.vc-planet.dg-debilitated .vc-pl { fill: #e0565b; }
.vc-planet.sel.dg-exalted .vc-pl, .vc-planet.sel.dg-debilitated .vc-pl { fill: var(--accent); }
.vc-drishti { fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-opacity: .8; }
.vc-arrowhead { fill: var(--accent); }
.vhead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.vtbl td:nth-child(5) { white-space: nowrap; }
.tbl tr[data-vref] { cursor: pointer; }
.dz-timeline { width: 100%; height: auto; margin: 6px 0; font-family: var(--sans); }
.dz-bar rect { fill: color-mix(in srgb, var(--accent) 30%, transparent); stroke: var(--bg); stroke-width: 1; cursor: pointer; }
.dz-bar:nth-child(odd) rect { fill: color-mix(in srgb, #c46a3c 35%, transparent); }
.dz-bar:hover rect { fill: var(--accent); }
.dz-bar text { font: 600 11px var(--sans); fill: var(--fg); pointer-events: none; }
.dz-tick { font-size: 10px; fill: var(--muted); }
.dz-today { stroke: #e0565b; stroke-width: 2; }
.dz-today-lbl { font-size: 10px; fill: #e0565b; }
.dz-list { list-style: none; padding: 0; margin: 4px 0 10px; }
.dz-list li { margin: 2px 0; }
.dz-list li.now .dz-row { border-color: var(--accent); }
.dz-list li.open .dz-row { background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); }
.dz-row { width: 100%; text-align: left; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 13px; }
ul.plain { padding-left: 18px; }
.vg-bar { width: 100%; height: auto; font-family: var(--sans); }
.vg-part rect { fill: var(--panel-2); stroke: var(--line); }
.vg-part.hit rect { fill: color-mix(in srgb, var(--accent) 35%, var(--panel-2)); }
.vg-part text { font-size: 10px; fill: var(--fg); }
.vg-mark { stroke: #e0565b; stroke-width: 2; }
.vg-cap { font-size: 11px; fill: var(--muted); }
.tbl.pch th { text-align: left; color: var(--muted); font-weight: 500; }
.threemaps { width: 100%; height: auto; font-family: var(--sans); }
.tm-s { stroke: var(--bg); stroke-width: .6; }
.tm-s.el0 { fill: color-mix(in srgb, var(--fire) 35%, transparent); } .tm-s.el1 { fill: color-mix(in srgb, var(--earth) 35%, transparent); }
.tm-s.el2 { fill: color-mix(in srgb, var(--air) 35%, transparent); } .tm-s.el3 { fill: color-mix(in srgb, var(--water) 35%, transparent); }
.tm-c.c0 { fill: color-mix(in srgb, #8a6fd8 40%, transparent); } .tm-c.c1 { fill: color-mix(in srgb, #b39cf0 30%, transparent); }
.tm-c { stroke: var(--bg); stroke-width: .6; }
.tm-lbl { font-size: 9.5px; fill: var(--fg); pointer-events: none; }
.tm-pl line { stroke: var(--fg); stroke-width: 1.2; }
.tm-pl text { font: 600 10px var(--sans); fill: var(--fg); }
.tm-pl { cursor: pointer; }
.tm-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin-bottom: 8px; }
.lbl.nak-lbl { font: italic 10.5px var(--serif); color: #d6bfff; opacity: .8; pointer-events: none; }
.tabs { flex-wrap: wrap; row-gap: 0; }
.tabs button { white-space: nowrap; }

/* ---------- houses & build ---------- */
.w-planet.flash .w-pglyph { fill: var(--accent); font-size: 28px; transition: font-size .2s; }
.w-angle.flash { stroke: var(--accent); stroke-width: 3.5; }
.lbl.house-num-lbl { font: 700 15px var(--sans); color: #9fe6d6; text-shadow: 0 0 4px #000, 0 0 8px #000; pointer-events: none; }
.lbl.cap-lbl { font: 600 11px var(--sans); color: #ff9a9a; pointer-events: none; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { font-size: 12.5px; padding: 4px 9px; }
.demo-note { border: 1px solid #e0565b; border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; background: color-mix(in srgb, #e0565b 8%, transparent); }
.demo-note p { margin: 0 0 6px; }

/* precession time machine (full-window view) */
.tm { position: fixed; inset: 0; z-index: 30; background: var(--bg); overflow: auto; padding: 12px 16px 40px; }
.tm[hidden] { display: none; }
.tm-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; position: relative; padding-right: 44px; }
.tm-head h2 { margin: 0; font: 600 20px var(--serif); }
.tm-head .x { position: absolute; right: 0; top: 0; }
.tm-time { display: flex; align-items: center; gap: 10px; }
.tm-time input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.tm-year { display: flex; gap: 4px; }
.tm-year { align-items: center; }
.tm-year input, .tm-year select { width: auto; display: inline-block; margin: 0; }
.tm-year input { width: 6.5em; }
.tm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.tm-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.tm-fig { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.tm-fig figcaption { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.tm-strip { grid-column: 1 / -1; }
.tm-svg svg { width: 100%; height: auto; display: block; }
.tm-polar .tm-svg svg { max-height: 68vh; }
.tm-bg { fill: #070910; stroke: var(--line); stroke-width: .3; }
.tm-stars circle { fill: #f2efe6; }
.tm-lines path { fill: none; stroke: #6f87c9; stroke-width: .18; opacity: .7; }
.tm-path { fill: none; stroke: var(--accent); stroke-width: .25; stroke-dasharray: .8 .8; opacity: .8; }
.tm-tick { fill: var(--accent); }
.tm-ticklbl { fill: var(--accent); font-size: 1.9px; text-anchor: middle; dominant-baseline: middle; }
.tm-star { fill: #e9e6dc; font-size: 2.1px; }
.tm-con { fill: #8fa4dd; font-size: 2.2px; font-style: italic; text-anchor: middle; opacity: .6; }
.tm-nep { stroke: #8fa4dd; stroke-width: .3; }
.tm-nep-t { fill: #8fa4dd; font-size: 1.7px; text-anchor: middle; opacity: .8; }
.tm-pole circle { fill: none; stroke: var(--hard); stroke-width: .45; }
.tm-pole path { stroke: var(--hard); stroke-width: .45; }
.tm-pole-key { color: var(--hard); }
.tm-read { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tm-big { font: 600 30px var(--serif); }
.tm-dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 12px 0; }
.tm-dl dt { color: var(--muted); font-size: 12.5px; }
.tm-dl dd { margin: 0; }
.tm-ay summary { cursor: pointer; color: var(--muted); }
.tm-cards { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.tm-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tm-card h3 { margin: 0 0 4px; font: 600 16px var(--serif); }
.tm-card ul { padding-left: 18px; }
.tm-row-l { fill: var(--muted); font-size: 11px; }
.tm-row-t { fill: var(--fg); font-size: 11px; text-anchor: middle; }
.tm-trop { fill: color-mix(in srgb, var(--accent) 20%, var(--panel-2)); stroke: var(--line); }
.tm-trop.odd { fill: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.tm-sid { fill: color-mix(in srgb, var(--minor) 22%, var(--panel-2)); stroke: var(--line); }
.tm-sid.odd { fill: color-mix(in srgb, var(--minor) 12%, var(--panel-2)); }
.tm-iau { fill: color-mix(in srgb, var(--soft) 24%, var(--panel-2)); stroke: var(--line); }
.tm-iau.odd { fill: color-mix(in srgb, var(--soft) 12%, var(--panel-2)); }
.tm-eq line { stroke: var(--hard); stroke-width: 2; }
.tm-eq text { fill: var(--hard); font-size: 11px; }
.tm-sun line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tm-sun text { fill: var(--accent); font-size: 11px; }
.tm-sstar { fill: var(--fg); }
.tm-sstar-t { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.tm-dipper { width: 100%; max-width: 420px; height: auto; display: block; background: #070910; border-radius: 8px; }
.tm-dnow { fill: none; stroke: #6f87c9; stroke-width: .15; stroke-dasharray: .5 .4; }
.tm-dnow-s { fill: #6f87c9; }
.tm-dthen { fill: none; stroke: var(--accent); stroke-width: .18; }
.tm-dthen-s { fill: #fff; }
.explore { display: grid; gap: 8px; margin-bottom: 14px; }
.explore-btn { text-align: left; padding: 10px 12px; }
.explore-btn b { display: block; font: 600 15px var(--serif); }
.sky-epoch { position: absolute; left: 12px; top: 52px; z-index: 3; background: var(--panel); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 6px 4px 12px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.sky-epoch[hidden] { display: none; }
@media (max-width: 900px) { .tm-grid { grid-template-columns: 1fr; } .tm-time { flex-wrap: wrap; } .tm-time input[type=range] { flex-basis: 100%; order: 3; } }

/* cycles view */
.cy-tabs { margin: 4px 0 12px; }
.cy-body { display: grid; gap: 14px; }
.cy-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cy-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.cy-controls label { display: flex; flex-direction: row; gap: 6px; align-items: center; margin: 0; font-size: 13px; color: var(--fg); }
.cy-controls select, .cy-controls input { width: auto; margin: 0; }
.cy-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.cy-two .tm-svg svg { max-height: 62vh; }
.cy-h { margin: 4px 0 0; font: 600 16px var(--serif); }
.cy-ring { fill: #070910; stroke: var(--line); stroke-width: .4; }
.cy-sign { fill: var(--muted); font-size: 7px; text-anchor: middle; font-family: var(--glyph); }
.cy-sunpath { fill: none; stroke: #e8c25a; stroke-width: .4; stroke-dasharray: 1.2 1.2; opacity: .6; }
.cy-path { fill: none; stroke: #f0d68a; stroke-width: .45; }
.cy-path2 { fill: none; stroke: #7fb8d6; stroke-width: .45; }
.cy-meet { fill: var(--hard); }
.cy-earth { fill: #4f8fe6; }
.cy-sun { fill: #e8c25a; }
.cy-lbl { fill: #c9cdd8; font-size: 5.5px; }
.cy-dance { fill: none; stroke: #e8c25a; stroke-width: .18; opacity: .5; }
.cy-orbit { fill: none; stroke: #c9cdd8; stroke-width: .35; opacity: .7; }
.cy-wedge { fill: color-mix(in srgb, var(--accent) 16%, var(--panel-2)); stroke: var(--line); stroke-width: .3; }
.cy-wedge.odd { fill: color-mix(in srgb, var(--accent) 8%, var(--panel-2)); }
.cy-star { fill: color-mix(in srgb, var(--hard) 10%, transparent); stroke: var(--hard); stroke-width: .6; }
.cy-yr { fill: var(--muted); font-size: 5px; text-anchor: middle; }
.cy-loops { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.cy-loop svg { width: 100%; height: auto; display: block; background: #070910; border-radius: 6px; margin: 6px 0; }
.cy-direct { fill: none; stroke: #c9cdd8; stroke-width: 1.6; }
.cy-retro { fill: none; stroke: var(--hard); stroke-width: 2.2; }
.cy-st { fill: var(--accent); }
.cy-tick { stroke: var(--line); stroke-width: 1; }
.cy-ticklbl { fill: var(--muted); font-size: 10px; }
.cy-rowlbl { fill: var(--fg); font-size: 12px; }
.cy-rowline { stroke: var(--line); stroke-width: 1; }
.cy-ev { stroke: #0b0d14; stroke-width: 1; }
.cy-now { stroke: var(--hard); stroke-width: 1.5; stroke-dasharray: 4 3; }
.cy-nowlbl { fill: var(--hard); font-size: 11px; }
.cy-life tr.past td, .cy-ecls tr.past td { color: var(--muted); }
.cy-ecls tr.hit td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.cy-ecl { padding: 1px 6px; border-radius: 6px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.cy-ecl.solar { border-color: var(--accent); }
.cy-ecl.total, .cy-ecl.annular, .cy-ecl.hybrid { font-weight: 600; }
.cy-season { fill: color-mix(in srgb, var(--soft) 22%, transparent); }
.cy-emark { stroke-width: 2; }
.cy-emark.solar { stroke: var(--accent); }
.cy-emark.lunar { stroke: #c9cdd8; }
.cy-decl { fill: none; stroke: var(--accent); stroke-width: 1.4; }
.cy-age { min-width: 6em; }
.tradition-note { border: 1px solid color-mix(in srgb, #d8a24a 50%, var(--line)); background: color-mix(in srgb, #d8a24a 8%, var(--panel)); border-radius: var(--radius); padding: 10px 12px; }
.earth-note { top: auto; bottom: 64px; max-width: calc(100% - 24px); border-radius: 12px; }
.back-note { top: 92px; }

/* explain this number */
.xn { cursor: help; text-decoration: underline dotted color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px; border-radius: 3px; }
.xn:hover, .xn:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.x-card p { margin: 6px 0; }
.x-val { font-variant-numeric: tabular-nums; color: var(--accent); margin-left: 4px; }

/* learn: lessons, history, traditions */
.ln-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; }
.ln-open { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; padding: 9px 12px; }
.ln-open > span:last-child { display: flex; flex-direction: column; }
.ln-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-weight: 600; flex: none; }
.ln-item.done .ln-n { background: var(--minor); color: #0b0d14; border-color: var(--minor); }
.ln-bar { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin: 6px 0; }
.ln-bar span { display: block; height: 100%; background: var(--minor); }
.lesson { position: fixed; left: 0; top: 52px; bottom: 0; width: min(500px, 100vw); z-index: 26; background: var(--panel); border-right: 1px solid var(--line); box-shadow: 10px 0 40px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.lesson[hidden] { display: none; }
.lesson.collapsed { top: auto; bottom: 64px; width: auto; background: none; border: 0; box-shadow: none; left: 12px; }
.ln-expand { background: var(--panel); border: 1px solid var(--accent); border-radius: 999px; padding: 8px 14px; }
.ln-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ln-head b { font: 600 16px var(--serif); flex: 1; }
.ln-dots { display: flex; gap: 4px; }
.ln-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ln-dot.past { background: var(--muted); }
.ln-dot.on { background: var(--accent); }
.ln-body { padding: 12px 16px; overflow: auto; flex: 1; }
.ln-body h3 { margin: 0 0 8px; font: 600 19px var(--serif); }
.ln-text { font-size: 15px; line-height: 1.55; }
.ln-text .fact { color: var(--accent); }
.ln-nav { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.ln-quiz { padding-left: 0; list-style: none; display: grid; gap: 12px; }
.ln-opts { display: grid; gap: 6px; }
.ln-opt { text-align: left; }
.ln-opt.right { border-color: var(--minor); background: color-mix(in srgb, var(--minor) 18%, var(--panel-2)); }
.ln-opt.wrong { border-color: var(--hard); background: color-mix(in srgb, var(--hard) 14%, var(--panel-2)); }
.ln-opt:disabled { cursor: default; opacity: 1; color: var(--fg); }
.ln-q .ok { color: var(--minor); }
.ln-score { border-top: 1px solid var(--line); padding-top: 10px; }
.hist { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 0; }
.hist-item { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist-when { font: 600 15px var(--serif); display: flex; flex-direction: column; border-left: 3px solid var(--line); padding-left: 10px; }
.hist-item.astrology .hist-when { border-color: #d7a847; }
.hist-item.astronomy .hist-when { border-color: #5aa8e6; }
.hist-item.both .hist-when { border-image: linear-gradient(#d7a847, #5aa8e6) 1; }
.hist-body p { margin: 4px 0; }
.hist-src a { color: var(--muted); }
.tr-xiu { fill: color-mix(in srgb, #e0614a 22%, var(--panel-2)); stroke: var(--line); stroke-width: .3; }
.tr-xiu.odd { fill: color-mix(in srgb, #e0614a 12%, var(--panel-2)); }
.tr-nak { fill: color-mix(in srgb, var(--minor) 20%, var(--panel-2)); stroke: var(--line); stroke-width: .3; }
.tr-nak.odd { fill: color-mix(in srgb, var(--minor) 10%, var(--panel-2)); }
.tr-hz { fill: var(--fg); font-size: 5.5px; text-anchor: middle; }
.tr-nk { fill: var(--muted); font-size: 4px; text-anchor: middle; }
.tr-c { fill: var(--muted); font-size: 6px; text-anchor: middle; }
.tm-card .tm-svg svg[aria-label="Xiu and nakshatras"] { max-width: 520px; margin: 8px auto; }
@media (max-width: 700px) { .hist-item { grid-template-columns: 1fr; gap: 4px; } .lesson { top: 0; } }

/* journal and meaning notes */
.jn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.jn-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.jn-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jn-tools { margin-left: auto; display: flex; gap: 6px; }
.jn-text { margin: 6px 0; white-space: normal; }
.jn-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.jn-chip { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.jn-count { font-size: 16px; }
.cal { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.cal-day { border-left: 3px solid var(--line); padding-left: 10px; }
.cal-day ul { list-style: none; padding: 0; margin: 4px 0 0; }
.cal-ev { font-size: 13.5px; }
.cal-ev.eclipse, .cal-ev.lunation { font-weight: 600; }
.cal-ev.transit { color: var(--accent); }
.mn-btn { font-size: 12px; padding: 2px 8px; margin: 4px 0; background: none; border: 1px dashed var(--line); color: var(--muted); }
.mn-btn:hover { color: var(--fg); border-color: var(--muted); }
.mn-note { border-left: 3px solid #c58ad6; padding: 4px 10px; margin: 4px 0; background: color-mix(in srgb, #c58ad6 8%, transparent); border-radius: 0 6px 6px 0; }
.mn-tag { font: 600 11px var(--sans); color: #c58ad6; text-transform: uppercase; letter-spacing: .04em; margin-right: 4px; }
.mn-orig summary { cursor: pointer; color: var(--muted); }
.mn-modal textarea { width: 100%; box-sizing: border-box; }
.mn-modal .modal-box { width: min(560px, 100%); }
.mn-wrap { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; flex-direction: column; }

/* your sky, outside */
.od-hits { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.od-tbl tr.up td:first-child { font-weight: 600; }
.od-dome { fill: #070910; stroke: var(--line); stroke-width: .4; }
.od-dome.day { fill: #1b2a44; }
.od-ring { fill: none; stroke: #2a3040; stroke-width: .3; }
.od-card { fill: var(--muted); font-size: 4px; text-anchor: middle; }
.od-pl { fill: #f0d68a; }
.od-pl.moon { fill: #e9e6dc; }
.od-lbl { fill: #e9e6dc; font-size: 3.4px; }
.od-fwd { stroke: var(--accent); stroke-width: .5; stroke-dasharray: 1 1; }
.od-finder { position: relative; display: grid; gap: 8px; }
.od-finder .tm-svg svg { max-width: 360px; margin: 0 auto; display: block; }
.od-guide { font-size: 18px; text-align: center; font-weight: 600; }
.od-video { width: 100%; max-height: 60vh; object-fit: cover; border-radius: 10px; background: #000; }
.od-marks { position: absolute; inset: 0; pointer-events: none; }
.od-mark { position: absolute; transform: translate(-50%, -50%); color: #fff; text-shadow: 0 0 4px #000; font-weight: 600; }
.od-toggles { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0; }
.od-sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 4px; }
.lbl.star-pointer { color: #ffe9a8; font-weight: 600; text-shadow: 0 0 6px #000; }

/* ---------- cosmic scale ---------- */
.cs-stops { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cs-wrap { position: relative; }
.cs-canvas { display: block; width: 100%; height: min(62vh, 560px); border-radius: 10px; background: #04050a; cursor: zoom-in; }
.cs-zoom { position: absolute; left: 12px; right: 12px; bottom: 10px; width: calc(100% - 24px); }
.cs-scale { position: absolute; left: 14px; top: 12px; color: #e9e6dc; font-size: 12px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.cs-scale span { display: block; height: 6px; border: 1px solid #e9e6dc; border-top: none; }
.cs-caption { min-height: 2.6em; margin: 8px 2px 12px; font-size: 15px; }
.cs-bars { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.cs-bars li { display: grid; grid-template-columns: minmax(7em, 11em) 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.cs-bn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-bar { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #f2c94c, #6f87e0); }
.cs-bl { color: var(--muted, #9aa); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .cs-bars li { grid-template-columns: 7em 1fr auto; } .cs-canvas { height: 52vh; } }

/* ---------- accessibility ---------- */
:root.palette-classic { --hard: #e0565b; --soft: #4f8fe6; --conj: #e8c25a; --minor: #4fbf8a; }
:root.reduce-motion *, :root.reduce-motion *::before, :root.reduce-motion *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { :root:not(.motion-full) * { scroll-behavior: auto !important; } }
.tm:focus { outline: none; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--accent); color: #1a1508; padding: 6px 10px; border-radius: 6px; }
.skip-link:focus { top: 8px; }
/* phones, Vedic mode: the chart first, the 3D view below it */
@media (max-width: 900px) { body[data-mode="vedic"] .split { grid-template-rows: max-content 60vh; } body[data-mode="vedic"] .left { order: 1; } body[data-mode="vedic"] .right { order: 2; } }
