:root {
  --bg: #f9f9fb;
  --panel: #ffffff;
  --panel-muted: #f3f7f6;
  --text: #17202a;
  --muted: #667085;
  --subtle: #8993a4;
  --border: #dce2ea;
  --border-strong: #c5ced9;
  --primary: #00a68c;
  --primary-strong: #007f70;
  --primary-soft: #e5f7f3;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #b7791f;
  --warning-soft: #fff7d6;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: clamp(208px, 16vw, 252px) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #ffffff;
  padding: 14px 12px;
  z-index: 30;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  column-gap: 16px;
  align-items: center;
  padding: 4px 2px 14px 4px;
  border-bottom: 1px solid var(--border);
}


.sidebar-brand strong {
  display: block;
  line-height: 1.2;
  font-size: 15px;
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.sidebar-title {
  min-width: 0;
  padding-right: 6px;
}

.sidebar-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 0;
}

.sidebar-toggle:hover {
  border-color: var(--border-strong);
  background: #f4f7fa;
  color: var(--primary-strong);
}

.sidebar-toggle span {
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.nav-short {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 28px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  padding: 10px 2px;
}

.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.nav-item:hover {
  background: #f4f7fa;
}

.nav-item.is-active {
  border-color: rgba(0, 166, 140, 0.22);
  background: var(--primary-soft);
  color: #064e47;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}



.sidebar-footer {
  margin-top: auto;
  padding: 14px 8px 2px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
}

.workspace {
  min-width: 0;
}

.patient-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: clamp(170px, 14vw, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(249, 249, 251, 0.96);
  backdrop-filter: blur(12px);
}

.patient-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow,
.module-kicker {
  display: inline-block;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.patient-name-row {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 7px;
}

.patient-name-input {
  width: 118px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font-size: 21px;
  font-weight: 780;
  outline: none;
}

.patient-name-input:focus {
  border-color: var(--primary);
}

.session-badge,
.state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--success-soft);
  color: #166534;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.state-badge.pending {
  background: var(--warning-soft);
  color: var(--warning);
}

.state-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.condition-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 8px;
}

.field span,
.field legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.field legend {
  padding: 0;
}

.field input,
.field select,
.field textarea,
.inline-input,
.table-input,
.score-input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 6px 8px;
  line-height: 1.25;
  outline: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-input:focus,
.table-input:focus,
.score-input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 140, 0.13);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 6px;
}

.field-row.compact input,
.field-row.compact select {
  min-height: 36px;
  padding: 7px 9px;
}

.segmented-field {
  padding-top: 8px;
}

.segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  border-radius: 8px;
  background: #edf1f5;
  padding: 3px;
}

