:root {
  color-scheme: dark;
  --bg: #121418;
  --sidebar: #191c22;
  --text: #f2efe9;
  --muted: #a39b90;
  --line: #31363f;
  --accent: #d7a15f;
  --accent-ink: #1c140c;
  --ok: #3cba8b;
  --bad: #e15d4f;
  --tile: #0c0d10;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled { opacity: 0.55; cursor: default; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#app {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
}

aside, main {
  height: 100%;
  min-height: 0;
  min-width: 0;
}

aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px 28px;
  overflow: hidden;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

main {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow: auto;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }

h1 { margin: 0; font-size: 28px; }

h2 { margin: 0; font-size: 22px; }

h3 { margin: 0; font-size: 16px; }

.panel details:not([open]) > :not(summary) { display: none !important; }
#building-stage[hidden] { display: none !important; }
.panel details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}
.panel details > summary::-webkit-details-marker { display: none; }
.panel details > summary::before {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
}
.panel details[open] > summary { margin-bottom: 12px; }
.panel details[open] > summary::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  border-bottom: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro-row, .detail-head, .day-nav, .row-actions, .dialog-actions, .detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intro-row, .detail-head, .day-nav { justify-content: space-between; }

.lede { margin: 8px 0 0; color: var(--muted); }

.app-version {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#host-status { margin: 10px 0 0; }

#da3-status { margin: 2px 0 0; }

.hint, .footnote, .caption, .count, .url, figcaption {
  color: var(--muted);
  font-size: 13px;
}

.pane-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footnote { margin: 0; }

.count { margin: 0; }

.url, .caption {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.caption { min-height: 1.2em; }

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--bad);
}

.banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #3a2a22;
}

label { display: block; color: var(--muted); font-size: 13px; }

input, select {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #101216;
}

label.check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

label.check input { width: auto; margin: 0; }

.primary, .secondary, .text-btn {
  border-radius: 999px;
  padding: 8px 14px;
}

.primary {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.secondary {
  background: transparent;
  border: 1px solid var(--line);
}

#add-demo {
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.3;
}

.text-btn {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 8px 0;
}

.danger { color: var(--bad); }

#interval-form, #feed-form, .panel, #empty {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#detail {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#feed-meta {
  display: flex;
  min-width: 0;
  white-space: nowrap;
}

#feed-url {
  overflow: hidden;
  text-overflow: ellipsis;
}

#feed-group-label { flex: none; }

.detail-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 14px;
  align-items: stretch;
}

.stage { min-height: 0; min-width: 0; overflow: hidden; }

.side-stack {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.detail-head { align-items: center; }

.detail-head > div:first-child { min-width: 0; flex: 1; }

.detail-actions { flex: 0 0 auto; }

.detail-actions, .row-actions, .dialog-actions { flex-wrap: wrap; }

.feed-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.feed-group { display: flex; flex-direction: column; gap: 4px; }

.feed-group-label {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.feed-group:first-child .feed-group-label { margin-top: 0; }

.feed-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.feed-select {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  min-width: 0;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
}

.fresh {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--bad);
}

.fresh.on { background: var(--ok); }

.feed-select[aria-current="true"] {
  border-color: var(--accent);
  background: #242018;
}

.feed-select strong, .feed-select span:not(.fresh) {
  display: block;
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-select span { color: var(--muted); font-size: 12px; }

.switch {
  display: flex;
  align-items: center;
}

.switch input { width: auto; margin: 0; }

.chart {
  margin: 0;
  background: var(--tile);
  border-radius: 12px;
  overflow: hidden;
}

#building-stage { display: grid; gap: 10px; }

#building-view {
  width: 100%;
  height: auto;
  display: block;
  background: #16130f;
  border-radius: 12px;
}

#chart, #activity, .board-chart { display: block; width: 100%; height: auto; }

.activity-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.activity-head h3 { margin: 14px 0 8px; }

.info-btn {
  anchor-name: --activity-info;
  width: 22px;
  height: 22px;
  margin-top: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-family: var(--serif, var(--sans));
  font-style: italic;
  line-height: 20px;
}

#activity-info-text {
  position: fixed;
  inset: auto;
  position-anchor: --activity-info;
  top: anchor(bottom);
  left: anchor(left);
  width: min(320px, calc(100vw - 24px));
  margin: 6px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sidebar);
  color: var(--text);
}

