/* ============================================================
   Spend the Frame — activity component layer
   Loaded AFTER styles.css (the ported Hick's Law brand system).
   styles.css owns the tokens and the shell: .wrap .hero-banner
   .main-stage .card .btn .field .input .btnrow .lead .muted .mono
   and the colour utilities .good .bad .danger .primary .tonal .ghost.

   This file is a trimmed copy of the Model Lab component layer —
   same selectors, same values, so the two sites stay visually
   identical — plus a small set of classes new to this activity:
   .brief-scenario, .throttle-card, .flagrow and the round-2
   diff styling in .pick.cut / .pick.added.
   ============================================================ */

[hidden]{ display:none !important; }

/* ---------- team identity strip ---------- */
.teamid{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:8px 12px; margin:0 0 14px;
  background:var(--surface); border:var(--border-w) solid var(--ink);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-1);
}
.teamid .who{ font-weight:800; font-size:14px; letter-spacing:.01em; }
.teamid .mem{ color:var(--muted); font-size:12.5px; flex:1 1 140px; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.teamid .swap{
  background:none; border:0; padding:4px 6px; cursor:pointer;
  font:inherit; font-size:12px; font-weight:800; text-transform:uppercase;
  letter-spacing:.06em; color:var(--emerald-700); text-decoration:underline;
  text-underline-offset:3px;
}
.teamid .swap:hover{ color:var(--forest-700); }

/* ---------- section head ---------- */
.hd{ display:flex; align-items:baseline; justify-content:space-between;
  gap:10px; margin:0 0 8px; }
.hd h2, .hd h3{ margin:0; }
.hd .side{ font-size:12px; font-weight:800; letter-spacing:.07em;
  text-transform:uppercase; color:var(--muted); }

/* ---------- callouts ---------- */
.callout{
  border-left:4px solid var(--forest-700); background:var(--emerald-50);
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  padding:11px 13px; margin:12px 0; font-size:13.5px; line-height:1.5;
}
.callout.gold  { border-left-color:var(--gold);    background:#fdf7ea; }
.callout.green { border-left-color:var(--emerald); background:var(--emerald-50); }
.callout.red   { border-left-color:var(--bad);     background:var(--bad-50); }
.callout b{ font-weight:800; }
.callout p{ margin:.45em 0 0; }
.callout p:first-child{ margin-top:0; }

/* ---------- brief scenario card ---------- */
.brief-scenario{
  background:var(--surface-2); border:var(--border-w) solid var(--ink);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-1);
  padding:14px 16px; margin:12px 0; font-size:14.5px; line-height:1.55;
}
.brief-scenario .tag{
  display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.09em;
  text-transform:uppercase; color:var(--forest-700); margin-bottom:6px;
}

/* ---------- stat grid (budget headline) ---------- */
.stat-grid{ display:grid; gap:8px; margin:12px 0;
  grid-template-columns:repeat(auto-fit,minmax(128px,1fr)); }
.stat{
  background:var(--surface); border:var(--border-w) solid var(--ink);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-1);
  padding:9px 11px 10px; min-width:0;
}
.stat .lbl{ display:block; font-size:10.5px; font-weight:800; letter-spacing:.1em;
  text-transform:uppercase; color:var(--muted); margin:0 0 3px; }
.stat .v{ display:block; font-size:22px; font-weight:900; line-height:1.1;
  color:var(--ink); font-variant-numeric:tabular-nums;
  overflow:hidden; text-overflow:ellipsis; }
