/* The lesson page HUD, on top of bench.css. Each piece is `hidden` until the lesson turns it on (lesson.js). */
.lesson [hidden] { display: none !important; }
.lesson .k { margin: 0 0 4px; font: var(--fl-small) var(--fl-font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--fl-holo); }
.lesson .x { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; background: none; border: 0; color: var(--fl-muted); font: 18px var(--fl-font-display); cursor: var(--cur-pointer); }
.lesson .x:hover, .lesson .x:focus-visible { color: var(--fl-text); outline: none; }
.panel { background: color-mix(in srgb, var(--fl-surface) 90%, transparent); border: 1px solid color-mix(in srgb, var(--fl-holo) 35%, transparent); border-radius: var(--fl-radius); }

/* pager + feed + inspector: three corners on a wide screen, one column on a phone */
.top { display: contents; }
/* pager: the ticket */
.pager { position: absolute; top: calc(var(--pt) + 56px); left: var(--pl); width: min(340px, 34vw); padding: 10px 12px; font-size: .8125rem; line-height: 1.45; border-left: 2px solid var(--fl-hazard); background: color-mix(in srgb, var(--fl-surface) 82%, transparent); }
.pager p { margin: 0; }
.pager-t b { font: 400 var(--fl-small) var(--fl-font-display); color: var(--fl-hazard); }
.pager-g { margin-top: 4px; color: var(--fl-muted); }
.pager-a { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--fl-line); color: var(--fl-hazard); font-family: var(--fl-font-display); font-size: var(--fl-small); }

/* right column: complaints feed, then the inspector */
.side { position: absolute; top: var(--pt); right: var(--pr); width: min(300px, 30vw); display: flex; flex-direction: column; gap: 8px; max-height: calc(100% - var(--pt) - 200px); pointer-events: none; }
.side > * { pointer-events: auto; }
.feed { padding: 8px 12px; }
.feed ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li { font-size: .8125rem; line-height: 1.4; }
.feed li b { display: block; font: 400 11px var(--fl-font-display); color: var(--fl-muted); }
.feed li:not(:first-child) { opacity: .6; }
.feed:has(+ .inspector:not([hidden])) li:nth-child(n + 3) { display: none; }
.feed ul:empty::before { content: "Quiet so far."; color: var(--fl-muted); font-size: .8125rem; }

