:root {
  color-scheme: light;
  --page-bg: #f4efe6;
  --page-glow: rgba(177, 136, 72, 0.12);
  --panel-bg: rgba(255, 253, 248, 0.9);
  --panel-strong: #fffdf8;
  --panel-soft: #eee7dc;
  --text-primary: #182439;
  --text-secondary: #687083;
  --ring-border: #c7bdad;
  --ring-strong: #8f836f;
  --accent: #a46f2b;
  --accent-soft: #eadbc2;
  --accent-lavender: #75688f;
  --danger: #a33e4a;
  --direct: #2f7180;
  --retrograde: #a14d5d;
  --stationary: #b08231;
  --focus: #356fa3;
  --shadow: 0 24px 60px rgba(45, 38, 28, 0.13);
  --soft-shadow: 0 10px 28px rgba(45, 38, 28, 0.09);
  --zodiac-a: #f3ede3;
  --zodiac-b: #eae2d6;
  --nak-a: #dfd4c3;
  --nak-b: #e9e0d3;
  --wheel-bg: #fbf8f1;
  --marker-bg: #fffdf8;
  --tooltip-bg: rgba(24, 36, 57, 0.97);
  --tooltip-text: #fffdf8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page-bg: #0d1420;
  --page-glow: rgba(186, 148, 87, 0.09);
  --panel-bg: rgba(19, 28, 42, 0.92);
  --panel-strong: #172132;
  --panel-soft: #222d3f;
  --text-primary: #f2ede3;
  --text-secondary: #a8b1c0;
  --ring-border: #485469;
  --ring-strong: #7d899c;
  --accent: #c39a5e;
  --accent-soft: #3e352c;
  --accent-lavender: #a99bc5;
  --danger: #de8190;
  --direct: #6bb6c1;
  --retrograde: #e27e90;
  --stationary: #d7ad61;
  --focus: #8dc4f1;
  --shadow: 0 25px 70px rgba(0, 0, 0, 0.35);
  --soft-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  --zodiac-a: #1b2739;
  --zodiac-b: #202d40;
  --nak-a: #263247;
  --nak-b: #2b384d;
  --wheel-bg: #111b29;
  --marker-bg: #f0eadf;
  --tooltip-bg: rgba(245, 239, 228, 0.98);
  --tooltip-text: #192336;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 20% 0%, var(--page-glow), transparent 32rem),
    var(--page-bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  transition: background-color 180ms ease, color 180ms ease;
}

button, select, input { font: inherit; }
button, select { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  color: var(--panel-strong);
  background: var(--text-primary);
  border-radius: 8px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  padding: 30px 0 22px;
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  gap: 32px;
  align-items: center;
}

.brand-lockup { display: flex; align-items: center; gap: 15px; }
.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--accent);
  border: 1px solid var(--ring-border);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 25px;
  background: var(--panel-bg);
  box-shadow: var(--soft-shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--text-primary); }
h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
h2 { margin-bottom: 0; font-size: 1.08rem; letter-spacing: -0.01em; }