.stat .v small{ font-size:12px; font-weight:800; color:var(--muted); margin-left:2px; }
.stat .note{ display:block; font-size:11.5px; color:var(--muted); margin-top:3px; line-height:1.35; }
.stat.hot{ background:#fdf1ec; border-color:var(--bad); }
.stat.hot .v{ color:var(--bad); }
.stat.ok { background:var(--emerald-50); }
.stat.ok .v{ color:var(--emerald-700); }

/* ---------- budget meter ---------- */
.meter-row{ margin:11px 0; }
.meter-head{ display:flex; align-items:baseline; justify-content:space-between;
  gap:8px; font-size:12.5px; margin:0 0 4px; }
.meter-head .name{ font-weight:800; text-transform:uppercase; letter-spacing:.07em; font-size:11px; }
.meter-head .val{ font-variant-numeric:tabular-nums; font-weight:800; }
.meter-head .val.over{ color:var(--bad); }
.meter{ position:relative; height:16px; background:var(--cream-2);
  border:var(--border-w) solid var(--ink); border-radius:var(--radius-xs); overflow:hidden; }
.meter-fill{ height:100%; width:0; background:var(--emerald);
  transition:width .28s var(--ease), background-color .28s var(--ease); }
.meter-fill.warn{ background:var(--gold); }
.meter-fill.over{ background:var(--bad); }
.meter::after{ content:""; position:absolute; inset-block:0; right:0; width:2px;
  background:var(--ink); opacity:.35; }
.card.meters{ position:sticky; top:6px; z-index:5; }
@media (max-width:759px){ .card.meters{ position:static; } }

/* ---------- category picklist ---------- */
.catname{ font-size:13px; font-weight:800; text-transform:uppercase;
  letter-spacing:.06em; color:var(--forest-700); margin:16px 0 6px; }
.catname:first-child{ margin-top:0; }
.catname .req{ font-weight:600; text-transform:none; letter-spacing:0; color:var(--muted); font-size:12px; }
.picklist{ display:flex; flex-direction:column; gap:7px; margin:0 0 4px; }
.pick{
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px;
  text-align:left; width:100%; cursor:pointer;
  background:var(--surface); border:var(--border-w) solid var(--ink);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-1);
  padding:9px 11px; font:inherit; color:inherit;
  transition:transform .08s var(--ease), box-shadow .08s var(--ease), background-color .08s var(--ease);
}
.pick:hover{ background:var(--surface-2); }
.pick:active, .pick.is-press{ transform:translate(var(--sh-1),var(--sh-1)); box-shadow:none; }
.pick[aria-pressed="true"]{
  background:var(--emerald-50); border-color:var(--emerald-700);
  box-shadow:var(--sh-1) var(--sh-1) 0 var(--emerald-700);
}
.pick.disabled{ opacity:.45; cursor:not-allowed; }
.pick .box{ width:19px; height:19px; flex:0 0 auto;
  border:var(--border-w) solid var(--ink); border-radius:var(--radius-xs);
  background:var(--surface); display:grid; place-items:center; }
.pick[aria-pressed="true"] .box{ background:var(--emerald-700); border-color:var(--emerald-700); }
.pick .box svg{ width:12px; height:12px; stroke:#fff; stroke-width:3.2; fill:none;
  opacity:0; transition:opacity .12s var(--ease); }
.pick[aria-pressed="true"] .box svg{ opacity:1; }
.pick .nm{ font-weight:800; font-size:14px; line-height:1.25; min-width:0; }
.pick .sub{ display:block; font-weight:500; font-size:12px; color:var(--muted); margin-top:2px; }
.pick .fig{ font-variant-numeric:tabular-nums; font-size:13px; color:var(--muted);
  text-align:right; white-space:nowrap; }
.pick .fig b{ display:block; color:var(--ink); font-size:15px; }
.vtag{ display:inline-block; font-style:normal; font-size:9.5px; font-weight:800;
  letter-spacing:.08em; text-transform:uppercase; vertical-align:1px;
  padding:1px 6px; margin-left:5px; border-radius:100px; }
