/* Astro Engine · Observatory chart instrument (static/js/observatory.js). Loaded by api/observatory_ui.py only on the
   birth-chart calculator, after observatory.css, which holds the tokens these rules use (night and daylight values).
   Both themes, one rule set: the wheel takes every colour from the tokens below (CSS, never SVG attributes), so a live
   theme switch recolours it in place, without a redraw, and the selection stays (design system section 8: soft aspects
   solid deep ice, hard aspects dashed lamp, ink glyphs, calculated points in --o-muted). Translucent strokes are
   color-mix() of the ice token, so they follow the theme too. */
:where(:root) body.obs:where(.obs-seo) {
  --ow-soft: #9fd0ff;                    /* soft and minor aspects, the aspect key */
  --ow-conj: var(--o-ice-2);             /* conjunction arcs */
  --ow-sign: rgba(220, 235, 252, .94);   /* zodiac glyphs */
  --ow-glyph: #f2f8ff;                   /* planet glyphs */
  --ow-point: #c3d6ee;                   /* calculated points (nodes, Lilith, Chiron): a cooler ink, so the planets lead */
  --ow-bright: #fff;                     /* the selected planet, sign and house */
  --ow-label: rgba(226, 238, 252, .95);  /* ASC and MC */
  --ow-label-2: rgba(176, 196, 222, .82); /* DSC and IC */
  --ow-hnum: rgba(196, 212, 232, .92);   /* house numbers */
  --ow-horizon: rgba(214, 235, 255, .7);
  --ow-port: rgba(214, 235, 255, .9);
  --ow-ring-on: rgba(214, 235, 255, .75);
  --ow-readout-2: #bcd2ea;               /* the readout's name and sign */
  --ow-halo: #060a12;                    /* the readout's halo: the field behind the wheel */
  --ow-chip: #d6deea;
  --ow-chip-type: #a9b6c9;
  --ow-chip-type-on: #c9d4e3;
  --ow-key: #b7c2d4;
  --ow-prompt: #dfe6f0;
  --ow-pos: #e4eaf3;
  --ow-glow: #9cc9f5;                    /* the soft light inside the rim (night only) */
}
/* ---------- the chart instrument (observatory.js) ---------- */
:where(:root) body.obs:where(.obs-seo) #calculator-natal-wheel { background: none; border: 0; }
:where(:root) body.obs:where(.obs-seo) #obs-natal-wheel { margin: 8px 0 28px; }
:where(:root) body.obs:where(.obs-seo) .ow-wrap { max-width: 720px; margin: 8px auto 0; }
/* The wheel is drawn after the result has painted, into a box that already has its final size (no shift). */
:where(:root) body.obs:where(.obs-seo) .ow-stage { width: 100%; aspect-ratio: 1 / 1; }
:where(:root) body.obs:where(.obs-seo) .ow { display: block; width: 100%; height: auto; aspect-ratio: 1; overflow: visible; user-select: none; -webkit-user-select: none; }
:where(:root) body.obs:where(.obs-seo) .ow line, :where(:root) body.obs:where(.obs-seo) .ow circle, :where(:root) body.obs:where(.obs-seo) .ow path, :where(:root) body.obs:where(.obs-seo) .ow use { vector-effect: non-scaling-stroke; }
:where(:root) body.obs:where(.obs-seo) .ow use { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
:where(:root) body.obs:where(.obs-seo) .ow .ow-fill { fill: currentColor; stroke: none; }
/* the light inside the rim and the rim's own gradient: stop colours from the tokens (CSS beats the SVG attributes) */
:where(:root) body.obs:where(.obs-seo) .ow #ow-glow stop { stop-color: var(--ow-glow); }
:where(:root) body.obs:where(.obs-seo) .ow #ow-rim stop:first-child { stop-color: var(--o-ice-2); }
:where(:root) body.obs:where(.obs-seo) .ow #ow-rim stop:not(:first-child) { stop-color: var(--o-ice); }
:where(:root) body.obs:where(.obs-seo) .ow-rim { fill: none; stroke-width: 1.2; }
:where(:root) body.obs:where(.obs-seo) .ow-ring { fill: none; stroke: color-mix(in srgb, var(--o-ice) 34%, transparent); stroke-width: 1; }
:where(:root) body.obs:where(.obs-seo) .ow-ring--faint { stroke: color-mix(in srgb, var(--o-ice) 16%, transparent); }
:where(:root) body.obs:where(.obs-seo) .ow-tick { stroke: color-mix(in srgb, var(--o-ice) 42%, transparent); stroke-width: 1; }
:where(:root) body.obs:where(.obs-seo) .ow-tick--1 { stroke: color-mix(in srgb, var(--o-ice) 20%, transparent); }
:where(:root) body.obs:where(.obs-seo) .ow-tick--10 { stroke: color-mix(in srgb, var(--o-ice) 60%, transparent); }
:where(:root) body.obs:where(.obs-seo) .ow-sign { color: var(--ow-sign); stroke-width: 1.4; }
:where(:root) body.obs:where(.obs-seo) .ow--compact .ow-sign { stroke-width: 1.5; }
:where(:root) body.obs:where(.obs-seo) .ow-sign.is-on { color: var(--ow-bright); stroke-width: 1.8; }
:where(:root) body.obs:where(.obs-seo) .ow-cusp { stroke: color-mix(in srgb, var(--o-ice) 20%, transparent); stroke-width: 1; }
:where(:root) body.obs:where(.obs-seo) .ow-cusp--angle { stroke: color-mix(in srgb, var(--o-ice) 42%, transparent); }
:where(:root) body.obs:where(.obs-seo) .ow-horizon { stroke: var(--ow-horizon); stroke-width: 1.2; }
:where(:root) body.obs:where(.obs-seo) .ow-angle { fill: var(--ow-label); font-family: var(--o-sans); font-weight: 700; letter-spacing: .05em; text-anchor: middle; dominant-baseline: central; }
:where(:root) body.obs:where(.obs-seo) .ow-angle--dsc, :where(:root) body.obs:where(.obs-seo) .ow-angle--ic { fill: var(--ow-label-2); font-weight: 600; }
:where(:root) body.obs:where(.obs-seo) .ow-deg { fill: var(--ow-bright); font-family: var(--o-sans); font-weight: 600; text-anchor: middle; opacity: 0; transition: opacity 200ms var(--o-ease);
  stroke: var(--ow-halo); stroke-width: 12px; stroke-linejoin: round; paint-order: stroke; pointer-events: none; }
:where(:root) body.obs:where(.obs-seo) .ow-deg .ow-deg-n, :where(:root) body.obs:where(.obs-seo) .ow-deg .ow-deg-s { fill: var(--ow-readout-2); font-weight: 500; }
:where(:root) body.obs:where(.obs-seo) .ow-deg.is-on { opacity: 1; }
/* Only the glyph hit circles take pointer input; lines, ports, labels and readouts never intercept a click. */
:where(:root) body.obs:where(.obs-seo) .ow * { pointer-events: none; }
:where(:root) body.obs:where(.obs-seo) .ow .ow-hit { pointer-events: all; }
:where(:root) body.obs:where(.obs-seo) .ow-hnum { fill: var(--ow-hnum); font-family: var(--o-sans); font-weight: 600; text-anchor: middle; dominant-baseline: central; }
:where(:root) body.obs:where(.obs-seo) .ow-hnum.is-on { fill: var(--ow-bright); }
/* Aspects: every configured aspect is visible by default; a selection brings its own forward and quiets the rest.
   Soft = solid ice, hard = dashed lamp, conjunction = short arc, minor = dotted. Shape, not only colour, tells them apart. */
:where(:root) body.obs:where(.obs-seo) .ow-asp { fill: none; stroke-width: 1; transition: stroke-opacity 260ms var(--o-ease); }
:where(:root) body.obs:where(.obs-seo) .ow-asp--soft { stroke: var(--ow-soft); stroke-opacity: .6; }
:where(:root) body.obs:where(.obs-seo) .ow-asp--hard { stroke: var(--o-lamp); stroke-opacity: .6; stroke-dasharray: 5 4; }
:where(:root) body.obs:where(.obs-seo) .ow-asp--conj { stroke: var(--ow-conj); stroke-opacity: .75; stroke-width: 1.6; stroke-linecap: round; }
:where(:root) body.obs:where(.obs-seo) .ow-asp--minor { stroke: var(--ow-soft); stroke-opacity: .5; stroke-dasharray: 1 4; stroke-linecap: round; }
:where(:root) body.obs:where(.obs-seo) .ow-lead { stroke: color-mix(in srgb, var(--o-ice) 50%, transparent); stroke-width: 1; }
:where(:root) body.obs:where(.obs-seo) .ow-port { fill: var(--ow-port); }
:where(:root) body.obs:where(.obs-seo) .ow-hit { fill: transparent; stroke: none; }
:where(:root) body.obs:where(.obs-seo) .ow-pl { cursor: pointer; outline: none; }
:where(:root) body.obs:where(.obs-seo) .ow-glyph { color: var(--ow-glyph); stroke-width: 1.8; transition: color 200ms var(--o-ease); }
:where(:root) body.obs:where(.obs-seo) .ow-pl[data-p="sun"] .ow-glyph { color: var(--o-lamp-2); }
/* calculated points (nodes, Lilith, Chiron): same weight, a cooler ink, so the ten planets lead */
:where(:root) body.obs:where(.obs-seo) .ow-pl--point .ow-glyph { color: var(--ow-point); }
:where(:root) body.obs:where(.obs-seo) .ow-pl--point .ow-lead { stroke: color-mix(in srgb, var(--o-ice) 36%, transparent); }
:where(:root) body.obs:where(.obs-seo) .ow--compact .ow-glyph { stroke-width: 1.95; }
:where(:root) body.obs:where(.obs-seo) .ow[data-active] .ow-asp { stroke-opacity: .28; }
:where(:root) body.obs:where(.obs-seo) .ow[data-active] .ow-asp.is-on { stroke-opacity: 1; stroke-width: 1.8; }
:where(:root) body.obs:where(.obs-seo) .ow-pl.is-active .ow-glyph { color: var(--ow-bright); stroke-width: 2.3; }
:where(:root) body.obs:where(.obs-seo) .ow-pl.is-active .ow-hit { fill: color-mix(in srgb, var(--o-ice) 12%, transparent); stroke: var(--ow-ring-on); stroke-width: 1; }
:where(:root) body.obs:where(.obs-seo) .ow-pl.is-active .ow-lead { stroke: var(--o-ice-2); stroke-width: 1.5; }
/* placement buttons: the equivalent control for every wheel target (WCAG 2.5.8), 44 px */
:where(:root) body.obs:where(.obs-seo) .ow-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; }
:where(:root) body.obs:where(.obs-seo) .ow-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px; width: auto;
  background: transparent; border: 1px solid var(--o-control); color: var(--ow-chip); font: 500 .9375rem var(--o-sans); cursor: pointer;
  box-shadow: none; transform: none;
}
:where(:root) body.obs:where(.obs-seo) .ow-chip:hover { border-color: var(--o-ice); background: transparent; color: var(--o-ink); box-shadow: none; transform: none; }
:where(:root) body.obs:where(.obs-seo) .ow-chip svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
:where(:root) body.obs:where(.obs-seo) .ow-chip svg * { vector-effect: non-scaling-stroke; }
:where(:root) body.obs:where(.obs-seo) .ow-chip-type { color: var(--ow-chip-type); font-weight: 400; font-size: .8125rem; }
:where(:root) body.obs:where(.obs-seo) .ow-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--o-ice) 14%, transparent); border-color: color-mix(in srgb, var(--o-ice) 75%, transparent); color: var(--o-ink); }
:where(:root) body.obs:where(.obs-seo) .ow-chip[aria-pressed="true"] .ow-chip-type { color: var(--ow-chip-type-on); }
:where(:root) body.obs:where(.obs-seo) .ow-chip:focus-visible { outline: 2px solid var(--o-ice); outline-offset: 2px; }
/* planets first, then the calculated points under their own label */
:where(:root) body.obs:where(.obs-seo) .ow-group-label { margin: 16px 0 0; color: var(--o-muted); font: 500 .8125rem var(--o-sans); letter-spacing: .02em; }
:where(:root) body.obs:where(.obs-seo) .ow-chips--points { margin-top: 8px; }
/* unknown birth time: whether the sign holds all day */
:where(:root) body.obs:where(.obs-seo) .ow-cap-sure { margin-top: 2px !important; color: var(--o-ink-3); font-size: .9375rem; }
/* the chart as text: every body and aspect, for anyone who prefers or needs a list */
:where(:root) body.obs:where(.obs-seo) .ow-text { margin-top: 14px; border-top: 1px solid var(--o-line); }
:where(:root) body.obs:where(.obs-seo) .ow-text > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--o-ink-2); font: 500 .9375rem var(--o-sans); list-style: none; }
:where(:root) body.obs:where(.obs-seo) .ow-text > summary::-webkit-details-marker { display: none; }
:where(:root) body.obs:where(.obs-seo) .ow-text > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 160ms var(--o-ease); }
:where(:root) body.obs:where(.obs-seo) .ow-text[open] > summary::before { transform: rotate(45deg); }
:where(:root) body.obs:where(.obs-seo) .ow-text-list { margin: 4px 0 12px; padding-left: 1.1em; color: var(--o-ink-2); font-size: .9375rem; line-height: 1.6; font-variant-numeric: tabular-nums; }
:where(:root) body.obs:where(.obs-seo) .ow-text-list--aspects { color: var(--o-ink-3); }
/* today's detailed server wheel, on request */
:where(:root) body.obs:where(.obs-seo) .ow-more { margin-top: 18px; border-top: 1px solid var(--o-line); }
:where(:root) body.obs:where(.obs-seo) .ow-more > summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; color: var(--o-ink-2); font: 500 .9375rem var(--o-sans); list-style: none; }
:where(:root) body.obs:where(.obs-seo) .ow-more > summary::-webkit-details-marker { display: none; }
:where(:root) body.obs:where(.obs-seo) .ow-more > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 160ms var(--o-ease); }
:where(:root) body.obs:where(.obs-seo) .ow-more[open] > summary::before { transform: rotate(45deg); }
:where(:root) body.obs:where(.obs-seo) .ow-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0; font-size: .8125rem; color: var(--ow-key); }
:where(:root) body.obs:where(.obs-seo) .ow-lg { display: inline-block; width: 22px; height: 2px; margin-right: 8px; vertical-align: middle; background: var(--ow-soft); }
:where(:root) body.obs:where(.obs-seo) .ow-lg--hard { background: repeating-linear-gradient(90deg, var(--o-lamp) 0 5px, transparent 5px 9px); }
:where(:root) body.obs:where(.obs-seo) .ow-lg--conj { width: 14px; height: 7px; background: none; border: 1.6px solid var(--ow-conj); border-color: var(--ow-conj) transparent transparent; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
:where(:root) body.obs:where(.obs-seo) .ow-lg--minor { background: repeating-linear-gradient(90deg, var(--ow-soft) 0 2px, transparent 2px 6px); }
/* the caption under the wheel: the selection's position, its aspects and, for a calculated point, what it is */
:where(:root) body.obs:where(.obs-seo) .ow-caption { margin: 12px 0 0; padding-left: 14px; border-left: 1px solid color-mix(in srgb, var(--o-lamp) 60%, transparent); min-height: 2.6em; }
:where(:root) body.obs:where(.obs-seo) .ow-caption p { margin: 0; max-width: 42.4em; }
:where(:root) body.obs:where(.obs-seo) .ow-cap-prompt { font-family: var(--o-serif); font-size: 1.25rem; line-height: 1.35; color: var(--ow-prompt); }
:where(:root) body.obs:where(.obs-seo) .ow-cap-title { font-family: var(--o-serif); font-size: 1.35rem; line-height: 1.3; color: var(--o-ivory); }
:where(:root) body.obs:where(.obs-seo) .ow-cap-type { font-family: var(--o-sans); font-size: .9375rem; color: var(--o-muted); }
:where(:root) body.obs:where(.obs-seo) .ow-cap-pos { margin-top: 2px !important; color: var(--ow-pos); font-size: 1rem; font-variant-numeric: tabular-nums; }
:where(:root) body.obs:where(.obs-seo) .ow-cap-asp { margin-top: 4px !important; color: var(--o-ink-3); font-size: .9375rem; line-height: 1.55; font-variant-numeric: tabular-nums; }
:where(:root) body.obs:where(.obs-seo) .ow-cap-explain { margin-top: 8px !important; color: var(--o-ink-3); font-size: .9375rem; line-height: 1.55; }

/* ---------- daylight ----------
   The same instrument on the daylight panel: deep-ice structure and soft aspects, dashed lamp hard aspects, ink glyphs
   and labels, calculated points in --o-muted, no light-on-light glow; selection thickens the stroke as at night. */
:where(:root[data-theme="light"]) body.obs:where(.obs-seo) {
  --ow-soft: var(--o-ice);
  --ow-conj: var(--o-ice);
  --ow-sign: var(--o-ink);
  --ow-glyph: var(--o-ink);
  --ow-point: var(--o-muted);
  --ow-bright: var(--o-ice-2);
  --ow-label: var(--o-ink);
  --ow-label-2: var(--o-muted);
  --ow-hnum: var(--o-muted);
  --ow-horizon: color-mix(in srgb, var(--o-ice) 70%, transparent);
  --ow-port: var(--o-ice);
  --ow-ring-on: color-mix(in srgb, var(--o-ice) 75%, transparent);
  --ow-readout-2: var(--o-muted);
  --ow-halo: var(--o-night-2);
  --ow-chip: var(--o-ink-2);
  --ow-chip-type: var(--o-faint);
  --ow-chip-type-on: var(--o-muted);
  --ow-key: var(--o-muted);
  --ow-prompt: var(--o-ink-2);
  --ow-pos: var(--o-ink);
  --ow-glow: var(--o-ice);
}
/* no light-on-light glow by day: the rim's inner light is switched off (stop opacity beats the SVG attribute) */
:where(:root[data-theme="light"]) body.obs:where(.obs-seo) .ow #ow-glow stop { stop-opacity: 0; }
