/* The master navigation and the pressed state (NAV-PROPOSAL.md, option C, chosen 16 Nov 2026).
   Top row: the phases of the production, centred. Second row: the phase's steps on the left, and the page's own view
   tools docked at the right end (a toolbar marked .dock is pinned there, so its DOM and handlers stay where they are).
   One pressed recipe for every key that stays on: dark concave face, the shadow inside, the LED lit. */

/* ── Pressed in ── */
.tabs button.on, .tabs .title, .bar button.on, .binpicks button.on, .seg button.on, .key.on:not(.hot), .btns button.on,
.pb.on, .pb-star.on, .pb-reject.on, .pb-warn.on, .card .acts > button.in, .chip:not([aria-pressed="false"]),
.key[aria-pressed="true"]:not(.primary), .angbtn.on {
  background: var(--key-on-face); box-shadow: var(--key-pressed); transform: translateY(1px); }
.angbtn.on { box-shadow: var(--key-pressed), inset 0 0 0 1px var(--cam-b); }
.heads .tog.on { box-shadow: var(--key-pressed); }  /* keeps its source colour; only the depth changes */
/* a lone toggle shows "on" with an LED too, never by depth alone */
.key.on:not(.led):not(.sq):not(.hot) { padding-left: 19px; }
.key.on:not(.led):not(.sq):not(.hot)::before { content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 6px var(--hot-glow); }
.tabs .title { background: none; box-shadow: none; transform: none; }  /* a panel's name is a label, not a key */

/* ── Trays: a row of choices sits in a recess, the one that's on sits flush in it ── */
.seg, .pviews, .binpicks, .bar .ws, .bar .phases {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px; background: var(--tray-bg); box-shadow: var(--tray); border-radius: calc(var(--r-s) + 3px); }

/* ── The bar: two rows ── */
.app > .bar { display: grid; grid-template-rows: var(--nav-h) var(--steps-h); padding: 0; gap: 0; height: var(--bar-h); }
.barrow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; padding: 0 8px 0 6px; }
.barrow .bl, .barrow .br { display: flex; align-items: center; gap: 12px; min-width: 0; }
.barrow .br { justify-content: flex-end; }
.barrow .bl .proj { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* phases: the master keys, bigger than any tool key, with the LED as a bar under the word */
.bar .phases { border-radius: 9px; }
.bar .phases button { position: relative; height: 32px; padding: 0 16px; border-radius: 6px; font: var(--fw-quiet) var(--fs-m) var(--ui); color: var(--dim);
  background: linear-gradient(var(--key-top), var(--key)); box-shadow: var(--key-shadow); transition: transform var(--t-key) var(--ease), box-shadow var(--t-key) var(--ease), color var(--t-fast); }
.bar .phases button::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 14px; height: 2px; margin-left: -7px; border-radius: 2px; background: var(--led-off); opacity: .5; transition: background var(--led-fade), box-shadow var(--led-fade); }
.bar .phases button:hover:not(:disabled) { color: var(--bright); }
.bar .phases button.on { color: var(--bright); font-weight: var(--fw-on); background: var(--key-on-face); box-shadow: var(--key-pressed); transform: translateY(1px); }
.bar .phases button.on::after { background: var(--hot); opacity: 1; box-shadow: 0 0 6px var(--hot-glow); }
/* a phase still to come looks and works like the others (Steve, 16 Nov): a click presses it for a moment and the Guide
   says what it will be (app.js, help/guide.js). Its LED stays dark because it never lights. */