.vtag.risky   { background:var(--bad-50); color:var(--bad); border:1px solid var(--bad); }
.vtag.gate    { background:#fdf7ea; color:#8a5d12; border:1px solid var(--gold); }
.vtag.headset { background:var(--emerald-100); color:var(--emerald-700); border:1px solid var(--emerald-700); }
.pick[aria-pressed="true"] .vtag{ background:#fff; }

/* round-2 diff: what changed since round 1 */
.pick.was-picked-r1:not([aria-pressed="true"]) .nm::after{
  content:" — cut"; color:var(--bad); font-weight:800; text-transform:uppercase;
  font-size:10.5px; letter-spacing:.05em;
}
.pick.new-in-r2[aria-pressed="true"] .nm::after{
  content:" — added"; color:var(--forest-700); font-weight:800; text-transform:uppercase;
  font-size:10.5px; letter-spacing:.05em;
}

/* ---------- single-choice options (yes/no, etc.) ---------- */
.opts{ display:grid; gap:7px; margin:11px 0; }
.opts.row{ grid-template-columns:repeat(auto-fit,minmax(132px,1fr)); }
.opt{
  display:block; text-align:left; width:100%; cursor:pointer;
  background:var(--surface); border:var(--border-w) solid var(--ink);
  border-radius:var(--radius-sm); box-shadow:var(--shadow-1);
  padding:10px 12px; font:inherit; color:inherit;
  transition:transform .08s var(--ease), box-shadow .08s var(--ease), background-color .08s var(--ease);
}
.opt:hover{ background:var(--surface-2); }
.opt:active, .opt.is-press{ transform:translate(var(--sh-1),var(--sh-1)); box-shadow:none; }
.opt[aria-pressed="true"]{
  background:var(--forest-700); border-color:var(--forest-700); color:#fff;
  box-shadow:var(--sh-1) var(--sh-1) 0 var(--forest-900);
}
.opt[aria-pressed="true"] .sub{ color:rgba(255,255,255,.72); }
.opt .ttl{ display:block; font-weight:800; font-size:14px; line-height:1.25; }
.opt .sub{ display:block; font-size:12px; color:var(--muted); margin-top:2px; line-height:1.4; }

/* ---------- badges ---------- */
.badge{ display:inline-block; font-size:11px; font-weight:800; letter-spacing:.04em;
  text-transform:uppercase; padding:3px 9px; border-radius:100px;
  border:var(--border-w) solid var(--ink); }
.badge.ship  { background:var(--emerald-50);  border-color:var(--emerald-700); color:var(--emerald-700); }
.badge.fix   { background:#fdf7ea;            border-color:var(--gold);        color:#8a5d12; }
.badge.reject{ background:var(--bad-50);      border-color:var(--bad);         color:var(--bad); }
.badge.wait  { background:var(--cream-2);     color:var(--muted); border-color:var(--line-2); }

/* ---------- throttle transition screen ---------- */
.throttle-card{
  background:var(--forest-900); color:#fff; border:var(--border-w) solid var(--ink);
  border-radius:var(--radius); box-shadow:var(--shadow-2);
  padding:22px 20px; margin:14px 0; text-align:center;
}
.throttle-card .big{ font-size:15px; font-weight:800; letter-spacing:.02em; line-height:1.4; }
.throttle-card .capdrop{ margin:16px 0; font-size:34px; font-weight:900;
  font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
.throttle-card .capdrop .was{ color:rgba(255,255,255,.5); text-decoration:line-through;
  font-size:22px; margin-right:10px; }
.throttle-card .capdrop .now{ color:#ffd479; }
.throttle-card .line{ font-size:13.5px; color:rgba(255,255,255,.78); line-height:1.5; margin-top:10px; }

/* ---------- data table ---------- */
.tablewrap{ overflow-x:auto; }
.dtl{ width:100%; border-collapse:collapse; font-size:13px; }
.dtl th, .dtl td{ padding:7px 9px; text-align:left; border-bottom:1px solid var(--line); }
.dtl thead th{ font-size:10.5px; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  color:var(--muted); border-bottom:var(--border-w) solid var(--ink); white-space:nowrap; }
.dtl td.num, .dtl th.num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.dtl tbody tr:last-child td{ border-bottom:0; }
.dtl tbody tr:hover{ background:var(--surface-2); }
.dtl td.over{ color:var(--bad); font-weight:800; }
.dtl .team{ font-weight:800; }
.dtl tfoot td{ border-top:var(--border-w) solid var(--ink); padding-top:8px; }

/* ---------- frequency bars (admin) ---------- */
.casedist{ margin:14px 0 16px; }
.distrow{ display:grid; grid-template-columns:1fr 3fr auto; align-items:center;
  gap:10px; margin:6px 0; font-size:13px; }
.distrow .dl{ color:var(--ink-2); font-weight:600; }
.distrow .dbar{ height:11px; background:var(--cream-2); border:1px solid var(--line-2);
  border-radius:100px; overflow:hidden; }
.distrow .dbar i{ display:block; height:100%; background:var(--line-2); }
.distrow .dbar i.ok{ background:var(--emerald); }
.distrow .dbar i.no{ background:var(--bad); }
.distrow .dn{ text-align:right; font-variant-numeric:tabular-nums; font-weight:800; }

/* ---------- flag rows (admin call-outs on named teams) ---------- */
.flagrow{ font-size:13px; padding:5px 0; border-bottom:1px dashed var(--line); }
.flagrow:last-child{ border-bottom:0; }
.flagrow b{ font-weight:800; }

.fine{ font-size:12px; color:var(--muted); line-height:1.5; }
.fine a{ color:var(--emerald-700); }
.fine.okmsg{ color:var(--emerald-700); font-weight:700; }

.worksplit{ display:grid; gap:16px; }

/* ---------- print: the plenary handout ---------- */
@media print{
  .hero-banner, .teamid, .btnrow, .throttle-card .capdrop .was{ display:none !important; }
  body{ background:#fff; }
  .card{ box-shadow:none; break-inside:avoid; }
}

/* ---------- narrow card (sign-in) ---------- */
@media (min-width:520px){
  .card.narrow{ max-width:680px; }
  .card.narrow .btnrow{ justify-content:flex-start; }
}

/* ---------- inline error text (admin board load failures) ---------- */
p.bad{ color:var(--bad); font-weight:700; }

/* ============================================================
   Stacked frame-budget visualizer
   A vertical bar, sidebar-mounted, one segment per active pick,
   stacked bottom-up in a fixed category order so a pick's visual
   position stays stable as neighbours are toggled. The cap is a
   dashed line at its true position on the scale — going over is
   allowed and expected, the bar just runs past the line into a
   tinted "over" zone instead of clamping at 100%.
   ============================================================ */
:root{
  --cat-ground:     #2f6f4f;
  --cat-light:      #c1852b;
  --cat-audio:      #3a6ea5;
  --cat-legibility: #6b4f8a;
  --cat-render:     #a5472f;
}

.worksplit{ display:grid; gap:16px; }
@media (min-width:820px){
  .worksplit{ grid-template-columns:1fr 248px; align-items:start; }
  .worksplit .sidebar{ position:sticky; top:6px; }
}

.stackcard .hd{ margin-bottom:2px; }
.stacktotal{
  font-size:26px; font-weight:900; font-variant-numeric:tabular-nums;
  line-height:1.1; margin:2px 0 10px; color:var(--ink);
}
.stacktotal small{ font-size:13px; font-weight:800; color:var(--muted); }
.stacktotal.over{ color:var(--bad); }
.stacktotal .overby{
  display:inline-block; margin-left:8px; font-size:11px; font-weight:800;
  text-transform:uppercase; letter-spacing:.04em; color:#fff;
  background:var(--bad); padding:2px 7px; border-radius:100px; vertical-align:2px;
}

.stackbar-wrap{
  position:relative; height:260px; margin:4px 0 2px;
  background:var(--cream-2); border:var(--border-w) solid var(--ink);
  border-radius:var(--radius-sm); overflow:hidden;
}
.stackbar-wrap.over{ border-color:var(--bad); }
.stackbar-overzone{
  position:absolute; left:0; right:0; top:0; z-index:1;
  background:rgba(192,71,59,.12); display:none;
}
.stackbar-capline{
  position:absolute; left:0; right:0; height:0; z-index:3;
  border-top:2px dashed var(--ink);
}
.stackbar-capline span{
  position:absolute; right:4px; bottom:2px; font-size:9.5px; font-weight:800;
  background:var(--surface); color:var(--ink); padding:1px 5px; border-radius:3px;
  border:1px solid var(--ink); white-space:nowrap;
}
.stackbar-track{
  position:absolute; left:0; right:0; bottom:0; top:0; z-index:2;
  display:flex; flex-direction:column-reverse;
}
.stackseg{
  flex:0 0 auto; width:100%; min-height:3px; box-sizing:border-box;
  border-top:1px solid rgba(255,255,255,.55);
  transition:height .18s var(--ease);
}
.stackseg.cat-ground{ background:var(--cat-ground); }
.stackseg.cat-light{ background:var(--cat-light); }
.stackseg.cat-audio{ background:var(--cat-audio); }
.stackseg.cat-legibility{ background:var(--cat-legibility); }
.stackseg.cat-render{ background:var(--cat-render); }

.stackbar-legend{ display:flex; flex-wrap:wrap; gap:5px 11px; margin:9px 0 2px; font-size:11px; color:var(--muted); }
.legend-item{ display:inline-flex; align-items:center; gap:5px; }
.legend-dot{ width:9px; height:9px; border-radius:2px; flex:0 0 auto; display:inline-block; }
.legend-dot.cat-ground{ background:var(--cat-ground); }
.legend-dot.cat-light{ background:var(--cat-light); }
.legend-dot.cat-audio{ background:var(--cat-audio); }
.legend-dot.cat-legibility{ background:var(--cat-legibility); }
.legend-dot.cat-render{ background:var(--cat-render); }

@media (max-width:819px){
  .stackbar-wrap{ height:150px; }
}

/* ---------- pinned brief recap (Round 1 / Round 2) ----------
   Same visual language as the Brief screen's scenario box, but
   sized down since it now sits above a dense category list rather
   than alone on its own screen. */
.brief-recap{ margin:0 0 12px; padding:10px 14px; font-size:13px; line-height:1.45; }
.brief-recap .tag{ margin-bottom:3px; }

/* ============================================================
   Stages 1 & 2 (source.html, scene.html) — ported verbatim from the
   Model Lab's lab.css: "Can I Ship This?" listing cards and reveal
   panel, and the Budget Table's requirements checklist. Same
   selectors, same values, so all three sites stay visually identical.
   ============================================================ */

/* ---------- reveal panel ---------- */
.answer{
  margin-top:12px; border:var(--border-w) solid var(--forest-900);
  border-radius:var(--radius-sm); background:var(--emerald-50);
  box-shadow:var(--shadow-1); overflow:hidden;
}
.answer > h4{
  margin:0; padding:7px 12px; background:var(--forest-900); color:#fff;
  font-size:11px; font-weight:800; letter-spacing:.11em; text-transform:uppercase;
}
.answer .body{ padding:11px 13px; font-size:13.5px; line-height:1.55; }
.answer .body p{ margin:.5em 0 0; }
.answer .body p:first-child{ margin-top:0; }
.answer .body b{ font-weight:800; }
.answer .trap{
  margin-top:9px; padding-top:9px; border-top:2px dashed var(--line-2);
  font-size:13px;
}
.answer .trap b{ color:var(--gold); text-transform:uppercase; letter-spacing:.07em; font-size:11px; }

/* ---------- asset listing card (Source the Asset) ---------- */
.listing .lhead{
  display:flex; align-items:flex-start; justify-content:space-between; gap:10px; flex-wrap:wrap;
}
.listing .lhead h2{ margin:0; font-size:20px; line-height:1.2; flex:1 1 220px; min-width:0; }
.listing .lhead .badge{ flex:0 0 auto; margin-top:3px;
  background:var(--forest-900); color:#fff; border-color:var(--forest-900); }
.listing .lauthor{ margin:.35em 0 .1em; font-size:14px; color:var(--ink-2); }
.listing .lauthor b{ font-weight:800; }
.listing .ldetails{
  list-style:none; margin:11px 0; padding:0;
  display:flex; flex-wrap:wrap; gap:6px;
}
.listing .ldetails li{
  font-size:11.5px; font-weight:700; padding:3px 9px;
  background:var(--cream-2); border:1px solid var(--line-2);
  border-radius:100px; color:var(--ink-2); white-space:nowrap;
}
.listing .lsmall{
  margin:11px 0 0; padding:10px 12px;
  background:var(--surface-2); border:var(--border-w) solid var(--line-2);
  border-left-width:7px; border-left-color:var(--gold);
  border-radius:var(--radius-xs);
  font-size:13px; line-height:1.5; font-style:italic; color:var(--ink-2);
}

/* attribution comparison inside a reveal */
.attrcmp{
  margin:.5em 0 0; padding:7px 10px; font-size:12.5px; line-height:1.45;
  background:var(--surface); border:2px solid var(--line-2); border-radius:var(--radius-xs);
}
.attrcmp.model{ background:var(--emerald-50); border-color:var(--emerald-700); }
.attrcmp .lbl{
  display:block; font-size:10px; font-weight:800; letter-spacing:.1em;
  text-transform:uppercase; color:var(--muted); margin-bottom:3px;
}

/* ---------- requirements checklist (Build the Scene) ---------- */
.reqlist{ list-style:none; margin:10px 0 0; padding:0; }
.reqlist li{
  font-size:13.5px; padding:3px 0 3px 20px; position:relative; color:var(--ink-2);
}
.reqlist li::before{
  content:""; position:absolute; left:4px; top:11px;
  width:6px; height:6px; border-radius:50%; background:var(--line-2);
}
.reqlist.live li{ padding-left:24px; }
.reqlist.live li::before{ display:none; }
.reqlist.live .tick{
  position:absolute; left:0; top:2px; width:17px; height:17px;
  display:grid; place-items:center; font-size:11px; font-weight:900;
  border:2px solid var(--line-2); border-radius:var(--radius-xs);
  background:var(--surface); color:transparent;
}
.reqlist.live li.met .tick{ background:var(--emerald-700); border-color:var(--emerald-700); color:#fff; }
.reqlist.live li.met{ color:var(--ink); }
.reqlist.live li.unmet{ color:var(--muted); }
.reqlist.live li b{ font-weight:800; }

/* the hero asset's locked-in line, and the locked rendering pick on
   stage 3 — same idea, visually inert rather than a real toggle */
.pick.is-locked{ cursor:default; background:var(--cream-2); }
.pick.is-locked:hover{ background:var(--cream-2); }
.pick.is-locked .box{ background:var(--forest-700); border-color:var(--forest-700); }
.pick.is-locked .box svg{ opacity:1; }

/* scene.html's own working layout: meters, then the prop catalogue,
   then the submit card — same shape as the Model Lab's Budget Table */
@media (min-width:1100px){
  .scenebuild{
    grid-template-columns:minmax(0,380px) minmax(0,1fr);
    grid-template-rows:max-content 1fr;
    align-items:start;
  }
  .scenebuild > .meters     { grid-column:1; grid-row:1; }
  .scenebuild > .assets     { grid-column:2; grid-row:1 / span 2; margin-top:0; }
  .scenebuild > .submitcard { grid-column:1; grid-row:2; align-self:start; }
  .scenebuild .assets .picklist{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
}
@media (min-width:1500px){
  .scenebuild .assets .picklist{ grid-template-columns:repeat(3,1fr); }
}
