:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #17212b;
  --muted: #667485;
  --line: #d7e0e7;
  --line-strong: #bfd0da;
  --teal: #006d77;
  --teal-soft: #e3f3f1;
  --orange: #e76f51;
  --selected: #f2c94c;
  --selected-soft: #fff8d8;
  --amber-soft: #fff4df;
  --green-soft: #e8f6ef;
  --shadow: 0 12px 28px rgba(34, 54, 73, 0.10);
  --font-ui: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --topbar-h: 44px;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.35;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

body.app-loading > * {
  visibility: hidden;
}

body.app-loading::before {
  content: "Loading...";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
  color: var(--muted);
  background: var(--bg);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input,
textarea {
  min-height: 34px;
  line-height: 1.25;
}

button,
select,
input[type="range"] {
  touch-action: manipulation;
}

select,
input,
textarea {
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

select {
  border-color: var(--line-strong);
  background-color: #eef7f7;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7b86 50%),
    linear-gradient(135deg, #6b7b86 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
}

input[type="range"] {
  min-height: 24px;
  padding: 0;
  -webkit-appearance: auto;
  appearance: auto;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: var(--topbar-h);
  padding: 6px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.language-switcher select {
  width: auto;
  min-width: 92px;
  height: 30px;
  padding: 4px 28px 4px 8px;
}

.topbar-title {
  display: flex;
  align-items: baseline;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-btn {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid #bdd3d6;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.guide-btn:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-card {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(390px, 32vw);
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  overflow: hidden;
  white-space: nowrap;
}

.session-card span {
  flex: 0 0 auto;
  display: inline;
  color: var(--muted);
  font-size: 12px;
}

.session-card strong {
  min-width: 0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-return-link {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.admin-return-link[hidden] {
  display: none;
}

.guide-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 24, 34, 0.42);
}

.guide-modal {
  width: min(760px, 100%);
  max-height: min(86vh, 780px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 35, 47, 0.28);
}

.guide-modal header,
.guide-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.guide-modal footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.guide-modal h2,
.guide-modal p {
  margin: 0;
}

.guide-close-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
}

.guide-modal-body {
  overflow: auto;
  padding: 16px 18px;
  color: #25323d;
  line-height: 1.65;
}

.guide-modal-body p {
  margin: 0 0 12px;
}

.guide-modal-body ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.guide-modal-body li {
  margin: 0 0 8px;
}

.feedback-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 26000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 24, 34, 0.38);
}

.feedback-modal-backdrop[hidden] {
  display: none !important;
}

.feedback-modal {
  width: min(640px, 100%);
  max-height: min(84vh, 720px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 35, 47, 0.28);
}

.feedback-modal header,
.feedback-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.feedback-modal footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.feedback-modal h2,
.feedback-modal p {
  margin: 0;
}

.feedback-modal-body {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 16px 18px;
  color: #25323d;
  line-height: 1.55;
}

.feedback-modal-body textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fbfcfd;
}

.modal-open {
  overflow: hidden;
}

.notice-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 24, 34, 0.32);
}

.notice-modal {
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.notice-modal p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  padding: 6px 8px 8px;
  overflow: hidden;
}

.case-sidebar,
.case-summary,
.clip-sidebar,
.video-panel,
.form-panel,
.action-bar,
.workflow-strip,
.admin-summary,
.admin-note,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.case-sidebar {
  position: relative;
  top: auto;
  width: auto;
  min-width: 0;
  max-width: none;
  height: 100%;
  overflow: auto;
  padding: 9px;
  resize: none;
}

.sidebar-header,
.panel-header,
.case-summary,
.action-bar,
.admin-summary,
.admin-note,
.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sidebar-header,
.panel-header.compact {
  gap: 8px;
}

.sidebar-header h2,
.panel-header h3,
.case-summary h2 {
  margin: 0;
}

.sidebar-header h2 {
  font-size: 15px;
}

.panel-header h3 {
  font-size: 16px;
  line-height: 1.2;
}

.case-list,
.clip-list {
  display: grid;
  gap: 6px;
}

.case-list {
  margin-top: 6px;
}

.case-card,
.clip-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.case-card {
  padding: 8px;
}

.clip-card {
  padding: 7px 8px;
}

.case-card.active,
.clip-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.case-card strong,
.case-card span,
.clip-card strong,
.clip-card span,
.clip-card small {
  display: block;
}

