:root {
      color-scheme: dark;
      --bg: #050a12;
      --bg-elevated: #091321;
      --card: rgba(13, 27, 45, .88);
      --card-solid: #0d1b2d;
      --card-soft: rgba(19, 38, 61, .78);
      --line: rgba(178, 211, 255, .15);
      --line-strong: rgba(178, 211, 255, .3);
      --text: #f4f8ff;
      --muted: #aebed1;
      --faint: #7f91a8;
      --accent: #72d7ff;
      --accent-2: #c5a6ff;
      --good: #70e0aa;
      --warn: #ffd477;
      --bad: #ff8d8d;
      --focus: #fff59d;
      --shadow: 0 22px 58px rgba(0, 0, 0, .38);
      --radius: 22px;
      --radius-sm: 14px;
      --header-h: 68px;
      --max: 1360px;
      --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    html[data-theme="red"] {
      --bg: #090000;
      --bg-elevated: #140202;
      --card: rgba(31, 4, 4, .92);
      --card-solid: #210505;
      --card-soft: rgba(43, 7, 7, .84);
      --line: rgba(255, 125, 105, .19);
      --line-strong: rgba(255, 125, 105, .36);
      --text: #ffd5ce;
      --muted: #d88e82;
      --faint: #a96860;
      --accent: #ff705e;
      --accent-2: #ff9b75;
      --good: #ff9b75;
      --warn: #ffb168;
      --bad: #ff5a4d;
      --focus: #ffcf87;
      --shadow: 0 22px 58px rgba(0, 0, 0, .58);
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
      margin: 0;
      min-width: 0;
      min-height: 100vh;
      color: var(--text);
      background:
        radial-gradient(circle at 15% -10%, rgba(45, 109, 167, .22), transparent 34rem),
        radial-gradient(circle at 90% 15%, rgba(93, 62, 153, .17), transparent 30rem),
        linear-gradient(180deg, var(--bg-elevated), var(--bg) 38rem);
      font-family: var(--font);
      line-height: 1.5;
      overflow-x: hidden;
    }

    html[data-theme="red"] body {
      background:
        radial-gradient(circle at 15% -10%, rgba(155, 24, 14, .18), transparent 34rem),
        linear-gradient(180deg, var(--bg-elevated), var(--bg) 38rem);
    }

    button, input, select { font: inherit; }
    #objectSearch::placeholder { color: #b7c4d3; opacity: 1; }
    button, select, input[type="date"], input[type="number"], input[type="text"] {
      color: var(--text);
      background: rgba(255,255,255,.055);
      border: 1px solid var(--line-strong);
      border-radius: 12px;
    }
    button { cursor: pointer; }
    select { color-scheme: dark; background-color: #0a111b; }
    select option { color: #f8f5ee; background-color: #0a111b; }
    select option:checked { color: #171006; background-color: #e4c27a; }
    html[data-theme="red"] select { background-color: #210505; }
    html[data-theme="red"] select option { color: #ffd5ce; background-color: #210505; }
    html[data-theme="red"] select option:checked { color: #280300; background-color: #ff9d88; }
    button:hover { border-color: rgba(114, 215, 255, .55); background: rgba(114, 215, 255, .09); }
    button:active { transform: translateY(1px); }
    button:disabled { cursor: not-allowed; opacity: .5; }
    :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
    a { color: var(--accent); }
    .skip-link {
      position: fixed; left: 12px; top: -80px; z-index: 9999;
      padding: 10px 14px; background: var(--text); color: var(--bg); border-radius: 10px;
    }
    .skip-link:focus { top: 12px; }

    .topbar {
      position: sticky;
      top: 0;
      z-index: 100;
      min-height: var(--header-h);
      padding: 10px max(14px, env(safe-area-inset-left));
      border-bottom: 1px solid var(--line);
      background: rgba(5, 10, 18, .78);
      backdrop-filter: blur(18px) saturate(1.25);
      -webkit-backdrop-filter: blur(18px) saturate(1.25);
    }
    html[data-theme="red"] .topbar { background: rgba(9, 0, 0, .88); }
    .topbar-inner {
      max-width: var(--max);
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
    .brand-mark {
      width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%;
      display: grid; place-items: center;
      color: #07111f;
      background: radial-gradient(circle at 38% 36%, #fffbd5 0 8%, #a9e7ff 10% 28%, #6e8cff 60%, #20135f 100%);
      box-shadow: 0 0 28px rgba(104, 190, 255, .28);
      font-size: 20px;
    }
    html[data-theme="red"] .brand-mark {
      color: #240000;
      background: radial-gradient(circle at 38% 36%, #ffe8d8 0 8%, #ff9a79 10% 30%, #bd2d1f 62%, #3f0502 100%);
      box-shadow: 0 0 28px rgba(255, 70, 46, .25);
    }
    .brand-copy { min-width: 0; }
    .brand-title { margin: 0; font-size: 1.02rem; line-height: 1.15; letter-spacing: .01em; }
    .brand-subtitle { margin: 3px 0 0; color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .brand-subtitle.is-simulating {
      color: var(--gold, var(--accent));
      font-size: .82rem;
      font-weight: 800;
      letter-spacing: .015em;
      text-shadow: 0 0 14px color-mix(in srgb, var(--gold, var(--accent)) 48%, transparent);
    }
    .top-actions { display: flex; align-items: center; gap: 8px; }
    .icon-btn, .compact-btn {
      min-width: 44px; min-height: 44px; padding: 8px 12px;
      display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    }
    .icon-btn span:last-child { display: none; }
    .site-home-link {
      min-height: 44px;
      padding: 8px 13px;
      display: none;
      align-items: center;
      gap: 8px;
      color: #fff;
      border: 1px solid rgba(210, 104, 104, .72);
      border-radius: 12px;
      background: rgba(180, 65, 65, .95);
      font-size: .78rem;
      font-weight: 740;
      text-decoration: none;
      white-space: nowrap;
    }
    .site-home-link:hover {
      color: #fff;
      border-color: rgba(231, 132, 132, .9);
      background: rgba(197, 72, 72, .98);
    }
    .site-home-link span:first-child { font-size: 1.08rem; line-height: 1; }
    .hamburger,
    #sidebar,
    #sidebarOverlay,
    .sidebar-scroll-cue { display: none; }
    .hamburger-text { margin-right: .35em; }

    @media (max-width: 969px) {
      .top-actions .hamburger {
        width: 80px;
        min-width: 44px;
        min-height: 44px;
        padding: 0 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        color: #fff;
        border: 1px solid rgba(210, 104, 104, .72);
        border-radius: 6px;
        background: rgba(180, 65, 65, .95);
        font-size: .72rem;
        font-weight: 720;
      }
      .top-actions .hamburger:hover {
        color: #fff;
        border-color: rgba(231, 132, 132, .9);
        background: rgba(197, 72, 72, .98);
      }
      #sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1001;
        width: 65vw;
        max-width: 260px;
        padding: 7px 4px;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overscroll-behavior: contain;
        color: #fff;
        border: 1px solid rgba(255,255,255,.09);
        border-radius: 10px 0 0 10px;
        background: linear-gradient(180deg, #070d12 0%, #080f14 55%, #070e13 100%);
        box-shadow: 0 18px 36px rgba(0,0,0,.34), 1px 0 0 rgba(255,255,255,.1) inset;
        transform: translateX(-100%);
        visibility: hidden;
        opacity: 0;
        transition: transform .25s ease, opacity .25s ease;
      }
      #sidebar[data-open] { transform: translateX(0); visibility: visible; opacity: 1; }
      #sidebar ul { margin: 0; padding: 0; list-style: none; }
      #sidebar > ul { padding-top: 10px; }
      #sidebar li { margin: 0 0 7px; }
      #sidebar ul ul { margin: 7px 0 0 13px; }
      #sidebar ul ul li { margin-bottom: 7px; }
      #sidebar a.interactive,
      #sidebar .nav-section-label {
        width: 100%;
        min-height: 40px;
        padding: 6px 8px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        color: #fff;
        border: 1px solid rgba(255,255,255,.07);
        border-radius: 5px;
        background: linear-gradient(180deg, #222c34 0%, #202a32 55%, #1e2830 100%);
        box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
        font-size: .72rem;
        font-weight: 560;
        line-height: 1.2;
        text-decoration: none;
      }
      #sidebar .nav-section-label { cursor: default; }
      #sidebar a.interactive:hover { background: rgba(0,123,255,.7); }
      #sidebar a[aria-current="page"] {
        color: #fff;
        background:
          linear-gradient(90deg, rgba(228,194,122,.16), rgba(228,194,122,.035)),
          rgba(14,24,33,.96);
        box-shadow: inset 3px 0 0 #e4c27a;
        font-weight: 700;
      }
      #sidebar svg { width: 16px; height: 16px; flex: 0 0 16px; margin-right: 2px; }
      #sidebarOverlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        background: rgba(0,0,0,.5);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        transition: opacity .25s ease;
      }
      #sidebarOverlay[hidden] { opacity: 0; pointer-events: none; }
      .sidebar-scroll-cue {
        position: fixed;
        left: 0;
        z-index: 1002;
        width: min(65vw, 260px);
        height: 38px;
        place-items: center;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .16s ease, visibility .16s ease;
      }
      .sidebar-scroll-cue::before {
        content: "";
        width: 38px;
        height: 20px;
        border: 1px solid rgba(114,214,255,.36);
        border-radius: 999px;
        background: rgba(6,17,26,.86);
        box-shadow: 0 6px 18px rgba(0,0,0,.32);
      }
      .sidebar-scroll-cue::after {
        content: "";
        position: absolute;
        width: 8px;
        height: 8px;
        border-right: 2px solid #72d6ff;
        border-bottom: 2px solid #72d6ff;
      }
      .sidebar-scroll-cue--top {
        top: max(8px, env(safe-area-inset-top));
        background: linear-gradient(180deg, rgba(58,61,65,.96), rgba(58,61,65,0));
      }
      .sidebar-scroll-cue--top::after { transform: translateY(3px) rotate(225deg); }
      .sidebar-scroll-cue--bottom {
        bottom: max(8px, env(safe-area-inset-bottom));
        background: linear-gradient(0deg, rgba(58,61,65,.96), rgba(58,61,65,0));
      }
      .sidebar-scroll-cue--bottom::after { transform: translateY(-3px) rotate(45deg); }
      #sidebar[data-open][data-can-scroll-up] + .sidebar-scroll-cue--top,
      #sidebar[data-open][data-can-scroll-down] ~ .sidebar-scroll-cue--bottom {
        display: grid;
        opacity: 1;
        visibility: visible;
      }
    }

    @media (max-width: 360px) {
      .brand-copy { display: none; }
    }
    @media (max-width: 520px) and (orientation: portrait) {
      .top-actions .hamburger { font-size: .8rem; }
    }
    @media (min-width: 970px) {
      .site-home-link { display: inline-flex; }
    }

    main { width: min(100% - 24px, var(--max)); margin: 0 auto; padding: 20px 0 70px; }
    .card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: linear-gradient(145deg, rgba(255,255,255,.025), transparent 46%), var(--card);
      box-shadow: var(--shadow);
    }
    .hero {
      position: relative;
      overflow: hidden;
      padding: clamp(20px, 4vw, 40px);
      margin-bottom: 18px;
      isolation: isolate;
    }
    .hero::before {
      content: "";
      position: absolute;
      width: 32rem; height: 32rem; border-radius: 50%; right: -11rem; top: -16rem; z-index: -1;
      background: radial-gradient(circle, rgba(114, 215, 255, .18), transparent 68%);
    }
    html[data-theme="red"] .hero::before { background: radial-gradient(circle, rgba(255, 84, 62, .16), transparent 68%); }
    .hero-grid { display: grid; gap: 22px; }
    .eyebrow {
      display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
      margin: 0 0 8px; color: var(--accent); font-size: .79rem; font-weight: 750; letter-spacing: .105em; text-transform: uppercase;
    }
    .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 14px currentColor; }
    .hero h1 { margin: 0; max-width: 900px; font-size: clamp(2rem, 5vw, 4.55rem); line-height: .98; letter-spacing: -.045em; }
    .hero-summary { max-width: 800px; margin: 14px 0 0; color: var(--muted); font-size: clamp(1rem, 2.1vw, 1.22rem); }
    .hero-meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 9px; }
    .pill {
      display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px;
      border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035); color: var(--muted); font-size: .82rem;
    }
    .pill strong { color: var(--text); font-weight: 700; }

    .time-console {
      padding: 14px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: rgba(1, 8, 18, .38);
    }
    html[data-theme="red"] .time-console { background: rgba(20, 0, 0, .45); }
    .time-console-top { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .selected-time { font-size: clamp(1.45rem, 3.5vw, 2.35rem); font-weight: 760; line-height: 1; letter-spacing: -.035em; }
    .selected-date { margin-top: 6px; color: var(--muted); font-size: .88rem; }
    .time-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
    .time-slider-wrap { min-width: 0; }
    input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
    .time-slider-labels { display: flex; justify-content: space-between; color: var(--faint); font-size: .68rem; margin-top: 2px; }
    .time-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
    .time-buttons button, .date-control { min-height: 42px; padding: 8px 12px; }
    .date-control { width: 155px; }

    .dashboard-grid { display: grid; gap: 18px; margin-bottom: 18px; }
    .sky-card { padding: 14px; min-width: 0; }
    .card-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
    .card-header h2, .card-header h3 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.42rem); letter-spacing: -.02em; }
    .card-header p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
    .section-kicker { color: var(--accent); font-size: .73rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
    .sky-header-actions { display: flex; flex: 0 0 auto; align-items: end; gap: 8px; }
    .sky-facing-control { display: grid; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 720; }
    .sky-facing-control select { min-width: 108px; min-height: 44px; padding: 8px 30px 8px 10px; }
    .sky-shell { position: relative; width: 100%; max-width: 860px; margin: 0 auto; }
    #skyCanvas { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 18px; touch-action: pan-y pinch-zoom; }
    .canvas-tooltip {
      position: absolute; z-index: 5; pointer-events: none; max-width: 230px;
      padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px;
      background: rgba(2, 8, 16, .94); color: var(--text); font-size: .78rem; box-shadow: 0 12px 30px rgba(0,0,0,.4);
      transform: translate(12px, 12px); opacity: 0; transition: opacity .1s ease;
    }
    html[data-theme="red"] .canvas-tooltip { background: rgba(24, 0, 0, .96); }
    .canvas-tooltip.visible { opacity: 1; }
    .canvas-tooltip strong { display: block; margin-bottom: 2px; }
    .canvas-tooltip span { color: var(--muted); }
    .map-toolbar {
      display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; padding: 12px;
      border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025);
    }
    .check-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .82rem; cursor: pointer; }
    .check-control input { accent-color: var(--accent); width: 17px; height: 17px; }
    .mag-control { margin-left: auto; display: grid; grid-template-columns: auto 120px 30px; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; }
    .map-note { max-width: 78ch; margin: 10px 2px 0; color: var(--faint); font-size: .76rem; text-wrap: pretty; }
    .object-detail {
      min-height: 66px; margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-soft);
      display: grid; align-content: center;
    }
    .object-detail strong { font-size: .96rem; }
    .object-detail p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }

    .side-stack { display: grid; gap: 18px; min-width: 0; }
    .mini-card { padding: 18px; }
    .quality-layout { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 16px; }
    .score-ring {
      --score: 0;
      position: relative; width: 120px; aspect-ratio: 1; border-radius: 50%;
      display: grid; place-items: center;
      background: conic-gradient(var(--accent) calc(var(--score) * 1%), rgba(255,255,255,.08) 0);
    }
    .score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--card-solid); border: 1px solid var(--line); }
    .score-value { position: relative; text-align: center; font-size: 1.8rem; font-weight: 800; line-height: 1; }
    .score-value small { display: block; margin-top: 5px; color: var(--muted); font-size: .65rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
    .quality-copy h3 { margin: 0; font-size: 1.12rem; }
    .quality-copy p { margin: 6px 0 0; color: var(--muted); font-size: .84rem; }
    .factor-list { display: grid; gap: 9px; margin: 16px 0 0; padding: 0; list-style: none; }
    .factor-row { display: grid; grid-template-columns: 86px 1fr 42px; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); }
    .factor-track { height: 7px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.08); }
    .factor-fill { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
    .factor-value { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

    .sun-moon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .body-tile { padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); min-width: 0; }
    .body-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 10px; font-size: 42px; }
    .sun-icon { border-radius: 50%; color: #ffe79a; text-shadow: 0 0 20px rgba(255, 209, 77, .55); }
    #moonPhaseCanvas { width: 62px; height: 62px; display: block; }
    .body-tile h3 { margin: 0; font-size: .98rem; }
    .body-big { margin-top: 5px; font-size: 1.23rem; font-weight: 760; }
    .body-small { margin-top: 4px; color: var(--muted); font-size: .75rem; }
    .body-stats { margin-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .body-stat { padding-top: 7px; border-top: 1px solid var(--line); }
    .body-stat span { display: block; color: var(--faint); font-size: .65rem; text-transform: uppercase; letter-spacing: .07em; }
    .body-stat strong { display: block; margin-top: 2px; font-size: .82rem; }

    .weather-main { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
    .weather-temp { font-size: 2.2rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
    .weather-label { margin-top: 5px; color: var(--muted); font-size: .82rem; }
    .weather-icon { font-size: 2.25rem; line-height: 1; }
    .weather-icon.has-svg { width: 54px; height: 54px; display: grid; place-items: center; }
    .weather-icon.has-svg svg { display: block; width: 54px; height: 54px; max-width: 100%; max-height: 100%; }
    .weather-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
    .weather-stat { padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
    .weather-stat span { display: block; color: var(--faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
    .weather-stat strong { display: block; margin-top: 3px; font-size: .9rem; }
    .status-line { margin-top: 12px; min-height: 20px; color: var(--muted); font-size: .76rem; }
    .status-line.error { color: var(--bad); }

    .section-card { padding: clamp(16px, 2.6vw, 26px); margin-bottom: 18px; }
    .timeline-layout { display: grid; gap: 18px; }
    .chart-shell { position: relative; min-width: 0; }
    #dayTimeline { display: block; width: 100%; height: 300px; border-radius: 16px; background: rgba(0,0,0,.12); }
    #forecastCanvas { display: block; width: 100%; height: 300px; border-radius: 16px; background: rgba(0,0,0,.12); }
    .event-panel { display: grid; align-content: start; gap: 10px; }
    .event-summary { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-soft); }
    .event-summary strong { display: block; }
    .event-summary p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; }
    .event-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
    .event-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 10px 12px; background: var(--card-solid); font-size: .82rem; }
    .event-row span:first-child { color: var(--muted); }
    .event-row strong { font-variant-numeric: tabular-nums; text-align: right; }
    .future-events { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .future-event { padding: 11px; border: 1px solid var(--line); border-radius: 12px; }
    .future-event span { display: block; color: var(--faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; }
    .future-event strong { display: block; margin-top: 4px; font-size: .82rem; }

    .planner-grid { display: grid; gap: 18px; }
    .best-windows { display: grid; gap: 9px; align-content: start; }
    .window-card { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-soft); }
    .window-card-top { display: flex; justify-content: space-between; gap: 12px; }
    .window-card strong { font-size: .9rem; }
    .window-score { color: var(--accent); font-weight: 800; }
    .window-card p { margin: 5px 0 0; color: var(--muted); font-size: .77rem; }
    .empty-state { padding: 18px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: .84rem; }
    .legend-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--muted); font-size: .73rem; }
    .legend-key { display: inline-flex; align-items: center; gap: 6px; }
    .legend-swatch { width: 18px; height: 5px; border-radius: 999px; background: var(--accent); }
    .legend-swatch.cloud { background: rgba(200, 220, 240, .55); }
    .legend-swatch.night { background: rgba(85, 75, 165, .7); }

    .object-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
    .object-tools input, .object-tools select { min-height: 42px; padding: 8px 11px; }
    .object-tools input { flex: 1 1 220px; min-width: 0; }
    .table-wrap { overflow: auto; max-height: 570px; border: 1px solid var(--line); border-radius: 14px; }
    table { width: 100%; border-collapse: collapse; min-width: 720px; }
    th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: .8rem; }
    th { position: sticky; top: 0; z-index: 2; color: var(--muted); background: var(--card-solid); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; }
    tbody tr { cursor: default; }
    tbody tr:hover, tbody tr:focus-within { background: rgba(114, 215, 255, .055); }
    tbody tr:last-child td { border-bottom: 0; }
    .object-select {
      display: block; width: 100%; padding: 0; border: 0; background: none;
      color: inherit; font: inherit; text-align: left; cursor: pointer;
    }
    .object-select:hover { border-color: transparent; background: none; }
    .object-name { display: flex; align-items: center; gap: 9px; font-weight: 700; white-space: nowrap; }
    .object-glyph { width: 24px; text-align: center; color: var(--accent); }
    .muted-cell { color: var(--muted); }
    .alt-positive { color: var(--good); }
    .alt-low { color: var(--warn); }
    .alt-negative { color: var(--faint); }
    .visibility-badge { display: inline-flex; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .69rem; white-space: nowrap; }

    .guide-grid { display: grid; gap: 12px; }
    .guide-item { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.02); }
    .guide-item .guide-icon { font-size: 1.35rem; }
    .guide-item h3 { margin: 8px 0 0; font-size: .98rem; }
    .guide-item p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }

    dialog {
      width: min(92vw, 560px);
      max-height: 88vh;
      color: var(--text);
      border: 1px solid var(--line-strong);
      border-radius: 20px;
      padding: 0;
      background: var(--card-solid);
      box-shadow: 0 30px 100px rgba(0,0,0,.7);
    }
    dialog::backdrop { background: rgba(0, 0, 0, .72); backdrop-filter: blur(5px); }
    .dialog-inner { padding: 22px; }
    .dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
    .dialog-header h2 { margin: 0; }
    .dialog-header p { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
    .dialog-close { min-width: 42px; min-height: 42px; }
    .form-grid { display: grid; gap: 13px; margin-top: 18px; }
    .field { display: grid; gap: 6px; }
    .field label { color: var(--muted); font-size: .78rem; }
    .field input { width: 100%; min-height: 45px; padding: 9px 11px; }
    .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
    .primary-btn { color: #04111d; background: var(--accent); border-color: transparent; font-weight: 800; }
    html[data-theme="red"] .primary-btn { color: #270300; }
    .primary-btn:hover { color: #04111d; background: var(--accent); filter: brightness(1.08); }
    .form-message { min-height: 20px; margin-top: 9px; color: var(--muted); font-size: .77rem; }
    .form-message.error { color: var(--bad); }

    footer { border-top: 1px solid var(--line); padding: 22px 14px 34px; color: var(--faint); font-size: .76rem; }
    .footer-inner { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; }

    .sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
    .nowrap { white-space: nowrap; }

    @media (min-width: 680px) {
      .icon-btn span:last-child { display: inline; }
      .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); align-items: end; }
      .guide-grid { grid-template-columns: repeat(2, 1fr); }
    }
    @media (min-width: 980px) {
      main { padding-top: 28px; }
      .dashboard-grid { grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr); align-items: start; }
      .sky-card { padding: 18px; }
      .timeline-layout { grid-template-columns: minmax(0, 1.65fr) minmax(290px, .65fr); }
      .planner-grid { grid-template-columns: minmax(0, 1.65fr) minmax(280px, .62fr); }
      .guide-grid { grid-template-columns: repeat(4, 1fr); }
    }
    @media (min-width: 1280px) {
      .side-stack { grid-template-columns: 1fr; }
      #dayTimeline, #forecastCanvas { height: 330px; }
    }
    @media (max-width: 520px) {
      .topbar { padding-inline: 10px; }
      .brand-subtitle { max-width: 165px; }
      .top-actions .icon-btn { padding-inline: 9px; }
      main { width: min(100% - 16px, var(--max)); padding-top: 12px; }
      .hero { padding: 20px 16px; }
      .time-console-top { align-items: start; flex-direction: column; }
      .time-controls { grid-template-columns: 44px minmax(0, 1fr) 44px; }
      .date-control { width: 100%; }
      .quality-layout { grid-template-columns: 106px 1fr; }
      .score-ring { width: 100px; }
      .mag-control { width: 100%; margin-left: 0; grid-template-columns: auto 1fr 30px; }
      .field-row { grid-template-columns: 1fr; }
      .future-events { grid-template-columns: 1fr; }
    }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
    }
    @media print {
      .topbar, .time-buttons, .map-toolbar, .object-tools, #locationDialog, footer { display: none !important; }
      body { background: #fff; color: #000; }
      main { width: 100%; padding: 0; }
      .card { box-shadow: none; border-color: #bbb; break-inside: avoid; background: #fff; color: #000; }
      .hero-summary, .card-header p, .muted-cell, .event-row span:first-child { color: #444 !important; }
    }

/* --------------------------------------------------------------------------
   NORDLAND SKY — OBSERVATORY EDITION
   Premium visual layer and merged legacy modules.
   -------------------------------------------------------------------------- */
:root {
  --bg: #03060b;
  --bg-elevated: #07101a;
  --card: rgba(9, 15, 24, .84);
  --card-solid: #0a111b;
  --card-soft: rgba(15, 24, 37, .76);
  --line: rgba(232, 211, 164, .22);
  --line-strong: rgba(232, 211, 164, .42);
  --text: #f8f5ee;
  --muted: #cbc8c0;
  --faint: #aab3c0;
  --accent: #e4c27a;
  --accent-2: #82dff7;
  --good: #7bdcb1;
  --warn: #efc97e;
  --bad: #ff9d91;
  --focus: #fff0b0;
  --gold: #e4c27a;
  --gold-soft: rgba(228, 194, 122, .15);
  --cyan: #82dff7;
  --violet: #b39df5;
  --shadow: 0 28px 80px rgba(0, 0, 0, .5), 0 2px 0 rgba(255, 255, 255, .018) inset;
  --radius: 24px;
  --header-h: 76px;
}

html[data-theme="red"] {
  --muted: #f0aaa0;
  --faint: #d99086;
  --line: rgba(255, 138, 114, .3);
  --line-strong: rgba(255, 157, 136, .5);
  --gold: #ff8a72;
  --gold-soft: rgba(255, 93, 70, .14);
  --cyan: #ff9d88;
  --violet: #dc7f70;
}

body {
  background:
    radial-gradient(circle at 20% -8%, rgba(50, 112, 143, .18), transparent 35rem),
    radial-gradient(circle at 92% 12%, rgba(98, 72, 144, .14), transparent 34rem),
    linear-gradient(180deg, #07101a 0, #03060b 36rem, #020408 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -5;
  pointer-events: none;
  opacity: .48;
  background-image:
    radial-gradient(circle at 7% 14%, rgba(255,255,255,.82) 0 1px, transparent 1.4px),
    radial-gradient(circle at 18% 77%, rgba(196,224,255,.72) 0 1px, transparent 1.3px),
    radial-gradient(circle at 34% 31%, rgba(255,255,255,.64) 0 .8px, transparent 1.2px),
    radial-gradient(circle at 51% 9%, rgba(255,241,199,.65) 0 1px, transparent 1.5px),
    radial-gradient(circle at 68% 65%, rgba(199,215,255,.74) 0 1px, transparent 1.4px),
    radial-gradient(circle at 84% 28%, rgba(255,255,255,.72) 0 .9px, transparent 1.3px),
    radial-gradient(circle at 93% 82%, rgba(255,244,215,.58) 0 1px, transparent 1.4px);
  background-size: 310px 310px, 420px 420px, 270px 270px, 530px 530px, 360px 360px, 470px 470px, 390px 390px;
}

.cosmos-backdrop,
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.cosmos-backdrop { z-index: -4; overflow: hidden; }
.cosmos-backdrop span {
  position: absolute;
  width: min(62vw, 880px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .14;
  animation: observatoryDrift 24s ease-in-out infinite alternate;
}
.cosmos-backdrop span:nth-child(1) { top: -32%; left: -16%; background: #1c7896; }
.cosmos-backdrop span:nth-child(2) { top: 16%; right: -26%; background: #624897; animation-delay: -8s; }
.cosmos-backdrop span:nth-child(3) { bottom: -42%; left: 22%; background: #785e2e; animation-delay: -15s; }
.grain-overlay {
  z-index: 200;
  opacity: .026;
  mix-blend-mode: soft-light;
  background-image: repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,.18) 3px);
}

@keyframes observatoryDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(.96); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

button,
select,
input[type="date"],
input[type="time"],
input[type="number"],
input[type="text"],
input[type="search"] {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
  box-shadow: 0 1px 0 rgba(255,255,255,.035) inset;
}

button:hover {
  border-color: rgba(228, 194, 122, .58);
  background: linear-gradient(180deg, rgba(228,194,122,.13), rgba(228,194,122,.055));
}

.topbar {
  padding-block: 11px;
  background: rgba(3, 7, 12, .82);
  border-bottom-color: rgba(232, 211, 164, .13);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(245px, auto) minmax(0, 1fr) auto;
  gap: 20px;
}

.brand {
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  color: #171006;
  background:
    radial-gradient(circle at 40% 34%, #fff9df 0 7%, #f2d69a 8% 22%, #c59b4a 48%, #382714 78%, #0a0b0f 100%);
  border: 1px solid rgba(255, 232, 174, .45);
  box-shadow: 0 0 0 5px rgba(228,194,122,.045), 0 0 30px rgba(228,194,122,.2);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(228,194,122,.16);
  border-radius: 50%;
  transform: rotate(-18deg) scaleY(.52);
}

.brand-title { letter-spacing: .02em; }
.brand-edition {
  color: var(--gold);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: .86em;
  font-style: italic;
  font-weight: 500;
}

.section-nav-wrap {
  position: relative;
  display: block;
  min-width: 0;
}

.section-nav-wrap.has-overflow { padding-bottom: 6px; }

.section-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.section-nav::-webkit-scrollbar {
  display: none;
}

.section-nav a {
  position: relative;
  min-height: 44px;
  padding: 9px 10px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 10px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 680;
  letter-spacing: .025em;
  text-decoration: none;
  white-space: nowrap;
}

.section-nav a::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0);
  transition: transform .22s ease;
}

.section-nav a:hover,
.section-nav a.active { color: var(--text); background: rgba(255,255,255,.035); }
.section-nav a.active::after,
.section-nav a:hover::after { transform: scaleX(1); }

.section-nav-progress {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 1px;
  height: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232,211,164,.12);
  opacity: 0;
  pointer-events: none;
}
.section-nav-wrap.has-overflow .section-nav-progress { opacity: 1; }
.section-nav-progress span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
  box-shadow: 0 0 8px rgba(228,194,122,.32);
  transform: translate3d(0,0,0);
  transform-origin: 0 50%;
  will-change: transform;
}

.card {
  position: relative;
  background:
    linear-gradient(145deg, rgba(255,255,255,.035), transparent 38%),
    radial-gradient(circle at 100% 0, rgba(130,223,247,.045), transparent 35%),
    var(--card);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.card::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 230, 173, .55), transparent);
  opacity: .65;
}

.hero {
  min-height: 0;
  display: grid;
  align-items: center;
  border-color: rgba(228,194,122,.19);
  background:
    radial-gradient(circle at 77% 10%, rgba(121, 91, 172, .22), transparent 31rem),
    radial-gradient(circle at 92% 75%, rgba(40, 130, 161, .2), transparent 25rem),
    linear-gradient(120deg, rgba(12,18,28,.96), rgba(7,13,22,.84));
}

.hero::before {
  width: 36rem;
  height: 36rem;
  right: -9rem;
  top: -16rem;
  border: 1px solid rgba(228,194,122,.15);
  background:
    radial-gradient(circle at 42% 42%, rgba(255,239,191,.25) 0 1%, rgba(124,192,220,.17) 2% 18%, rgba(109,80,170,.14) 37%, transparent 70%);
  box-shadow: 0 0 0 45px rgba(228,194,122,.018), 0 0 0 90px rgba(130,223,247,.015);
}

.hero h1 {
  max-width: 960px;
  font-size: clamp(1.85rem, 4vw, 3.25rem);
  line-height: 1.04;
  background: linear-gradient(118deg, #fffdf7 0 45%, #dfc27f 72%, #9adff2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.hero-summary { max-width: 850px; margin-top: 9px; }
.signature-pill {
  color: #171006;
  border-color: rgba(245,221,165,.48);
  background: linear-gradient(120deg, #f0d89b, #c89e50);
  box-shadow: 0 7px 28px rgba(199,155,73,.16);
}
.signature-pill strong { color: inherit; }

.time-console {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent),
    rgba(2, 7, 13, .58);
  border-color: rgba(232,211,164,.18);
  box-shadow: 0 18px 45px rgba(0,0,0,.24), 0 1px 0 rgba(255,255,255,.045) inset;
}
.time-console.is-playing {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 18px 45px rgba(0,0,0,.24), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent) inset;
}
.time-console.is-playing :is(.selected-time, .selected-date, .date-control) { color: var(--accent); }

.tonight-verdict {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(228,194,122,.22);
  border-radius: 16px;
  background: rgba(1,7,13,.45);
}
.tonight-verdict h2 { margin: 3px 0 0; color: var(--text); font-size: clamp(1.15rem, 2vw, 1.45rem); }
.tonight-verdict p { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.tonight-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.tonight-facts > div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.tonight-facts dt { color: var(--faint); font-size: .7rem; font-weight: 760; letter-spacing: .065em; text-transform: uppercase; }
.tonight-facts dd { margin: 4px 0 0; color: var(--text); font-size: .82rem; font-weight: 720; line-height: 1.35; }

.tonight-targets-card {
  grid-column: 1 / -1;
  padding: clamp(16px, 2.2vw, 22px);
  display: grid;
  gap: 14px;
}
.tonight-targets-card h2 { margin: 3px 0 0; color: var(--gold); font-size: clamp(1.15rem, 2vw, 1.4rem); }
.tonight-targets-card > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.tonight-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.tonight-target-card {
  min-width: 0;
  min-height: 92px;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 5px;
  text-align: start;
  background: rgba(255,255,255,.025);
}
.tonight-target-top { min-width: 0; display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.tonight-target-top strong { min-width: 0; color: var(--text); font-size: .92rem; }
.tonight-target-top > span { flex: 0 0 auto; color: var(--gold); font-size: .7rem; font-weight: 760; }
.tonight-target-position { color: var(--muted); font-size: .78rem; }
.tonight-target-note { color: var(--faint); font-size: .76rem; line-height: 1.4; }

.legacy-anchor {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

html.astro-enhanced [data-astro-view][hidden] { display: none !important; }

.selected-time { font-family: ui-serif, Georgia, "Times New Roman", serif; font-weight: 650; }
.section-kicker { color: var(--gold); font-size: .78rem; }
.card-header h2 { color: var(--gold); }
.card-header h2,
.card-header h3 { text-wrap: balance; }

.primary-btn {
  color: #171006;
  background: linear-gradient(135deg, #f0d99f, #c79d50);
  border-color: rgba(255,236,190,.3);
  box-shadow: 0 8px 26px rgba(199,155,73,.16), 0 1px 0 rgba(255,255,255,.35) inset;
}
.primary-btn:hover { color: #171006; background: linear-gradient(135deg, #f6e3b0, #d4aa5b); }

.score-ring {
  box-shadow: 0 0 36px rgba(228,194,122,.08);
}

/* Observatory / merged Earth and solar-system viewer */
.observatory-card { overflow: hidden; }
.observatory-header { align-items: center; }
.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.19);
}
.segment-button {
  min-height: 39px;
  padding: 7px 13px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
}
.segment-button.active {
  color: #171006;
  background: linear-gradient(135deg, #efd79c, #c3994d);
  border-color: rgba(255,236,190,.32);
  box-shadow: 0 6px 22px rgba(196,151,71,.16);
}
.observatory-layout {
  display: grid;
  grid-template-areas:
    "panel"
    "stage";
  gap: 18px;
}
.observatory-canvas-shell {
  position: relative;
  min-width: 0;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(228,194,122,.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 45%, rgba(24,51,68,.3), transparent 48%),
    #02050a;
  box-shadow: 0 22px 55px rgba(0,0,0,.35) inset;
}
#observatoryCanvas { display: block; width: 100%; height: 520px; touch-action: pan-y; }
.observatory-tooltip { z-index: 6; }
.observatory-watermark {
  position: absolute;
  left: 14px;
  bottom: 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(232,211,164,.17);
  border-radius: 999px;
  color: #d8cfba;
  background: rgba(2,6,11,.62);
  backdrop-filter: blur(10px);
  font-size: .75rem;
  font-weight: 760;
  letter-spacing: .12em;
}
.observatory-panel {
  grid-area: panel;
  display: grid;
  align-content: start;
  gap: 17px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.028), transparent), rgba(3,8,14,.38);
}
.observatory-panel.is-playing {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent) inset;
}
.observatory-panel.is-playing #observatoryDate { color: var(--accent); }
.observatory-panel h3 { margin: 4px 0 0; font-family: ui-serif, Georgia, serif; font-size: 1.45rem; font-weight: 550; }
.observatory-panel p { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.observatory-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.observatory-stats > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.024);
}
.observatory-stats span { display: block; color: var(--faint); font-size: .75rem; letter-spacing: .065em; text-transform: uppercase; }
.observatory-stats strong { display: block; margin-top: 4px; overflow: hidden; color: var(--text); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.observatory-controls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.observatory-controls button { min-height: 42px; padding: 8px 10px; }
.observatory-speed { display: grid; grid-template-columns: 1fr minmax(132px, auto); gap: 10px; align-items: center; color: var(--muted); font-size: .84rem; }
.observatory-speed select { min-height: 42px; padding: 8px 10px; }
.observatory-distance-toggle {
  min-height: 42px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.024);
  cursor: pointer;
  font-size: .84rem;
}
.observatory-distance-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 0;
  accent-color: var(--gold, var(--accent));
}
.observatory-distance-toggle:focus-within { border-color: var(--line-strong); }
.observatory-note { padding-top: 12px; border-top: 1px solid var(--line); color: var(--faint) !important; font-size: .86rem !important; }

/* Almanac */
.almanac-layout { display: grid; gap: 18px; }
.almanac-form {
  align-self: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2,7,13,.34);
}
.almanac-date-row { margin-bottom: 10px; }
.almanac-form .field + .field { margin-top: 10px; }
.almanac-form .field-row .field + .field { margin-top: 0; }
.almanac-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.almanac-actions button { min-height: 44px; padding: 8px 13px; }
.almanac-results { display: grid; gap: 12px; }
.almanac-result-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,.028), transparent), var(--card-soft);
}
.almanac-result-card.sun-result { border-top-color: rgba(239,198,107,.44); }
.almanac-result-card.moon-result { border-top-color: rgba(179,157,245,.4); }
.result-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.result-heading > span { color: var(--gold); font-size: 1.25rem; text-shadow: 0 0 18px rgba(228,194,122,.2); }
.moon-result .result-heading > span { color: var(--violet); }
.result-heading h3 { margin: 0; font-size: 1rem; }
.almanac-result-card dl { display: grid; gap: 0; margin: 0; }
.almanac-result-card dl > div { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.almanac-result-card dl > div:last-child { border-bottom: 0; }
.almanac-result-card dt { color: var(--muted); font-size: .77rem; }
.almanac-result-card dd { margin: 0; color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 700; text-align: right; }

/* Calendar */
.calendar-header { align-items: end; }
.calendar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .76rem; }
.calendar-controls input { width: 96px; min-height: 42px; padding: 8px 10px; }
.calendar-controls button { min-height: 42px; padding: 8px 12px; }
.calendar-grid { display: grid; gap: 16px; }
.calendar-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2,7,13,.3);
}
.calendar-panel-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.calendar-panel-heading > span { color: var(--violet); font-size: 1.7rem; text-shadow: 0 0 20px rgba(179,157,245,.22); }
.calendar-panel-heading.season-heading > span { color: var(--gold); }
.calendar-panel-heading h3 { margin: 0; font-size: 1rem; }
.calendar-panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: .74rem; }
.phase-grid,
.season-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.phase-card,
.season-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255,255,255,.028), transparent), rgba(255,255,255,.015);
}
.phase-card,
.season-card { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 11px; }
.phase-moon-canvas {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 50%;
  background: #02050a;
  box-shadow: 0 0 0 1px rgba(220,232,247,.2), 0 0 22px rgba(179,157,245,.2);
}
.season-visual {
  position: relative;
  width: 58px;
  height: 58px;
  display: block;
  isolation: isolate;
  border: 1px solid rgba(221,244,255,.72);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 31% 34%, #7bd093 0 12%, transparent 13%),
    radial-gradient(ellipse at 67% 61%, #77c68e 0 11%, transparent 12%),
    radial-gradient(ellipse at 43% 78%, #5da979 0 8%, transparent 9%),
    radial-gradient(circle at 36% 31%, #93e8ff, #26779d 62%, #102d55 100%);
  box-shadow: 0 0 18px rgba(106,208,244,.34);
}
.season-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.season-visual::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  z-index: 2;
  height: 1px;
  border-radius: 50%;
  background: rgba(226,244,255,.62);
  transform: translateY(-50%) rotate(8deg);
}
.season-position-0::before { background: linear-gradient(90deg, rgba(2,8,20,.66) 0 42%, transparent 59%); }
.season-position-90::before { background: linear-gradient(0deg, rgba(2,8,20,.7) 0 38%, transparent 67%); }
.season-position-180::before { background: linear-gradient(270deg, rgba(2,8,20,.66) 0 42%, transparent 59%); }
.season-position-270::before { background: linear-gradient(180deg, rgba(2,8,20,.7) 0 38%, transparent 67%); }
.season-position-0 { box-shadow: 0 0 18px rgba(123,220,177,.35); }
.season-position-90 { box-shadow: 0 0 19px rgba(244,205,115,.42); }
.season-position-180 { box-shadow: 0 0 18px rgba(228,170,105,.36); }
.season-position-270 { box-shadow: 0 0 19px rgba(130,190,247,.4); }
.season-axis {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: 2px;
  height: 76px;
  border-radius: 999px;
  background: #f8f5ee;
  box-shadow: 0 0 4px rgba(248,245,238,.72);
  transform: translate(-50%, -50%) rotate(-23.4deg);
}
.phase-card h4,
.season-card h4 { margin: 0; overflow: hidden; font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.phase-card time,
.season-card time { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.season-card { border-left: 2px solid rgba(228,194,122,.42); }

.footer-inner > div { display: grid; gap: 3px; }
.footer-inner strong { color: var(--text); font-size: .8rem; }
.footer-inner div span { color: var(--faint); }

html[data-theme="red"] .segment-button.active,
html[data-theme="red"] .signature-pill,
html[data-theme="red"] .primary-btn {
  color: #280300;
  background: linear-gradient(135deg, #ffab91, #cf3a28);
}
html[data-theme="red"] .phase-moon-canvas { box-shadow: 0 0 0 1px rgba(255,157,136,.28), 0 0 22px rgba(255,112,94,.2); }
html[data-theme="red"] .season-visual { filter: sepia(.42) saturate(1.25) hue-rotate(318deg); }

/* Readable sky-map guide and visual key */
.sky-shell { max-width: 920px; }
.sky-reading-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.sky-reading-guide span {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255,255,255,.022);
  font-size: .8rem;
}
.sky-reading-guide strong { color: var(--text); }
.sky-symbol-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 10px 2px 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: .8rem;
}
.sky-symbol-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sky-symbol-legend i { display: inline-block; width: 12px; height: 12px; }
.legend-star { border-radius: 50%; background: #edf4ff; box-shadow: 0 0 8px #b9d4ff; }
.legend-planet { border-radius: 50%; background: #f2d0a8; box-shadow: 0 0 9px rgba(242,208,168,.7); }
.legend-deep { border: 1px solid var(--violet); transform: rotate(45deg); }
.legend-ecliptic { width: 18px !important; height: 0 !important; border-top: 2px dashed var(--violet); }

/* Solar-system selection and legend */
.observatory-stage { grid-area: stage; min-width: 0; display: grid; align-content: start; gap: 10px; }
.planet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  padding: 2px 1px 6px;
  overflow-x: visible;
}
.planet-legend[hidden] { display: none; }
.planet-key {
  min-height: 38px;
  padding: 7px 10px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .8rem;
}
.planet-key[aria-pressed="true"] {
  color: var(--text);
  border-color: rgba(228,194,122,.5);
  background: rgba(228,194,122,.1);
}
.planet-key-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--planet-color);
  box-shadow: 0 0 9px var(--planet-color);
}
.observatory-selection { grid-column: 1 / -1; }
.observatory-scope[hidden] { display: none; }

/* Local celestial-events calendar */
.events-header { align-items: end; }
.events-horizon {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: .78rem;
  font-weight: 760;
  letter-spacing: .04em;
}
.event-highlight {
  position: relative;
  overflow: hidden;
  margin-bottom: 15px;
  padding: clamp(17px, 3vw, 25px);
  border: 1px solid rgba(228,194,122,.28);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0, rgba(130,223,247,.11), transparent 38%),
    radial-gradient(circle at 0 100%, rgba(179,157,245,.1), transparent 42%),
    linear-gradient(135deg, rgba(228,194,122,.075), rgba(255,255,255,.018));
}
.event-highlight::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  top: -90px;
  border: 1px solid rgba(228,194,122,.17);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(130,223,247,.025), 0 0 0 48px rgba(179,157,245,.02);
}
.event-highlight h3 { position: relative; margin: 5px 0 0; font-size: clamp(1.25rem, 3vw, 1.85rem); text-wrap: balance; }
.event-highlight p { position: relative; max-width: 80ch; margin: 7px 0 0; color: var(--muted); font-size: .9rem; }
.event-highlight-meta { color: var(--gold) !important; font-weight: 720; }
.celestial-event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.celestial-event-card {
  position: relative;
  min-width: 0;
  min-height: 205px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 7px;
  border-radius: 15px;
  color: var(--text);
  text-align: start;
  white-space: normal;
}
.celestial-event-card::before {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  top: -1px;
  height: 2px;
  border-radius: 999px;
  background: var(--event-accent, var(--gold));
  box-shadow: 0 0 15px color-mix(in srgb, var(--event-accent, var(--gold)) 45%, transparent);
}
.event-solar-eclipse { --event-accent: #f3cb75; }
.event-lunar-eclipse { --event-accent: #b39df5; }
.event-meteor { --event-accent: #82dff7; }
.event-planet { --event-accent: #7bdcb1; }
.celestial-event-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.celestial-event-icon { color: var(--event-accent); font-size: 1.22rem; text-shadow: 0 0 14px var(--event-accent); }
.celestial-event-type { min-width: 0; overflow: hidden; color: var(--faint); font-size: .76rem; font-weight: 760; letter-spacing: .065em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.celestial-event-rating { margin-left: auto; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.tone-good .celestial-event-rating { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.tone-limited .celestial-event-rating { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 42%, transparent); }
.celestial-event-card > strong { font-size: 1rem; line-height: 1.3; }
.celestial-event-card time { color: var(--gold); font-size: .82rem; font-weight: 700; }
.celestial-event-meta { color: var(--muted); font-size: .8rem; }
.celestial-event-description { color: var(--faint); font-size: .8rem; line-height: 1.55; }
.events-source-note { max-width: 80ch; margin: 13px 2px 0; color: var(--faint); font-size: .8rem; text-wrap: pretty; }
.events-source-note a { color: var(--cyan); }

/* Stable anchors, clearer typography and reusable topic information */
.hero,
.sky-card,
.section-card { scroll-margin-top: calc(var(--header-h) + 18px); }
.heading-with-info { display: flex; align-items: center; gap: 9px; min-width: 0; }
.heading-with-info h2 { min-width: 0; }
.info-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-color: var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(228,194,122,.08);
  font-family: ui-serif, Georgia, serif;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1;
}
.info-button:hover { color: #171006; background: var(--gold); }

.topic-info-dialog { width: min(92vw, 680px); }
.topic-info-header { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.topic-info-title-row { display: flex; align-items: center; gap: 11px; margin-top: 5px; }
.topic-info-title-row h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); text-wrap: balance; }
.topic-info-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
  font-size: 1.25rem;
}
.topic-info-header > div > p { max-width: 72ch; margin-top: 9px; font-size: .92rem; }
.topic-info-facts { display: grid; gap: 10px; margin: 18px 0 0; }
.topic-info-facts > div {
  display: grid;
  grid-template-columns: minmax(120px, .35fr) minmax(0, 1fr);
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
}
.topic-info-facts dt { color: var(--gold); font-size: .86rem; font-weight: 780; }
.topic-info-facts dd { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.topic-info-note {
  margin: 14px 0 0;
  padding: 13px 14px;
  border-left: 3px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  color: var(--text);
  background: rgba(130,223,247,.07);
  font-size: .86rem;
}

.object-info-popover {
  position: fixed;
  inset: auto;
  z-index: 1000;
  display: none;
  width: min(300px, calc(100vw - 20px));
  margin: 0;
  padding: 13px;
  overflow: visible;
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--gold) 52%, transparent);
  border-radius: 15px;
  background: rgba(8,14,22,.97);
  box-shadow: 0 16px 46px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.025) inset;
}
.object-info-popover:popover-open { display: block; }
.object-info-popover.is-open { display: block; }
.object-info-popover::backdrop { background: transparent; backdrop-filter: none; }
.object-info-popover::before {
  content: "";
  position: absolute;
  left: clamp(18px, var(--object-arrow-x, 50%), calc(100% - 18px));
  width: 11px;
  height: 11px;
  border: solid color-mix(in srgb, var(--gold) 52%, transparent);
  background: rgba(8,14,22,.97);
  transform: translateX(-50%) rotate(45deg);
}
.object-info-popover.is-above::before { bottom: -6px; border-width: 0 1px 1px 0; }
.object-info-popover.is-below::before { top: -6px; border-width: 1px 0 0 1px; }
.object-info-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.object-info-heading { min-width: 0; display: flex; align-items: center; gap: 9px; }
.object-info-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--gold);
  background: var(--gold-soft);
}
.object-info-kicker { display: block; color: var(--gold); font-size: .65rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.object-info-heading h2 { margin: 1px 0 0; overflow: hidden; font-size: 1.08rem; text-overflow: ellipsis; white-space: nowrap; }
.object-info-popover .dialog-close { min-width: 38px; min-height: 38px; padding: 0; }
.object-info-summary { margin: 10px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.object-info-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 10px 0 0; }
.object-info-facts > div { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.object-info-facts dt { color: var(--gold); font-size: .66rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.object-info-facts dd { margin: 2px 0 0; overflow: hidden; color: var(--text); font-size: .77rem; text-overflow: ellipsis; white-space: nowrap; }
.object-info-note { margin: 9px 0 0; padding: 8px 9px; border-left: 2px solid var(--cyan); border-radius: 0 8px 8px 0; color: var(--muted); background: rgba(130,223,247,.06); font-size: .75rem; line-height: 1.4; }
.object-info-note:empty { display: none; }
html[data-theme="red"] .object-info-popover,
html[data-theme="red"] .object-info-popover::before { background: rgba(25,2,2,.98); }

/* Center the visual summary while preserving start-aligned detail values. */
.body-tile > .body-icon { margin: 0 auto 10px; }
.body-tile > h3,
.body-tile > .body-big,
.body-tile > .body-small { text-align: center; }
.body-stats { text-align: start; }

/* No supporting text is intentionally faint or below a practical reading size. */
.card-header p { max-width: 80ch; font-size: .9rem; }
.time-slider-labels,
.score-value small { font-size: .75rem; }
.map-note,
.status-line,
.event-summary p,
.window-card p,
.guide-item p,
.dialog-header p,
.field label,
.form-message,
footer { font-size: .82rem; }
.factor-row { font-size: .82rem; }
.body-small { font-size: .82rem; }
.body-stat span,
.weather-stat span,
.future-event span,
th { font-size: .75rem; }
.body-stat strong { font-size: .9rem; }
.weather-label { font-size: .86rem; }
.weather-stat strong { font-size: .94rem; }
.event-row { font-size: .86rem; }
.future-event strong { font-size: .86rem; }
.window-card p { font-size: .82rem; }
.legend-row { gap: 8px; font-size: .82rem; }
.legend-key {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
}
.legend-key.night-key { color: var(--text); border-color: rgba(179,157,245,.58); background: rgba(179,157,245,.11); font-weight: 720; }
.legend-swatch { width: 21px; height: 7px; }
.legend-swatch.cloud { background: rgba(220, 234, 247, .82); }
.legend-swatch.night { background: linear-gradient(90deg, #786acb, #b39df5); box-shadow: 0 0 9px rgba(179,157,245,.42); }
th,
td { font-size: .84rem; }
.visibility-badge { font-size: .76rem; }
.almanac-result-card dt,
.almanac-result-card dd { font-size: .84rem; }
.calendar-panel-heading p { font-size: .8rem; }
.phase-card h4,
.season-card h4 { font-size: .88rem; }
.phase-card time,
.season-card time { font-size: .8rem; }
.footer-inner strong { font-size: .88rem; }
.footer-inner div span { color: var(--faint); }

@media (max-width: 520px) {
  .topic-info-facts > div { grid-template-columns: 1fr; gap: 5px; }
}

@supports (content-visibility: auto) {
  .section-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 720px;
  }
}

@media (min-width: 980px) {
  .tonight-verdict { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); align-items: center; }
  .tonight-targets-card { grid-template-columns: minmax(220px, .42fr) minmax(0, 1.58fr); align-items: center; }
  .tonight-targets:has(> .tonight-target-card:only-child) { grid-template-columns: minmax(18rem, 32rem); }
  .tonight-targets:has(> .tonight-target-card:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(16rem, 1fr)); }
  .observatory-layout {
    grid-template-columns: minmax(0, 1.62fr) minmax(300px, .58fr);
    grid-template-areas: "stage panel";
    align-items: stretch;
  }
  .almanac-layout { grid-template-columns: minmax(310px, .72fr) minmax(0, 1.28fr); align-items: start; }
  .almanac-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  html { font-size: 112.5%; }
  .object-info-kicker,
  .object-info-facts dt { font-size: .72rem; }
  .object-info-facts dd,
  .object-info-note { font-size: .82rem; }
}

@media (max-width: 1120px) {
  .topbar-inner { grid-template-columns: minmax(230px, 1fr) auto; }
  .brand { grid-column: 1; grid-row: 1; }
  .top-actions { grid-column: 2; grid-row: 1; }
  .section-nav-wrap { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .section-nav { justify-content: flex-start; }
  .hero,
  .sky-card,
  .section-card { scroll-margin-top: 126px; }
  .celestial-event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px), (hover: none) and (pointer: coarse) {
  [data-astro-view-link="objekter"],
  [data-astro-view="objekter"] { display: none !important; }
}

@media (max-width: 680px) {
  .sky-card > .card-header { align-items: stretch; flex-direction: column; }
  .sky-header-actions { width: 100%; }
  .sky-facing-control { flex: 1 1 auto; }
  .sky-facing-control select { width: 100%; }
  .hover-only-note { display: none; }
  .tonight-facts { grid-template-columns: 1fr; }
  .tonight-targets { grid-template-columns: 1fr; }
  .observatory-header { align-items: stretch; flex-direction: column; }
  .segmented-control { width: 100%; }
  #observatoryCanvas { height: 390px; }
  .observatory-stats { grid-template-columns: 1fr; }
  .phase-grid,
  .season-grid { grid-template-columns: 1fr; }
  .calendar-controls { width: 100%; }
  .calendar-controls input { flex: 1 1 90px; }
  .sky-reading-guide,
  .celestial-event-grid { grid-template-columns: 1fr; }
  .celestial-event-card { min-height: 0; }
}

@media (hover: none), (pointer: coarse) {
  #skyTooltip,
  .hover-only-note { display: none !important; }
}

@media (max-width: 520px) {
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .brand-edition { display: none; }
  .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
  .hero { min-height: auto; padding: 18px 15px; }
  .hero h1 { font-size: clamp(1.75rem, 9vw, 2.35rem); }
  .hero-meta { margin-top: 13px; }
  .tonight-verdict { padding: 12px; }
  .section-nav a { padding-inline: 12px; }
  .observatory-header { align-items: stretch; }
  .segmented-control { width: 100%; }
  .observatory-panel { padding: 14px; }
  .observatory-controls { grid-template-columns: 1fr 1fr; }
  .almanac-form,
  .calendar-panel { padding: 14px; }
  .calendar-header { align-items: stretch; }
}

@media (max-width: 520px) {
  .brand.is-simulating { gap: 0; }
  .brand.is-simulating .brand-mark { display: none; }
  .brand.is-simulating .brand-title { font-size: .9rem; }
  .brand.is-simulating .brand-subtitle { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cosmos-backdrop span { animation: none; }
  .section-nav { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .site-home-link,
  .top-actions .hamburger,
  #sidebar,
  #sidebar a.interactive,
  #sidebar .nav-section-label { border: 1px solid ButtonText; }
  #sidebar a[aria-current="page"] { box-shadow: none; outline: 2px solid Highlight; outline-offset: -3px; }
}

@media print {
  .cosmos-backdrop, .grain-overlay, #solsystemet, #calendar,
  #sidebar, #sidebarOverlay, .sidebar-scroll-cue { display: none !important; }
}