.icon-button, .secondary-button, .transport-button {
  border: 1px solid var(--ring-border);
  background: var(--panel-strong);
  box-shadow: 0 2px 8px rgba(20, 25, 35, 0.05);
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.icon-button:hover, .secondary-button:hover, .transport-button:hover:not(:disabled) {
  border-color: var(--ring-strong);
  transform: translateY(-1px);
}
.icon-button:disabled, .secondary-button:disabled, .transport-button:disabled { opacity: 0.42; cursor: not-allowed; }

.header-actions { display: flex; justify-self: end; align-items: center; gap: 10px; }
.github-link {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: var(--text-primary);
}
.github-link svg { width: 20px; height: 20px; }

.theme-toggle {
  min-width: 92px;
  padding: 9px 13px;
  display: inline-flex;
  justify-self: end;
  justify-content: center;
  gap: 8px;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.theme-icon { color: var(--accent); font-size: 1rem; }

.app-layout {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
}
.main-column { min-width: 0; display: grid; gap: 16px; }

.chart-panel, .positions-panel, .control-panel, .details-panel, .guide-panel {
  border: 1px solid color-mix(in srgb, var(--ring-border) 82%, transparent);
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.chart-panel { min-width: 0; padding: 24px; border-radius: 24px; }
.chart-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.orientation-key { display: flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 0.72rem; }
.north-arrow { color: var(--accent); font-size: 1.1rem; }

.chart-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 520px); gap: 3px; margin: 2px 0 10px; padding: 3px; border: 1px solid var(--ring-border); border-radius: 11px; background: var(--panel-soft); }
.chart-tab { padding: 7px 12px; border: 0; border-radius: 8px; color: var(--text-secondary); background: transparent; cursor: pointer; font-size: 0.7rem; font-weight: 750; }
.chart-tab.is-active { color: var(--text-primary); background: var(--panel-strong); box-shadow: 0 2px 8px rgba(20, 25, 35, 0.08); }
.chart-stage { position: relative; }

.chart-shell {
  position: relative;
  /* Only the square SVG is capped to the viewport height. The surrounding
     chart section may extend beyond the viewport and scroll normally. */
  width: min(100%, 920px, 100dvh);
  max-height: 100dvh;
  margin: 0 auto;
  aspect-ratio: 1;
}
#transit-wheel { display: block; width: 100%; height: 100%; overflow: visible; }

.wheel-base { fill: var(--wheel-bg); stroke: var(--ring-border); stroke-width: 1.5; }
.planet-orbit { fill: none; stroke: var(--ring-border); stroke-width: 1; stroke-dasharray: 2 7; opacity: 0.7; }
.moon-orbit { fill: none; stroke: var(--accent-lavender); stroke-width: 1; stroke-dasharray: 1 8; opacity: 0.48; }
.center-disc { fill: var(--panel-strong); stroke: var(--ring-border); stroke-width: 1.2; filter: drop-shadow(0 10px 18px rgba(30, 28, 24, 0.09)); }
.zodiac-sector { fill: var(--zodiac-a); stroke: var(--ring-border); stroke-width: 1; }
.zodiac-sector-alt { fill: var(--zodiac-b); }
.nakshatra-sector { fill: var(--nak-a); stroke: none; }
.nakshatra-sector-alt { fill: var(--nak-b); }
.nakshatra-boundary { stroke: var(--ring-border); stroke-width: 0.9; }
.zodiac-icon { opacity: 0.9; clip-path: circle(16px); }
.zodiac-icon.is-missing { display: none; }
.zodiac-name { fill: var(--text-primary); font-size: 9.5px; font-weight: 700; letter-spacing: 0.035em; }
.zodiac-degrees { fill: var(--text-secondary); font-size: 7.2px; letter-spacing: 0.025em; }
.nakshatra-label { fill: var(--text-primary); font-size: 8.6px; font-weight: 650; letter-spacing: 0.01em; }
.nak-short { display: none; }
.cardinal-mark { fill: var(--accent); }

.center-eyebrow { fill: var(--accent); font-size: 6.2px; font-weight: 800; letter-spacing: 0.16em; }
.center-date { fill: var(--text-primary); font-family: Georgia, serif; font-size: 16px; }
.center-state { fill: var(--text-secondary); font-size: 7.5px; }
.center-day { fill: var(--text-secondary); font-size: 5.8px; font-weight: 700; letter-spacing: 0.1em; }

.planet-marker { cursor: pointer; outline: none; }
.marker-hit-area { fill: transparent; stroke: none; pointer-events: all; }
.planet-marker:focus, .planet-marker:focus-visible { outline: none; }
.planet-icon { pointer-events: none; }
.planet-icon.is-missing { display: none; }
.marker-fallback { fill: var(--text-primary); font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.marker-fallback.has-icon { opacity: 0; }
.planet-name { fill: var(--text-primary); stroke: var(--wheel-bg); stroke-width: 2.7px; paint-order: stroke fill; font-size: 8px; font-weight: 750; letter-spacing: 0.025em; pointer-events: none; }
.selected-ring { fill: none; stroke: var(--accent); stroke-width: 2.4; opacity: 0; }
.planet-marker:hover .selected-ring, .planet-marker:focus-visible .selected-ring { opacity: 0.65; }
.planet-marker.is-selected .selected-ring { opacity: 1; stroke-dasharray: 3 3; }
.retrograde-badge { display: none; }
.planet-marker.is-retrograde .retrograde-badge { display: block; }
.retrograde-badge circle { fill: var(--retrograde); stroke: var(--wheel-bg); stroke-width: 1.5; }
.retrograde-badge text { fill: #fff; font-size: 9px; font-weight: 800; }
.combust-badge { display: none; }
.planet-marker.is-combust .combust-badge { display: block; }
.combust-badge circle { fill: var(--accent); stroke: var(--wheel-bg); stroke-width: 1.5; }
.combust-badge text { fill: var(--panel-strong); font-size: 8px; font-weight: 850; }
.planet-marker.is-retrograde .selected-ring { stroke: var(--retrograde); }
.planet-marker.is-stationary .selected-ring { stroke: var(--stationary); }
.trail-point { fill: var(--accent); }

.planet-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 8;
  width: min(280px, calc(100% - 20px));
  padding: 15px;
  color: var(--tooltip-text);
  background: var(--tooltip-bg);
  border: 1px solid color-mix(in srgb, var(--ring-border) 55%, transparent);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
  pointer-events: none;
  font-size: 0.74rem;
}
.tooltip-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 0.9rem; }
.tooltip-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.tooltip-date { margin: 2px 0 10px; opacity: 0.68; }
.planet-tooltip dl { margin: 0; }
.planet-tooltip dl div { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.planet-tooltip dt { opacity: 0.67; }
.planet-tooltip dd { margin: 0; text-align: right; font-weight: 650; }
.motion-chip { padding: 3px 7px; border-radius: 999px; font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase; background: color-mix(in srgb, currentColor 12%, transparent); }
.motion-chip.retrograde { color: #ff9aac; }
.motion-chip.stationary { color: #f3ca7d; }
.condition-chip { padding: 3px 7px; border-radius: 999px; font-size: 0.6rem; letter-spacing: 0.05em; text-transform: uppercase; background: color-mix(in srgb, currentColor 12%, transparent); }
.condition-chip.combust { color: #f1bd68; }

.north-chart-toolbar, .south-chart-toolbar { display: grid; grid-template-columns: minmax(145px, 205px) minmax(250px, 340px) 1fr; gap: 12px; align-items: end; max-width: 920px; margin: 0 auto 8px; color: var(--text-secondary); font-size: 0.68rem; }
.north-chart-toolbar label, .south-chart-toolbar label, .north-motion-control legend, .south-motion-control legend { color: var(--text-primary); font-weight: 750; }
.north-chart-toolbar select, .south-chart-toolbar select { padding-top: 7px; padding-bottom: 7px; }
.north-toolbar-field, .south-toolbar-field { display: grid; gap: 5px; }
.north-motion-control, .south-motion-control { min-width: 0; margin: 0; padding: 0; border: 0; }
.north-motion-control legend, .south-motion-control legend { margin-bottom: 5px; padding: 0; }
.north-motion-options, .south-motion-options { display: grid; grid-template-columns: 1fr 1.35fr; gap: 3px; padding: 3px; border: 1px solid var(--ring-border); border-radius: 10px; background: var(--panel-soft); }
.north-motion-options label, .south-motion-options label { position: relative; min-width: 0; cursor: pointer; }
.north-motion-options input, .south-motion-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.north-motion-options span, .south-motion-options span { display: grid; min-height: 31px; place-items: center; padding: 5px 8px; border-radius: 7px; color: var(--text-secondary); text-align: center; font-size: 0.64rem; white-space: nowrap; }
.north-motion-options input:checked + span, .south-motion-options input:checked + span { color: var(--text-primary); background: var(--panel-strong); box-shadow: 0 2px 8px rgba(20, 25, 35, 0.08); }
.north-motion-options input:focus-visible + span, .south-motion-options input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.north-motion-options input:disabled + span, .south-motion-options input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.north-toolbar-note { align-self: center; line-height: 1.45; }
.north-chart-shell, .south-chart-shell { width: min(100%, 920px, 100dvh); max-height: 100dvh; margin: 0 auto; aspect-ratio: 1; }
#north-indian-chart, #south-indian-chart { display: block; width: 100%; height: 100%; }
.north-chart-field { fill: var(--wheel-bg); stroke: var(--ring-strong); stroke-width: 2; }
.north-chart-line { fill: none; stroke: var(--ring-border); stroke-width: 1.4; }
.north-house-number { fill: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: 0.08em; }
.north-house-sign { fill: var(--text-secondary); font-size: 10px; font-weight: 700; }
.north-chart-date { fill: var(--text-primary); font-family: Georgia, serif; font-size: 13px; font-weight: 600; letter-spacing: 0.025em; }
.north-planet-marker { cursor: pointer; outline: none; }
.north-planet-marker:focus, .north-planet-marker:focus-visible { outline: none; }
.north-marker-icon { pointer-events: none; }
.north-marker-icon.is-missing { display: none; }
.north-marker-fallback { fill: var(--text-primary); font-family: Georgia, serif; font-weight: 700; }
.north-marker-fallback.has-icon { opacity: 0; }
.north-marker-name { fill: var(--text-primary); stroke: var(--wheel-bg); stroke-width: 2.2px; paint-order: stroke fill; font-weight: 750; pointer-events: none; }
.north-marker-status { fill: var(--retrograde); stroke: var(--wheel-bg); stroke-width: 1.8px; paint-order: stroke fill; font-size: 9px; font-weight: 850; }
.north-planet-marker.is-combust .north-marker-status { fill: var(--accent); }
.north-selected-ring { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 3; opacity: 0; }
.north-planet-marker.is-selected .north-selected-ring { opacity: 1; }

.south-chart-field { fill: var(--wheel-bg); stroke: var(--ring-strong); stroke-width: 2; }
.south-chart-line { fill: none; stroke: var(--ring-border); stroke-width: 1.4; }
.south-sign-label { fill: var(--text-secondary); font-size: 10px; font-weight: 700; }
.south-house-number { fill: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: 0.07em; }
.south-chart-date { fill: var(--text-primary); font-family: Georgia, serif; font-size: 13px; font-weight: 600; letter-spacing: 0.025em; }
.south-planet-marker { cursor: pointer; outline: none; }
.south-planet-marker:focus, .south-planet-marker:focus-visible { outline: none; }
.south-marker-icon { pointer-events: none; }
.south-marker-icon.is-missing { display: none; }
.south-marker-fallback { fill: var(--text-primary); font-family: Georgia, serif; font-weight: 700; }
.south-marker-fallback.has-icon { opacity: 0; }
.south-marker-name { fill: var(--text-primary); stroke: var(--wheel-bg); stroke-width: 2.2px; paint-order: stroke fill; font-weight: 750; pointer-events: none; }
.south-marker-status { fill: var(--retrograde); stroke: var(--wheel-bg); stroke-width: 1.8px; paint-order: stroke fill; font-size: 9px; font-weight: 850; }
.south-planet-marker.is-combust .south-marker-status { fill: var(--accent); }
.south-selected-ring { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 3 3; opacity: 0; }
.south-planet-marker.is-selected .south-selected-ring { opacity: 1; }

.loading-state, .error-state {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 10;
  width: min(340px, calc(100% - 32px));
  padding: 22px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--panel-strong) 94%, transparent);
  border: 1px solid var(--ring-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -50%);
  text-align: center;
}
.loading-state { display: grid; justify-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-secondary); }
.loading-state strong { color: var(--text-primary); font-size: 0.92rem; }
.loading-orbit { width: 38px; height: 38px; margin-bottom: 4px; border: 2px solid var(--ring-border); border-top-color: var(--accent); border-radius: 50%; animation: orbit 900ms linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.error-state { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; text-align: left; }
.error-state p { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.78rem; }
.error-state button { grid-column: 2; justify-self: start; }
.error-symbol { width: 30px; height: 30px; display: grid; place-items: center; color: var(--danger); border: 1px solid var(--danger); border-radius: 50%; font-weight: 800; }
.secondary-button { padding: 7px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 700; }

.wheel-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin-top: 10px; color: var(--text-secondary); font-size: 0.7rem; }
.wheel-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.legend-dot.direct { background: var(--direct); }
.legend-dot.retrograde { background: var(--retrograde); }
.legend-dot.combust { background: var(--accent); }
.legend-dot.stationary { background: var(--stationary); }
.legend-ring { width: 11px; height: 11px; display: inline-block; border: 2px dashed var(--accent); border-radius: 50%; }

.positions-panel { min-width: 0; padding: 22px 24px 24px; border-radius: 20px; }
.positions-heading-row { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; }
.positions-date { color: var(--text-secondary); font-family: Georgia, serif; font-size: 0.84rem; white-space: nowrap; }
.positions-table-wrap { max-width: 100%; overflow-x: auto; }
.positions-table { width: 100%; border-collapse: collapse; color: var(--text-primary); font-size: 0.68rem; }
.positions-table th { padding: 9px 8px; color: var(--text-secondary); border-bottom: 1px solid var(--ring-border); text-align: left; font-size: 0.59rem; letter-spacing: 0.055em; text-transform: uppercase; white-space: nowrap; }
.positions-table td { padding: 10px 8px; border-bottom: 1px solid color-mix(in srgb, var(--ring-border) 62%, transparent); white-space: nowrap; }
.positions-table tbody tr:last-child td { border-bottom: 0; }
.table-planet { display: inline-flex; align-items: center; gap: 7px; }
.table-planet img { width: 22px; height: 22px; object-fit: contain; }
.table-planet strong { font-size: 0.7rem; }
.table-motion { display: inline-block; padding: 3px 7px; border-radius: 999px; color: var(--direct); background: color-mix(in srgb, var(--direct) 12%, transparent); font-size: 0.57rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.table-motion.retrograde { color: var(--retrograde); background: color-mix(in srgb, var(--retrograde) 12%, transparent); }
.table-motion.stationary { color: var(--stationary); background: color-mix(in srgb, var(--stationary) 12%, transparent); }

.side-column { display: grid; gap: 16px; position: sticky; top: 16px; }
.control-panel, .details-panel { padding: 20px; border-radius: 18px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.playback-status { padding: 4px 8px; color: var(--text-secondary); background: var(--panel-soft); border-radius: 999px; font-size: 0.66rem; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; }
.playback-status.is-playing { color: var(--direct); }

.field-label, .timeline-heading label { display: block; margin-bottom: 6px; font-size: 0.72rem; font-weight: 750; }
.field-note { margin: 5px 0 16px; color: var(--text-secondary); font-size: 0.65rem; }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 12px; top: 50%; color: var(--text-secondary); transform: translateY(-58%); pointer-events: none; }
select {
  width: 100%;
  appearance: none;
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--ring-border);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--panel-strong);
  cursor: pointer;
}
.select-wrap.compact select { padding-top: 8px; padding-bottom: 8px; }

.transport { display: grid; grid-template-columns: 38px 38px 1fr 1fr 38px 38px; gap: 6px; margin: 0 0 20px; }
.transport-button { min-height: 38px; padding: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; font-size: 0.69rem; font-weight: 750; }
.transport-button.primary { color: var(--panel-strong); background: var(--text-primary); border-color: var(--text-primary); }
:root[data-theme="dark"] .transport-button.primary { color: var(--page-bg); }

.timeline-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.date-picker { width: 145px; padding: 3px 5px; border: 1px solid transparent; border-radius: 7px; color: var(--text-primary); background: transparent; font-family: Georgia, serif; font-size: 0.86rem; font-weight: 500; cursor: pointer; }
.date-picker:hover { border-color: var(--ring-border); background: var(--panel-soft); }
.date-picker::-webkit-calendar-picker-indicator { opacity: 0.72; cursor: pointer; }
.timeline { width: 100%; height: 20px; margin: 2px 0; accent-color: var(--accent); cursor: pointer; }
.timeline-meta { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 0.62rem; }
.control-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 12px; align-items: end; margin-top: 18px; }
.control-grid > div { display: grid; grid-template-rows: auto 62px; align-self: stretch; }
.control-grid > div .select-wrap, .control-grid > div select { height: 62px; }
.outer-planets-field { grid-column: 1 / -1; }