/* inspector: Live / Settings / App */
.inspector { position: relative; min-height: 0; padding: 8px 12px 12px; overflow: auto; }
.inspector > header { padding-right: 36px; font: 1.0625rem var(--fl-font-display); }
.tabs { display: flex; gap: 4px; margin: 6px 0 8px; }
.tabs button { min-height: 44px; padding: 0 12px; background: none; border: 1px solid transparent; border-radius: var(--fl-radius); font: var(--fl-small) var(--fl-font-display); color: var(--fl-muted); cursor: var(--cur-pointer); }
.tabs button[aria-selected="true"] { color: var(--fl-holo); border-color: var(--fl-holo); }
.live { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font: var(--fl-small)/1.5 var(--fl-font-display); }
.live dt { color: var(--fl-muted); } .live dd { margin: 0; text-align: right; color: var(--fl-text); }
.live .hot { color: var(--fl-hazard); }
.row { padding: 8px 0; border-top: 1px solid var(--fl-line); }
.row:first-child { border-top: 0; }
.row b { display: block; font: 400 .9375rem var(--fl-font-display); }
.row small { display: block; color: var(--fl-muted); font: 11px var(--fl-font-display); }
.row p { margin: 4px 0 0; font-size: .75rem; color: var(--fl-muted); line-height: 1.4; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.steps button { min-height: 44px; min-width: 44px; padding: 0 10px; background: none; border: 1px solid var(--fl-line); border-radius: var(--fl-radius); color: var(--fl-text); font: var(--fl-small) var(--fl-font-display); cursor: var(--cur-pointer); }
.steps button[aria-pressed="true"] { border-color: var(--fl-holo); color: var(--fl-holo); background: color-mix(in srgb, var(--fl-holo) 12%, transparent); }
.more-later { margin: 8px 0 0; font: 11px var(--fl-font-display); color: var(--fl-muted); }

/* the tray: each part with its lab price */
.lesson .tool { height: 82px; align-content: start; }
.lesson .tool img { height: 62px; }
.tool-p { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; font: 11px/1 var(--fl-font-display); color: var(--fl-muted); }
.lesson .tool-n { display: none; }
.tray-g { display: grid; gap: 6px; }
.tray-g > summary { font: 11px var(--fl-font-display); color: var(--fl-muted); cursor: var(--cur-pointer, pointer); padding: 4px 2px; text-transform: uppercase; }
.lesson .tool:disabled .tool-p { color: var(--fl-hazard); }

/* dock: desktop pieces sit in their own corners; phones stack them (below) */
.dock { display: contents; }
.controls { position: absolute; left: var(--pl); bottom: var(--pb); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.controls .btn { min-height: 44px; }
#status { font: var(--fl-small)/1.4 var(--fl-font-display); color: var(--fl-muted); max-width: 240px; }
.gauges { position: absolute; left: calc(var(--pl) + 92px); bottom: calc(var(--pb) + 56px); display: grid; gap: 8px; width: 296px; }
.graph, .cost { padding: 8px 10px; }
.graph-tabs { display: flex; gap: 2px; margin-bottom: 2px; }
.graph-tabs button { min-height: 28px; padding: 0 8px; background: none; border: 0; border-bottom: 2px solid transparent; font: 11px var(--fl-font-display); color: var(--fl-muted); cursor: var(--cur-pointer); }
.graph-tabs button[aria-pressed="true"] { color: var(--fl-text); border-bottom-color: var(--fl-holo); }
.lesson #graph { position: static; inset: auto; display: block; width: 100%; height: 84px; touch-action: auto; }
.graph-n { margin: 2px 0 0; font: 11px var(--fl-font-display); color: var(--fl-muted); }
.cost p { margin: 0; font: var(--fl-small) var(--fl-font-display); color: var(--fl-muted); }
.cost b { font-weight: 400; color: var(--fl-text); }
.cost.over b { color: var(--fl-hazard); }
.meter { height: 6px; margin: 4px 0; background: var(--fl-line); border-radius: var(--fl-radius); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--fl-holo); transition: width .3s var(--fl-ease); }
.cost.over .meter i { background: var(--fl-hazard); }
.cost .fine { font-size: 11px; }
.logstrip { position: absolute; right: var(--pr); bottom: var(--pb); width: min(470px, 40vw); padding: 6px 10px; }
.logstrip header { display: flex; justify-content: space-between; align-items: center; }
.logstrip .btn { font-size: 11px; padding: 4px 8px; min-height: 28px; }
.logstrip ol { list-style: none; margin: 4px 0 0; padding: 0; font: 11px/1.6 var(--fl-font-display); color: var(--fl-muted); min-height: 6.4em; }
.logstrip li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logstrip li.err { color: var(--fl-hazard); }
.logstrip li i { font-style: normal; color: var(--fl-text); }
.logstrip li.err i { color: var(--fl-hazard); }
.logstrip ol:empty::before { content: "Nothing yet. Press Run it."; }

/* selection bar, fail card, hint, replay */
.selbar { position: absolute; left: 50%; top: calc(var(--pt) + 4px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; font: var(--fl-small) var(--fl-font-display); background: var(--fl-surface); border: 1px solid var(--fl-hazard); border-radius: var(--fl-radius); }
.selbar .btn { min-height: 44px; }
.result, .hintcard, .replay { position: absolute; left: 50%; bottom: calc(var(--pb) + 64px); transform: translateX(-50%); width: min(380px, calc(100% - 32px)); padding: 12px 16px; font-size: .8125rem; line-height: 1.45; background: color-mix(in srgb, var(--fl-surface) 94%, transparent); border: 1px solid var(--fl-hazard); border-radius: var(--fl-radius); box-shadow: var(--fl-glow-hazard); }
.hintcard { border-color: var(--fl-holo); box-shadow: var(--fl-glow); bottom: calc(var(--pb) + 190px); }
.replay { border-color: var(--fl-holo); box-shadow: var(--fl-glow); width: min(440px, calc(100% - 32px)); }
.hintcard .k, .replay .k { color: var(--fl-holo); } .result .k { color: var(--fl-hazard); }
.result h3 { margin: 0 0 6px; font-size: 1.0625rem; }
.result p, .hintcard p, .replay p { margin: 0 0 6px; }
.replay-head { display: flex; justify-content: space-between; font: var(--fl-small) var(--fl-font-display); color: var(--fl-holo); }
.replay input[type=range] { width: 100%; min-height: 44px; accent-color: var(--fl-holo); }
.act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.act .btn { min-height: 44px; }
.toast { position: absolute; left: 50%; top: calc(var(--pt) + 64px); transform: translateX(-50%); max-width: min(420px, 90%); padding: 8px 12px; font: var(--fl-small) var(--fl-font-display); background: var(--fl-surface); border: 1px solid var(--fl-holo); border-radius: var(--fl-radius); opacity: 0; pointer-events: none; transition: opacity .25s; }
.toast.on { opacity: 1; }

/* a briefing's own scene fills the screen under the HUD */
.custom { position: absolute; inset: 0; display: grid; place-items: center; padding: 120px 16px; }
.brief { display: grid; gap: 16px; justify-items: center; max-width: 520px; text-align: center; }
.brief-line { font: 1.375rem var(--fl-font-display); }
.brief-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.brief .btn { min-height: 44px; }

/* end dialog: post-mortem, Real thing card, marks */
#end { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; padding: 28px; color: var(--fl-text); background: var(--fl-surface); border: 1px solid var(--fl-hazard); border-radius: var(--fl-radius); box-shadow: var(--fl-glow-hazard); }
#end::backdrop { background: color-mix(in srgb, var(--fl-bg) 75%, transparent); }
#end.area-done { padding-top: 34px; background: repeating-linear-gradient(135deg, var(--fl-hazard) 0 10px, transparent 10px 20px) top / 100% 6px no-repeat, var(--fl-surface); }
#end h2 { margin-bottom: 12px; color: var(--fl-hazard); font-size: var(--fl-h3); }
#end h2::before, #end h2::after { content: none; }
#end form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
#end .choice { display: block; width: 100%; min-height: 44px; margin: 0 0 8px; padding: 10px 12px; text-align: left; background: none; border: 1px solid var(--fl-line); border-radius: var(--fl-radius); color: var(--fl-text); font: .9375rem var(--fl-body, Inter), system-ui, sans-serif; cursor: var(--cur-pointer); }
#end .choice:hover, #end .choice:focus-visible { border-color: var(--fl-holo); outline: none; }
#end .choice[aria-pressed=true] { border-color: var(--fl-holo); background: color-mix(in srgb, var(--fl-holo) 14%, transparent); }
#end .choice.right { border-color: var(--fl-ok); } #end .choice.wrong { border-color: var(--fl-hazard); opacity: .7; }
#end .why { margin: 0 0 8px; color: var(--fl-muted); font-size: .9375rem; }
#end pre { margin: 12px 0 0; padding: 10px 12px; overflow: auto; font: 12px/1.5 var(--fl-font-display); color: var(--fl-holo); background: var(--fl-bg); border: 1px solid var(--fl-line); border-radius: var(--fl-radius); }
#end ul { margin: 0 0 12px; padding-left: 20px; }
#end li { margin-bottom: 6px; }
#end .say { margin: 0 0 16px; padding: 4px 0 4px 12px; border-left: 2px solid var(--fl-hazard); }
#end .say b { display: block; margin-bottom: 4px; font: 400 var(--fl-small) var(--fl-font-display); color: var(--fl-hazard); }
.marks { display: grid; gap: 8px; margin: 0 0 16px; }
.mark-row { display: grid; grid-template-columns: 4.5em 1fr; gap: 4px 12px; align-items: baseline; }
.mark-row b { font: 400 var(--fl-small) var(--fl-font-display); }
.mark-row.ok b { color: var(--fl-ok); } .mark-row.no b { color: var(--fl-muted); }
.mark-row span { font-size: .9375rem; }
.bars { display: grid; gap: 6px; margin: 0 0 16px; font: 11px var(--fl-font-display); color: var(--fl-muted); }
.bar2 { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 8px; align-items: center; }
.bar2 .rail { position: relative; height: 6px; background: var(--fl-line); border-radius: var(--fl-radius); }
.bar2 .rail i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--fl-holo); border-radius: var(--fl-radius); }
.bar2 .rail em { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--fl-hazard); }

