/* Fenwick Dailies slate log. Same structure and neutrals as the other demo
   consoles; slate-blue accent. Three roles are colour-coded everywhere -
   code (neutral), model (amber), person (accent) - and every state also
   carries a text label (never colour alone). */
:root {
  color-scheme: light;
  --bg: #f3f3f0; --panel: #fcfcfb; --ink: #0b0b0b; --ink2: #52514e; --muted: #75746e; --line: #e3e2dd;
  --chip: #ecebe6; --track: #e9e8e3;
  --accent: #33598a; --accent-ink: #fff; --accent-soft: rgba(51, 89, 138, .13);
  --model: #a86a12; --model-soft: rgba(168, 106, 18, .14); --code: #4a4944; --code-soft: rgba(74, 73, 68, .1);
  --take-a: #33598a; --take-b: #5d7fae; --dropped: #b9b8b1; --focus: #2a78d6;
  --good: #0a7d24; --warn-bg: #fff4d6; --warn-ink: #6b4a00; --bad: #c0392b; --bad-bg: #fde8e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #121211; --panel: #1a1a19; --ink: #fff; --ink2: #c3c2b7; --muted: #9b9a93; --line: #33322f;
    --chip: #2a2a27; --track: #242422;
    --accent: #7fa6dc; --accent-ink: #0b1320; --accent-soft: rgba(127, 166, 220, .18);
    --model: #e0a54a; --model-soft: rgba(224, 165, 74, .16); --code: #c3c2b7; --code-soft: rgba(195, 194, 183, .12);
    --take-a: #7fa6dc; --take-b: #4d6f9f; --dropped: #55544f; --focus: #3987e5;
    --good: #6fcf97; --warn-bg: #3a2f10; --warn-ink: #f3d68a; --bad: #ff8a7a; --bad-bg: #3b1d19;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.mono, code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.small { font-size: 13px; } .muted { color: var(--muted); } .nowrap { white-space: nowrap; }
.error-text { color: var(--bad); font-weight: 600; margin: 8px 0 0; }

header.top { padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--panel); display: flex; gap: 6px 14px; align-items: baseline; flex-wrap: wrap; }
header.top .brand { color: inherit; text-decoration: none; font-weight: 700; }
header.top .brand span { font-weight: 500; color: var(--ink2); }
header.top .sub { color: var(--muted); font-size: 13px; }
header.top nav { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 14px; }
header.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
form.inline { display: inline; }
button.linkish { background: none; color: var(--muted); padding: 0; font-weight: 500; }
.sandbox-bar { background: var(--chip); color: var(--ink2); font-size: 13px; padding: 7px 24px; border-bottom: 1px solid var(--line); }
main { max-width: 1280px; margin: 0 auto; padding: 18px 16px 40px; }
footer.foot { max-width: 1280px; margin: 0 auto; padding: 0 16px 28px; color: var(--muted); font-size: 12px; }