.case-card strong {
  font-size: 13.5px;
  line-height: 1.25;
}

.case-card span,
.clip-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.clip-card strong {
  font-size: 13px;
}

.clip-card span {
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.case-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 46px;
  max-height: 96px;
  padding: 7px 9px;
  overflow: visible;
  resize: vertical;
}

.case-summary-main {
  display: none;
}

.case-summary h2 {
  font-size: 17px;
  line-height: 1.2;
}

.case-switcher {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.compact-field {
  width: 100%;
  min-width: 0;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid #b7d5d7;
  border-radius: 8px;
  background: var(--teal-soft);
}

.compact-field select {
  height: 32px;
  background-color: #ffffff;
  border-color: #b7d5d7;
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4f6;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.workflow-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  text-align: left;
}

.workflow-step span {
  grid-row: 1 / 3;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #e9f0f3;
  color: var(--muted);
  font-weight: 700;
}

.workflow-step strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-step.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.workflow-step.active span {
  background: var(--teal);
  color: #fff;
}

.workflow-step.done span {
  background: #23724d;
  color: #fff;
}

.review-grid {
  display: grid;
  grid-template-columns: clamp(210px, 17vw, 280px) minmax(0, 1fr) clamp(360px, 30vw, 470px);
  gap: 6px;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.clip-sidebar,
.video-panel,
.form-panel {
  width: 100%;
  padding: 8px;
  min-width: 120px;
}

.clip-sidebar {
  position: relative;
  top: auto;
  width: auto;
  max-width: none;
  height: 100%;
  max-height: none;
  overflow: auto;
  resize: none;
}

.form-panel {
  position: relative;
  top: auto;
  min-width: 280px;
  max-width: none;
  height: 100%;
  max-height: none;
  overflow: auto;
  resize: none;
}

.video-panel {
  min-width: 0;
  max-width: none;
  height: 100%;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  resize: none;
}

.panel-header {
  margin-bottom: 6px;
}

.panel-subtitle {
  max-width: 520px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
}

.panel-header.compact {
  margin-bottom: 6px;
}

.clip-select-compact {
  max-width: 220px;
}

.video-shell {
  position: relative;
  width: 100%;
  max-width: min(100%, 620px);
  max-height: min(48vh, 500px);
  max-height: min(48dvh, 500px);
  aspect-ratio: var(--video-aspect, 4 / 3);
  overflow: hidden;
  border-radius: 8px;
  background: #101820;
  margin: 0 auto;
  contain: layout paint;
}

#video,
#annotationCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#video {
  object-fit: contain;
  background: #101820;
  transform: rotate(var(--video-rotation, 0deg));
  transform-origin: center center;
}

#annotationCanvas {
  cursor: default;
  pointer-events: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

#annotationCanvas.annotating {
  cursor: crosshair;
  pointer-events: auto;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: #dbe7ed;
  text-align: center;
  background: radial-gradient(circle at center, rgba(0, 109, 119, 0.18), rgba(16, 24, 32, 0.95));
  pointer-events: none;
}

.empty-state.hidden {
  display: none;
}

.playback-tools,
.timeline-tools,
.local-video-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}