.segmented-control label {
  min-width: 0;
  position: relative;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.segmented-control input:checked + span {
  background: #ffffff;
  color: var(--primary-strong);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.unit-input {
  display: grid;
  grid-template-columns: minmax(52px, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.unit-input span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 21vw, 340px);
  gap: 14px;
  padding: 14px 16px 22px;
}

.module-surface,
.insight-surface {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-surface {
  overflow: hidden;
}

.module-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.module-header h1 {
  margin: 6px 0 5px;
  font-size: 21px;
  line-height: 1.24;
  letter-spacing: 0;
}

.module-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button {
  border-radius: 7px;
  border: 1px solid transparent;
  min-height: 34px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 750;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button {
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover {
  border-color: var(--border-strong);
  background: #f4f7fa;
}

.ghost-button {
  border-color: transparent;
  background: transparent;
  color: var(--primary-strong);
}

.mini-button {
  min-height: 28px;
  padding: 5px 8px;
  border-color: var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
}

#moduleBody {
  padding: 14px 18px 18px;
}

.section-band {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 14px;
  overflow: hidden;
}

.section-band:last-child {
  margin-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-content {
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label,
.form-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.form-field.full {
  grid-column: 1 / -1;
}

.customer-id-output {
  display: flex;
  min-width: 0;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e9ecef;
  border-radius: 3px;
  background: #f5f7f8;
  padding: 6px 8px;
  color: var(--text);
  line-height: 1.25;
  user-select: text;
}

.customer-id-output strong {
  overflow: hidden;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-wrap {
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.table-wrap.compact {
  max-height: 360px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 9px;
  vertical-align: middle;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef5f4;
  color: #24433f;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.data-table tbody tr:hover td {
  background: #f8fbfb;
}

.data-table .number-cell {
  width: 48px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.data-table .narrow {
  width: 118px;
  min-width: 118px;
}

.data-table .wide {
  min-width: 300px;
}

.word-token {
  display: inline;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
}

.table-input {
  min-width: 120px;
  min-height: 36px;
  padding: 7px 9px;
}

.score-input {
  width: 76px;
  min-width: 76px;
  min-height: 36px;
  padding: 7px 9px;
  text-align: right;
}

.checkbox-line,
.radio-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.checkbox-line input,
.radio-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.checkbox-line input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.checkbox-line:has(input:disabled) {
  color: var(--muted);
}

.protocol-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 10px;
  padding: 9px 10px;
}

.protocol-heading {
  display: contents;
}

.protocol-heading h2 {
  display: none;
}

.protocol-heading p {
  display: none;
}

.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  align-items: end;
  grid-column: 1;
  grid-row: 1;
}

.protocol-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.protocol-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}


.clinical-table th.is-selected-col,
.clinical-table td.is-selected-col {
  background: #eaf8f5;
}

.clinical-table tbody tr:hover td.is-selected-col {
  background: #dff4ef;
}

.clinical-table th[data-wrs-table-list],
.clinical-table th[data-srs-table-list],
.list-select-cell {
  cursor: pointer;
}

.list-header-button {
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.clinical-table th.is-selected-col {
  box-shadow: inset 0 -2px 0 var(--primary);
}

.clinical-table th.is-selected-col .list-header-button {
  color: var(--primary-strong);
}

.clinical-table td.is-selected-col .word-token {
  background: transparent;
  color: #075f52;
}

.wrs-table tbody td.is-selected-col {
  text-align: center;
}

.wrs-table thead .list-header-button {
  text-align: center;
}

.response-cell {
  min-width: 150px;
}

.srs-response-cell {
  min-width: 190px;
}

.srs-response-input {
  width: 100%;
  min-width: 170px;
}
.scored-sentence {
  line-height: 1.7;
}

.scored-token {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--primary);
}

.target-exception-toggle {
  display: inline;
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.target-exception-toggle:hover {
  background: var(--primary-soft);
}

.target-exception-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.target-exception-toggle.is-incorrect {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
  text-decoration-color: var(--danger);
  text-decoration-style: wavy;
}

.target-exception-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.recall-target-toggle.is-missed {
  background: transparent;
  color: var(--danger);
  text-decoration-color: var(--danger);
  text-decoration-style: wavy;
}

.judge-cell {
  min-width: 108px;
}

.score-cell {
  min-width: 118px;
  white-space: nowrap;
}

.score-cell .score-input {
  display: inline-block;
  width: 76px;
  min-width: 76px;
  min-height: 36px;
  margin-right: 5px;
  padding: 7px 9px;
  text-align: right;
}

.derived-score-count {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  min-width: 72px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.derived-score-count strong {
  font-size: 15px;
}

.derived-score-count span {
  color: var(--muted);
  font-size: 12px;
}

.score-input.is-scored-cell {
  border-color: rgba(0, 166, 140, 0.42);
  background: #f7fffc;
}

.score-input.is-reference-cell:disabled,
.score-input:disabled {
  border-color: var(--border);
  background: #f4f7fa;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.derived-value {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f4f7fa;
  color: var(--muted);
  padding: 7px 9px;
  font-weight: 800;
}
.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.summary-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.summary-item strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
}

.summary-item small {
  display: block;
  margin-top: 4px;
  color: var(--subtle);
  font-size: 12px;
}

.tabs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tab-button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 780;
}

.tab-button:hover {
  background: #f4f7fa;
}

.tab-button.is-active {
  border-color: rgba(0, 166, 140, 0.3);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.question-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 250px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.question-row:last-child {
  border-bottom: 0;
}

.question-row:hover {
  background: #f8fbfb;
}

.question-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.question-row p {
  margin: 0;
  line-height: 1.45;
  font-size: 14px;
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.radio-grid label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.radio-grid input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.radio-grid label:has(input:checked) {
  border-color: rgba(0, 166, 140, 0.34);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.8fr);
  gap: 14px;
  align-items: stretch;
}

.chart-shell {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  padding: 14px;
  min-height: 320px;
}

.chart-shell svg {
  display: block;
  width: 100%;
  height: auto;
}

.input-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inline-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.metric-line:last-child {
  border-bottom: 0;
}

.metric-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.metric-line strong {
  color: var(--text);
  font-size: 15px;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.report-print-frame {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  border: 0;
  pointer-events: none;
}

.data-management-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.report-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-list li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}

.report-list li:last-child {
  border-bottom: 0;
}

.report-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.bar-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f5;
}

.bar-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

progress.bar-meter {
  display: block;
  width: 100%;
  border: 0;
  appearance: none;
}

progress.bar-meter::-webkit-progress-bar {
  border-radius: inherit;
  background: #e5e9ef;
}

progress.bar-meter::-webkit-progress-value {
  border-radius: inherit;
  background: var(--primary);
}

progress.bar-meter::-moz-progress-bar {
  border-radius: inherit;
  background: var(--primary);
}

.insight-surface {
  position: sticky;
  top: 98px;
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.insight-heading {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.insight-heading strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.score-block,
.progress-block,
.chart-block,
.remarks-block {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.score-block {
  background: #fbfcfd;
}

.score-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.score-value strong {
  font-size: 34px;
  line-height: 1;
}

.score-value span {
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.score-block p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.block-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.block-title strong {
  color: var(--text);
  font-size: 13px;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf2;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.mini-chart {
  min-height: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}

.mini-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.remarks-block {
  flex: 1;
  min-height: 0;
  border-bottom: 0;
  display: flex;
  flex-direction: column;
}

.remark-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 72px;
  max-height: 150px;
  overflow: auto;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.remark-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 8px;
  align-items: start;
  border-left: 3px solid var(--primary);
  background: #f7faf9;
  padding: 8px 9px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.remark-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.remark-delete-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.remark-delete-button:hover {
  background: #edf0f3;
  color: var(--text);
}

.remark-list li.remark-empty {
  display: block;
  border-left-color: var(--border);
  color: var(--muted);
}

.remarks-block textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  outline: none;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border: 1px solid rgba(0, 166, 140, 0.22);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 750;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .patient-bar {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .condition-grid {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }

  .topbar-session {
    gap: 10px;
    padding: 0 14px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .insight-surface {
    position: static;
    height: auto;
  }

  .protocol-panel {
    grid-template-columns: 1fr;
  }

  .protocol-grid {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    grid-column: 1;
    grid-row: auto;
  }


  .question-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .radio-grid {
    grid-column: 2;
  }
}







.app-shell,
.sidebar,
.nav-item,
.sidebar-title,
.sidebar-footer,
.patient-bar,
.dashboard-grid {
  transition: grid-template-columns 180ms ease, width 180ms ease, padding 180ms ease, opacity 120ms ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.app-shell.is-sidebar-collapsed .sidebar {
  width: 64px;
}

.app-shell.is-sidebar-collapsed .sidebar {
  padding: 14px 8px;
}

.app-shell.is-sidebar-collapsed .sidebar-brand {
  display: flex;
  justify-content: center;
  padding: 2px 0 12px;
}

.app-shell.is-sidebar-collapsed .sidebar-title,
.app-shell.is-sidebar-collapsed .sidebar-footer,
.app-shell.is-sidebar-collapsed .nav-label {
  display: none;
}

.app-shell.is-sidebar-collapsed .sidebar-toggle span {
  transform: rotate(225deg);
}

.app-shell.is-sidebar-collapsed .nav-list {
  padding: 10px 0;
  gap: 6px;
}

.app-shell.is-sidebar-collapsed .nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: center;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.app-shell.is-sidebar-collapsed .nav-short {
  display: inline-flex;
}

.app-shell.is-sidebar-collapsed .nav-item.is-active .nav-short {
  background: #ffffff;
  color: var(--primary-strong);
}




/* Flat clinical workspace overrides */
.module-surface {
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.insight-surface {
  border-radius: 0;
  box-shadow: none;
}

.module-header {
  padding: 14px 18px 12px;
  background: #ffffff;
}

#moduleBody {
  padding: 10px 18px 18px;
}

.protocol-panel {
  border: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  margin-bottom: 8px;
  padding: 8px 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin: 0 0 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.summary-item {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 8px 12px;
}

.summary-item:last-child {
  border-right: 0;
}

.summary-item strong {
  margin-top: 3px;
  font-size: 18px;
}

.summary-item small {
  margin-top: 2px;
}

.section-band {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  margin-bottom: 0;
  overflow: visible;
}

.section-title {
  min-height: 38px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
}

.section-content {
  padding: 12px 0 16px;
}

.table-wrap,
.question-list,
.chart-shell,
.mini-chart,
.remarks-block textarea {
  border-radius: 0;
}

.chart-shell {
  background: #ffffff;
}








/* Unified clinical workspace */
:root {
  --bg: #f9f9fb;
  --panel: #ffffff;
  --panel-muted: #edf0f3;
  --text: #37495f;
  --muted: #8795a8;
  --subtle: #a1adbd;
  --border: #dfe8f1;
  --border-strong: #d1d6df;
  --primary: #00a68c;
  --primary-strong: #2b8871;
  --primary-soft: #d3efe8;
  --danger: #ed2939;
  --danger-soft: #ffdfe2;
  --success: #28a745;
  --success-soft: #d7eddc;
  --warning: #e67e22;
  --warning-soft: #fff5e4;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-strong: 0 3px 10px rgba(55, 73, 95, 0.12);
  --radius: 3px;
  --header-height: 60px;
}

body {
  padding-top: var(--header-height);
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.app-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-height);
  min-width: 1080px;
  border-bottom: 1px solid #119877;
  background: var(--primary);
  color: #ffffff;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 292px;
  height: 100%;
  padding: 0 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: #ffffff;
  color: var(--primary);
  font-size: 17px;
  font-weight: 900;
}

.topbar-brand strong {
  font-size: 16px;
  line-height: 1;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.topbar-nav button {
  display: flex;
  align-items: center;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 15px;
  font-weight: 800;
}

.topbar-nav button:hover,
.topbar-nav button.is-active,
.topbar-nav button[aria-current="page"] {
  background: #119877;
  color: #ffffff;
}

.topbar-session {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  margin-left: auto;
  padding: 0 22px;
  font-size: 12px;
  white-space: nowrap;
}

.topbar-user-name {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.topbar-user-name span {
  color: #a0ddcc;
  font-weight: 800;
}

.topbar-user-name strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.1;
}

.app-shell {
  grid-template-columns: clamp(292px, 22vw, 340px) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  border-right: 1px solid var(--border-strong);
  background: var(--bg);
  padding: 10px;
}

.sidebar-brand {
  grid-template-columns: minmax(0, 1fr) 32px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand strong {
  color: var(--text);
  font-size: 14px;
}

.sidebar-brand span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-toggle {
  width: 30px;
  height: 30px;
  border-color: var(--border-strong);
  border-radius: 3px;
  background: var(--panel-muted);
  color: var(--text);
}

.sidebar-toggle:hover {
  background: var(--text);
  color: #ffffff;
}

.customer-panel {
  margin: 10px 0;
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.customer-card-header {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 12px 10px 10px;
  border-bottom: 1px solid var(--border);
}

.customer-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: var(--text);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.customer-title {
  min-width: 0;
  flex: 1;
}

.customer-title > span,
.customer-section-title {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.patient-name-row {
  gap: 6px;
  margin-top: 3px;
}

.patient-name-input {
  width: 100%;
  min-width: 0;
  border-bottom-color: var(--border-strong);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.session-badge,
.state-badge {
  min-height: 22px;
  border-radius: 20px;
  background: var(--primary-soft);
  color: #21705d;
  padding: 2px 8px;
  font-size: 11px;
}

.customer-info-list {
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.customer-info-list li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.customer-info-list li:last-child {
  margin-bottom: 0;
}

.customer-info-list strong {
  color: var(--muted);
  font-weight: 700;
}

.customer-info-list span {
  min-width: 0;
}

.customer-label-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.customer-label {
  display: flex;
  align-items: center;
  min-height: 25px;
  padding: 5px 8px;
  background: #ecf1f9;
  box-shadow: 3px 3px rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.76);
  list-style: none;
}

.customer-label .label-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.la-box {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 2px;
  margin-right: 5px;
}

.la-mint {
  background-color: #aedac4;
}

.la-bluebell {
  background-color: #b6d4e2;
}

.customer-section-title {
  height: 24px;
  line-height: 24px;
  padding: 0 10px;
  background: var(--panel-muted);
  color: var(--text);
}

.customer-panel .condition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
}

.field {
  border-color: var(--border);
  border-radius: 3px;
  background: var(--panel);
  padding: 7px 8px;
}

.field span,
.field legend,
.form-field label,
.form-field span,
.protocol-field > span,
.block-title span {
  color: var(--muted);
  font-size: 11px;
}

.field input,
.field select,
.field textarea,
.inline-input,
.table-input,
.score-input,
.customer-form input[type="text"],
.customer-form select,
.customer-form textarea {
  border-color: #e9ecef;
  border-radius: 3px;
  color: var(--text);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.inline-input:focus,
.table-input:focus,
.score-input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 140, 0.12);
}

.segmented-control {
  border-radius: 20px;
  background: var(--panel-muted);
  padding: 3px;
}

.segmented-control span {
  border-radius: 20px;
}

.segmented-control input:checked + span {
  color: #21705d;
}

.nav-list {
  gap: 4px;
  padding: 0 0 10px;
}

.nav-item {
  min-height: 34px;
  border-radius: 3px;
  padding: 6px 8px 6px 10px;
  color: var(--text);
}

.nav-item:hover {
  background: var(--panel-muted);
}

.nav-item.is-active {
  border-color: transparent;
  background: var(--text);
  color: #ffffff;
}

.nav-label {
  font-size: 13px;
  font-weight: 800;
}

.nav-short {
  border-radius: 3px;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 4px 2px;
  color: var(--muted);
}

.workspace {
  min-width: 0;
  background: var(--bg);
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1fr) clamp(300px, 22vw, 360px);
  gap: 20px;
  padding: 20px;
}

.module-surface,
.insight-surface {
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-surface {
  overflow: hidden;
}

.module-header {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.module-header h1 {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.module-header p {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow,
.module-kicker {
  color: var(--primary);
  font-size: 11px;
}

#moduleBody {
  padding: 18px 20px 22px;
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button,
.tab-button {
  border-radius: 3px;
  font-size: 13px;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button,
.mini-button {
  border-color: var(--text);
  background: #ffffff;
  color: var(--text);
}

.secondary-button:hover,
.ghost-button:hover,
.mini-button:hover,
.tab-button:hover {
  border-color: var(--text);
  background: var(--panel-muted);
}

.ghost-button {
  color: var(--primary);
}

.section-band {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  margin-bottom: 14px;
  overflow: hidden;
}

.section-title {
  min-height: 40px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
}

.section-title h2,
.section-title h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.section-title p {
  color: var(--muted);
  font-size: 11px;
}

.section-content {
  padding: 14px;
}

.summary-strip {
  gap: 10px;
  margin: 0 0 14px;
  border: 0;
  background: transparent;
}

.summary-item {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
}

.summary-item:last-child {
  border-right: 1px solid var(--border);
}

.summary-item strong {
  color: var(--text);
  font-size: 22px;
}

.table-wrap,
.question-list,
.chart-shell,
.mini-chart,
.remarks-block textarea {
  border-color: var(--border);
  border-radius: 3px;
}

.data-table {
  color: var(--text);
}

.data-table th,
.data-table td {
  border-color: var(--border);
}

.data-table thead th {
  background: #e5e9f1;
  color: #212c39;
}

.data-table tbody tr:hover td {
  background: #f9f9f9;
}

.protocol-panel {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel-muted);
  margin-bottom: 12px;
  padding: 10px;
}

.protocol-grid {
  gap: 8px;
}

.tab-button {
  border-color: var(--border-strong);
  color: var(--text);
}

.tab-button.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: #21705d;
}

.chart-shell {
  background: #ffffff;
}

.insight-surface {
  top: calc(var(--header-height) + 20px);
  height: calc(100vh - var(--header-height) - 40px);
  overflow: hidden;
}

.insight-heading,
.score-block,
.progress-block,
.chart-block,
.remarks-block {
  border-color: var(--border);
}

.insight-heading {
  padding: 16px 18px 13px;
}

.insight-heading strong {
  color: var(--text);
}

.score-block {
  background: var(--panel-muted);
}

.score-value strong {
  color: var(--text);
}

.score-value span {
  background: var(--primary-soft);
  color: #21705d;
}

.summary-print-button {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  color: var(--primary-strong);
}

.summary-print-button:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, #ffffff);
}

.summary-print-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 2px;
}

.summary-print-notice {
  color: var(--primary-strong);
  font-weight: 750;
}

.progress-track,
.bar-meter {
  background: #edf0f3;
}

.progress-track span,
.bar-meter span {
  background: var(--primary);
}

.remark-list li {
  border-left-color: var(--primary);
  background: #f7faf9;
}

.toast {
  border-color: rgba(0, 166, 140, 0.22);
  border-radius: 3px;
  box-shadow: var(--shadow-strong);
}

.app-shell,
.sidebar,
.nav-item,
.sidebar-title,
.sidebar-footer,
.dashboard-grid,
.customer-panel {
  transition: grid-template-columns 180ms ease, width 180ms ease, padding 180ms ease, opacity 120ms ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.app-shell.is-sidebar-collapsed .sidebar {
  padding: 10px 8px;
}

.app-shell.is-sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

.app-shell.is-sidebar-collapsed .customer-panel,
.app-shell.is-sidebar-collapsed .sidebar-title,
.app-shell.is-sidebar-collapsed .sidebar-footer,
.app-shell.is-sidebar-collapsed .nav-label {
  display: none;
}

.app-shell.is-sidebar-collapsed .nav-list {
  padding-top: 10px;
}

.app-shell.is-sidebar-collapsed .nav-item {
  justify-content: center;
  min-height: 34px;
  padding: 5px;
}

.app-shell.is-sidebar-collapsed .nav-short {
  display: inline-flex;
  color: var(--text);
}

.app-shell.is-sidebar-collapsed .nav-item.is-active .nav-short {
  background: transparent;
  color: #ffffff;
}

@media (max-width: 1180px) {
  .app-topbar {
    min-width: 0;
  }

  .topbar-brand {
    width: auto;
    min-width: 250px;
  }

  
  .topbar-session {
    gap: 10px;
    padding: 0 14px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .insight-surface {
    position: static;
    height: auto;
  }
}

@media (max-width: 860px) {
  body {
    padding-top: 0;
  }

  .app-topbar {
    position: static;
    min-width: 0;
    height: auto;
    flex-wrap: wrap;
  }

  .topbar-brand {
    min-width: 0;
    flex: 1;
    height: var(--header-height);
  }

  .topbar-session {
    display: none;
  }

  .topbar-nav {
    order: 3;
    display: flex;
    width: 100%;
    height: 42px;
    overflow-x: auto;
    background: #119877;
  }

  .topbar-nav button {
    flex: 1 0 auto;
    justify-content: center;
    min-width: 108px;
    height: 42px;
    padding: 0 12px;
    font-size: 13px;
  }

  .app-shell,
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .app-shell.is-sidebar-collapsed .customer-panel,
  .app-shell.is-sidebar-collapsed .sidebar-title,
  .app-shell.is-sidebar-collapsed .sidebar-footer,
  .app-shell.is-sidebar-collapsed .nav-label {
    display: block;
  }

  .app-shell.is-sidebar-collapsed .nav-label {
    display: inline;
  }

  .app-shell.is-sidebar-collapsed .nav-short {
    display: none;
  }

  .nav-list {
    max-height: none;
  }

  .dashboard-grid {
    padding: 12px;
  }

  .module-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .module-actions {
    justify-content: flex-start;
  }

  .form-grid,
  .form-grid.two-col,
  .chart-layout,
  .report-grid,
  .inline-grid,
  .inline-grid.three {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .radio-grid {
    grid-column: 1 / -1;
  }
}

@media (min-width: 861px) {
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) !important;
  }
}


.customer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-section-title span,
.customer-section-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-section-title strong {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
}





/* Top exam tabs and scrollable customer panel */
:root {
  --header-height: 104px;
  --topbar-main-height: 60px;
  --topbar-tabs-height: 44px;
}

body {
  padding-top: var(--header-height);
}

.app-topbar {
  display: grid;
  grid-template-columns: clamp(292px, 22vw, 340px) minmax(0, 1fr);
  grid-template-rows: var(--topbar-main-height) var(--topbar-tabs-height);
  align-items: stretch;
  height: var(--header-height);
  min-width: 0;
}

.topbar-brand {
  grid-column: 1;
  grid-row: 1;
  width: auto;
  height: var(--topbar-main-height);
}

.topbar-session {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  min-width: 0;
  height: var(--topbar-main-height);
}

.topbar-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: stretch;
  gap: 0;
  height: var(--topbar-tabs-height);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  background: #119877;
  scrollbar-width: thin;
}

.topbar-nav-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 112px;
  height: var(--topbar-tabs-height);
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.topbar-nav-item:hover,
.topbar-nav-item.is-active,
.topbar-nav-item[aria-current="page"] {
  background: #0b7f66;
  color: #ffffff;
}

.topbar-nav-short {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 11px;
  font-weight: 900;
}

.topbar-nav-item.is-active .topbar-nav-short,
.topbar-nav-item[aria-current="page"] .topbar-nav-short {
  background: #ffffff;
  color: var(--primary-strong);
}

.topbar-nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell {
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

.sidebar-brand {
  flex: 0 0 auto;
}

.customer-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

@media (min-width: 861px) {
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) !important;
  }
}

@media (max-width: 1180px) {
  .topbar-nav-item {
    min-width: 104px;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: auto;
  }

  body {
    padding-top: 0;
  }

  .app-topbar {
    position: static;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--topbar-main-height) var(--topbar-tabs-height);
    height: auto;
  }

  .topbar-brand,
  .topbar-nav {
    grid-column: 1;
  }

  .topbar-session {
    display: none;
  }

  .topbar-nav-item {
    min-width: 98px;
    padding: 0 10px;
  }

  .topbar-nav-label {
    max-width: 86px;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .customer-panel {
    max-height: none;
    overflow: visible;
  }
}

/* Restored side exam menu */
:root {
  --header-height: 60px;
  --topbar-main-height: 60px;
}

body {
  padding-top: var(--header-height);
}

.app-topbar {
  display: flex;
  align-items: center;
  height: var(--header-height);
  min-width: 0;
}

.topbar-brand {
  flex: 0 0 clamp(292px, 22vw, 340px);
  width: auto;
  height: 100%;
}

.topbar-session {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
}

.topbar-nav {
  display: none !important;
}

.app-shell {
  grid-template-columns: clamp(292px, 22vw, 340px) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-height));
}

.sidebar {
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  flex: 0 0 auto;
}

.sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.customer-panel {
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
}

.exam-menu-panel {
  margin: 10px 0 0;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.exam-menu-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #f5faf8;
  color: var(--text);
  padding: 9px 10px;
  text-align: left;
}

.exam-menu-header::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.exam-menu-panel.is-collapsed .exam-menu-header::after {
  transform: rotate(-45deg) translateY(1px);
}

.exam-menu-header span {
  font-size: 13px;
  font-weight: 900;
}

.exam-menu-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exam-menu-panel .nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: none;
  overflow: visible;
  padding: 7px;
}

.exam-menu-panel.is-collapsed .nav-list {
  display: none;
}

.exam-menu-panel .nav-item {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  min-height: 34px;
  border-radius: 3px;
  padding: 5px 7px;
}

.exam-menu-panel .nav-short {
  display: inline-flex;
  min-width: 34px;
  min-height: 24px;
  border-radius: 3px;
  background: #edf1f5;
  color: var(--muted);
}

.exam-menu-panel .nav-item.is-active {
  background: var(--primary);
  color: #ffffff;
}

.exam-menu-panel .nav-item.is-active .nav-short {
  background: #ffffff;
  color: var(--primary-strong);
}

.exam-menu-panel .nav-label {
  font-size: 13px;
  font-weight: 800;
}

.app-shell.is-sidebar-collapsed .sidebar-body,
.app-shell.is-sidebar-collapsed .exam-menu-panel {
  overflow: visible;
}

.app-shell.is-sidebar-collapsed .exam-menu-header {
  display: none;
}

.app-shell.is-sidebar-collapsed .exam-menu-panel .nav-list {
  display: flex;
  padding: 8px 0 0;
}

@media (min-width: 861px) {
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 64px minmax(0, 1fr) !important;
  }
}

@media (max-width: 1180px) {
}

@media (max-width: 860px) {
  :root {
    --header-height: auto;
  }

  body {
    padding-top: 0;
  }

  .app-topbar {
    position: static;
    display: flex;
    height: 60px;
  }

  .topbar-brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-session {
    display: none;
  }

  .app-shell,
  .app-shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar-body {
    overflow: visible;
  }

  .app-shell.is-sidebar-collapsed .customer-panel,
  .app-shell.is-sidebar-collapsed .sidebar-title,
  .app-shell.is-sidebar-collapsed .nav-label {
    display: block;
  }

  .app-shell.is-sidebar-collapsed .exam-menu-header {
    display: grid;
  }
}

/* Restore original-style top bar menu */
:root {
  --header-height: 60px;
}

.app-topbar {
  display: flex;
  align-items: center;
  height: var(--header-height);
  min-width: 1080px;
}

.topbar-brand {
  flex: 0 0 292px;
  width: 292px;
  height: 100%;
}

.topbar-nav {
  display: flex !important;
  align-items: center;
  gap: 2px;
  height: 100%;
  min-width: 0;
  overflow: visible;
  border-top: 0;
  background: transparent;
}

.topbar-nav button {
  display: flex;
  align-items: center;
  height: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-nav button:hover,
.topbar-nav button.is-active,
.topbar-nav button[aria-current="page"] {
  background: #119877;
  color: #ffffff;
}

.topbar-session {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  height: 100%;
  margin-left: auto;
}

@media (max-width: 1180px) {
  .app-topbar {
    min-width: 0;
  }

  .topbar-brand {
    flex-basis: 250px;
    width: 250px;
  }
}

@media (max-width: 860px) {
  .app-topbar {
    position: static;
    height: 60px;
  }

  .topbar-brand {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  .topbar-nav,
  .topbar-session {
    display: none !important;
  }
}

/* Top bar exam dropdown */
.topbar-exam-menu {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.topbar-exam-button,
.topbar-exam-menu .exam-menu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  min-height: 0;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.topbar-exam-button::after,
.topbar-exam-menu .exam-menu-header::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.topbar-exam-menu:not(.is-collapsed) .topbar-exam-button::after,
.topbar-exam-menu:not(.is-collapsed) .exam-menu-header::after {
  transform: rotate(225deg) translate(-1px, -1px);
}

.topbar-exam-button:hover,
.topbar-exam-button.is-active,
.topbar-exam-menu:not(.is-collapsed) .topbar-exam-button {
  background: #119877;
  color: #ffffff;
}

.topbar-exam-button span {
  font-size: 15px;
  font-weight: 800;
}

.topbar-exam-button strong {
  max-width: 92px;
  overflow: hidden;
  color: #d7fff5;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#examMenuCurrent[hidden] {
  display: none;
}

.topbar-exam-dropdown,
.topbar-exam-menu .nav-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  width: 276px;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 0 0 3px 3px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
  padding: 7px;
}

.topbar-exam-menu.is-collapsed .topbar-exam-dropdown,
.topbar-exam-menu.is-collapsed .nav-list {
  display: none;
}

.topbar-exam-dropdown .nav-item,
.topbar-exam-menu .nav-item {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: 34px;
  border-radius: 3px;
  padding: 7px 10px;
  color: var(--text);
}

.topbar-exam-dropdown .nav-short,
.topbar-exam-menu .nav-short {
  display: none;
}

.topbar-exam-dropdown .nav-item.is-active,
.topbar-exam-menu .nav-item.is-active {
  background: var(--primary);
  color: #ffffff;
}

.topbar-exam-dropdown .nav-item.is-active .nav-short,
.topbar-exam-menu .nav-item.is-active .nav-short {
  background: #ffffff;
  color: var(--primary-strong);
}

.sidebar .exam-menu-panel {
  display: none;
}

@media (max-width: 1180px) {
  .topbar-exam-button,
  .topbar-exam-menu .exam-menu-header {
    padding: 0 14px;
  }

  .topbar-exam-button strong {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar-exam-menu {
    display: none;
  }
}



/* Customer search in top bar */
.topbar-session {
  gap: 10px;
  padding: 0 16px;
}

.customer-search {
  position: relative;
  flex: 0 1 280px;
  min-width: 190px;
  max-width: 320px;
}

.customer-search-input {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0 12px;
  outline: none;
  font-size: 13px;
  font-weight: 800;
}

.customer-search-input::placeholder {
  color: rgba(255, 255, 255, 0.72);
}

.customer-search-input:focus {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.json-import-input {
  display: none;
}

.customer-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 140;
  display: grid;
  gap: 4px;
  width: min(360px, calc(100vw - 24px));
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow-strong);
  padding: 7px;
}

.customer-search-results.is-hidden {
  display: none;
}

.customer-search-result {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
}

.customer-search-result:hover,
.customer-search-result.is-active {
  border-color: rgba(0, 166, 140, 0.22);
  background: var(--primary-soft);
}

.customer-search-result strong {
  font-size: 13px;
  line-height: 1.2;
}

.customer-search-result span,
.customer-search-result small,
.customer-search-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.customer-search-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-search-empty {
  padding: 12px 10px;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .customer-search {
    flex-basis: 220px;
    min-width: 170px;
  }
}

/* Read-only customer identity in sidebar */
.patient-name-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-input {
  min-width: 88px;
}

.phoneme-section-stack {
  display: grid;
  gap: 14px;
}

.phoneme-total-summary {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.phoneme-total-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfd;
}

.phoneme-total-summary-heading h2,
.phoneme-total-summary-heading p {
  margin: 0;
}

.phoneme-total-summary-heading h2 {
  font-size: 15px;
}

.phoneme-total-summary-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.phoneme-total-aggregate {
  display: grid;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
}

.phoneme-total-aggregate span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.phoneme-total-aggregate strong {
  color: var(--primary-strong);
  font-size: 15px;
}

.phoneme-total-summary ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.phoneme-total-summary li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 11px 14px;
  border-right: 1px solid var(--border);
}

.phoneme-total-summary li:last-child {
  border-right: 0;
}

.phoneme-total-summary li span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.phoneme-total-summary li strong {
  font-size: 14px;
}

.phoneme-total-summary li small {
  grid-column: 1 / -1;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 750;
}

.phoneme-table th,
.phoneme-table td {
  min-width: 70px;
}

.phoneme-table th:first-child,
.phoneme-table td:first-child {
  min-width: 92px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #ffffff;
}

.phoneme-table .phoneme-total-row th,
.phoneme-table .phoneme-total-row td {
  border-top: 2px solid #b8d8d1;
  background: #eef8f5;
  color: #24433f;
  font-weight: 750;
}

.phoneme-table .phoneme-total-row td[colspan] {
  color: var(--muted);
  text-align: right;
  font-size: 11px;
}

.training-content-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.training-content-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.training-content-list li:last-child {
  border-bottom: 0;
}

.training-content-list p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.training-content-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

/* Final responsive top bar rules */
.app-topbar {
  min-width: 0;
}

.topbar-brand {
  flex: 0 0 clamp(220px, 21vw, 292px);
  min-width: 0;
}

.topbar-brand strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-nav {
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
}

.topbar-nav > button,
.topbar-exam-button,
.topbar-exam-menu .exam-menu-header {
  flex: 0 0 auto;
  min-width: max-content;
  padding-inline: 14px;
}

.topbar-session {
  flex: 1 1 auto;
  min-width: 0;
}

.customer-search {
  flex: 1 1 220px;
  min-width: 150px;
}

.topbar-exam-dropdown .nav-item,
.topbar-exam-menu .nav-item {
  height: auto;
  padding: 7px 10px;
}

@media (max-width: 1280px) {
  .topbar-brand {
    flex-basis: 230px;
    width: auto;
    padding-inline: 14px;
  }

  .topbar-nav > button,
  .topbar-exam-button,
  .topbar-exam-menu .exam-menu-header {
    padding-inline: 11px;
    font-size: 14px;
  }

  .topbar-session {
    gap: 7px;
    padding-inline: 10px;
  }

  .customer-search {
    flex-basis: 180px;
    min-width: 132px;
  }
}

@media (max-width: 1040px) {
  :root {
    --header-height: 104px;
  }

  body {
    padding-top: var(--header-height);
  }

  .app-topbar {
    position: fixed;
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    grid-template-rows: 60px 44px;
    align-items: stretch;
    height: var(--header-height);
    min-width: 0;
  }

  .topbar-brand {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    height: 60px;
  }

  .topbar-session {
    grid-column: 2;
    grid-row: 1;
    height: 60px;
    justify-content: flex-end;
  }

  .topbar-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex !important;
    align-items: stretch;
    height: 44px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    background: #119877;
    scrollbar-width: thin;
  }

  .topbar-nav > button,
  .topbar-exam-button,
  .topbar-exam-menu .exam-menu-header {
    height: 44px;
    min-height: 44px;
    padding-inline: 14px;
  }

  .topbar-exam-menu {
    display: flex;
    flex: 0 0 auto;
    height: 44px;
  }

  .topbar-exam-dropdown,
  .topbar-exam-menu .nav-list {
    position: fixed;
    top: var(--header-height);
    left: 8px;
    width: min(320px, calc(100vw - 16px));
    max-height: calc(100vh - var(--header-height) - 8px);
  }

  .app-shell {
    min-height: calc(100vh - var(--header-height));
  }

  .sidebar {
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
  }
}

@media (max-width: 860px) {
  .app-topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-brand {
    grid-column: 1;
  }

  .topbar-session {
    display: none !important;
  }

  .topbar-nav {
    grid-column: 1;
  }

  .topbar-nav > button,
  .topbar-exam-button,
  .topbar-exam-menu .exam-menu-header {
    min-width: 94px;
    justify-content: center;
    padding-inline: 10px;
    font-size: 13px;
  }

  .topbar-exam-menu {
    display: flex;
  }

  .topbar-exam-button strong {
    display: none;
  }
}

@media (max-width: 520px) {
  .topbar-brand {
    padding-inline: 12px;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .topbar-brand strong {
    font-size: 15px;
  }

  .topbar-nav > button,
  .topbar-exam-button,
  .topbar-exam-menu .exam-menu-header {
    min-width: 86px;
    padding-inline: 8px;
  }
}

/* Customer management */
.customer-management-layout {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.customer-list-panel,
.customer-detail-panel {
  min-width: 0;
}

.customer-list-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
}

.customer-management-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  border-bottom: 1px solid var(--border);
  padding: 12px;
}

.customer-management-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.customer-management-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.customer-card-list {
  display: grid;
  max-height: calc(100vh - var(--header-height) - 210px);
  min-height: 220px;
  overflow-y: auto;
}

.customer-list-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas:
    "avatar main"
    "avatar status";
  gap: 4px 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.customer-list-card:last-child {
  border-bottom: 0;
}

.customer-list-card:hover,
.customer-list-card.is-active {
  background: #f0faf7;
}

.customer-list-card.is-active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.customer-list-avatar,
.customer-detail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #dff5ee;
  color: #126b58;
  font-weight: 900;
}

.customer-list-avatar {
  grid-area: avatar;
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.customer-list-main {
  grid-area: main;
  min-width: 0;
}

.customer-list-main strong,
.customer-list-main small,
.customer-list-main em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-main strong {
  font-size: 14px;
  line-height: 1.25;
}

.customer-list-main small,
.customer-list-main em,
.customer-list-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.customer-list-main em {
  margin-top: 3px;
  font-style: normal;
}

.customer-list-status {
  grid-area: status;
  font-weight: 800;
}

.customer-detail-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.customer-detail-title {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
}

.customer-detail-avatar {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  font-size: 16px;
}

.customer-detail-title div {
  min-width: 0;
}

.customer-detail-title strong,
.customer-detail-title small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-detail-title strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.customer-detail-title small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.has-modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(16, 24, 40, 0.42);
}

.oneflow-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 230;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(16, 24, 40, 0.22);
  transform: translate(-50%, -50%);
}

.oneflow-modal-header,
.oneflow-modal-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.oneflow-modal-header {
  border-bottom: 1px solid var(--border);
}

.oneflow-modal-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.oneflow-modal-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.oneflow-modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: #fbfcfd;
}

.modal-close-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.modal-close-button:hover {
  border-color: var(--border-strong);
  background: #f4f7fa;
}

.customer-create-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.customer-create-form .full {
  grid-column: 1 / -1;
}

.customer-create-sex {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.customer-create-sex legend {
  color: var(--muted);
  font-size: 11px;
}

.customer-create-sex .segmented-control {
  border-radius: 7px;
}

.customer-create-sex .segmented-control span {
  border-radius: 6px;
}

@media (max-width: 980px) {
  .customer-management-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-card-list {
    max-height: 360px;
  }
}

@media (max-width: 640px) {
  .customer-management-header,
  .customer-detail-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-create-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .oneflow-modal {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .oneflow-modal-header,
  .oneflow-modal-body,
  .oneflow-modal-footer {
    padding: 12px;
  }
}

.customer-avatar.hsol-customer-avatar,
.customer-list-avatar.hsol-customer-avatar,
.customer-detail-avatar.hsol-customer-avatar {
  border-radius: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  color: transparent;
  font-size: 0;
  line-height: 0;
}

.hsol-customer-avatar.icon-male {
  background-image: url("/assets/avatars/male.svg");
}

.word-memory-summary .is-active-row th,
.word-memory-summary .is-active-row td {
  background: var(--primary-soft);
}

.memory-span-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.memory-reference-block {
  margin-bottom: 18px;
}

.memory-reference-block h3,
.memory-span-heading {
  margin: 0 0 9px;
  color: var(--text);
  font-size: 13px;
}

.memory-reference-block h3 span {
  margin-left: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.memory-reference-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  counter-reset: memory-reference;
  list-style: none;
}

.memory-reference-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  counter-increment: memory-reference;
}

.memory-reference-number::before {
  content: counter(memory-reference);
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: center;
}

.memory-reference-list .memory-word {
  border-radius: 4px;
  justify-content: center;
}

.memory-span-band {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 58px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.memory-span-score {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  border-right: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-variant-numeric: tabular-nums;
}

.memory-span-score strong {
  font-size: 16px;
  line-height: 1.1;
}

.memory-span-score span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.memory-span-words {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 7px;
  padding: 10px 12px;
}

.memory-word {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-muted);
  padding: 4px 11px;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
}

@media (max-width: 720px) {
  .memory-span-band {
    grid-template-columns: 1fr;
  }

  .memory-span-score {
    grid-template-columns: auto auto;
    justify-content: start;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
  }

  .memory-span-score span {
    align-self: center;
  }

  .memory-span-words {
    padding: 9px;
  }

  .memory-reference-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hsol-customer-avatar.icon-female {
  background-image: url("/assets/avatars/female.svg");
}

.hsol-customer-avatar.icon-unknown {
  background-image: url("/assets/avatars/unknown.svg");
}

/* Top bar login context */
.topbar-user-name {
  display: flex !important;
}

@media (max-width: 860px) {
  .topbar-session {
    display: none !important;
  }
}

/* Dropdown customer search */
.customer-search {
  position: relative;
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
}

.customer-search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
}

.customer-search-toggle:hover,
.customer-search.is-open .customer-search-toggle {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.18);
}

.customer-search-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.customer-search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.customer-search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 150;
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 24px));
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: var(--shadow-strong);
  padding: 10px;
}

.customer-search-panel.is-hidden {
  display: none;
}

.customer-search-panel .customer-search-input {
  width: 100%;
  height: 36px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
  font-size: 13px;
  font-weight: 800;
}

.customer-search-panel .customer-search-input::placeholder {
  color: var(--muted);
}

.customer-search-panel .customer-search-input:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 166, 140, 0.12);
}

.customer-search-panel .customer-search-results {
  position: static;
  display: grid;
  gap: 4px;
  width: 100%;
  max-height: 310px;
  overflow-y: auto;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 8px 0 0;
}

.customer-search-panel .customer-search-results.is-hidden {
  display: none;
}

@media (max-width: 1040px) {
  .customer-search-panel {
    top: calc(100% + 6px);
    right: 0;
  }
}

/* HSOL visual alignment */
:root {
  --bg: #f9f9fb;
  --panel: #ffffff;
  --panel-muted: #fbfbfb;
  --text: #37495f;
  --muted: #8795a8;
  --border: #d4d8df;
  --border-strong: #ced4da;
  --primary: #00a68c;
  --primary-strong: #2b8871;
  --primary-soft: #d3efe8;
  --shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-strong: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

body,
.sidebar,
.workspace {
  background: var(--bg);
  color: var(--text);
}

.app-topbar {
  border-bottom: 1px solid #058e77;
  background: var(--primary);
  box-shadow: none;
}

.topbar-brand {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-mark {
  border-radius: 3px;
  color: var(--primary);
}

.topbar-nav button,
.topbar-exam-button,
.topbar-exam-menu .exam-menu-header {
  font-weight: 700;
}

.topbar-nav button:hover,
.topbar-nav button.is-active,
.topbar-nav button[aria-current="page"],
.topbar-exam-button:hover,
.topbar-exam-button.is-active,
.topbar-exam-menu:not(.is-collapsed) .topbar-exam-button,
.customer-search-toggle:hover,
.customer-search.is-open .customer-search-toggle {
  border-color: transparent;
  background: #119877;
  color: #ffffff;
}

.topbar-user-name span {
  color: #a0ddcc;
}

.customer-panel,
.module-surface,
.insight-surface,
.customer-list-panel {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-header {
  position: relative;
  min-height: 65px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 15px 30px 14px;
}

.module-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 30px;
  width: 160px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

.module-kicker {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
}

.module-header h1 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
}

.module-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

#moduleBody {
  padding: 20px 30px 24px;
}

.section-band {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.section-title {
  min-height: 48px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
  padding: 10px 14px;
}

.section-title h2,
.section-title h3 {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-title p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.customer-management-header {
  min-height: 65px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  padding: 15px 16px;
}

.customer-management-header h2 {
  color: var(--text);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
}

.customer-management-header p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-list-card {
  border-bottom: 1px solid #e9ecef;
  background: var(--panel);
  padding: 10px 12px;
}

.customer-list-card:hover,
.customer-list-card.is-active {
  background: #bff0e3;
}

.customer-list-card.is-active {
  box-shadow: inset 3px 0 0 var(--primary);
}

.customer-list-main strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.customer-list-main small,
.customer-list-main em,
.customer-list-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.customer-detail-head {
  min-height: 65px;
  border-top: 0;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.customer-detail-title strong {
  color: var(--text);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0;
}

.customer-detail-title small {
  color: var(--muted);
}

.form-field span,
.field span,
.field legend,
.protocol-field > span,
.block-title span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.inline-input,
.field input,
.field select,
.field textarea,
.table-input,
.score-input,
textarea {
  border: 1px solid #e9ecef;
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
}

.inline-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus,
.score-input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 140, 0.12);
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button,
.tab-button {
  min-height: 32px;
  border-radius: 2px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 400;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.secondary-button,
.mini-button {
  border-color: var(--text);
  background: var(--panel);
  color: var(--text);
}

.secondary-button:hover,
.mini-button:hover,
.ghost-button:hover,
.tab-button:hover {
  border-color: var(--text);
  background: #edf0f3;
}

.secondary-button.reset-all-button {
  border-color: #d8a6a6;
  background: #fffafa;
  color: #9f3434;
}

.secondary-button.reset-all-button:hover:not(:disabled) {
  border-color: #b94b4b;
  background: #fff1f1;
  color: #842626;
}

.oneflow-modal {
  border: 0;
  border-radius: 3px;
  box-shadow: var(--shadow-strong);
}

.oneflow-modal-header {
  min-height: 60px;
  align-items: flex-start;
  border-bottom: 0;
  padding: 0 0 0 30px;
}

.oneflow-modal-header .oneflow-title {
  position: relative;
  margin: 0;
  padding: 15px 0 !important;
  color: var(--text);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
}

.oneflow-modal-header .oneflow-title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  height: 5px;
  border-radius: 0 0 5px 5px;
  background: var(--primary);
}

.modal-close-button {
  width: 50px;
  height: 50px;
  margin-left: auto;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
}

.oneflow-modal-body {
  padding: 0 30px 18px;
}

.oneflow-modal-footer {
  border-top: 0;
  border-radius: 0 0 4px 4px;
  background: #f4f4f4;
  padding: 20px 30px;
}

.customer-create-form {
  gap: 12px 14px;
}

.customer-create-form .form-field span,
.customer-create-sex legend {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.customer-create-form .inline-input,
.customer-create-sex .segmented-control {
  min-height: 36px;
  border-color: #e9ecef;
  border-radius: 3px;
}

.customer-search-toggle {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 700;
}

.customer-search-panel {
  border: 1px solid var(--border);
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.customer-search-panel .customer-search-input {
  height: 36px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: none;
  font-weight: 700;
}

.customer-search-panel .customer-search-input:focus {
  border-bottom-color: #fafafa;
  background: #fafafa;
  box-shadow: none;
}

.summary-item,
.table-wrap,
.chart-shell,
.mini-chart,
.remarks-block textarea {
  border-radius: 3px;
}

.state-badge {
  border-radius: 2px;
  font-weight: 700;
}

@media (max-width: 640px) {
  .module-header {
    padding: 14px 16px 12px;
  }

  .module-header::before {
    left: 16px;
    width: 120px;
  }

  #moduleBody {
    padding: 14px;
  }

  .oneflow-modal-header {
    padding: 0 0 0 16px;
  }

  .oneflow-modal-body,
  .oneflow-modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .oneflow-modal-header .oneflow-title::before {
    width: 120px;
  }
}

/* HSOL header search alignment */
.topbar-session {
  gap: 0;
  padding: 0;
}

.topbar-user-name {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  height: 60px;
  border-left: 0;
  padding: 0 18px;
  line-height: 60px;
}

.topbar-user-name span,
.topbar-user-name strong {
  display: inline;
  font-size: 12px;
  font-weight: 700;
  line-height: 60px;
}

/* Authenticated local workspace */
body.auth-locked {
  overflow: hidden;
}

body.auth-locked .app-topbar,
body.auth-locked .app-shell,
body.auth-locked #customerModalRoot,
body.auth-locked #audioCalibrationModalRoot,
body.auth-locked #phonemeComparisonModalRoot,
body.auth-locked #systemModalRoot,
body.auth-locked .toast {
  visibility: hidden;
}

.auth-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: auto;
  isolation: isolate;
  background: #eef7f4;
  padding: clamp(28px, 5vw, 72px);
}

.auth-root::before {
  content: none;
}

body:not(.auth-locked) .auth-root {
  display: none;
}

.auth-stage {
  position: relative;
  display: grid;
  grid-template-columns: 460px minmax(0, 1fr);
  width: min(1180px, 100%);
  height: min(720px, calc(100dvh - 72px));
  min-height: 580px;
  overflow: hidden;
  border: 1px solid rgba(0, 166, 140, 0.13);
  border-radius: 6px;
  background: #f9f9fb;
  box-shadow: 0 28px 70px rgba(33, 44, 57, 0.16);
  animation: auth-stage-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-showcase {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #00a68c;
  color: #ffffff;
}

.auth-showcase::before,
.auth-showcase::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.auth-showcase::before {
  top: -84px;
  right: -128px;
  width: 390px;
  height: 250px;
  background: rgba(33, 44, 57, 0.11);
  transform: rotate(8deg);
}

.auth-showcase::after {
  bottom: -145px;
  left: -118px;
  width: 410px;
  height: 290px;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(-7deg);
}

.auth-showcase-content {
  position: relative;
  z-index: 1;
  width: 300px;
  text-align: center;
}

.auth-showcase-mark {
  display: block;
  width: 90px;
  height: 90px;
  margin: 0 auto 38px;
  filter: drop-shadow(0 12px 20px rgba(33, 44, 57, 0.12));
}

.auth-showcase h2 {
  margin: 0;
  color: #ffffff;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
}

.auth-showcase-content p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
}

.auth-panel {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid rgba(92, 111, 134, 0.08);
  background: #f9f9fb;
  padding: 48px;
}

.auth-panel::before {
  content: none;
}

.auth-panel-inner {
  position: relative;
  width: min(460px, 100%);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.auth-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 38px;
  color: #37495f;
}

.auth-brand img {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(0, 166, 140, 0.14);
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(33, 44, 57, 0.08);
}

.auth-brand strong {
  font-size: 14px;
}

.auth-heading {
  margin-bottom: 28px;
}

.auth-heading h1 {
  margin: 0;
  color: #37495f;
  font-size: 30px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
}

.auth-heading p {
  margin: 10px 0 0;
  color: #8795a8;
  font-size: 15px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #37495f;
  font-size: 13px;
  font-weight: 700;
}

.auth-form input,
.auth-form select {
  width: 100%;
  height: 50px;
  border: 1px solid #ced4da;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 12px;
  color: #37495f;
  font-size: 15px;
}

.auth-form input::placeholder {
  color: #d1d6df;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: #00a68c;
  outline: 3px solid rgba(0, 166, 140, 0.12);
  outline-offset: 0;
}

.auth-submit {
  width: 180px;
  height: 50px;
  margin: 10px 0 0 auto;
  border: 0;
  border-radius: 50px;
  background: #00a68c;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.auth-submit:hover:not(:disabled) {
  background: #2b8871;
  box-shadow: 0 10px 22px rgba(0, 166, 140, 0.2);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  background: #ced4da;
  box-shadow: none;
  transform: none;
}

.auth-error {
  min-height: 18px;
  margin: -2px 0 0;
  color: #b42318;
  font-size: 12px;
}

.auth-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.auth-form-actions button {
  min-width: 148px;
  height: 50px;
  border-radius: 50px;
}

@keyframes auth-stage-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .auth-stage {
    grid-template-columns: minmax(0, 1fr);
    width: min(620px, 100%);
    height: auto;
    min-height: min(680px, calc(100dvh - 56px));
  }

  .auth-showcase {
    display: none;
  }

  .auth-panel {
    padding: 46px;
  }

  .auth-brand {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-stage {
    animation: none;
  }

  .auth-submit {
    transition: none;
  }
}

.topbar-new-customer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.topbar-new-customer > span:first-child {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.topbar-new-customer:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.account-menu-wrap {
  position: relative;
  align-self: stretch;
}

.topbar-account {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 142px;
  height: 60px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #ffffff;
  padding: 0 18px;
  text-align: left;
}

.topbar-account:hover,
.topbar-account[aria-expanded="true"] {
  background: #087b69;
}

.topbar-account span {
  color: #a0ddcc;
  font-size: 11px;
}

.topbar-account .topbar-branch-name {
  max-width: 150px;
  overflow: hidden;
  color: #b7e6da;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-account strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: fixed;
  top: 60px;
  right: 58px;
  z-index: 120;
  width: 170px;
  border: 1px solid #bdc8cd;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(24, 38, 45, 0.16);
  display: grid;
  gap: 2px;
  padding: 5px;
  white-space: normal;
}

.account-menu.is-hidden {
  display: none;
}

.account-menu button {
  display: block;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #26383f;
  padding: 7px 9px;
  text-align: left;
}

.account-menu button:hover {
  background: #edf4f2;
}

.user-admin-modal {
  width: min(960px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 32px));
}

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #d6dde1;
  margin-bottom: 16px;
}

.admin-tab {
  min-height: 38px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #52656e;
  padding: 7px 12px;
  font-weight: 700;
}

.admin-tab.is-active {
  border-bottom-color: #007f6d;
  color: #163e37;
}

.user-create-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.2fr) 130px auto;
  gap: 8px;
  align-items: end;
  border-bottom: 1px solid #dce3e6;
  padding-bottom: 16px;
  margin-bottom: 14px;
}

.user-create-row label {
  display: grid;
  gap: 5px;
  color: #3b4d55;
  font-size: 12px;
  font-weight: 700;
}

.user-create-row input,
.user-create-row select,
.user-role-select,
.user-display-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid #bcc8cd;
  border-radius: 3px;
  background: #ffffff;
  padding: 7px 9px;
}

.admin-user-meta {
  display: block;
  margin-top: 4px;
  color: #657780;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

.admin-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.admin-active-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.admin-empty {
  height: 96px;
  color: #657780;
  text-align: center !important;
}

.admin-table-wrap {
  overflow: auto;
  max-height: 430px;
  border: 1px solid #d4dde1;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e0e5e8;
  padding: 9px;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f4f5;
  color: #34474f;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.temporary-password-box {
  border: 1px solid #9dcfc4;
  border-radius: 3px;
  background: #edf8f5;
  margin-bottom: 14px;
  padding: 11px 12px;
  color: #21483f;
  font-size: 12px;
}

.temporary-password-box code {
  display: block;
  margin-top: 5px;
  color: #102e28;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.temporary-password-box button {
  margin: 8px 8px 0 0;
}

.temporary-password-box > span {
  color: #526a62;
}

.audit-outcome-failure,
.audit-outcome-denied {
  color: #b42318;
  font-weight: 700;
}

body.role-readonly #moduleBody input:not([readonly]),
body.role-readonly #moduleBody textarea:not([readonly]),
body.role-readonly #moduleBody select,
body.role-readonly #examConditionGrid input,
body.role-readonly #examConditionGrid select,
body.role-readonly #remarkInput {
  background: #eef1f2;
  color: #60727a;
}

@media (max-width: 760px) {
  .auth-root {
    align-items: start;
    padding: 16px;
  }

  .auth-root::before {
    content: none;
  }

  .auth-stage {
    min-height: calc(100dvh - 32px);
    border-radius: 5px;
  }

  .auth-panel {
    margin-top: 0;
    padding: 36px 28px;
  }

  .auth-panel-inner {
    padding: 0;
  }

  .auth-brand {
    margin-bottom: 32px;
  }

  .auth-heading h1 {
    font-size: 26px;
  }

  .auth-heading p {
    font-size: 13px;
  }

  .auth-submit {
    width: 100%;
  }

  .auth-form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-form-actions button {
    min-width: 0;
  }

  .topbar-account {
    min-width: 104px;
    padding: 0 10px;
  }

  .app-topbar .topbar-account .topbar-branch-name {
    display: none;
  }

  .topbar-new-customer > span:last-child {
    display: none;
  }

  .user-create-row {
    grid-template-columns: 1fr;
  }

  .user-admin-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
}

.topbar-user-name span {
  color: #a0ddcc;
}

.topbar-user-name strong {
  color: #ffffff;
}

.customer-search {
  flex: 0 0 50px;
  width: 50px;
}

.customer-search-toggle {
  display: grid;
  place-items: center;
  width: 50px;
  height: 60px;
  border: 0;
  border-left: 1px solid #058e77;
  border-radius: 0;
  background: #119877;
  color: rgba(255, 255, 255, 0.58);
  padding: 0;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.customer-search-toggle:hover,
.customer-search.is-open .customer-search-toggle {
  border-left-color: #058e77;
  background: var(--primary-strong);
  color: #ffffff;
}

.customer-search-icon {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.customer-search-icon::after {
  right: -7px;
  bottom: -5px;
  width: 9px;
  height: 2px;
}

.customer-search-panel {
  top: 100%;
  right: 0;
}

.topbar-nav > button[data-topbar-target="report"] {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 860px) {
  .app-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .topbar-brand {
    grid-column: 1;
    min-width: 0;
  }

  .topbar-session {
    display: flex !important;
    grid-column: 2;
    grid-row: 1;
    height: 60px;
    padding: 0;
  }

  .topbar-user-name {
    display: none !important;
  }

  .topbar-nav {
    grid-column: 1 / -1;
  }
}

/* HSOL single-title module header */
.module-kicker,
.module-header p {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 520px) {
  html,
  body,
  .app-shell,
  .sidebar,
  .sidebar-body,
  .customer-panel,
  .condition-grid,
  .field,
  .segmented-control {
    min-width: 0;
    max-width: 100%;
  }

  .sidebar {
    width: 100%;
  }

  .customer-panel .condition-grid {
    width: 100vw;
    box-sizing: border-box;
  }

  .condition-grid > .field {
    width: 100%;
    box-sizing: border-box;
  }

  .segmented-control span {
    padding-inline: 3px;
    font-size: 11px;
  }
}

.module-header > div:first-child {
  display: flex;
  min-width: 0;
  min-height: 35px;
  align-items: center;
}

.module-header h1 {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Roomier right-side score summary */
.score-block,
.progress-block,
.chart-block {
  padding: 18px 20px;
}

.score-block {
  display: grid;
  gap: 12px;
}

.score-value {
  align-items: center;
  gap: 16px;
}

.score-value strong {
  min-width: 0;
  font-size: 32px;
  line-height: 1.1;
}

.score-value span {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 5px 11px;
  line-height: 1.25;
}

.score-block p {
  margin: 0;
}

.block-title {
  margin-bottom: 14px;
}

.chart-block .block-title {
  display: none;
}

.chart-block {
  padding: 14px 20px;
}

.mini-chart {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

/* Quiet status labels */
.score-value {
  justify-content: flex-start;
}

.session-badge,
.state-badge {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.state-badge::before {
  content: none;
  display: none;
}

.state-badge.pending,
.state-badge.danger {
  background: transparent;
}

/* Header brand icon */
.brand-mark {
  font-size: 0;
  line-height: 0;
}

.brand-icon {
  display: block;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Persistent patient context and minimal desktop sidebar. */
.topbar-brand-copy {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 5px;
  align-content: center;
}

.topbar-brand {
  padding-inline: 20px;
}

.topbar-brand-copy > strong,
.topbar-current-customer {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-current-customer {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.sidebar-toggle {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.sidebar-panel-toggle {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  margin-left: 0;
  align-self: flex-start;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.sidebar-panel-toggle:hover {
  border-color: #b9e2d9;
  background: #e5f7f3;
  color: #007f70;
}

.sidebar-panel-toggle:focus-visible {
  outline: 2px solid #007f70;
  outline-offset: 2px;
}

.sidebar .customer-panel {
  margin-top: 0;
}

.topbar-session > .topbar-new-customer {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 108px;
  height: 60px;
  border: 0;
  border-left: 1px solid #b9e2d9;
  border-radius: 0;
  background: #e5f7f3;
  color: #007f70;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
}

.topbar-session > .topbar-new-customer:hover {
  background: #ffffff;
  color: #007f70;
}

.topbar-session > .topbar-new-customer:active {
  background: #d3eee8;
}

.topbar-session > .topbar-new-customer:focus-visible {
  outline: 2px solid #007f70;
  outline-offset: -4px;
}

.sidebar-toggle-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-toggle-open {
  display: none;
}

body.is-sidebar-collapsed .sidebar-toggle-close {
  display: none;
}

body.is-sidebar-collapsed .sidebar-toggle-open {
  display: block;
}

.sidebar-edge-trigger {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
}

@media (min-width: 861px) and (max-width: 1280px) {
  .topbar-brand {
    padding-inline: 14px;
  }
}

@media (min-width: 861px) {
  .sidebar {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .app-shell.is-sidebar-collapsed {
    grid-template-columns: 0 minmax(0, 1fr) !important;
  }

  .app-shell.is-sidebar-collapsed .sidebar {
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border-right: 0;
    background: transparent;
  }

  .app-shell.is-sidebar-collapsed .sidebar-brand {
    display: none;
  }

  .app-shell.is-sidebar-collapsed .sidebar-body {
    display: none;
  }

  .app-shell.is-sidebar-collapsed .dashboard-grid {
    padding-left: 20px;
  }

  body.is-sidebar-collapsed .sidebar-edge-trigger {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 35;
    display: block;
    width: 20px;
    height: auto;
    cursor: pointer;
    outline: 0;
  }

  .sidebar-edge-trigger::before {
    content: "";
    position: absolute;
    top: var(--sidebar-edge-y, 48px);
    left: 0;
    width: 3px;
    height: 56px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    opacity: 0.42;
    transform: translateY(-50%) scaleY(0.78);
    transition: width 160ms ease, opacity 160ms ease, transform 180ms cubic-bezier(0.2, 0, 0, 1);
  }

  .sidebar-edge-trigger::after {
    content: "";
    position: absolute;
    top: var(--sidebar-edge-y, 48px);
    left: 3px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--primary-strong);
    border-bottom: 2px solid var(--primary-strong);
    opacity: 0;
    transform: translate(-6px, -50%) rotate(-45deg);
    transition: opacity 140ms ease, transform 180ms cubic-bezier(0.2, 0, 0, 1);
  }

  .sidebar-edge-trigger:hover::before,
  .sidebar-edge-trigger:focus-visible::before {
    width: 6px;
    opacity: 1;
    transform: translateY(-50%) scaleY(1);
  }

  .sidebar-edge-trigger:hover::after,
  .sidebar-edge-trigger:focus-visible::after {
    opacity: 1;
    transform: translate(4px, -50%) rotate(-45deg);
  }
}

@media (max-width: 860px) {
  .topbar-brand {
    padding-inline: 20px;
  }

  .sidebar-toggle {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar-session > .topbar-new-customer {
    flex-basis: 50px;
    width: 50px;
    min-width: 50px;
    padding: 0;
  }
}

@media (max-width: 520px) {
  .topbar-brand-copy {
    gap: 4px;
  }

  .topbar-current-customer {
    max-width: 148px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell,
  .sidebar,
  .sidebar-brand,
  .sidebar-toggle,
  .sidebar-edge-trigger::before,
  .sidebar-edge-trigger::after {
    transition: none !important;
  }
}

/* Customer lifecycle controls */
.customer-management-toolbar {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.customer-archive-entry {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  background: var(--panel-muted);
  padding: 8px 10px;
}

.customer-archive-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 3px 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.customer-archive-shortcut svg,
.customer-archive-back svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-archive-shortcut:hover,
.customer-archive-shortcut:focus-visible {
  color: var(--primary-strong);
}

.customer-archive-shortcut:hover > span,
.customer-archive-shortcut:focus-visible > span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.customer-archive-shortcut:focus-visible,
.danger-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.customer-archive-shortcut:active {
  color: var(--primary-strong);
}

.customer-archive-shortcut:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  text-decoration: none;
}

.customer-archive-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.customer-list-panel.is-archive-management .customer-management-header {
  background: var(--panel-muted);
}

.customer-detail-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.customer-empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-height: 240px;
  background: #fafbfb;
  color: var(--muted);
  padding: 32px 20px;
  text-align: center;
}

.customer-empty-state h2,
.customer-empty-state h3,
.customer-empty-state strong {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

.customer-empty-state p {
  max-width: 420px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.customer-empty-state .primary-button,
.customer-empty-state .secondary-button {
  margin-top: 6px;
}

.customer-empty-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #cfe5df;
  border-radius: 3px;
  background: #edf7f5;
  color: var(--primary-strong);
  font-size: 21px;
  line-height: 1;
}

.customer-empty-icon svg {
  width: 21px;
  height: 21px;
}

.customer-empty-icon-button {
  appearance: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.customer-empty-icon-button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.customer-empty-icon-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.customer-empty-icon-button:active {
  border-color: var(--primary-strong);
  color: var(--primary-strong);
}

.customer-empty-icon-button:disabled {
  border-color: var(--border);
  background: var(--panel-muted);
  color: var(--subtle);
  cursor: not-allowed;
}

.archived-customer-card {
  background: #f8f9fa;
}

.archived-customer-card:hover,
.archived-customer-card.is-active {
  background: #edf4f2;
}

.archived-customer-card.is-active {
  box-shadow: inset 3px 0 0 #8aa69f;
}

.archived-customer-card .customer-list-avatar {
  filter: saturate(0.45);
  opacity: 0.82;
}

.archived-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid #d5dade;
  border-radius: 2px;
  background: #edf0f2;
  color: #5f6d79;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: nowrap;
}

.archived-customer-detail {
  min-width: 0;
  color: var(--text);
}

.customer-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  min-width: 0;
  border-top: 1px solid #e9ecef;
}

.customer-readonly-field {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  border-bottom: 1px solid #e9ecef;
  padding: 11px 0 12px;
}

.customer-readonly-field.full {
  grid-column: 1 / -1;
}

.customer-readonly-field > span:first-child,
.customer-readonly-field > label:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.customer-readonly-field > strong,
.customer-readonly-field > span:last-child,
.customer-readonly-field > p {
  min-width: 0;
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.customer-action-modal {
  width: min(560px, calc(100vw - 28px));
}

.customer-action-modal .oneflow-modal-body {
  display: grid;
  gap: 14px;
}

.customer-action-summary {
  display: grid;
  gap: 3px;
  min-width: 0;
  border: 1px solid #dde4e2;
  border-radius: 3px;
  background: #f7faf9;
  padding: 12px 14px;
}

.customer-action-summary strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-action-summary span,
.customer-action-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.customer-action-warning {
  border: 1px solid #f2b8b8;
  border-left: 3px solid var(--danger);
  border-radius: 3px;
  background: #fff5f5;
  color: #8f1d1d;
  padding: 11px 12px;
  font-size: 12px;
  line-height: 1.55;
}

.customer-action-warning strong {
  display: block;
  margin-bottom: 2px;
  color: #8f1d1d;
  font-size: 13px;
}

.customer-action-warning p {
  margin: 0;
}

.confirmation-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.confirmation-field > span,
.confirmation-field > label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.confirmation-field input,
.confirmation-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid #d9dfe3;
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 10px;
  outline: 0;
  font-size: 13px;
}

.confirmation-field textarea {
  min-height: 84px;
  resize: vertical;
}

.confirmation-field input:focus,
.confirmation-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 166, 140, 0.12);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid var(--danger);
  border-radius: 2px;
  background: var(--danger);
  color: #ffffff;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
}

.danger-button:hover:not(:disabled) {
  border-color: #b91c1c;
  background: #b91c1c;
}

.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.customer-action-error {
  min-height: 18px;
  margin: 0;
  border-left: 3px solid #aab3bc;
  border-radius: 0 2px 2px 0;
  background: #f4f5f6;
  color: #596572;
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.45;
}

.customer-action-error:empty {
  display: none;
}

.sidebar-customer-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 220px;
  color: var(--muted);
  padding: 24px 12px;
  text-align: center;
}

.sidebar-customer-empty .customer-empty-icon {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.sidebar-customer-empty strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.sidebar-customer-empty p {
  max-width: 220px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 720px) {
  .customer-management-toolbar {
    align-items: stretch;
  }

  .customer-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .customer-readonly-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-readonly-field.full {
    grid-column: auto;
  }

  .customer-empty-state {
    min-height: 190px;
    padding: 24px 16px;
  }

  .customer-action-modal {
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 18px);
  }

  .customer-action-modal .oneflow-modal-footer {
    flex-wrap: wrap;
  }

  .customer-action-modal .oneflow-modal-footer > button {
    flex: 1 1 132px;
  }
}

@media (max-width: 420px) {
  .customer-management-toolbar,
  .customer-detail-actions {
    flex-direction: column;
  }

  .customer-management-toolbar > button,
  .customer-detail-actions > button {
    width: 100%;
  }

  .customer-action-modal .oneflow-modal-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .customer-action-modal .oneflow-modal-footer > button {
    width: 100%;
  }
}

/* Clinical test audio player */
.audio-calibration-modal {
  width: min(560px, calc(100vw - 28px));
}

.audio-calibration-message p {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.audio-calibration-message p strong,
.audio-calibration-message p span {
  display: block;
}

.audio-calibration-dismiss {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin-top: 18px;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.audio-calibration-dismiss input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.audio-player-card {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: none;
}

.audio-player-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
}

.audio-player-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.audio-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #ffffff;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.audio-status-badge[hidden] {
  display: none;
}

.audio-library-fields {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(300px, 1.4fr);
  gap: 16px;
  padding: 16px 14px;
  background: #ffffff;
}

.audio-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px 12px;
  align-items: center;
  min-width: 0;
}

.audio-field > span {
  grid-column: 1;
  grid-row: 1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.audio-field input,
.audio-field select {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: #ffffff;
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
  font-size: 12px;
}

.audio-search-field input {
  grid-column: 1 / -1;
}

.audio-transport {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(216px, 1fr) auto;
  grid-template-areas: "track progress controls";
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: #f8fafb;
}

.audio-transport-buttons {
  grid-area: controls;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.audio-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--text);
  padding: 0;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.audio-icon-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.audio-icon-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.audio-main-control {
  width: 50px;
  height: 50px;
  flex-basis: 50px;
  border: 0;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 166, 140, 0.2);
}

.audio-main-control:hover:not(:disabled) {
  background: var(--primary-strong);
  color: #ffffff;
}

.audio-control-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.audio-main-control .audio-control-icon {
  width: 23px;
  height: 23px;
}

.audio-icon-fill {
  fill: currentColor;
  stroke: none;
}

.audio-transport button:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.audio-now-playing {
  grid-area: track;
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.audio-track-artwork {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  overflow: hidden;
  border: 1px solid rgba(0, 166, 140, 0.25);
  border-radius: 3px;
  background: var(--primary-soft);
}

.audio-equalizer {
  display: flex;
  gap: 3px;
  align-items: end;
  justify-content: center;
  width: 30px;
  height: 21px;
}

.audio-equalizer i {
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: var(--primary);
  transform-origin: bottom;
}

.audio-equalizer i:nth-child(2),
.audio-equalizer i:nth-child(4) {
  height: 15px;
}

.audio-equalizer i:nth-child(3) {
  height: 19px;
}

.audio-player-card.is-playing .audio-equalizer i {
  animation: audio-equalizer-pulse 1000ms ease-in-out infinite alternate;
}

.audio-player-card.is-playing .audio-equalizer i:nth-child(2) { animation-delay: -420ms; }
.audio-player-card.is-playing .audio-equalizer i:nth-child(3) { animation-delay: -180ms; }
.audio-player-card.is-playing .audio-equalizer i:nth-child(4) { animation-delay: -570ms; }
.audio-player-card.is-playing .audio-equalizer i:nth-child(5) { animation-delay: -290ms; }

@keyframes audio-equalizer-pulse {
  from { transform: scaleY(0.55); opacity: 0.72; }
  to { transform: scaleY(1); opacity: 1; }
}

.audio-track-copy {
  min-width: 0;
}

.audio-track-copy > span {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-strong);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.audio-now-playing strong,
.audio-now-playing small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-now-playing strong {
  color: var(--text);
  font-size: 13px;
}

.audio-now-playing small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.audio-progress-row {
  grid-area: progress;
  display: grid;
  grid-template-columns: 38px minmax(120px, 1fr) 38px;
  gap: 10px;
  align-items: center;
}

.audio-progress-row input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  outline: none;
  background: #d8e0e8;
  cursor: pointer;
}

.audio-progress-row input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  border: 3px solid #f8fafb;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(0, 166, 140, 0.5);
}

.audio-progress-row input[type="range"]::-moz-range-thumb {
  width: 9px;
  height: 9px;
  border: 3px solid #f8fafb;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(0, 166, 140, 0.5);
}

.audio-progress-row input[type="range"]:disabled {
  cursor: default;
  opacity: 0.45;
}

.audio-progress-row output {
  min-width: 38px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.audio-calibration-note,
.audio-runtime-error,
.audio-error-message,
.audio-loading-message {
  margin: 0;
  padding: 9px 14px;
  border-top: 1px solid #d9e8e4;
  font-size: 11px;
  line-height: 1.5;
}

.audio-calibration-note {
  background: var(--panel-muted);
  color: var(--muted);
}

.audio-runtime-error,
.audio-error-message {
  background: #fff4f4;
  color: #a12b2b;
}

.audio-runtime-error[hidden] {
  display: none;
}

.audio-loading-message {
  border-top: 0;
  color: var(--muted);
}

.calculation-rule-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.audio-player-card.is-loading,
.audio-player-card.has-error {
  background: #ffffff;
}

@media (max-width: 1040px) {
  .audio-transport {
    grid-template-columns: minmax(220px, 1fr) auto;
    grid-template-areas:
      "track controls"
      "progress progress";
  }
}

@media (max-width: 720px) {
  .audio-library-fields,
  .audio-transport {
    grid-template-columns: minmax(0, 1fr);
  }

  .audio-transport {
    grid-template-areas:
      "track"
      "progress"
      "controls";
    gap: 16px;
  }
}

@media (max-width: 420px) {
  .audio-player-heading,
  .audio-library-fields,
  .audio-transport {
    padding-right: 10px;
    padding-left: 10px;
  }

  .audio-transport-buttons {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .audio-player-card.is-playing .audio-equalizer i {
    animation: none;
  }
}

.customer-management-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.customer-management-header > div:first-child {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.customer-management-header h2 {
  white-space: nowrap;
}

.customer-management-toolbar {
  flex: none;
  width: 100%;
}

/* Optional large-type overview mode. The default workspace remains unchanged. */
.topbar-overview-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 60px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.topbar-overview-toggle:hover {
  background: #119877;
  color: #ffffff;
}

.topbar-overview-toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -4px;
}

.topbar-overview-toggle[aria-pressed="true"] {
  background: #ffffff;
  color: #007f70;
}

.overview-mode-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 1280px) {
  .topbar-overview-toggle {
    width: 52px;
    padding: 0;
  }

  .overview-mode-label {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar-overview-toggle {
    display: none;
  }
}

@media (min-width: 861px) {
  body.is-overview-mode .app-shell,
  body.is-overview-mode .app-shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.is-overview-mode .sidebar,
  body.is-overview-mode .sidebar-edge-trigger {
    display: none !important;
  }

  body.is-overview-mode .dashboard-grid,
  body.is-overview-mode .app-shell.is-sidebar-collapsed .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
    padding: 0 10px;
  }

  body.is-overview-mode .insight-surface {
    display: none !important;
  }

  body.is-overview-mode .module-surface {
    width: 100%;
    min-width: 0;
    font-size: 18px;
  }

  body.is-overview-mode .module-header {
    min-height: 32px;
    padding: 2px 10px;
  }

  body.is-overview-mode .module-header::before {
    left: 12px;
    width: 112px;
  }

  body.is-overview-mode .module-header > div:first-child {
    min-height: 28px;
  }

  body.is-overview-mode .module-header h1 {
    font-size: 25px;
    line-height: 1.15;
  }

  body.is-overview-mode #moduleBody {
    padding: 4px 8px;
  }

body.is-overview-mode .section-band {
    margin-bottom: 4px;
  }

  body.is-overview-mode .section-title {
    min-height: 26px;
    padding: 2px 6px;
  }

  body.is-overview-mode .section-title h2,
  body.is-overview-mode .section-title h3 {
    font-size: 19px;
    line-height: 1.15;
  }

  body.is-overview-mode .section-title p {
    display: none;
  }

  body.is-overview-mode .section-content {
    padding: 2px;
  }

  body.is-overview-mode .tabs-row {
    gap: 4px;
    margin-bottom: 6px;
  }

  body.is-overview-mode .tab-button,
  body.is-overview-mode .primary-button,
  body.is-overview-mode .secondary-button,
  body.is-overview-mode .ghost-button,
  body.is-overview-mode .mini-button {
    min-height: 29px;
    padding: 3px 9px;
    font-size: 16px;
  }

  body.is-overview-mode .table-wrap,
  body.is-overview-mode .table-wrap.compact {
    max-height: none;
    border-radius: 2px;
  }

  body.is-overview-mode .data-table {
    font-size: 18px;
    line-height: 1.08;
  }

  body.is-overview-mode .data-table thead th {
    font-size: 16px;
  }

  body.is-overview-mode .data-table th,
  body.is-overview-mode .data-table td {
    padding: 0 5px;
  }

  body.is-overview-mode .data-table .number-cell {
    width: 38px;
  }

  body.is-overview-mode .table-input,
  body.is-overview-mode .score-input,
  body.is-overview-mode .score-cell .score-input,
  body.is-overview-mode .derived-value {
    min-height: 26px;
    height: 26px;
    padding: 0 5px;
    font-size: 18px;
  }

  body.is-overview-mode .table-input {
    min-width: 100px;
  }

  body.is-overview-mode .score-input,
  body.is-overview-mode .score-cell .score-input {
    width: 64px;
    min-width: 64px;
  }

  body.is-overview-mode .word-token {
    min-width: 0;
    padding: 0;
    font-size: 20px;
  }

  body.is-overview-mode .scored-sentence {
    font-size: 18px;
    line-height: 1.2;
  }

  body.is-overview-mode .checkbox-line,
  body.is-overview-mode .radio-line,
  body.is-overview-mode .state-badge {
    font-size: 17px;
  }

  body.is-overview-mode .checkbox-line input,
  body.is-overview-mode .radio-line input {
    width: 18px;
    height: 18px;
  }

  body.is-overview-mode .field,
  body.is-overview-mode .protocol-panel {
    padding: 5px 6px;
  }

  body.is-overview-mode .field span,
  body.is-overview-mode .field legend,
  body.is-overview-mode .form-field span,
  body.is-overview-mode .protocol-field > span {
    font-size: 15px;
  }

  body.is-overview-mode .field input,
  body.is-overview-mode .field select,
  body.is-overview-mode .field textarea,
  body.is-overview-mode .inline-input,
  body.is-overview-mode textarea {
    font-size: 17px;
  }

  body.is-overview-mode .customer-id-output {
    min-height: 32px;
    padding: 3px 7px;
  }

  body.is-overview-mode .customer-id-output strong {
    font-size: 18px;
  }

  body.is-overview-mode .audio-player-card {
    margin-bottom: 4px;
  }

  body.is-overview-mode .audio-player-heading {
    display: none;
  }

  body.is-overview-mode .audio-player-heading h2 {
    font-size: 15px;
  }

  body.is-overview-mode .audio-library-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 2px 6px;
  }

  body.is-overview-mode .audio-search-field {
    display: none;
  }

  body.is-overview-mode .audio-field {
    gap: 0;
  }

  body.is-overview-mode .audio-field > span {
    display: none;
  }

  body.is-overview-mode .audio-field input,
  body.is-overview-mode .audio-field select {
    grid-row: 1;
    min-height: 27px;
    padding: 2px 6px;
    font-size: 16px;
  }

  body.is-overview-mode .audio-transport {
    grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1fr) auto;
    grid-template-areas: "track progress controls";
    gap: 8px;
    padding: 2px 6px;
  }

  body.is-overview-mode .audio-track-artwork,
  body.is-overview-mode .audio-track-copy > span {
    display: none;
  }

  body.is-overview-mode .audio-now-playing {
    gap: 0;
  }

  body.is-overview-mode .audio-now-playing strong {
    font-size: 17px;
  }

  body.is-overview-mode .audio-now-playing small {
    margin-top: 1px;
    font-size: 13px;
  }

  body.is-overview-mode .audio-transport-buttons {
    gap: 4px;
  }

  body.is-overview-mode .audio-icon-button {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  body.is-overview-mode .audio-main-control {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  body.is-overview-mode .audio-control-icon,
  body.is-overview-mode .audio-main-control .audio-control-icon {
    width: 18px;
    height: 18px;
  }

  body.is-overview-mode .audio-progress-row {
    grid-template-columns: 34px minmax(100px, 1fr) 34px;
    gap: 6px;
  }

  body.is-overview-mode .audio-progress-row output {
    min-width: 34px;
    font-size: 14px;
  }

  body.is-overview-mode .audio-calibration-note,
  body.is-overview-mode .audio-runtime-error,
  body.is-overview-mode .audio-error-message,
  body.is-overview-mode .audio-loading-message {
    padding: 0 6px;
    font-size: 14px;
    line-height: 1.25;
  }
}

/* Keep only the active WRS/SRS list expanded. */
.clinical-table .is-collapsed-list-col {
  box-sizing: border-box;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  overflow: hidden;
  background: #f3f5f6;
  padding-right: 2px;
  padding-left: 2px;
  color: var(--muted);
  text-align: center;
}

.clinical-table tbody .is-collapsed-list-col {
  background: #fafbfc;
}

.clinical-table th.is-collapsed-list-col {
  box-shadow: inset 0 -2px 0 #cfd6dd;
}

.clinical-table th.is-collapsed-list-col:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.clinical-table .is-collapsed-list-col .list-header-button {
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: center;
}

.srs-table .is-collapsed-list-col {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
}

.srs-table .is-collapsed-list-col .list-header-button {
  white-space: nowrap;
}

.srs-table {
  width: 718px;
  min-width: 718px;
  table-layout: fixed;
  margin-left: auto;
  margin-right: auto;
}

.srs-table .srs-number-col {
  width: 36px;
}

.srs-table .srs-active-list-col {
  width: 300px;
}

.srs-table .srs-collapsed-list-col {
  width: 72px;
}

.srs-table .srs-response-col {
  width: 190px;
}

.srs-table .srs-score-col {
  width: 118px;
}

body.is-overview-mode .srs-table {
  width: 914px;
  min-width: 914px;
}

body.is-overview-mode .srs-table .srs-active-list-col {
  width: 360px;
}

body.is-overview-mode .srs-table .srs-collapsed-list-col {
  width: 88px;
}

body.is-overview-mode .srs-table .srs-response-col {
  width: 320px;
}

body.is-overview-mode .wrs-table .is-collapsed-list-col {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
}

body.is-overview-mode .srs-table .is-collapsed-list-col {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
}

.wrs-table {
  width: 662px;
  min-width: 662px;
  table-layout: fixed;
  margin-right: auto;
  margin-left: auto;
}

.wrs-table .wrs-number-col {
  width: 44px;
}

.wrs-table .wrs-active-list-col {
  width: 90px;
}

.wrs-table .wrs-collapsed-list-col {
  width: 40px;
}

.wrs-table .wrs-response-col {
  width: 180px;
}

.wrs-table .wrs-no-response-col {
  width: 100px;
}

.wrs-table .wrs-judge-col {
  width: 128px;
}

body.is-overview-mode .wrs-table {
  width: 672px;
  min-width: 672px;
}

body.is-overview-mode .wrs-table .wrs-number-col {
  width: 42px;
}

body.is-overview-mode .wrs-table .wrs-active-list-col {
  width: 100px;
}

body.is-overview-mode .wrs-table .wrs-collapsed-list-col {
  width: 48px;
}

body.is-overview-mode .wrs-table .wrs-judge-col {
  width: 136px;
}

.wrs-no-response-cell .checkbox-line {
  justify-content: center;
  white-space: nowrap;
}

.wrs-judge-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  color: var(--success);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.wrs-judge-result.is-incorrect {
  color: var(--danger);
}

.session-date-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
}

.session-date-summary {
  display: grid;
  min-width: 220px;
  gap: 1px;
}

.session-date-summary > span,
.session-date-picker > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.session-date-summary strong {
  color: var(--text);
  font-size: 15px;
}

.session-date-summary small {
  color: var(--muted);
  font-size: 11px;
}

.session-date-picker {
  display: grid;
  gap: 4px;
}

.session-date-picker input,
.session-date-picker select {
  min-height: 34px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
  padding: 5px 8px;
  font: inherit;
}

.session-date-history {
  display: flex;
  flex: 1;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}

.session-today-button {
  flex: 0 0 auto;
  align-self: flex-end;
  min-height: 34px;
}

.session-date-button,
.report-date-button {
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel-muted);
  color: var(--muted);
  padding: 7px 9px;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.session-date-button.is-active,
.session-date-button:hover,
.report-date-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 검사기록의 조건은 구분 문자열 대신 읽을 수 있는 메타데이터 묶음으로 보여준다. */
.session-module-cell {
  min-width: 116px;
}

.session-module-link {
  display: inline-flex;
  align-items: center;
  gap: var(--hsol-space-1);
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  padding: var(--hsol-space-1);
  font: inherit;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.session-module-link-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--muted);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.session-module-link > span {
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.session-module-link:hover {
  color: var(--primary-strong);
}

.session-module-link:hover > span {
  text-decoration-color: currentColor;
}

.session-module-link:hover .session-module-link-icon {
  color: var(--primary-strong);
}

.session-module-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.session-module-link:active {
  color: var(--primary-strong);
}

.session-module-link:active > span {
  text-decoration-color: currentColor;
}

.session-module-link:disabled {
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
}

.session-module-link:disabled .session-module-link-icon {
  color: var(--subtle);
}

.session-result-cell {
  min-width: 104px;
}

.session-result-values {
  display: grid;
  justify-content: center;
  gap: var(--hsol-space-1);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.session-result-values > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--hsol-space-2);
}

.session-result-values dt,
.session-result-values dd {
  margin: 0;
}

.session-result-values dt,
.session-result-values dd span {
  color: var(--muted);
  font-size: var(--hsol-font-small);
  font-weight: 700;
  white-space: nowrap;
}

.session-result-values dd {
  display: inline-flex;
  align-items: baseline;
  gap: var(--hsol-space-1);
}

.session-result-values dd strong {
  color: var(--text);
  font-size: var(--hsol-font-medium);
  font-weight: 700;
}

.session-condition-cell {
  min-width: 292px;
}

.session-condition-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hsol-space-1) 0;
  margin: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.session-condition-item {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: var(--hsol-space-1);
  margin: 0;
  padding-inline: var(--hsol-space-2);
  border-inline-start: 1px solid var(--border);
  line-height: 1.3;
}

.session-condition-item:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

.session-condition-item dt,
.session-condition-item dd {
  margin: 0;
}

.session-condition-item dt {
  color: var(--muted);
  font-size: var(--hsol-font-small);
  font-weight: 700;
  white-space: nowrap;
}

.session-condition-item dd {
  min-width: 0;
  color: var(--text);
  font-size: var(--hsol-font-small);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.longitudinal-report {
  margin-top: 14px;
}

.longitudinal-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.report-results-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hsol-space-3);
  margin-bottom: var(--hsol-space-3);
}

.report-view-control {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: var(--hsol-control-height);
  overflow: visible;
  border: 1px solid var(--hsol-disabled-border);
  border-radius: var(--hsol-radius-soft);
  background: var(--hsol-paper);
  padding: 0;
}

.report-view-control button {
  min-height: 34px;
  border: 0;
  border-inline-end: 1px solid var(--hsol-table-line);
  border-radius: 0;
  background: var(--hsol-paper);
  color: var(--hsol-space-medium);
  padding: 5px var(--hsol-space-3);
  font: inherit;
  font-size: var(--hsol-font-small);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.report-view-control button:first-child {
  border-radius: var(--hsol-radius-soft) 0 0 var(--hsol-radius-soft);
}

.report-view-control button:last-child {
  border-inline-end: 0;
  border-radius: 0 var(--hsol-radius-soft) var(--hsol-radius-soft) 0;
}

.report-view-control button[aria-pressed="true"] {
  background: var(--hsol-brand-light);
  color: var(--hsol-brand-accessible);
  box-shadow: none;
  font-weight: 700;
}

.report-view-control button:hover:not([aria-pressed="true"]) {
  background: var(--hsol-canvas-light);
  color: var(--hsol-space-dark);
}

.report-view-control button:focus-visible {
  outline: 2px solid var(--hsol-focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--hsol-paper);
}

.report-filter-shell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
  min-width: 0;
  width: min(720px, 100%);
  margin-left: auto;
  margin-bottom: 0;
}

.report-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--panel);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.report-filter-toggle:hover,
.report-filter-toggle[aria-expanded="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.report-filter-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.report-filter-toggle:active {
  border-color: var(--primary-strong);
  color: var(--primary-strong);
}

.report-filter-toggle:disabled {
  border-color: var(--border);
  background: var(--panel-muted);
  color: var(--subtle);
  cursor: not-allowed;
}

.report-filter-toggle-icon,
.report-filter-toggle-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-filter-toggle-chevron {
  width: 12px;
  height: 12px;
  margin-inline-start: 2px;
}

.report-filter-toggle[aria-expanded="true"] .report-filter-toggle-chevron {
  transform: rotate(180deg);
}

.report-filter-popover {
  align-self: stretch;
  width: min(720px, 100%);
  margin-top: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--text) 13%, transparent);
}

.report-filter-popover[hidden] {
  display: none;
}

.report-filter-popover-header,
.report-filter-popover-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hsol-space-3);
  padding: var(--hsol-space-3);
}

