/* ============================================================
   Jyotiṣa — dark space theme
   ============================================================ */
:root {
  /* Saffron dusk — warm dark theme for the temple/sky aesthetic */
  --bg: #0b0805;
  --bg-2: #14100a;
  --panel: rgba(28, 21, 14, 0.78);
  --panel-solid: #1c1610;
  --line: #3a2e1f;
  --text: #f1e8d5;          /* warm cream */
  --muted: #b8a98c;         /* warm muted */
  --accent: #d9a44a;        /* saffron-gold */
  --accent-2: #c97a3a;      /* burnt copper (was violet) */
  --good: #88c97a;
  --warn: #e76a5a;
  --grid: rgba(255,255,255,0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(ellipse 1200px 800px at 20% 0%, rgba(201,122,58,0.16), transparent 50%),
    radial-gradient(ellipse 1000px 700px at 80% 100%, rgba(217,164,74,0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
a { color: var(--accent); }
code { background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }

/* topbar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(7,6,13,0.95), rgba(7,6,13,0.65));
  border-bottom: 1px solid var(--line);
  z-index: 50; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  font-size: 28px; color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(201,161,74,0.6));
}
.brand h1 { font-size: 18px; margin: 0; letter-spacing: 0.5px; }
.brand .sub { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 8px 14px; border-radius: 8px; font-size: 13px; cursor: pointer;
  transition: all .15s ease;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.tab.active {
  color: var(--text); background: rgba(201,122,58,0.18);
  border-color: rgba(201,122,58,0.45);
}
.external-link {
  color: var(--accent); font-size: 12.5px;
  padding: 7px 12px; border-radius: 8px;
  border: 1px solid rgba(217,164,74,0.4);
  text-decoration: none; margin-left: 10px;
  transition: background .15s ease;
}
.external-link:hover { background: rgba(217,164,74,0.12); color: var(--text); }

/* views */
.view { position: fixed; top: 60px; left: 0; right: 0; bottom: 0; display: none; }
.view.active { display: block; }

/* ============================ SKY ============================ */
#view-sky #three-host { position: absolute; inset: 0; }
.sky-panel {
  position: absolute; top: 16px; right: 16px; width: 320px; max-height: calc(100% - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 14px 16px; overflow-y: auto;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.panel-title {
  font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); margin: 8px 0 8px;
}
.panel-title.small { margin-top: 14px; }
.hint {
  font-size: 11px; color: var(--muted); line-height: 1.4;
  padding: 8px 10px; background: rgba(201,122,58,0.08);
  border: 1px solid rgba(201,122,58,0.18); border-radius: 6px;
}
.controls-help {
  font-size: 11.5px; color: var(--muted); line-height: 1.45;
  background: rgba(201,122,58,0.06);
  border: 1px solid rgba(201,122,58,0.18); border-radius: 8px;
  padding: 4px 10px 10px;
}
.controls-help summary {
  cursor: pointer; color: var(--accent);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.4px;
  padding: 6px 0; list-style: none; user-select: none;
}
.controls-help summary::-webkit-details-marker { display: none; }
.controls-help summary::before { content: "▸ "; color: var(--accent); display: inline-block; transition: transform .15s ease; }
.controls-help[open] summary::before { content: "▾ "; }
.ctrl-group + .ctrl-group { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,0.07); }
.ctrl-head {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--accent); margin-bottom: 4px;
}
.ctrl-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 2px 0; font-size: 11.5px;
}
.ctrl-row > span:first-child { color: var(--text); }
.ctrl-row > span:last-child  { color: var(--muted); }
.row { margin-bottom: 10px; }
.row label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.row input:not([type="checkbox"]):not([type="radio"]),
.row select {
  width: 100%; padding: 7px 9px; background: rgba(255,255,255,0.03);
  color: var(--text); border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: inherit;
}
.row input:focus, .row select:focus { outline: none; border-color: var(--accent-2); }
/* Checkboxes / radios inside rows: keep natural size — the styled-input rule
   above otherwise stretches them to 100% width and breaks .ck-line layout. */
.row input[type="checkbox"], .row input[type="radio"] {
  width: auto; height: auto; padding: 0;
  background: transparent; border: 0;
  margin: 2px 0 0 0; flex-shrink: 0;
}
.row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.two-col > div { width: 100%; }

button {
  background: rgba(201,122,58,0.18); color: var(--text);
  border: 1px solid rgba(201,122,58,0.45);
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
  font-family: inherit;
}
button:hover { background: rgba(201,122,58,0.32); }
button.primary { background: var(--accent); color: #221904; border-color: var(--accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button.small-btn { padding: 5px 10px; font-size: 11.5px; margin-top: 5px; }

.place-row { position: relative; }
.autocomplete-results {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 8px; margin-top: 4px;
  max-height: 220px; overflow-y: auto; z-index: 20;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
}
.autocomplete-results.open { display: block; }
.autocomplete-results .ac-item {
  padding: 8px 12px; cursor: pointer; font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.autocomplete-results .ac-item:last-child { border-bottom: none; }
.autocomplete-results .ac-item:hover,
.autocomplete-results .ac-item.active { background: rgba(201,122,58,0.18); }
.autocomplete-results .ac-item .coords { color: var(--muted); font-family: ui-monospace, monospace; font-size: 10.5px; margin-top: 2px; }
.autocomplete-results .ac-empty { padding: 10px 12px; color: var(--muted); font-size: 12px; }

.readout {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; line-height: 1.55; color: #d4cfe6;
}
.readout .pl-row {
  display: grid; grid-template-columns: 22px 1fr auto auto; gap: 6px;
  padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.readout .pl-row:last-child { border-bottom: none; }
.readout .pl-sym { color: var(--accent); text-align: center; }
.readout .pl-sign { color: var(--muted); }
.readout .pl-retro { color: var(--warn); }
.readout .pl-divider {
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.4px;
  padding: 8px 0 4px; margin-top: 6px; border-top: 1px dashed rgba(255,255,255,0.08);
}
.small-text { font-size: 11.5px; }
.ayanamsa {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.ayanamsa span { color: var(--accent); font-family: ui-monospace, monospace; }

/* ============================ CHART ============================ */
.chart-wrap {
  display: grid; grid-template-columns: 340px 1fr; height: 100%;
}
.chart-form {
  background: var(--panel-solid); border-right: 1px solid var(--line);
  padding: 18px; overflow-y: auto;
}
.chart-results { padding: 18px 22px; overflow-y: auto; }

.chart-meta {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  display: flex; gap: 24px; flex-wrap: wrap;
}
.chart-meta .meta-item { font-size: 12.5px; }
.chart-meta .meta-item span { color: var(--muted); display: block; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }

.chart-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 1100px) { .chart-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 16px;
}
.card-title {
  font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.chart-svg { width: 100%; aspect-ratio: 1; max-width: 460px; margin: 0 auto; display: block; }
.chart-svg svg { width: 100%; height: 100%; }

table.positions {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
table.positions th, table.positions td {
  padding: 7px 8px; text-align: left; border-bottom: 1px solid var(--line);
}
table.positions th {
  font-weight: 500; color: var(--muted); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1px;
}
table.positions td.num { font-family: ui-monospace, monospace; font-size: 12px; }
table.positions tr:hover td { background: rgba(255,255,255,0.02); }
.retro-tag { color: var(--warn); font-size: 11px; margin-left: 4px; }

.dasha-list { font-size: 12.5px; }
.dasha-row {
  display: grid; grid-template-columns: 100px 1fr auto; gap: 12px;
  padding: 6px 4px; border-bottom: 1px dashed rgba(255,255,255,0.07);
}
.dasha-row:last-child { border-bottom: none; }
.dasha-row.current { background: rgba(201,161,74,0.08); border-radius: 6px; padding: 6px 8px; }
.dasha-lord { color: var(--accent); }
.dasha-period { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11.5px; }

#yoga-notes ul { padding-left: 18px; margin: 4px 0; }
#yoga-notes li { font-size: 13px; padding: 3px 0; }

/* ============================ SANKALPA ============================ */
.sankalpa-wrap {
  max-width: 880px; margin: 0 auto; padding: 32px 28px; overflow-y: auto; height: 100%;
}
.dev-notice {
  background: rgba(231,106,90,0.10);
  border: 1px solid rgba(231,106,90,0.4);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12.5px; line-height: 1.5;
  color: var(--text);
  margin-bottom: 22px;
}
.dev-notice strong { color: var(--warn); }
.sankalpa-tz-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 4px; padding: 10px 12px;
  background: rgba(201,122,58,0.06);
  border: 1px solid rgba(201,122,58,0.18); border-radius: 8px;
}
.sankalpa-tz-row label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1.2px;
}
.sankalpa-tz-row select {
  background: rgba(255,255,255,0.04); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; font-family: inherit; font-size: 13px;
}
.sankalpa-intro h2 { color: var(--accent); margin: 0 0 12px; font-size: 26px; letter-spacing: 0.5px; }
.sankalpa-intro p { font-size: 14px; line-height: 1.6; color: var(--text); margin: 0 0 10px; }
.sankalpa-intro p.muted { color: var(--muted); font-size: 12.5px; }
.sankalpa-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; margin: 22px 0;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.sankalpa-recitation {
  font-family: "Times New Roman", "Georgia", serif;
  font-size: 18px; line-height: 1.65; color: var(--accent);
  text-align: center; padding: 12px 8px;
  font-style: italic; letter-spacing: 0.3px;
}
.sankalpa-meta {
  font-size: 11.5px; color: var(--muted); text-align: center;
  font-family: ui-monospace, monospace;
  border-top: 1px dashed rgba(255,255,255,0.08); padding-top: 10px; margin-top: 6px;
}
.sk-table { display: grid; grid-template-columns: 140px 1fr 1fr; gap: 8px 16px; font-size: 13px; }
.sk-table .sk-label { color: var(--accent); text-transform: uppercase; letter-spacing: 1px; font-size: 10.5px; }
.sk-table .sk-val   { color: var(--text); }
.sk-table .sk-desc  { color: var(--muted); font-size: 12px; }
.sk-table .sk-row { display: contents; }
.sk-table .sk-row > * { padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,0.06); }

/* ============================ SAVED ============================ */
.saved-wrap { padding: 22px; overflow-y: auto; height: 100%; }
.muted { color: var(--muted); font-size: 12.5px; }
.saved-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.saved-card .info b { font-size: 14px; }
.saved-card .info div { font-size: 12px; color: var(--muted); margin-top: 2px; }
.saved-card .actions { display: flex; gap: 6px; }
.saved-card button { padding: 5px 10px; font-size: 12px; }
.saved-card button.danger { border-color: rgba(255,107,107,0.4); background: rgba(255,107,107,0.15); }

/* ============================ ABOUT ============================ */
.about {
  max-width: 720px; margin: 0 auto; padding: 40px 24px; overflow-y: auto; height: 100%;
}
.about h2 { color: var(--accent); }
.about h3 { color: var(--text); margin-top: 24px; font-size: 16px; }
.about ul li { padding: 4px 0; font-size: 13.5px; }

/* ascendant selector floating at the top of the sky view */
.ascendant-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px 6px 12px; display: flex; align-items: center; gap: 10px;
  z-index: 5; backdrop-filter: blur(8px);
}
.ascendant-bar label {
  font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px;
}
.ascendant-bar select {
  background: rgba(255,255,255,0.05); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font-family: inherit; font-size: 12.5px;
}
.ascendant-bar select:focus { outline: none; border-color: var(--accent-2); }
/* subtle divider before the ayanamsa control so it reads as a separate concept */
.ascendant-bar .ayanamsa-label {
  border-left: 1px solid var(--line);
  padding-left: 12px; margin-left: 4px;
}

/* selected-planet info panel (left side) */
.planet-info-panel {
  position: absolute; top: 16px; left: 16px; width: 320px;
  max-height: calc(100% - 32px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 14px 16px; overflow-y: auto;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  z-index: 5;
}
.planet-info-panel[hidden] { display: none; }
.close-info {
  position: absolute; top: 6px; right: 6px;
  background: transparent; border: none; color: var(--muted);
  font-size: 20px; line-height: 1; padding: 4px 8px; cursor: pointer;
}
.close-info:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.info-head { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.info-sym { font-size: 26px; color: var(--accent); }
.info-name { font-size: 15px; font-weight: 500; }
.info-pos { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-family: ui-monospace, monospace; }
.info-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.info-section-title { font-size: 10.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 4px; }
.info-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.info-text { font-size: 13px; line-height: 1.5; color: var(--text); }

/* tooltip for 3d planet */
.sky-tooltip {
  position: absolute; pointer-events: none;
  background: rgba(7,6,13,0.92); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 8px; font-size: 11.5px;
  font-family: ui-monospace, monospace; color: var(--text);
  transform: translate(-50%, calc(-100% - 8px));
  white-space: nowrap; z-index: 30;
  display: none;
}
.sky-tooltip b { color: var(--accent); }

/* ============================ INTERPRETATIONS (chart view) ============================ */
.interp-row {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 10px 0 12px;
}
.interp-row:last-child { border-bottom: none; }
.interp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.interp-sym { color: var(--accent); font-size: 18px; }
.interp-name { font-size: 14px; font-weight: 500; }
.interp-where { color: var(--muted); font-size: 11.5px; font-family: ui-monospace, monospace; }
.interp-block { font-size: 13px; line-height: 1.5; color: var(--text); padding: 3px 0; }
.interp-tag { color: var(--accent); font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; margin-right: 6px; }

/* ============================ RESPONSIVE — tablet & mobile ============================ */
/* On narrower viewports, allow vertical scroll on the body and let views stack. */
@media (max-width: 900px) {
  body { overflow: auto; }
  .topbar {
    height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px;
    position: sticky; /* still pinned but flows with scroll */
  }
  .brand h1 { font-size: 16px; }
  .brand .sub { display: none; }
  .tabs { flex-wrap: wrap; row-gap: 4px; }
  .tab { padding: 6px 10px; font-size: 12px; }
  .view { position: relative; top: 0; min-height: calc(100vh - 64px); }

  /* Sky view: collapse the side panel to a bottom drawer */
  #view-sky #three-host { position: relative; height: 60vh; }
  .sky-panel {
    position: static; width: auto; max-height: none; margin: 0 12px 12px;
  }
  .ascendant-bar { position: static; transform: none; margin: 8px 12px; justify-content: center; }
  .planet-info-panel {
    position: static; width: auto; max-height: none; margin: 0 12px 12px;
  }

  /* Chart view: stack the form on top of results */
  .chart-wrap { grid-template-columns: 1fr; height: auto; }
  .chart-form { border-right: none; border-bottom: 1px solid var(--line); }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-svg { max-width: 100%; }

  /* Sankalpa: tighter padding */
  .sankalpa-wrap { padding: 20px 16px; }
  .sankalpa-recitation { font-size: 15px; }
  .sk-table { grid-template-columns: 1fr; gap: 4px; }
  .sk-table .sk-row > * { padding: 4px 0; border: none; }
  .sk-table .sk-label { padding-top: 8px; }
  .sk-table .sk-row { padding-bottom: 6px; border-bottom: 1px dashed rgba(255,255,255,0.06); }

  /* Saved & About: tighter padding */
  .saved-wrap, .about { padding: 16px; }
  .about { padding: 24px 16px; }

  /* Tooltip-on-touch: hide hover tooltip on small viewports; tap-to-select panel covers it */
  .sky-tooltip { display: none !important; }
}

/* Tiny phones: shrink chip-style tabs further */
@media (max-width: 480px) {
  .brand h1 { font-size: 15px; }
  .tab { padding: 5px 8px; font-size: 11.5px; border-radius: 6px; }
  .panel-title { font-size: 10.5px; }
  .row input, .row select { padding: 9px 10px; font-size: 14px; } /* big enough to avoid iOS auto-zoom */
  button { padding: 10px 14px; font-size: 14px; }
}

/* Touch-friendly hit targets on coarse pointers */
@media (pointer: coarse) {
  .tab, button, .ac-item { min-height: 40px; }
  .close-info { padding: 8px 12px; font-size: 22px; }
}

/* ============ Pañchāṅga panel ============ */
.panch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.panch-cell {
  padding: 10px 12px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.panch-key  { font-size: 10.5px; color: var(--accent); letter-spacing: 1.2px; text-transform: uppercase; }
.panch-val  { font-size: 15px; color: var(--text); margin-top: 4px; }
.panch-sub  { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-family: ui-monospace, monospace; }

/* ============ Aṣṭakavarga grid ============ */
.av-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
@media (max-width: 720px) { .av-grid { grid-template-columns: repeat(4, 1fr); } }
.av-cell {
  padding: 8px 6px;
  text-align: center;
  border-radius: 6px;
  background: hsl(var(--av-hue) 35% 18%);
  border: 1px solid hsl(var(--av-hue) 40% 28%);
}
.av-house { font-size: 10px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.av-sign  { font-size: 11.5px; color: var(--text); margin: 2px 0; }
.av-val   { font-size: 18px; font-weight: 600; color: hsl(var(--av-hue) 80% 75%); font-family: ui-monospace, monospace; }
.av-note  { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.av-details summary { cursor: pointer; color: var(--accent); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; padding: 6px 0; }
.av-table-wrap { overflow-x: auto; }
.av-table { width: 100%; border-collapse: collapse; font-size: 11.5px; font-family: ui-monospace, monospace; }
.av-table th, .av-table td { padding: 4px 6px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.av-table th { color: var(--muted); font-weight: 500; }
.av-table tr.sav-row td { background: rgba(201,161,74,0.07); color: var(--accent); }

/* ============ Click-to-explore house info panel ============ */
.house-info-panel {
  display: none;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 16px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}
.house-info-panel.open { display: block; }
.house-info-panel .info-close {
  position: absolute; top: 10px; right: 14px;
  background: transparent; border: 1px solid var(--line);
  color: var(--muted); border-radius: 50%;
  width: 28px; height: 28px; padding: 0; line-height: 1;
  font-size: 18px; cursor: pointer;
}
.house-info-panel .info-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.house-info-panel .info-block {
  padding: 8px 0 10px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
}
.house-info-panel .info-block:last-child { border-bottom: none; }
.house-info-panel .info-h1 {
  font-size: 14px; color: var(--accent); letter-spacing: 0.5px; margin-bottom: 4px;
}
.house-info-panel .info-h2 { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.house-info-panel p { font-size: 13px; line-height: 1.55; margin: 4px 0; color: var(--text); }
.house-info-panel p.muted { color: var(--muted); font-size: 12.5px; }
.house-info-panel .planet-block {
  margin: 8px 0; padding: 8px 10px;
  background: rgba(122,92,255,0.06); border-radius: 6px;
}

/* Inline hint label on card titles */
.hint-inline {
  font-size: 10px; color: var(--muted);
  font-weight: normal; text-transform: none; letter-spacing: 0;
  margin-left: 6px;
}

/* All-dashas expandable list */
.dasha-list details.maha { margin-bottom: 4px; border-bottom: 1px dashed rgba(255,255,255,0.06); }
.dasha-list details.maha[open] { background: rgba(122,92,255,0.04); border-radius: 6px; }
.dasha-list details.maha.current-maha { background: rgba(201,161,74,0.08); border-radius: 6px; }
.dasha-list summary.maha-row { cursor: pointer; padding: 6px 8px; list-style: none; display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; }
.dasha-list summary.maha-row::-webkit-details-marker { display: none; }
.dasha-list summary.maha-row::before { content: "▸"; color: var(--muted); margin-right: 4px; }
.dasha-list details[open] > summary.maha-row::before { content: "▾"; }
.dasha-list .bhukti-list { padding: 4px 24px 8px; }
.dasha-list .bhukti-row {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 12px;
  padding: 3px 0; font-size: 11.5px;
}
.dasha-list .bhukti-row.current { background: rgba(201,161,74,0.12); border-radius: 4px; padding: 3px 6px; }

/* Tooltip yogas list */
.sky-tooltip .tt-yogas { margin-top: 6px; padding-top: 4px; border-top: 1px dashed rgba(255,255,255,0.12); line-height: 1.4; }

/* Planet snippet in side panel */
.planet-snippet {
  padding: 8px 10px;
  margin: 6px 0;
  background: rgba(122,92,255,0.06);
  border-radius: 6px;
}
.info-sym-small { font-size: 13px; color: var(--accent); margin-bottom: 4px; }
.muted { color: var(--muted); }

/* ============ Major Transits panel ============ */
.transit-list {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,0.18);
}
.transit-list .ev-meta {
  padding: 8px 10px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--panel-solid);
  z-index: 1;
}
.transit-list .ev-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background .12s ease;
}
.transit-list .ev-row:hover { background: rgba(217,164,74,0.08); }
.transit-list .ev-row.active {
  background: rgba(217,164,74,0.18);
  border-left: 2px solid var(--accent);
}
.transit-list .ev-row:focus { outline: none; background: rgba(217,164,74,0.12); }
.transit-list .ev-date {
  font-family: ui-monospace, monospace;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.transit-list .ev-title {
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
}
.transit-list .ev-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}
.transit-list .ev-sym {
  display: inline-block;
  width: 16px;
  text-align: center;
  font-family: ui-monospace, monospace;
}
.transit-list .ev-ingress     .ev-sym { color: #d9a44a; }
.transit-list .ev-station     .ev-sym { color: #e76a5a; }
.transit-list .ev-eclipse     .ev-sym { color: #c98bff; }
.transit-list .ev-conjunction .ev-sym { color: #7fdfff; }

/* Major-transits panel additions */
.transit-list .ev-eclipse-strong {
  background: linear-gradient(90deg, rgba(201,139,255,0.10), rgba(201,139,255,0.02));
  border-left: 2px solid #c98bff;
}
.transit-list .ev-eclipse-strong .ev-title { color: #ddc1ff; font-weight: 600; }
.transit-list .ev-eclipse-strong .ev-sym   { color: #c98bff; font-size: 13px; }
.transit-list .ev-minor .ev-date,
.transit-list .ev-minor .ev-title,
.transit-list .ev-minor .ev-sub { opacity: 0.72; }
.transit-list .ev-minor::before {
  content: "minor";
  display: inline-block;
  position: absolute; right: 10px;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--muted);
  padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px;
  background: rgba(255,255,255,0.02);
}
.transit-list .ev-row { position: relative; }
label.ck-line {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 11px; color: var(--muted); line-height: 1.35; cursor: pointer;
}
label.ck-line input[type=checkbox] { margin-top: 2px; flex-shrink: 0; }

/* ============ Sankalpa location input ============ */
.sankalpa-loc-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 0;
}
.sankalpa-loc-row label { font-size: 12px; color: var(--muted); }
.sankalpa-loc-row input {
  flex: 1; min-width: 220px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  color: var(--text); border: 1px solid var(--line); border-radius: 7px;
  font-size: 13px; font-family: ui-monospace, monospace;
}
.sankalpa-loc-row input:focus { outline: none; border-color: var(--accent-2); }
.sankalpa-loc-row button { padding: 8px 14px; }
.sk-status {
  flex-basis: 100%; font-size: 11.5px; color: var(--muted);
  font-family: ui-monospace, monospace; min-height: 16px;
}
.sk-row.sk-head .sk-label,
.sk-row.sk-head .sk-val,
.sk-row.sk-head .sk-desc {
  font-size: 10.5px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 1.2px;
}

/* ============ Sankalpa: fixed Kauai location block ============ */
.sankalpa-loc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
}
.sk-location-label {
  display: flex; flex-direction: column; gap: 2px;
}
.sk-location-name {
  font-size: 15px; color: var(--accent); font-weight: 500;
  letter-spacing: 0.3px;
}
.sk-location-coords {
  font-size: 11.5px; color: var(--muted);
  font-family: ui-monospace, monospace;
}
.sk-location-note {
  grid-column: 1 / -1;
  font-size: 12px; line-height: 1.5; color: var(--muted);
  background: rgba(201,122,58,0.06);
  border-left: 2px solid rgba(217,164,74,0.4);
  border-radius: 4px;
  padding: 10px 12px; margin-top: 6px;
}

/* ============ About page styling ============ */
.about .lede {
  font-size: 16px; line-height: 1.6; color: var(--text);
  margin: 4px 0 24px;
  padding: 14px 16px;
  background: rgba(217,164,74,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.about ul.tips {
  list-style: none; padding-left: 0;
}
.about ul.tips li {
  padding: 7px 0 7px 22px;
  position: relative;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  font-size: 13.5px; line-height: 1.55;
}
.about ul.tips li:before {
  content: "✦";
  position: absolute; left: 0; top: 8px;
  color: var(--accent); font-size: 11px;
}
.about ul.tips li:last-child { border-bottom: none; }
.about ul.grahas {
  list-style: none; padding-left: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
@media (min-width: 720px) {
  .about ul.grahas { grid-template-columns: 1fr 1fr; gap: 4px 24px; }
}
.about ul.grahas li {
  padding: 6px 0; font-size: 13px;
  border-bottom: 1px dashed rgba(255,255,255,0.04);
}
.about ul.grahas .g {
  display: inline-block;
  min-width: 200px;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.2px;
}
.about p { line-height: 1.65; }
.about em { color: var(--text); opacity: 0.92; }

/* ============ Sankalpa iframe fallback ============ */
.sk-fallback .sk-fallback-note {
  font-size: 12px; line-height: 1.5; color: var(--muted);
  background: rgba(231,106,90,0.08);
  border-left: 2px solid rgba(231,106,90,0.5);
  border-radius: 4px;
  padding: 9px 12px;
  margin: 4px 0 14px;
}
#sankalpa-iframe {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7eedd; /* upstream page has a light background; this avoids a flash */
  display: block;
}

/* ============ Long-form interpretations ============ */
#chart-longform .lf-planet {
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.07);
}
#chart-longform .lf-planet:last-child { border-bottom: none; }
.lf-planet-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 4px 0 8px;
  font-size: 16px; font-weight: 500; color: var(--text);
}
.lf-sym { color: var(--accent); font-size: 20px; }
.lf-where { color: var(--muted); font-size: 12.5px; font-family: ui-monospace, monospace; margin-left: auto; }
.lf-details {
  margin: 6px 0;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid rgba(217,164,74,0.35);
  border-radius: 4px;
}
.lf-details summary {
  cursor: pointer; color: var(--accent);
  font-size: 12.5px; letter-spacing: 0.4px;
  padding: 2px 0;
  list-style: none;
}
.lf-details summary::-webkit-details-marker { display: none; }
.lf-details summary::before { content: "▸ "; color: var(--accent); display: inline-block; transition: transform .15s ease; }
.lf-details[open] summary::before { content: "▾ "; }
.lf-details p {
  margin: 8px 0 4px; line-height: 1.6;
  font-size: 13.5px; color: var(--text);
}
.lf-keywords {
  display: block; margin-bottom: 6px;
  font-size: 11.5px; color: var(--muted);
  font-style: italic; letter-spacing: 0.3px;
}
.lf-note {
  margin-top: 18px; padding: 10px 14px;
  font-size: 12px; border-radius: 6px;
  background: rgba(201,122,58,0.05);
  border-left: 2px solid rgba(217,164,74,0.3);
}

/* ============ Print stylesheet — used by "Download as PDF" ============ */
@media print {
  /* Strip the chrome — keep only the chart-results column */
  .topbar, .sky-panel, .ascendant-bar, .planet-info-panel,
  .chart-form, .saved-wrap, .about, .sankalpa-wrap,
  #view-sky, #view-saved, #view-about, #view-sankalpa { display: none !important; }
  body { background: white !important; color: #1a1410 !important; overflow: visible !important; }
  html, body { height: auto !important; }
  .view {
    position: static !important;
    top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
  }
  #view-chart, #view-chart.active { display: block !important; }
  .chart-wrap { display: block !important; }
  .chart-results {
    padding: 0 !important; margin: 0 !important;
    overflow: visible !important;
  }
  /* Card and section styling for print */
  .card, .sankalpa-card, .house-info-panel {
    background: white !important;
    border: 1px solid #c9b89a !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 14px;
    color: #1a1410 !important;
  }
  .card-title { color: #6b4a18 !important; }
  /* Chart SVGs */
  .chart-svg svg rect[stroke],
  .chart-svg svg line,
  .chart-svg svg polygon { stroke: #6b5538 !important; }
  .chart-svg svg text { fill: #1a1410 !important; }
  .chart-svg svg text[fill="#d9a44a"] { fill: #8a6f47 !important; }
  /* Tables, dasha rows — make readable on white */
  .positions, .av-table, .dasha-list, .sk-table {
    color: #1a1410 !important;
  }
  table.positions th, table.positions td,
  .av-table th, .av-table td {
    border-color: #d8c9aa !important;
  }
  .dasha-row, .bhukti-row { color: #1a1410 !important; border-bottom-color: #d8c9aa !important; }
  /* Always show every collapsed section in the PDF */
  details, details > * { display: block !important; }
  details > summary { font-weight: 500; color: #6b4a18 !important; }
  details > summary::before { content: "" !important; }
  /* Long-form interpretations: readable, page-break friendly */
  #chart-longform .lf-details {
    background: #fdf8eb !important;
    border-left: 3px solid #c9a14a !important;
    color: #1a1410 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  #chart-longform .lf-details p { color: #1a1410 !important; }
  #chart-longform .lf-planet { page-break-inside: avoid; break-inside: avoid; }
  /* Hide elements that don't belong in a printed natal chart */
  #house-info-panel,                  /* the click-to-explore panel */
  .hint, .hint-inline,
  #toast-host { display: none !important; }
  /* Force a small margin around the page */
  @page { margin: 14mm; }
}

/* Primary instruction hint at the top of the Live Sky panel —
   slightly stronger than .hint so first-time visitors notice it. */
.hint.hint-primary {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(217,164,74,0.10);
  border: 1px solid rgba(217,164,74,0.35);
  padding: 10px 12px;
}
.hint.hint-primary b { color: var(--accent); }

/* ============ Janma Nakṣatra card (Birth Chart page) ============ */
.nak-card { padding: 4px 0; }
.nak-name-row {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 12px;
}
.nak-star {
  font-size: 26px; color: var(--accent);
  line-height: 1; margin-top: 2px;
}
.nak-name {
  font-size: 18px; color: var(--text); font-weight: 500;
  letter-spacing: 0.3px;
}
.nak-keyword {
  color: var(--accent); font-weight: 400;
  font-size: 14px; font-style: italic;
}
.nak-meta {
  font-size: 12px; color: var(--muted);
  font-family: ui-monospace, monospace;
  margin-top: 3px;
}
.nak-desc {
  font-size: 14px; line-height: 1.6; color: var(--text);
  margin: 10px 0 8px;
  padding: 12px 14px;
  background: rgba(217,164,74,0.06);
  border-left: 2px solid rgba(217,164,74,0.45);
  border-radius: 4px;
}
.nak-extra {
  font-size: 12.5px; color: var(--muted);
  margin: 6px 0;
}
.nak-extra b { color: var(--text); font-weight: 500; }
.nak-foot {
  margin-top: 14px;
  font-size: 11.5px; color: var(--muted);
  font-style: italic;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}

/* Brief plain-English intro under each card-title on the Birth Chart page —
   helps new readers know what they're looking at without overwhelming. */
.card-intro {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: -6px 0 14px;     /* tighten against the card-title above */
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-left: 2px solid rgba(217,164,74,0.3);
  border-radius: 4px;
}
.card-intro b { color: var(--text); font-weight: 500; }
.card-intro i { color: var(--text); opacity: 0.85; }
/* When the print stylesheet expands everything, keep these readable on white */
@media print {
  .card-intro {
    color: #4a3a20 !important;
    background: #fdf8eb !important;
    border-left-color: #c9a14a !important;
  }
}