/* phones: still full screen, the pieces stack up from the bottom like a game's dock */
/* the screen tour: a dim veil with a hole over one place, and a card beside it */
.tour-veil { position: fixed; inset: 0; z-index: 50; }
.tour-hole { position: fixed; border: 1px solid var(--fl-holo); border-radius: var(--fl-radius); box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--fl-bg) 72%, transparent), var(--fl-glow); transition: all .3s ease; pointer-events: none; }
.tour-card { position: fixed; width: min(320px, calc(100vw - 24px)); padding: 12px 14px; display: grid; gap: 10px; font-size: .8125rem; line-height: 1.45; background: var(--fl-surface); border: 1px solid var(--fl-holo); border-radius: var(--fl-radius); box-shadow: var(--fl-glow); transition: top .3s ease, left .3s ease; }
.tour-card p { margin: 0; display: grid; gap: 4px; }
.tour-card .k { font: var(--fl-small) var(--fl-font-display); font-weight: 400; color: var(--fl-holo); }
.tour-card .act { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }
@media (max-width: 860px) {
  .lesson .hud-title h1 { font-size: 1.0625rem; }
  .top { display: flex; flex-direction: column; gap: 6px; position: absolute; top: calc(var(--pt) + 52px); left: var(--pl); right: var(--pr); }
  .pager { position: static; width: auto; padding: 6px 10px; font-size: .75rem; }
  .pager-g { display: none; }
  .side { position: static; width: auto; max-height: none; }
  .feed { padding: 4px 10px; } .feed .k { display: none; } .feed li:nth-child(n + 2) { display: none; }
  .inspector { position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; max-height: 55%; border-radius: var(--fl-radius) var(--fl-radius) 0 0; background: var(--fl-surface); }
  .dock { display: flex; flex-direction: column; gap: 6px; position: relative; padding: 0 var(--pr) var(--pb) var(--pl); }
  .dock > * { position: relative; left: auto; right: auto; top: auto; bottom: auto; transform: none; width: auto; max-width: none; }
  .selbar { align-self: center; }
  .logstrip ol { min-height: 3.2em; max-height: 3.2em; overflow: hidden; } .logstrip li:nth-child(n + 3):not(:last-child) { display: none; }
  .gauges { grid-template-columns: 1fr 1fr; width: auto; left: auto; }
  .lesson #graph { height: 48px; } .graph-n, .cost .fine { display: none; }
  .controls { flex-wrap: wrap; row-gap: 6px; } .controls .btn { white-space: nowrap; } #status { flex: 1 1 120px; min-width: 0; max-width: none; }  /* a long button (a recorded outage) pushes the rest to a second row */
  .graph-tabs button:not([aria-pressed="true"]) { display: none; }  /* one metric at a time: tap it to see the next */
  .graph-tabs button { min-height: 44px; min-width: 44px; margin: -8px 0; }
  .logstrip .btn { min-height: 44px; }
  .lesson .toolbox { position: relative; top: 0; left: 0; transform: none; flex-direction: row; justify-content: center; align-self: center; margin: 0 0 6px; }
  .result, .hintcard, .replay { border-radius: var(--fl-radius); }
  .custom { padding: 140px 16px 40px; }
}

/* the level stamp on a gate's closing card */
#end .stamp { display: inline-block; margin: 0 0 14px; padding: 8px 18px; border: 3px solid var(--fl-hazard); border-radius: 6px; color: var(--fl-hazard); font: 400 2rem var(--fl-font-display); letter-spacing: .12em; transform: rotate(-4deg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--fl-hazard) 35%, transparent); }
