/* factoscribe · direction B "Rekorder" (see .planning/design/).
   Every color, font, radius, spacing and shadow is a token in :root, so a brand can be swapped in
   at this one place. Components below only use the tokens. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(/fonts/archivo-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(/fonts/archivo-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ================= Tokens ================= */
:root {
  /* type: one family for the interface (Archivo, SIL OFL, self-hosted in /fonts) */
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: var(--font-ui);
  --font-numbers: var(--font-ui);
  --stretch-numbers: 62%;     /* condensed figures for the time */
  --stretch-title: 88%;
  --fs-xs: 12px;     /* times, hints */
  --fs-sm: 13px;     /* labels */
  --fs-ui: 15px;     /* interface */
  --fs-text: 17px;   /* transcript */
  --fs-title: 22px;  /* titles */
  --fs-h1: 30px;
  --fs-timer: 88px;  /* the big time */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 600;
  --lh-ui: 1.45;
  --lh-text: 1.5;

  /* spacing: one scale, nothing else */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* sizes */
  --h-control: 40px;      /* buttons and fields, desktop */
  --h-control-sm: 32px;   /* inside text rows and toolbars */
  --h-touch: 48px;        /* phone */
  --h-tap-min: 44px;

  /* radii */
  --r-button: 999px;
  --r-field: 12px;
  --r-card: 14px;
  --r-sheet: 24px;
  --r-tile: 18px;
  --r-small: 6px;

  /* light surfaces */
  --c-body: #e9e8e4;
  --c-panel: #ffffff;
  --c-sunk: #f6f5f1;
  --c-seg: #dcdbd6;
  --c-ink: #1c1d20;
  --c-ink-on: #ffffff;
  --c-mute: #6c6e73;
  --c-faint: #a3a4a8;
  --c-line: #d9d8d3;
  --c-line-soft: #efeeea;
  --c-wave: #c6c5c0;

  /* the dark deck */
  --c-deck: #232529;
  --c-deck-2: #2f3237;
  --c-deck-3: #3b3f45;
  --c-deck-text: #ecebe7;
  --c-deck-mute: #8f9299;

  /* meaning: red is recording and nothing else; amber is a warning or a problem */
  --c-rec: #e5482d;
  --c-rec-dim: #84301f;
  --c-amber: #e8a33d;
  --c-amber-ink: #8a5a0c;
  --c-amber-soft: #fbf1dc;
  --c-amber-tint: rgba(232, 163, 61, .16);
  --c-ok: #7c8a5c;
  --c-accent: #3b62c4;          /* selection and focus */
  --c-accent-soft: #e7ecf8;
  --c-del-bg: #fbe1db;
  --c-del-ink: #8a2414;
  --c-ins-bg: #e2efd9;
  --c-ins-ink: #2c5a22;
  --c-note: #fbf1dc;            /* comments */
  --c-scrim: rgba(28, 29, 32, .5);

  /* speakers: six fixed tones, the same person keeps one color everywhere */
  --spk-1: #3d5a99;
  --spk-2: #c2703d;
  --spk-3: #6b7a2a;
  --spk-4: #7a5aa6;
  --spk-5: #4d6a78;
  --spk-6: #8c5a3c;

  /* depth */
  --sh-pop: 0 2px 6px rgba(28, 29, 32, .08), 0 20px 48px rgba(28, 29, 32, .2);
  --sh-bar: 0 -4px 16px rgba(0, 0, 0, .06);
  --sh-seg: 0 1px 2px rgba(0, 0, 0, .08);
  --focus-ring: 0 0 0 3px rgba(59, 98, 196, .35);

  /* motion */
  --t-fast: 150ms;
  --t-med: 200ms;
}

/* ================= Base ================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-body); color: var(--c-ink);
  font: var(--fw-regular) var(--fs-ui)/var(--lh-ui) var(--font-ui);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-weight: var(--fw-bold); margin: 0; }
h2 { font-size: var(--fs-ui); }
h3 { font-size: var(--fs-ui); }
.h1 { font-size: var(--fs-h1); line-height: 1.1; font-stretch: var(--stretch-title); }
code { font-size: .9em; background: var(--c-sunk); padding: .1em .35em; border-radius: var(--r-small); }
.muted { color: var(--c-mute); }
.num, .elapsed, time { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.row { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); flex-wrap: wrap; }
.ok { color: var(--c-ok); }
.warn { color: var(--c-amber-ink); }
.err { color: var(--c-amber-ink); font-weight: var(--fw-medium); }
.fail { color: var(--c-rec); font-weight: var(--fw-bold); }
.i { flex: none; display: block; }
.card { background: var(--c-panel); border-radius: var(--r-card); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-4); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bar-small { font-size: var(--fs-sm); }

/* ================= Buttons: one system ================= */
button, .btn, .button-link, .small-button {
  font: inherit; color: var(--c-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--h-control); padding: 0 var(--sp-4);
  border: 1px solid var(--c-line); border-radius: var(--r-button); background: var(--c-panel);
  font-weight: var(--fw-medium); white-space: nowrap; text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}
