/* ============================================================
   ASTROLABE — celestial dark theme
   ============================================================ */
:root {
  --panel-w: 408px;
  --bg0: #06080f;
  --bg1: #0b0f1d;
  --bg2: #10162a;
  --panel: #0e1322;
  --panel-glass: rgba(14, 19, 34, 0.88);
  --card: #141b30;
  --line: rgba(148, 163, 204, 0.14);
  --line-gold: rgba(232, 201, 106, 0.25);
  --gold: #e8c96a;
  --gold-bright: #f6dd8f;
  --gold-dim: #9c8542;
  --ink: #e8ebf4;
  --muted: #8b93a7;
  --faint: #5a6175;
  --danger: #e05555;
  --ok: #4fc9a4;
  --fire: #ff7a59;
  --earth: #7ec97e;
  --air: #f2d06b;
  --water: #5bb8e8;
  --font-ui: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-serif: 'Cormorant Garamond', 'Georgia', serif;
  --glyph-font: 'Segoe UI Symbol', 'Noto Sans Symbols', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 75% -10%, rgba(64, 84, 158, 0.16), transparent 60%),
    radial-gradient(900px 700px at -5% 110%, rgba(120, 84, 158, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
#stars .st {
  position: absolute; border-radius: 50%; background: #cdd6ee;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .18; } 50% { opacity: .7; } }

/* ---------------- header ---------------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 18px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20,26,46,0.9), rgba(13,17,30,0.75));
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; user-select: none; }
.brand-mark {
  font-size: 22px; color: var(--gold);
  text-shadow: 0 0 12px rgba(232, 201, 106, 0.55);
  animation: spin-slow 60s linear infinite;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
.brand-text h1 {
  font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 2.5px;
  background: linear-gradient(180deg, #f8e7ae, #cfa845);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.1;
}
.brand-sub { font-size: 10px; letter-spacing: 2.6px; text-transform: uppercase; color: var(--faint); }

.modes { display: flex; gap: 4px; margin-left: 12px; background: rgba(6,9,18,0.6); padding: 4px; border-radius: 10px; border: 1px solid var(--line); }
.mode-btn {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--muted); background: transparent; border: none; border-radius: 7px;
  padding: 6px 14px; cursor: pointer; transition: all .18s;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active {
  color: #0d1020; background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 0 14px rgba(232, 201, 106, 0.35);
}

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------------- chips & buttons ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  background: rgba(20, 27, 48, 0.8); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; transition: all .18s;
}
.chip:hover { color: var(--ink); border-color: var(--line-gold); }
.chip-toggle.on {
  color: var(--gold-bright); border-color: var(--line-gold);
  background: rgba(232, 201, 106, 0.08);
  box-shadow: inset 0 0 12px rgba(232, 201, 106, 0.07);
}
.chip-loc .loc-ico { color: var(--gold); }

.btn {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 500;
  color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--line-gold); background: #1a2340; }
.btn:active { transform: translateY(1px); }
.btn-gold {
  color: #131020; font-weight: 600;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-color: transparent;
}
.btn-gold:hover { background: linear-gradient(180deg, #fff0bd, var(--gold-bright)); box-shadow: 0 0 16px rgba(232,201,106,.3); }
.btn.small { padding: 4px 9px; font-size: 11.5px; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ---------------- main layout ----------------
   The wheel wrap spans the FULL viewport width so the chart sits dead
   center of the screen; the side panel floats above it as a glass
   overlay and can be collapsed. */
main { position: relative; z-index: 1; flex: 1; min-height: 0; }

#wheelWrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
/* Sized so the centered wheel never hides behind the side panel:
   bounded by viewport height AND by the width left over around the panel
   (symmetric, since the wheel stays dead center). Collapsing the panel
   releases the width bound. */
body.panel-wide { --panel-w: min(760px, 85vw); }

#wheel {
  display: block;
  height: min(calc(100vh - 130px), calc(100vw - 2 * (var(--panel-w) + 12px)));
  min-height: 340px;
  transition: height .28s ease;
}
body.panel-collapsed #wheel { height: min(calc(100vh - 130px), calc(100vw - 40px)); }

.wheel-hud { position: absolute; z-index: 3; display: flex; gap: 8px; align-items: flex-start; }
.hud-tl { top: 12px; left: 16px; flex-direction: column; }
.hud-tr { top: 12px; right: 16px; }
.hud-bl { bottom: 12px; left: 16px; flex-direction: column; max-width: 300px; }

#modeInfo { font-size: 12.5px; color: var(--muted); }
#modeInfo .mi-title { font-family: var(--font-display); font-size: 15px; color: var(--gold-bright); letter-spacing: 1px; }
#modeInfo .mi-sub { margin-top: 2px; }

#patternHud .pat {
  font-size: 11.5px; color: var(--muted); background: rgba(10, 14, 26, 0.75);
  border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin-top: 5px;
  cursor: pointer; transition: border-color .15s;
}
#patternHud .pat:hover { border-color: var(--line-gold); color: var(--ink); }
#patternHud .pat b { color: var(--gold); font-weight: 600; }

