:root {
  --navy: #17324d;
  --blue: #236b8e;
  --teal: #2f7f78;
  --teal-soft: #e9f4f1;
  --blue-soft: #eaf2f7;
  --sand: #f4f1ea;
  --paper: #ffffff;
  --ink: #1d2936;
  --muted: #647281;
  --line: #d9e1e7;
  --danger: #a33d3d;
  --shadow: 0 18px 45px rgba(24, 51, 74, 0.1);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 127, 120, 0.13), transparent 26rem),
    linear-gradient(180deg, #f7f9fa 0%, #eef3f4 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.watermark-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
  opacity: 0.075;
  background-image: url("watermark.svg");
  background-repeat: repeat;
  background-size: 360px 190px;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px max(32px, calc((100vw - 1380px) / 2));
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(217, 225, 231, 0.8);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--paper);
  background: linear-gradient(145deg, var(--teal), var(--blue));
  box-shadow: 0 8px 18px rgba(35, 107, 142, 0.22);
}

.brand-mark svg {
  width: 33px;
  height: 33px;
}

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

.topbar h1 {
  margin: 0;
  color: var(--navy);
  font-size: 23px;
  line-height: 1.25;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-badge,
.status-pill,
.optional-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.demo-badge,
.status-pill {
  color: #1f635d;
  background: #e2f1ed;
}

.optional-label {
  color: var(--muted);
  background: #f1f4f6;
}

.disclaimer {
  width: min(1380px, calc(100vw - 64px));
  margin: 18px auto 0;
  padding: 11px 16px;
  color: #596775;
  background: #fffaf0;
  border: 1px solid #eadfbd;
  border-radius: 12px;
  font-size: 13px;
}

.app-shell {
  width: min(1380px, calc(100vw - 64px));
  margin: 22px auto 54px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.stepper {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(217, 225, 231, 0.86);
  box-shadow: 0 12px 34px rgba(24, 51, 74, 0.06);
}

.step {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.step span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}

.step strong {
  font-size: 13px;
}

.step.active {
  color: var(--navy);
  background: var(--blue-soft);
}

.step.active span {
  color: white;
  background: var(--navy);
  border-color: var(--navy);
}

.step.done span {
  color: var(--teal);
  border-color: #a9d1cb;
  background: #e6f3f0;
}

.workspace {
  min-width: 0;
}

.panel {
  display: none;
  padding: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(217, 225, 231, 0.92);
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: panel-in 240ms ease both;
}

.panel.active {
  display: block;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.section-heading h2 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 27px;
  line-height: 1.25;
}

.section-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

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

.form-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-grid-assessment {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 18px;
  align-items: end;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span,
.calculated-field > span {
  color: #485867;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.search-field input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fbfcfd;
  border: 1px solid #ced9df;
  border-radius: 10px;
  outline: none;
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}

.field input:focus,
.field select:focus,
.search-field input:focus {
  background: white;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(35, 107, 142, 0.12);
}

.calculated-field {
  display: grid;
  align-content: center;
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, #e2f4ef, #eef8f5);
  border: 1px solid #9fc9c1;
  box-shadow: 0 10px 23px rgba(47, 127, 120, 0.1);
}

.calculated-field strong {
  color: var(--navy);
  font-size: 31px;
  line-height: 1.12;
}

.calculated-field small {
  color: #27635d;
  font-size: 13px;
  font-weight: 700;
}

.bmi-reference-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
  margin-top: 20px;
  padding: 19px 20px;
  background: linear-gradient(145deg, #f2faf8, #f8fafb);
  border: 1px solid #bad8d2;
  border-radius: 16px;
}

.bmi-reference-card h3 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 18px;
}

.bmi-reference-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.standard-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.standard-list li {
  padding: 10px 12px;
  background: white;
  border: 1px solid #d5e5e1;
  border-radius: 10px;
}

.standard-list strong,
.standard-list span {
  display: block;
}

.standard-list strong {
  color: var(--navy);
  font-size: 12px;
}

.standard-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #42505e;
  font-size: 13px;
}

.checkline input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.toggle-line {
  min-height: 44px;
  padding: 9px 12px;
  background: #f7fafb;
  border: 1px solid #dce4e8;
  border-radius: 10px;
}

.assessment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.subpanel {
  padding: 18px;
  background: #f8fafb;
  border: 1px solid #dde5e9;
  border-radius: 15px;
}

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

.subpanel-heading h3,
.summary-card h4 {
  margin: 0;
  color: var(--navy);
  font-size: 17px;
}

.emg-zone {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid #cddfdc;
  border-radius: 17px;
  background: linear-gradient(145deg, #f5fbfa, #f8fafb);
}

.upload-box {
  display: grid;
  place-items: center;
  min-height: 132px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px dashed #9fc3bd;
  border-radius: 14px;
  text-align: center;
  transition: border-color 160ms, background 160ms;
}

.upload-box:hover,
.upload-box.dragging {
  border-color: var(--teal);
  background: #f2fbf8;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-box strong {
  color: var(--navy);
  font-size: 16px;
}

.upload-box small {
  max-width: 560px;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 7px;
  color: white;
  background: var(--teal);
  border-radius: 50%;
  font-size: 22px;
}

.emg-workspace {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.file-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: white;
  border: 1px solid #dce5e8;
  border-radius: 12px;
}

.file-summary div {
  display: grid;
}

.file-summary span {
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  padding: 3px;
  color: var(--blue);
  background: transparent;
  border: 0;
}

.text-button.danger {
  color: var(--danger);
}

.emg-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
}

.preview-card,
.summary-card {
  padding: 14px;
  background: white;
  border: 1px solid #dce5e8;
  border-radius: 13px;
}

.summary-card p {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.emg-preview {
  min-height: 160px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #f4f6f7;
  border-radius: 9px;
}

.emg-preview img,
.emg-preview iframe {
  display: block;
  width: 100%;
  height: 270px;
  border: 0;
  object-fit: contain;
}

.insight-text {
  padding: 12px;
  color: #38545d;
  background: #eef7f5;
  border-radius: 10px;
  font-size: 13px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 9px 8px;
  border: 1px solid #dde5e9;
  text-align: center;
  vertical-align: middle;
}

.data-table th {
  color: white;
  background: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

.data-table input {
  width: 68px;
  min-height: 32px;
  padding: 5px 6px;
  border: 1px solid #ccd8de;
  border-radius: 7px;
  text-align: right;
}

.data-table td:first-child {
  min-width: 124px;
  text-align: left;
  white-space: nowrap;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid #e4eaed;
}

.helper-text,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 140ms, box-shadow 140ms, background 140ms;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: var(--navy);
  box-shadow: 0 8px 16px rgba(23, 50, 77, 0.16);
}

.button-primary:hover {
  background: #214867;
}

.button-secondary {
  color: var(--blue);
  background: white;
  border-color: #c5d7e1;
}

.button-ghost {
  color: #52616f;
  background: #f4f7f8;
  border-color: #dde5e9;
}

.button-small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  box-shadow: none;
}

.full-width {
  width: 100%;
}

.route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 18px;
}