.playback-tools {
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.playback-tools .ghost-btn,
.playback-tools .primary-btn,
.playback-tools button {
  flex: 0 0 auto;
}

.timeline-tools {
  padding-bottom: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.local-video-row span,
.time-readout,
.duration-chip {
  color: var(--muted);
  font-size: 12px;
}

.time-readout {
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

#seekSlider {
  flex: 1 1 220px;
  min-width: 160px;
  accent-color: var(--teal);
}

.duration-chip,
.timeline-tools button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.speed-field {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.file-btn,
button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
}

button,
.file-btn {
  padding: 6px 8px;
  background: #e9f3f4;
  color: var(--ink);
  cursor: pointer;
}

button,
.file-btn,
select {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

button:hover,
.file-btn:hover {
  border-color: var(--teal);
}

.file-btn input {
  display: none;
}

.primary-btn {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.ghost-btn {
  border-color: #b7d5d7;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
}

.ghost-btn.muted-toggle {
  color: #6f7f85;
  border-color: #cfd9dc;
  background: #f1f5f6;
}

.danger-btn {
  border-color: #e5b5a8;
  background: #fff2ee;
  color: #b54832;
}

.wide-action {
  width: 100%;
}

.evidence-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.card-actions .ghost-btn {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.item-card.editing {
  border-color: var(--orange);
  background: #fff8f4;
  box-shadow: inset 0 0 0 1px rgba(231, 111, 81, 0.16);
}

.hint-box {
  margin-top: 6px;
  padding: 7px 8px;
  border: 1px solid #c9dce0;
  border-radius: 8px;
  background: var(--teal-soft);
  color: #24555b;
  font-size: 13px;
  line-height: 1.45;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: -8px -8px 8px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 7px 20px 7px 6px;
  overflow: visible;
  font-size: 13px;
  white-space: normal;
}

.tab-label {
  min-width: 0;
  overflow: visible;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.tab.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.tab-help {
  position: absolute;
  top: 3px;
  right: 4px;
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 109, 119, 0.12);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  outline: none;
}

.tab.active .tab-help {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tab-tooltip {
  position: fixed;
  top: calc(var(--topbar-h) + 58px);
  right: 18px;
  z-index: 9999;
  display: none;
  width: min(320px, 82vw);
  padding: 9px 10px;
  border: 1px solid #bfd5da;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(18, 36, 44, 0.16);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
  white-space: normal;
}

.tab-tooltip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--teal);
  font-size: 12.5px;
}

.tab-help:hover + .tab-tooltip,
.tab-help:focus-visible + .tab-tooltip {
  display: block;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 7px 8px;
  background: #ffffff;
  color: var(--ink);
}

textarea {
  min-height: 42px;
  resize: vertical;
}

.custom-select-field {
  margin-top: 0;
  border-style: dashed;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.form-grid label {
  display: grid;
  grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.form-grid label > span {
  min-width: 0;
  color: var(--muted);
  line-height: 1.25;
}

.form-grid label > select,
.form-grid label > .custom-select-field {
  min-width: 0;
}

.form-grid label > input:not(.custom-select-field) {
  grid-column: 2 / -1;
  min-width: 0;
}

.view-correction-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 6px;
  min-width: 0;
}

.view-correction-controls[hidden] {
  display: none;
}

.view-correction-controls > select,
.view-correction-controls > .custom-select-field {
  min-width: 0;
}

.form-row-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}

.form-grid .compact-entry {
  grid-template-columns: minmax(74px, 0.65fr) minmax(0, 1fr);
}

.form-grid .compact-entry > input:not(.custom-select-field),
.form-grid .compact-entry > select {
  grid-column: auto;
  min-width: 0;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.check-grid label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7fafb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.check-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.check-grid label span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 6px;
}

.check-grid label span::before {
  content: "";
  display: inline-grid;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  place-items: center;
  border: 1px solid #aab9c1;
  border-radius: 3px;
  background: #fff;
}

.check-grid label:hover {
  border-color: var(--teal);
  background: #eef8f7;
}

.check-grid label.checked,
.check-grid label:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #074f55;
  box-shadow: inset 0 0 0 1px rgba(0, 109, 119, 0.18);
}

.check-grid label.checked span::before,
.check-grid label:has(input:checked) span::before {
  content: "✓";
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.check-grid label:focus-within {
  outline: 2px solid rgba(0, 109, 119, 0.24);
  outline-offset: 2px;
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.list-header h4 {
  margin: 0;
}

.item-list {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.item-card {
  position: relative;
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fbfdfe;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.item-card:hover {
  border-color: #78adb4;
  background: #f5fbfc;
}

.item-card.linked-clip {
  border-left-color: #2f9e8f;
  background: #f6fcfb;
}

.item-card.active {
  border-color: var(--selected);
  border-left-color: var(--selected);
  background: var(--selected-soft);
  box-shadow: 0 0 0 2px rgba(61, 124, 133, 0.22), 0 8px 18px rgba(61, 124, 133, 0.12);
  transform: translateY(-1px);
}

.item-card.active::after {
  content: "✓";
  position: absolute;
  top: 7px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--selected);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.item-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.item-card p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.item-card .card-time {
  color: #4f6974;
  font-size: 11.5px;
  font-weight: 700;
}

.report-sections {
  display: grid;
  gap: 9px;
}

.report-section-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
}

.report-section-row span {
  padding-top: 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.action-bar {
  position: relative;
  bottom: auto;
  z-index: 5;
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  width: auto;
  max-width: none;
}

.action-bar button {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

#saveStatus {
  max-width: 170px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-layout {
  display: grid;
  gap: 18px;
  padding: 22px;
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow: auto;
  align-content: start;
}

.admin-summary,
.admin-note {
  padding: 18px 20px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
}

.admin-overview article {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-overview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-overview strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
  line-height: 1;
}

.admin-access-log {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.admin-access-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-access-head h2,
.admin-access-head p {
  margin: 0;
}

.admin-access-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-access-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-access-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-access-table th,
.admin-access-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-access-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f7;
  color: #31595e;
  font-weight: 800;
}

.admin-access-table td {
  color: #33424f;
  word-break: break-word;
}

.admin-note {
  align-items: flex-start;
  color: var(--muted);
  font-size: 14px;
}

.admin-note span,
.admin-note strong {
  display: block;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 18px;
}

.admin-search-field {
  min-width: 220px;
}

.admin-pagination {
  margin: 6px 0 12px;
}

.admin-pagination-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfb;
  color: var(--muted);
  font-size: 13px;
}

.admin-pagination-inner span {
  text-align: center;
  font-weight: 700;
  color: #31595e;
}

.admin-card {
  padding: 18px;
  min-height: 0;
  overflow: hidden;
}

.admin-card-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.admin-export-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #31595e;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  appearance: none;
  white-space: nowrap;
}

.admin-export-pick:hover {
  border-color: var(--teal);
  background: #eef8f7;
}

.admin-export-pick.selected,
.admin-export-pick[aria-pressed="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.admin-card-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  min-width: 180px;
}

.compact-copy {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.access-link-field {
  display: grid;
  grid-template-columns: minmax(70px, 0.18fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: -4px 0 12px;
}

.access-link-field span {
  color: var(--muted);
  font-size: 12px;
}

.access-link-field input {
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  background: #f8fafc;
}

.admin-card-head h3,
.admin-card-head p {
  margin: 0;
}

.admin-card-head h3 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.admin-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.admin-card-stats span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef4f6;
  color: var(--muted);
  font-size: 12px;
}

.expert-access-log {
  margin: -2px 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfd;
}

.expert-access-log summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  cursor: pointer;
  color: #254b50;
  font-size: 13px;
  font-weight: 800;
}

.expert-access-log summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.expert-access-table-wrap {
  max-height: 190px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

.expert-access-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 12px;
}

.expert-access-table th,
.expert-access-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.expert-access-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef7f7;
  color: #31595e;
  font-weight: 800;
}

.expert-access-table td {
  color: #33424f;
  word-break: break-word;
}

.admin-create-modal small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 18px 20px 0;
}

.admin-create-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.admin-create-form input,
.admin-create-form select {
  width: 100%;
  min-width: 0;
  height: 40px;
}

.admin-create-form button {
  min-height: 40px;
  white-space: normal;
}

.modal-create-form footer {
  margin: 4px -20px 0;
}

.admin-create-status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: 0;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.assignment-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 2px;
}

.assignment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.assignment-row:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 109, 119, 0.12);
}

.assignment-case-pick {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}

.assignment-row input[type="checkbox"] {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1.5px solid #9fb3ba;
  border-radius: 4px;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.assignment-row input[type="checkbox"]:checked {
  border-color: var(--teal);
  background: var(--teal);
}

.assignment-row input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: -1px 0 0;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
}

.assignment-row strong,
.assignment-row small {
  display: block;
}

.assignment-range-field {
  display: grid;
  gap: 3px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(160px, 0.52fr) minmax(150px, 0.48fr);
  align-items: center;
  min-width: 0;
}

.assignment-range-field small {
  white-space: normal;
}

.assignment-range-field small b {
  display: block;
  margin-top: 2px;
  color: #789097;
  font-weight: 500;
}

.assignment-range-field input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 7px;
  font-size: 12px;
}