/* ---------------- tooltip ---------------- */
.tooltip {
  position: absolute; z-index: 10; pointer-events: none;
  max-width: 280px; padding: 10px 12px;
  background: rgba(9, 12, 24, 0.95); border: 1px solid var(--line-gold);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.55);
  font-size: 12px; line-height: 1.5; color: var(--ink);
}
.tooltip .tt-title { font-weight: 600; color: var(--gold-bright); font-size: 13px; margin-bottom: 3px; }
.tooltip .tt-sub { color: var(--muted); }

/* ---------------- side panel (overlay) ---------------- */
#panel {
  position: absolute; top: 0; right: 0; bottom: 0; z-index: 4;
  width: var(--panel-w); display: flex; flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--panel-glass); backdrop-filter: blur(10px);
  transition: transform .28s ease, width .28s ease;
}
#panel.collapsed { transform: translateX(100%); }
#panelToggle {
  position: absolute; left: -26px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 72px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); cursor: pointer;
  background: var(--panel-glass); border: 1px solid var(--line); border-right: none;
  border-radius: 10px 0 0 10px; backdrop-filter: blur(10px);
  transition: color .15s, border-color .15s;
}
#panelToggle:hover { color: var(--gold-bright); border-color: var(--line-gold); }

#panelWide {
  position: absolute; left: -26px; top: calc(50% - 88px);
  width: 26px; height: 46px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); cursor: pointer;
  background: var(--panel-glass); border: 1px solid var(--line); border-right: none;
  border-radius: 10px 0 0 10px; backdrop-filter: blur(10px);
  transition: color .15s, border-color .15s;
}
#panelWide:hover { color: var(--gold-bright); border-color: var(--line-gold); }

/* roomier reading when the panel is widened */
body.panel-wide .reading-out { font-size: 17px; line-height: 1.7; padding: 20px 26px 16px; }
body.panel-wide .xp-body { font-size: 16.5px; }
body.panel-wide .tabpane { padding: 16px 22px; }

/* keep the wheel's corner chips clear of the overlay panel */
.hud-tr { right: calc(var(--panel-w) + 16px); transition: right .28s ease; }
body.panel-collapsed .hud-tr { right: 16px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1; font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: .3px;
  color: var(--muted); background: transparent; border: none;
  border-bottom: 2px solid transparent; padding: 10px 4px; cursor: pointer; transition: all .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--gold-bright); border-bottom-color: var(--gold); }

.tabpanes { flex: 1; overflow: hidden; position: relative; }
.tabpane { position: absolute; inset: 0; overflow-y: auto; padding: 14px; display: none; }
.tabpane.active { display: block; }