.route-result {
  padding: 24px;
  color: white;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.18), transparent 9rem),
    linear-gradient(135deg, #1d4e69, #2d7774);
  border-radius: 17px;
}

.route-result .eyebrow {
  color: #cce7e2;
}

.route-result h3 {
  margin: 5px 0 8px;
  font-size: 28px;
}

.route-result p:not(.eyebrow) {
  margin: 0;
  color: #deefef;
}

.route-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 24px 0 0;
}

.route-facts div {
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 11px;
}

.route-facts dt {
  color: #cce2e2;
  font-size: 11px;
}

.route-facts dd {
  margin: 3px 0 0;
  color: white;
  font-size: 13px;
  font-weight: 700;
}

.route-override {
  padding: 20px;
  background: #f8fafb;
  border: 1px solid #dde5e9;
  border-radius: 17px;
}

.logic-strip {
  margin-top: 16px;
  padding: 13px 15px;
  color: #415260;
  background: var(--blue-soft);
  border-radius: 12px;
  font-size: 13px;
}

.candidate-panel {
  margin-top: 18px;
  padding: 20px;
  background: #fffaf0;
  border: 1px solid #e8dfc8;
  border-radius: 16px;
}

.candidate-panel:empty {
  display: none;
}

.candidate-panel h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 18px;
}

