/* Alert follow-up (/tonight/follow-up, ADR 0124): builds on planner.css.
   followup-dark.css overrides the map for the dark theme; night vision is the
   site-wide theme (ADR 0086). */

.fu-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(130px, 1fr) auto; gap: 12px; align-items: end; }
.fu-row .np-go { margin: 0; white-space: nowrap; }
.fu-form .sm { margin: 8px 0 0; }
.fu-help > summary { cursor: pointer; color: var(--accent-moon); font-weight: 600; width: max-content; }
.fu-matches { margin: 6px 0 0; padding-left: 1.2rem; }

/* ---- Layout: form, a short scrolling alert table, then the result full width ---- */
.fu-layout, .fu-main { display: grid; gap: 16px; min-width: 0; }
.fu-main { scroll-margin-top: calc(var(--sticky-top, 0px) + 12px); }
.fu-empty h2 { margin-top: 0; }
html.is-following .fu-main { opacity: 0.55; transition: opacity 0.15s; }

/* ---- Alerts ---- */
.fu-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.fu-chips[hidden] { display: none; }
.fu-chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 0.82rem; cursor: pointer; }
.fu-chip span { color: var(--muted); margin-left: 2px; }
.fu-chip.is-on { border-color: var(--accent-moon); background: color-mix(in srgb, var(--accent-moon) 14%, var(--surface)); font-weight: 600; }
.fu-chip:focus-visible, .fu-alert-scroll:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.fu-here-hint { color: var(--muted); white-space: nowrap; }
.fu-here-hint.is-now { color: #176b2c; font-weight: 650; }
.fu-here-hint::before { content: "● "; color: #86c96b; }
.fu-here-hint.is-now::before { color: #176b2c; }
.fu-here-hint.is-no::before { color: var(--line); }
/* About seven rows tall; the rest scrolls inside, so the map stays close below. */
.fu-alert-scroll { max-height: 19rem; overflow: auto; overscroll-behavior: contain; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }
.fu-alert-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.fu-alert-table th, .fu-alert-table td { text-align: left; padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: baseline; }
.fu-alert-table thead th { position: sticky; top: 0; z-index: 1; border-top: 0; background: var(--surface); font-size: 0.8rem; color: var(--muted); font-weight: 600; box-shadow: inset 0 -1px 0 var(--line); }
.fu-alert-table tbody tr:first-child > * { border-top: 0; }
.fu-alert-table tbody th { font-weight: 650; }
.fu-alert-table tbody tr[hidden] { display: none; }
.fu-alert-table tbody tr:hover { background: color-mix(in srgb, var(--line) 30%, transparent); }
.fu-alert-table tbody tr.is-on { background: color-mix(in srgb, var(--accent-moon) 14%, var(--surface)); }
.fu-alert-table tbody tr.is-on th { box-shadow: inset 3px 0 0 var(--accent-moon); }
.fu-alert-table td.fu-a-when, .fu-alert-table td.fu-a-size, .fu-alert-table td.fu-a-links { white-space: nowrap; }
.fu-a-from, .fu-a-when, .fu-a-size, .fu-a-links { color: var(--muted); }
.fu-here-label { display: none; }
/* Phones: each alert as two short lines. */
@media (max-width: 720px) {
  .fu-alert-scroll { max-height: 26rem; }
  .fu-alert-table thead { display: none; }
  .fu-alert-table, .fu-alert-table tbody { display: block; }
  .fu-alert-table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 10px; border-top: 1px solid var(--line); }
  .fu-alert-table tbody tr:first-child { border-top: 0; }
  .fu-alert-table tbody tr[hidden] { display: none; }
  .fu-alert-table tbody th, .fu-alert-table tbody td { display: block; border: 0; padding: 0; }
  .fu-alert-table td.fu-a-from, .fu-alert-table td.fu-a-links { display: none; }
  .fu-here-label { display: inline; color: var(--muted); }
  .fu-alert-table tbody tr.is-on { box-shadow: inset 3px 0 0 var(--accent-moon); }
  .fu-alert-table tbody tr.is-on th { box-shadow: none; }
}
.fu-kind { white-space: nowrap; font-size: 0.76rem; font-weight: 650; padding: 1px 8px; border-radius: 999px; color: #fff; background: #5b6b84; }
.fu-kind-ligo { background: #7a4fc4; }
.fu-kind-icecube { background: #1f7fa8; }
.fu-kind-fermi, .fu-kind-svom { background: #b5482c; }
.fu-kind-einstein { background: #2f8a55; }
.fu-kind-maxi { background: #3a7d3a; }
.fu-kind-super { background: #a3337a; }
.fu-kind-chime, .fu-kind-dsa { background: #8a6a12; }
.fu-kind-swift { background: #c0602a; }

/* ---- Target and map ---- */
.fu-note { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--warn-bg, #fff4e0); color: var(--warn-text); font-weight: 600; }
.fu-map { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #cfe1ee; margin-top: 10px; }
.fu-map-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 12px; text-align: center; color: var(--muted); }
.fu-map-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.fu-land { fill: #f4f1e8; stroke: #c9c3b2; stroke-width: 0.15; }
.fu-borders { fill: none; stroke: #d8d2c2; stroke-width: 0.6; }
.fu-grid { fill: none; stroke: rgb(29 93 134 / 0.12); stroke-width: 1; }
.fu-cells { image-rendering: pixelated; opacity: 0.78; }
.fu-obs { fill: #fff; stroke: #1d2b3a; }
.fu-obs.is-first { fill: #ffd34d; }
.fu-here { fill: none; stroke: #1d2b3a; stroke-dasharray: 2 2; }
.sb-map-zoom { position: absolute; z-index: 2; right: 8px; top: 8px; display: grid; gap: 4px; }
.sb-map-zoom[hidden] { display: none; }
.sb-map-zoom button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 1.1rem/1 system-ui, sans-serif; cursor: pointer; }
.sb-map-zoom button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.fu-card { position: absolute; z-index: 3; max-width: 260px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); font-size: 0.86rem; display: grid; gap: 2px; pointer-events: none; }
.fu-card[hidden] { display: none; }
.fu-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin: 8px 0 0; }
.fu-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fu-swatch { display: inline-block; width: 14px; height: 10px; border-radius: 3px; }
/* Few hours to many: pale to deep green, readable on land and sea. */
.fu-s1 { background: #c6e8b0; }
.fu-s2 { background: #86c96b; }
.fu-s3 { background: #3f9e45; }
.fu-s4 { background: #176b2c; }

/* ---- Tables ---- */
.fu-table tr.fu-more { display: none; }
.np-card:has(.fu-all[open]) .fu-table tr.fu-more { display: table-row; }
.fu-table tr.fu-none th, .fu-table tr.fu-none td { color: var(--muted); }
.fu-all { margin-top: 8px; }
.fu-all > summary { cursor: pointer; color: var(--accent-moon); font-weight: 600; }
.fu-eph td { white-space: nowrap; }

@media (max-width: 720px) {
  .fu-row { grid-template-columns: 1fr 1fr; }
  .fu-q { grid-column: 1 / -1; }
  .fu-map { aspect-ratio: 3 / 2; }
  /* Observatories become short cards: the name, then labelled facts in two columns. */
  .fu-table:not(.fu-eph) tr.fu-row-obs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fu-table:not(.fu-eph) td.np-num { white-space: normal; }
  .fu-table:not(.fu-eph) td .muted { display: block; }
  .fu-table:not(.fu-eph) tr.fu-row-obs th { grid-column: 1 / -1; }
  .fu-table:not(.fu-eph) tr.fu-row-obs td { grid-column: auto; }
  .fu-table:not(.fu-eph) td[data-label]::before { content: attr(data-label); display: block; font-size: 0.74rem; color: var(--muted); }
  .fu-table:not(.fu-eph) td.fu-links { grid-column: 1 / -1; }
  .fu-table tr.fu-row-obs.fu-more { display: none; }
  .np-card:has(.fu-all[open]) .fu-table tr.fu-row-obs.fu-more { display: grid; }
  /* The ephemeris keeps its columns and scrolls sideways. */
  .fu-eph thead { display: table-header-group; }
  .fu-eph, .fu-eph tbody { display: table; width: max-content; }
  .fu-eph tr { display: table-row; padding: 0; }
  .fu-eph td, .fu-eph th { display: table-cell; padding: 6px 7px; border-top: 1px solid var(--line); }
  .fu-eph td::before { content: none !important; }
}

/* GCN Circulars linked from the selected alert */
.fu-circulars{margin:.5rem 0 .75rem}
.fu-circulars ul{margin:.4rem 0;padding-left:1.1rem}
.fu-circulars li{margin:.2rem 0}

/* ---- In plain words: what happened, and can I see it from home ---- */
.fu-plain { display: grid; gap: 12px 20px; margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent-moon) 8%, var(--surface)); }
@media (min-width: 900px) { .fu-plain:has(> div + div) { grid-template-columns: 3fr 2fr; } }
.fu-plain h3 { margin: 0 0 4px; font-size: 0.95rem; }
.fu-plain p { margin: 0; line-height: 1.5; }
.fu-plain-home { padding-left: 12px; border-left: 3px solid var(--line); }
.fu-home-eyes, .fu-home-binoculars, .fu-home-telescope { border-left-color: #2f8a55; }
.fu-home-maybe { border-left-color: #c0902a; }
.fu-home-badge { display: inline-block; margin-left: 6px; font-size: 0.74rem; font-weight: 650; padding: 0 7px; border-radius: 999px; border: 1px solid #c0902a; color: #8a5a00; white-space: nowrap; }
