:root { --bg: #070d18; --panel: rgba(9, 16, 28, 0.82); --ink: #e8eef7; --muted: #93a6bd; --accent: #ffb347;
  --line: rgba(147, 166, 189, 0.22); --on: #2f6fd1; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 13px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden; }
#view { position: fixed; inset: 0; }
#bar { position: fixed; top: 0; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
  padding: 8px 16px; background: var(--panel); border-bottom: 1px solid var(--line); z-index: 3;
  backdrop-filter: blur(6px); }
#bar .brand span { color: var(--muted); margin-left: 6px; }
#bar label { color: var(--muted); display: flex; gap: 6px; align-items: center; }
select, button { background: #14223a; color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font: inherit; max-width: 62vw; }
button { cursor: pointer; }
button:hover { border-color: #5b7bb0; }
#cams { position: fixed; left: 16px; top: 58px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 3;
  max-width: calc(100vw - 350px); }
#cams button { background: var(--panel); backdrop-filter: blur(6px); }
#cams button.on { background: var(--on); border-color: #7aa7ff; }
#cams .sep { width: 10px; }
#hud { position: fixed; right: 16px; top: 58px; width: 310px; max-width: calc(100vw - 32px); background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; z-index: 3; backdrop-filter: blur(6px); }
#clock { font-size: 18px; font-weight: 600; }
#sky { font-size: 12px; }
#storm { color: var(--accent); margin: 4px 0 8px; min-height: 18px; }
#totals div { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding: 3px 0; }
#totals b { font-variant-numeric: tabular-nums; }
#legend { margin-top: 8px; }
#legend .ramp { height: 8px; border-radius: 4px; margin: 4px 0 2px; }
#legend .ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
#legend .keys { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: 11px; }
#legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
#pick { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; min-height: 48px; }
.muted { color: var(--muted); }
#timeline { position: fixed; left: 16px; right: 16px; bottom: 26px; display: flex; gap: 10px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; z-index: 3;
  backdrop-filter: blur(6px); }
#timeline input { flex: 1; min-width: 0; }
#credits { position: fixed; left: 16px; right: 16px; bottom: 6px; font-size: 10px; color: var(--muted); z-index: 3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.label { color: #eef4fb; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; pointer-events: none;
  text-shadow: 0 0 4px #000, 0 0 2px #000; margin-top: -18px; }
.label.storm { font-size: 13px; color: #ffd28a; margin-top: -30px; }
.label.sat { font-size: 11px; color: #cfe3ff; font-weight: 500; }
body.nolabels .label { display: none; }
#barToggle, #hudToggle { display: none; }
@media (max-width: 760px) {
  /* phones: the scene first. One header row (task, plan and colour behind "Plan"), one scrolling row of camera and
     layer buttons, the panel at the bottom showing only the time and the storm until tapped. */
  #bar { padding: 6px 12px; font-size: 12px; gap: 6px 10px; flex-wrap: wrap; }
  #bar .brand span { display: none; }
  #barToggle { display: inline-block; margin-left: auto; padding: 3px 10px; }
  #bar label { display: none; width: 100%; justify-content: space-between; }
  #bar label select { flex: 1; max-width: none; }
  body.baropen #bar label { display: flex; }
  #cams { left: 0; right: 0; max-width: none; flex-wrap: nowrap; overflow-x: auto; padding: 0 12px 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #cams::-webkit-scrollbar { display: none; }
  #cams button { padding: 4px 9px; font-size: 12px; flex: 0 0 auto; }
  #hud { top: auto !important; bottom: 70px; left: 12px; right: 12px; width: auto; max-height: 46vh; overflow: auto;
    padding: 8px 12px; cursor: pointer; }
  #hud #clock { font-size: 15px; }
  #hud #storm { margin: 2px 0 0; }
  #hud:not(.open) #sky, #hud:not(.open) #totals, #hud:not(.open) #legend, #hud:not(.open) #pick { display: none; }
  #hud::after { content: "Tap for details \25BE"; display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
  #hud.open::after { content: "Tap to hide \25B4"; }
  #legend .keys { display: none; }
  #timeline { left: 12px; right: 64px; bottom: 18px; padding: 6px 8px; gap: 8px; }
  #tl { display: none; }
  #credits { display: none; }
  .label { font-size: 10px; }
}

/* ?clean=1: the scene and the panel only (video export) */
body.clean #bar, body.clean #cams, body.clean #timeline, body.clean #pick { display: none; }
body.clean #hud { top: 16px !important; }

#tasknote { position: fixed; left: 16px; z-index: 6; max-width: min(560px, calc(100vw - 360px)); background: #fff4d6;
  color: #3b2f0b; border: 1px solid #e3c46c; border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.4;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); }
#tasknote b { font-weight: 650; }
@media (max-width: 760px) { #tasknote { left: 12px; right: 12px; max-width: none; font-size: 12.5px; cursor: pointer; }
  #tasknote .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #tasknote.open .t { display: block; } }
body.clean #tasknote { display: none; }