.switch-field { height: 62px; min-height: 62px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--ring-border); border-radius: 10px; cursor: pointer; }
.switch-field > span:first-child { display: grid; }
.switch-field strong { font-size: 0.7rem; }
.switch-field small { color: var(--text-secondary); font-size: 0.59rem; }
.switch-field input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 34px; height: 20px; flex: 0 0 auto; border-radius: 999px; background: var(--ring-border); transition: background 150ms ease; }
.switch-track::after { content: ""; position: absolute; width: 14px; height: 14px; top: 3px; left: 3px; border-radius: 50%; background: var(--panel-strong); box-shadow: 0 1px 4px rgba(0,0,0,.24); transition: transform 150ms ease; }
.switch-field input:checked + .switch-track { background: var(--accent); }
.switch-field input:checked + .switch-track::after { transform: translateX(14px); }
.switch-field input:focus-visible + .switch-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.details-panel { min-height: 255px; }
.empty-details { display: grid; min-height: 210px; place-items: center; align-content: center; text-align: center; }
.empty-details h2 { margin: 9px 0 5px; }
.empty-details p { max-width: 260px; margin: 0; color: var(--text-secondary); font-size: 0.72rem; }
.empty-symbol { color: var(--accent); font-size: 1.4rem; }
.details-heading { display: flex; gap: 13px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--ring-border); }
.details-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; color: var(--text-primary); font-family: Georgia, serif; font-size: 25px; }
.details-icon img { width: 38px; height: 38px; object-fit: contain; }
.details-heading h2 { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 500; }
.details-heading p { margin: 2px 0 0; color: var(--text-secondary); font-size: 0.66rem; }
.details-statuses { margin-left: auto; display: grid; justify-items: end; gap: 5px; }
.details-motion { padding: 4px 7px; border-radius: 999px; color: var(--direct); background: color-mix(in srgb, var(--direct) 12%, transparent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.details-motion.retrograde { color: var(--retrograde); background: color-mix(in srgb, var(--retrograde) 12%, transparent); }
.details-motion.stationary { color: var(--stationary); background: color-mix(in srgb, var(--stationary) 12%, transparent); }
.details-combust { padding: 4px 7px; border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 0.58rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.position-hero { padding: 15px 0 13px; }
.position-hero span { color: var(--text-secondary); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; }
.position-hero strong { display: block; margin-top: 2px; font-family: Georgia, serif; font-size: 1.45rem; font-weight: 500; }
.detail-list { margin: 0; }
.detail-list div { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; padding: 7px 0; border-top: 1px solid color-mix(in srgb, var(--ring-border) 64%, transparent); }
.detail-list dt { color: var(--text-secondary); font-size: 0.68rem; }
.detail-list dd { margin: 0; text-align: right; font-size: 0.7rem; font-weight: 700; }

.guide-panel { padding: 0 18px; border-radius: 14px; box-shadow: var(--soft-shadow); }
.guide-panel summary { padding: 14px 0; cursor: pointer; font-size: 0.74rem; font-weight: 750; }
.guide-panel p { margin: -3px 0 15px; color: var(--text-secondary); font-size: 0.68rem; }

.seo-content {
  width: min(1480px, calc(100% - 48px));
  margin: 24px auto 0;
  padding: 36px;
  border: 1px solid color-mix(in srgb, var(--ring-border) 82%, transparent);
  border-radius: 24px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
}
.seo-intro { max-width: 980px; }
.seo-content h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 500; line-height: 1.25; }
.seo-content h3 { margin: 0 0 8px; color: var(--text-primary); font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; font-weight: 500; line-height: 1.3; }
.seo-content p { margin: 0 0 12px; color: var(--text-secondary); font-size: 0.84rem; line-height: 1.75; }
.seo-content a { color: var(--accent); font-weight: 700; text-underline-offset: 0.16em; }
.seo-content a:hover { color: var(--text-primary); }
.seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 36px; margin-top: 30px; }
.seo-article { padding-top: 22px; border-top: 1px solid var(--ring-border); }
.seo-faq { margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--ring-border); }
.seo-faq h2 { margin-bottom: 12px; }
.faq-list details { border-top: 1px solid color-mix(in srgb, var(--ring-border) 70%, transparent); }
.faq-list details:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ring-border) 70%, transparent); }
.faq-list summary { padding: 15px 2px; cursor: pointer; color: var(--text-primary); font-size: 0.82rem; font-weight: 750; }
.faq-list p { max-width: 920px; margin: -3px 0 16px; padding-right: 24px; }