.report-filter-popover-header {
  border-block-end: 1px solid var(--border);
}

.report-filter-popover-header > div {
  min-width: 0;
}

.report-filter-popover-header strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.report-filter-popover-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--hsol-font-small);
}

.report-filter-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}

.report-filter-close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.report-filter-close:hover {
  background: var(--panel-muted);
  color: var(--text);
}

.report-filter-close:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.report-filter-close:active {
  color: var(--primary-strong);
}

.report-filter-close:disabled {
  color: var(--subtle);
  cursor: not-allowed;
}

.report-filter-popover-footer {
  border-block-start: 1px solid var(--border);
  background: var(--panel-muted);
}

.report-filter-popover-footer > span {
  color: var(--muted);
  font-size: var(--hsol-font-small);
  font-weight: 700;
}

.report-filter-controls {
  display: grid;
  padding-inline: var(--hsol-space-3);
}

.report-filter-group {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: var(--hsol-space-3);
  padding-block: var(--hsol-space-3);
  border-block-end: 1px solid var(--border);
}

.report-filter-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hsol-space-2);
  min-width: 0;
}

.report-filter-heading > div {
  display: grid;
  gap: 2px;
}

.report-filter-heading strong {
  color: var(--text);
  font-size: 13px;
}

.report-filter-heading small {
  color: var(--muted);
  font-size: var(--hsol-font-small);
  font-weight: 700;
}