.candidate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.candidate-chip {
  padding: 9px 12px;
  color: #694f24;
  background: white;
  border: 1px solid #ddc999;
  border-radius: 10px;
  font-size: 13px;
}

.selected-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  color: var(--muted);
  background: var(--teal-soft);
  border-radius: 12px;
}

.selected-counter strong {
  color: var(--teal);
  font-size: 23px;
}

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

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #f0f4f5;
  border-radius: 11px;
}

.segmented button {
  border: 0;
  padding: 8px 11px;
  color: #60707e;
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
}

.segmented button.active {
  color: var(--navy);
  background: white;
  box-shadow: 0 2px 8px rgba(24, 51, 74, 0.08);
}

.search-field {
  width: min(310px, 32vw);
}

.search-field input {
  min-height: 38px;
}

.selection-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  gap: 18px;
  align-items: start;
}

.action-list {
  display: grid;
  gap: 10px;
  max-height: 700px;
  padding-right: 7px;
  overflow-y: auto;
}

.action-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  background: #fbfcfd;
  border: 1px solid #dde5e9;
  border-radius: 13px;
}

.action-card.selected {
  background: #f2faf8;
  border-color: #93c5bd;
  box-shadow: inset 4px 0 0 var(--teal);
}

.action-card.candidate {
  background: #fffaf0;
  border-color: #ddc999;
}

.action-card > input {
  width: 17px;
  height: 17px;
  margin-top: 3px;
  accent-color: var(--teal);
}

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

.action-title-row h4 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
}

.tag {
  padding: 2px 7px;
  color: #506371;
  background: #eaf0f3;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.tag.candidate-tag {
  color: #76591f;
  background: #f4e5bd;
}

.action-body {
  margin: 6px 0 0;
  color: #536371;
  font-size: 12px;
  line-height: 1.65;
}

.video-button {
  align-self: start;
  white-space: nowrap;
  min-height: 32px;
  padding: 5px 9px;
  color: var(--blue);
  background: white;
  border: 1px solid #c9d9e3;
  border-radius: 8px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.video-button.disabled {
  color: #9aa5ae;
  border-color: #e0e6e9;
  pointer-events: none;
}

.video-tools {
  align-self: start;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 88px;
}

.qr-link {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
}

.qr-link img {
  display: block;
  width: 58px;
  height: 58px;
  padding: 3px;
  background: white;
  border: 1px solid #d4e0e5;
  border-radius: 7px;
}

.qr-unavailable {
  color: #9aa5ae;
  font-size: 10px;
  text-align: center;
}

.selection-summary {
  position: sticky;
  top: 18px;
  padding: 18px;
  background: #f8fafb;
  border: 1px solid #dbe4e8;
  border-radius: 16px;
}

.selection-summary h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 19px;
}

.selected-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 21px;
  max-height: 390px;
  overflow-y: auto;
}

.selected-list li {
  padding-left: 4px;
  font-size: 12px;
}

.confirm-line {
  align-items: flex-start;
  margin: 18px 0 14px;
  padding-top: 14px;
  border-top: 1px solid #dde5e9;
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.report-actions {
  display: flex;
  gap: 9px;
}

.report-document {
  padding: 40px 44px;
  color: #202b35;
  background: white;
  border: 1px solid #dce3e7;
  border-radius: 16px;
  box-shadow: 0 18px 55px rgba(24, 51, 74, 0.09);
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--navy);
}

