/* Astrocartography: the site's charcoal and chalk, with Earth's ringed mono buttons */
.astro {
  --ring: color-mix(in srgb, var(--ink) 42%, transparent);
  --glass: color-mix(in srgb, var(--bg) 84%, transparent);
  --faint: color-mix(in srgb, var(--ink) 34%, var(--bg));
}
html:has(.astro), .astro { height: 100%; overflow: hidden }
.astro { display: flex; flex-direction: column }
.astro [hidden] { display: none !important }
.astro > .top { flex: none; background: var(--bg); position: relative; z-index: 10 }
.astro * { box-sizing: border-box }
:where(.astro) :where(button) { font: inherit; color: inherit }

.astro-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 410px }
.stage { position: relative; overflow: hidden; min-height: 0 }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none }
#map.dragging { cursor: grabbing }
#map.picking { cursor: crosshair }

/* ---------- Earth's buttons ---------- */
.layers { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--ring); border-radius: 999px; background: var(--glass) }
.layers button, .seg button { border: 0; background: transparent; min-height: 28px; padding: 4px 10px; border-radius: 999px; font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); cursor: pointer; transition: background .15s, color .15s }
.layers button:not([aria-selected="true"]):hover, .seg button:not([aria-pressed="true"]):not(:disabled):hover { color: var(--ink) }
.layers [aria-selected="true"], .seg [aria-pressed="true"] { background: var(--ink); color: var(--bg) }
.seg button:disabled { opacity: .4; cursor: default }
.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--ring); border-radius: 999px; background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px) }
.seg.small button { min-height: 24px; padding: 3px 9px }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ring); background: var(--glass); border-radius: 999px; min-height: 28px; padding: 3px 10px 3px 6px; font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); cursor: pointer; transition: background .15s, color .15s }
.chip.text { padding-left: 10px }
.chip:not([aria-pressed="true"]):hover { color: var(--ink) }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink) }
.chip .g { font: 15px/1 var(--sans); letter-spacing: 0; text-transform: none; width: 16px; text-align: center }
.chip.x { padding: 0; width: 30px; height: 30px; justify-content: center }
.chip.x svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round }

/* ---------- over the map ---------- */
.views { position: absolute; top: 14px; left: 14px; z-index: 2 }
.hint { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 2; margin: 0; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase }
.when { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; pointer-events: none }
.when > * { pointer-events: auto }
.when #scrub, .when #speed { display: none }
.when.dated #scrub { display: block; flex: 1 1 160px; min-width: 120px }
.when.dated #speed { display: inline-flex }
.when #stamp { flex: 1 1 100%; order: -1; margin: 0; font: 400 12px/1.3 var(--mono); color: var(--soft); text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg) }
.when #stamp b { color: var(--ink); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; margin-right: 6px }
#scrub { accent-color: var(--ink); height: 28px }