.report-filter-all {
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  padding: 2px 0;
  font: inherit;
  font-size: var(--hsol-font-small);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.report-filter-all:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-filter-all:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.report-filter-all:active {
  color: var(--primary-strong);
}

.report-filter-all:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  text-decoration: none;
}

.report-filter-options {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
  padding: 2px;
}

.report-filter-option {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--panel);
  color: var(--muted);
  padding: 6px 9px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.report-filter-option:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.report-filter-option.is-selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.report-filter-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.report-filter-option:active {
  border-color: var(--primary-strong);
  color: var(--primary-strong);
}

.report-filter-option:disabled {
  border-color: var(--border);
  background: var(--panel-muted);
  color: var(--subtle);
  cursor: not-allowed;
}

.report-filter-option small {
  margin-inline-start: 5px;
  color: var(--primary-strong);
  font-size: 9px;
}

.report-filter-check {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--panel);
  color: var(--panel);
}

.report-filter-check svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.report-filter-option.is-selected .report-filter-check {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.report-filter-option.is-selected .report-filter-check svg {
  opacity: 1;
}

.report-filter-results {
  min-width: 0;
}

.report-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--hsol-space-2);
  color: var(--muted);
  font-size: var(--hsol-font-small);
}

.report-filter-summary > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-filter-summary strong {
  color: var(--text);
}

