/* Bedrock console — the authoring half of the product.
 *
 * Light ground, per the brand guidelines: "A light ground carries the whole
 * system — no dark surfaces." The viewer stays dark because a 3D scene of rock
 * needs to be, but the console is a working tool read for hours at a time and
 * takes the paper side of the brand.
 *
 * Three faces, matching the marketing site so the two halves are recognisably
 * one product: Space Grotesk sets headings, Inter sets prose, JetBrains Mono
 * sets every label and every number. Numbers are tabular everywhere — this is a
 * tool for people who compare tonnages down a column.
 *
 * Two colours differ from the console design file, both to clear WCAG AA on a
 * light ground, and both following the brand guidelines' own instruction that
 * accent-coloured *text* takes Accent 700 rather than Accent:
 *   --accent (#0088b0) is 3.7:1 on the page — fills, borders and rules only.
 *   --accent-700 (#006786) is 5.7:1 — anything accent-coloured that is read.
 *   --good was darkened from #1a8a5c (3.5:1 on its own chip) to #146c49 (5.7:1),
 *   because it carries the 10px LOADED tag, which is body text at tag size.
 * --ink-mute is likewise a step darker than the design's #8d9490 (2.8:1), which
 * would have put every column header, breadcrumb and stat caption below the
 * threshold. #8d9490 survives as --ink-faint for rules and the drag glyph, which
 * are not read. */

:root {
  --bg:        #f6f7f6;
  --surface:   #ffffff;
  --raised:    #fbfbfa;
  --border:    #e2e5e2;
  --border-2:  #ececea;
  --ink:       #14171a;
  --ink-dim:   #5b6266;
  --ink-mute:  #6d7472;
  --ink-faint: #8d9490;   /* decoration only — never text */
  --accent:     #0088b0;
  --accent-700: #006786;
  --accent-dim: #e4f2f6;
  --accent-ink: #ffffff;
  --good: #146c49; --good-dim: #e6f5ee;
  --bad:  #c23a2e; --bad-dim:  #fbeae8;
  --warn: #8a6410; --warn-dim: #fdf3e0;
  --r-ctl: 6px;
  --r-pan: 10px;
  --heading: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: Inter, system-ui, sans-serif;
  /* Aliases kept so older rules and any inline styles still resolve. */
  --panel: var(--surface);
  --line: var(--border);
  --line-2: var(--border-2);
  --ink-2: var(--ink-dim);
  --mute: var(--ink-mute);
  --gold: var(--accent);
  --danger: var(--bad);
  --live: var(--good);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
  font-size: 14px; line-height: 1.5; text-wrap: pretty;
}
a { color: var(--accent-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Every numeral in this product lines up under the one above it. */
.mono, td.n, th.n, .stat b, input, select, textarea {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}

/* The breadcrumb / section label above a title. */
.eyebrow {
  display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute);
}
.eyebrow a { color: var(--ink-mute); }
.eyebrow a:hover { color: var(--accent-700); }

/* ------------------------------------------------------------ app shell -- */
#app {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh;
  /* The rail is sticky and one viewport tall, so its own background stops at the
     fold on a long page and leaves a grey stripe beneath it. The column carries
     the white instead. */
  background: linear-gradient(to right, var(--surface) 0 240px, var(--bg) 240px);
}
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; background: var(--bg); }
  #rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
}

/* A label and its buttons on one line, the label taking the slack. Used by
   every panel header, zone header and action row in the console. */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }

#rail {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 22px 16px; display: flex; flex-direction: column;
}
#rail .brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 2px; }
#rail .brand b {
  font-family: var(--heading); font-size: 17px; font-weight: 700;
  letter-spacing: -.01em;
}
#rail .w {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .1em; color: var(--accent-700); text-transform: uppercase;
  padding: 0 6px 20px;
}
#rail nav { display: flex; flex-direction: column; gap: 2px; }
#rail nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: var(--r-ctl); color: var(--ink-dim); font-size: 14px;
  font-weight: 500; transition: background .12s, color .12s;
}
#rail nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
#rail nav a.on { background: var(--accent-dim); color: var(--accent-700); }
#rail nav a .k { font-family: var(--mono); font-size: 10px; color: var(--ink-mute); margin-left: auto; }
#rail .sec {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-mute); padding: 18px 10px 7px;
}
#rail .foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
#rail .foot .who {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute);
  padding: 0 6px 10px; word-break: break-all;
}

main { padding: 40px 48px 80px; max-width: 1180px; min-width: 0; }
@media (max-width: 640px) { main { padding: 26px 18px 56px; } }