.tabpane::-webkit-scrollbar { width: 9px; }
.tabpane::-webkit-scrollbar-thumb { background: #232c49; border-radius: 6px; border: 2px solid var(--panel); }
.tabpane::-webkit-scrollbar-track { background: transparent; }

/* section headers inside panes */
.sec-h {
  font-family: var(--font-display); font-size: 12.5px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--gold);
  margin: 16px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.sec-h:first-child { margin-top: 0; }
.sec-h .sec-note { font-family: var(--font-ui); font-size: 10.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--faint); margin-left: auto; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.faint { color: var(--faint); }

/* ---------------- positions table ---------------- */
.pos-row {
  display: grid; grid-template-columns: 30px 1fr 118px 34px 78px;
  align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 8px; cursor: pointer; transition: background .12s;
}
.pos-row:hover { background: rgba(148, 163, 204, 0.07); }
.pos-row.sel { background: rgba(232, 201, 106, 0.08); outline: 1px solid var(--line-gold); }
.pos-glyph { font-family: var(--glyph-font); font-size: 19px; text-align: center; line-height: 1; }
.pos-name { font-weight: 500; font-size: 13px; }
.pos-name .retro { color: var(--danger); font-size: 10.5px; font-weight: 600; margin-left: 5px; }
.pos-lon { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos-lon .sg { font-family: var(--glyph-font); margin: 0 2px; }
.pos-house { font-size: 11.5px; color: var(--faint); text-align: center; }
.pos-dig { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.dig-badge {
  font-size: 9px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
  padding: 2px 5px; border-radius: 4px;
}
.dig-good { color: #0e1424; background: var(--gold); }
.dig-mixed { color: var(--gold); background: rgba(232,201,106,.12); border: 1px solid var(--line-gold); }
.dig-bad { color: #ffb3b3; background: rgba(224, 85, 85, 0.18); }

.chart-status {
  display: flex; gap: 10px; align-items: center; margin-bottom: 12px;
  padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.moon-icon { width: 40px; height: 40px; flex-shrink: 0; }
.cs-main { line-height: 1.45; font-size: 12.5px; }
.cs-main b { color: var(--gold-bright); font-weight: 600; }

/* ---------------- aspects list ---------------- */
.asp-row {
  display: grid; grid-template-columns: 24px 84px 26px 84px 1fr 62px;
  align-items: center; gap: 4px; padding: 5px 8px; border-radius: 8px;
  cursor: pointer; transition: background .12s; font-size: 12.5px;
}
.asp-row:hover { background: rgba(148, 163, 204, 0.07); }
.asp-row.sel { background: rgba(232, 201, 106, 0.08); outline: 1px solid var(--line-gold); }
.asp-g { font-family: var(--glyph-font); font-size: 16px; text-align: center; }
.asp-body { display: flex; align-items: center; gap: 5px; }
.asp-body .g { font-family: var(--glyph-font); font-size: 15px; }
.asp-orb { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; font-size: 11.5px; }
.asp-flag { font-size: 9.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; text-align: center; border-radius: 4px; padding: 2px 0; }
.asp-flag.app { color: #9fe8c9; background: rgba(79, 201, 164, 0.13); }
.asp-flag.sep2 { color: var(--faint); background: rgba(148,163,204,.08); }

/* ---------------- explore pane ---------------- */
.xp-hero { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.xp-hero .xg {
  font-family: var(--glyph-font); font-size: 40px; line-height: 1;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, rgba(232,201,106,.16), rgba(20,27,48,.7));
  border: 1px solid var(--line-gold); border-radius: 50%;
}
.xp-hero h2 { font-family: var(--font-display); font-size: 19px; letter-spacing: 1px; color: var(--gold-bright); font-weight: 600; }
.xp-hero .xp-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.xp-body { font-family: var(--font-serif); font-size: 15.5px; line-height: 1.62; }
.xp-body p { margin-bottom: 9px; }
.xp-body em { color: var(--gold-bright); font-style: italic; }
.kv { display: grid; grid-template-columns: 118px 1fr; gap: 3px 10px; font-size: 12.5px; margin: 10px 0; }
.kv dt { color: var(--faint); }
.kv dd { color: var(--ink); }
.tagrow { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }

/* ---------------- reading pane ---------------- */
.rd-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rd-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rd-row label { font-size: 11.5px; color: var(--faint); min-width: 44px; }
.seg { display: flex; background: rgba(6,9,18,0.6); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button {
  font-size: 11.5px; font-weight: 500; color: var(--muted); background: transparent;
  border: none; border-radius: 6px; padding: 5px 10px; cursor: pointer; transition: all .15s;
}
.seg button:hover { color: var(--ink); }
.seg button:disabled { opacity: .35; cursor: default; }
.seg button:disabled:hover { color: var(--muted); }
.seg button.on { color: #101426; background: linear-gradient(180deg, #d9e2f5, #aab7d4); font-weight: 600; }
.seg button.on.gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }

.reading-out {
  font-family: var(--font-serif); font-size: 15.5px; line-height: 1.65;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 16px 12px; margin-top: 10px;
}
.reading-out h3 { font-family: var(--font-display); font-size: 14px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); margin: 14px 0 6px; font-weight: 600; }
.reading-out h3:first-child { margin-top: 0; }
.reading-out p { margin-bottom: 9px; }
.reading-out em { color: var(--gold-bright); }
.reading-out .sig { font-size: 11px; font-family: var(--font-ui); color: var(--faint); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 10px; }

.ai-note { font-size: 11.5px; color: var(--faint); line-height: 1.5; margin-top: 8px; }

/* ask-the-chart Q&A */
.ask-row { display: flex; gap: 8px; margin: 4px 0 6px; }
.ask-row input { flex: 1; }
.ask-q {
  font-size: 13px; color: var(--gold-bright); line-height: 1.5;
  background: rgba(232, 201, 106, 0.07); border: 1px solid var(--line-gold);
  border-radius: 12px 12px 3px 12px; padding: 8px 12px;
  margin: 12px 0 0 28px;
}
.ask-a { margin-top: 6px; }
.spin { display: inline-block; animation: spin-slow 1.6s linear infinite; }

textarea, input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], select, input[type="datetime-local"] {
  font-family: var(--font-ui); font-size: 13px; color: var(--ink);
  background: #0a0e1c; border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold-dim); }
select option { background: var(--bg2); }
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.8) sepia(0.4) saturate(2); cursor: pointer; }

/* ---------------- people pane ---------------- */
.person-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 7px; transition: border-color .15s;
}
.person-card:hover { border-color: var(--line-gold); }
.pc-info { flex: 1; min-width: 0; }
.pc-name { font-weight: 600; font-size: 13.5px; }
.pc-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-sun { font-family: var(--glyph-font); font-size: 20px; width: 30px; text-align: center; }
.pc-actions { display: flex; gap: 4px; }

.pform { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pform .full { grid-column: 1 / -1; }
.pform label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--faint); }
.pform input, .pform select { width: 100%; }
.form-actions { display: flex; gap: 8px; margin-top: 10px; }
.spacer { flex: 1; }

/* ---------------- settings pane ---------------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.set-row > span { font-size: 13px; }
.set-row .hint { display: block; font-size: 11px; color: var(--faint); margin-top: 1px; }
.body-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0; }
.body-chip {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11.5px; color: var(--muted); background: rgba(20,27,48,.6);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 4px; cursor: pointer; transition: all .15s;
}
.body-chip .g { font-family: var(--glyph-font); font-size: 15px; }
.body-chip.on { color: var(--ink); border-color: var(--line-gold); background: rgba(232,201,106,.07); }
.body-chip.off .g { filter: grayscale(1); opacity: .4; }

input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 3px; background: #1d2540; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold-dim));
  margin-top: -5px; box-shadow: 0 0 8px rgba(232,201,106,.5);
}
input[type="range"]::-moz-range-track { height: 5px; border-radius: 3px; background: #1d2540; }
input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: var(--gold); }

/* ---------------- time bar ---------------- */
#timebar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(20,26,46,0.95), rgba(13,17,30,0.85));
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
}
.tb-group { display: flex; align-items: center; gap: 6px; }
.tb-datetime input { font-variant-numeric: tabular-nums; }
.tb-datetime select { max-width: 170px; }
.btn.step { padding: 6px 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.btn.step:hover { color: var(--ink); }
.btn.play { font-size: 13px; width: 34px; }
.btn.play.on { color: #101426; background: linear-gradient(180deg, var(--gold-bright), var(--gold)); border-color: transparent; box-shadow: 0 0 12px rgba(232,201,106,.35); }
.tb-scrub { flex: 1; min-width: 180px; }
.tb-scrub input[type="range"] { flex: 1; }

/* ---------------- modal ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(4, 6, 12, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(480px, 92vw); max-height: 86vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--line-gold); border-radius: 14px;
  padding: 20px; box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.modal-card h3 { font-family: var(--font-display); letter-spacing: 1.5px; color: var(--gold-bright); margin-bottom: 6px; font-weight: 600; }
.loc-search-row { display: flex; gap: 8px; margin: 12px 0 8px; }
.loc-search-row input { flex: 1; }
.loc-results { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.loc-results .lr {
  text-align: left; font-size: 12.5px; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer;
}
.loc-results .lr:hover { border-color: var(--line-gold); }
.loc-results .lr .sub { color: var(--faint); font-size: 11px; }
.loc-manual { display: flex; gap: 8px; margin: 10px 0; }
.loc-manual label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--faint); flex: 1; }
.loc-manual input { width: 100%; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------------- svg wheel styles ---------------- */
#wheel text { user-select: none; }
.sign-seg { transition: opacity .2s; cursor: pointer; }
.sign-seg:hover { opacity: 0.85; }
.sign-glyph { font-family: var(--glyph-font); cursor: pointer; }
.house-line { pointer-events: none; }
.house-num { font-family: var(--font-serif); cursor: pointer; }
.planet-g { cursor: pointer; }
.planet-g .pg { font-family: var(--glyph-font); }
.planet-g .pdeg { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.aspect-line { cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.angle-label { font-family: var(--font-ui); font-weight: 600; letter-spacing: 1px; }
.dimmed { opacity: 0.13 !important; }
.hl { filter: drop-shadow(0 0 6px rgba(232, 201, 106, 0.8)); }

/* ---------------- responsive: stacked app layout (tablets & phones) ----------------
   The page becomes a normal scrolling document: sticky header, full-width wheel,
   HUD rows in flow (not overlaid), panel content in flow (the desktop absolute
   panes would collapse to zero height here), compact sticky time bar. */
@media (max-width: 1100px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow-y: auto; overflow-x: hidden; }

  .topbar { position: sticky; top: 0; z-index: 20; flex-wrap: wrap; row-gap: 6px; }

  main { display: flex; flex-direction: column; flex: none; min-height: 0; }

  #wheelWrap { position: relative; inset: auto; flex: none; flex-direction: column; padding: 8px 6px 4px; }
  .wheel-hud { position: static; width: 100%; justify-content: center; flex-wrap: wrap; }
  .hud-tl { order: 1; align-items: center; text-align: center; }
  .hud-tr, body.panel-collapsed .hud-tr { order: 2; right: auto; margin: 6px 0 2px; }
  #wheel, body.panel-collapsed #wheel {
    order: 3;
    width: min(96vw, 62vh); height: auto; min-height: 0;
    transition: none;
  }
  .hud-bl { order: 4; flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: none; margin-top: 2px; }

  #panel {
    position: relative; width: 100%; max-height: none;
    border-left: none; border-top: 1px solid var(--line);
    transform: none; transition: none;
  }
  #panel.collapsed { transform: none; }
  #panelToggle, #panelWide { display: none; }
  .tab { font-size: 11px; letter-spacing: 0; padding: 11px 1px; min-width: 0; }
  /* panes flow with the page instead of filling a fixed panel */
  .tabpanes { flex: none; position: static; overflow: visible; }
  .tabpane { position: static; display: none; overflow: visible; }
  .tabpane.active { display: block; }

  #timebar { position: sticky; bottom: 0; z-index: 20; padding: 7px 8px; gap: 8px 10px; }
}

/* ---------------- phones ---------------- */
@media (max-width: 760px) {
  .brand-sub { display: none; }
  .brand-text h1 { font-size: 16px; letter-spacing: 2px; }
  .brand-mark { font-size: 18px; }
  .modes { margin-left: 0; }
  .mode-btn { padding: 5px 10px; font-size: 12px; }
  .top-right { margin-left: auto; }
  .chip { padding: 4px 10px; font-size: 11px; }
  .chip-loc #locLabel { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #modeInfo .mi-title { font-size: 14px; }

  /* 16px inputs stop iOS Safari from zooming the page on focus */
  input[type="text"], input[type="number"], input[type="date"], input[type="time"],
  input[type="password"], input[type="datetime-local"], select, textarea { font-size: 16px; }

  /* time bar: compact to ~3 rows — drop year/month steps (scrub + play cover them) */
  .btn.step[data-step="-31557600"], .btn.step[data-step="31557600"],
  .btn.step[data-step="-2629800"], .btn.step[data-step="2629800"] { display: none; }
  #timebar { gap: 6px 8px; padding: 6px 8px; }
  #timebar .btn { padding: 6px 8px; }
  #timebar select { padding: 6px 6px; }
  .tb-datetime input { width: 150px; }
  .tb-datetime select { max-width: 96px; }
  .tb-play select { max-width: 118px; }
  .tb-scrub { width: 100%; min-width: 0; }

  .pc-actions { flex-wrap: wrap; justify-content: flex-end; }
  .pos-row { grid-template-columns: 26px 1fr 106px 30px 70px; gap: 4px; }
  .asp-row { grid-template-columns: 22px 76px 22px 76px 1fr 58px; }
  .tabpane { padding: 12px 10px; }
  .modal-card { padding: 14px; }
  .loc-manual { flex-wrap: wrap; }
}