@media (hover: hover) { button:hover:not(:disabled), .btn:hover { border-color: #c4c3bd; } }
button:disabled { opacity: .45; cursor: default; }
.small, button.small { min-height: var(--h-control-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn.primary, button.primary, .nb-save { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-ink-on); }
.btn.quiet, button.quiet { background: transparent; border-color: transparent; color: var(--c-mute); }
@media (hover: hover) { .btn.quiet:hover { color: var(--c-ink); border-color: transparent; background: rgba(0, 0, 0, .04); } }
.btn.sq { width: var(--h-control); padding: 0; }
.btn.lg { min-height: var(--h-touch); font-size: 16px; }
.btn.lg.sq { width: var(--h-touch); }
.rec, .btn.rec { background: var(--c-rec); border-color: var(--c-rec); color: #fff; font-weight: var(--fw-bold); }
.rec:hover, .btn.rec:hover { border-color: var(--c-rec); filter: brightness(1.05); }
.stop, .btn.stop { background: var(--c-panel); border-color: var(--c-rec); color: var(--c-rec); font-weight: var(--fw-bold); }
.stop.confirm { background: var(--c-rec); color: #fff; }

/* ================= Form controls: one style ================= */
input, select, textarea {
  font: inherit; color: var(--c-ink); min-height: var(--h-control); padding: 0 var(--sp-3);
  border: 1px solid var(--c-line); border-radius: var(--r-field); background: var(--c-panel);
  min-width: 0;
}
textarea { padding: var(--sp-2) var(--sp-3); line-height: var(--lh-ui); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: var(--focus-ring); }
input::placeholder, textarea::placeholder { color: var(--c-faint); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236c6e73' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=search] { -webkit-appearance: none; appearance: none; }
/* multiple choice: a check box */
input[type=checkbox]:not([role=switch]) {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0;
  border: 1.5px solid var(--c-faint); border-radius: 5px; background: var(--c-panel); display: inline-grid; place-items: center; cursor: pointer; flex: none;
}
input[type=checkbox]:not([role=switch]):checked {
  background: var(--c-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center no-repeat;
  border-color: var(--c-ink);
}
input[type=checkbox]:disabled { opacity: .45; cursor: default; }
/* on/off: a switch */
.switch { display: flex; gap: var(--sp-3); align-items: center; min-height: var(--h-control); cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { flex: none; width: 46px; height: 28px; border-radius: 14px; background: #c9c8c3; position: relative; transition: background var(--t-fast); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left var(--t-fast); }
.switch input:checked + .switch-track { background: var(--c-ink); }
.switch input:checked + .switch-track::after { left: 21px; }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus-ring); }
.switch.disabled { opacity: .5; cursor: default; }
.switch-text { display: flex; flex-direction: column; }
.switch-text small { font-size: var(--fs-xs); color: var(--c-mute); }
/* sliders (zoom): same calm style */
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; border: 0; padding: 0; min-height: var(--h-control-sm); box-shadow: none; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--c-line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--c-ink); margin-top: -6px; border: 0; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--c-line); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--c-ink); border: 0; }
/* segmented control */
.seg { display: inline-flex; background: var(--c-seg); border-radius: var(--r-button); padding: 3px; gap: 0; flex: none; }
.seg button { min-height: var(--h-control-sm); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-button); background: transparent; color: var(--c-mute); font-size: 14px; }
.seg button.on, .seg button[aria-pressed=true] { background: var(--c-panel); color: var(--c-ink); box-shadow: var(--sh-seg); }
.seg button:disabled { text-decoration: line-through; opacity: 1; color: var(--c-faint); }

/* ================= Small parts: avatars, dots, meters ================= */
.av {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  font: var(--fw-bold) var(--fs-xs)/1 var(--font-ui); color: #fff; background: var(--c, var(--c-deck-mute));
}
.av.un { background: transparent; color: var(--c); box-shadow: inset 0 0 0 1.5px var(--c); }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.av.xs { width: 22px; height: 22px; font-size: 9px; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-rec); flex: none; display: inline-block; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--c-ok); display: inline-block; }
.dot.warn, .dot.err { background: var(--c-amber); }
.dot.fail { background: var(--c-rec); }
.segm { display: inline-flex; gap: 2px; flex: none; }
.segm i { width: 5px; height: 12px; border-radius: 1.5px; background: var(--c-line); }
.segm i.on { background: var(--c-ink); }
.segm i.hot { background: var(--c-amber); }
.dark .segm i, .segm.dark i { background: var(--c-deck-3); }
.dark .segm i.on, .segm.dark i.on { background: var(--c-amber); }
.dark .segm i.hot, .segm.dark i.hot { background: var(--c-rec); }
.chip-src { font-size: var(--fs-xs); color: var(--c-mute); border: 1px solid var(--c-line); border-radius: var(--r-small); padding: 0 6px; line-height: 18px; white-space: nowrap; }
.badge-warn { background: var(--c-amber); color: var(--c-ink); border-radius: 4px; padding: 1px 6px; font-weight: var(--fw-bold); font-size: var(--fs-xs); }
.badge-fail { background: var(--c-rec); color: #fff; border-radius: 4px; padding: 1px 6px; font-weight: var(--fw-bold); font-size: var(--fs-xs); }

/* ================= App chrome ================= */
.top { display: flex; gap: var(--sp-4); align-items: center; padding: 0 var(--sp-5); height: 64px; }
.brand { font-weight: var(--fw-bold); color: var(--c-mute); text-decoration: none; font-size: var(--fs-ui); }
.top-logout, .top-voices, .top-connections { color: var(--c-mute); }
main { max-width: 1120px; margin: 0 auto; padding: var(--sp-4) var(--sp-5) 120px; }
body.in-session .top { display: none; }

.s-header-inner { max-width: 1120px; margin: 0 auto; padding: var(--sp-4) var(--sp-5) 0; }
.s-title-row { display: flex; gap: var(--sp-2); align-items: center; }
.s-title-row .back { color: var(--c-mute); }
.s-name-wrap { flex: 1; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--c-faint); cursor: text; }
.s-name { flex: 1; min-width: 0; font-size: var(--fs-title); font-weight: var(--fw-bold); border: 1px solid transparent; background: transparent; padding: 0 var(--sp-2); margin-left: calc(-1 * var(--sp-2)); }
.s-name:hover { border-color: var(--c-line); }
.s-name:focus { background: var(--c-panel); }
.s-name:focus + .pen { visibility: hidden; }
.tabs { display: flex; gap: var(--sp-1); margin-top: var(--sp-3); }
.tabs a { min-height: 36px; padding: 0 var(--sp-4); border-radius: 18px; display: flex; align-items: center; font-weight: var(--fw-medium); color: var(--c-mute); text-decoration: none; }
.tabs a:hover { color: var(--c-ink); }
.tabs a.on { background: var(--c-ink); color: var(--c-ink-on); }

/* ================= Menus, sheets, notices ================= */
.panel { z-index: 70; background: var(--c-panel); color: var(--c-ink); }
.panel.pop { position: absolute; min-width: 280px; max-width: min(360px, calc(100vw - 16px)); border-radius: 18px; box-shadow: var(--sh-pop); padding: var(--sp-2); animation: pop-in var(--t-fast) ease-out; }
.panel.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 10px var(--sp-4) calc(var(--sp-5) + env(safe-area-inset-bottom)); animation: sheet-up var(--t-med) ease-out; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--c-line); margin: 0 auto var(--sp-3); }
.panel-head { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-1) var(--sp-2) var(--sp-3); font-size: 16px; }
.panel-head strong { flex: 1; }
.scrim { position: fixed; inset: 0; z-index: 65; background: var(--c-scrim); animation: fade-in var(--t-med); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .4; } }
@keyframes fade-in { from { opacity: 0; } }
.menu { display: grid; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; padding: var(--sp-2) var(--sp-3); border: 0; border-radius: 10px; background: transparent; text-align: left; justify-content: flex-start; font-weight: var(--fw-medium); color: var(--c-ink); text-decoration: none; white-space: normal; width: 100%; }
.menu-item:hover { background: var(--c-sunk); }
.menu-item .i { color: var(--c-mute); }
.menu-item span { display: flex; flex-direction: column; min-width: 0; }
.menu-item small { font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--c-mute); overflow-wrap: anywhere; }
.menu-item.danger { color: var(--c-ink); }
.menu-group { font-size: var(--fs-sm); color: var(--c-mute); padding: var(--sp-2) var(--sp-3) 0; }
.menu-body { padding: 0 var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--c-line-soft); margin-bottom: var(--sp-1); }
.menu-body .s-ai { display: grid; gap: var(--sp-1); margin: 0; }
.menu-body select { width: 100%; }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 90; display: flex; gap: var(--sp-2); align-items: center; background: var(--c-ink); color: var(--c-ink-on); border-radius: var(--r-button); padding: var(--sp-2) var(--sp-4); font-weight: var(--fw-medium); font-size: 14px; box-shadow: var(--sh-pop); transition: opacity var(--t-med); white-space: nowrap; }
.toast.warn .i { color: var(--c-amber); }
.toast.gone { opacity: 0; }

/* ================= Session list ================= */
.list-head { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-2) 0 var(--sp-5); }
.new-session { min-height: var(--h-touch); padding: 0 var(--sp-5); }
.sessions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--sp-4); }
.session-item { position: relative; background: var(--c-panel); border-radius: var(--r-card); }
.session-face { position: relative; background: var(--c-panel); border-radius: var(--r-card); }
.swipe-actions { display: none; }
.session-face > a { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-1) var(--sp-4); align-items: center; padding: var(--sp-4) 56px var(--sp-4) var(--sp-5); text-decoration: none; color: inherit; border-radius: var(--r-card); min-height: 88px; }
.session-face > a:hover { box-shadow: 0 0 0 1px var(--c-line); }
.sessions .title { font-weight: var(--fw-bold); font-size: 17px; overflow-wrap: anywhere; }
.sessions .when { grid-column: 1; font-size: var(--fs-sm); color: var(--c-mute); display: flex; gap: var(--sp-2); align-items: center; }
.sessions .dauer { grid-column: 2; grid-row: 1 / span 2; font: var(--fw-medium) 26px/1 var(--font-numbers); font-stretch: var(--stretch-numbers); font-variant-numeric: tabular-nums; }
.sessions .count { grid-column: 1; font-size: var(--fs-xs); color: var(--c-faint); }
.sessions .live-label { color: var(--c-rec); font-weight: var(--fw-bold); }
.session-more { position: absolute; top: var(--sp-2); right: var(--sp-2); }
/* mouse devices: the ⋯ shows on hover and keyboard focus; touch devices wider than the phone keep it visible */
@media (hover: hover) and (pointer: fine) {
  .session-more { opacity: 0; transition: opacity .12s; }
  .session-item:hover .session-more, .session-item:focus-within .session-more, .session-more[aria-expanded="true"] { opacity: 1; }
}
.empty { color: var(--c-ink); text-align: center; margin-top: var(--sp-7); }
.empty p { margin: var(--sp-1) 0; }

