/* /live and /live/embed (static/live.html), and the parts the landing page shares with them: the chronicle and the
 * crews' colours. Colours come from tokens.css. On /live the canvas fills the window under the site bar and the
 * dive's facts, the chronicle and the bots float over it as the fleet's panels (tenshin_panels.css, Dr. Ray
 * 2026-11-28); under 768 px they are the drop-in's bottom strip. The embed has no panels. */
body.live {
  margin: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--hd-bg); color: var(--hd-ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.live-bar { flex: none; display: flex; justify-content: flex-end; padding: 6px 12px; border-bottom: 1px solid var(--hd-line); }
.live-main { position: relative; flex: 1; min-height: 0; }
.tn-panels-narrow .live-main { margin-bottom: var(--tn-panels-strip, 44px); }
.live-stage { position: absolute; inset: 0; overflow: hidden; }
.live-view { display: block; width: 100%; height: 100%; image-rendering: pixelated; background: var(--hd-canvas); }
/* The engine's Pixi stage (scene.mjs) lies over the canvas and draws the crew's map. */
.live-stage .scene { position: absolute; inset: 0; pointer-events: none; }
.live-stage .scene canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.live-note {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: max-content;
  max-width: min(56ch, calc(100% - 24px)); margin: 0; padding: 8px 12px;
  background: var(--hd-panel); color: var(--hd-ink); border: 1px solid var(--hd-line); border-radius: 6px;
  font-size: 14px;
}
:root:not(.tn-panels-narrow) #dive-panel, :root:not(.tn-panels-narrow) #chron-panel { width: 300px; }
:root:not(.tn-panels-narrow) #agents-panel { width: 320px; }
#chron-panel .tn-panel-body { max-height: 32vh; }
#agents-panel .tn-panel-body { max-height: 40vh; }
#chron-panel .chron { max-height: none; overflow: visible; }
.live-phase { font-size: 15px; line-height: 1.35; margin: 0 0 8px; }
.live-help { margin: 4px 0 0; font-size: 13px; color: var(--hd-ink-2); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 6px; }
.fact { background: var(--hd-panel-2); border: 1px solid var(--hd-line); border-radius: 6px; padding: 4px 8px; }
.fact dt { font-size: 12px; color: var(--hd-ink-2); }
.fact dd { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Each crew in its own colour, wherever it is named. */
[data-crew="cable_cutters"] { color: var(--hd-crew-cutters); }
[data-crew="last_bell"] { color: var(--hd-crew-bell); }
[data-crew="rust_choir"] { color: var(--hd-crew-choir); }
.crew-name { overflow-wrap: anywhere; }

.chron { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.chron-line { display: flex; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--hd-line); font-size: 14px; }
.chron-line:last-child { border-bottom: 0; }
.chron-clock { flex: none; font-variant-numeric: tabular-nums; color: var(--hd-ink-2); }
.chron-text { min-width: 0; overflow-wrap: anywhere; }
.chron-line[data-kind="extract"] .chron-text { color: var(--hd-good); }
.chron-line[data-kind="out"] .chron-text,
.chron-line[data-kind="collapse"] .chron-text { color: var(--hd-danger); }
.chron-line[data-kind="shout"] .chron-text { color: var(--hd-accent); font-style: italic; }
.chron-line[data-kind="ping"] .chron-text { color: var(--hd-cool); }

.ladder-row { overflow-wrap: anywhere; }     /* the landing page's ladder, filled by live.mjs */
.agents { max-height: 520px; overflow-y: auto; }
.agent-head { font-size: 13px; margin: 10px 0 4px; color: var(--hd-ink-2); }
.agent-list { list-style: none; margin: 0; padding: 0; }
.agent { display: grid; gap: 1px; padding: 6px 0; border-bottom: 1px solid var(--hd-line); font-size: 13px; }
.agent:last-child { border-bottom: 0; }
.agent-name { font-weight: 700; font-size: 14px; }
.agent:not([data-crew]) .agent-name { color: var(--hd-ink); }
.agent-what, .agent-count { color: var(--hd-ink-2); }
.agent-last { color: var(--hd-ink); }

.facts[hidden] { display: none; }

/* In the panel each bot is one line and its last dive a second; the chronicle and the bots scroll in their panels. */
#agents-panel .agents { max-height: none; overflow: visible; }
#agents-panel .agent { grid-template-columns: 1fr auto; column-gap: 8px; padding: 3px 0; }
#agents-panel .agent-what { display: none; }
#agents-panel .agent-last { grid-column: 1 / -1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#agents-panel .agent-head { margin: 6px 0 2px; }
.narrow-tabs { display: none; }
.narrow-tab { min-height: 32px; padding: 2px 12px; border: 1px solid var(--hd-line); border-radius: 6px; background: var(--hd-btn);
  color: var(--hd-btn-ink); font: inherit; font-size: 13px; cursor: pointer; }
.narrow-tab[aria-selected="true"] { background: var(--hd-main); color: var(--hd-main-ink); border-color: transparent; font-weight: 700; }

/* The embed (the landing page's iframe, 300 to 740 px wide): the canvas fills the frame under the short nav, and the
 * phase line and the facts sit in one compact strip over the bottom of the canvas. The landing page runs its own
 * chronicle beside the iframe, so the embed leaves that out, and the bots. */
body.live[data-embed="true"] { display: flex; flex-direction: column; height: 100vh; min-height: 0; overflow: hidden; }
body.live[data-embed="true"] .live-bar { display: none; }     /* the page around the frame has the nav */
body.live[data-embed="true"] .live-main { display: block; position: relative; flex: 1; min-height: 0; height: auto;
  padding: 0; }
body.live[data-embed="true"] .live-stage { position: absolute; inset: 0; min-height: 0; border: 0; border-radius: 0; }
body.live[data-embed="true"] .live-view { height: 100%; min-height: 0; }
body.live[data-embed="true"] .live-note { inset: 6px 6px auto 6px; padding: 4px 8px; font-size: 12px; }
body.live[data-embed="true"] .live-side { position: absolute; left: 6px; right: 6px; bottom: 6px; gap: 0;
  overflow: visible; pointer-events: none; }
body.live[data-embed="true"] .agents-box,
body.live[data-embed="true"] .chron-box,
body.live[data-embed="true"] .live-help { display: none; }
body.live[data-embed="true"] .live-box.tn-panel { padding: 5px 8px; border-radius: 6px;
  background: var(--hd-panel); border: 1px solid var(--hd-line); }
/* No drop-in in the embed: the panel markup is plain boxes, and their title bars go. */
body.live[data-embed="true"] .tn-panel-head, body.live[data-embed="true"] .tn-panel-badge { display: none; }
body.live[data-embed="true"] .live-phase { margin: 0; font-size: 12px; line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
body.live[data-embed="true"] .facts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 2px 0 0; }
body.live[data-embed="true"] .facts[hidden] { display: none; }
body.live[data-embed="true"] .fact { display: flex; gap: 4px; align-items: baseline; padding: 0; background: none;
  border: 0; }
body.live[data-embed="true"] .fact dt { font-size: 11px; }
body.live[data-embed="true"] .fact dd { font-size: 13px; }
@media (max-height: 559px) { body.live:not([data-embed="true"]) .agent-head { display: none; } body.live:not([data-embed="true"]) .agent { font-size: 12px; padding: 0; } }