#activity-info-text p { margin: 0; }

.schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-row .hint { margin: 0; }

#chart text, #activity text, .board-chart text { font-family: var(--mono); }

.activity h3 { font-size: 15px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.legend li { display: flex; align-items: center; gap: 6px; }

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 99px;
}

.swatch.mean { background: #d7a15f; }
.swatch.range { background: rgba(215, 161, 95, 0.45); }
.swatch.day { background: #f2efe9; }
.swatch.pin { background: var(--ok); box-shadow: inset 0 0 0 2px #fff; }
.swatch.moon { background: #f2efe9; box-shadow: inset 0 0 0 2px #d7a15f; }
.swatch.sun { background: #fff6d0; box-shadow: inset 0 0 0 2px #e2a03a; }
.swatch.sun-region { background: rgba(226, 160, 58, 0.45); }
.swatch.region { background: rgba(215, 161, 95, 0.45); box-shadow: inset 0 0 0 1px #f2efe9; }
.swatch.agree { background: #f4f1ea; box-shadow: inset 0 0 0 2px #1c1916; }
.swatch.night { background: #1a2838; box-shadow: inset 0 0 0 2px #8aa0b4; }
.swatch.night-pin { background: #d7d3cb; box-shadow: inset 0 0 0 2px #fff; }
.swatch.ground { background: rgba(120, 168, 96, 0.9); }
.swatch.horizon { background: #f4f1ea; box-shadow: inset 0 0 0 2px #111; }
.swatch.vanish { background: #e85d8c; }
.swatch.upright { background: #5ec8e6; }
.swatch.level { background: #e0b06a; }

.bands {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 4px 0 0;
}

.bands div { display: flex; flex-direction: column; gap: 2px; }

.bands dt {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bands dd { margin: 0; font-variant-numeric: tabular-nums; }

.preview {
  position: relative;
  display: grid;
  align-items: start;
  justify-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--tile);
  border-radius: 12px;
  overflow: hidden;
}

#preview-empty { place-self: center; }

.preview-labels {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

#live-dialog,
#three-dialog,
#still-dialog {
  width: max-content;
  max-width: calc(100vw - 32px);
}

#still-dialog {
  max-height: calc(100vh - 24px);
}

#still-form {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 24px);
}

#live-form,
#three-form,
#still-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: max-content;
  padding: 20px;
}

.live-stage, .still-stage { position: relative; flex: 0 0 auto; }

.still-stage { width: max-content; }

#still-viewbox {
  max-width: 100%;
  max-height: calc(100vh - 470px);
  overflow: auto;
  background: #000;
}

#still-zoom-value {
  min-width: 3.2em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.roll-control {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, 100%);
}

.roll-control input { flex: 1; accent-color: var(--accent); }

#still-roll-value,
#still-pitch-value,
#still-lens-value { min-width: 4.2em; font-variant-numeric: tabular-nums; }

#still-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.live-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--mark, var(--accent));
  border-radius: 4px;
  pointer-events: none;
}

.live-box span {
  position: absolute;
  left: 0;
  bottom: calc(100% + 2px);
  padding: 1px 7px;
  border: 2px solid var(--mark, var(--accent));
  border-radius: 999px;
  background: #1c140c;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.live-box.below span { bottom: auto; top: 2px; }

#live-view,
#still-view,
#still-flat {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  display: block;
  background: var(--tile);
  border-radius: 12px;
}

#three-dialog {
  width: calc(100vw - 24px);
  height: calc(100vh - 24px);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
}

#three-form,
#still-form {
  width: 100%;
  max-width: 100%;
}

#three-form {
  align-items: stretch;
  height: 100%;
  max-height: none;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  gap: 8px;
}

#three-note,
#three-status,
#three-summary { margin: 0; }

.three-setup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  width: 100%;
}

#three-form:has(#three-stage:not([hidden])) {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
}

#three-form:has(#three-stage:not([hidden])) #three-title { grid-column: 1 / -1; grid-row: 1; }
#three-form:has(#three-stage:not([hidden])) #three-note { grid-column: 1 / -1; grid-row: 2; }
#three-form:has(#three-stage:not([hidden])) .three-setup { grid-column: 1 / -1; grid-row: 3; }
#three-form:has(#three-stage:not([hidden])) .three-stills { grid-column: 1; grid-row: 4; max-height: none; }
#three-form:has(#three-stage:not([hidden])) #three-status { grid-column: 1; grid-row: 5; align-self: end; }
#three-form:has(#three-stage:not([hidden])) #three-stage { grid-column: 2; grid-row: 4 / span 2; }
#three-form:has(#three-stage:not([hidden])) .three-creates { grid-column: 1 / -1; grid-row: 6; }

.three-stills {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 720px) {
  #three-form:has(#three-stage:not([hidden])) {
    display: flex;
  }

  #three-form:has(#three-stage:not([hidden])) .three-stills {
    flex: 0 1 120px;
    max-height: 140px;
  }
}