/* ================= Setup (desktop rows) ================= */
.setup h2 { font-size: var(--fs-ui); }
.setup-head { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--sp-2); }
.device-name-label { display: inline-flex; gap: var(--sp-1); align-items: center; color: var(--c-mute); font-size: var(--fs-sm); margin-left: auto; }
.device-name { width: 9em; min-height: var(--h-control-sm); border-color: transparent; background: transparent; text-align: right; color: var(--c-mute); }
.device-name:hover { border-color: var(--c-line); }
.setup-hint p { margin: var(--sp-1) 0 var(--sp-3); font-size: var(--fs-sm); max-width: 80ch; }
.setup-hint > summary { cursor: pointer; color: var(--c-mute); font-size: var(--fs-sm); }
.channel { padding: var(--sp-3) 0; border-top: 1px solid var(--c-line-soft); }
.ch-grid { display: grid; grid-template-columns: minmax(9em, 1.1fr) minmax(8em, 1fr) minmax(10em, 2.6fr) minmax(11em, 1.2fr); gap: var(--sp-2); align-items: center; }
.ch-grid input:not([type=checkbox]) { min-width: 0; width: 100%; }
.ch-name { font-weight: var(--fw-bold); }
.ch-small { font-size: var(--fs-xs); font-weight: var(--fw-regular); }
.ch-right { display: flex; gap: var(--sp-2); align-items: center; justify-content: flex-end; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-right.info { justify-content: flex-start; }
.ch-right.err, .ch-right.warn { color: var(--c-amber-ink); }
.ch-right.fail { color: var(--c-rec); }
.ch-device { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-2); font-size: var(--fs-sm); flex-wrap: wrap; }
.ch-device select { max-width: 24em; }
.ch-device .track-info { font-size: var(--fs-sm); }
.channel label.diarize { display: inline-flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); white-space: nowrap; }
.setup-more { display: flex; gap: var(--sp-3); align-items: flex-start; flex-wrap: wrap; margin-top: var(--sp-3); }
.setup-more .add-row { flex: none; }
.s-terms { flex: 1 1 100%; }
.s-terms > summary { cursor: pointer; color: var(--c-mute); list-style: none; display: flex; align-items: center; gap: var(--sp-2); min-height: var(--h-control); }
.s-terms > summary::-webkit-details-marker { display: none; }
.s-terms[open] > summary .chev { transform: rotate(90deg); }
.s-terms .terms { padding: var(--sp-2) 0 0; margin: 0; background: transparent; }
.s-ai { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-top: var(--sp-3); }
.s-ai .ai-label { font-size: var(--fs-sm); color: var(--c-mute); }
.setup-actions { margin-top: var(--sp-4); }
canvas.wave { display: block; width: 100%; height: 32px; background: var(--c-sunk); border-radius: var(--r-small); }
.ch-live canvas.wave { height: 26px; }
.e-check { display: inline-flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); white-space: nowrap; cursor: pointer; }

/* ================= Setup grouped by input (phone) ================= */
.inputs { display: grid; gap: var(--sp-3); }
.rcv { background: var(--c-panel); border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--c-line-soft); }
.rcv-head { padding: var(--sp-3) var(--sp-4); display: grid; grid-template-columns: 1fr auto; gap: 2px var(--sp-3); align-items: center; }
.rcv-head .rcv-name { font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.rcv-head .rcv-sub { font-size: var(--fs-sm); color: var(--c-mute); }
.rcv-head .rcv-sub.warn { color: var(--c-amber-ink); }
.rcv-meters { grid-column: 2; grid-row: 1 / span 2; display: grid; gap: var(--sp-1); justify-items: end; }
.lr { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-xs); color: var(--c-mute); }
.chn { border-top: 1px solid var(--c-line-soft); }
.chn > .c1 { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-4); width: 100%; border: 0; border-radius: 0; background: transparent; justify-content: flex-start; font-weight: var(--fw-regular); text-align: left; }
.chn .trk { width: 52px; font-size: var(--fs-sm); color: var(--c-mute); flex: none; }
.chn .c1 b { font-weight: var(--fw-bold); }
.chn .c1 .p { color: var(--c-mute); font-size: 14px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chn.open { background: #faf9f6; }
.chn .c-body { padding: 0 var(--sp-4) var(--sp-4); display: grid; gap: var(--sp-2); }
.chn .fl { font-size: var(--fs-sm); color: var(--c-mute); margin-top: var(--sp-2); }
.chn .seg { display: flex; width: 100%; }
.chn .seg button { flex: 1; min-height: var(--h-control); }
.chn .hint { font-size: var(--fs-sm); color: var(--c-mute); }
.chn .two2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.chn .two2 > div { display: grid; gap: var(--sp-1); min-width: 0; }
.chn .c-actions { display: flex; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-2); }
.chn .sw-row { padding: 0 var(--sp-4); border-top: 1px solid var(--c-line-soft); }
.new-tag { font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--c-ink); color: #fff; border-radius: 4px; padding: 1px 6px; }

/* ================= Summary ================= */
.summary { padding: var(--sp-3) var(--sp-5); }
.summary p { margin: 0 0 var(--sp-2); }
.summary-details summary { cursor: pointer; color: var(--c-mute); }
.summary-details table { margin-top: var(--sp-2); font-size: var(--fs-sm); border-collapse: collapse; }
.summary-details { overflow-x: auto; }
.summary td { padding: 2px var(--sp-4) 2px 0; vertical-align: top; }

/* ================= Transcript filter and the section band ================= */
.tl-filter { margin: var(--sp-2) 0 var(--sp-3); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
.tl-filter > * { min-width: 0; }
.pm-warn { font-size: var(--fs-sm); color: var(--c-amber); margin: -4px 0 var(--sp-1) 18px; overflow-wrap: anywhere; }
.pm-warn:empty { display: none; }
.pm-warn.fail { color: var(--c-rec); }
.kinds { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.kinds .who { display: flex; align-items: center; gap: var(--sp-1); }
.who-btn { display: inline-flex; padding: 0; border: 0; background: transparent; min-height: 0; border-radius: 50%; }
.who-btn .av { box-shadow: 0 0 0 2px var(--c-body); }
.who-btn .av.un { box-shadow: inset 0 0 0 1.5px var(--c), 0 0 0 2px var(--c-body); background: var(--c-body); }
.who-btn[aria-pressed=true] .av { box-shadow: 0 0 0 2px var(--c-body), 0 0 0 4px var(--c-ink); }
.kinds.dimmed .who-btn[aria-pressed=false] .av { opacity: .4; }
.kinds .cnt { margin-left: auto; font-size: var(--fs-sm); color: var(--c-mute); }
.tl-search { width: 220px; }
.f-section { display: grid; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); }
.f-section h4 { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); color: var(--c-mute); font-weight: var(--fw-medium); }
.fr { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: 0 var(--sp-2); border: 0; background: transparent; border-radius: 8px; width: 100%; justify-content: flex-start; font-weight: var(--fw-regular); }
.fr:hover { background: var(--c-sunk); }
.fr.sub { padding-left: 40px; font-size: 14px; }
.fr .n { margin-left: auto; font-size: var(--fs-xs); color: var(--c-faint); }
.fr.on { font-weight: var(--fw-bold); }
.fr .radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--c-faint); flex: none; }
.fr.on .radio { border: 5px solid var(--c-ink); }

.band { background: var(--c-panel); border-radius: var(--r-card); padding: var(--sp-2) var(--sp-3); position: relative; user-select: none; touch-action: pan-y; }
.band-strip { position: relative; height: 32px; cursor: pointer; }
.band-strip canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.band-head { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--c-rec); pointer-events: none; }
.band-head.paused { background: var(--c-ink); }
.band-head b { position: absolute; top: -2px; right: 6px; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--c-rec); white-space: nowrap; }
.band-head.paused b { color: var(--c-ink); }
.band-head.left b { right: auto; left: 6px; }
.band-secs { display: flex; gap: var(--sp-1); margin-top: 6px; }
.band-secs button { display: block; text-align: left; text-overflow: ellipsis; white-space: nowrap; line-height: 24px; min-height: 24px; height: 24px; border-radius: var(--r-small); background: var(--c-body); border: 0; padding: 0 6px; font-size: var(--fs-xs); color: var(--c-mute); font-weight: var(--fw-medium); overflow: hidden; justify-content: flex-start; min-width: 24px; text-overflow: clip; font-variant-numeric: tabular-nums; }
.band-secs button.on { background: var(--c-ink); color: var(--c-ink-on); }
.band-secs button.live { background: var(--c-panel); box-shadow: inset 0 0 0 1px var(--c-line); }
.band-secs button.live.on { background: var(--c-ink); }