header.page { margin-bottom: 28px; }
header.page h1 {
  font-family: var(--heading); margin: 10px 0 0;
  font-size: clamp(24px, 3vw, 32px); font-weight: 700;
  letter-spacing: -.02em; text-wrap: balance;
}
header.page p {
  margin: 8px 0 0; color: var(--ink-mute); max-width: 68ch;
  font-family: var(--mono); font-size: 12.5px;
}
header.page .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
header.page .row .grow { flex: 1; min-width: 240px; }

/* Body prose inside a panel — the paragraphs that explain what a section is
   for. Distinct from header.page p, which is a mono spec line. */
.lead { font-size: 13.5px; line-height: 1.6; color: var(--ink-dim); max-width: 78ch; }

/* ---------------------------------------------------------------- panel -- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-pan); padding: 22px;
}
.panel + .panel, .stats3 + .panel, .panel + .stats3 { margin-top: 24px; }
.panel > h2, .panel > .row > h2 {
  font-family: var(--heading); margin: 0 0 14px; font-size: 19px;
  font-weight: 700; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.panel > .row > h2 { margin-bottom: 0; }
.panel > .row { margin-bottom: 14px; align-items: center; }
.panel > h2 .hint, .panel .hint { font-weight: 400; color: var(--ink-mute); font-size: 12px; font-family: var(--mono); }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* --------------------------------------------------------------- controls */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 13.5px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--border); border-radius: 7px;
  padding: 10px 16px; cursor: pointer; white-space: nowrap;
  transition: border-color .12s, background .12s, transform .06s;
}
.btn:hover:not(:disabled) { border-color: var(--ink-mute); }
/* Physical press. */
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: var(--accent-700); border-color: var(--accent-700);
  color: var(--accent-ink);
}
.btn.primary:hover:not(:disabled) { background: #005872; border-color: #005872; }
.btn.danger { color: var(--bad); border-color: var(--bad-dim); background: var(--bad-dim); }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); }
.btn.sm {
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em;
  font-weight: 500; padding: 6px 11px; border-radius: 5px;
}
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [contenteditable]:focus-visible {
  outline: 2px solid var(--accent-700); outline-offset: 2px;
}
/* "Upload logo" and friends are <label>s wrapping a hidden file input. */
label.btn { display: inline-block; }

.field { margin-bottom: 14px; }
/* Label above input, always — a placeholder is not a label. */
.field label, .brandrow label {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute);
  margin-bottom: 6px;
}
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], select, textarea {
  width: 100%; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  padding: 9px 11px; font-size: 13px; font-family: var(--mono);
}
select { min-width: 200px; }
textarea { font-family: var(--sans); font-size: 13.5px; line-height: 1.55; resize: vertical; }
/* Placeholders must clear 4.5:1 like any other text. */
::placeholder { color: var(--ink-mute); opacity: 1; }
input:disabled, select:disabled, textarea:disabled { opacity: .5; background: var(--bg); }
.checkline { display: flex; align-items: center; gap: 8px; margin: 9px 0; font-size: 13px; }
.checkline input { width: auto; accent-color: var(--accent-700); }
.hintline { font-size: 12.5px; color: var(--ink-mute); margin-top: 6px; }

.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------- tables -- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; }
td { border-top: 1px solid var(--border-2); font-size: 14px; }
th {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 500;
  padding: 14px 16px 10px;
}
td b { font-weight: 600; }
td.n, th.n { text-align: right; }
td.mono, td.n { font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
tbody tr[data-go]:hover td { background: var(--bg); }
.tablewrap { overflow-x: auto; }
/* A table fills its panel edge to edge rather than sitting inset in it. */
.panel > .tablewrap { margin: -22px; width: calc(100% + 44px); }
.panel > h2 + .tablewrap, .panel > .row + .tablewrap { margin-top: 0; }

/* ---------------------------------------------------------------- stats -- */
/* Three figures across, divided by hairlines that are the grid's own gap
   showing through. The headline numbers of a project, and the first thing
   anyone looks at. */
.stats3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: var(--r-pan); overflow: hidden;
}
@media (max-width: 700px) { .stats3 { grid-template-columns: 1fr; } }
.stats3 .stat { background: var(--surface); padding: 20px 22px; }

.stat { display: flex; flex-direction: column; gap: 0; }
.stat .l {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-mute);
}
.stat b {
  font-family: var(--heading); font-size: 26px; font-weight: 700;
  letter-spacing: -.01em; margin-top: 8px;
}
.stat .sub { font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; }

