:root {
  /* colours from the tools' shared design (dgsgc.github.io design/suite.css): the planner's own
     colour is teal; dark matches the other tools, light is the planner's own version */
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1b1f24;
  --muted: #5d6673;
  --line: #dde1e6;
  --accent: #1f8a7a;
  --accent-text: #ffffff;
  --danger: #c23b3b;
  --field: #ffffff;
  --sky: #05070c;
  --warn: #a15c00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216;
    --panel: #171b21;
    --text: #e6e9ee;
    --muted: #a9b2bf;
    --line: #2a3038;
    --accent: #3bb3a1;
    --accent-text: #04201b;
    --danger: #ef6a6a;
    --field: #12161b;
    --warn: #f0b45a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --panel: #171b21; --text: #e6e9ee; --muted: #a9b2bf; --line: #2a3038;
  --accent: #3bb3a1; --accent-text: #04201b; --danger: #ef6a6a; --field: #12161b; --warn: #f0b45a; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.layout { --side-w: clamp(360px, 30vw, 440px); display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; }
/* The scroll bar's space (--gutter, measured by the page: 0 with overlay scroll
   bars, ~15px when they always show) is kept on the right, so the left side is
   widened to match and the cards sit evenly between the edges. */
.side { overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; padding: 0 max(3px, calc(12px - var(--gutter, 0px))) 24px max(12px, calc(var(--gutter, 0px) + 3px)); display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); min-width: 0; }
.sky { position: relative; background: var(--sky); min-height: 300px; }
#aladin { position: absolute; inset: 0; }
.sky-error { position: absolute; inset: auto 16px 16px 16px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--danger); border-radius: 8px; }
/* Target settings: a card stacked over the sidebar's cards, under the page
   title, tinted with the accent so it stands out. The sky stays clear, so the
   mosaic updates live and the sky can still be dragged to frame the target.
   --panel-top/left/width line it up with the first card, set by the page. */
.target-panel {
  --panel: color-mix(in srgb, var(--accent) 9%, var(--bg));
  position: fixed; top: var(--panel-top, 60px); left: var(--panel-left, 12px); max-height: calc(100dvh - var(--panel-top, 60px) - 12px); width: var(--panel-width, calc(var(--side-w) - 24px)); z-index: 5; overflow-y: auto; overflow-x: hidden;
  border: 1px solid var(--accent); border-radius: 12px;
  background: var(--panel); box-shadow: 0 14px 40px rgb(0 0 0 / 0.45);
}
/* The sidebar's own cards stay out of sight around the panel (not on phones,
   where the panel is a sheet over the sky). */
@media (min-width: 761px) { .side.covered > :not(.brand) { visibility: hidden; } }
/* Its sticky header and footer are pinned to 14px padding all round. */
.card.target-panel { padding: 14px; }
.target-panel .card-head { position: sticky; top: -14px; margin: -14px -14px 0; height: auto; min-height: 58px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 12px 12px 0 0; z-index: 1; }
.target-panel .done-row { position: sticky; bottom: -14px; z-index: 1; display: flex; justify-content: space-between; align-items: center; margin: 2px -14px -14px; padding: 12px 14px; background: var(--panel); border-top: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 0 0 12px 12px; }