/* ================= Transcript ================= */
.timeline { list-style: none; padding: var(--sp-1) var(--sp-5); margin: 0; background: var(--c-panel); border-radius: var(--r-card); }
.timeline:empty { display: none; }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-line-soft); }
.timeline li:last-child { border-bottom: 0; }
.t-head { display: flex; gap: var(--sp-2); align-items: baseline; flex-wrap: wrap; font-size: 14px; min-width: 0; }
.t-head .source { font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.t-head .source.un { color: var(--c-mute); font-weight: var(--fw-medium); }
.t-head .chip-src { align-self: center; }
.t-head time { color: var(--c-faint); font-size: var(--fs-xs); }
.t-head .kind { font-size: var(--fs-xs); color: var(--c-mute); }
.timeline .content { display: block; margin-top: 2px; font-size: 16px; line-height: var(--lh-text); max-width: 72ch; min-width: 0; overflow-wrap: anywhere; font-family: var(--font-text); }
.timeline li.kommentar .content { background: var(--c-note); display: inline-block; padding: 6px var(--sp-3); border-radius: 4px var(--sp-3) var(--sp-3) var(--sp-3); margin-top: var(--sp-1); white-space: pre-wrap; cursor: pointer; }
.timeline li.foto img { max-width: min(320px, 100%); max-height: 240px; border-radius: 10px; display: block; margin-top: 6px; }
.timeline li.marker { grid-template-columns: 1fr; color: var(--c-faint); font-size: var(--fs-xs); text-align: center; padding: var(--sp-2) 0; }
.timeline li.marker.zuordnung { color: var(--c-mute); }
.timeline .source.nameable { cursor: pointer; }
.timeline .source.nameable:hover, .timeline .source.nameable:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.timeline .av-btn { cursor: pointer; }
.timeline li .jump { visibility: hidden; border: 0; background: none; color: var(--c-mute); min-height: 0; padding: 0 var(--sp-1); }
.timeline li:hover .jump, .timeline li:focus-within .jump { visibility: visible; }
.timeline li.highlight { background: var(--c-amber-soft); transition: background 1.5s; margin: 0 calc(-1 * var(--sp-3)); padding-left: var(--sp-3); padding-right: var(--sp-3); border-radius: 10px; }
.timeline li.more { display: flex; justify-content: center; padding: var(--sp-4) 0; grid-template-columns: none; }
.timeline li.paused { display: flex; align-items: center; gap: var(--sp-3); justify-content: space-between; flex-wrap: nowrap; position: sticky; top: var(--sticky-top, 0px); box-shadow: 0 4px 12px rgba(0, 0, 0, .06); z-index: 2; background: var(--c-sunk); border-radius: 10px; padding: var(--sp-2) var(--sp-3); margin: var(--sp-2) calc(-1 * var(--sp-3)); font-size: 14px; color: var(--c-ink); border-bottom: 0; }
/* duplicates: hidden in place with a way to show them, or shown muted */
.timeline li.dupn { display: block; padding: 6px 0 6px 44px; font-size: var(--fs-xs); color: var(--c-faint); }
.timeline li.dupn button { min-height: 0; border: 0; background: none; padding: 0 var(--sp-2); font-size: var(--fs-xs); color: var(--c-mute); font-weight: var(--fw-bold); }
.timeline li.duplicate { background: var(--c-sunk); margin: var(--sp-1) calc(-1 * var(--sp-3)); padding: 10px var(--sp-3); border-radius: 10px; border-bottom: 0; }
.timeline li.duplicate .av { opacity: .45; }
.timeline li.duplicate .content { color: var(--c-faint); font-size: var(--fs-ui); }
.timeline li.duplicate .source { color: var(--c-mute); font-weight: var(--fw-medium); }
.dup-why { font-size: var(--fs-xs); color: var(--c-mute); }
.nodup { margin-left: auto; min-height: 24px; padding: 0 10px; font-size: var(--fs-xs); font-weight: var(--fw-bold); }
body.stream-down #tl-count::after { content: " · Live-Verbindung unterbrochen, verbinde neu …"; color: var(--c-amber-ink); font-weight: var(--fw-medium); }

/* ================= Recording bar (desktop player bar) ================= */
body.with-bar main { padding-bottom: 140px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--c-deck); color: var(--c-deck-text); padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + env(safe-area-inset-bottom)); }
.bar-row { display: flex; gap: var(--sp-4); align-items: center; max-width: 1400px; margin: 0 auto; }
.bar-state { display: flex; gap: var(--sp-2); align-items: center; white-space: nowrap; border: 0; background: transparent; color: inherit; padding: 0; min-height: var(--h-control); cursor: default; font-weight: var(--fw-regular); }
.bar-state strong { font-weight: var(--fw-medium); }
.bar-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-deck-3); }
.bar.running .bar-dot { background: var(--c-rec); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.bar .elapsed { font: var(--fw-medium) 26px/1 var(--font-numbers); font-stretch: var(--stretch-numbers); }
.bar .bar-small, .bar .muted { color: var(--c-deck-mute); }
.bar-up, .bar-mic { display: none; }
.bar-channels { flex: 1; display: flex; gap: var(--sp-4); overflow: hidden; min-width: 0; }
.bar-channel { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); white-space: nowrap; }
.bar-channel.err, .bar-channel.warn { color: var(--c-amber); }
.bar-channel.fail { color: var(--c-rec); }
.bar-input { display: flex; gap: var(--sp-2); align-items: center; }
.bar .act { min-height: var(--h-control); padding: 0 var(--sp-3); border-radius: var(--r-button); background: var(--c-deck-2); border: 1px solid var(--c-deck-2); color: var(--c-deck-text); display: inline-flex; gap: var(--sp-2); align-items: center; cursor: pointer; font-weight: var(--fw-medium); }
.bar .act:hover { border-color: var(--c-deck-3); }
.photo-status { color: var(--c-deck-mute); }
.photo-status:empty { display: none; }
.comment-form { display: flex; gap: var(--sp-1); margin: 0; }
.bar #comment-input { width: 18em; background: var(--c-deck-2); border-color: var(--c-deck-2); color: var(--c-deck-text); }
.bar #comment-input::placeholder { color: var(--c-deck-mute); }
.bar .send { background: var(--c-deck-2); border-color: var(--c-deck-2); color: var(--c-deck-text); }
.bar .stop { background: transparent; }
.bar .warnings { max-width: 1400px; margin: 0 auto var(--sp-2); }
/* Desktop bar: the stop button must always stay visible. The comment field gives way first,
   then the button labels and the chunk count disappear on narrower windows. */
.bar-input { min-width: 0; flex: 0 1 auto; }
.bar-input .comment-form { flex: 1 1 auto; min-width: 7em; }
.bar #comment-input { width: 18em; min-width: 0; flex: 1 1 auto; }
.bar #stop, .bar .hold-wrap, .bar .send { flex-shrink: 0; }
.bar-state { flex-shrink: 0; }
@media (min-width: 701px) and (max-width: 1380px) {
  .bar .act-label { display: none; }
  .bar #chunk-count { display: none; }
  .bar #comment-input { width: 12em; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  .bar-channels { display: none; }
}
/* The combined level next to the time is for narrow bars only; wide bars show each mic. */
@media (min-width: 1001px) {
  .bar-state .segm { display: none; }
}
.warnings:empty { display: none; }
.warnings > div { display: flex; gap: var(--sp-2); align-items: center; color: var(--c-amber); font-size: 14px; }
.warnings > div.fail { color: var(--c-rec); }
.hold-wrap { position: relative; display: inline-flex; }

/* ================= Hold-to-stop button ================= */
.big-stop { width: 68px; height: 68px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: var(--c-rec); color: #fff; position: relative; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.big-stop .i { position: relative; z-index: 1; }
.hold-ring { position: absolute; inset: -10px; pointer-events: none; }
.hold-ring svg { width: 100%; height: 100%; display: block; }
.hold-ring .ring-bg { stroke: transparent; stroke-width: 4; }
.hold-ring .ring-fg { stroke: var(--c-deck-text); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset var(--t-fast) ease-out; }
.big-stop.holding .ring-bg { stroke: var(--c-deck-3); }
.big-stop.holding .ring-fg { stroke-dashoffset: 0; transition: stroke-dashoffset 1000ms linear; }
.hold-tip { position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%); background: var(--c-deck-text); color: var(--c-deck); border-radius: 10px; padding: var(--sp-2) 14px; font-size: var(--fs-sm); font-weight: var(--fw-bold); white-space: nowrap; z-index: 5; box-shadow: var(--sh-pop); animation: pop-in var(--t-fast); }

