/* Sizes and colours come from design/source/Main.dc.html -> renderVals().
   --s, --cs, --ls are the size of one design pixel at the current viewport (SPEC 3.12). */

@font-face { font-family: 'Barlow'; font-weight: 600; font-display: block; src: url(fonts/barlow-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-display: block; src: url(fonts/barlow-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: block; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: block; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'DSEG7C'; font-weight: 700; font-display: block; src: url(fonts/DSEG7Classic-Bold.woff2) format('woff2'); }

:root {
  --s: calc(100dvh / 390);
  --cs: min(var(--s), 1.25px);
  --ls: min(var(--s), 1.6px);

  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --half: round(16 * var(--ls), 1px);
  --r2: round(23 * var(--s), 1px);
  --tc-size: round(min(74 * var(--s), (100vw - 48px) / 9), 1px);
  --pad: round(12 * var(--ls), 1px);
  --lab: round(14 * var(--ls), 1px);
  --prod: round(24 * var(--s), 1px);
  --big: round(52 * var(--s), 1px);
  --small: round(23 * var(--s), 1px);
  --fh: round(56 * var(--cs), 1px);
  --btn: round(150 * var(--cs), 1px);
  --bf: round(20 * var(--cs), 1px);
  --ic: round(28 * var(--cs), 1px);
  --pf: round(16 * var(--cs), 1px);
  --armed-f: round(24 * var(--cs), 1px);
  --fw: round(8 * var(--cs), 1px);
  --stripe: round(20 * var(--ls), 1px);
  --stripe-diag: round(28 * var(--ls), 1px);

  --run: #000 0 9%, #00A651 9% 20%, #FFE600 20% 31%, #0090D8 31% 42%, #E3242B 42% 53%,
         #FFFFFF 53% 64%, #A6A6A6 64% 75%, #555555 75% 86%, #000 86%;
  --armed: #00FF00;
  --armed-text: #000000;
}

:root[data-layout=simple] {
  --half: round(26 * var(--ls), 1px);
  --r2: round(52 * var(--s), 1px);
  --tc-size: round(min(104 * var(--s), (100vw - 48px) / 9), 1px);
}

:root[data-mode=light] { --bg: #FFFFFF; --fg: #111111; --lab-c: #333333; --line: #111111; --tc-c: #C8102E; --ghost: rgba(200,16,46,.05); --bar: #F2F2F2; }
:root[data-mode=dark]  { --bg: #0B0B0B; --fg: #F2F2F2; --lab-c: #CCCCCC; --line: #3A3A3A; --tc-c: #FF3B30; --ghost: rgba(255,59,48,.16); --bar: #161616; }

:root[data-band=colour] {
  --band-top: linear-gradient(45deg, var(--run));
  --band-bot: linear-gradient(135deg, var(--run));
}
:root[data-band=mono] {
  --band-top: repeating-linear-gradient(45deg, #F2F2F2 0 var(--stripe), #0B0B0B var(--stripe) calc(2 * var(--stripe)));
  --band-bot: repeating-linear-gradient(135deg, #F2F2F2 0 var(--stripe), #0B0B0B var(--stripe) calc(2 * var(--stripe)));
}
:root[data-stripes=diagonal][data-band=colour] { --band-top: linear-gradient(120deg, var(--run)); }
:root[data-stripes=diagonal][data-band=mono] {
  --band-top: repeating-linear-gradient(120deg, #F2F2F2 0 var(--stripe-diag), #0B0B0B var(--stripe-diag) calc(2 * var(--stripe-diag)));
}

/* Sync instant: must stay after the band rules above. */
:root[data-state=sync][data-mode=dark]  { --bg: #FFFFFF; --fg: #000000; --lab-c: #333333; --line: #000000; --tc-c: #000000; --ghost: transparent; --bar: #FFFFFF; --band-top: #000000; --band-bot: #000000; }
:root[data-state=sync][data-mode=light] { --bg: #000000; --fg: #FFFFFF; --lab-c: #CCCCCC; --line: #FFFFFF; --tc-c: #FFFFFF; --ghost: transparent; --bar: #000000; --band-top: #FFFFFF; --band-bot: #FFFFFF; }

:root[data-armed-color=red]  { --armed: #E0242B; --armed-text: #FFFFFF; }
:root[data-armed-color=blue] { --armed: #0000FF; --armed-text: #FFFFFF; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { background: #0B0B0B; }
html:not([data-ready]) body { visibility: hidden; }

#slate, #rotate {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Barlow Condensed', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* macOS thickens text otherwise; the designs have the thinner weight. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Slate ---- */

#slate { background: var(--bg); color: var(--fg); }

.band { flex: none; border-bottom: 2px solid var(--line); }
.band .top { height: var(--half); background: var(--band-top); }
.band .bot { height: var(--half); background: var(--band-bot); }
:root[data-stripes=diagonal] #slate .band .top { height: calc(2 * var(--half)); }
:root[data-stripes=diagonal] #slate .band .bot { display: none; }

.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 17fr) minmax(0, 30fr) minmax(0, 34fr) minmax(0, 19fr);
  gap: 2px;
  background: var(--line);
}
:root[data-layout=simple] .grid { grid-template-rows: minmax(0, 20fr) minmax(0, 34fr) minmax(0, 46fr); }

.cell {
  background: var(--bg);
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
/* Only text moves away from the notch (ENTREGA Q1). */
.cell.first { padding-left: max(var(--pad), var(--safe-l)); }
.cell.last { padding-right: max(var(--pad), var(--safe-r)); }
:root[data-layout=simple] .cell.scene { padding-left: max(var(--pad), var(--safe-l)); }
:root[data-layout=simple] .cell.intday { padding-right: max(var(--pad), var(--safe-r)); }

.production { grid-column: span 3; }

.label {
  font-family: Barlow, sans-serif;
  font-weight: 600;
  font-size: var(--lab);
  letter-spacing: .06em;
  color: var(--lab-c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.value {
  font-weight: 600;
  font-size: var(--prod);
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* The clip box must not cut descenders at line-height 1. */
  padding-block: .15em;
  margin-block: -.15em;
}
.big .value { font-size: var(--big); line-height: 1; }
.small .value { font-size: var(--small); }
.r2 .value { font-size: var(--r2); }
/* FPS shrinks to fit instead (ENTREGA Q3). */
.fps .value { text-overflow: clip; }

.tc-cell {
  grid-column: span 4;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tc {
  position: relative;
  font-family: 'DSEG7C', monospace;
  font-weight: 700;
  font-size: var(--tc-size);
  line-height: 1;
  white-space: nowrap;
}
.tc .ghost { position: absolute; left: 0; top: 0; color: var(--ghost); }
.tc .lit { position: relative; color: var(--tc-c); }
/* Tablet and computer: the timecode uses the room it has (DECISIONS D-18). */
@media (min-height: 480px) {
  .tc-cell { container-type: size; }
  .tc { font-size: round(min(85cqh, (100cqw - 48px) / 7.1), 1px); }
}

:root[data-layout=simple] .full-only { display: none; }
:root[data-layout=simple] .tc-cell { order: 2; }
:root[data-layout=simple] .r2 { order: 1; }

.bar {
  flex: none;
  height: calc(var(--fh) + var(--safe-b));
  border-top: 2px solid var(--line);
  background: var(--bar);
  display: grid;
  grid-template-columns: calc(var(--btn) + var(--safe-l)) minmax(0, 1fr) calc(var(--btn) + var(--safe-r));
  align-items: center;
}
.bar button {
  height: 100%;
  padding: 0 0 var(--safe-b);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: var(--bf);
}
/* SPEC 10: press feedback is an instant colour change; none while the buttons ignore taps. */
.bar button:active { background: var(--fg); color: var(--bg); }
:root:is([data-state=firing], [data-state=sync]) .bar button:active { background: transparent; color: var(--fg); }
.bar .settings { border-right: 2px solid var(--line); padding-left: var(--safe-l); }
/* Dividers reach the screen edge; only the content stays above the home indicator. */
.signature { padding-bottom: var(--safe-b); }
.bar .edit { border-left: 2px solid var(--line); padding-right: var(--safe-r); }
.bar svg { width: var(--ic); height: var(--ic); }

.signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.promo { font-family: Barlow, sans-serif; font-weight: 600; font-size: var(--pf); white-space: nowrap; }
.promo.url { color: var(--lab-c); }
/* The second tap registered (DECISIONS D-24). */
:root[data-state=firing] .signature { align-self: stretch; background: var(--armed); }
:root[data-state=firing] .armed-word { color: var(--armed-text); }
.armed-word { display: none; font-weight: 700; font-size: var(--armed-f); letter-spacing: .24em; }
:root[data-state=armed] .armed-word:not(.clap-word) { display: inline; }
/* While firing the word says what comes next (DECISIONS D-26). */
:root[data-state=firing] .clap-word { display: inline; }
:root:is([data-state=armed], [data-state=firing]) .promo { display: none; }

/* Web pages cannot read the screen's corner radius; the side inset is close to it on phones that report one (DECISIONS D-20). */
.armed-frame {
  display: none;
  position: absolute;
  inset: var(--fw);
  border-radius: max(max(var(--safe-l), var(--safe-r)) - var(--fw), 0px);
  /* One shape: the frame and the corners outside the curve, in the frame colour. */
  box-shadow: 0 0 0 100vmax var(--armed);
  pointer-events: none;
}
:root:is([data-state=armed], [data-state=firing]) .armed-frame { display: block; }

/* ---- Portrait (image 18): fixed look whatever the settings say (ENTREGA Q2) ---- */

#rotate {
  --ps: min(100vw / 390, 100dvh / 844, 2px);
  display: none;
  background: #0B0B0B;
  color: #F2F2F2;
}
#rotate .band { border-bottom-color: #3A3A3A; }
#rotate .band .top { height: calc(18 * var(--ps)); background: linear-gradient(45deg, var(--run)); }
#rotate .band .bot { height: calc(18 * var(--ps)); background: linear-gradient(135deg, var(--run)); }
#rotate header { padding-top: max(calc(56 * var(--ps)), env(safe-area-inset-top, 0px)); text-align: center; }
#rotate h1 { margin: 0; font-size: calc(44 * var(--ps)); font-weight: 700; letter-spacing: .02em; }
#rotate .middle { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(36 * var(--ps)); }
#rotate .middle svg { width: calc(260 * var(--ps)); height: calc(200 * var(--ps)); }
#rotate p { margin: 0; font-size: calc(34 * var(--ps)); font-weight: 700; }
#rotate footer {
  flex: none;
  height: calc(64 * var(--ps));
  padding-bottom: var(--safe-b);
  border-top: 2px solid #3A3A3A;
  background: #161616;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  font-family: Barlow, sans-serif;
  font-weight: 600;
  font-size: calc(16 * var(--ps));
}
#rotate footer .url { font-size: calc(15 * var(--ps)); color: #CCCCCC; }

@media (orientation: portrait) {
  #slate { display: none; }
  #rotate { display: flex; }
}

/* ---- Panels (images 07, 11, 12, 13): always dark, sizes from the design sources ---- */

:root { --p: min(100vw / 844, 1.25px, max(100dvh / 390, 1px)); }

.panel, .scrim, .menu-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  color: #F2F2F2;
  font-family: 'Barlow Condensed', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  outline: none;
}
.panel { display: flex; background: #0B0B0B; overflow-y: auto; overscroll-behavior: contain; }
.scrim { display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .7); }
[hidden] { display: none !important; }

.panel-body { flex: none; margin: auto; width: calc(844 * var(--p)); height: calc(390 * var(--p)); display: flex; flex-direction: column; }
#takes .panel-body, .doc-panel .panel-body { height: min(calc(390 * var(--p)), 100dvh); }
@media (max-width: 844px) {
  #edit .panel-body, #settings .panel-body { height: max(calc(390 * var(--p)), 100dvh); }
  #takes .panel-body, .doc-panel .panel-body { height: 100dvh; }
}

.panel button, .scrim button, .menu button { font-family: inherit; color: inherit; padding: 0; }
.panel button:disabled, .stepper button:disabled, .step button:disabled { color: #5A5A5A; }
.panel button:active:not(:disabled), .scrim button:active, .menu button:active { background: #F2F2F2; color: #0B0B0B; }

.panel-head {
  flex: none;
  height: calc(56 * var(--p));
  display: grid;
  grid-template-columns: calc(150 * var(--p) + var(--safe-l)) minmax(0, 1fr) calc(150 * var(--p) + var(--safe-r));
  align-items: center;
  border-bottom: 2px solid #3A3A3A;
  background: #161616;
}
.panel-head h1 { margin: 0; text-align: center; font-size: calc(24 * var(--p)); font-weight: 700; }
.panel-head .done {
  height: calc(56 * var(--p));
  border: 0;
  border-left: 2px solid #3A3A3A;
  background: #F2F2F2;
  color: #0B0B0B;
  font-weight: 700;
  font-size: calc(20 * var(--p));
  padding-right: var(--safe-r);
}
.panel-head .back {
  height: calc(56 * var(--p));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(6 * var(--p));
  border: 0;
  border-right: 2px solid #3A3A3A;
  background: transparent;
  font-weight: 700;
  font-size: calc(20 * var(--p));
  padding-left: var(--safe-l);
}
.panel-head .back svg { width: calc(28 * var(--p)); height: calc(28 * var(--p)); }
.panel-head .count { text-align: center; font-size: calc(18 * var(--p)); font-weight: 600; color: #CCCCCC; padding-right: var(--safe-r); }

/* Edit */
.edit-form {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: calc(12 * var(--p)) calc(16 * var(--p));
  padding: calc(14 * var(--p)) max(calc(20 * var(--p)), var(--safe-r)) calc(14 * var(--p)) max(calc(20 * var(--p)), var(--safe-l));
}
.field {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--p));
  font-family: Barlow, sans-serif;
  font-size: calc(14 * var(--p));
  font-weight: 600;
  letter-spacing: .06em;
  color: #CCCCCC;
}
.field.wide { grid-column: span 3; }
.field input {
  height: calc(50 * var(--p));
  box-sizing: border-box;
  padding: 0 calc(12 * var(--p));
  border: 2px solid #3A3A3A;
  border-radius: 0;
  background: #161616;
  color: #F2F2F2;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: calc(24 * var(--p));
  letter-spacing: 0;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.field input::placeholder { color: #CCCCCC; opacity: 1; }
.field input:focus { border-color: #F2F2F2; }
.stepper {
  height: calc(50 * var(--p));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: calc(50 * var(--p)) minmax(0, 1fr) calc(50 * var(--p));
  border: 2px solid #3A3A3A;
}
.stepper button { border: 0; background: #222222; color: #F2F2F2; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: calc(28 * var(--p)); }
.stepper button:first-child { border-right: 2px solid #3A3A3A; }
.stepper button:last-child { border-left: 2px solid #3A3A3A; }
.stepper input { height: auto; min-width: 0; padding: 0; border: 0; text-align: center; font-size: calc(26 * var(--p)); }
.segments {
  height: calc(50 * var(--p));
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 2px solid #3A3A3A;
}
.segments button { border: 0; background: #161616; color: #F2F2F2; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: calc(22 * var(--p)); letter-spacing: 0; }
.segments button[aria-pressed=true] { background: #F2F2F2; color: #0B0B0B; }

/* Take log */
.takes-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.takes-list table { width: 100%; border-collapse: collapse; font-size: calc(20 * var(--p)); }
.takes-list thead tr {
  height: calc(36 * var(--p));
  background: #161616;
  color: #CCCCCC;
  text-align: left;
  font-family: Barlow, sans-serif;
  font-size: calc(13 * var(--p));
  letter-spacing: .06em;
}
.takes-list th { padding: 0 calc(12 * var(--p)); font-weight: 600; }
.takes-list th.delete-col { width: calc(56 * var(--p)); }
.takes-list tbody tr { height: calc(52 * var(--p)); border-bottom: 1px solid #2A2A2A; }
.takes-list td { padding: 0 calc(12 * var(--p)); font-weight: 600; }
.takes-list th:first-child, .takes-list td:first-child { padding-left: max(calc(12 * var(--p)), var(--safe-l)); }
.takes-list td.muted { color: #CCCCCC; }
.takes-list td.tabular { font-variant-numeric: tabular-nums; }
.takes-list td.delete-cell { padding: 0 max(calc(6 * var(--p)), var(--safe-r)) 0 calc(6 * var(--p)); }
.delete-cell button { width: calc(44 * var(--p)); height: calc(44 * var(--p)); border: 0; background: transparent; color: #CCCCCC; }
.delete-cell svg { width: calc(26 * var(--p)); height: calc(26 * var(--p)); display: inline-block; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.no-takes { flex: 1; display: flex; align-items: center; justify-content: center; font-size: calc(26 * var(--p)); font-weight: 600; color: #CCCCCC; }
.panel-foot {
  flex: none;
  height: calc(56 * var(--p) + var(--safe-b));
  border-top: 2px solid #3A3A3A;
  background: #161616;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.panel-foot button { border: 0; padding-bottom: var(--safe-b); background: transparent; font-weight: 700; font-size: calc(20 * var(--p)); }
.panel-foot button:not(:last-child) { border-right: 2px solid #3A3A3A; }
.panel-foot .export-pdf { padding-left: var(--safe-l); }
.panel-foot .clear-all { color: #FF6B63; padding-right: var(--safe-r); }

/* Clear all dialog */
.dialog { width: calc(420 * var(--p)); background: #161616; border: 2px solid #3A3A3A; display: flex; flex-direction: column; }
.dialog h2 { margin: 0; padding: calc(28 * var(--p)) calc(24 * var(--p)); text-align: center; font-size: calc(28 * var(--p)); font-weight: 700; }
.dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid #3A3A3A; }
.dialog-actions button { height: calc(56 * var(--p)); border: 0; font-weight: 700; font-size: calc(20 * var(--p)); }
.dialog-actions .cancel { border-right: 2px solid #3A3A3A; background: transparent; color: #F2F2F2; }
.dialog-actions .delete-all { background: #E0242B; color: #FFFFFF; }

/* Take-row context menu: NO DESIGN, dialog style of image 13; waits for Daniel at its checkpoint. */
.menu { position: fixed; background: #161616; border: 2px solid #3A3A3A; }
.menu button { display: block; height: calc(56 * var(--p)); padding: 0 calc(24 * var(--p)); border: 0; background: transparent; color: #FF6B63; font-weight: 700; font-size: calc(20 * var(--p)); white-space: nowrap; }

/* Settings (images 08, 09, 10) */
.tabs { flex: none; height: calc(52 * var(--p)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 2px solid #3A3A3A; }
.tabs button { border: 0; border-right: 1px solid #3A3A3A; background: #161616; color: #F2F2F2; font-weight: 700; font-size: calc(21 * var(--p)); }
.tabs button[aria-selected=true] { background: #F2F2F2; color: #0B0B0B; }
.page { flex: 1; min-height: 0; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; background: #3A3A3A; }
.col { min-width: 0; background: #0B0B0B; display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); padding: 0 calc(18 * var(--p)); }
.col:first-child { padding-left: max(calc(18 * var(--p)), var(--safe-l)); }
.col:last-child { padding-right: max(calc(18 * var(--p)), var(--safe-r)); }
.general { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); padding: 0 max(calc(22 * var(--p)), var(--safe-r)) 0 max(calc(22 * var(--p)), var(--safe-l)); }
.row { display: flex; align-items: center; justify-content: space-between; gap: calc(10 * var(--p)); min-width: 0; border-bottom: 1px solid #2A2A2A; }
.page .row:nth-child(3) { border-bottom: 0; }
.section-title { font-size: calc(20 * var(--p)); font-weight: 700; }
.row-label { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; font-size: calc(20 * var(--p)); font-weight: 600; }
.general .row-label { font-size: calc(21 * var(--p)); }
.seg, .step, .wide-button, .row select, .row input[type=range] { flex: none; }
.seg { height: calc(46 * var(--p)); box-sizing: border-box; display: grid; grid-template-columns: repeat(var(--n), calc(var(--w) * var(--p))); border: 2px solid #3A3A3A; }
.seg button { display: flex; align-items: center; justify-content: center; gap: calc(6 * var(--p)); border: 0; background: #161616; color: #F2F2F2; font-weight: 700; font-size: calc(19 * var(--p)); white-space: nowrap; }
.seg.small button { font-size: calc(18 * var(--p)); }
.seg button[aria-pressed=true] { background: #F2F2F2; color: #0B0B0B; }
.seg svg { width: calc(26 * var(--p)); height: calc(26 * var(--p)); }
.swatch { width: calc(18 * var(--p)); height: calc(18 * var(--p)); box-sizing: border-box; border: calc(4 * var(--p)) solid var(--c); outline: 1px solid var(--o); }
.row select {
  height: calc(46 * var(--p));
  width: calc(230 * var(--p));
  padding: 0 calc(10 * var(--p));
  border: 2px solid #3A3A3A;
  border-radius: 0;
  background: #161616;
  color: #F2F2F2;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: calc(20 * var(--p));
}
.general select { width: calc(260 * var(--p)); }
.row input[type=range] { width: calc(230 * var(--p)); height: calc(46 * var(--p)); accent-color: #F2F2F2; }
.step { height: calc(46 * var(--p)); width: calc(230 * var(--p)); box-sizing: border-box; display: grid; grid-template-columns: calc(46 * var(--p)) minmax(0, 1fr) calc(46 * var(--p)); border: 2px solid #3A3A3A; }
.step button { border: 0; background: #222222; color: #F2F2F2; font-weight: 700; font-size: calc(26 * var(--p)); touch-action: none; }
.step button:first-child { border-right: 2px solid #3A3A3A; }
.step button:last-child { border-left: 2px solid #3A3A3A; }
.step-value { display: flex; align-items: center; justify-content: center; background: #161616; font-size: calc(21 * var(--p)); font-weight: 600; }
.wide-button { height: calc(46 * var(--p)); width: calc(230 * var(--p)); border: 2px solid #3A3A3A; background: #222222; color: #F2F2F2; font-weight: 700; font-size: calc(19 * var(--p)); white-space: nowrap; }
.row-end { flex: none; display: flex; align-items: center; gap: calc(12 * var(--p)); }
.row-end button { height: calc(46 * var(--p)); width: calc(124 * var(--p)); box-sizing: border-box; border: 2px solid #3A3A3A; background: #222222; color: #F2F2F2; font-weight: 700; font-size: calc(19 * var(--p)); white-space: nowrap; }
.row-end .open-takes { width: calc(140 * var(--p)); margin-left: calc(2 * var(--p)); }
.count-takes { font-size: calc(19 * var(--p)); font-weight: 600; color: #CCCCCC; }
.version-line { font-family: Barlow, sans-serif; font-size: calc(16 * var(--p)); font-weight: 600; color: #CCCCCC; }

/* Test sync: the inverted slate shows through the Settings panel for its 3 frames. */
:root[data-state=sync] .panel { visibility: hidden; }

/* Help and About: NO DESIGN, panel style; wait for Daniel at their checkpoint. */
.doc { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: calc(16 * var(--p)) max(calc(22 * var(--p)), var(--safe-r)) calc(24 * var(--p)) max(calc(22 * var(--p)), var(--safe-l)); font-size: calc(20 * var(--p)); line-height: 1.35; -webkit-user-select: text; user-select: text; }
.doc h2 { margin: calc(16 * var(--p)) 0 calc(6 * var(--p)); font-size: calc(24 * var(--p)); font-weight: 700; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: calc(16 * var(--p)) 0 calc(6 * var(--p)); font-size: calc(20 * var(--p)); font-weight: 700; }
.doc p { margin: 0 0 calc(8 * var(--p)); font-weight: 600; color: #CCCCCC; }
.doc a { color: #F2F2F2; }
.doc pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: Barlow, sans-serif; font-weight: 600; font-size: calc(13 * var(--p)); line-height: 1.4; color: #CCCCCC; }

@media (orientation: portrait) {
  .panel, .scrim, .menu-layer { display: none !important; }
}