.three-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.three-picks button {
  margin: 0;
}

.three-creates {
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
}

#three-still-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  align-content: start;
  overflow: auto;
}

#three-still-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
}

#three-still-list img {
  grid-column: 1 / -1;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--tile);
  border-radius: 8px;
}

.three-toolbar,
.three-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.three-toolbar button.current {
  border-color: var(--accent);
  color: var(--accent);
}

#three-stage:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#three-view {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  background: #101216;
  border-radius: 12px;
}

.three-readout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 0 0 auto;
  min-height: 0;
}

#three-summary { flex: 1 1 auto; min-width: 0; }

#three-depth {
  flex: 0 0 auto;
  width: auto;
  max-width: 180px;
  max-height: 72px;
  object-fit: contain;
  object-position: right center;
  border-radius: 10px;
  background: var(--tile);
}

#live-dialog {
  overflow: hidden;
}

#live-form {
  max-width: 100%;
  max-height: calc(100vh - 36px);
  min-height: 0;
}

#live-note { margin: 0; }

.live-stage {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
}

#live-view {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 210px);
  object-fit: contain;
}

#still-view,
#still-flat {
  max-width: none;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
}

#preview { cursor: zoom-in; }

.preview img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: top center;
  background: var(--tile);
}

.timeline input { margin-top: 6px; }

.film {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.film button {
  flex: 0 0 auto;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--tile);
}

.film button[aria-current="true"] { border-color: var(--accent); }

.film img {
  display: block;
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
}

dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
  color: inherit;
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: 16px;
}

dialog::backdrop { background: rgba(0, 0, 0, 0.55); }

#feed-dialog { width: min(1080px, calc(100vw - 32px)); }

.feed-dialog-layout {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}

.feed-test-pane {
  flex: 1 1 320px;
  min-width: min(100%, 280px);
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feed-test-stage {
  min-height: 220px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

#feed-test-view {
  display: block;
  width: 100%;
  max-height: min(540px, calc(100vh - 180px));
  object-fit: contain;
  background: #000;
}

#feed-form, #map-form, #interval-form { padding: 20px; }

#feed-form { flex: 1 1 340px; min-width: min(100%, 280px); }

#map-dialog { width: min(920px, calc(100vw - 32px)); }

#map-form { display: flex; flex-direction: column; gap: 12px; }

#place-map {
  width: 100%;
  height: min(440px, 50vh);
  display: block;
  background: #10202c;
  border-radius: 12px;
}