/* ================= Focus screen (phone, while recording) ================= */
.focus { position: fixed; inset: 0; z-index: 30; background: var(--c-deck); color: var(--c-deck-text); display: flex; flex-direction: column; padding: calc(var(--sp-3) + env(safe-area-inset-top)) 20px 0; }
.f-top { display: flex; align-items: center; gap: var(--sp-1); min-height: var(--h-control); }
.f-top .btn.quiet { color: var(--c-deck-mute); }
.f-name { flex: 1; font-size: 17px; font-weight: var(--fw-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-tabs { display: flex; background: var(--c-deck-2); border-radius: var(--r-button); padding: 3px; margin-top: var(--sp-2); }
.f-tabs button { flex: 1; min-height: 38px; border: 0; background: transparent; color: var(--c-deck-mute); border-radius: var(--r-button); font-size: 14px; padding: 0 var(--sp-2); }
.f-tabs button:hover { color: var(--c-deck-text); }
.f-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: var(--sp-3); }
.f-timerow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.timer { font: var(--fw-medium) var(--fs-timer)/1 var(--font-numbers); font-stretch: var(--stretch-numbers); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.focus .timer { font-size: 92px; margin: var(--sp-5) 0 var(--sp-2); text-align: center; align-self: center; font-variant-numeric: tabular-nums; }
.focus.many .timer { font-size: 56px; margin: var(--sp-2) 0 var(--sp-1); }
.f-state { display: flex; gap: var(--sp-2); align-items: center; color: var(--c-deck-mute); font-size: 14px; }
.focus:not(.many) .f-state { display: none; }
.f-mics { display: grid; gap: 2px; margin-top: var(--sp-1); }
.pmr { display: grid; grid-template-columns: 8px auto minmax(0, 1fr) auto 16px; gap: 10px; align-items: center; min-height: 40px; width: 100%; padding: 0; border: 0; background: transparent; color: var(--c-deck-mute); font-size: 14px; font-weight: var(--fw-regular); text-align: left; border-radius: 0; justify-content: stretch; }
.pmr b { color: var(--c-deck-text); font-weight: var(--fw-medium); }
.pmr .tn { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pmr .tw { color: var(--c-amber); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pmr .tf { color: var(--c-rec); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.focus:not(.many) .pmr .i { display: none; }
.focus:not(.many) .pmr { grid-template-columns: 10px auto minmax(0, 1fr) auto; }
.focus:not(.many) .pmr .dot { width: 10px; height: 10px; background: var(--c-rec); }
.focus:not(.many) .pmr .dot.warn, .focus:not(.many) .pmr .dot.err { background: var(--c-amber); }
.focus:not(.many) .pmr b { color: var(--c-deck-mute); font-weight: var(--fw-regular); }
.pmo { background: var(--c-deck-2); border-radius: 12px; margin: 2px -12px; padding: 0 12px 12px; }
.pmo .x { font-size: var(--fs-sm); color: var(--c-deck-mute); line-height: 1.4; margin: 2px 0 10px 18px; }
.pmo .xa { display: flex; gap: var(--sp-2); margin-left: 18px; align-items: center; }
.pmo .xa input { flex: 1; min-height: var(--h-control); background: var(--c-deck-3); border-color: var(--c-deck-3); color: var(--c-deck-text); }
.f-warn:empty { display: none; }
.f-warn { margin-top: var(--sp-2); color: var(--c-amber); font-size: 14px; display: grid; gap: var(--sp-1); }
.f-last { background: var(--c-deck-2); border-radius: var(--r-card); padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-4); font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--c-deck-mute); }
.f-last-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.f-last b { display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-deck-text); margin-bottom: 2px; }
.acts4 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: none; }
.act4 { height: 96px; border-radius: var(--r-tile); background: var(--c-deck-2); border: 0; color: var(--c-deck-text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: var(--fw-medium); cursor: pointer; padding: 0; }
.act4:active { background: var(--c-deck-3); }
.act4 .act-label { max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-bottom { flex: none; display: flex; justify-content: center; padding: var(--sp-5) 0 calc(var(--sp-5) + env(safe-area-inset-bottom)); }
.f-bottom .big-stop { width: 76px; height: 76px; box-shadow: 0 0 0 6px var(--c-deck), 0 0 0 7px var(--c-deck-3); }
body.focus-on { overflow: hidden; }

/* ================= Comment sheet (phone; public/comment-sheet.js) ================= */
/* Dark like the focus screen it opens from. Placed by script on the visual viewport, so it sits
   right above the keyboard. */
.cs-scrim { position: fixed; inset: 0; z-index: 75; background: rgba(0, 0, 0, .55); animation: fade-in var(--t-med); }
.comment-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 76; display: flex; flex-direction: column; max-height: 100%; width: 100%;
  background: var(--c-deck); color: var(--c-deck-text); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .35);
  padding: 10px 20px calc(var(--sp-4) + env(safe-area-inset-bottom)); animation: sheet-up var(--t-med) ease-out; overflow: hidden; }
.comment-sheet.kb { padding-bottom: var(--sp-3); border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
.cs-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--c-deck-3); margin: 0 auto var(--sp-3); flex: none; }
.cs-head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-3); flex: none; min-width: 0; touch-action: none; }
.cs-title { font-size: var(--fs-title); font-weight: var(--fw-bold); font-stretch: var(--stretch-title); }
.cs-when { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--c-deck-mute); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cs-when .i { align-self: center; }
.cs-form { display: flex; flex-direction: column; min-height: 0; flex: 1; margin: 0; }
.comment-sheet .cs-field { display: block; width: 100%; min-height: 96px; resize: none; font: var(--fw-regular) 17px/var(--lh-text) var(--font-text);
  background: var(--c-deck-2); color: var(--c-deck-text); border: 1px solid var(--c-deck-2); border-radius: var(--r-field); padding: var(--sp-3) 14px; overflow-y: auto; overflow-wrap: anywhere; }
.comment-sheet .cs-field::placeholder { color: var(--c-deck-mute); }
.comment-sheet .cs-field:focus { border-color: var(--c-deck-3); box-shadow: none; }
.cs-status:empty { display: none; }
.cs-status { color: var(--c-amber); font-size: 14px; margin-top: var(--sp-2); }
.cs-actions { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); flex: none; }
.cs-cancel { min-height: 52px; padding: 0 var(--sp-4); border: 0; background: transparent; color: var(--c-deck-mute); font-size: 16px; font-weight: var(--fw-medium); border-radius: var(--r-button); }
.cs-send { flex: 1; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); border: 0; border-radius: var(--r-button);
  background: var(--c-deck-text); color: var(--c-deck); font-size: 17px; font-weight: var(--fw-bold); transition: background var(--t-fast), color var(--t-fast); }
.cs-send:disabled { background: var(--c-deck-2); color: var(--c-deck-mute); opacity: 1; }
.comment-sheet.sent .cs-send { background: var(--c-ok); color: #fff; }
body.cs-on { overflow: hidden; }

/* ================= Deck as a handle (phone, while recording) ================= */
/* A grab bar on its top edge and "Aufnahme ^" on the time row: tap or swipe up opens the focus screen. */
.bar-open { display: none; }
@media (max-width: 700px) {
  .bar.running { padding-top: 18px; touch-action: pan-x; cursor: pointer; }
  .bar.running::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--c-deck-3); }
  .bar.running .bar-open { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; flex: none; padding: 4px 0 4px 4px; color: var(--c-deck-text); font-size: 13px; font-weight: var(--fw-medium); }
  .bar.running .bar-open .bar-up { display: block; color: var(--c-deck-text); margin: 0; }
  .bar.dragging { transition: none; }
  .bar.running .bar-input { cursor: default; }
}