/* ---------------------------------------------------------------- chips -- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono);
  font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  font-weight: 500; padding: 4px 8px; border-radius: 4px;
  background: var(--border-2); color: var(--ink-mute);
}
.chip.live   { background: var(--good-dim); color: var(--good); }
.chip.draft  { background: var(--border-2); color: var(--ink-mute); }
.chip.warn   { background: var(--warn-dim); color: var(--warn); }
.chip.danger { background: var(--bad-dim);  color: var(--bad); }

/* ------------------------------------------------------------- messages -- */
.note {
  border: 1px solid var(--border); border-radius: var(--r-pan);
  padding: 14px 16px; font-size: 13.5px; line-height: 1.55;
  color: var(--ink-dim); background: var(--raised);
}
.note.warn   { border-color: #ecd9ae; background: var(--warn-dim); color: var(--warn); }
.note.danger { border-color: #f0c6c0; background: var(--bad-dim);  color: var(--bad); }
.note b { color: inherit; font-weight: 600; }
.note + .note { margin-top: 10px; }

/* Empty states are an invitation, not a blank rectangle. */
.empty {
  padding: 32px 22px; text-align: center;
  border: 1px dashed var(--border); border-radius: 8px;
}
.empty h3 { font-family: var(--heading); margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.empty p { margin: 0 auto 16px; color: var(--ink-mute); max-width: 50ch; font-size: 13px; }
.empty p:last-child { margin-bottom: 0; }

/* Skeletons mirror the shape of what is coming, so the page does not jump. */
.skel { background: var(--border-2); border-radius: var(--r-ctl); height: 12px; animation: pulse 1.5s ease-in-out infinite; }
.skel.row { height: 34px; margin-bottom: 8px; }
.skel.big { height: 56px; }
@keyframes pulse { 0%,100% { opacity: .5 } 50% { opacity: 1 } }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: var(--ink); color: #fff; border-radius: 8px;
  padding: 12px 18px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60;
  max-width: min(560px, 90vw); text-align: center;
  box-shadow: 0 6px 24px rgba(20,23,26,.18);
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }

/* ---------------------------------------------------------------- modal -- */
.modal {
  position: fixed; inset: 0; z-index: 50; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(20,23,26,.42);
}
.modal.on { display: flex; }
.modal .inner {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pan);
  width: min(680px, 100%); max-height: 88vh; overflow-y: auto; padding: 24px;
  box-shadow: 0 24px 64px rgba(20,23,26,.18);
}
.modal h2 { font-family: var(--heading); margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.modal .sub { color: var(--ink-mute); font-size: 13.5px; line-height: 1.55; margin: 0 0 18px; }

/* ---------------------------------------------------- the ingest ledger -- */
/* The signature of this console. An upload elsewhere is a progress bar; here it
 * is a run log that ends by proving its own arithmetic reconciles. That proof
 * is the product's entire claim, so it is shown rather than asserted. */
.ledger {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.85;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 15px 17px; max-height: 320px; overflow-y: auto;
}
.ledger .ln { display: flex; gap: 12px; }
.ledger .ln .k { color: var(--ink-mute); min-width: 186px; }
.ledger .ln .v { color: var(--ink); font-variant-numeric: tabular-nums; }
.ledger .ln.ok  .v { color: var(--good); }
.ledger .ln.bad .v { color: var(--bad); }
.ledger .rule { height: 1px; background: var(--border); margin: 9px 0; }

.bar { height: 4px; background: var(--border-2); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s linear; }

/* Drop target for the block model. */
.drop {
  border: 1px dashed var(--border); border-radius: 8px;
  padding: 34px 20px; text-align: center; transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: var(--accent-dim); }
.drop p { margin: 6px 0 0; color: var(--ink-mute); font-size: 13px; }

/* ------------------------------------------------------------- analytics */
/* Bars rather than a charting library: two dozen chapters of dwell time is a
 * bar chart, and a dependency for that would be larger than the whole page. */
.funnel { display: flex; flex-direction: column; gap: 7px; }
.funnel .f { display: grid; grid-template-columns: 30px 1fr 96px; gap: 11px; align-items: center; }
.funnel .f .o { font-family: var(--mono); font-size: 10.5px; color: var(--ink-mute); text-align: right; }
.funnel .f .t { font-size: 12.5px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel .f .m { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); text-align: right; }
.funnel .f .track { height: 22px; background: var(--bg); border-radius: 3px; position: relative; overflow: hidden; }
.funnel .f .track > i { position: absolute; inset: 0 auto 0 0; background: var(--accent-dim); }
.funnel .f .track > span { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--ink); }

.spark { display: flex; align-items: flex-end; gap: 2px; height: 46px; }
.spark i { flex: 1; background: var(--accent); opacity: .45; border-radius: 2px 2px 0 0; min-height: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ----------------------------------------------------------------- zones --- */
/* A zone is one deposit inside a project. Each carries the dataset slots; a
   filled slot reads as done, an empty one as an invitation. */
.zone {
  border: 1px solid var(--border); border-radius: var(--r-pan);
  padding: 20px; background: var(--surface);
}
.zone + .zone { margin-top: 12px; }
.zone > .row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.zone > .row b { font-family: var(--heading); font-size: 16px; font-weight: 600; }
.zone .zsub { font-family: var(--mono); font-size: 12px; color: var(--ink-mute); margin-left: 10px; }

.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 900px) { .slots { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .slots { grid-template-columns: 1fr; } }
.slot {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
}
.slot.on { border-color: #bfe4d4; }
.slot .k {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  flex: 1; min-width: 0; padding-top: 4px;
}
/* Chip over buttons, right-aligned, so a loaded slot with two actions stays the
   same height as an empty one with a single Add. */
.slot .acts {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}

/* "resource stage" beside the block-model slot. A quiet note that this one is
   for later, not an asterisk implying the project is incomplete without it. */
.slot .k .opt {
  display: block; font-style: normal; font-family: var(--mono);
  font-size: 10px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 400; margin-top: 3px;
}

/* ---- deck builder ------------------------------------------------------ */
.builder { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } }
.bcol h3 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-mute); font-weight: 500;
  margin: 0 0 10px;
}
.bcol h3 .hint { margin-left: 6px; }
.droplist {
  min-height: 180px; max-height: 520px; overflow-y: auto;
  border: 1px dashed var(--border); border-radius: var(--r-pan);
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
}
.droplist.running { border-style: solid; border-color: var(--accent); }
.droplist.over { border-color: var(--accent); background: var(--accent-dim); }
.scard {
  display: flex; align-items: center; gap: 12px; padding: 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: grab;
}
.scard:active { cursor: grabbing; }
.scard.dragging { opacity: .4; }
.scard .grow { flex: 1; min-width: 0; }
.scard b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.scard .ssec {
  display: block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--accent-700);
  margin: 2px 0 3px;
}
.scard .sbody { display: block; font-size: 11.5px; line-height: 1.35; color: var(--ink-mute); }
.empty.sm { padding: 22px 12px; }
.empty.sm p { margin: 0; font-size: 12px; }