#place-map .land { fill: #8aa0b4; }
#place-map .night { fill: rgba(6, 12, 24, 0.55); }
#place-map.zoomable, #world-svg.zoomable { cursor: grab; touch-action: none; }
#open-kml { color: inherit; font: inherit; text-decoration: none; cursor: pointer; }
#place-map.zoomable:active, #world-svg.zoomable:active { cursor: grabbing; }
#place-map .daylight-band { fill: rgba(215, 161, 95, 0.72); }
#place-map .daylight-error { fill: none; stroke: #e2b56a; stroke-width: 1px; vector-effect: non-scaling-stroke; }
.swatch.error-box { background: transparent; box-shadow: inset 0 0 0 1px #e2b56a; }
#place-map .map-town,
#world-svg .map-town,
#place-map .map-scale-label,
#world-svg .map-scale-label {
  fill: rgba(247, 244, 238, 0.72);
  font-family: inherit;
  font-weight: 500;
  pointer-events: none;
  stroke: rgba(8, 16, 24, 0.55);
  paint-order: stroke;
}
#place-map .map-town,
#world-svg .map-town { text-anchor: middle; dominant-baseline: central; }
#place-map .map-town-dot,
#world-svg .map-town-dot { fill: rgba(247, 244, 238, 0.55); stroke: none; pointer-events: none; }
#place-map .map-scale,
#world-svg .map-scale { fill: none; stroke: rgba(247, 244, 238, 0.8); stroke-linecap: square; pointer-events: none; }
#place-map .map-scale-label.across,
#world-svg .map-scale-label.across { text-anchor: middle; dominant-baseline: auto; }
#place-map .map-scale-label.up,
#world-svg .map-scale-label.up { text-anchor: start; dominant-baseline: central; }
#place-map .ip-pin { fill: var(--ok); stroke: #fff; stroke-width: 1px; }
#place-map .moon-pin { fill: #f2efe9; stroke: #d7a15f; stroke-width: 2px; }
#place-map .moon-region { fill: rgba(215, 161, 95, 0.28); stroke: none; }
#place-map .moon-facing { fill: none; stroke: #1c1916; stroke-linecap: round; stroke-linejoin: round; }
#place-map .sun-pin { fill: #fff6d0; stroke: #e2a03a; stroke-width: 2px; }
#place-map .sun-region { fill: rgba(226, 160, 58, 0.32); stroke: none; }
#place-map .sun-facing { fill: none; stroke: #1c1916; stroke-linecap: round; stroke-linejoin: round; }
#place-map .agree-region { fill: rgba(244, 241, 234, 0.82); stroke: #1c1916; stroke-width: 0.6px; }
#place-map .agree-facing { fill: none; stroke: #1c1916; stroke-linecap: round; stroke-linejoin: round; }
#place-map .agree-pin { fill: #f4f1ea; stroke: #1c1916; stroke-width: 2px; }

.scene-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.scene-pair figure { margin: 0; }

.scene-pair img {
  width: 100%;
  height: auto;
  display: block;
  background: #14120f;
  border-radius: 12px;
}

.scene-pair figcaption { margin-top: 4px; }

.moon-sky { margin: 0; }

.moon-sky svg {
  width: 100%;
  height: auto;
  display: block;
  background: #14120f;
  border-radius: 12px;
}