.brand { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 12px 0 12px; margin-bottom: 0; border-bottom: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand h1 { font-size: 16px; margin: 0; letter-spacing: -0.01em; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand h1 .logo { width: 20px; height: 20px; flex: none; color: var(--accent); }
.tools { display: flex; gap: 6px; }
/* The panel's close button: a square, centred on the title. */
#editor-close { width: 32px; height: 32px; padding: 0; font-size: 14px; line-height: 1; }
.brand .intro { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.plan-files { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
button.night-toggle[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); border-color: var(--accent); }
/* Night mode: the page, the sky and every dialog in shades of pure red. */
/* Night mode: a red colour scheme for the page itself, so every panel, card
   and dialog follows it in every browser. Only pictures (the sky, the chart,
   rig colour dots) go through the red filter: a filter on the whole page is
   skipped by some browsers for panels on their own layer, such as the
   sliding target panel. */
html:root.night {
  --bg: #000; --panel: #0d0202; --field: #070101; --line: #3b0e0a; --sky: #000;
  --text: #e0402f; --muted: #a32e22; --accent: #c9301f; --accent-text: #000;
  --danger: #ff5a3c; --warn: #b8341f; color-scheme: dark;
}
html.night #aladin, html.night .night-svg, html.night .dot, html.night img,
html.night input[type="checkbox"], html.night input[type="range"], html.night input[type="color"] { filter: url(#night-red); }
html.night .chip { --chip: #c9301f !important; }
html.night #rig-list li { --rig: #c9301f !important; }
html.night .confirm-foot button.danger:not(.ghost) { color: #000; }
.filters { position: absolute; width: 0; height: 0; }
.btn-icon { width: 13px; height: 13px; margin-right: 4px; flex: none; }
/* Sky view settings: labels in one column, controls in the other. */
.settings { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px 8px; align-items: center; }
.settings .survey { display: contents; font-size: 12px; color: var(--muted); }
.settings > .hint { grid-column: 1 / -1; }
/* Labels beside chip rows line up with the first row of chips. */
.settings .row-label { align-self: start; padding-top: 4px; }
.survey { font-size: 12px; color: var(--muted); }
.survey select { padding: 4px 6px; }
.settings-head { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.moon-keep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.moon-keep-row input { width: 4.2em; padding: 3px 5px; }
.moon-keep-row > span { white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.on { background: color-mix(in srgb, var(--chip, var(--accent)) 22%, transparent); border-color: var(--chip, var(--accent)); color: var(--text); }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Folded or open, a card's heading row keeps the same padding and height
   (whether a chip, a button or nothing sits beside it), so headings don't jump. */
/* Heading rows stay 28px (the tallest button, Add rig, is 27px) so headings
   don't jump when a card folds. The capitals are only ~9px tall, so the row
   is pulled up into the card's padding: the letters then have the same space
   above them as under the card's last row, and the same again before the
   card's content. */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; height: 28px; margin: -7px 0 -5px; }
.card.folded .card-head { margin-bottom: -9px; }
.card-head h2 { display: flex; align-items: center; align-self: stretch; line-height: 1; }
/* Folding card heading: looks like the other headings, with a caret. */
button.fold { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; }
button.fold:hover { color: var(--text); }
button.fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button.fold .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; transition: transform 0.15s; }
.folded button.fold .caret { transform: rotate(-90deg); }
/* A folded card shows what's in use as a chip: the rig (with its colour) or the sky survey. */
button.fold .current { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 2px 10px 2px 8px; border: 1px solid var(--accent); border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 600; color: var(--text); }
button.fold .current .sky-icon { width: 12px; height: 12px; flex: none; color: var(--accent); }
button.fold .current:empty { display: none; }
.fold-body { display: flex; flex-direction: column; gap: 12px; }
.fold-body.settings { display: grid; }
.fold-body[hidden] { display: none; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.list li:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.list li.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* Rigs: the one in use is filled with its own colour. */
.list li.rig { border-left: 3px solid transparent; }
.list li.rig.in-use { border: 1px solid var(--rig); border-left: 3px solid var(--rig); background: color-mix(in srgb, var(--rig) 22%, transparent); }
.list li.rig.in-use .name { font-weight: 650; }
.list li.rig.in-use .meta { color: var(--text); }
.list li.rig.editing .rig-settings { color: var(--accent); opacity: 1; }
.rig-settings { flex: none; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; margin-left: 2px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); opacity: 0.55; cursor: pointer; }
.list li:hover .rig-settings, .rig-settings:focus-visible { opacity: 1; }
.rig-settings:hover { background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--text); }
.list .dot, .fold .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.list .empty { color: var(--muted); cursor: default; }
.list .star { flex: none; border: 0; background: none; padding: 0 2px; margin: 0 -4px 0 -2px; font-size: 15px; line-height: 1; color: var(--muted); cursor: pointer; opacity: 0.55; }
.list .star:hover, .list .star:focus-visible { opacity: 1; }
.list .star.on { color: #e9b949; opacity: 1; }
.list .has-notes { color: var(--muted); font-size: 12px; }
.list .when-meta { color: var(--accent); }
.list-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 2px; }
.list-tools label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.list-tools select { font-size: 12.5px; padding: 2px 6px; }
.list-tools .hint { font-size: 11.5px; }
.list .empty:hover { background: none; }

.form { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 8px; }
/* A labelled part of a card: a rule above and a small heading. */
.form-section { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sub-head.form-section { margin-top: 4px; text-transform: none; letter-spacing: normal; }
.sub-head.form-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sub-head.form-section h3 .hint { text-transform: none; letter-spacing: normal; }
.form > *, .rig-sec > * { min-width: 0; }
.form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.form input, .form select { width: 100%; }
/* Examples in empty boxes must not look like values. */
.form input::placeholder { color: var(--muted); opacity: 0.6; font-style: italic; }
/* A long option (some camera names are) otherwise counts as overflow, and the
   dialog scrolls sideways. Paint containment keeps it inside the select. */
.form select { contain: paint; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s6 { grid-column: 1 / -1; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
.form label.check input { width: auto; accent-color: var(--accent); }
.angle-hint { align-self: end; }
.warn { color: var(--warn); }
.warn-box { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--warn); border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); font-size: 12px; line-height: 1.45; color: var(--text); }
input:disabled { opacity: 0.55; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 8px; align-items: center; }
input, select { font: inherit; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
/* Pickers match the height of the text boxes beside them. */
.form input:not([type="checkbox"]):not([type="range"]):not([type="color"]), .form select { height: 34px; }
.seq input, .seq select { height: 32px; }
.survey select { height: 30px; }
textarea { width: 100%; margin-top: 6px; font: 11px/1.4 ui-monospace, Menlo, Consolas, monospace; color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 6px; padding: 6px; resize: vertical; white-space: pre; }
input[type="range"] { padding: 0; accent-color: var(--accent); }
input[type="color"] { padding: 2px; height: 32px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; }
.search input[type=search] { -webkit-appearance: none; appearance: none; }
/* The object a search found, before it becomes a target. */
.found { border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.found-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.found-name { font-weight: 600; }
.found-add { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.found-add label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.found-add button { flex: 1; }
.found .hint { margin: 0; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 13px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts dd.links { display: flex; gap: 4px 14px; flex-wrap: wrap; }
.facts dd.links a { color: var(--accent); }
.facts .est { color: var(--muted); font-style: italic; }
/* The card for an object clicked on the sky floats under its frame. */
/* While browsing, Add view centre sits under the frame at the view centre;
   phones keep it in the Targets card. */
.sky-note { position: absolute; z-index: 3; right: 10px; top: 50px; padding: 4px 10px; border-radius: 8px; font-size: 12px; color: #ffe3a0; background: rgb(0 0 0 / 0.55); pointer-events: none; white-space: nowrap; }
/* The sky time: a button at the top right, opening the time bar. Always on the
   dark sky, so it keeps the sky note's dark look in both themes. */
.time-bar { position: absolute; z-index: 5; right: 10px; top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: calc(100% - 20px); }
.time-top { display: flex; gap: 6px; }
/* Phones: below the sky view's own coordinate box, which takes the top row. */
@media (max-width: 560px) { .time-bar { top: 52px; } .sky-note { top: 92px; } }
.time-pill, .time-back { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font: 600 12.5px/1.2 inherit; font-family: inherit; color: #e6e9ee; background: rgb(8 11 16 / 0.72); border: 1px solid rgb(255 255 255 / 0.16); cursor: pointer; white-space: nowrap; }
.time-pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.time-pill:hover, .time-back:hover { border-color: rgb(255 255 255 / 0.4); }
.time-pill.simulated { color: #ffe3a0; border-color: #ffe3a0; background: rgb(40 30 5 / 0.8); }
.time-back { color: #9fe3d6; }
.time-panel { width: min(340px, calc(100vw - 40px)); padding: 10px 12px 9px; border-radius: 12px; background: rgb(14 18 24 / 0.94); border: 1px solid rgb(255 255 255 / 0.14); color: #e6e9ee; box-shadow: 0 10px 30px rgb(0 0 0 / 0.5); display: flex; flex-direction: column; gap: 6px; }
.time-panel[hidden] { display: none; }
.time-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.time-row input { color-scheme: dark; background: #0b0e13; color: #e6e9ee; border: 1px solid #2a3038; border-radius: 8px; padding: 4px 6px; font: inherit; font-size: 13px; min-width: 0; }
.time-row input[type="date"] { flex: 1 1 120px; }
.time-row input[type="time"] { flex: 0 1 92px; }
.time-panel button.ghost { color: #e6e9ee; border-color: #3a424c; }
.time-close { margin-left: auto; padding: 2px 9px; }
.time-steps { justify-content: space-between; }
.time-steps button { flex: 1; }
.time-hint, .time-night-label { font-size: 11.5px; color: #a9b2bf; }
.time-hint:empty { display: none; }
.time-night-label { color: #e6e9ee; }
.time-play-row { display: flex; align-items: center; gap: 8px; }
.time-track { position: relative; height: 22px; flex: 1; }
.time-play, .time-speed { flex: none; height: 26px; border-radius: 999px; border: 1px solid #3a424c; background: #0b0e13; color: #e6e9ee; cursor: pointer; font: 600 11.5px/1 inherit; font-family: inherit; }
.time-play { width: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.time-play svg { width: 14px; height: 14px; fill: currentColor; }
.time-play .i-pause, .time-play.playing .i-play { display: none; }
.time-play.playing .i-pause { display: inline; }
.time-play.playing { color: #1b1404; background: #ffe3a0; border-color: #ffe3a0; }
.time-speed { padding: 0 9px; min-width: 52px; }
.time-lock .i-shut, .time-lock.on .i-open { display: none; }
.time-lock.on .i-shut { display: inline; }
.time-lock.on { color: #06231f; background: #3bb3a1; border-color: #3bb3a1; }
.time-play:hover, .time-speed:hover { border-color: #7d8794; }
.time-shade { position: absolute; inset: 7px 0; border-radius: 4px; background: rgb(150 175 220 / 0.12); }
.time-track input[type="range"] { position: absolute; inset: 0; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.time-track input[type="range"]::-webkit-slider-runnable-track { height: 22px; background: transparent; border: 0; }
.time-track input[type="range"]::-moz-range-track { height: 22px; background: transparent; border: 0; }
.time-track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 6px; height: 22px; border-radius: 3px; background: #ffe3a0; border: 0; box-shadow: 0 0 0 2px rgb(0 0 0 / 0.55); }
.time-track input[type="range"]::-moz-range-thumb { width: 6px; height: 22px; border-radius: 3px; background: #ffe3a0; border: 0; box-shadow: 0 0 0 2px rgb(0 0 0 / 0.55); }
.time-track input[type="range"]:focus-visible { outline: 2px solid #9fe3d6; outline-offset: 2px; border-radius: 4px; }
.time-shade { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12); }
.time-ticks { position: relative; height: 12px; font-size: 10px; color: #a9b2bf; margin: 0 68px 0 38px; }
.time-ticks span { position: absolute; transform: translateX(-50%); }
.sky-add { position: absolute; z-index: 4; left: 50%; bottom: 56px; transform: translateX(-50%); box-shadow: 0 8px 24px rgb(0 0 0 / 0.45); }
@media (min-width: 761px) { #add-here { display: none; } }
.found.on-sky { position: absolute; z-index: 4; overflow-y: auto; width: min(400px, calc(100% - 16px)); background: color-mix(in srgb, var(--accent) 9%, var(--bg)); box-shadow: 0 10px 30px rgb(0 0 0 / 0.45); }

button, .button { font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 7px 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); display: inline-flex; align-items: center; justify-content: center; }
.send-open { display: inline-flex; margin: 8px 0 4px; text-decoration: none; }
button.ghost, .button.ghost { background: transparent; color: var(--accent); }
button.danger { border-color: var(--danger); color: var(--danger); }
button.small, .button.small { padding: 4px 9px; font-size: 12px; }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.hint { margin: 0; color: var(--muted); font-size: 12px; }
.summary { margin: 0; font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }

/* The rig form: a dialog over the planner, so the sidebar keeps just the list. */
.dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); box-shadow: 0 18px 50px rgb(0 0 0 / 0.35); overflow: hidden; }
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgb(5 7 12 / 0.55); }
/* The planner's own confirm and message box (in place of the browser's). */
.dialog.confirm { width: min(420px, calc(100vw - 32px)); }
.dialog.confirm .dialog-head h2 { text-transform: none; letter-spacing: normal; font-size: 17px; color: var(--text); }
.confirm-text { margin: 0; padding: 14px 18px 4px; line-height: 1.5; }
.confirm-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px 16px; }
.confirm-foot button.danger:not(.ghost) { background: var(--danger); border-color: var(--danger); color: #fff; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 16px; }
/* overflow-x: hidden: the sticky footer reaches the edges with negative margins,
   which Chrome counts (with the padding beyond it) as room to scroll sideways. */
.dialog .form { padding: 4px 18px 0; overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 0 1 auto; }
/* The rig form's sections: on narrow screens their fields join the form's own
   grid; on wide ones the dialog widens and the sections sit two by two, so it
   fits without scrolling. */
.rig-sec { display: contents; }
@media (min-width: 1000px) {
  #rig-dialog { width: min(980px, calc(100vw - 48px)); }
  #rig-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 28px;
    grid-template-areas: "basics site" "scope camera" "solve guide" "foot foot"; }
  .rig-sec { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px 8px; align-content: start; }
  .sec-basics { grid-area: basics; padding-top: 10px; } .sec-site { grid-area: site; } .sec-scope { grid-area: scope; }
  .sec-camera { grid-area: camera; } .sec-solve { grid-area: solve; } .sec-guide { grid-area: guide; }
  #rig-form > .dialog-foot { grid-area: foot; }
  .sec-site > .form-section:first-child { border-top: 0; }
}
#rig-fov-summary { flex: 1 0 100%; margin: 0; }
.dialog-foot { position: sticky; bottom: 0; margin: 4px -18px 0; padding: 12px 18px; background: var(--panel); border-top: 1px solid var(--line); }
@media (max-width: 520px) {
  .dialog .form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog .form .s2, .dialog .form .s3, .dialog .form .s4 { grid-column: span 1; }
  .dialog .form .s4 { grid-column: 1 / -1; }
}

details summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 4px 0; }
details summary:hover { color: var(--text); }
details[open] > summary { margin-bottom: 4px; }
.table-wrap { overflow-x: auto; }
.panels { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.panels th, .panels td { text-align: left; padding: 4px 3px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.panels th { color: var(--muted); font-weight: 600; }
h3 { font-size: 13px; margin: 0; }
h3 .hint { font-weight: 400; margin-left: 4px; }
.sub-head { display: flex; justify-content: space-between; align-items: center; }
/* When: the night's altitude chart */
.night-nav { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
/* With Tonight showing there may not be room for both: the night buttons then go under the heading. */
.sub-head:has(.night-nav) { flex-wrap: wrap; gap: 4px 8px; }
#night-zone { white-space: nowrap; }
.night-nav { margin-left: auto; }
.night-nav #night-date { min-width: 86px; text-align: center; }
.night-nav button { padding: 2px 9px; line-height: 1.2; }
.night-nav .night-tonight { margin-right: 6px; }
.night-chart { margin: 2px 0 0; }
.night-svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--sky) 55%, var(--panel)); touch-action: pan-y; }
.night-svg .band { fill: #9fb4d6; }
.night-svg .grid { stroke: var(--line); stroke-width: 0.6; }
.night-svg .axis { fill: var(--muted); font-size: 8.5px; font-variant-numeric: tabular-nums; }
.night-svg .readout { fill: var(--text); font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.night-svg .min-alt { stroke: var(--warn); stroke-width: 0.8; stroke-dasharray: 3 3; fill: none; }
.night-svg .meridian { stroke: var(--muted); stroke-width: 0.8; stroke-dasharray: 2 3; }
.night-svg .moon-line { fill: none; stroke: #d9dde4; stroke-opacity: 0.55; stroke-width: 1.2; stroke-dasharray: 4 3; }
.night-svg .alt-line { fill: none; stroke: var(--accent); stroke-opacity: 0.4; stroke-width: 1.4; }
.night-svg .alt-usable { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; }
.night-svg .cursor { stroke: var(--text); stroke-opacity: 0.5; stroke-width: 0.8; }
.night-svg .sky-time { stroke: var(--accent); stroke-width: 1.4; }
.night-svg .sky-time.simulated { stroke: var(--warn); stroke-dasharray: 3 2; }
.night-svg { cursor: pointer; }
.night-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.night-key span { white-space: nowrap; }
.night-key span::before { content: ""; display: inline-block; width: 14px; height: 0; margin-right: 5px; vertical-align: middle; border-top: 2.5px solid var(--accent); }
.night-key .k-moon::before { border-top: 1.5px dashed #b9bec7; }
.night-key .k-panel::before { border-top: 1px solid var(--accent); opacity: 0.6; }
.night-svg .panel-line { fill: none; stroke: var(--accent); stroke-opacity: 0.35; stroke-width: 0.7; }
.night-key .k-min::before { border-top: 1.5px dashed var(--warn); }
#night-summary { font-size: 12.5px; line-height: 1.55; margin-top: 6px; }
#night-nosite button { margin-left: 6px; }
.locate { align-self: end; }
.horizon-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.horizon-row .horizon-label { font-size: 12px; color: var(--muted); }
.horizon-row .hint { margin: 0; flex: 1 1 200px; }
.progress-line { font-size: 12.5px; line-height: 1.5; }
.progress-line .hint { display: inline; }
table.panels tr.finished td { color: var(--accent); }
.fit-row { display: flex; align-items: baseline; gap: 10px; }
.fit-row button { flex: none; }
.fit-row .hint { line-height: 1.45; }
.fit-row { flex-wrap: wrap; }
.lock-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lock-row button { flex: none; margin-left: auto; }
.astrobin-link { margin-left: auto; font-size: 12.5px; color: var(--accent); white-space: nowrap; }
button.link { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
button.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.seqs { display: flex; flex-direction: column; gap: 6px; }
.seq { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr) 28px; gap: 4px; align-items: center; }
.seq-labels { font-size: 11px; color: var(--muted); margin-bottom: -6px; }
/* Mono rigs: a Filter column after Type. */
.seqs.mono .seq, .seq-labels.mono { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.95fr) minmax(0, 0.9fr) minmax(0, 0.85fr) minmax(0, 0.8fr) 28px; }
.seq-labels:not(.mono) .f-col { display: none; }
.seq input, .seq select { padding: 5px 4px; width: 100%; font-size: 13px; }
.seq .remove { padding: 4px 0; width: 28px; }
.seq input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.seq input::-webkit-outer-spin-button, .seq input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.seqs .empty { color: var(--muted); font-size: 12px; margin: 0; }
.howto ol { margin: 6px 0; padding-left: 18px; }
.howto p { margin: 0; font-size: 12px; color: var(--muted); }
.foot { padding: 0 15px; }
.bmc { margin: 6px 0 14px; zoom: .6; }
/* The note at the foot of the side panel: credits, "unofficial", support. It can be folded away. */
.foot-info { padding: 0 15px; }
.foot-info > summary { list-style: none; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; color: var(--muted); padding: 2px 0 6px; user-select: none; }
.foot-info > summary::-webkit-details-marker { display: none; }
.foot-info > summary:hover { color: var(--text); }
.foot-info .hint + .hint { margin-top: 8px; }
.foot-info > summary svg { width: 12px; height: 12px; transition: transform .15s ease; }
.foot-info[open] > summary svg { transform: rotate(180deg); }
.foot-info[open] .lbl-closed, .foot-info:not([open]) .lbl-open { display: none; }
/* Night mode keeps the page red and dark: no bright yellow button. */
html.night .bmc { display: none; }
/* Send card: each way to send is its own block, well spaced. */
.send { display: flex; flex-direction: column; gap: 12px; }
.send-dialog { width: min(560px, calc(100vw - 32px)); }
.send-body { padding: 14px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.send-pick { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.send-pick select { height: 34px; }
.ts-filters { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--muted); }
.ts-filters > p { grid-column: 1 / -1; margin: 0; }
.ts-filter { display: contents; }
.ts-filter span { font-weight: 600; color: var(--text); }
.ts-filter select { height: 32px; }
.ts-filter select.need { border-color: var(--warn); }
.send-list { margin: 0; padding: 6px 10px 8px; border: 1px solid var(--line); border-radius: 8px; max-height: 240px; overflow-y: auto; }
.send-list legend { padding: 0 4px; font-size: 12px; color: var(--muted); }
.send-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13.5px; cursor: pointer; }
.send-row[hidden] { display: none; }
.send-row input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }
.send-row .meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.send-row.all { border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 2px; font-weight: 600; }
button:disabled { opacity: 0.45; cursor: default; }
.done-right { display: flex; gap: 8px; }
.send-all { width: 100%; height: 40px; gap: 8px; font-size: 14px; }
.send-all .btn-icon { width: 16px; height: 16px; }
/* Waiting to send: targets kept for when their rig is online. */
.later { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 8px; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 4px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.later[hidden], .later-row[hidden] { display: none; }
.later h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.later .hint { margin: 0; }
.later-list { display: flex; flex-direction: column; }
.later-rig { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.later-list .later-rig:first-child { border-top: 0; }
.later-rig .who { min-width: 0; font-size: 13.5px; }
.later-rig .who strong { display: block; }
.later-rig .who span { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.later-rig .note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); }
.later-row { display: flex; align-items: center; gap: 10px; }
.later-row .hint { margin: 0; flex: 1; }
.later-dialog { width: min(440px, calc(100vw - 32px)); }
.later-dialog .later-intro { margin: 12px 18px 4px; }
.later-dialog .later-list { padding: 0 18px; overflow-y: auto; }
.later-dialog .confirm-foot { border-top: 1px solid var(--line); }
.send-ways { display: flex; flex-direction: column; gap: 16px; }
.send-ways[hidden] { display: none; }
.way { display: flex; flex-direction: column; gap: 8px; }
.way + .way, .mores { border-top: 1px solid var(--line); padding-top: 14px; }
.way h3 { font-size: 13px; }
.mores { display: flex; flex-direction: column; gap: 2px; }
.hint[role=status]:empty, .summary:empty { display: none; }

@media (max-width: 760px) {
  .target-panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 50vh; border-radius: 14px 14px 0 0; border: 0; border-top: 2px solid var(--accent); box-shadow: 0 -10px 30px rgb(0 0 0 / 0.35); }
  .layout { grid-template-columns: 1fr; grid-template-rows: 55vh auto; height: auto; }
  .sky { order: -1; height: 55vh; }
  .side { border-right: 0; padding: 0 16px 16px; overflow: visible; }
  .brand { position: static; }
}


a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
.in-app .web-only { display: none; }
.start-hint { border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px; color: var(--text); }
.start-hint button { margin-top: 6px; display: block; }
.app-only { display: none; }
.in-app .app-only { display: block; }
.retire-note { margin: 8px 0 0; padding: 8px 10px; border: 1px solid var(--warn); border-radius: 8px; font-size: 12px; line-height: 1.45; color: var(--text); }
.retire-note a { color: inherit; }

/* Send window: QR code for the copy page on a phone or tablet (hand.html). */
.hand-box { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0 4px; }
.hand-box[hidden] { display: none; }
.hand-qr { flex: 0 0 auto; width: 148px; border-radius: 6px; overflow: hidden; }
.hand-qr svg { display: block; width: 100%; height: auto; }
.hand-box .hint { margin: 0 0 6px; }
@media (max-width: 520px) { .hand-box { flex-direction: column; } }
.hand-box .touch-only, .hand-box.touch .qr-only, .hand-box.touch .hand-qr { display: none; }
.hand-box.touch .touch-only { display: block; }
/* A target's notes: ordinary text, wrapping (the plan-text boxes are monospace). */
#target-form textarea[name="notes"] { font: 13px/1.4 inherit; font-family: inherit; white-space: pre-wrap; min-height: 2.6em; }

/* Your images */
.my-images { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; }
.my-images .hint { margin: 0; line-height: 1.45; }
.image-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.image-list li { display: flex; align-items: center; gap: 8px; }
.image-list li.off .image-name span { color: var(--muted); }
.image-name { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.image-name input { flex: none; } /* long names mustn't squash the tick box */
.image-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-list input[type="range"] { flex: 0 1 90px; min-width: 50px; }
.image-list button { flex: none; }
.image-msg { color: var(--text); }
.image-add-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.image-list li.outline-only .image-name span:last-child { color: var(--muted); }
.outline-mark { flex: none; width: 12px; height: 9px; border: 1.5px solid #3bb3a1; border-radius: 2px; }
.outline-note { font-size: 11px; margin: 0 4px 0 0; }
.image-list li.solving .image-name span:last-child { color: var(--muted); }
.solving-mark { flex: none; width: 10px; height: 10px; border: 1.5px solid #3bb3a1; border-right-color: transparent; border-radius: 50%; animation: solving-spin 1s linear infinite; }
@keyframes solving-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .solving-mark { animation: none; } }
.anet { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; }
.anet summary { cursor: pointer; color: var(--text); font-weight: 500; }
.anet[open] summary { margin-bottom: 6px; }
.anet p { margin: 0 0 6px; }
.anet a { color: var(--accent); }
.anet-key { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.anet-key input { flex: 1 1 auto; min-width: 0; }
.anet-warn strong { color: var(--text); font-weight: 600; }
/* The Your images window: the list and the astrometry.net key. */
.images-dialog { width: min(780px, calc(100vw - 32px)); }
.images-body { padding: 12px 18px 4px; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.images-body .hint { margin: 0; line-height: 1.45; }
.images-body .image-list { gap: 6px; }
.images-dialog .confirm-foot { border-top: 1px solid var(--line); }
.images-dialog .image-list input[type="range"] { flex: none; width: 120px; min-width: 0; } /* the same width on every row: long names are cut short instead */
@media (max-width: 560px) { .images-dialog .image-list input[type="range"] { width: 64px; } }

/* Progress card over the sky while a picture is read and solved (dark in both themes, like the time bar). */
.solve-pop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(360px, calc(100% - 32px)); padding: 14px 16px 12px; border-radius: 12px; background: rgb(14 18 24 / 0.95); border: 1px solid rgb(255 255 255 / 0.14); color: #e6e9ee; box-shadow: 0 12px 36px rgb(0 0 0 / 0.55); display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.solve-pop[hidden] { display: none; }
.solve-pop.is-error { border-color: var(--danger); }
.solve-pop-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.solve-pop-thumb { flex: none; width: 64px; height: 48px; object-fit: cover; border-radius: 6px; background: #20262e; border: 1px solid rgb(255 255 255 / 0.12); }
.solve-pop-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.solve-pop-title strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solve-pop-count { font-size: 11px; color: #9aa4b0; letter-spacing: 0.04em; }
.solve-pop-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.solve-pop-steps li { display: flex; align-items: center; gap: 9px; color: #7d8794; }
.solve-pop-steps li.done, .solve-pop-steps li.now { color: #e6e9ee; }
.solve-pop-mark { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid #4a535e; box-sizing: border-box; }
.solve-pop-steps li.done .solve-pop-mark { background: #3bb3a1; border-color: #3bb3a1; position: relative; }
.solve-pop-steps li.done .solve-pop-mark::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 3px; height: 6px; border: solid #0e1218; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.solve-pop-steps li.now .solve-pop-mark { border-color: #3bb3a1; border-top-color: transparent; animation: solve-spin 0.9s linear infinite; }
.solve-pop-secs { color: #9aa4b0; font-variant-numeric: tabular-nums; }
.solve-pop-bar { height: 3px; border-radius: 2px; background: #252c35; overflow: hidden; }
.solve-pop-bar span { display: block; height: 100%; width: 35%; border-radius: 2px; background: #3bb3a1; animation: solve-slide 1.4s ease-in-out infinite; }
.solve-pop-note { margin: 0; font-size: 12px; color: #9aa4b0; line-height: 1.4; }
.solve-pop-error { margin: 0; line-height: 1.45; color: #f1c7c7; }
.solve-pop-actions { display: flex; justify-content: flex-end; }
.solve-pop-actions button.ghost { color: #e6e9ee; border-color: #3a424c; }
.solve-pop.is-done .solve-pop-title strong::before { content: '✓ '; color: #3bb3a1; }
@keyframes solve-spin { to { transform: rotate(360deg); } }
@keyframes solve-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) {
  .solve-pop-steps li.now .solve-pop-mark { animation: none; border-top-color: #3bb3a1; }
  .solve-pop-bar span { animation: none; width: 100%; opacity: 0.5; }
}
@media (max-width: 560px) {
  /* Phones: the sky is at the top of the page and you're usually scrolled down to
     Your images, so the card floats at the bottom of the screen instead. */
  .solve-pop { position: fixed; top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 12px 14px 10px; gap: 8px; background: rgb(14 18 24); }
}

/* Compare rigs, best months and the share link (target panel). */
.compare-btn.on { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
.compare-list ul { list-style: none; margin: 0 0 4px; padding: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.compare-list li { display: flex; align-items: center; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line); }
.compare-list li:first-child { border-top: 0; }
.compare-list .swatch { flex: none; width: 10px; height: 10px; border-radius: 2px; }
.season { margin-top: 10px; }
.season-label { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.season-strip, .season-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.season-strip { margin: 6px 0 3px; }
.season-cell { height: 18px; padding: 0; border: 0; border-radius: 3px; background: color-mix(in srgb, var(--line) 70%, transparent); cursor: pointer; }
.season-cell.shown { outline: 1.5px solid var(--text); outline-offset: 1px; }
.season-cell:hover { filter: brightness(1.25); }
.season-months span { font-size: 10.5px; color: var(--muted); text-align: center; }
.season-text { margin: 4px 0 0; }
.done-left { display: flex; gap: 6px; align-items: center; }
.done-row button { white-space: nowrap; }

/* First-time tour */
.brand-btns { display: flex; gap: 6px; align-items: center; flex: none; }
.tour-back { position: fixed; inset: 0; z-index: 1000; }
.tour-shade { position: fixed; background: rgb(0 0 0 / 0.6); }
.tour-hole { position: fixed; z-index: 1001; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 2px var(--accent); }
.tour-card { position: fixed; z-index: 1002; background: var(--panel); color: var(--text); border: 1px solid var(--accent); border-radius: 12px; padding: 14px 16px 12px; box-shadow: 0 14px 40px rgb(0 0 0 / 0.5); }
.tour-card h2 { margin: 2px 0 6px; font-size: 16px; text-transform: none; letter-spacing: normal; }
.tour-card p { margin: 0 0 8px; color: var(--muted); }
.tour-card b { color: var(--text); }
.tour-step { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.tour-nav { display: flex; gap: 6px; }