.assignment-progress,
.assignment-diagnosis {
  min-width: 0;
}

.assignment-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4f6;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.status-completed {
  background: var(--green-soft);
  color: #23724d;
}

.status-draft {
  background: var(--amber-soft);
  color: #9a641a;
}

.status-not_started,
.status-not_assigned {
  background: #eef4f6;
  color: var(--muted);
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid #b7d5d7;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
  text-decoration: none;
}

.text-btn {
  border: 1px solid #b7d5d7;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 8px;
  text-align: left;
}

.session-card .text-btn {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: 0;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(31, 120, 116, 0.12), rgba(232, 244, 246, 0.75)),
    #f7fafb;
}

.auth-card {
  width: min(980px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 24px;
}

.auth-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.auth-topline .eyebrow {
  margin: 0;
}

.auth-topline .language-switcher {
  flex: 0 0 auto;
}

.auth-brand h1,
.auth-brand p {
  margin: 0;
}

.auth-brand h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 42px);
}

.auth-brand p {
  color: var(--muted);
}

.auth-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.auth-form h2 {
  margin: 0;
  font-size: 20px;
}

.auth-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: #a65023;
  font-weight: 700;
}

@media (max-width: 1380px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-grid {
    grid-template-columns: 210px minmax(0, 1fr) clamp(360px, 30vw, 450px);
  }

  .clip-sidebar {
    position: relative;
    top: auto;
    grid-column: auto;
    width: auto;
    min-width: 0;
    max-height: none;
    overflow: auto;
  }

  .clip-list {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    padding-bottom: 0;
  }

  .clip-card {
    min-height: 58px;
    padding: 7px;
  }

  .clip-card span {
    display: none;
  }

  .clip-card small {
    white-space: normal;
  }

  .form-panel {
    max-height: none;
  }

  .video-shell {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .action-bar {
    left: auto;
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .clip-sidebar {
    top: auto;
    max-height: none;
  }

  .review-grid {
    grid-template-columns: 210px minmax(0, 1fr) clamp(340px, 30vw, 420px);
  }

  .video-panel {
    min-width: 340px;
    max-width: none;
  }

  .form-panel {
    position: relative;
    grid-column: auto;
    max-width: none;
    max-height: none;
  }

  .workflow-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-bar {
    width: auto;
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 920px) {
  .layout {
    padding-left: 0;
    padding-right: 0;
  }

  .workspace,
  .review-grid {
    width: 100%;
    max-width: 100%;
  }

  .workspace {
    overflow: auto;
    scrollbar-width: none;
  }

  .workspace::-webkit-scrollbar {
    display: none;
  }

  .review-grid {
    grid-template-columns: minmax(172px, 220px) minmax(0, 1fr);
    grid-auto-rows: auto;
    overflow: visible;
    background: var(--bg);
  }

  .video-panel {
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
    resize: none;
  }

  .clip-sidebar {
    width: 100%;
  }

  .form-panel {
    position: relative;
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    max-height: 100%;
    resize: vertical;
  }
}

@media (max-width: 720px) {
  body {
    height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .auth-panels {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-create-form,
  .assignment-range-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .action-bar {
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  #saveStatus {
    max-width: 120px;
  }

  .layout {
    height: calc(100vh - var(--topbar-h));
    height: calc(100dvh - var(--topbar-h));
    min-height: 0;
    overflow: hidden;
    padding: 6px 0;
  }

  .case-summary {
    grid-template-columns: 1fr;
    max-height: 132px;
    overflow: auto;
  }

  .case-switcher {
    grid-template-columns: 1fr auto auto;
  }

  .compact-field {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .tab-tooltip {
    top: calc(var(--topbar-h) + 8px);
    right: 10px;
  }

  .workspace {
    overflow: auto;
  }

  .review-grid {
    overflow: visible;
  }

  .case-sidebar {
    height: auto;
    max-height: 30vh;
    max-height: 30dvh;
  }

  .review-grid {
    grid-template-columns: 1fr;
  }

  .clip-sidebar {
    position: static;
    max-height: 42vh;
    max-height: 42dvh;
    resize: vertical;
  }

  .video-shell {
    max-width: 100%;
  }

  .workflow-strip,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid label {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .form-grid label > span {
    grid-column: 1 / -1;
  }

  .form-grid label > input:not(.custom-select-field) {
    grid-column: 1 / -1;
  }

  .form-row-pair {
    grid-template-columns: 1fr;
  }

  .form-grid .compact-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-section-row {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.text-review-layout {
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  overflow: hidden;
}

.text-case-nav,
.text-input-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.text-case-nav,
.text-input-panel {
  padding: 10px;
}

.text-case-list {
  display: grid;
  gap: 8px;
}

.text-case-card {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.text-case-card strong,
.text-case-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-case-card span {
  color: var(--muted);
  font-size: 12px;
}

.text-case-card .status-pill {
  grid-row: span 2;
}

.text-case-card.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.text-input-panel label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.text-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.text-source-fixed {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #74a8a8;
  border-radius: 10px;
  background: linear-gradient(180deg, #d9eeec 0%, #edf8f6 100%);
  box-shadow: 0 12px 28px rgba(15, 88, 92, 0.16);
}

.text-source-fixed .source-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
}

.text-source-fixed pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 210px;
  overflow: auto;
  font-family: var(--font-ui);
  line-height: 1.7;
}

.text-input-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.text-input-panel label {
  display: grid;
  gap: 6px;
}

.text-input-panel textarea,
.text-input-panel input,
.text-input-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.text-input-panel textarea {
  resize: vertical;
}

.text-example-wrap {
  display: grid;
  gap: 6px;
}

.text-example-wrap > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.text-input-panel .text-example-box {
  min-height: 108px;
  padding: 10px 12px;
  background: #f6faf9;
  color: #36575c;
  line-height: 1.65;
  white-space: pre-wrap;
  border-color: #cfe5e3;
  border: 1px solid #cfe5e3;
  border-radius: 8px;
  cursor: default;
}

.text-step-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.text-step {
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid #b7d5d7;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.text-step.active {
  background: var(--teal);
  color: #fff;
}

.text-step-panels {
  min-height: 0;
}

.text-section {
  display: none;
  gap: 12px;
}

.text-section.active {
  display: grid;
}

.text-section h2 {
  margin: 4px 0 2px;
  font-size: 18px;
}

.text-section b {
  display: block;
  margin-top: 4px;
}

.text-section small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.text-section-note {
  padding: 10px 12px;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
  color: #31595e;
  line-height: 1.55;
}

.text-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.text-example-hint {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid #d5dce1;
  border-radius: 8px;
  background: #f7f9fa;
  color: #5a6874;
  font-size: 12px;
  line-height: 1.55;
}

.text-scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.text-scale-flex {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.text-scale input,
.text-choice input {
  accent-color: var(--teal);
}

.text-scale label {
  min-width: 0;
}

.text-scale input {
  position: absolute;
  opacity: 0;
}

.text-scale span {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.text-scale b {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.text-scale input:checked + span {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.text-scale-multi span {
  min-height: 58px;
}

.text-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.text-choice {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 6px !important;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.text-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.text-admin-card {
  border-color: #cfe5e3;
}

.text-assignment-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.manual-assignment-field {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}

.manual-assignment-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.manual-assignment-field textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.manual-assignment-field small {
  color: var(--muted);
}

.compact-save {
  margin-bottom: 12px;
}

@media (max-width: 1180px) {
  .text-review-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .text-step-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .text-review-layout {
    height: auto;
    min-height: calc(100vh - var(--topbar-h));
    overflow: auto;
    grid-template-columns: 1fr;
  }

  .text-case-nav,
  .text-input-panel {
    max-height: none;
  }

  .text-step-nav,
  .text-scale,
  .text-path-row {
    grid-template-columns: 1fr;
  }
}

@supports selector(::-webkit-scrollbar) {
  .case-sidebar::-webkit-scrollbar,
  .clip-sidebar::-webkit-scrollbar,
  .form-panel::-webkit-scrollbar,
  .video-panel::-webkit-scrollbar,
  .admin-layout::-webkit-scrollbar,
  .assignment-list::-webkit-scrollbar,
  .playback-tools::-webkit-scrollbar,
  .timeline-tools::-webkit-scrollbar,
  .item-list::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  .case-sidebar::-webkit-scrollbar-thumb,
  .clip-sidebar::-webkit-scrollbar-thumb,
  .form-panel::-webkit-scrollbar-thumb,
  .video-panel::-webkit-scrollbar-thumb,
  .admin-layout::-webkit-scrollbar-thumb,
  .assignment-list::-webkit-scrollbar-thumb,
  .playback-tools::-webkit-scrollbar-thumb,
  .timeline-tools::-webkit-scrollbar-thumb,
  .item-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #c6d3da;
  }
}