.moon-sky .moon-frame { fill: #1c1916; }
.moon-sky .moon-path { fill: none; stroke: #d7a15f; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.moon-sky .moon-fit { fill: none; stroke: #f2efe9; stroke-width: 1.25; stroke-dasharray: 4 3; opacity: 0.8; }
.moon-sky .moon-dot { fill: #f2efe9; }
.moon-sky .moon-dot.end { fill: #d7a15f; }
.sun-sky .moon-path { stroke: #e2a03a; }
.sun-sky .moon-fit { stroke: #fff6d0; }
.sun-sky .moon-dot.end { fill: #e2a03a; }

#board-dialog {
  width: calc(100vw - 12px);
  max-width: calc(100vw - 12px);
  height: calc(100vh - 12px);
  max-height: calc(100vh - 12px);
  margin: 6px auto;
  overflow: hidden;
}

#board-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  padding: 10px 12px;
}

.board-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.board-bar h2, .board-bar h3, #board-note, #board-clock { margin: 0; white-space: nowrap; }

.board-bar h2 { font-size: 16px; }

.board-bar h3 { min-width: 8.5em; font-size: 14px; text-align: center; }

.board-bar button { padding: 4px 10px; }

.board-bar .timeline {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-bar .timeline input { margin: 0; }

#board-note {
  flex: 1 1 140px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

#board-clock { min-width: 4.6em; font-variant-numeric: tabular-nums; }

#board-stack {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.board-cell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 15px minmax(0, 1fr) 18px;
  gap: 2px;
}

.board-cell h3 {
  margin: 0;
  font-size: 11px;
  line-height: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-cell .chart {
  height: 18px;
  margin: 0;
  border-radius: 4px;
}

.board-chart { width: 100%; height: 18px; cursor: pointer; }

.board-preview {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  border-radius: 6px;
}

.board-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.board-preview p {
  margin: 0;
  padding: 2px 4px;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

#world-dialog { width: min(920px, calc(100vw - 32px)); }

#world-form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }

#world-svg {
  width: 100%;
  height: min(420px, 48vh);
  display: block;
  background: #10202c;
  border-radius: 12px;
}

#world-svg .land { fill: #8aa0b4; }
#world-svg .night { fill: rgba(6, 12, 24, 0.55); }
#world-svg .feed-pin { cursor: pointer; stroke: #fff; stroke-width: 1.5px; }
#world-svg .feed-pin.day { fill: var(--ok); }
#world-svg .feed-pin.night { fill: #d7d3cb; }

.world-feeds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 168px;
  overflow: auto;
}

.world-feeds button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.world-feeds button span { display: block; color: var(--muted); font-size: 13px; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--sidebar);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.login-card .primary { align-self: flex-start; }

.watch-page {
  overflow: auto;
  min-height: 100vh;
}

.watch-card {
  width: min(1100px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px 28px;
}

.watch-card header { display: flex; flex-direction: column; gap: 4px; }

.watch-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 12px;
  align-items: end;
}

.watch-card .dialog-actions { margin: 0; }

.watch-link input { font-family: var(--mono); font-size: 13px; }

.watch-page .live-stage {
  flex: 1 1 auto;
  display: flex;
  min-height: 240px;
}

.watch-page #live-view {
  width: 100%;
  max-width: 100%;
  max-height: calc(100vh - 280px);
  background: var(--tile);
  border-radius: 12px;
}

@media (max-width: 720px) {
  .watch-card form { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  #app { height: auto; grid-template-columns: 1fr; }
  aside, main { height: auto; overflow: visible; }
  #detail { flex: none; height: auto; }
  .detail-grid { display: flex; flex-direction: column; }
  .stage { overflow: visible; }
  .preview { flex: none; min-height: 200px; }
  .preview img { height: auto; max-height: 52vh; }
  .side-stack { overflow: visible; }
  .feed-list, .feed-group-list { overflow: visible; }
  aside { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  main { min-height: 0; padding: 20px 16px 40px; }
  .detail-head { align-items: stretch; flex-direction: column; }
  .day-nav { align-items: center; gap: 8px; }
  .day-nav h3 { flex: 1; font-size: 15px; text-align: center; }
  .day-nav button { padding: 8px 10px; }
  .bands { grid-template-columns: 1fr; }
}
