.horoscope-app {
  --bg: #f2f0f7;
  --surface: #ffffff;
  --ink: #1d1a33;
  --muted: #625e7d;
  --line: #d7d3e6;
  --accent: #b4590a;
  --accent-soft: #fbe9d4;
  --indigo: #3a2f8f;
  --good: #1f7a4d;
  --bad: #b3261e;
  --font-display: "Spectral", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  padding-block: 24px 48px;
  padding-inline: max(16px, env(safe-area-inset-left, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .horoscope-app {
    --bg: #131120;
    --surface: #1d1a30;
    --ink: #ece9fa;
    --muted: #a29fc2;
    --line: #373358;
    --accent: #f0a04b;
    --accent-soft: #3a2a17;
    --indigo: #a89cff;
    --good: #5fd49b;
    --bad: #ff8a80;
  }
}
:root[data-theme="dark"] .horoscope-app {
  --bg: #131120;
  --surface: #1d1a30;
  --ink: #ece9fa;
  --muted: #a29fc2;
  --line: #373358;
  --accent: #f0a04b;
  --accent-soft: #3a2a17;
  --indigo: #a89cff;
  --good: #5fd49b;
  --bad: #ff8a80;
}
.horoscope-app *,
.horoscope-app *::before,
.horoscope-app *::after { box-sizing: border-box; }
.horoscope-app .wrap { max-width: 1180px; margin: 0 auto; display: grid; gap: 24px; }
.horoscope-app > .wrap > header h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 40px); margin: 0 0 4px; text-wrap: balance; }
.horoscope-app > .wrap > header p { margin: 0; color: var(--muted); max-width: 62ch; }
.horoscope-app .cols { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .horoscope-app .cols { grid-template-columns: minmax(0, 1fr); } }
.horoscope-app .card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; min-width: 0; }
.horoscope-app #results > .card { position: relative; isolation: isolate; overflow: hidden; }
.horoscope-app #results > .card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("../images/logo.png") center / 180px auto no-repeat;
  opacity: 0.20;
  pointer-events: none;
}
.horoscope-app #results > .card > * { position: relative; z-index: 1; }
.horoscope-app .stack { display: grid; gap: 24px; min-width: 0; }
.horoscope-app h2 { font-family: var(--font-display); font-size: 20px; margin: 0 0 12px; }
.horoscope-app .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 4px; }
.horoscope-app .grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.horoscope-app .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.horoscope-app .gender-options { margin: 0 0 12px; padding: 0; border: 0; }
.horoscope-app .gender-options-list { display: flex; flex-wrap: nowrap; align-items: center; gap: 18px; }
.horoscope-app .gender-options label { display: inline-flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.horoscope-app .gender-options input[type="radio"] { width: auto; margin: 0; padding: 0; accent-color: var(--accent); }
.horoscope-app input,
.horoscope-app select {
  width: 100%; padding: 8px 10px; font: 500 15px var(--font-mono);
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
}
.horoscope-app input:focus-visible,
.horoscope-app select:focus-visible,
.horoscope-app button:focus-visible,
.horoscope-app #map:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.horoscope-app button {
  font: 700 15px var(--font-body); padding: 10px 16px; border-radius: 6px; cursor: pointer;
  background: var(--accent); color: #fff; border: 0; width: 100%;
}
.horoscope-app button:disabled { opacity: .5; cursor: not-allowed; }
.horoscope-app .hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.horoscope-app .astrological-disclaimer { font-size: 10.5px; line-height: 1.4; }
.horoscope-app .hint a { color: var(--indigo); }
.horoscope-app .birth-offset { margin-bottom: 12px; }
.horoscope-app .city-picker { margin-bottom: 8px; }
.horoscope-app .picked-location { margin-bottom: 14px; }
.horoscope-app .form-error { color: var(--bad); }
.horoscope-app #map { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: crosshair; display: block; touch-action: manipulation; }
.horoscope-app .leaflet-container { font: 12px var(--font-body); z-index: 0; }
.horoscope-app .leaflet-control-attribution { font-size: 10px; }
.horoscope-app .status { padding: 10px 12px; border-radius: 6px; font-size: 13.5px; border: 1px solid var(--line); background: var(--bg); }
.horoscope-app .status.ok { color: var(--good); }
.horoscope-app .status.err { color: var(--bad); }
.horoscope-app .chartbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; justify-items: center; }
.horoscope-app .charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; width: 100%; }
.horoscope-app .charts figure { margin: 0; min-width: 0; }
.horoscope-app .charts figcaption { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 6px; }
.horoscope-app svg.chart { width: 100%; height: auto; display: block; }
.horoscope-app .chart .frame { fill: var(--surface); stroke: var(--indigo); stroke-width: 2; }
.horoscope-app .chart .ln { stroke: var(--indigo); stroke-width: 1.5; fill: none; }
.horoscope-app .chart .sgn { fill: var(--muted); font: 500 13px var(--font-mono); }
.horoscope-app .chart .pl { fill: var(--ink); font: 700 14px var(--font-body); }
.horoscope-app .chart .pl.asc { fill: var(--accent); }
.horoscope-app .chart .chart-center-label { font: 700 20px var(--font-display); }
.horoscope-app .tablewrap { overflow-x: auto; }
.horoscope-app table { border-collapse: collapse; width: 100%; font-size: 14px; }
.horoscope-app th,
.horoscope-app td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.horoscope-app th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.horoscope-app td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.horoscope-app .rx { color: var(--accent); font-weight: 700; }
.horoscope-app .meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-bottom: 4px; }
.horoscope-app .meta div { min-width: 0; overflow-wrap: anywhere; background: var(--bg); border-radius: 6px; padding: 10px 12px; }
.horoscope-app .meta b { display: block; font-family: var(--font-display); font-size: clamp(12px, 1.25vw, 18px); }
.horoscope-app .dasha-row.now td { background: var(--accent-soft); font-weight: 700; }
.horoscope-app .dasha-row.favourable td { color: #1b5e20; background: #e8f5e9; }
.horoscope-app .dasha-row.unfavourable td { color: #b71c1c; background: #ffebee; }
.horoscope-app .traits-tables { display: grid; gap: 18px; }
.horoscope-app .traits-tables table { table-layout: fixed; }
.horoscope-app .traits-tables caption { padding: 0 10px 6px; color: var(--indigo); font: 700 16px var(--font-display); text-align: left; }
.horoscope-app .traits-tables th { width: 25%; white-space: normal; overflow-wrap: anywhere; text-transform: none; font-size: 12px; }
.horoscope-app .traits-tables td { width: 75%; white-space: normal; overflow-wrap: anywhere; }
.horoscope-app .traits-tables .rashi-forecast-table td { white-space: pre-line; }
.horoscope-app .toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.horoscope-app .toolbar select { min-width: 220px; font-family: var(--font-body); }
.horoscope-app .toolbar button { width: auto; }
.horoscope-app .charts-display { margin-top: 16px; }
.horoscope-app .personal-details-display { list-style: none; margin: 0 0 16px; padding: 0; }
.horoscope-app .personal-details-display li { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr); gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.horoscope-app .personal-details-display .label { margin: 0; }
.horoscope-app .personal-details-display b { overflow-wrap: anywhere; }
.horoscope-app .dasha-note { margin: 0 0 10px; }
.print-watermark { display: none; }
@media (max-width: 600px) {
  .horoscope-app .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .horoscope-app .meta div:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: no-preference) {
  .horoscope-app button { transition: filter .15s; }
  .horoscope-app button:hover:not(:disabled) { filter: brightness(1.08); }
}
@media print {
  body { background: #fff; color: #000; padding: 0; }
  body > .print-watermark {
    display: block !important;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 280px;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0.07;
    pointer-events: none;
  }
  body > *:not(.print-watermark) { position: relative; z-index: 1; }
  [data-site-navigation],
  [data-site-footer],
  .horoscope-app > .wrap > header,
  .horoscope-app #libstatus,
  .horoscope-app .toolbar { display: none !important; }
  .horoscope-page,
  .horoscope-page > section { background: transparent !important; }
  .horoscope-app {
    --bg: #f2f0f7;
    --surface: #fff;
    --ink: #1d1a33;
    --muted: #625e7d;
    --line: #d7d3e6;
    --accent: #b4590a;
    --accent-soft: #fbe9d4;
    --indigo: #3a2f8f;
    color: var(--ink);
    color-scheme: light;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .horoscope-app .wrap { display: block; max-width: none; }
  .horoscope-app .cols { display: block; }
  .horoscope-app #form { display: none !important; }
  .horoscope-app #results:not([hidden]) { display: grid; gap: 16px; }
  .horoscope-app .card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; break-inside: avoid; }
  .horoscope-app #results > .card::before { content: none; }
  .horoscope-app .personal-details-display li { border-color: #ccc; }
  .horoscope-app .chart .frame { fill: transparent; }
  .horoscope-app .meta { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 1.4fr); }
  .horoscope-app .meta div:last-child { grid-column: auto; }
  .horoscope-app .meta div { background: var(--bg); border: 1px solid var(--line); }
  .horoscope-app .tablewrap { overflow: visible; }
  .horoscope-app th,
  .horoscope-app td { border-color: #ccc; }
  .horoscope-app #dasha .dasha-row.favourable td {
    color: #1b5e20 !important;
    background: #e8f5e9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .horoscope-app #dasha .dasha-row.unfavourable td {
    color: #b71c1c !important;
    background: #ffebee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