.bar .phases button.nudge { animation: phase-nudge 320ms var(--ease); }
@keyframes phase-nudge { 0%, 45% { background: var(--key-on-face); box-shadow: var(--key-pressed); transform: translateY(1px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .bar .phases button.nudge { animation: none; } }

/* steps: the phase's workspaces, as ordinary keys in a tray; only the current phase's show */
.steps { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 8px; background: var(--body); border-top: 1px solid var(--groove); box-shadow: inset 0 1px 0 var(--key-hi); }
.bar .ws { margin: 0; }
.bar .ws button { padding: 4px 11px 4px 19px; }
.bar .ws button[data-key]::after { content: attr(data-key); margin-left: 7px; font: var(--fs-xs) var(--mono); color: var(--faint); }
.app[data-at="prep"] .bar .ws [data-in]:not([data-in="prep"]),
.app[data-at="post"] .bar .ws [data-in]:not([data-in="post"]) { display: none; }

/* ── The dock: the page's view tools at the steps row's right end ── */
.app.ws-people #peoplePanel > .tabs.dock, .app.ws-brief #briefPanel > .tabs.dock, .app.ws-log .shotbar.dock:not([hidden]) {
  position: fixed; z-index: 10; top: var(--nav-h);  /* over a maximised panel (9), under dialogs (20) */ right: calc(var(--gutter) + 10px); height: var(--steps-h); max-width: calc(100vw - 300px);
  display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 0; background: none; border: 0; box-shadow: none; overflow: hidden; }
.tabs.dock > .title { display: none; }  /* the step key already names the page */
.tabs.dock .extra { margin-left: 8px; }
.tabs.dock input[type=search] { width: 240px; }
.shotbar.dock .sp { display: none; }
/* nothing in the dock wraps; when the window is narrow the dock scrolls sideways instead of squashing */
.tabs.dock > *, .shotbar.dock > *, .shotbar.dock label { flex: none; white-space: nowrap; }
.app.ws-people #peoplePanel > .tabs.dock, .app.ws-brief #briefPanel > .tabs.dock, .app.ws-log .shotbar.dock:not([hidden]) { overflow-x: auto; scrollbar-width: none; }
.shotbar.dock input[type=search] { flex: 0 1 220px; min-width: 130px; }
.barrow .pill { white-space: nowrap; }

/* When the bar is narrow (a small window, or the Guide open beside it) the top row gives way in steps, so the phases
   never run into the tools: they stay centred while there's room, then the project name truncates, then the brand
   word and the media pill's words go (the LED stays; hover says the rest), then everything tightens. Sized by the
   bar's own width, not the window's. Under 821px the bar stacks instead (below). */
@media (min-width: 821px) {
  .app > .bar { container: cutbar / inline-size; }
  @container cutbar (max-width: 1180px) {
    .barrow { display: flex; min-width: 0; }
    .barrow .bl, .barrow .br { flex: 1 1 0; }
    .barrow .br { min-width: max-content; }
    .barrow .bl > .brand, .barrow .phases, .barrow .br > * { flex: none; }
  }
  @container cutbar (max-width: 1000px) {
    .barrow .brand { font-size: 0; gap: 0; }
    .barrow .pill { font-size: 0; gap: 0; padding: 0 9px; height: 22px; }
  }
  @container cutbar (max-width: 760px) {
    .barrow { gap: 8px; } .barrow .br, .barrow .bl { gap: 6px; }
    .bar .phases button { padding: 0 8px; }
  }
  @container cutbar (max-width: 680px) {  /* the Guide open in a window under ~1000px */
    .bar .phases button { padding: 0 6px; font-size: var(--fs); }
    #layoutBtn, #bodyBtn, #soundBtn { display: none; }  /* layouts are in each panel's tab menu, the body and sound in ⌘K */
  }
}
@media (max-width: 1100px) { .bar .ws button[data-key]::after { display: none; } .bar .phases button { padding: 0 11px; } }
@media (max-width: 820px) {
  .app > .bar { height: auto; grid-template-rows: auto auto; }
  .barrow { grid-template-columns: 1fr; padding: 6px; }
  .barrow .br { justify-content: flex-start; flex-wrap: wrap; }
  .app.ws-people #peoplePanel > .tabs.dock, .app.ws-brief #briefPanel > .tabs.dock, .app.ws-log .shotbar.dock:not([hidden]) { position: static; max-width: none; flex-wrap: wrap; height: auto; padding: 6px 10px; }
  .tabs.dock > .title { display: inline; }
}

/* ── Feel (js/feel.js): the master keys go down fast and come back a little slower, like a sprung key, and their LED
   warms up rather than snapping on. No bounce, no overshoot. .down holds a quick click in long enough to see. ── */
.bar .phases button, .bar .ws button, .btn.primary {
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t-fast), color var(--t-fast); }
.bar .phases button:is(:active, .down):not(:disabled), .bar .ws button:is(:active, .down), .btn.primary:is(:active, .down) {
  transition-duration: var(--t-key); }
.bar .phases button:is(:active, .down):not(:disabled), .bar .ws button:is(:active, .down) {
  background: var(--key-on-face); box-shadow: var(--key-pressed); transform: translateY(2px); }
/* the primary keeps its colour; it sinks, its glow pulls in and its face darkens to the lower half */
.btn.primary:is(:active, .down) { background: linear-gradient(var(--hot-press), var(--hot-press)); transform: translateY(2px);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35), 0 0 0 rgba(0,0,0,0), 0 1px 3px var(--hot-glow); }
/* the LEDs: a bloom as they come on that settles to the steady glow */
.bar .ws button.on::before { animation: led-on 220ms var(--ease) both; }
.bar .phases button.on::after { animation: led-on 220ms var(--ease) both; }
@keyframes led-on {
  0% { background: var(--led-off); opacity: .5; box-shadow: 0 0 0 transparent; }
  55% { background: var(--hot); opacity: 1; box-shadow: 0 0 10px var(--hot-glow); }
  100% { background: var(--hot); opacity: 1; box-shadow: 0 0 6px var(--hot-glow); } }
/* a phase that's on throws a faint wash of its LED onto the key face, as if lit from below */
.bar .phases button.on { background: radial-gradient(60% 60% at 50% 115%, oklch(from var(--hot) l c h / .16), transparent 70%), var(--key-on-face); }

/* Sound: the bar's toggle shows "on" with an LED, like any lone toggle */
#soundBtn { position: relative; }
#soundBtn[aria-pressed="true"]::after { content: ""; position: absolute; right: 1px; top: 1px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--hot); box-shadow: 0 0 6px var(--hot-glow); animation: led-on 220ms var(--ease) both; }
#soundBtn[aria-pressed="false"] { color: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .bar .phases button, .bar .ws button, .btn.primary, .bar .phases button::after, .bar .ws button::before { transition: none !important; }
  .bar .ws button.on::before, .bar .phases button.on::after, #soundBtn::after { animation: none !important; }
}
