:root {
  /* The website's palette (website/assets/tokens.css): navy for text, buttons and links, off-white pages, the deep
     green for OK and recording. Red, purple and orange keep their courtroom meanings. */
  --bg: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #eef0f3;
  --text: #0d2243;
  --muted: #45526a;
  --border: #d9dce2;
  --accent: #0d2243;
  --accent-text: #ffffff;
  --accent-soft: #e7ebf2;
  --rec: #c0392b;
  --rec-soft: #fbe9e7;
  --ok: #067a62;
  --ok-soft: #dcfbef;
  --warn: #b26a00;
  --sealed: #6b3fa0;
  --sidebar: #c77700;
  --select: rgba(13, 34, 67, 0.22);
  --shadow: 0 1px 2px rgba(13, 34, 67, .06), 0 4px 16px rgba(13, 34, 67, .08);
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1a33; --panel: #0d2243; --panel-2: #16305a; --text: #f5f5f7; --muted: #b5bfcd; --border: #28456f;
    --accent: #a9c4f5; --accent-text: #0d2243; --accent-soft: #1d3a66; --rec: #ef5350; --rec-soft: #3d1a26;
    --ok: #3fcf8e; --ok-soft: #0f3a3a; --warn: #ffb74d; --sealed: #b394e0; --sidebar: #ffb74d; --select: rgba(169, 196, 245, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1a33; --panel: #0d2243; --panel-2: #16305a; --text: #f5f5f7; --muted: #b5bfcd; --border: #28456f;
  --accent: #a9c4f5; --accent-text: #0d2243; --accent-soft: #1d3a66; --rec: #ef5350; --rec-soft: #3d1a26;
  --ok: #3fcf8e; --ok-soft: #0f3a3a; --warn: #ffb74d; --sealed: #b394e0; --sidebar: #ffb74d; --select: rgba(169, 196, 245, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

button, .button {
  font: inherit; border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 6px;
  padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-height: 32px;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
button.primary, a.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { background: var(--rec); color: #fff; border-color: var(--rec); }
button.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
button.small { padding: 2px 8px; min-height: 26px; font-size: 13px; }
button.icon { padding: 4px 8px; min-width: 34px; justify-content: center; font-variant-numeric: tabular-nums; }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; min-height: 32px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
input[type="range"] { padding: 0; }
textarea { width: 100%; resize: vertical; }

/* App frame */
#app { min-height: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.brand { font-weight: 700; margin-right: 10px; display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rec); }
.nav a { padding: 6px 10px; border-radius: 6px; color: var(--text); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge { background: var(--accent); color: var(--accent-text); border-radius: 10px; padding: 0 7px; font-size: 12px; font-weight: 600; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.status-dot.green { background: var(--ok); } .status-dot.yellow { background: var(--warn); } .status-dot.red { background: var(--rec); }
main { flex: 1; padding: 16px; max-width: 1500px; width: 100%; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 12px; }
.toolbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }

/* Tables */
table.list { width: 100%; border-collapse: collapse; background: var(--panel); }
table.list th, table.list td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { position: sticky; top: 0; background: var(--panel-2); font-weight: 600; user-select: none; white-space: nowrap; }
table.list th.sortable { cursor: pointer; }
table.list tbody tr { cursor: default; }
table.list tbody tr:hover { background: var(--panel-2); }
table.list tbody tr.selected { background: var(--accent-soft); }
.table-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--border); border-radius: var(--radius); }
.pill { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.pill.rec { background: var(--rec); color: #fff; } .pill.ok { background: var(--ok); color: #fff; } .pill.warn { background: var(--warn); color: #fff; }
.pill.sealed { background: var(--sealed); color: #fff; }

/* Forms and dialogs */
.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-weight: 600; font-size: 13px; }
.field small { color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 6px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 12px; }
.form-error { color: var(--rec); min-height: 1em; }
.note { color: var(--muted); }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow: auto; }
.dialog { background: var(--panel); border-radius: 10px; padding: 18px; width: min(480px, 100%); box-shadow: var(--shadow); }
.dialog.wide { width: min(900px, 100%); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.key-box { font-family: var(--mono); font-size: 26px; letter-spacing: 2px; text-align: center; padding: 14px; border: 2px dashed var(--sealed); border-radius: 8px; margin: 10px 0; user-select: all; }
#toasts { position: fixed; bottom: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 420px; }
.toast.error { background: var(--rec); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }

/* Login */
.login { max-width: 380px; margin: 10vh auto; }
.login h1 { text-align: center; }

/* Main menu */
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.menu-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.menu a { display: block; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; box-shadow: var(--shadow); }
.menu a:hover { border-color: var(--accent); }
.menu b { display: block; font-size: 16px; margin-bottom: 4px; }

/* Monitor */
.monitor { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(360px, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .monitor { grid-template-columns: 1fr; } }
.room-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.room-tabs button.active { background: var(--accent); color: var(--accent-text); }
.rec-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-btn { font-size: 16px; padding: 10px 16px; min-width: 110px; justify-content: center; }
.rec-btn.record { color: var(--rec); border-color: var(--rec); font-weight: 700; }
.rec-btn.record.on, .rec-btn.record.on:disabled { background: var(--ok); border-color: var(--ok); color: #fff; opacity: 1; }
/* Stop turns red while there is a recording to stop (recording or paused), so it's clear it must be pressed to end it. */
.rec-btn.stop.on { background: var(--rec); border-color: var(--rec); color: #fff; font-weight: 700; }
/* Recording state: NOT RECORDING large, red and flashing; RECORDING large and green; PAUSED large and amber. */
.rec-state { font-weight: 800; letter-spacing: 1px; font-size: 26px; }
.rec-state.idle { color: var(--rec); animation: blink 1.2s steps(2, start) infinite; }
.rec-state.recording { color: var(--ok); }
.rec-state.paused { color: var(--warn); }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .rec-state.idle { animation: none; } }
.big-clock { font-family: var(--mono); font-size: 28px; }
.clock-stack { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.rec-length { font-family: var(--mono); font-size: 16px; color: var(--muted); }
.meters { display: grid; gap: 4px; }
.meter { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; font-size: 12px; }
.meter .bar { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .15s; }
.meter .bar i.hot { background: var(--rec); }
.tag-line { display: flex; gap: 6px; }
.tag-line input { flex: 1; }
.quicktags { display: flex; flex-wrap: wrap; gap: 4px; }
.quicktags button { font-size: 13px; }
.quicktags kbd { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tag-list { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.tag-item { display: grid; grid-template-columns: 78px 1fr auto; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--border); align-items: baseline; }
.tag-item:last-child { border-bottom: 0; }
.tag-item.private { color: var(--sealed); font-style: italic; }
.tag-item.current { background: var(--accent-soft); }
.tag-item .t { font-family: var(--mono); font-size: 12px; color: var(--muted); cursor: pointer; }
.tag-item .who { font-size: 11px; color: var(--muted); }
.transcript { max-height: min(420px, 30vh); overflow: auto; border: 1px solid var(--border); border-radius: 6px; padding: 4px 0; background: var(--panel); }
.tx-line { padding: 3px 10px; display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: baseline; }
.tx-line .t { font-family: var(--mono); font-size: 12px; color: var(--muted); cursor: pointer; }
.tx-line .sp { font-weight: 700; margin-right: 6px; }
.tx-line .sp.rename { cursor: pointer; } .tx-line .sp.rename:hover, .tx-line .sp.rename:focus-visible { text-decoration: underline; }
.tx-line.current { background: var(--accent-soft); }
.tx-line.hidden-part { color: var(--muted); font-style: italic; }
.tx-line.edited .text { text-decoration: underline dotted var(--muted); }
/* Quick drafts of the newest words: greyed until the careful transcript replaces them. */
.tx-line.draft { color: var(--muted); font-style: italic; }
/* Times hidden (the Times box under the transcript): the text takes the whole line. */
.transcript.no-times .tx-line { grid-template-columns: 1fr auto; }
.transcript.no-times .tx-line .t { display: none; }
/* A new speaker's turn starts with a little space. */
.tx-line.turn { margin-top: 4px; }
/* Each speaker in their own colour (the first eight never share one), in Transcript panes and Live Transcript. */
:root { --sp1: #0b5cad; --sp2: #a3361b; --sp3: #1d7a3a; --sp4: #7a3aa6; --sp5: #8a5a00; --sp6: #00727a; --sp7: #b0306b; --sp8: #4d5b00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sp1: #8cc4ff; --sp2: #ff9e80; --sp3: #7ee2a0; --sp4: #d0a6ff; --sp5: #ffd36b; --sp6: #6fe0e8; --sp7: #ff94c2; --sp8: #c8d96b; }
}
:root[data-theme="dark"] { --sp1: #8cc4ff; --sp2: #ff9e80; --sp3: #7ee2a0; --sp4: #d0a6ff; --sp5: #ffd36b; --sp6: #6fe0e8; --sp7: #ff94c2; --sp8: #c8d96b; }
:is(.transcript, .captions) .sp[data-c="1"] { color: var(--sp1); } :is(.transcript, .captions) .sp[data-c="2"] { color: var(--sp2); } :is(.transcript, .captions) .sp[data-c="3"] { color: var(--sp3); } :is(.transcript, .captions) .sp[data-c="4"] { color: var(--sp4); }
:is(.transcript, .captions) .sp[data-c="5"] { color: var(--sp5); } :is(.transcript, .captions) .sp[data-c="6"] { color: var(--sp6); } :is(.transcript, .captions) .sp[data-c="7"] { color: var(--sp7); } :is(.transcript, .captions) .sp[data-c="8"] { color: var(--sp8); }

/* Player */
.player { display: flex; flex-direction: column; gap: 8px; }
.player-head { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.player-head b { font-family: var(--mono); font-weight: 600; }
.timeline { position: relative; height: 34px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; touch-action: none; user-select: none; }
.timeline .range { position: absolute; top: 0; bottom: 0; }
.timeline .range.sealed { background: repeating-linear-gradient(45deg, var(--sealed), var(--sealed) 3px, transparent 3px, transparent 7px); opacity: .55; }
.timeline .range.sidebar { background: var(--sidebar); opacity: .35; }
.timeline .range.pause { background: var(--muted); opacity: .25; }
.timeline .range.sel { background: var(--select); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.timeline .tick { position: absolute; top: 0; width: 1px; height: 8px; background: var(--accent); }
.timeline .head { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1px; background: var(--rec); border-radius: 2px; }
.timeline .live-edge { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(90deg, transparent, transparent 4px, var(--border) 4px, var(--border) 5px); }
.transport { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.transport .sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.videos .cam { position: relative; background: #000; border-radius: 6px; overflow: hidden; aspect-ratio: 16 / 9; }
.videos video { width: 100%; height: 100%; object-fit: contain; display: block; }
.videos .cam span { position: absolute; left: 6px; top: 4px; color: #fff; font-size: 12px; text-shadow: 0 0 3px #000; }
.videos .cam .none { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 13px; }
.play-layout { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(320px, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1100px) { .play-layout { grid-template-columns: 1fr; } }

/* Captions for a courtroom (Hearing Access): a caption code and its QR code */
.caption-code-shown { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.caption-code-shown > .stack { flex: 1 1 260px; min-width: 0; }
.caption-qr { width: 180px; max-width: 100%; }
.caption-qr svg { width: 100%; height: auto; display: block; }
/* Setting up an authenticator app */
.mfa-qr { width: 200px; max-width: 100%; background: #fff; padding: 6px; border-radius: var(--radius); }
.mfa-qr svg { width: 100%; height: auto; display: block; }
.mfa-key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05em; letter-spacing: .05em; user-select: all; }
.mfa-steps { margin: 0; padding-left: 1.3em; }
.mfa-code { font-size: 1.3em; letter-spacing: .15em; max-width: 12em; }
.mfa-recovery { columns: 2; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05em; list-style: none; padding: 0; user-select: all; }
.needs { display: inline-flex; flex-wrap: wrap; gap: 4px; }

/* Live captions */
.captions { font-size: var(--caption-size, 32px); line-height: 1.35; max-height: calc(100vh - 160px); overflow: auto; padding: 12px 20px; background: var(--panel); border-radius: var(--radius); }
.captions p { margin: 0 0 .5em; }
.captions .sp { font-weight: 800; color: var(--accent); margin-right: .4em; }
.captions .draft { opacity: .7; }

/* Recorders */
.recorders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 620px), 1fr)); gap: 12px; }
.recorder-card .sources-wrap { overflow-x: auto; }
.recorder-card .row { justify-content: space-between; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; font-size: 13px; margin: 8px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.alert { padding: 6px 10px; border-radius: 6px; margin: 4px 0; border-left: 4px solid var(--warn); background: var(--panel-2); }
.alert.red { border-color: var(--rec); }
/* Video Arraignment: someone is ready at the camera (ready-notice.js), and their row on the video calendar. */
.ready-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; margin: 6px 0; border-radius: 6px;
  border-left: 4px solid var(--ok); background: var(--ok-soft); }
.ready-notice[hidden] { display: none; }
.ready-notice.flash { animation: ready-flash 1s ease-in-out 5; }
@keyframes ready-flash { 50% { box-shadow: 0 0 0 4px var(--ok); } }
@media (prefers-reduced-motion: reduce) { .ready-notice.flash { animation: none; outline: 3px solid var(--ok); } }
tr.ready-row > td { background: var(--ok-soft); }
tr.ready-row > td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.problem details summary { cursor: pointer; }
.problem.compact { padding: 4px 8px; font-size: 13px; }
.problem-detail { white-space: pre-wrap; word-break: break-word; font-size: 12px; margin: 4px 0 0; max-height: 200px; overflow: auto; }
.problem-fix ol { margin: 0; padding-left: 22px; line-height: 1.5; }
.problem-fix ol li + li { margin-top: 6px; }
.problem-fix code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; word-break: break-all; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; }
.tabs button.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--panel-2); }

@media (max-width: 640px) {
  main { padding: 10px; }
  .nav a { padding: 6px 6px; }
}
@media print {
  .topbar, .toolbar, .no-print { display: none !important; }
}

/* Scheduling */
.assign-chip { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px; background: var(--accent-soft); border-left: 4px solid var(--accent); flex-wrap: wrap; }
.assign-chip.relief { border-left-color: var(--ok); }
.assign-chip.backup { border-left-color: var(--muted); background: var(--panel-2); }
.my-assignments { margin-bottom: 16px; }
.my-assignments .row { justify-content: space-between; border-bottom: 1px solid var(--border); padding: 6px 0; }
.my-assignments .row:last-child { border-bottom: 0; }

/* Scheduling: the list of all assignments, grouped by date, and a case's Assign button on the docket. */
.list .day-row th { background: var(--panel-2); text-align: left; padding-top: 10px; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
button.link:hover { text-decoration: underline; }
.docket-case { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.assign-chip.open { background: transparent; border: 1px dashed var(--warn); border-left: 4px solid var(--warn); }

/* Record page: live cameras. */
.live-cams { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; margin-top: 8px; }
.live-cam { position: relative; background: #000; border-radius: 6px; overflow: hidden; }
.live-cam canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 30vh; object-fit: contain; }
.block.sized .live-cam canvas { max-height: none; }
.live-cam-name { display: none; font-weight: 600; }
.live-cams.popped .live-cam { display: none; }
.live-cams.popped .live-cam-name { display: block; }
.live-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 6px; padding: 4px 8px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.live-badge { font-variant-numeric: tabular-nums; }
.live-badge.ok::before { content: '● '; color: #4caf50; }
.live-badge.warn { color: #ffb74d; }
/* Camera controls under a live camera: hold-to-move pad, zoom, speed, saved positions. */
.ptz { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; padding: 8px 2px 4px; }
.ptz-move { display: flex; gap: 8px; align-items: center; }
.ptz-pad { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 30px); gap: 2px; }
.ptz-zoom { display: grid; grid-template-rows: repeat(2, 30px); gap: 4px; }
.ptz-btn { padding: 0; min-width: 34px; font-size: 14px; line-height: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.ptz-btn.on { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.ptz-dot { align-self: center; justify-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.ptz-speed { display: grid; gap: 2px; font-size: 12px; }
.ptz-side { flex: 1; min-width: 160px; display: grid; gap: 6px; }
.ptz-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.ptz-note { font-size: 12px; }
.ptz-note:empty { display: none; }

/* Arrangeable blocks (Record, Note Take): two columns with a bar between them that sets their widths. */
.monitor.blocks { grid-template-columns: minmax(0, var(--left, 1fr)) 0 minmax(0, var(--right, 1fr)); column-gap: 6px; }
.block-col { min-height: 80px; align-content: start; }
.block-split { visibility: hidden; } /* keeps its empty place in the grid, so the second column stays in the third track */
.block-grip { display: none; }
.block.sized { overflow: auto; }
.monitor.blocks.arranging { grid-template-columns: minmax(0, var(--left, 1fr)) 10px minmax(0, var(--right, 1fr)); }
.arranging .block-split { visibility: visible; cursor: col-resize; border-radius: 5px; background: var(--accent-soft); border: 1px dashed var(--accent); }
.arranging .block-col { outline: 1px dashed var(--border); outline-offset: 2px; border-radius: 8px; }
.arranging .block { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 8px; overflow: auto; min-height: 48px; cursor: grab; }
/* While arranging, a block is moved by any part of it: its contents don't take clicks until Done. */
.arranging .block > :not(.block-grip):not(.block-resize) { pointer-events: none; user-select: none; }
.block-resize { display: none; }
.arranging .block-resize { display: block; position: sticky; bottom: 0; cursor: ns-resize; text-align: center; font-size: 12px; font-weight: 600; color: var(--accent-text); background: var(--accent); padding: 3px; border-radius: 0 0 6px 6px; user-select: none; }
.arrange-btn { font-weight: 600; border-color: var(--accent); color: var(--accent); }
.arrange-btn.primary { color: var(--accent-text); }
/* A block given a height fills it: its panel stretches, and a list or transcript inside takes the rest. */
.block.sized { display: flex; flex-direction: column; }
.block.sized > .panel, .block.sized > div:not(.block-grip):not(.block-resize) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.block.sized .panel > .stack { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.block.sized .transcript, .block.sized .tag-list { flex: 1; min-height: 0; max-height: none; }
.arranging .block-grip { display: block; cursor: grab; user-select: none; font-size: 12px; font-weight: 600; color: var(--accent-text); background: var(--accent); padding: 3px 8px; border-radius: 6px 6px 0 0; }
.block.dragging { opacity: .45; }
@media (max-width: 1000px) {
  .monitor.blocks, .monitor.blocks.arranging { grid-template-columns: 1fr; }
  .arranging .block-split { display: none; }
}
.page-head { gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.page-head .room-tabs { margin-bottom: 0; }
.block-note { display: none; }
.arranging .block > :empty + .block-note { display: block; padding: 14px 12px; color: var(--muted); font-style: italic; background: var(--panel); border: 1px solid var(--border); border-top: 0; }

/* Realtime: a stenographer's realtime text with page:line numbers, and each viewer's highlights and notes. */
.rt-uncertified { font-size: 12px; color: var(--muted); border-left: 3px solid var(--warn); padding: 2px 8px; margin: 8px 0 0; }
.rt-held { background: var(--rec); color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .04em; padding: 6px 12px; border-radius: 6px; margin-top: 8px; }
.rt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
@media (max-width: 900px) { .rt-layout { grid-template-columns: minmax(0, 1fr); } }
.rt-text { position: relative; height: calc(100vh - 300px); min-height: 260px; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 0 24px;
  font: var(--rt-size, 18px)/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.rt-text.rt-pane { height: min(420px, 40vh); min-height: 200px; --rt-size: 14px; }
.rt-pane .rt-line { cursor: default; }
.rt-line { position: relative; display: flex; gap: 14px; padding: 0 12px; cursor: pointer; white-space: pre-wrap; }
.rt-line:hover { background: var(--panel-2); }
.rt-num { flex: none; min-width: 3.6em; text-align: right; color: var(--muted); font-size: .72em; padding-top: .35em; user-select: none; }
.rt-t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rt-line.page-start { border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 4px; }
.rt-line.page-start::before { content: attr(data-page); position: absolute; right: 12px; top: -1.25em; font: 11px/1 system-ui, sans-serif; color: var(--muted); background: var(--panel); padding: 0 4px; }
.rt-line.held .rt-t { color: var(--muted); font-style: italic; }
.rt-line.has-note .rt-num::after { content: " ✎"; color: var(--accent); }
.rt-line.current { outline: 2px solid var(--accent); outline-offset: -2px; }
.rt-line.flash { animation: rt-flash 1.4s ease-out; }
@keyframes rt-flash { from { background: var(--accent-soft); } to { background: transparent; } }
.rt-text mark { background: rgba(255, 152, 0, .45); color: inherit; border-radius: 2px; }
.hl-yellow { background: rgba(255, 214, 0, .30); } .hl-green { background: rgba(76, 175, 80, .26); }
.hl-blue { background: rgba(33, 150, 243, .24); } .hl-pink { background: rgba(233, 30, 99, .22); }
.rt-menu { position: absolute; z-index: 5; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.rt-swatch { width: 26px; height: 26px; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid var(--border); }
.rt-swatch.on { border-color: var(--text); }
.rt-notes h2 { margin-top: 0; }
.rt-notes-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 420px); overflow: auto; }
.rt-note { display: flex; gap: 6px; align-items: baseline; text-align: left; border: 0; border-radius: 6px; padding: 4px 6px; background: transparent; }
.rt-note:hover { background: var(--panel-2); }
.rt-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--border); }
.rt-dot.hl-none { background: transparent; }

/* Realtime viewers: My Realtime's machine transcript (each line's time of day), messages with the court, and the
   court's list of who is following. */
.rt-machine .rt-num { min-width: 6.6em; }
.rv-draft { color: var(--muted); font-style: italic; cursor: default; }
.rv-message-block { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.rv-message-block h2 { font-size: 16px; margin: 0 0 6px; }
.rv-message-block textarea { width: 100%; box-sizing: border-box; }
.rv-messages { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; margin: 6px 0; }
.rv-message { padding: 4px 8px; border-radius: 6px; background: var(--panel-2); font-size: 14px; }
.rv-message.court { background: var(--accent-soft); }
.rv-message .muted { font-size: 12px; }
.rv-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.rv-dot.on { background: var(--ok, #2e7d32); }
/* Issues and Quick Marks: an Issue's color down the left of its section's lines and its name where the section
   starts; a flag on a Quick Mark; the newest lines at the foot of the text while reading back. */
.rt-line.in-issue::after { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 5px; background: var(--iss); border-radius: 2px; }
.rt-line.mark-start { outline: 2px dashed var(--accent); outline-offset: -2px; }
.rt-marks { flex: none; display: flex; gap: 4px; align-items: center; font: 12px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.rt-marks:empty { display: none; }
.rv-chip { display: inline-block; padding: 1px 7px; border-radius: 10px; color: #fff; background: var(--iss, #6B7280); font: 600 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; white-space: nowrap; }
.rv-flag { color: #D64545; font-size: 15px; line-height: 1; }
.rv-mark-tools { display: inline-flex; gap: 6px; margin-left: 10px; }
.rv-pending { margin: 8px 0 0; }
.rv-marks-block { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.rv-marks-block h2 { font-size: 16px; margin: 0; }
.rv-marks-list { max-height: 240px; margin-top: 6px; }
.rv-downloads { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.rv-downloads h2 { font-size: 16px; margin: 0 0 6px; }
.rv-mark { display: flex; align-items: baseline; gap: 4px; }
.rv-mark .rt-note { flex: 1; min-width: 0; }
.rv-bar { flex: none; width: 5px; height: 14px; border-radius: 2px; background: var(--iss); }
.rv-text-wrap { position: relative; min-width: 0; }
.rv-live { position: absolute; left: 1px; right: 1px; bottom: 1px; z-index: 4; padding: 6px 12px 8px; background: var(--panel); border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 14px rgba(0, 0, 0, .12); }
.rv-live .row { margin-bottom: 2px; }
.rv-live-line { display: flex; gap: 14px; font: 16px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-live-line .rt-num { min-width: 6.6em; }

/* Reporters page: each court reporter's rates, dictionaries and files under their row. */
table.list tr.reporter-extra td { border-top: 0; padding-top: 0; font-size: 13px; color: var(--muted); }
/* The reporter Scorecard: the court's average row stands apart; each measure's detail lines are small. */
table.scorecard tr.scorecard-court td { background: var(--panel-2); }
table.scorecard td { vertical-align: top; }
table.scorecard td .muted { font-size: 12px; }
label.button input[type=file] { display: none; }

/* Realtime, Live Editors: edited lines have a bar at the left; each editor's marker has their own color. */
.rt-line.edited { box-shadow: inset 4px 0 0 var(--accent); }
.rt-line.edited .rt-num { color: var(--accent); }
.rt-line.reporter-changed { box-shadow: inset 4px 0 0 var(--warn); }
.rt-line.locked { cursor: default; }
.rt-line.locked .rt-t { color: var(--muted); }
.rt-line.editing { background: var(--accent-soft); }
.rt-input { width: 100%; font: inherit; line-height: inherit; padding: 0 2px; margin: 0 -3px; border: 1px solid var(--accent); border-radius: 3px; background: var(--panel); color: var(--text); min-height: 0; }
.rt-who { position: absolute; right: 8px; top: 0; display: flex; gap: 3px; pointer-events: none; }
.rt-badge { display: inline-block; min-width: 1.9em; padding: 0 4px; border-radius: 9px; font: 600 11px/1.6 system-ui, sans-serif; text-align: center; color: #fff; background: var(--muted); }
.rt-badge.ed-0 { background: #1e7b5f; } .rt-badge.ed-1 { background: #8e3b9e; } .rt-badge.ed-2 { background: #b8541b; }
.rt-badge.ed-3 { background: #2a63b8; } .rt-badge.ed-4 { background: #a3324a; } .rt-badge.ed-5 { background: #5d6b1e; }
.rt-editors { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 8px; font-size: 14px; }
.rt-editor { display: inline-flex; gap: 4px; align-items: center; }
.rt-history-text { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; }

/* Assign dialog: whom to choose, with each reporter's details for that time and courtroom. */
.candidates-box { display: flex; flex-direction: column; gap: 6px; }
.candidates-tools { margin: 0; }
.candidates { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
.candidate { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; font-size: 13px; }
.candidate .candidate-main { flex: 1; }
.candidate.chosen { background: var(--accent-soft); }
.candidate.busy .candidate-main > b { opacity: .7; }
.candidate .candidate-why { color: var(--warn); }
.pill.home { background: var(--accent); color: var(--accent-text, #fff); }
.stars { display: inline-flex; gap: 2px; }
.stars button { min-height: 0; padding: 0 2px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; }
.stars button.on { color: #f5a623; }

/* Shown when SmartRM was updated while the page was open. */
.update-bar { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; margin-top: 4px; border-radius: 6px; background: var(--accent-soft); border: 1px solid var(--accent); }
.update-bar > span { flex: 1; min-width: 0; }

/* Speak into Crtrm: held down to talk; red while live in the courtroom. */
.talk-btn { font-weight: 600; touch-action: none; user-select: none; -webkit-user-select: none; }
.talk-btn.talking { background: var(--rec); border-color: var(--rec); color: #fff; }
.talk-note { font-size: 13px; }

/* Which SmartRM this is, in the top bar: small, readable, click for the details. */
.version-btn { font: 12px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--muted); background: transparent; border: 1px solid transparent; padding: 3px 6px; min-height: 0; }
.version-btn:hover { border-color: var(--border); color: var(--text); }
.link-btn { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.report-btn { white-space: nowrap; }
.report-preview { max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin: 6px 0 0; }
.prompt-text { width: 100%; font: 12px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; }
.verify-head { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); }
.verify-head strong { font-size: 18px; }
.verify-ok { color: var(--ok); }
.verify-bad { color: var(--rec); }
.verify-warn { color: var(--warn); }
.verify-head.verify-ok { border-color: currentColor; }
.verify-head.verify-bad { border-color: currentColor; }
.sso-button { display: block; text-align: center; text-decoration: none; }
.login-or { text-align: center; margin: 0; }
.update-changes { margin: 0; padding-left: 18px; max-height: 320px; overflow: auto; }
/* Foot pedal: the player's pedal buttons light while pressed; the setup dialog's test tiles. */
.transport button.pedal-on { background: var(--accent); color: var(--accent-text); }
.pedal-pill { border: 0; cursor: pointer; }
.pedal-setup h3 { margin: 12px 0 4px; font-size: 14px; }
.pedal-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pedal-tile { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); }
.pedal-tile.on { background: var(--accent); color: var(--accent-text); }
.pedal-tile.on small { color: inherit; }
.pedal-tile.learning { outline: 2px dashed var(--accent); }
@media (max-width: 520px) { .pedal-tiles { grid-template-columns: 1fr; } }

/* Test My Realtime (views/realtime-test.js): the checklist, the test's text and the Help agent. */
.rt-test-title { margin: 0; }
.rt-checks { display: flex; flex-direction: column; gap: 8px; }
.rt-check { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: start; }
.rt-check .pill { justify-self: start; margin-top: 2px; }
.rt-check .muted { margin-top: 2px; }
.rt-test-text { font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace); font-size: 14px; white-space: pre-wrap; word-break: break-word;
  max-height: 320px; min-height: 60px; overflow: auto; margin: 0; padding: 10px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); }
.help-log { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.help-msg { padding: 8px 10px; border-radius: 8px; background: var(--panel-2); white-space: pre-wrap; max-width: 85%; }
.help-msg.me { align-self: flex-end; border: 1px solid var(--border); background: var(--panel); }
.help-msg .muted { font-size: 12px; margin-bottom: 2px; }
.help-ask { align-items: flex-end; flex-wrap: nowrap; }
.help-ask textarea { flex: 1; min-width: 0; }
.help-note { font-size: 12px; margin: 0; }
.rt-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rt-compare .rt-test-text { max-height: 600px; }
/* Writing Checks: an error in the text that arrived; .missing: words read that didn't arrive. */
.wc-err { color: var(--rec); background: var(--rec-soft); border-radius: 3px; text-decoration: underline wavy var(--rec); text-underline-offset: 3px; cursor: help; }
.wc-err.missing { font-style: italic; text-decoration: none; }
.wc-err.flash { outline: 2px solid var(--rec); outline-offset: 1px; }
@media (max-width: 800px) { .rt-compare { grid-template-columns: 1fr; } }