/* ?clip: the map and its date alone, for the Life card */
.clip :is(.astro > .top, .panel, .views, .hint, #mode, #play, #scrub, #speed, .badge, .legend) { display: none !important }
.clip .astro-main { grid-template-columns: minmax(0, 1fr) }
.clip .stage { height: 100%; min-height: 0 }

/* ---------- the panel ---------- */
.panel { min-height: 0; overflow: auto; border-left: 1px solid var(--line); padding: 20px 22px 40px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin }
.panel > header h1 { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em }
.panel .sub { margin: 6px 0 0; font-size: 15px; line-height: 1.4; color: var(--soft); text-wrap: pretty }
.birth { border: 1px solid var(--line); border-radius: 16px; padding: 14px }
.birth form { display: flex; flex-direction: column; gap: 10px }
.birth label { display: flex; flex-direction: column; gap: 5px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--soft) }
.birth label.check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font: 500 14px/1.2 var(--sans); color: var(--ink) }
.birth input:not([type="checkbox"]), .birth select { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--wash); color: var(--ink); font: 500 15px/1.2 var(--sans); letter-spacing: 0; text-transform: none }
.birth input:focus-visible, .birth select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px }
.birth input:disabled { opacity: .45 }
.birth .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.birth details summary { cursor: pointer; font-size: 14px; color: var(--soft) }
.birth details[open] { display: flex; flex-direction: column; gap: 10px }
.birth .link { align-self: flex-start; margin-top: -4px; padding: 0; border: 0; background: none; font-size: 14px; color: var(--soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer }
.birth .link:hover { color: var(--ink) }
.birth .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.birth .go { min-height: 38px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; cursor: pointer }
.birth .go:hover { opacity: .88 }
.birth .note { margin: 0; font-size: 13px; color: var(--soft) }
.birth .err { margin: 0; font-size: 14px; font-weight: 600 }
.birth .warn { margin: 0; font-size: 13px; line-height: 1.4; color: var(--soft); border-left: 2px solid var(--ink); padding-left: 10px }
#summary { display: flex; flex-direction: column; gap: 10px }
#summary[hidden] { display: none }
#summary p { margin: 0; font-size: 15px; line-height: 1.45 }
#summary .row { display: flex; gap: 8px }

.planets { display: flex; flex-wrap: wrap; gap: 6px }
.tabs { align-self: flex-start }
.tab { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5 }
.tab h2 { margin: 4px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25 }
.tab h3 { margin: 10px 0 0; font: 500 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft) }
.tab p { margin: 0; text-wrap: pretty }
.tab .lead { font-size: 17px; font-weight: 600; line-height: 1.4 }
.soft { color: var(--soft) }
.mono { font-family: var(--mono); font-size: 12px }
.here-h { display: flex; align-items: center; justify-content: space-between; gap: 10px }
.tab ul { list-style: none; margin: 0; padding: 0 }
.lines { display: flex; flex-direction: column; gap: 2px }
.ln { padding: 10px 0; border-top: 1px solid var(--line) }
.ln-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px }
.ln-h b { font-weight: 700 }
.ln-h span { flex: none; font: 400 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--soft) }
.ln p { margin-top: 4px; color: var(--soft); font-size: 14px }
.dim { opacity: .4 }
.places { display: grid; grid-template-columns: 1fr 1fr; gap: 6px }
.places button { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: none; text-align: left; cursor: pointer }
.places button:hover { background: var(--wash2) }
.places b { font-size: 14px }
.places span { font-size: 12px; color: var(--soft) }
.places i { font: normal 400 11px/1.2 var(--mono); color: var(--soft); letter-spacing: .04em }
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px }
.big3 div { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px }
.big3 span { font: 400 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--soft) }
.big3 b { font-size: 14px }
.pos { width: 100%; border-collapse: collapse; font-size: 14px }
.pos td { padding: 5px 4px; border-top: 1px solid var(--line) }
.pos td.g { width: 22px; text-align: center; font-size: 16px }
.pos td:last-child { text-align: right; color: var(--soft) }
.pos abbr { text-decoration: none; font-weight: 700 }
.asp li { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px }
.asp li b { font-size: 16px; text-align: center }
.asp li span:last-of-type { text-align: right }
.asp li i { grid-column: 1 / -1; font: normal 400 11px/1 var(--mono); color: var(--soft); text-align: center }
.key { display: flex; flex-direction: column; gap: 10px }
.key li { display: flex; gap: 12px; align-items: flex-start }
.key li div { display: flex; flex-direction: column; gap: 2px }
.key li span { font-size: 14px; color: var(--soft); line-height: 1.4 }
.dash { flex: none; width: 48px; height: 8px; margin-top: 7px; stroke: var(--ink); stroke-width: 2 }
.more { font-weight: 700 }

/* ---------- the wheel ---------- */
.wheel { width: 100%; max-width: 380px; align-self: center; overflow: visible; margin: 6px 0 }
.wheel text { fill: var(--ink); text-anchor: middle; dominant-baseline: central }
.w-rim { fill: none; stroke: var(--ink); stroke-opacity: .5 }
.w-rim.faint { stroke-opacity: .2 }
.w-line { stroke: var(--ink); stroke-opacity: .32 }
.w-line.faint { stroke-opacity: .2 }
.w-line.strong { stroke-opacity: .85; stroke-width: 1.4 }
.w-sign { font-size: 15px; fill-opacity: .8 }
.w-num { font: 400 9px var(--mono); fill-opacity: .55 }
.w-angle { font: 500 10px var(--mono); letter-spacing: .06em }
.w-planet { font-size: 17px }
.w-deg { font: 400 9px var(--mono); fill-opacity: .7 }
.w-asp { stroke: var(--ink); stroke-opacity: .32; stroke-dasharray: 2 3 }
.w-asp.hard { stroke-dasharray: none; stroke-opacity: .45 }
.w-asp.lit { stroke-opacity: .95; stroke-width: 1.4 }
.w-asp.dim { stroke-opacity: .08 }
.w-body.dim { opacity: .3 }
.w-body.lit .w-planet { font-weight: 700 }

@media (max-width: 900px) {
  html:has(.astro), .astro { height: auto; overflow: auto }
  .astro-main { display: block }
  .stage { height: 62svh; min-height: 360px }
  .panel { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 18px 16px 48px }
}
@media (max-width: 640px) {
  .views { top: 10px; left: 10px }
  .layers button, .seg button { min-height: 26px; padding: 3px 8px; font-size: 10px }
  .when { left: 10px; right: 10px; bottom: 10px }
}
@media (prefers-reduced-motion: reduce) { .seg button, .layers button, .chip { transition: none } }