h1 { font-size: 21px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 0 0 8px; } h3 { font-size: 15px; margin: 0 0 6px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
label { font-size: 13px; color: var(--ink2); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; min-width: 0; max-width: 100%; }
textarea { width: 100%; resize: vertical; min-height: 64px; }
button { font: inherit; border: 0; border-radius: 7px; padding: 8px 14px; cursor: pointer; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.secondary { background: var(--chip); color: var(--ink); }
button.danger { background: var(--chip); color: var(--bad); }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.login { max-width: 420px; margin: 10vh auto; }
.login label { display: grid; gap: 4px; }

.intro { margin: 2px 0 14px; max-width: 900px; }
.intro p { margin: 4px 0 0; color: var(--ink2); }
.layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 940px) { .layout { grid-template-columns: 1fr; } }
.stepnum { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; margin-right: 6px; }


.intro .notjudge { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 7px 7px 0; color: var(--ink); }
.who { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--ink2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.dot.code { background: var(--code); } .dot.model { background: var(--model); } .dot.person { background: var(--accent); }
.who-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 0 5px; }
.who-tag.code, .who-tag.Rekognition, .who-tag.ffmpeg { background: var(--code-soft); color: var(--code); }
.who-tag.model { background: var(--model-soft); color: var(--model); }
.who-tag.person { background: var(--accent-soft); color: var(--accent); }

/* examples */
.examples { display: grid; gap: 8px; }
.example { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg); }
.example b { font-size: 14px; }
.example .meta { grid-column: 1; font-size: 12px; color: var(--muted); }
.example p { grid-column: 1; margin: 0; font-size: 13px; color: var(--ink2); }
.example button { grid-column: 2; grid-row: 1 / span 3; }
@media (max-width: 560px) { .example { grid-template-columns: 1fr; } .example button { grid-column: 1; grid-row: auto; } }
.empty { border: 1px dashed var(--line); border-radius: 9px; padding: 12px; font-size: 13px; color: var(--ink2); }
.badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 5px; padding: 1px 6px; background: var(--chip); color: var(--ink2); vertical-align: 1px; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.model { background: var(--model-soft); color: var(--model); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.good { background: var(--accent-soft); color: var(--good); }

/* upload */
.drop { position: relative; display: grid; place-items: center; gap: 4px; text-align: center; border: 2px dashed var(--line); border-radius: 10px; padding: 22px 12px; cursor: pointer; background: var(--bg); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-main { font-weight: 600; color: var(--ink); }
.drop-sub { font-size: 13px; color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 3px; font-size: 14px; }
.checks li::before { content: "✓ "; color: var(--good); font-weight: 700; }
.checks li.no::before { content: "✕ "; color: var(--bad); }
.checks li.maybe::before { content: "… "; color: var(--muted); }
.rights { display: flex; gap: 9px; align-items: flex-start; margin: 12px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--ink); }
.rights input { margin-top: 4px; }
.progress { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.guardrails { margin-top: 12px; font-size: 13px; color: var(--ink2); }
.guardrails summary { cursor: pointer; font-weight: 600; }
.guardrails ul { margin: 6px 0 0; padding-left: 20px; }
.notice { border-radius: 9px; padding: 10px 12px; font-size: 14px; }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.info { background: var(--accent-soft); color: var(--ink); }

/* rolls list */
.runs { display: grid; gap: 6px; }
.runitem { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--bg); }
.runitem b { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runitem span { font-size: 12px; color: var(--muted); }

/* roll page */
.runhead { display: flex; gap: 8px 14px; align-items: baseline; flex-wrap: wrap; }
.runhead h1 { margin: 0; overflow-wrap: anywhere; }
.facts { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); margin-top: 6px; }
.stages { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 1000px) { .stages { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stage { border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; background: var(--panel); }
.stage b { display: block; font-size: 13px; }
.stage small { display: block; font-size: 12px; color: var(--muted); min-height: 1.4em; }
.stage .st { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.stage.done .st { color: var(--good); }
.stage.active { border-color: var(--accent); }
.stage.active .st { color: var(--accent); }
.stage.blocked, .stage.failed { border-color: var(--bad); }
.stage.blocked .st, .stage.failed .st { color: var(--bad); }
.spinner { display: inline-block; width: 11px; height: 11px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 4px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } .progress div { transition: none; } }

/* timeline */
.tl { width: 100%; display: block; overflow: visible; }
.tl text { font: 11px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; fill: var(--muted); }
.tl .lane-label { font-weight: 600; fill: var(--ink2); }
.tl .track { fill: var(--track); }
.tl .motion { fill: none; stroke: var(--code); stroke-width: 1; opacity: .8; }
.tl .audio { fill: var(--code-soft); stroke: var(--code); stroke-width: .8; }
.tl .cand { stroke-width: 2; }
.tl .cand.slate { stroke: var(--model); }
.tl .cand.not { stroke: var(--dropped); }
.tl .cand.failed { stroke: var(--bad); }
.tl .take { cursor: pointer; }
.tl .take rect { fill: var(--take-a); }
.tl .take.alt rect { fill: var(--take-b); }
.tl .take text { fill: var(--accent-ink); font-weight: 700; }
.tl .take.review rect { stroke: var(--model); stroke-width: 2; }
.tl .head rect { fill: url(#hatch); }
.tl .clap { fill: var(--ink); }
.tl .clap.missing { fill: none; stroke: var(--bad); stroke-width: 1.5; }
.tl .axis line { stroke: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--ink2); margin-top: 6px; }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }
.sw.take { background: var(--take-a); } .sw.slate { background: var(--model); width: 3px; } .sw.not { background: var(--dropped); width: 3px; }
.sw.clap { background: var(--ink); width: 8px; height: 8px; transform: rotate(45deg); }
.sw.review { background: transparent; border: 2px solid var(--model); }

/* slate cards */
.reviewbar { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; }
.reviewbar label { display: flex; gap: 6px; align-items: center; }
.slates { display: grid; gap: 12px; }
.slatecard { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr); gap: 14px; scroll-margin-top: 12px; }
.slatecard.dismissed { opacity: .6; grid-template-columns: 1fr; }
@media (max-width: 880px) { .slatecard { grid-template-columns: 1fr; } }
.slatecard h3 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.frame { position: relative; }
.frame img { width: 100%; border-radius: 8px; background: #000; display: block; }
.frame .gone { aspect-ratio: 16 / 9; border-radius: 8px; background: var(--track); display: grid; place-items: center; text-align: center; font-size: 13px; color: var(--muted); padding: 12px; }
.frame figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fields { width: 100%; border-collapse: collapse; font-size: 14px; }
.fields th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 6px; }
.fields td { padding: 6px; border-top: 1px solid var(--line); vertical-align: top; }
.fields tr.flag td { background: var(--model-soft); }
.fields tr.flag td:first-child { box-shadow: inset 3px 0 0 var(--model); }
.fields td.name { font-weight: 600; white-space: nowrap; }
.fields input { width: 100%; min-width: 70px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.fields .flags { font-size: 12px; color: var(--ink2); margin: 3px 0 0; padding-left: 16px; }
.fields .acts { display: flex; gap: 6px; white-space: nowrap; }
.fields .acts button { padding: 5px 9px; font-size: 13px; }
.fields .by { font-size: 12px; color: var(--muted); }
.fields .was { font-size: 12px; color: var(--muted); }
.conf { display: grid; gap: 2px; min-width: 64px; font-size: 12px; font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 6px; background: var(--chip); border-radius: 3px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--model); }
.meter b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.sync { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--bg); font-size: 13px; }
.sync .row { justify-content: space-between; }
.clapchart { width: 100%; display: block; margin-top: 6px; }
.clapchart .m { fill: none; stroke: var(--code); stroke-width: 1.4; }
.clapchart .a { fill: var(--code-soft); stroke: var(--code); stroke-width: .8; }
.clapchart .syncline { stroke: var(--accent); stroke-width: 2; }
.clapchart .visline { stroke: var(--model); stroke-width: 1.5; stroke-dasharray: 3 3; }
.clapchart .hold { fill: var(--accent-soft); }
.clapchart text { font: 11px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; fill: var(--muted); }

/* export */
.files { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: var(--bg); font-size: 14px; }
.files li small { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.blockers { margin: 6px 0; padding-left: 20px; color: var(--ink2); font-size: 14px; }
.promote { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.promote label { display: grid; gap: 3px; }
.promote .wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .promote { grid-template-columns: 1fr; } }

table.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
table.plain th, table.plain td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plain th { color: var(--muted); font-weight: 600; }
.tablewrap { overflow-x: auto; }
details.panel > summary { cursor: pointer; font-weight: 600; }
.audit { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; display: grid; gap: 4px; }
.audit li { display: grid; grid-template-columns: 72px 150px minmax(0, 1fr); gap: 8px; }
.audit li span:nth-child(3) { overflow-wrap: anywhere; }
@media (max-width: 640px) { .audit li { grid-template-columns: 1fr; gap: 0; padding-bottom: 4px; border-bottom: 1px solid var(--line); } }

@media (max-width: 640px) {
  .fields, .fields tbody { display: block; }
  .fields tr:first-child { display: none; }
  .fields tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 8px 6px; border-top: 1px solid var(--line); }
  .fields td { display: block; border: 0; padding: 0; }
  .fields td.name { grid-column: 1; }
  .fields td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .fields td:nth-child(2) { grid-column: 1 / -1; }
  .fields td:nth-child(4) { grid-column: 1 / -1; }
  .fields tr.flag td:first-child { box-shadow: none; }
  .fields tr.flag { box-shadow: inset 3px 0 0 var(--model); }
}