/* ================= Table mode ================= */
.table-overlay { position: fixed; inset: 0; z-index: 100; background: #000; display: grid; place-items: center; cursor: default; user-select: none; -webkit-tap-highlight-color: transparent; text-align: center; }
.table-inner { display: grid; justify-items: center; gap: 0; }
.table-ring { width: 64px; height: 64px; border-radius: 50%; border: 1px solid #2a2b2e; display: grid; place-items: center; margin-bottom: var(--sp-6); }
.table-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c-rec-dim); animation: table-pulse 3s ease-in-out infinite; }
.table-time { font: var(--fw-medium) 44px/1 var(--font-numbers); font-stretch: var(--stretch-numbers); font-variant-numeric: tabular-nums; color: #4b4d52; }
.table-meter { margin-top: 20px; }
.table-meter .segm i { background: #1c1d20; }
.table-meter .segm i.on, .table-meter .segm i.hot { background: #4a3a1e; }
.table-warn { color: #8a6a2a; font-size: var(--fs-sm); max-width: 80vw; margin-top: var(--sp-4); }
.table-warn:empty { display: none; }
.table-hint { font-size: var(--fs-sm); color: #3a3b3f; margin-top: 120px; }
@keyframes table-pulse { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }
body.table-mode { overflow: hidden; }

/* ================= Name box ================= */
.name-box { position: absolute; z-index: 75; background: var(--c-panel); border-radius: 18px; box-shadow: var(--sh-pop); padding: var(--sp-4) 20px 20px; display: grid; gap: var(--sp-2); width: min(380px, calc(100vw - 16px)); }
.name-box.sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none; border-radius: var(--r-sheet) var(--r-sheet) 0 0; padding: 10px 20px calc(var(--sp-5) + env(safe-area-inset-bottom)); max-height: 86vh; overflow-y: auto; animation: sheet-up var(--t-med) ease-out; }
.name-box.sheet::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--c-line); margin: 0 auto var(--sp-2); }
.nb-scrim { position: fixed; inset: 0; z-index: 74; background: var(--c-scrim); }
.nb-head { display: flex; gap: var(--sp-3); align-items: center; }
.nb-title { flex: 1; font-size: 19px; font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.nb-close { min-height: var(--h-control); width: var(--h-control); padding: 0; border-color: transparent; background: transparent; color: var(--c-mute); }
.nb-where { font-size: var(--fs-sm); overflow-wrap: anywhere; color: var(--c-mute); margin-bottom: var(--sp-2); }
.nb-row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.nb-row > span { flex: 1 1 12em; min-width: 0; }
.nb-name { flex: 1 1 10em; min-width: 0; }
.nb-merge { flex: 1 1 100%; min-width: 0; }
.nb-name::-webkit-calendar-picker-indicator { display: none !important; }
.nb-known { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--c-mute); }
.nb-known button { min-height: 28px; padding: 0 var(--sp-3); border: 0; background: var(--c-body); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.nb-origin, .nb-proposal { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); }
.nb-origin { border-top: 1px solid var(--c-line); padding-top: var(--sp-3); margin-top: var(--sp-1); color: var(--c-mute); }
.nb-origin > span, .nb-proposal > span { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
.nb-proposal { background: var(--c-sunk); border-radius: 10px; padding: var(--sp-2) var(--sp-3); }
.nb-undo { border-color: transparent; background: transparent; font-weight: var(--fw-bold); }
.nb-sections { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.nb-sections button.on { background: var(--c-ink); border-color: var(--c-ink); color: var(--c-ink-on); }
.nb-hint { font-size: var(--fs-sm); color: var(--c-mute); margin: 0; }
.nb-error { font-size: var(--fs-sm); }
.nb-all-row { font-size: var(--fs-sm); gap: var(--sp-2); cursor: pointer; margin-top: var(--sp-1); }

/* ================= Speakers ================= */
.speakers .sp-head { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin: var(--sp-2) 0 var(--sp-1); }
.speakers .sp-head h2 { font-size: var(--fs-h1); font-stretch: var(--stretch-title); line-height: 1.1; }
.sp-group { font-size: var(--fs-sm); color: var(--c-mute); font-weight: var(--fw-regular); margin: var(--sp-5) 0 10px; display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.sp-group b { color: var(--c-ink); font-weight: var(--fw-bold); }
.sp-list { display: grid; gap: var(--sp-2); max-width: 720px; }
.sp-card { background: var(--c-panel); border-radius: var(--r-card); padding: var(--sp-3) var(--sp-4); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; cursor: pointer; min-width: 0; }
.sp-card:hover, .sp-card:focus-visible { box-shadow: 0 0 0 1px var(--c-line); }
.sp-card.removed { opacity: .6; }
.sp-play { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; background: var(--c-body); border: 0; }
.sp-name { font-weight: var(--fw-bold); font-size: 17px; display: flex; gap: var(--sp-2); align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.sp-name.un { color: var(--c-mute); font-weight: var(--fw-medium); }
.sp-name small { font-weight: var(--fw-regular); font-size: var(--fs-xs); color: var(--c-faint); }
.sp-sub { font-size: var(--fs-xs); color: var(--c-mute); overflow-wrap: anywhere; }
.sp-last { font-size: 14px; color: var(--c-mute); margin: 2px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sp-count { white-space: nowrap; font-size: var(--fs-sm); color: var(--c-mute); font-variant-numeric: tabular-nums; }
.sp-note { grid-column: 2 / -1; font-size: var(--fs-sm); }

/* ================= Analysis ================= */
.analysis h2 { font-size: var(--fs-title); }
.analysis h3 { font-size: var(--fs-ui); margin: var(--sp-5) 0 var(--sp-1); display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.analysis p { font-size: var(--fs-sm); margin: 0 0 var(--sp-2); max-width: 80ch; }
.a-list { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }
.a-row { display: grid; grid-template-columns: minmax(8em, 1.2fr) 4fr 3.5em 4em 6em; gap: var(--sp-3); align-items: center; font-size: 14px; }
.a-name { font-weight: var(--fw-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: var(--sp-2); align-items: center; }
.a-bar { height: 12px; background: var(--c-sunk); border-radius: 6px; overflow: hidden; }
.a-bar > i { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.a-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ================= Editor ================= */
main.wide { max-width: none; padding: var(--sp-4) var(--sp-6) 140px; }
.e-header { display: flex; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-3); flex-wrap: wrap; }
.e-head-label { font-size: var(--fs-sm); color: var(--c-mute); }
.e-sections { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.e-sections button { min-height: 28px; padding: 0 10px; border-radius: 14px; background: var(--c-panel); border: 0; font-size: var(--fs-sm); color: var(--c-mute); font-variant-numeric: tabular-nums; }
.e-sections button:hover { color: var(--c-ink); }
.e-zoom { display: inline-flex; gap: var(--sp-2); align-items: center; color: var(--c-mute); }
.e-zoom input { width: 140px; }
.e-tl { display: flex; border-radius: var(--r-card); background: var(--c-panel); overflow: hidden; }
.e-labels { flex: 0 0 168px; border-right: 1px solid var(--c-line-soft); }
.e-labels .e-axis-label { height: 28px; border-bottom: 1px solid var(--c-line-soft); }
.e-label { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3); border-bottom: 1px solid var(--c-line-soft); font-weight: var(--fw-medium); font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.e-label .lbl { overflow: hidden; text-overflow: ellipsis; }
.e-label.sub { font-weight: var(--fw-regular); padding-left: var(--sp-4); color: var(--c-ink); }
.e-label.clickable { cursor: pointer; }
.e-label.clickable:hover { background: var(--c-sunk); }
.e-label.on { background: var(--c-accent-soft); }
.e-scroll { flex: 1; overflow-x: auto; overflow-y: hidden; cursor: crosshair; user-select: none; }
.e-content { position: relative; }
.e-axis { position: relative; height: 28px; border-bottom: 1px solid var(--c-line-soft); }
.e-axis span { position: absolute; top: 7px; font-size: 11px; color: var(--c-faint); transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.e-axis span::after { content: ""; position: absolute; left: 50%; top: 16px; height: 5px; border-left: 1px solid var(--c-line); }
.e-lane { position: relative; border-bottom: 1px solid var(--c-line-soft); }
.e-rec { position: absolute; top: 4px; height: 30px; background: var(--c-sunk); border-radius: 4px; overflow: hidden; }
.e-rec canvas { width: 100%; height: 30px; display: block; }
.e-rec.sub { background: #faf9f6; height: 62px; }
.e-blk { position: absolute; top: 38px; height: 26px; background: var(--c, var(--spk-1)); color: #fff; border: 0; border-radius: 6px; font-size: var(--fs-xs); line-height: 26px; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; opacity: .92; }
.e-blk:hover { opacity: 1; }
.e-blk.retranscribed { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.e-blk.duplicate { opacity: .4; background: repeating-linear-gradient(135deg, #d8dad8, #d8dad8 6px, #cfd2cf 6px, #cfd2cf 12px); color: var(--c-mute); }
.e-marker { position: absolute; top: 20px; transform: translateX(-50%); cursor: pointer; width: 28px; height: 28px; border-radius: 50%; background: var(--c-body); display: grid; place-items: center; color: var(--c-ink); }
.e-sel { position: absolute; background: var(--c-amber-tint); border-left: 2px solid var(--c-amber); border-right: 2px solid var(--c-amber); pointer-events: none; }
.e-gap { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--c-sunk) 0 6px, var(--c-line-soft) 6px 12px); pointer-events: none; }
.e-gap span { position: absolute; top: 6px; left: 50%; transform: translateX(-50%) rotate(-90deg) translateX(-40%); transform-origin: center; font-size: 11px; color: var(--c-mute); white-space: nowrap; }
.e-panel { margin-top: var(--sp-4); background: var(--c-panel); border-radius: var(--r-card); padding: var(--sp-4) var(--sp-5); }
.e-panel .row { margin-top: var(--sp-2); }
.e-panel audio { margin-top: var(--sp-3); width: 100%; }
.e-result { border-top: 1px solid var(--c-line-soft); margin-top: var(--sp-4); padding-top: var(--sp-3); }
.e-diff { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.e-diff p { margin: var(--sp-1) 0; line-height: var(--lh-text); }
.e-diff del { background: var(--c-del-bg); color: var(--c-del-ink); text-decoration: line-through; }
.e-diff ins { background: var(--c-ins-bg); color: var(--c-ins-ink); text-decoration: none; }
.e-preview { border-top: 1px solid var(--c-line-soft); margin-top: var(--sp-3); padding-top: var(--sp-2); }
.e-p-row { display: grid; grid-template-columns: 5em minmax(8em, 12em) 1fr; gap: var(--sp-3); padding: var(--sp-1) 0; font-size: 14px; line-height: var(--lh-ui); }
.e-p-row .time { color: var(--c-faint); font-variant-numeric: tabular-nums; }
.e-p-source { font-weight: var(--fw-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-dup { background: var(--c-sunk); border-radius: 10px; padding: var(--sp-2) var(--sp-3); font-size: 14px; }

/* ================= Domain terms ================= */
.terms { background: var(--c-panel); border-radius: var(--r-card); padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-4); }
.terms-header { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.terms-header .muted { font-size: var(--fs-sm); }
.terms-table { border-collapse: collapse; margin-top: var(--sp-2); }
.terms-table td { padding: 2px var(--sp-2) 2px 0; font-size: 14px; }
.terms-table input { width: 22em; }
.terms .row input { flex: 1; }
.terms-footer { font-size: var(--fs-xs); margin-top: var(--sp-2); }

/* ================= Lightbox ================= */
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(14, 15, 17, .92); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; outline: none; }
.lb-frame { color: var(--c-deck-text); max-width: 96vw; max-height: 96vh; display: flex; flex-direction: column; overflow: hidden; }
.lb-header { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0; font-size: 14px; }
.lb-header button, .lb-header a { background: var(--c-deck-2); color: var(--c-deck-text); border: 1px solid var(--c-deck-2); min-height: var(--h-control-sm); padding: 0 var(--sp-3); border-radius: var(--r-button); text-decoration: none; display: inline-flex; gap: var(--sp-2); align-items: center; font-size: 14px; }
.lb-header button.sq { width: var(--h-control-sm); padding: 0; }
.lb-spacer { flex: 1; }
.lb-muted { color: var(--c-deck-mute); font-variant-numeric: tabular-nums; }
.lb-image { overflow: auto; max-height: calc(96vh - 3.5em); border-radius: 10px; touch-action: pinch-zoom pan-x pan-y; }
.lb-image img { display: block; cursor: zoom-out; }
.lb-image img.lb-fit { max-width: 94vw; max-height: calc(94vh - 3.5em); cursor: zoom-in; margin: 0 auto; }
.lb-text { background: var(--c-note); color: var(--c-ink); padding: var(--sp-5) var(--sp-6); font-size: 20px; line-height: var(--lh-text); min-width: min(40em, 80vw); white-space: pre-wrap; border-radius: var(--r-card); }

/* ================= Login ================= */
.login { max-width: 22em; margin: 18vh auto; text-align: center; padding: 0 var(--sp-4); }
.login h1 { font-size: var(--fs-title); color: var(--c-mute); }
.login form { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.login input { flex: 1; }
.login .err { margin-top: var(--sp-3); }

/* ================= Desktop / phone switches ================= */
@media (min-width: 701px) {
  .phone-only { display: none !important; }
  .setup-hint > summary { display: none; }
}
@media (max-width: 700px) { .desktop-only { display: none !important; } }

/* ================= Phone ================= */
@media (max-width: 700px) {
  :root { --h-control: 44px; }
  html, body { overflow-x: clip; max-width: 100vw; }
  main, section, .setup, .summary, .row { min-width: 0; max-width: 100%; }
  select, input, textarea, button { max-width: 100%; }
  input, select, textarea { font-size: 16px; } /* no zoom on focus */
  code { word-break: break-all; }
  main { padding: var(--sp-3) var(--sp-4) 200px; }
  .card { padding: var(--sp-4); }

  /* list: dark top, cards, the big record button in a dock at the bottom */
  .top { background: var(--c-deck); color: var(--c-deck-text); height: 72px; padding: 0 20px; }
  .top .brand { color: var(--c-deck-mute); }
  .top-logout { color: var(--c-deck-mute); width: var(--h-control); padding: 0; }
  .top-logout .label { display: none; }
  .top-voices, .top-connections { color: var(--c-deck-mute); width: var(--h-control); padding: 0; }
  .top-voices .label, .top-connections .label { display: none; }
  .list-head { margin: var(--sp-2) 0 var(--sp-3); }
  .list-head .h1 { font-size: 26px; }
  .sessions { grid-template-columns: 1fr; gap: var(--sp-2); }
  .session-face > a { padding: var(--sp-4) var(--sp-4); min-height: 76px; }
  /* phone: swipe left to reveal Teilen / Löschen; the ⋯ stays for keyboard and screen reader, invisible until focused */
  html, body { overscroll-behavior-x: none; }
  .session-item { overflow: hidden; }
  .session-face { touch-action: pan-y; transition: transform .22s ease; }
  .swipe-actions { display: flex; position: absolute; inset: 0 0 0 auto; width: 176px; visibility: hidden; }
  .session-item.swiped .swipe-actions, .session-item:has(.session-face[style*="translate"]) .swipe-actions { visibility: visible; }
  .swipe-act { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1); border: 0; border-radius: 0; background: var(--c-seg); color: var(--c-ink); font: var(--fw-medium) var(--fs-sm) var(--font-ui); cursor: pointer; }
  .swipe-act.danger { background: var(--c-rec); color: var(--c-ink-on); }
  .session-item .session-more { opacity: 1; clip-path: inset(50%); width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; }
  .session-item .session-more:focus-visible { clip-path: none; width: var(--h-touch, 44px); height: var(--h-touch, 44px); background: var(--c-panel); }
  .session-item:has(.session-more:focus-visible) .session-face > a { padding-right: 52px; }
  @media (prefers-reduced-motion: reduce) { .session-face { transition: none !important; } }
  .new-session { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 21; width: 68px; height: 68px; min-height: 0; padding: 0; border-radius: 50%; box-shadow: 0 0 0 6px var(--c-panel); }
  .new-session .label { display: none; }
  #view-list:not([hidden])::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); background: var(--c-panel); border-top: 1px solid var(--c-line); z-index: 20; }

  /* session head: back, name, share, more; tabs below */
  .s-header { background: var(--c-panel); position: sticky; top: 0; z-index: 10; }
  body { --sticky-top: 96px; }
  .timeline li.paused button { flex: none; }
  .s-header-inner { padding: var(--sp-1) var(--sp-2) 0; }
  .s-name { font-size: 17px; margin-left: 0; padding: 0 var(--sp-1); }
  .s-name-wrap .pen { display: none; }
  .share-btn { width: var(--h-control); padding: 0; border-color: transparent; background: transparent; color: var(--c-mute); }
  .share-btn .label { display: none; }
  .tabs { margin-top: 0; border-bottom: 1px solid var(--c-line); gap: 0; }
  .tabs a { flex: 1; justify-content: center; min-height: 44px; border-radius: 0; border-bottom: 2px solid transparent; padding: 0 var(--sp-1); }
  .tabs a.on { background: transparent; color: var(--c-ink); border-bottom-color: var(--c-ink); }

  /* the bar becomes the deck at the bottom: status row, then Foto, Galerie, the big button, Kommentar, Tisch */
  .bar { padding: 10px var(--sp-3) calc(var(--sp-4) + env(safe-area-inset-bottom)); width: 100vw; }
  .bar-row { flex-wrap: wrap; gap: var(--sp-2); }
  .bar-state { flex: 1 1 100%; min-height: 32px; padding: 0 var(--sp-2); cursor: pointer; }
  .bar .elapsed { font-size: 26px; }
  .bar-mic { display: inline; color: var(--c-deck-mute); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
  .bar.running .bar-up { display: block; color: var(--c-deck-mute); margin-left: auto; }
  #bar-text { display: none; }
  .bar:not(.running) .bar-state { display: none; }
  .setup-head { flex-wrap: nowrap; }
  .setup-head h2 { flex: 1; }
  .bar #chunk-count { display: none; }
  .bar-channels { display: none; }
  .bar-input { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr 84px 1fr 1fr; gap: var(--sp-2); align-items: center; }
  .bar .act { height: 60px; border-radius: var(--r-card); flex-direction: column; justify-content: center; gap: var(--sp-1); font-size: 11px; padding: 0; min-width: 0; }
  .bar .act .act-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .bar .photo-status { position: absolute; left: 0; right: 0; top: -28px; text-align: center; color: var(--c-deck-text); }
  .comment-form { display: none; }
  .bar-big { grid-column: 3; justify-self: center; }
  .big-rec { width: 72px; height: 72px; min-height: 0; padding: 0; border-radius: 50%; box-shadow: 0 0 0 5px var(--c-deck), 0 0 0 6px var(--c-deck-3); }
  .big-rec .label { display: none; }
  .big-rec .i { width: 28px; height: 28px; }
  .bar-big .big-stop { width: 72px; height: 72px; box-shadow: 0 0 0 5px var(--c-deck), 0 0 0 6px var(--c-deck-3); }
  .bar #comment-open { grid-column: 4; }
  .bar #table-mode { grid-column: 5; }
  .bar .warnings { margin: 0 var(--sp-2) var(--sp-2); }
  body.with-bar main { padding-bottom: 210px; }

  /* setup on the phone */
  .setup { padding: var(--sp-4) var(--sp-3); background: transparent; }
  .setup-head { padding: 0 var(--sp-1); }
  .setup-hint { padding: 0 var(--sp-1); }
  .setup-hint > summary { min-height: var(--h-tap-min); display: flex; align-items: center; }
  .setup-actions { display: none; } /* the record button sits in the deck at the bottom */
  .setup-more { flex-direction: column; align-items: stretch; }
  .setup-more .add-row { justify-content: flex-start; border-radius: var(--r-card); min-height: 52px; border: 0; }
  .s-terms { background: var(--c-panel); border-radius: var(--r-card); padding: 0 var(--sp-4); }
  .s-terms > summary { min-height: 52px; justify-content: space-between; color: var(--c-ink); }
  .s-terms .terms { padding: 0 0 var(--sp-4); }
  .terms-table input { width: 100%; }
  .terms-header .muted { flex-basis: 100%; }
  .s-ai { display: grid; gap: var(--sp-2); }

  /* recording mics (box) on the phone: rows in the deck replace it */
  #channel-status-box { display: none !important; }

  /* filter and transcript */
  .tl-filter { margin: var(--sp-2) calc(-1 * var(--sp-4)) var(--sp-2); padding: 0 var(--sp-3); max-width: none; }
  .kinds .seg { flex: 1 1 0; min-width: 0; }
  .kinds .seg button { flex: 1 1 auto; padding: 0 6px; font-size: 13px; min-width: 0; }
  .kinds .tl-more { width: var(--h-control); padding: 0; flex: none; border-color: transparent; background: transparent; }
  .kinds .who { flex-basis: 100%; order: 4; }
  .setup-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .device-name { width: 6em; }
  .kinds .cnt { flex-basis: 100%; margin-left: 0; order: 5; }
  .tl-search { display: none; }
  .timeline { margin: 0 calc(-1 * var(--sp-4)); border-radius: 0; padding: 0 var(--sp-4); }
  .timeline li .jump { display: none; }

  /* speakers, analysis */
  .sp-card { grid-template-columns: 40px minmax(0, 1fr); }
  .sp-card .sp-count { grid-column: 2; }
  .sp-play { width: 40px; height: 40px; }
  .a-row { grid-template-columns: minmax(0, 1fr) 3em 3.5em; gap: var(--sp-2) var(--sp-3); }
  .a-row .a-bar { grid-column: 1 / -1; grid-row: 2; }
  .a-row .a-num.words { display: none; }

  .panel.sheet .menu-item { min-height: 52px; }
  .name-box.sheet input, .name-box.sheet select, .name-box.sheet button:not(.nb-known button) { min-height: var(--h-touch); }
  .toast { bottom: 150px; }
}

/* meters on the dark deck */
.bar .segm i, .focus .segm i { background: var(--c-deck-3); }
.bar .segm i.on, .focus .segm i.on { background: var(--c-amber); }
.bar .segm i.hot, .focus .segm i.hot { background: var(--c-rec); }

@media (prefers-reduced-motion: reduce) {
  .bar.running .bar-dot, .table-dot { animation: none; }
  .panel, .scrim, .toast, .name-box.sheet { animation: none; transition: none; }
}

/* Remembered voices (public/voice-consent.js, public/voices-page.js) */
.nb-voice-row { font-size: var(--fs-sm); gap: var(--sp-2); cursor: pointer; margin-top: var(--sp-1); }
.nb-voice-row { min-height: var(--h-control); }
.nb-voice-row input, .name-box.sheet .nb-voice-row input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--c-ink); }
.nb-voice-state .btn { min-height: var(--h-control-sm); }
.voices-page { max-width: 760px; }
.voices-page .lead { margin: var(--sp-2) 0 var(--sp-5); }
.voices { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-3); }
.voice-item { background: var(--c-panel); border-radius: var(--r-card); padding: var(--sp-4) var(--sp-5); display: grid; gap: var(--sp-1); font-size: var(--fs-ui); }
.voice-item.gone { background: var(--c-sunk); }
.voice-head { display: flex; gap: var(--sp-3); align-items: center; }
.voice-head strong { flex: 1; font-size: var(--fs-title); font-stretch: var(--stretch-title); overflow-wrap: anywhere; }
.voice-line { font-size: var(--fs-sm); color: var(--c-mute); overflow-wrap: anywhere; }
.voice-audio { display: block; height: 36px; margin-top: var(--sp-1); width: 100%; max-width: 360px; }
.voices-gone { margin-top: var(--sp-5); }
.voices-gone > summary { cursor: pointer; color: var(--c-mute); font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.m-expected { display: grid; gap: var(--sp-1); margin-top: var(--sp-2); }
.m-expected .group { font-size: var(--fs-sm); color: var(--c-mute); }

/* ================= Installed app (PWA) ================= */
.sw-update { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-4); background: var(--c-deck); color: var(--c-deck-text); border-radius: var(--r-button); box-shadow: var(--sh-pop); font-size: var(--fs-sm); }
@media (display-mode: standalone), (display-mode: window-controls-overlay) {
  /* no browser pull-to-refresh: it would reload the page in the middle of a recording */
  html, body { overscroll-behavior-y: none; }
  .top { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
  .s-header-inner { padding-top: calc(var(--sp-4) + env(safe-area-inset-top)); }
  body.table-mode .table-overlay { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
}