/* Slots accept a dropped file directly — the gesture everyone tries first. */
.slot.dropping { border-color: var(--accent); background: var(--accent-dim); }
.slot.dropping * { pointer-events: none; }
.dropmini {
  position: relative; border: 1px dashed var(--border); border-radius: 8px;
  padding: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.dropmini.over { border-color: var(--accent); background: var(--accent-dim); }
.dropmini input[type=file] { flex: 0 0 auto; max-width: 60%; }
.dzname { font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); }
.zone.dropping { border-color: var(--accent); background: var(--accent-dim); }
/* Schematic, not a preview — see candidateGlyph(). Enough to tell a section
   from a plan from a drill slide without rendering anything. */
.scard .sglyph {
  flex: 0 0 auto; line-height: 0; border-radius: 5px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg);
}

/* ---- studio ------------------------------------------------------------
   The chapter list and the thing it edits, side by side, because the whole
   point is that you adjust a shot while looking at it. Tall on purpose: a
   viewer in a letterbox is a viewer you cannot judge a camera in. */
.studio {
  display: grid; grid-template-columns: 340px 1fr; gap: 16px;
  align-items: stretch; height: calc(100vh - 210px); min-height: 520px;
}
.stchaps {
  overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius: var(--r-pan);
  background: var(--surface); padding: 8px;
}
/* The viewer is a dark 3D scene; it keeps its own ground rather than being
   forced onto the console's paper. */