.report-org {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

.report-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
}

.report-header p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
}

.report-meta {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.report-section {
  margin-top: 24px;
}

.report-section h3 {
  margin: 0 0 12px;
  padding-bottom: 6px;
  color: var(--navy);
  border-bottom: 1px solid #dce3e7;
  font-size: 17px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.report-field {
  padding: 10px 12px;
  background: #f7f9fa;
  border-radius: 9px;
}

.report-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.report-field strong {
  display: block;
  margin-top: 2px;
  color: #243543;
  font-size: 14px;
}

.report-note {
  margin-top: 10px;
  padding: 12px 14px;
  color: #465a67;
  background: var(--blue-soft);
  border-radius: 9px;
  font-size: 12px;
}

.report-emg-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.3fr);
  gap: 18px;
}

.report-emg-preview {
  min-height: 215px;
  overflow: hidden;
  border: 1px solid #dce3e7;
  border-radius: 9px;
}

.report-emg-preview img,
.report-emg-preview iframe {
  width: 100%;
  height: 330px;
  display: block;
  border: 0;
  object-fit: contain;
}

.report-action-list {
  display: grid;
  gap: 11px;
}

.report-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 13px 14px;
  background: #fbfcfd;
  border: 1px solid #dce3e7;
  border-radius: 10px;
}

.report-action-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-action h4 {
  margin: 0;
  color: #233846;
  font-size: 14px;
}

.report-action p {
  margin: 6px 0 0;
  color: #51616d;
  font-size: 12px;
}

.report-action .video-tools {
  min-width: 76px;
}

.report-qr {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: var(--muted);
  text-decoration: none;
  font-size: 9px;
}

.report-qr img {
  width: 70px;
  height: 70px;
  padding: 3px;
  background: white;
  border: 1px solid #d8e1e5;
  border-radius: 7px;
}

.report-action .video-button {
  display: inline-flex;
}

.report-list {
  margin: 0;
  padding-left: 21px;
  color: #4b5c68;
  font-size: 12px;
}

.report-sign {
  margin-top: 28px;
  color: #445562;
  font-size: 12px;
}

