/* S02 sky pages: birth-data calculators, chart wheel, Mercury retrograde and full moons. */
.tool-panel {
  --fire: color-mix(in oklab, var(--vermilion) 62%, white);
  --earth: color-mix(in oklab, var(--sage) 55%, white);
  --air: color-mix(in oklab, var(--indigo) 45%, white);
  --water: color-mix(in oklab, #2f8fa3 60%, white);
  --panel-ink: #f3eee3;
  --panel-muted: #c9c4d6;
  --symbols: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", "Noto Sans Symbols 2", "DejaVu Sans", sans-serif;
}

/* Birth form */
.birth-form { display: grid; gap: 1.1rem; }
.optional { font-weight: 500; color: var(--panel-muted); font-size: .8rem; margin-left: .3rem; }
.city-combo { position: relative; }
.city-list { position: absolute; z-index: 5; top: calc(100% + .35rem); left: 0; right: 0; max-height: 18rem; overflow-y: auto; margin: 0; padding: .35rem; list-style: none; background: var(--card); color: var(--ink); border-radius: 12px; box-shadow: 0 24px 48px -20px #000a; }
.city-list li { padding: .6rem .75rem; border-radius: 8px; cursor: pointer; font-size: .95rem; }
.city-list li[aria-selected="true"], .city-list li:hover { background: var(--brass-wash); }
.city-list .city-empty { cursor: default; color: var(--muted); }
.manual-place summary { cursor: pointer; color: var(--star); font-weight: 700; font-size: .92rem; width: fit-content; }
.manual-place[open] summary { margin-bottom: .9rem; }

/* Shared result pieces */
.sky-result { display: grid; gap: 1.25rem; }
.result-context { margin: 0; color: var(--panel-muted); font-size: .92rem; }
.result-callout { margin: 0; padding: .9rem 1.1rem; border-left: 3px solid var(--brass); border-radius: 0 12px 12px 0; background: #ffffff0f; }
.result-heading { margin: .75rem 0 0; }
.badge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .85rem; }
.sign-badge { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: var(--radius); background: #ffffff10; border: 1px solid #f3eee322; }
.sign-glyph { display: grid; place-items: center; flex: none; width: 3.6rem; height: 3.6rem; border-radius: 50%; background: var(--brass); color: var(--ink); font: 400 2rem/1 var(--symbols); }
.sign-badge.is-unknown .sign-glyph { background: transparent; border: 1.5px dashed var(--panel-muted); color: var(--panel-muted); font-family: var(--serif); }
.sign-badge p { margin: 0; }
.badge-eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--star); margin: 0 0 .2rem; }
.badge-sign { font: 400 2rem/1.05 var(--serif); color: #fff8e8; }
.badge-detail { color: var(--panel-muted); font-size: .88rem; }
.reading { padding: 1.1rem 1.25rem; border-radius: var(--radius); background: #ffffff0b; border: 1px solid #f3eee31a; transition: border-color .2s, background .2s; }
.reading h3, .reading h4 { margin: 0 0 .45rem; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; color: #fff8e8; }
.reading p { margin: 0 0 .5rem; }
.reading p:last-child { margin: 0; }
.reading-note, .reading-meta { color: var(--panel-muted); font-size: .9rem; }
.reading-meta { font-weight: 650; }
.reading-facts { display: grid; gap: .55rem; margin: .8rem 0 0; }
.reading-facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; }
.reading-facts dt { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--star); padding-top: .2rem; }
.reading-facts dd { margin: 0; }
.reading.is-active { border-color: var(--brass); background: #c9913c1f; }
.reading-symbol { display: inline-block; min-width: 1.6em; margin-right: .35rem; color: var(--star); font-family: var(--symbols); font-size: .95em; }
.phase-note { display: flex; align-items: center; gap: 1rem; }
.phase-note p { margin: 0; color: var(--panel-muted); font-size: .93rem; }
.moon-svg { width: 3.4rem; height: 3.4rem; flex: none; }
.moon-dark { fill: #2b3058; }
.moon-lit { fill: var(--star); }
.moon-rim { fill: none; stroke: #f4dfae66; stroke-width: 1.5; }

/* Chart wheel */
.chart-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.chart-frame { aspect-ratio: 1; max-width: 40rem; width: 100%; }
.chart-wheel { width: 100%; height: 100%; overflow: visible; font-family: var(--sans); }
.wheel-face { fill: #0d1024; }
.sign-cell { stroke: #f3eee333; stroke-width: 1; fill-opacity: .16; }
.sign-cell.el-fire { fill: var(--fire); } .sign-cell.el-earth { fill: var(--earth); } .sign-cell.el-air { fill: var(--air); } .sign-cell.el-water { fill: var(--water); }
.sign-glyph-text { font: 28px var(--symbols); text-anchor: middle; }
.sign-glyph-text.el-fire { fill: var(--fire); } .sign-glyph-text.el-earth { fill: var(--earth); } .sign-glyph-text.el-air { fill: var(--air); } .sign-glyph-text.el-water { fill: var(--water); }
.ring-line { fill: none; stroke: #f3eee355; stroke-width: 1; }
.inner-line { stroke: #f3eee333; }
.ticks { stroke: #f3eee366; stroke-width: 1; }
.spokes { stroke: #f3eee31f; stroke-width: 1; }
.house-number { fill: var(--panel-muted); font-size: 13px; font-weight: 700; text-anchor: middle; }
.chart-axis path { stroke: var(--brass); stroke-width: 2.2; }
.chart-axis text { fill: var(--star); font-size: 15px; font-weight: 800; letter-spacing: .06em; text-anchor: middle; }
.chart-axis:focus-visible { outline: none; }
.chart-axis:focus-visible text, .chart-axis.is-active text { fill: #fff; text-decoration: underline; }
.aspect { stroke-width: 1.4; opacity: .75; transition: opacity .2s, stroke-width .2s; }
.aspect-trine, .aspect-sextile { stroke: var(--brass); }
.aspect-square, .aspect-opposition { stroke: var(--fire); }
.aspect-conjunction { stroke: #f3eee3; }
.aspect-sextile { stroke-dasharray: 5 4; }
.planet-leader { fill: none; stroke: #f3eee366; stroke-width: 1; }
.planet-dot { fill: var(--star); }
.planet-hit { fill: #14172b; stroke: #f3eee333; stroke-width: 1; transition: fill .2s, stroke .2s; }
.planet-glyph { fill: #fff8e8; font: 27px var(--symbols); text-anchor: middle; pointer-events: none; }
.planet-retro { fill: var(--fire); font-size: 12px; font-weight: 800; }
.chart-planet { cursor: pointer; }
.chart-planet:focus-visible { outline: none; }
.chart-planet:hover .planet-hit, .chart-planet:focus-visible .planet-hit, .chart-planet.is-active .planet-hit { fill: var(--brass); stroke: var(--star); stroke-width: 2; }
.chart-planet:hover .planet-glyph, .chart-planet:focus-visible .planet-glyph, .chart-planet.is-active .planet-glyph { fill: var(--ink); }
.chart-planet:focus-visible .planet-hit { stroke: #fff; stroke-width: 3; }
.has-active .chart-planet:not(.is-active), .has-active .chart-axis:not(.is-active) { opacity: .45; }
.has-active .aspect { opacity: .12; }
.has-active .aspect.is-linked { opacity: 1; stroke-width: 2.6; }
.chart-detail { position: sticky; top: 1rem; padding: 1.25rem; border-radius: var(--radius); background: #ffffff0d; border: 1px solid #f3eee322; min-height: 12rem; }
.chart-detail h3 { font-size: 1.7rem; margin: 0 0 .4rem; }
.chart-detail p { margin: 0 0 .55rem; }
.planet-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.planet-table th, .planet-table td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid #f3eee31f; }
.planet-table thead th { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--panel-muted); }
.planet-table tbody th { font-weight: 700; white-space: nowrap; }
.planet-table tr.is-active { background: #c9913c26; }
.reading-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .85rem; }
.reading-grid .reading { scroll-margin-top: 1rem; }
.aspect-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.aspect-list li { padding: .6rem .85rem; border-radius: 10px; background: #ffffff08; }
.aspect-list li span { color: var(--panel-muted); font-size: .9rem; }
.aspect-list li.is-active { background: #c9913c26; }
@media (max-width: 860px) {
  .chart-layout { grid-template-columns: 1fr; }
  .chart-frame { margin-inline: auto; }
  .chart-detail { position: static; min-height: 0; }
}

@media (max-width: 520px) {
  .chart-frame { width: calc(100% + 1.5rem); max-width: none; margin-inline: -.75rem; }
}

/* Mercury retrograde */
.article > .prose-section { min-width: 0; }
.retro-verdict { font: 400 clamp(2rem, 5vw, 3.2rem)/1.05 var(--serif); color: #fff8e8; margin: 0 0 .6rem; }
.retro-verdict strong { font-weight: 400; color: var(--star); font-style: italic; }
.retro-detail { max-width: 46rem; color: var(--panel-ink); }
.countdown-label { margin: 1.25rem 0 .6rem; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--star); }
.retro-status .countdown { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 30rem; margin: 0; }
.retro-year { margin: 1.75rem 0 0; }
.retro-strip { width: 100%; height: auto; overflow: visible; }
.month-line { stroke: #f3eee326; }
.month-label { fill: var(--panel-muted); font-size: 12px; font-weight: 700; }
.band-shadow, .band-retro { transform-box: fill-box; transform-origin: left center; }
.band-shadow { fill: #f4dfae33; }
.band-retro { fill: var(--fire); }
.today line { stroke: #fff; stroke-width: 2.5; }
.today text { fill: #fff; font-size: 12px; font-weight: 800; text-anchor: middle; }
.retro-year figcaption { margin-top: .6rem; }
@media (max-width: 640px) { .month-label, .today text { font-size: 28px; } .month-label { font-weight: 600; } }
.retro-table td.when strong, .retro-table td.when span { display: block; }
.retro-table td.when span { color: var(--muted); font-size: .82rem; }
.retro-table { min-width: 44rem; }

/* Full moons */
.moon-now-card { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.75rem; }
.moon-now-card p { margin: 0 0 .3rem; }
.moon-now-disc { width: 5.5rem; height: 5.5rem; }
.moon-now-phase { font: 400 clamp(1.6rem, 3.5vw, 2.2rem)/1.1 var(--serif); color: #fff8e8; }
.moon-list-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: .2rem; }
.moon-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.moon-row { display: grid; grid-template-columns: auto minmax(9rem, 1.3fr) 1fr auto; align-items: center; gap: .5rem 1rem; padding: .7rem .9rem; border-radius: 12px; background: #ffffff0b; }
.moon-when strong, .moon-when span { display: block; }
.moon-when span { color: var(--panel-muted); font-size: .85rem; }
.moon-name { font: 400 1.35rem/1.1 var(--serif); color: #fff8e8; }
.moon-name em { font: 700 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--star); margin-left: .35rem; }
.moon-sign { color: var(--star); font-weight: 650; font-size: .92rem; }
.moon-disc { width: 1.6rem; height: 1.6rem; border-radius: 50%; background: radial-gradient(circle at 38% 36%, #fffbea, var(--star) 60%, #d9bd7f); box-shadow: 0 0 14px #f4dfae55; }
.moon-disc-lg { width: 5rem; height: 5rem; flex: none; }
.moon-date { display: flex; align-items: center; gap: 1.5rem; padding: 1.25rem; border-radius: var(--radius); background: var(--night); color: #f3eee3; margin-bottom: 1rem; }
.moon-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .75rem 1.25rem; margin: 0; flex: 1; }
.moon-facts dt { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--star); }
.moon-facts dd { margin: .1rem 0 0; }
.prompt-list li { font: 400 1.25rem/1.35 var(--serif); }
.moon-links { margin-top: 1rem; }
@media (max-width: 640px) {
  .moon-row { grid-template-columns: auto 1fr; }
  .moon-name, .moon-sign { grid-column: 2; }
  .moon-date { flex-direction: column; align-items: flex-start; }
}
.chart-detail .reading-symbol { min-width: 0; margin-right: .5rem; }