.report-filter-empty {
  margin: 0;
  border: 1px dashed var(--border-strong);
  background: var(--panel-muted);
  color: var(--muted);
  padding: var(--hsol-space-4);
  font-size: 13px;
  text-align: center;
}

.hearing-summary-notice,
.hearing-summary-scope-note {
  margin: 0 0 var(--hsol-space-2);
  color: var(--muted);
  font-size: var(--hsol-font-small);
}

.hearing-summary-notice {
  border-inline-start: 3px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  padding: 7px 10px;
  font-weight: 750;
}

.table-wrap.hearing-summary-table-wrap {
  width: 100%;
  max-height: 640px;
  overflow: auto;
  border: 1px solid var(--hsol-table-border);
  border-radius: var(--hsol-radius);
  background: var(--hsol-paper);
}

.hearing-summary-table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--hsol-paper);
  color: var(--hsol-space);
  font-size: var(--hsol-font-medium);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  table-layout: fixed;
}

.hearing-summary-table th,
.hearing-summary-table td {
  width: 68px;
  min-width: 68px;
  height: 38px;
  border-inline-end: 1px solid var(--hsol-table-line);
  border-block-end: 1px solid var(--hsol-table-line);
  background: var(--hsol-paper);
  padding: 7px 8px 9px;
  text-align: center;
  overflow-wrap: anywhere;
}