footer { width: min(1480px, calc(100% - 48px)); margin: 18px auto 0; padding: 16px 0 28px; color: var(--text-secondary); text-align: center; font-size: 0.66rem; }
footer p { margin: 0; }

@media (max-width: 1120px) {
  .site-header { grid-template-columns: 1fr auto; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .app-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .chart-panel { padding: 18px; }
  .positions-panel { padding: 20px; }
  .transport { grid-template-columns: 34px 34px 1fr 1fr 34px 34px; }
  .transport-button { font-size: 0.63rem; }
}

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .side-column { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .guide-panel { grid-column: 1 / -1; }
  .chart-shell { max-width: min(720px, 100dvh); max-height: 100dvh; }
  .north-chart-shell, .south-chart-shell { max-width: min(720px, 100dvh); max-height: 100dvh; }
  .north-chart-toolbar, .south-chart-toolbar { grid-template-columns: minmax(145px, 0.75fr) minmax(250px, 1.25fr); }
  .north-toolbar-note { grid-column: 1 / -1; }
  .seo-content { padding: 28px; }
  .seo-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 620px) {
  .site-header, .app-layout, .seo-content, footer { width: min(100% - 24px, 1480px); }
  .site-header { padding-top: 18px; gap: 16px; }
  .brand-mark { width: 44px; height: 44px; }
  .theme-toggle { min-width: 44px; padding: 9px; }
  .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .chart-panel { padding: 12px 8px 14px; border-radius: 18px; }
  .chart-heading-row { padding: 5px 8px 0; }
  .chart-tabs { margin-left: 8px; }
  .north-chart-toolbar, .south-chart-toolbar { grid-template-columns: 1fr; padding: 0 8px; }
  .north-toolbar-note { grid-column: auto; }
  .north-motion-options, .south-motion-options { grid-template-columns: 1fr 1.35fr; }
  .orientation-key span:last-child { display: none; }
  .side-column { grid-template-columns: 1fr; }
  .guide-panel { grid-column: auto; }
  .nak-full { display: none; }
  .nak-short { display: initial; }
  .nakshatra-label { font-size: 10px; }
  .zodiac-name { font-size: 9.5px; }
  .zodiac-degrees { font-size: 7.2px; }
  .wheel-legend { padding-inline: 8px; }
  .positions-panel { padding: 18px 14px; border-radius: 18px; }
  .positions-heading-row { align-items: start; }
  .positions-table-wrap { overflow: visible; }
  .positions-table, .positions-table tbody { display: block; width: 100%; }
  .positions-table thead { display: none; }
  .positions-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; padding: 10px 0; border-bottom: 1px solid var(--ring-border); }
  .positions-table tr:last-child { border-bottom: 0; }
  .positions-table td { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border: 0; white-space: normal; text-align: right; }
  .positions-table td::before { content: attr(data-label); color: var(--text-secondary); font-size: 0.59rem; font-weight: 750; letter-spacing: 0.04em; text-align: left; text-transform: uppercase; }
  .positions-table td:first-child { grid-column: 1 / -1; padding-bottom: 9px; }
  .positions-table td:first-child::before { display: none; }
  .seo-content { margin-top: 16px; padding: 24px 18px; border-radius: 18px; }
  .seo-grid { margin-top: 22px; }
  .seo-faq { margin-top: 28px; padding-top: 22px; }
}

@media (max-width: 390px) {
  .site-header { grid-template-columns: 1fr auto; }
  .eyebrow { letter-spacing: 0.11em; }
  .brand-lockup { gap: 10px; }
  .chart-heading-row h2 { font-size: 0.95rem; }
  .chart-tab { padding-inline: 4px; font-size: 0.61rem; }
  .transport { grid-template-columns: 34px 34px 1fr 34px 34px; }
  #pause-button { grid-column: 3; grid-row: 1; }
  #play-button[hidden] + #pause-button { display: inline-flex !important; }
  .control-grid { grid-template-columns: 1fr; }
  .planet-tooltip { font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