.stview {
  position: relative; border: 1px solid var(--border);
  border-radius: var(--r-pan); overflow: hidden; background: #07090A;
}
.stview iframe { display: block; width: 100%; height: 100%; border: 0; }
.stlive {
  position: absolute; left: 12px; top: 12px; z-index: 2; display: flex;
  gap: 10px; align-items: baseline; padding: 8px 12px; border-radius: 6px;
  background: rgba(255,255,255,.94); border: 1px solid var(--border);
  font-size: 12px; color: var(--ink-dim); pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.stlive .k {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-700);
}
.stlive .v { font-family: var(--mono); font-size: 11px; color: var(--ink-mute); }
.stchap {
  display: block; width: 100%; text-align: left; padding: 0; margin-bottom: 4px;
  border: 1px solid transparent; border-radius: 8px; background: none;
  cursor: pointer; color: inherit; font: inherit;
}
.stchap:hover { background: var(--bg); }
.stchap.on { background: var(--accent-dim); border-color: var(--accent); }
.stchap .stgo {
  display: flex; gap: 10px; width: 100%; text-align: left;
  padding: 10px 10px 4px; border: 0; background: none; cursor: pointer;
  color: inherit; font: inherit;
}
.stchap .n { flex: 0 0 auto; font-family: var(--mono); font-size: 10px; color: var(--ink-mute); padding-top: 3px; }
.stchap b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.stchap .cam { display: block; font-family: var(--mono); font-size: 10px; color: var(--ink-mute); margin-top: 2px; }
.stchap .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.stchap .chips i {
  font-style: normal; font-family: var(--mono); font-size: 9px;
  letter-spacing: .04em; padding: 2px 5px; border-radius: 3px;
  background: var(--border-2); color: var(--ink-mute);
}
@media (max-width: 1000px) {
  .studio { grid-template-columns: 1fr; height: auto; }
  .stchaps { max-height: 280px; }
  .stview { height: 70vh; }
}
/* A slide someone has flown to and set, versus one that is still whatever the
   generator proposed. Removing the first costs work; removing the second does
   not, and the card should say which it is. */
.scard .tagline, .stchap .tagline {
  font-style: normal; font-family: var(--mono); font-size: 9px;
  letter-spacing: .05em; text-transform: uppercase; vertical-align: 2px;
  padding: 2px 5px; border-radius: 3px; margin-left: 6px;
  background: var(--accent-dim); color: var(--accent-700);
}
/* A chapter row is two things: jump to it, and replay the flight into it. */
.strow { display: flex; align-items: center; gap: 8px; padding: 0 10px 9px 34px; flex-wrap: wrap; }
.stwarn {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em;
  padding: 2px 5px; border-radius: 3px; background: var(--bad-dim); color: var(--bad);
}
.sttime { font-family: var(--mono); font-size: 10px; color: var(--good); }
.sttime.bad { color: var(--bad); }

/* ---- embed panel -------------------------------------------------------
   Four destinations that each want a different artifact: markup, a bare URL,
   an add-in, or an import. Tabs rather than one long page, because nobody is
   publishing to all four at once. */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs .tab {
  padding: 9px 12px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--ink-mute); font: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.on { color: var(--accent-700); border-bottom-color: var(--accent); }
.snip {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 13px; overflow: auto; white-space: pre-wrap; word-break: break-all;
  color: var(--ink-dim); margin: 0 0 12px;
}
.steps { margin: 8px 0 12px; padding-left: 20px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.7; }
.steps li { margin-bottom: 4px; }

/* ---- neighbouring holders ---------------------------------------------- */
.nbrow {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--border-2);
}
.nbrow:first-child { border-top: 0; }
.nbrow b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.nbrow .hint { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--ink-mute); margin-top: 3px; }
.nblogo {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 7px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
}
.nblogo img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; }
.nblogo span { font-family: var(--mono); font-weight: 600; font-size: 12px; color: var(--accent-700); }
.nblogo.lg { width: 90px; height: 90px; border-radius: 8px; }
.nblogo.lg span { font-size: 20px; }
.brandrow { display: grid; grid-template-columns: 90px 1fr; gap: 20px; align-items: start; }
@media (max-width: 700px) { .brandrow { grid-template-columns: 1fr; } }
.nbrow.off { opacity: .55; }
.nbnote {
  display: block; width: 100%; max-width: 520px; margin-top: 6px;
  padding: 7px 10px; font-family: var(--sans); font-size: 12.5px;
  background: var(--surface); color: var(--ink-dim);
  border: 1px solid var(--border); border-radius: var(--r-ctl);
}
.nbnote:disabled { opacity: .45; }
.nbjur { font-family: var(--mono); font-size: 12px; min-width: 0; width: auto; }
/* A contenteditable that is empty looks like a rendering fault rather than an
   invitation, so it says what it is until there is something in it. */
[contenteditable][data-placeholder]:empty::before { content: attr(data-placeholder); color: var(--ink-mute); }

/* A toggle that reads its own state — the featured/logo pair on a holder row. */
.toggle {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .03em;
  padding: 6px 10px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink-mute); cursor: pointer;
  white-space: nowrap;
}
.toggle:hover { border-color: var(--ink-mute); color: var(--ink); }
.toggle.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-700); }