.report-footer {
  margin-top: 30px;
  padding-top: 12px;
  color: #7a8791;
  border-top: 1px solid #dce3e7;
  font-size: 10px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 360px;
  padding: 11px 14px;
  color: white;
  background: #243f52;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20, 36, 49, 0.24);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms, transform 180ms;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1180px) {
  .form-grid-assessment { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .selection-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  body {
    font-size: 14px;
  }

  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px 16px;
  }

  .brand-mark {
    width: 43px;
    height: 43px;
    border-radius: 12px;
  }

  .brand-mark svg {
    width: 29px;
    height: 29px;
  }

  .topbar > div:nth-child(2) {
    min-width: 0;
    flex: 1;
  }

  .topbar h1 {
    font-size: 18px;
    line-height: 1.35;
  }

  .topbar .eyebrow {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .topbar-actions {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .disclaimer,
  .app-shell {
    width: calc(100vw - 24px);
  }

  .disclaimer {
    margin-top: 10px;
    padding: 9px 12px;
    font-size: 12px;
  }

  .app-shell {
    display: block;
    margin-top: 12px;
    margin-bottom: 28px;
  }

  .stepper {
    position: static;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    margin-bottom: 12px;
    padding: 7px;
    overflow: visible;
  }

  .step {
    min-width: 0;
    min-height: 54px;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 5px 2px;
    text-align: center;
  }

  .step span {
    width: 27px;
    height: 27px;
  }

  .step strong {
    white-space: normal;
    font-size: 10.5px;
    line-height: 1.18;
  }

  .panel {
    padding: 17px 14px;
    border-radius: 17px;
  }

  .section-heading {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .section-heading h2 {
    font-size: 23px;
  }

  .section-heading .button,
  .section-heading > .status-pill {
    align-self: stretch;
  }

  .section-heading .button {
    width: 100%;
  }

  .form-grid,
  .form-grid-compact,
  .form-grid-assessment,
  .assessment-grid,
  .emg-review-grid,
  .route-layout,
  .selection-layout,
  .report-emg-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .field input,
  .field select,
  .search-field input {
    min-height: 47px;
    font-size: 16px;
  }

  .calculated-field {
    min-height: 96px;
    padding: 15px 16px;
  }

  .calculated-field strong {
    font-size: 34px;
  }

  .bmi-reference-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

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

  .subpanel,
  .emg-zone {
    padding: 14px;
  }

  .subpanel-heading {
    align-items: flex-start;
  }

  .upload-box {
    min-height: 145px;
    padding: 18px 12px;
  }

  .file-summary {
    align-items: flex-start;
    gap: 10px;
  }

  .file-summary div {
    min-width: 0;
  }

  .file-summary strong {
    overflow-wrap: anywhere;
  }

  .emg-preview img,
  .emg-preview iframe {
    height: 225px;
  }

  .data-table {
    min-width: 760px;
  }

  .panel-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .panel-footer .button {
    width: 100%;
  }

  .route-result {
    padding: 19px 17px;
  }

  .route-result h3 {
    font-size: 23px;
  }

  .route-facts {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 17px;
  }

  .candidate-list {
    flex-direction: column;
    align-items: stretch;
  }

  .candidate-chip {
    width: 100%;
  }

  .action-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .segmented {
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .segmented button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .search-field {
    width: 100%;
  }

  .action-list {
    max-height: none;
    padding-right: 0;
  }

  .action-card {
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 11px;
  }

  .action-card > input {
    margin-top: 4px;
  }

  .action-title-row {
    gap: 6px;
  }

  .action-title-row h4 {
    font-size: 14px;
  }

  .action-body {
    font-size: 12px;
  }

  .video-tools {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 1px;
  }

  .qr-link {
    grid-auto-flow: column;
    align-items: center;
  }

  .qr-link img {
    width: 54px;
    height: 54px;
  }

  .selection-summary {
    position: static;
  }

  .selected-list {
    max-height: none;
  }

  .report-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .report-document {
    padding: 19px 14px;
    border-radius: 13px;
  }

  .report-header {
    flex-direction: column;
    gap: 12px;
  }

  .report-header h2 {
    font-size: 22px;
  }

  .report-meta {
    justify-items: start;
  }

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

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

  .report-action .video-tools {
    grid-column: 1;
    grid-row: auto;
  }

  .report-emg-preview img,
  .report-emg-preview iframe {
    height: 240px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .topbar h1 {
    font-size: 17px;
  }

  .demo-badge {
    display: none;
  }

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

  .selected-counter {
    align-self: flex-start;
  }
}

@media print {
  @page { size: A4 portrait; margin: 12mm; }
  body {
    min-width: 0;
    background: white;
    font-size: 11px;
  }
  .topbar,
  .disclaimer,
  .stepper,
  .no-print,
  .toast {
    display: none !important;
  }
  .watermark-layer {
    display: block !important;
    opacity: 0.085;
  }
  .app-shell,
  .workspace {
    display: block;
    width: auto;
    margin: 0;
  }
  .panel {
    display: none !important;
    padding: 0;
    border: 0;
    box-shadow: none;
  }
  .panel[data-step="5"] {
    display: block !important;
  }
  .report-document {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .report-section {
    break-inside: avoid;
  }
  .report-action {
    break-inside: avoid;
  }
  .report-action .video-button {
    display: none;
  }
  .report-action .report-qr {
    display: grid;
  }
}