.hearing-summary-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 42px;
  background: var(--hsol-table-head);
  color: var(--hsol-space-dark);
  font-size: var(--hsol-font-small);
  font-weight: 700;
}

.hearing-summary-table thead tr:nth-child(2) th {
  top: 42px;
  height: 32px;
}

.hearing-summary-table .hearing-summary-date-band {
  background: var(--hsol-table-head);
  color: var(--hsol-space-dark);
}

.hearing-summary-date-band b,
.hearing-summary-date-band .report-date-button {
  display: block;
  width: 100%;
}

.hearing-summary-date-band b {
  margin-bottom: 2px;
  font-size: 10px;
}

.hearing-summary-date-band .report-date-button {
  color: inherit;
  font-size: 11px;
}

.hearing-summary-date-band .report-date-button:hover,
.hearing-summary-date-band .report-date-button:focus-visible {
  color: var(--hsol-brand-accessible);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hearing-summary-date-band .report-date-button:focus-visible {
  outline: 2px solid var(--hsol-focus-ring);
  outline-offset: 2px;
}

.hearing-summary-table .hearing-summary-delta-band {
  background: var(--hsol-space);
  color: var(--hsol-paper);
}

.hearing-summary-table .hearing-summary-item-column,
.hearing-summary-table tbody tr:not(.hearing-summary-block) > th:first-child {
  position: sticky;
  left: 0;
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  text-align: left;
}

.hearing-summary-table .hearing-summary-item-column {
  z-index: 7;
  background: var(--hsol-table-head);
}

.hearing-summary-table tbody tr:not(.hearing-summary-block) > th:first-child {
  z-index: 2;
  background: var(--hsol-canvas-dark);
  color: var(--hsol-space);
  font-weight: 700;
  box-shadow: 1px 0 0 var(--hsol-table-line);
}

.hearing-summary-table .hearing-summary-block th {
  height: 34px;
  background: var(--hsol-brand-light);
  color: var(--hsol-brand-accessible);
  text-align: left;
  padding-inline: var(--hsol-space-3);
  font-size: var(--hsol-font-medium);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hearing-summary-table .hearing-summary-delta-cell {
  background: var(--hsol-canvas-dark);
  color: var(--hsol-space);
  font-weight: 700;
}

.hearing-summary-table .hearing-summary-remarks {
  max-width: 204px;
  color: var(--hsol-space-medium);
  font-size: var(--hsol-font-small);
  text-align: left;
}

.hearing-summary-table tbody tr:not(.hearing-summary-block):hover > th,
.hearing-summary-table tbody tr:not(.hearing-summary-block):hover > td {
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

.hearing-summary-table tbody tr:not(.hearing-summary-block):hover > .hearing-summary-delta-cell {
  background: color-mix(in srgb, var(--primary) 9%, var(--panel-muted));
}

.longitudinal-table th,
.longitudinal-table td {
  min-width: 120px;
  text-align: center;
  white-space: normal;
}

.report-comparison-table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

.report-comparison-table .report-module-column {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 152px;
  min-width: 152px;
  max-width: 152px;
  background: var(--panel-muted);
  box-shadow: 1px 0 0 var(--border), 8px 0 14px color-mix(in srgb, var(--text) 5%, transparent);
  text-align: left;
}

.report-comparison-table thead .report-module-column {
  z-index: 5;
  background: #e5e9f1;
}

.report-date-column,
.report-comparison-cell {
  width: 178px;
  min-width: 178px;
  max-width: 178px;
}

.data-table thead th.report-date-column {
  background: #e5e9f1;
  padding-block: 9px;
  text-align: center;
}

.data-table thead th.report-date-column.is-active-session {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.report-comparison-cell {
  padding: 12px !important;
  vertical-align: top !important;
}

.report-comparison-cell.is-active-session {
  background: color-mix(in srgb, var(--primary) 6%, var(--panel));
}

.data-table tbody tr:hover .report-comparison-cell.is-active-session {
  background: color-mix(in srgb, var(--primary) 10%, var(--panel));
}

.report-comparison-cell.is-incomplete,
.report-comparison-cell.is-active-session.is-incomplete {
  background: color-mix(in srgb, #dc2626 7%, var(--panel));
  box-shadow: inset 3px 0 0 color-mix(in srgb, #dc2626 38%, transparent);
}

.data-table tbody tr:hover .report-comparison-cell.is-incomplete {
  background: color-mix(in srgb, #dc2626 10%, var(--panel));
}

.report-comparison-score {
  display: flex;
  min-height: 32px;
  align-items: flex-start;
  justify-content: center;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.35;
}

.report-mcl-result {
  display: grid;
  width: 100%;
  gap: 5px;
}

.report-mcl-values {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.report-mcl-value {
  display: grid;
  min-width: 0;
  gap: 2px;
  padding-inline: 5px;
  text-align: center;
}

.report-mcl-value + .report-mcl-value {
  border-inline-start: 1px solid var(--border);
}

.report-mcl-value dt,
.report-mcl-value dd {
  margin: 0;
}

.report-mcl-value dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.report-mcl-value dd {
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.report-mcl-unit {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.report-module-link {
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  white-space: normal;
}

.report-module-link > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-module-link .session-module-link-icon {
  margin-top: 2px;
}

.report-module-actions {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.report-incomplete-note {
  display: block;
  margin-top: var(--hsol-space-2);
  color: #9f2f2f;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
}

.report-date-button {
  display: inline-grid;
  justify-items: center;
  gap: 1px;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
}

.report-date-column .report-date-button {
  width: 100%;
}

.report-date-button:hover,
.report-date-button:focus-visible {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-date-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.report-date-button:active {
  color: var(--primary-strong);
}

.report-date-button:disabled {
  color: var(--subtle);
  cursor: not-allowed;
  text-decoration: none;
}

.report-date-button small {
  color: var(--primary);
  font-size: 10px;
}

@media (max-width: 720px) {
  .report-results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .report-view-control {
    align-self: flex-start;
  }

  .report-filter-shell {
    width: 100%;
    margin-left: 0;
  }

  .hearing-summary-table-wrap {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .report-filter-group {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hsol-space-2);
  }

  body.is-overview-mode .memory-span-list {
    gap: 4px;
  }

  body.is-overview-mode .memory-reference-block {
    margin-bottom: 8px;
  }

  body.is-overview-mode .memory-reference-list {
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 3px;
  }

  body.is-overview-mode .memory-span-band {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 42px;
  }

  body.is-overview-mode .memory-span-words {
    gap: 4px;
    padding: 5px 7px;
  }

  body.is-overview-mode .memory-word {
    min-height: 26px;
    padding: 2px 8px;
    font-size: 16px;
  }

  .report-filter-heading {
    flex-direction: row;
    align-items: center;
  }

  .report-filter-heading > div {
    display: flex;
    align-items: baseline;
    gap: var(--hsol-space-2);
  }

  .report-filtered-table th,
  .report-filtered-table td {
    min-width: 108px;
  }

  .report-comparison-table .report-module-column {
    width: 118px;
    min-width: 118px;
    max-width: 118px;
  }

  .report-comparison-table .report-date-column,
  .report-comparison-table .report-comparison-cell {
    width: 152px;
    min-width: 152px;
    max-width: 152px;
  }

  .report-comparison-cell {
    padding: 10px 8px !important;
  }

  .report-filter-toggle,
  .report-filter-popover {
    width: 100%;
  }

  .report-filter-toggle {
    justify-content: flex-start;
  }

  .report-filter-toggle-chevron {
    margin-inline-start: auto;
  }

  .report-filter-popover-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .report-filter-popover-footer .primary-button {
    width: 100%;
  }
}

.phoneme-report-cell {
  display: inline-grid;
  gap: 2px;
  min-width: 96px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 6px;
  font: inherit;
  cursor: pointer;
}

.phoneme-report-cell:hover,
.phoneme-report-cell:focus-visible {
  color: var(--primary);
}

.phoneme-report-cell small {
  color: var(--muted);
  font-size: 10px;
}

.phoneme-compare-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-height: 24px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--primary-strong);
  padding: 3px 4px;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.phoneme-compare-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.phoneme-compare-button:hover {
  background: transparent;
  color: var(--primary-strong);
}

.phoneme-compare-button:hover > span,
.phoneme-compare-button:focus-visible > span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.phoneme-compare-button:active {
  color: var(--primary-strong);
}

.phoneme-compare-button:focus-visible {
  outline: 2px solid rgba(0, 127, 112, 0.42);
  outline-offset: 2px;
}

.phoneme-comparison-modal {
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
}

.phoneme-comparison-body {
  display: grid;
  gap: 18px;
  overflow-y: auto;
}

.phoneme-comparison-block {
  min-width: 0;
}

.phoneme-comparison-heading {
  margin-bottom: 9px;
}

.phoneme-comparison-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.phoneme-comparison-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.phoneme-comparison-summary th,
.phoneme-comparison-summary td,
.phoneme-similar-group-table th,
.phoneme-similar-group-table td,
.phoneme-comparison-detail th,
.phoneme-comparison-detail td {
  min-width: 112px;
  text-align: center;
  white-space: nowrap;
}

.phoneme-comparison-summary th:first-child,
.phoneme-similar-group-table th:first-child,
.phoneme-comparison-detail th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 130px;
  background: var(--panel-muted);
  text-align: left;
}

.phoneme-similar-group-result strong,
.phoneme-similar-group-result small {
  display: block;
}

.phoneme-similar-group-result small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.phoneme-similar-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  border: 1px solid #79adc6;
  border-radius: 2px;
  background: #c1e4f5;
  vertical-align: -1px;
}

.phoneme-comparison-summary .is-low-score,
.phoneme-comparison-detail .is-low-score {
  color: #a33a2b;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(163, 58, 43, 0.35);
  text-underline-offset: 3px;
}

.phoneme-comparison-detail td strong,
.phoneme-comparison-detail td small {
  display: block;
}

.phoneme-comparison-detail td small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.phoneme-delta {
  font-weight: 700;
  color: var(--primary);
}

.phoneme-delta.is-negative {
  color: #a33a2b;
}

.phoneme-comparison-tabs {
  margin-bottom: 10px;
}

@media (max-width: 760px) {
  .session-date-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .session-date-summary {
    min-width: 0;
  }

  .session-condition-cell {
    min-width: 260px;
  }

  .phoneme-comparison-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .phoneme-total-summary-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .phoneme-total-aggregate {
    text-align: left;
  }

  .phoneme-total-summary ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phoneme-total-summary li:nth-child(2) {
    border-right: 0;
  }

  .phoneme-total-summary li:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

.mcl-table {
  min-width: 760px;
  table-layout: fixed;
}

.mcl-table .mcl-ear-cell {
  width: 82px;
  text-align: center;
}

.mcl-table .mcl-level-cell,
.mcl-table .mcl-result-cell {
  width: 120px;
}

.mcl-table .unit-input {
  grid-template-columns: minmax(58px, 1fr) auto;
}

.mcl-table .score-input {
  text-align: right;
}

.mcl-table .mcl-result-cell .derived-value {
  width: 100%;
  justify-content: flex-end;
}

[data-mcl-reference] {
  width: 100%;
}

.wrs-mcl-field {
  min-width: 0;
}

.wrs-mcl-save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hsol-space-2);
  min-width: 0;
}

.wrs-mcl-save-row .mini-button {
  flex: 0 0 auto;
}

.wrs-mcl-save-status {
  display: inline-flex;
  align-items: center;
  gap: var(--hsol-space-1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
}

.wrs-mcl-save-status.is-saved {
  color: var(--success);
}

.wrs-mcl-save-status.is-failed {
  color: var(--danger);
}

.wrs-mcl-save-status svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

@media (min-width: 861px) {
  body.is-overview-mode .data-table .table-input {
    box-sizing: border-box;
    width: min(100%, 240px);
    min-width: 0;
    max-width: 240px;
  }

  body.is-overview-mode .clinical-table thead th,
  body.is-overview-mode .clinical-table .list-header-button,
  body.is-overview-mode .wrs-table tbody td,
  body.is-overview-mode .data-table td:has(> .table-input),
  body.is-overview-mode .data-table td:has(> .score-input) {
    text-align: center;
  }

  body.is-overview-mode .wrs-table .response-cell {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }

  body.is-overview-mode .wrs-table .wrs-response-col {
    width: 150px;
  }

  body.is-overview-mode .wrs-table .response-cell .table-input {
    width: 100%;
    max-width: 100%;
  }

  body.is-overview-mode .wrs-table .judge-cell {
    width: 116px;
    min-width: 116px;
    max-width: 116px;
  }

  body.is-overview-mode .srs-table .srs-response-cell {
    width: 320px;
    min-width: 280px;
    max-width: 320px;
  }

  body.is-overview-mode .srs-table .srs-response-input {
    width: 100%;
    max-width: 100%;
  }

  body.is-overview-mode .srs-table .score-cell {
    width: 98px;
    min-width: 98px;
    max-width: 98px;
  }
}

@media (min-width: 1000px) {
  body.is-overview-mode .dashboard-grid,
  body.is-overview-mode .app-shell.is-sidebar-collapsed .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) clamp(260px, 25vw, 300px) !important;
    gap: 10px;
    align-items: start;
    width: 100%;
    max-width: 1180px;
    margin-right: auto;
    margin-left: auto;
  }

  body.is-overview-mode .module-surface {
    align-self: start;
  }

  body.is-overview-mode .section-content:has(.wrs-table) {
    display: flex;
    justify-content: center;
  }

  body.is-overview-mode .table-wrap:has(.wrs-table) {
    width: fit-content;
    max-width: 100%;
  }

  body.is-overview-mode .insight-surface {
    position: sticky;
    top: calc(var(--header-height) + 10px);
    display: flex !important;
    flex-direction: column;
    gap: 0;
    align-self: start;
    height: auto;
    min-height: calc(100vh - var(--header-height) - 36px);
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #ffffff;
    box-shadow: var(--shadow);
    font-size: 15px;
  }

  body.is-overview-mode .insight-surface > div {
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.is-overview-mode .insight-surface > div:last-child {
    flex: 1 1 auto;
    border-bottom: 0;
  }

  body.is-overview-mode .insight-heading {
    border-color: #b9e2d9;
    background: #e5f7f3;
    padding: 10px 14px;
  }

  body.is-overview-mode .insight-heading .eyebrow {
    color: #007f70;
    font-size: 12px;
  }

  body.is-overview-mode .insight-heading strong {
    margin-top: 3px;
    color: var(--text);
    font-size: 19px;
  }

  body.is-overview-mode .score-block,
  body.is-overview-mode .progress-block,
  body.is-overview-mode .chart-block {
    padding: 12px 14px;
  }

  body.is-overview-mode .score-value strong {
    font-size: 34px;
  }

  body.is-overview-mode .score-block p {
    font-size: 14px;
  }

  body.is-overview-mode .remarks-block {
    padding: 12px 14px;
  }

  body.is-overview-mode .block-title span,
  body.is-overview-mode .remark-list,
  body.is-overview-mode .remarks-block textarea {
    font-size: 14px;
  }

  body.is-overview-mode .remarks-block textarea {
    min-height: 88px;
    height: 88px;
    resize: vertical;
  }

  body.is-overview-mode .remark-list {
    max-height: 74px;
    overflow-y: auto;
  }
}

@media (min-width: 1120px) {
  body:not(.is-overview-mode) .topbar-brand {
    flex-basis: clamp(220px, 20vw, 300px);
  }

  body:not(.is-overview-mode) .app-shell,
  body:not(.is-overview-mode) .app-shell:not(.is-sidebar-collapsed) {
    grid-template-columns: clamp(220px, 20vw, 300px) minmax(0, 1fr);
  }

  body:not(.is-overview-mode) .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) clamp(250px, 22vw, 300px);
    gap: clamp(10px, 1.1vw, 16px);
    align-items: start;
    padding: clamp(10px, 1.1vw, 16px);
  }

  body:not(.is-overview-mode) .module-surface {
    align-self: start;
  }

  body:not(.is-overview-mode) .insight-surface {
    position: sticky;
    top: calc(var(--header-height) + 12px);
    display: flex;
    flex-direction: column;
    gap: 0;
    align-self: start;
    height: auto;
    min-height: calc(100vh - var(--header-height) - 40px);
    border: 1px solid var(--border);
    border-radius: 3px;
    background: #ffffff;
    box-shadow: var(--shadow);
  }

  body:not(.is-overview-mode) .insight-surface > div {
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body:not(.is-overview-mode) .insight-surface > div:last-child {
    flex: 1 1 auto;
    border-bottom: 0;
  }

  body:not(.is-overview-mode) .insight-heading {
    border-color: #b9e2d9;
    background: #e5f7f3;
    padding: 12px 14px;
  }

  body:not(.is-overview-mode) .insight-heading .eyebrow {
    color: #007f70;
  }

  body:not(.is-overview-mode) .insight-heading strong {
    margin-top: 3px;
    font-size: 17px;
  }

  body:not(.is-overview-mode) .score-block,
  body:not(.is-overview-mode) .progress-block,
  body:not(.is-overview-mode) .chart-block {
    padding: 14px 16px;
  }

  body:not(.is-overview-mode) .score-value strong {
    font-size: 30px;
  }

  body:not(.is-overview-mode) .remarks-block {
    padding: 14px 16px;
  }

  body:not(.is-overview-mode) .remarks-block textarea {
    min-height: 112px;
    height: 112px;
    resize: vertical;
  }

  body:not(.is-overview-mode) .remark-list {
    max-height: 86px;
    overflow-y: auto;
  }
}

/* Clinical records expand vertically; the page owns vertical scrolling. */
#moduleBody .table-wrap,
#moduleBody .table-wrap.compact {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

@media (min-width: 861px) {
  body:not(.is-overview-mode) .section-content:has(.wrs-table) {
    display: flex;
    justify-content: flex-start;
  }

  body:not(.is-overview-mode) .table-wrap:has(.wrs-table) {
    width: fit-content;
    max-width: 100%;
  }

  body:not(.is-overview-mode) .wrs-table {
    margin-right: 0;
    margin-left: 0;
  }
}

/* Give longitudinal results the full workspace when the viewport can support it. */
@media (min-width: 1120px) {
  body.is-report-mode .dashboard-grid,
  body.is-report-mode .app-shell.is-sidebar-collapsed .dashboard-grid {
    width: 100%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
    margin: 0;
    padding: clamp(10px, 1vw, 16px);
  }

  body.is-report-mode .module-surface {
    width: 100%;
  }

  body.is-report-mode .insight-surface {
    display: none !important;
  }

  body.is-report-mode .report-comparison-table {
    width: 100%;
  }
}
/* Compact sticky phoneme answer key and click-to-cycle scoring */
.insight-surface.is-phoneme-insight .chart-block {
  padding: 0;
}

.insight-surface.is-phoneme-insight .mini-chart {
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.phoneme-answer-card {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #ffffff;
}

.phoneme-answer-heading {
  display: block;
  min-height: 38px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-muted);
}

.phoneme-answer-heading h2,
.phoneme-answer-block-title h3 {
  margin: 0;
}

.phoneme-answer-heading h2 {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}


.phoneme-answer-content {
  display: grid;
  background: #ffffff;
}

.phoneme-answer-block {
  min-width: 0;
  padding: 8px 9px 9px;
}

.phoneme-answer-block + .phoneme-answer-block {
  border-top: 1px solid var(--border);
}

.phoneme-answer-block-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}

.phoneme-answer-block-title h3 {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.phoneme-answer-block-title span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}

.phoneme-answer-rounds {
  display: grid;
  gap: 3px;
}

.phoneme-answer-round {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 3px;
  align-items: stretch;
  min-width: 0;
}

.phoneme-answer-round-label {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 2px solid var(--primary);
  background: #eef8f5;
  color: var(--primary-strong);
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.phoneme-answer-cues {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phoneme-answer-cues.has-10-cues {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.phoneme-answer-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 31px;
  border: 1px solid #dfe6eb;
  border-radius: 2px;
  background: #fbfcfd;
  padding: 2px 1px;
  font-variant-numeric: tabular-nums;
}

.phoneme-answer-cue > strong {
  overflow: hidden;
  width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.phoneme-table th:not(:first-child),
.phoneme-table td:not(:first-child) {
  min-width: 42px;
  padding-right: 3px;
  padding-left: 3px;
}

.phoneme-table th:nth-last-child(-n + 2),
.phoneme-table td:nth-last-child(-n + 2) {
  min-width: 54px;
}

.phoneme-table th:last-child,
.phoneme-table td.phoneme-remarks-cell {
  min-width: 140px;
}

.phoneme-table .phoneme-remarks-cell .table-input {
  width: 100%;
  min-width: 0;
}

.phoneme-table td.phoneme-score-cell {
  background: #f6fbf9;
}

.phoneme-table td.phoneme-reference-cell {
  background: #ffffff;
}

#moduleBody .phoneme-table td.phoneme-excel-fill-blue,
#moduleBody .phoneme-table tbody tr:hover td.phoneme-excel-fill-blue {
  background: #c1e4f5;
}

#moduleBody .phoneme-table td.phoneme-excel-fill-gray,
#moduleBody .phoneme-table tbody tr:hover td.phoneme-excel-fill-gray {
  background: #d8d8d8;
}

.phoneme-table td.phoneme-excel-fill-blue .phoneme-cycle-button:not(:hover) {
  border-color: #79adc6;
  background: rgba(255, 255, 255, 0.72);
  color: #185b75;
}

.phoneme-table td.phoneme-excel-fill-gray .phoneme-cycle-button:disabled {
  border-color: #aeb8bf;
  background: rgba(255, 255, 255, 0.52);
  color: #65727c;
}

.phoneme-cycle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: 1px solid #d4dde3;
  border-radius: 4px;
  background: #ffffff;
  color: #65727c;
  padding: 0;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.phoneme-cycle-button.is-scored {
  border-color: rgba(0, 166, 140, 0.42);
}

.phoneme-cycle-button.is-entered {
  background: #e8f7f3;
  color: var(--primary-strong);
}

.phoneme-cycle-button:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.phoneme-cycle-button:active:not(:disabled) {
  transform: translateY(1px);
}

.phoneme-cycle-button:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--primary-strong);
  outline-offset: 2px;
}

.phoneme-cycle-button:disabled {
  cursor: not-allowed;
  border-color: #dce3e8;
  background: #f1f4f6;
  color: #7c8993;
  opacity: 1;
}

@media (max-width: 860px) {
  .insight-surface.is-phoneme-insight .chart-block {
    order: -1;
  }

  .phoneme-answer-heading {
    padding-right: 12px;
    padding-left: 12px;
  }

  .phoneme-answer-block {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phoneme-cycle-button,
  .phoneme-compare-button {
    transition: none;
  }

  .phoneme-compare-button:hover {
    transform: none;
  }
}
