:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211b;
  background: #f3f6f3;
  --surface: #ffffff;
  --line: #dbe4dc;
  --muted: #66736b;
  --green: #176b46;
  --green-dark: #0f5134;
  --green-soft: #e6f4ec;
  --amber-soft: #fff5d8;
  --red: #b42318;
  --red-soft: #feeceb;
  --shadow: 0 12px 36px rgba(28, 45, 34, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow: hidden;
  background: #f3f6f3;
}

[hidden] { display: none !important; }

button, input, textarea, select { font: inherit; }
button, select, input { min-height: 44px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.page-shell {
  width: min(1100px, calc(100% - 24px));
  height: 100dvh;
  margin-inline: auto;
  padding-block: 10px 76px;
}

#task-view:not([hidden]) {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
}

.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
}

.login-card, .empty-card {
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card { display: grid; gap: 10px; }
.login-card h1, .empty-card h1 { margin: 0; }
.login-card label { margin-top: 8px; font-weight: 700; }
.login-credential { text-align: left; }

input, textarea, select {
  width: 100%;
  border: 1px solid #bdc9c0;
  border-radius: 10px;
  background: #fff;
  color: inherit;
}

input, select { padding: 9px 12px; }
textarea {
  min-height: calc(1lh + 18px);
  max-height: calc(4lh + 18px);
  padding: 12px;
  resize: none;
  line-height: 1.6;
}

input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(23, 107, 70, 0.2);
  outline-offset: 2px;
  border-color: var(--green);
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.primary { background: var(--green); color: #fff; font-weight: 800; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.secondary { border-color: #bdc9c0; background: #fff; color: #26332b; font-weight: 750; }
.secondary:hover { background: #f5f8f6; }
.quiet { background: transparent; border-color: var(--line); color: #3e4c43; }
.full { width: 100%; margin-top: 12px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.muted { margin: 6px 0; color: var(--muted); }
.form-error { min-height: 24px; margin: 2px 0 0; color: var(--red); }

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  flex: 0 0 auto;
  gap: 16px;
  align-items: center;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.app-header h1 { margin: 0; font-size: 1.05rem; }
.app-header .eyebrow { margin-bottom: 1px; font-size: 0.68rem; }
.header-stats { display: flex; gap: 14px; margin: 0; }
.header-stats div { min-width: 76px; }
.header-stats dt { color: var(--muted); font-size: 0.68rem; }
.header-stats dd { margin: 1px 0 0; font-size: 0.88rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box span { font-weight: 750; }
.header-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #3e4c43;
  text-decoration: none;
}
.shortcuts-help-button {
  width: 44px;
  min-height: 44px;
  padding: 4px;
  font-size: 1.05rem;
}

.journey-banner {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid #b9ddc8;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 850;
  text-align: center;
}

.context-panel {
  flex: 0 0 auto;
  padding: 7px 12px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 3px;
}

.section-heading h2 { margin: 0; font-size: 0.92rem; }
.context-panel .eyebrow { margin-bottom: 0; font-size: 0.66rem; }
.call-id { color: var(--muted); font-size: 0.82rem; direction: ltr; }
.context-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 10px; }
.context-toggle { min-height: 44px; }
.flow-list { display: grid; gap: 2px; }

.flow-turn {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 2px 8px;
  border-radius: 7px;
  background: #f7f9f7;
  color: #647068;
  font-size: 0.76rem;
  line-height: 1.35;
}

.flow-turn.candidate {
  border: 1px solid #b9ddc8;
  background: var(--green-soft);
  color: #1f3527;
}

.role-badge { font-weight: 850; white-space: nowrap; }
.context-panel .turn-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stepper-button { min-height: 44px; }
.stepper-progress { display: grid; gap: 4px; min-width: 150px; text-align: center; }
.stepper-progress strong { font-size: 0.82rem; }
.segment-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; min-height: 10px; }
.segment-dot {
  width: 10px;
  height: 10px;
  border: 1px solid #9eaba1;
  border-radius: 50%;
  background: #fff;
}
.segment-dot.complete { border-color: var(--green); background: var(--green-soft); }
.segment-dot.active { border-color: var(--green-dark); background: var(--green); box-shadow: 0 0 0 3px rgba(23, 107, 70, 0.15); }
.segment-workspace, .segments-list { min-height: 0; }
.segment-workspace { flex: 1 1 auto; }
.segments-list { height: 100%; }

.segment-card {
  height: 100%;
  overflow: hidden;
  padding: 12px 16px;
  border: 2px solid #b8c9bc;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.segment-card.current { border-color: var(--green); }
.segment-card:not(.pass1-card) { display: flex; min-height: 0; flex-direction: column; }
.segment-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 7px; }
.segment-top h3 { margin: 0; font-size: 0.96rem; }
.listen-state { font-size: 0.88rem; font-weight: 800; color: #926414; }
.listen-state.done { color: var(--green); }
.step-name { color: var(--green); font-size: 0.82rem; font-weight: 850; white-space: nowrap; }
.inline-flow-button { min-height: 44px; margin-inline-start: auto; padding-block: 6px; font-size: 0.78rem; }
.native-audio { width: 100%; min-width: 180px; min-height: 44px; }

.pass1-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 3px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.pass1-card.segment-card { padding: 8px 12px; }
.audio-sandwich {
  display: flex;
  flex: 0 0 auto;
  min-height: 0;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  align-content: flex-start;
  gap: 2px;
}
.audio-sandwich > .step-context,
.audio-sandwich > .player-controls {
  flex: 0 0 auto;
  margin-block: 0;
}
.pass1-work-divider {
  flex: 0 0 auto;
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--line);
}
.pass1-title-row {
  display: grid;
  grid-template-columns: auto minmax(80px, 1fr) auto;
  min-height: 32px;
  gap: 9px;
  margin-bottom: 0;
}
.pass1-title-row h3 {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pass1-title-row .inline-flow-button {
  min-height: 32px;
  padding: 3px 9px;
  font-size: 0.78rem;
}
.segment-title-dots {
  align-self: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-height: 7px;
  overflow: hidden;
}
.segment-title-dots .segment-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
}
.segment-title-dots .segment-dot.active { box-shadow: 0 0 0 2px rgba(23, 107, 70, 0.14); }
.step-panel { display: grid; min-height: 0; align-content: start; gap: 5px; }
.step-context {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 5px 8px 6px;
  border: 1px dashed #c7d4ca;
  border-radius: 10px;
  background: #f7faf8;
}
.context-strip-label {
  justify-self: start;
  padding: 2px 8px;
  border: 1px solid #d2ddd5;
  border-radius: 999px;
  background: #edf3ef;
  color: #526158;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.3;
}
.step-context .flow-turn {
  grid-template-columns: 82px minmax(0, 1fr);
  padding: 1px 5px;
  background: transparent;
  font-size: 0.9rem;
  line-height: 1.5;
}
.step-context .turn-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.context-empty { padding-inline: 5px; color: var(--muted); font-size: 0.82rem; }
.context-after {
  border-color: #d7d0bf;
  background: #fbfaf6;
}
.context-after .context-strip-label {
  border-color: #ded7c7;
  background: #f3f0e8;
}
.transcribe-panel .step-context { padding-block: 4px; }
.pass1-card .step-context {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1px 7px;
  padding: 3px 6px;
}
.pass1-card .context-strip-label {
  grid-column: 1;
  grid-row: 1 / span 2;
  padding: 1px 7px;
  font-size: 0.82rem;
}
.pass1-card .step-context .flow-turn {
  grid-column: 2;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 6px;
  padding: 0 3px;
  font-size: 0.98rem;
  line-height: 1.35;
}
.pass1-card .step-context .context-empty {
  grid-column: 2;
  padding-inline: 3px;
  font-size: 0.9rem;
}

.player-controls {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.pass1-card .player-controls {
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  gap: 6px;
  margin: 0;
}

.judge-panel .player-controls { margin: 1px 0; }
.judge-audio { min-height: 48px; }

.play-button { background: #22382b; color: #fff; font-weight: 800; }
.speed-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; }
.speed-select { width: auto; min-width: 78px; }
.field-label { display: block; margin: 8px 0 5px; font-weight: 800; }
.compact-label { margin: 2px 0 0; font-size: 0.82rem; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  min-height: 44px;
  padding: 8px 12px;
  border-color: #cbd5cd;
  background: #fff;
  color: #39483f;
  font-size: 0.86rem;
}
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.chip[aria-checked="true"] { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); }
.judge-chips { flex-wrap: nowrap; }
.judge-chips .chip { flex: 1 1 auto; min-width: 0; padding-inline: 9px; white-space: nowrap; }
.accent-chips .chip { font-size: 0.78rem; }
.choice-chip { display: grid; place-items: center; gap: 2px; }
.choice-label { font-weight: 800; }
.choice-help {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
  white-space: normal;
}
.choice-chip[aria-checked="true"] .choice-help { color: var(--green-dark); }
.quality-chips .choice-chip { min-height: 54px; }
.transcript-label {
  display: grid;
  gap: 3px;
  margin: 0;
}
.transcript-textarea {
  min-height: calc(1lh + 14px);
  font-size: 1.16rem;
  line-height: 1.65;
}
.transcript-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}
.transcript-hint.optional { color: #8a928d; }
.note-label { display: grid; gap: 3px; margin: 0; }
.note-input { min-height: 44px; padding-block: 7px; }
.broken-media-row { min-height: 28px; }
.pass1-card .compact-label {
  margin: 1px 0 0;
  font-size: 0.9rem;
}
.pass1-card .chip {
  min-height: 44px;
  padding: 4px 9px;
  font-size: 0.94rem;
}
.pass1-card .choice-help { font-size: 0.75rem; line-height: 1.2; }
.pass1-card .quality-chips .choice-chip { min-height: 44px; }
.pass1-card .accent-chips .chip { font-size: 0.9rem; }
.accent-choice-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.accent-choice-row .accent-chips { flex: 1 1 auto; min-width: 0; }
.accent-other-field { flex: 0 0 180px; }
.accent-other-input {
  min-height: 44px;
  padding: 4px 9px;
  font-size: 0.88rem;
}
.pass1-card .transcript-label {
  gap: 2px;
  font-size: 0.94rem;
}
.pass1-card .transcript-textarea {
  min-height: calc(1lh + 12px);
  max-height: calc(4lh + 12px);
  padding: 6px 9px;
  font-size: 1.2rem;
  line-height: 1.45;
}
.pass1-card .transcript-hint { font-size: 0.78rem; line-height: 1.25; }
.pass1-utility-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.pass1-card .note-label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}
.pass1-card .note-input {
  min-height: 44px;
  padding-block: 4px;
  font-size: 0.88rem;
}
.pass1-card .broken-media-row { min-height: 24px; }
.pass1-card .broken-media-action,
.pass1-card .broken-media-undo { min-height: 44px; }
.broken-media-action {
  min-height: 44px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.broken-media-action:hover { color: var(--red); }
.broken-media-status { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.broken-media-chip {
  padding: 4px 9px;
  border: 1px solid #e4a7a2;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 850;
}
.broken-media-undo {
  min-height: 44px;
  padding: 2px 7px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 0.76rem;
  text-decoration: underline;
}

.judge-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.judge-hint { margin: 0; color: var(--muted); font-size: 0.78rem; }
.judge-hint.ready { color: var(--green); font-weight: 750; }
.judge-hint.needs-listen { color: #805c13; font-weight: 800; }
.compact-flag { flex: 0 0 auto; min-height: 44px; padding-block: 6px; }
.transcribe-panel .field-label { margin-top: 1px; }
.transcribe-panel .flags { margin-top: 1px; }
.small-replay { justify-self: start; min-height: 44px; }

.flags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.flag-button { border-color: #cbd5cd; background: #fff; }
.flag-button[aria-pressed="true"] { border-color: #b7841c; background: var(--amber-soft); color: #67490d; }
.flag-button.broken[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); color: var(--red); }

.pass2-status {
  color: var(--green);
  font-size: 0.88rem;
  font-weight: 800;
}
.pass2-status.done { color: var(--green-dark); }
.pass2-status.corrected { color: #44347d; }

.transcript-correction-panel {
  display: grid;
  gap: 9px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #cabfe9;
  border-radius: 12px;
  background: #fbfaff;
}
.correction-title { margin: 0; color: #44347d; }
.correction-player { margin: 0; }
.correction-error { margin: 0; }
.correction-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.correction-chip {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #c9c1e5;
  border-radius: 999px;
  background: #eeeaff;
  color: #44347d;
}
.correction-summary .quiet { min-height: 44px; }
.correction-undo { color: var(--red); }

.pass2-junk-workspace {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  margin-top: 10px;
  padding-top: 12px;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.pass2-junk-notice {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #e2c676;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #67490d;
  font-weight: 850;
  text-align: center;
}
.pass2-junk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.junk-correction-action { background: #44347d; }
.junk-correction-action:hover:not(:disabled) { background: #392a70; }
.pass2-junk-status {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #9bceb1;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 850;
  text-align: center;
}

.annotation-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.annotation-workspace.panel-open { grid-template-columns: minmax(0, 1fr) minmax(330px, 42%); }
.annotation-main { min-width: 0; overflow: auto; padding: 10px 4px 12px; }
.pass1-mapping-workspace {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
}
.pass1-mapping-workspace .annotation-list { grid-template-columns: minmax(0, 1fr); }
.live-token-label { margin: 10px 0 0; color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.annotation-toolbar { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 9px; }
.primary-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-button {
  border-color: #b9c7bd;
  background: #fff;
  color: #26332b;
  font-weight: 850;
}
.mode-button[aria-pressed="true"] {
  border-color: #6657a5;
  background: #eeeaff;
  color: #392a70;
  box-shadow: inset 0 0 0 1px #6657a5;
}
.type-guide { margin-inline-start: auto; }
.type-guide[open] { flex-basis: 100%; }
.type-guide summary {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #3e4c43;
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}
.type-guide summary::-webkit-details-marker { display: none; }
.type-guide-body {
  max-height: 330px;
  margin-top: 8px;
  padding: 12px;
  overflow: auto;
  border: 1px solid #d4cdeb;
  border-radius: 12px;
  background: #fbfaff;
}
.type-guide-body h4 { margin: 0 0 8px; }
.type-guide-body h4:not(:first-child) { margin-top: 14px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.guide-card,
.entity-type-card,
.kind-card {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d4cdeb;
  border-radius: 10px;
  text-align: start;
}
.guide-card { background: #fff; }
.mapping-guide-card { background: #f4f1ff; }
.help-card-label { font-size: 0.84rem; }
.help-card-code { direction: ltr; color: inherit; font-size: 0.72rem; overflow-wrap: anywhere; }
.help-card-example { color: inherit; font-size: 0.76rem; line-height: 1.45; opacity: 0.86; }

.token-transcript {
  min-height: 96px;
  padding: 15px;
  border: 1px solid #bdc9c0;
  border-radius: 12px;
  background: #fbfcfb;
  font-size: 1.08rem;
  line-height: 2.2;
  white-space: pre-wrap;
  cursor: text;
}

.surface-token {
  display: inline-block;
  min-height: 44px;
  padding: 8px 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  unicode-bidi: isolate;
  cursor: pointer;
}

.surface-token:hover,
.surface-token:focus-visible {
  background: #dceee3;
  box-shadow: inset 0 -3px 0 var(--green);
}
.surface-token.selected {
  background: #ffd86f;
  color: #4f3300;
  box-shadow: inset 0 -3px 0 #9d6800, 0 0 0 2px rgba(183, 132, 28, 0.18);
}

.selection-hint {
  min-height: 24px;
  margin: 9px 0 7px;
  padding: 8px 11px;
  border: 1px solid #c9c1e5;
  border-radius: 9px;
  background: #f4f1ff;
  color: #44347d;
  font-size: 0.86rem;
  font-weight: 750;
}

.annotation-side-panel,
.junk-correction-form {
  padding: 16px;
  border: 1px solid #cabfe9;
  background: #fbfaff;
}
.annotation-side-panel {
  min-width: 0;
  overflow: auto;
  border-block: 0;
  border-inline-end: 0;
  animation: side-panel-in 180ms ease-out;
}
@keyframes side-panel-in {
  from { opacity: 0; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

.popover-head,
.popover-actions,
.issue-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.popover-head h4 { margin: 0; }
.panel-close { min-height: 44px; padding-block: 5px; }
.selected-surface { margin: 10px 0; color: #44347d; font-weight: 800; }
.taxonomy-search { margin-bottom: 10px; }
.taxonomy-block { margin-top: 10px; }
.taxonomy-block h5 { margin: 0 0 7px; }
.taxonomy-options, .mapping-kinds { display: flex; flex-wrap: wrap; gap: 7px; }
.entity-type-palette,
.mapping-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.entity-type-card,
.kind-card { min-height: 78px; }
.entity-type-card[aria-pressed="true"],
.kind-card[aria-pressed="true"] {
  border-color: #392a70;
  box-shadow: inset 0 0 0 2px #6657a5;
}
.taxonomy-option, .kind-chip {
  border-color: #d4cdeb;
  background: #fff;
  color: #44347d;
}
.taxonomy-option[aria-pressed="true"], .kind-chip[aria-pressed="true"] {
  border-color: #6657a5;
  background: #eeeaff;
  color: #392a70;
}
.popover-actions { margin-top: 14px; }
.popover-error { min-height: 22px; margin: 7px 0 0; color: var(--red); }

.suggestions-list { margin-top: 12px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion-chip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 6px 8px;
  border: 2px dashed #8d7fc4;
  border-radius: 999px;
  background: #fbfaff;
  color: #44347d;
}
.suggestion-badge { font-size: 0.7rem; font-weight: 850; }
.suggestion-awaiting { color: #805c13; font-size: 0.75rem; font-weight: 800; }
.suggestion-actions { display: flex; gap: 4px; }
.suggestion-actions button { min-width: 44px; min-height: 44px; padding: 2px 8px; }
.suggestion-confirm { background: var(--green-soft); color: var(--green-dark); }
.suggestion-reject { background: var(--red-soft); color: var(--red); }
.annotation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.annotation-section { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfa; }
.annotation-list-title { margin: 0; font-size: 0.92rem; }
.annotation-empty { margin: 8px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.annotation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 7px;
  margin-top: 7px;
}
.annotation-edit {
  min-width: 0;
  overflow-wrap: anywhere;
  border-color: transparent;
  text-align: start;
  font-weight: 750;
}
.annotation-delete {
  width: 64px;
  padding: 0;
  border-color: #efc3bf;
  background: #fff;
  color: var(--red);
  font-weight: 900;
}
.annotation-edit.mapping-chip { border-color: #d4cdeb; background: #f4f1ff; color: #44347d; }
.annotation-row.orphaned .annotation-edit {
  border-color: #d8746d;
  background: var(--red-soft);
  color: var(--red);
  box-shadow: inset 0 0 0 1px #d8746d;
}
.entity-color-0 { background: #e5f3ff; color: #174b76; }
.entity-color-1 { background: #e6f4ec; color: #0f5134; }
.entity-color-2 { background: #fff0d8; color: #70470a; }
.entity-color-3 { background: #f5e9ff; color: #5d2a78; }
.entity-color-4 { background: #ffe8ed; color: #84223a; }
.entity-color-5 { background: #e5f5f4; color: #155a56; }
.entity-color-6 { background: #edf0ff; color: #344386; }
.entity-color-7 { background: #f2efe9; color: #574b3a; }

.pass2-flags { align-items: center; margin-top: 14px; }
.junk-raise-button {
  min-height: 44px;
  padding: 5px 10px;
  border-color: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.junk-raise-button:hover:not(:disabled) { color: #67490d; }
.junk-correction-form label { display: block; margin-top: 9px; font-weight: 750; }
.junk-correction-form textarea { min-height: 82px; }
.junk-correction-reason {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid #e2c676;
  border-radius: 9px;
  background: var(--amber-soft);
  font-weight: 800;
}
.issue-actions { margin-top: 12px; }

.submit-bar {
  position: fixed;
  z-index: 10;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 7px max(12px, calc((100vw - 1100px) / 2));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -8px 24px rgba(28, 45, 34, 0.07);
}

.gate-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.submit-bar p { margin: 3px 0 0; font-size: 0.85rem; }
.submit-actions { display: flex; gap: 8px; }
kbd { padding: 2px 5px; border: 1px solid currentColor; border-radius: 4px; font: inherit; font-size: 0.72rem; opacity: 0.75; }

.flow-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: 86dvh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  box-shadow: 0 24px 80px rgba(18, 31, 23, 0.28);
}

.flow-dialog::backdrop { background: rgba(20, 31, 24, 0.58); }
.flow-dialog-card { display: flex; max-height: 86dvh; flex-direction: column; }
.flow-dialog-header {
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.flow-dialog-header h2 { margin: 0; font-size: 1.12rem; }
.full-flow-list { gap: 7px; padding: 14px 16px 18px; overflow: auto; }
.full-flow-list .flow-turn {
  grid-template-columns: 92px minmax(0, 1fr);
  padding: 9px 12px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.full-flow-list .turn-text { overflow-wrap: anywhere; white-space: normal; }

.shortcuts-dialog { width: min(520px, calc(100% - 28px)); }
.shortcuts-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 16px;
}
.shortcuts-list div {
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: #f7f9f7;
}
.shortcuts-list dt, .shortcuts-list dd { margin: 0; }
.shortcuts-list dd { color: #3e4c43; }
.shortcuts-note {
  margin: 0 16px 16px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 750;
  text-align: center;
}

.empty-card { margin: 16vh auto 0; text-align: center; }
.empty-card button { margin: 12px 4px 0; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 1.7rem; }

.toast {
  position: fixed;
  z-index: 30;
  top: 18px;
  left: 50%;
  width: min(520px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 14px 18px;
  border: 1px solid #e4a7a2;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
  box-shadow: var(--shadow);
  text-align: center;
  font-weight: 800;
}

.toast[data-kind="success"] { border-color: #9bceb1; background: var(--green-soft); color: var(--green-dark); }
.toast[data-kind="info"] { border-color: #bfd0df; background: #edf5fb; color: #234d70; }

@media (max-width: 700px) {
  .page-shell { width: min(100% - 12px, 1100px); padding-block: 6px 122px; }
  .app-header { grid-template-columns: 1fr auto; gap: 8px; }
  .header-stats { display: none; }
  .user-box span { display: none; }
  .context-actions .call-id { display: none; }
  .flow-turn { grid-template-columns: 74px minmax(0, 1fr); }
  .player-controls { grid-template-columns: 1fr 1fr; }
  .pass1-card .player-controls { grid-template-columns: 1fr 1fr; }
  .native-audio { grid-column: 1 / -1; grid-row: 1; }
  .submit-bar {
    grid-template-columns: 1fr minmax(120px, 1.2fr) 1fr;
    gap: 6px;
    padding: 6px;
  }
  .stepper-progress { grid-column: 2; grid-row: 1; min-width: 0; }
  #previous-segment { grid-column: 1; grid-row: 1; }
  #next-segment { grid-column: 3; grid-row: 1; }
  .submit-actions { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: center; }
  .popover-head { align-items: stretch; flex-direction: column; }
  .full-flow-list .flow-turn { grid-template-columns: 1fr; gap: 2px; }
  .segment-top .step-name { display: none; }
  .inline-flow-button { margin-inline-start: auto; }
  .step-context .flow-turn { grid-template-columns: 72px minmax(0, 1fr); }
  .judge-chips { flex-wrap: wrap; }
  .judge-chips .chip { flex: 1 1 30%; }
  .accent-chips .chip { flex-basis: 22%; }
  .accent-choice-row { align-items: stretch; flex-direction: column; gap: 4px; }
  .accent-other-field { flex: 0 0 auto; }
  .pass1-utility-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .judge-gate { align-items: stretch; flex-direction: column; gap: 3px; }
  .annotation-workspace.panel-open { grid-template-columns: minmax(0, 1fr); }
  .annotation-side-panel { max-height: 52dvh; border-inline: 0; border-bottom: 0; }
  .pass2-junk-actions { grid-template-columns: minmax(0, 1fr); }
  .guide-grid,
  .entity-type-palette,
  .mapping-kinds,
  .annotation-list { grid-template-columns: minmax(0, 1fr); }
  .shortcuts-list { grid-template-columns: minmax(0, 1fr); }
}

@media (max-height: 680px) {
  .pass1-card { padding-block: 8px; }
  .segment-top { margin-bottom: 3px; }
  .step-panel { gap: 3px; }
  .step-context { gap: 1px; padding: 3px 6px 4px; }
  .context-strip-label { padding-block: 1px; }
  .chip { min-height: 44px; padding-block: 6px; }
  .judge-hint { display: none; }
  textarea { min-height: calc(2lh + 14px); max-height: calc(4lh + 14px); }
}

.admin-body {
  min-height: 100dvh;
  overflow: auto;
  direction: ltr;
}
.admin-shell {
  width: min(1180px, calc(100% - 24px));
  margin-inline: auto;
  padding-block: 12px 40px;
}
.admin-header { position: sticky; z-index: 5; top: 8px; }
.admin-job-picker {
  display: grid;
  grid-template-columns: auto minmax(180px, 260px);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.admin-job-picker select { min-width: 0; color: #17211b; }
.admin-access-card { margin: 14vh auto 0; text-align: center; }
.admin-content { display: grid; gap: 16px; margin-top: 16px; }
.admin-section {
  color: #0b0b0b;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.admin-section-heading { margin-bottom: 14px; }
.admin-section-heading h2 { font-size: 1.2rem; }
.pipeline-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pipeline-warning-chip,
.pipeline-paused-badge {
  padding: 3px 8px;
  border: 1px solid #e2c676;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #0b0b0b;
  font-size: 0.68rem;
  font-weight: 850;
}

.pipeline-board-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}
.pipeline-board {
  display: grid;
  grid-template-columns: 240px 72px 260px 104px 230px 72px 230px;
  grid-template-rows: 34px minmax(220px, auto);
  width: max-content;
  min-width: 100%;
  align-items: start;
}
.pipeline-stage {
  grid-row: 2;
  min-width: 0;
  min-height: 220px;
  overflow: hidden;
  padding: 9px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.stage-transcription {
  grid-column: 1;
  border-top: 3px solid #2a78d6;
}
.stage-entities {
  grid-column: 3;
  border-top: 3px solid #eb6834;
}
.stage-entities.paused {
  border-color: #bdc9c0;
  background: #f3f5f3;
}
.stage-review {
  grid-column: 5;
  margin-top: 24px;
  border-top: 3px solid #eda100;
}
.stage-done {
  grid-column: 7;
  border-top: 3px solid #1baf7a;
}
.pipeline-stage header {
  display: grid;
  gap: 3px;
  min-height: 104px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.pipeline-stage h3 {
  margin: 0;
  color: #17211b;
  font-size: 0.88rem;
}
.pipeline-stage-title {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pipeline-paused-badge { padding-block: 2px; }
.pipeline-stage-metric {
  display: grid;
  justify-items: start;
  margin-top: 2px;
  line-height: 1.05;
}
.pipeline-stage-count {
  color: #17211b;
  font-size: 1.4rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pipeline-stage-items {
  margin-top: 2px;
  color: #66736b;
  font-size: 0.66rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pipeline-stage-split {
  margin-top: 3px;
  color: #52514e;
  font-size: 0.61rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pipeline-skeleton {
  color: #9aa39d;
  font-weight: 650;
}
.pipeline-stage header p {
  margin: 0;
  color: #66736b;
  font-size: 0.62rem;
  line-height: 1.25;
}
.pipeline-samples {
  display: grid;
  gap: 4px;
  padding-top: 7px;
}
.pipeline-sample {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid #e2e7e3;
  border-radius: 6px;
  background: #f8faf8;
}
.pipeline-call-id {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #17211b;
  font-size: 0.67rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipeline-sample-duration,
.pipeline-sample-age {
  flex: 0 0 auto;
  color: #66736b;
  font-size: 0.64rem;
  font-variant-numeric: tabular-nums;
}
.pipeline-sample-age {
  min-width: 24px;
  font-weight: 800;
  text-align: right;
}
.pipeline-samples-empty {
  margin: 0;
  padding: 12px 6px;
  color: #7b857f;
  font-size: 0.67rem;
  text-align: center;
}
.pipeline-connector {
  display: grid;
  grid-row: 2;
  align-content: start;
  justify-items: center;
  gap: 6px;
  padding: 72px 6px 0;
  color: #52514e;
  font-size: 0.61rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
}
.connector-transcribed { grid-column: 2; }
.pipeline-connector i,
.pipeline-clean-route i {
  position: relative;
  display: block;
  width: 100%;
  height: 2px;
  background: #52514e;
}
.pipeline-connector i::after,
.pipeline-clean-route i::after {
  position: absolute;
  top: 50%;
  right: -1px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #52514e;
  content: "";
  transform: translateY(-50%);
}
.pipeline-clean-route {
  display: grid;
  grid-column: 4 / 7;
  grid-row: 1;
  grid-template-columns: auto minmax(80px, 1fr);
  align-items: end;
  gap: 3px 10px;
  padding: 0 4px 7px;
  color: #52514e;
  font-size: 0.61rem;
  font-weight: 800;
}
.pipeline-clean-route .route-origin { justify-self: start; }
.pipeline-clean-route .route-clean-label { justify-self: end; }
.pipeline-clean-route i { grid-column: 1 / -1; }
.pipeline-fork-connector {
  grid-column: 4;
  padding-top: 79px;
}
.pipeline-fork-connector i,
.pipeline-return-connector i {
  height: 2px;
  background: repeating-linear-gradient(90deg, #52514e 0 7px, transparent 7px 12px);
}
.pipeline-fork-connector i {
  width: 84%;
  transform: rotate(17deg);
  transform-origin: left center;
}
.pipeline-return-connector {
  grid-column: 6;
  padding-top: 105px;
}
.pipeline-return-connector i {
  transform: rotate(-8deg);
  transform-origin: left center;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.chart-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.quality-card { grid-column: 1 / -1; }
.chart-heading {
  display: flex;
  min-height: 32px;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}
.chart-heading h3 { margin: 0; font-size: 1rem; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: #52514e;
  font-size: 0.76rem;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 5px;
  border-radius: 2px;
}
.series-p1 { background: #2a78d6; }
.series-p2 { background: #eb6834; }

.daily-chart { min-height: 218px; overflow-x: auto; }
.daily-plot {
  display: flex;
  min-width: max-content;
  min-height: 208px;
  align-items: end;
  border-bottom: 1px solid #8f918e;
}
.daily-groups { display: flex; align-items: end; gap: 20px; padding-inline: 8px; }
.daily-group {
  display: grid;
  min-width: 52px;
  justify-items: center;
  gap: 7px;
}
.daily-bar-pair {
  display: flex;
  height: 174px;
  align-items: end;
  gap: 2px;
}
.daily-bar-column {
  display: flex;
  height: 174px;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  gap: 3px;
}
.daily-bar-mark {
  width: 18px;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}
.daily-value-label,
.reviewer-value-label {
  color: #0b0b0b;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.daily-axis-label {
  min-height: 26px;
  color: #52514e;
  font-size: 0.72rem;
  white-space: nowrap;
}

.reviewers-chart { overflow-x: auto; }
.reviewer-rows {
  display: grid;
  min-width: 450px;
  border-inline-start: 1px solid #8f918e;
}
.reviewer-row {
  display: grid;
  grid-template-columns: minmax(125px, 0.44fr) minmax(230px, 1fr);
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.reviewer-row:last-child { border-bottom: 0; }
.reviewer-axis { display: grid; align-content: center; gap: 3px; }
.reviewer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reviewer-averages { color: #52514e; font-size: 0.7rem; line-height: 1.5; }
.reviewer-bars { display: grid; align-content: center; gap: 2px; }
.reviewer-bar-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
}
.reviewer-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 2px;
  background: #eef0ee;
}
.reviewer-bar-mark {
  height: 100%;
  min-width: 0;
  border-radius: 2px;
}

.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: start;
}
.admin-table thead th { color: var(--muted); font-size: 0.8rem; }
.admin-table td { font-variant-numeric: tabular-nums; }
.admin-table-empty { text-align: center !important; color: var(--muted); }
.quality-table { min-width: 660px; }
.quality-table td:not(:first-child) { color: #0b0b0b; }
.quality-table tfoot th,
.quality-table tfoot td {
  padding-top: 14px;
  border-bottom: 0;
  background: #f6f7f6;
}
.iaa-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.iaa-stat { color: #0b0b0b; font-variant-numeric: tabular-nums; }
.prefill-quality-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: #0b0b0b;
}
.prefill-quality-panel .chart-heading { margin-bottom: 10px; }
.prefill-quality-panel h4,
.prefill-quality-panel h5 { margin: 0; color: #0b0b0b; }
.prefill-quality-panel h4 { font-size: 1rem; }
.prefill-quality-panel h5 { font-size: 0.86rem; }
.prefill-quality-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(220px, 0.8fr) minmax(180px, 0.6fr);
  gap: 12px;
  align-items: start;
}
.prefill-quality-grid > section {
  display: grid;
  min-width: 0;
  gap: 8px;
}
.prefill-user-table { min-width: 520px; }
.prefill-client-table { min-width: 240px; }
.prefill-quality-panel .admin-table th,
.prefill-quality-panel .admin-table td,
.prefill-quality-panel .admin-table-empty { color: #0b0b0b; }
.prefill-mishearing-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.prefill-mishearing-list li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #0b0b0b;
  font-size: 0.78rem;
}
.prefill-word {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prefill-arrow { flex: 0 0 auto; }
.prefill-frequency {
  flex: 0 0 auto;
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
}
.prefill-quality-empty {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #0b0b0b;
  font-size: 0.78rem;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(320px, 0.8fr);
  align-items: start;
  gap: 16px;
}
.team-table { min-width: 620px; }
.team-table th[scope="row"] { font-weight: 800; }
.team-active { font-weight: 900; }
.team-view-button {
  min-height: 36px;
  padding: 6px 12px;
}
.team-user-detail-cell {
  padding: 0 !important;
  background: #f7f9f7;
}
.team-user-detail-content {
  display: grid;
  gap: 12px;
  padding: 12px 10px 16px;
}
.team-detail-block {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.team-detail-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
}
.team-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.team-detail-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #cbd4cd;
  border-radius: 999px;
  background: #f4f6f4;
  color: #38443c;
  font-size: 0.74rem;
  font-weight: 750;
  white-space: nowrap;
}
.team-detail-work-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.team-detail-summary {
  margin: 0;
  color: #38443c;
  font-size: 0.84rem;
  font-weight: 750;
}
.team-copy-ids {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.78rem;
}
.team-detail-list {
  margin: 0;
  padding: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
  list-style: none;
}
.team-work-list { max-height: 220px; }
.team-activity-list { max-height: 260px; }
.team-work-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto minmax(120px, 0.8fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
}
.team-work-row:first-child,
.team-activity-row:first-child { border-top: 0; }
.team-work-call-id {
  overflow: hidden;
  color: #17211b;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-pass-chip { justify-self: start; }
.team-detail-date,
.team-work-counterpart,
.team-activity-age { color: var(--muted); }
.team-work-counterpart {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-activity-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 4px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  line-height: 1.45;
}
.team-activity-age {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}
.team-detail-empty,
.team-detail-loading { margin: 0; }
.clipboard-fallback {
  position: fixed;
  inset: 0 auto auto -10000px;
  white-space: pre;
}
.team-form {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}
.team-form h3 { margin: 0 0 8px; font-size: 1rem; }
.team-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.team-form-error { margin-bottom: 2px; }
.team-form-note { margin: 0; font-size: 0.78rem; line-height: 1.5; }
.team-credentials {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid #9bceb1;
  border-radius: 12px;
  background: var(--green-soft);
}
.team-credentials-title {
  margin: 0;
  color: var(--green-dark);
  font-weight: 850;
}
.team-credentials-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.team-credentials-values > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid #b9ddc8;
  border-radius: 9px;
  background: #fff;
}
.team-credentials-values dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}
.team-credentials-values dd { margin: 0; }
.team-credentials-values code {
  overflow-wrap: anywhere;
  color: #0b0b0b;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
}
.team-credentials-actions {
  display: flex;
  justify-content: end;
  flex-wrap: wrap;
  gap: 8px;
}

.job-controls-list { display: grid; gap: 10px; }
.job-control-row {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(320px, 1.2fr);
  gap: 12px 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfb;
}
.job-control-summary { display: grid; align-content: start; gap: 4px; }
.job-control-summary h3 { margin: 0; font-size: 1rem; }
.job-control-inventory,
.job-created { margin: 0; color: #52514e; font-size: 0.78rem; }
.job-toggle-list { display: grid; gap: 8px; }
.job-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 3px 10px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.job-toggle input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}
.toggle-track {
  position: relative;
  grid-row: 1;
  width: 42px;
  height: 24px;
  border: 1px solid #9eaba1;
  border-radius: 999px;
  background: #e7ebe8;
}
.toggle-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(28, 45, 34, 0.25);
  content: "";
  transition: transform 120ms ease;
}
.job-toggle input:checked + .toggle-track {
  border-color: var(--green);
  background: var(--green);
}
.job-toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.job-toggle input:focus-visible + .toggle-track {
  outline: 3px solid rgba(23, 107, 70, 0.2);
  outline-offset: 2px;
}
.job-toggle input:disabled + .toggle-track { opacity: 0.55; }
.job-toggle-copy {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  gap: 2px;
}
.job-toggle-copy span { color: #52514e; font-size: 0.72rem; line-height: 1.4; }
.job-access { grid-column: 1 / -1; }
.job-access summary {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
}
.job-access-users {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding-top: 8px;
}
.job-access-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.job-access-user input { width: 20px; min-height: 20px; flex: 0 0 20px; }
.job-access-user > span { display: grid; min-width: 0; gap: 2px; }
.job-access-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-access-user span span { color: #52514e; font-size: 0.72rem; }

.data-safety-heading > div { max-width: 780px; }
.data-safety-explanation {
  margin: 6px 0 0;
  line-height: 1.5;
}
.ops-card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.ops-stat {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8faf8;
}
.ops-label { color: #52514e; font-size: 0.76rem; font-weight: 750; }
.ops-value {
  overflow: hidden;
  color: #0b0b0b;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disputes-list { display: grid; gap: 14px; }
.admin-empty-state {
  margin: 0;
  padding: 28px;
  border: 1px dashed #bdc9c0;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.review-lane-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d4cdeb;
  border-radius: 14px;
  background: #fbfaff;
}
.review-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.review-card-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.review-item-id { margin: 0; font-size: 1rem; }
.review-type-chip {
  padding: 4px 9px;
  border: 1px solid #c8ceca;
  border-radius: 999px;
  background: #eef1ef;
  color: #0b0b0b;
  font-size: 0.72rem;
  font-weight: 800;
}
.review-created {
  margin-inline-start: auto;
  color: #52514e;
  font-size: 0.76rem;
  text-align: right;
}
.review-segment {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.review-segment:first-of-type { padding-top: 0; border-top: 0; }
.review-segment-label { color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.review-segment-audio { width: 100%; min-height: 44px; }
.review-version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.review-version {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.review-version-author {
  display: grid;
  gap: 3px;
}
.review-version-author h4 { margin: 0; }
.review-version-author time,
.review-version-reason {
  color: var(--muted);
  font-size: 0.76rem;
}
.review-version-reason { font-weight: 800; }
.review-version-text {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #f8faf8;
  font-size: 1.35rem;
  font-weight: 750;
  line-height: 2;
  text-align: right;
}
.review-junk-proposal {
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  font-weight: 400;
  text-align: left;
}
.diff-word { border-radius: 4px; }
.diff-word.changed {
  padding: 2px 3px;
  background: #ffe39a;
  color: #593c05;
  box-shadow: inset 0 -2px 0 #b7841c;
}
.empty-version-text {
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
}
.review-accept-button { width: 100%; }

@media (max-width: 820px) {
  .admin-header { position: static; grid-template-columns: minmax(0, 1fr) auto; }
  .admin-job-picker { grid-template-columns: minmax(160px, 1fr); }
  .admin-job-picker > span { display: none; }
  .analytics-grid { grid-template-columns: minmax(0, 1fr); }
  .quality-card { grid-column: auto; }
  .prefill-quality-grid { grid-template-columns: minmax(0, 1fr); }
  .team-layout { grid-template-columns: minmax(0, 1fr); }
  .job-control-row { grid-template-columns: minmax(0, 1fr); }
  .job-access { grid-column: auto; }
  .job-access-users { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-version-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .admin-shell { width: min(100% - 12px, 1180px); }
  .admin-header { grid-template-columns: minmax(0, 1fr); }
  .admin-header .user-box { justify-content: space-between; }
  .admin-header .user-box span { display: inline; }
  .admin-section { padding: 12px; }
  .admin-section-heading { align-items: start; flex-direction: column; }
  .team-form-row,
  .team-credentials-values { grid-template-columns: minmax(0, 1fr); }
  .team-credentials-actions > button { width: 100%; }
  .job-access-users { grid-template-columns: minmax(0, 1fr); }
  .ops-card { grid-template-columns: minmax(0, 1fr); }
}


/* owner demo round 10: the sandwich rows stay packed; free height follows them */
.pass1-card .step-context { margin-block: 0; }
.judge-panel .player-controls { margin-block: 2px; }
.audio-sandwich > .player-controls { margin-block: 0; }
.context-before, .context-after { margin-block: 0; }


/* transcript lives inside the sandwich: compact, one-line start */
.audio-sandwich .transcript-label { margin: 2px 0; }
.audio-sandwich .transcript-textarea { min-height: calc(1lh + 14px); padding: 7px 12px; }


/* slim custom player — the native controls slab is gone */
.headless-audio { display: none; }
.progress-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.progress-bar {
  position: relative;
  flex: 1 1 auto;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  direction: rtl;
}
.progress-bar::before {
  content: "";
  position: absolute;
  inset: 17px 0;
  border: 1px solid #c9d6cc;
  border-radius: 999px;
  background: #e7ede8;
}
.progress-fill {
  position: absolute;
  z-index: 1;
  inset-block: 17px;
  inset-inline-start: 0;
  width: 0%;
  border-radius: 999px;
  background: #2f6b46;
}
.time-label { flex: 0 0 auto; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; }
.pass1-card .player-controls { min-height: 44px; }

/* sandwich rows share one visual rhythm: same heights, paddings, type scale */
.audio-sandwich .step-context, .audio-sandwich .context-before, .audio-sandwich .context-after {
  min-height: calc(1lh + 12px); padding: 5px 10px; font-size: 1.02rem;
}
.audio-sandwich .transcript-textarea { font-size: 1.08rem; }

/* the divider breathes: margin above and below */
.work-divider, .sandwich-divider { margin-block: 12px; }


/* page never scrolls horizontally: wide sections scroll inside themselves */
.admin-shell { max-width: 1440px; width: 100%; margin-inline: auto; }
.admin-content > * { min-width: 0; max-width: 100%; }
.admin-body { overflow-x: clip; }
.pipeline-board-scroll { max-width: 100%; }

/* admin/annotation switch on the no-tasks card — anchors match the quiet buttons */
.empty-admin-link { display: inline-block; text-decoration: none; text-align: center; }
