/* DYNORA / Pist A. Presentation layer only; original styles and logic retained.
   Radix Gray / Orange: MIT. Barlow Condensed + IBM Plex: SIL OFL 1.1.
   See assets/SOURCES.md. No external assets or generated imagery. */
@font-face {
  font-family:"Barlow Condensed";
  src:url("./assets/fonts/BarlowCondensed-ExtraBold.ttf") format("truetype");
  font-style:normal;
  font-weight:800;
  font-display:swap;
}

:root {
  --bg:#111111; --panel:#191919; --panel2:#222222; --line:#646464;
  --text:#fcfcfc; --muted:#b4b4b4; --green:#f76b15; --green-ink:#111111;
  --left:#f76b15; --right:#b4b4b4; --total:#fcfcfc; --grid:#3e3e3e;
  --selection:#313131; --plot-gap:#f76b1529; --plot-event:#b4b4b41a;
  --border:var(--line); --accent:#f76b15; --accent-ink:#111111;
  --font-heading:"Barlow Condensed","IBM Plex Sans",sans-serif;
  --workspace-gutter:clamp(16px,2.5vw,40px);
  accent-color:var(--accent);
  scrollbar-color:var(--muted) var(--bg);
}
:root[data-theme=light] {
  --bg:#fcfcfc; --panel:#fcfcfc; --panel2:#f0f0f0; --line:#d9d9d9;
  --text:#111111; --muted:#646464; --green:#111111; --green-ink:#fcfcfc;
  --left:#cc4e00; --right:#646464; --total:#111111; --grid:#e0e0e0;
  --selection:#e8e8e8; --plot-gap:#cc4e0020; --plot-event:#64646412;
}
body {font:400 16px/1.5 var(--font-ui); background:var(--bg); color:var(--text)}
/* Turkish casing is presentation-only (the document is lang=tr).
   Preserve stored text, numeric values, units, file names and detailed guidance. */
h1,h2,h3,h4,summary,.record-info strong,.review-summary strong,
.chart-empty strong,.simple-help li>strong {text-transform:uppercase}
button,.workflow li,.context-form label,.test-catalog>label,.device-baud,
.legend,.channel-label,.total-readout>span:first-child,.quality-stats span,
.readout .panel-title>span,.source-info strong,.export-bar strong,
.metric-table th,.metric-table td:first-child,.measurement-report th,
.measurement-report dt,.measurement-report td:first-child,
#autoState,#recordFilter,#phaseSelect,#markerKind,#comparisonChannel {
  text-transform:none;
}
/* Form contents and technical identifiers must retain their original case. */
input,textarea,select,option,code,pre,.mono,.context-form small,
.context-form p,.context-form .check,.quick-tests small {
  text-transform:none;
}
#recordFilter option,#phaseSelect option,#markerKind option,
#comparisonChannel option,.context-form select,.context-form option {
  text-transform:none;
}
::selection {background:var(--accent);color:var(--accent-ink)}
input,textarea {caret-color:var(--text)}
a {text-underline-offset:.2em}
main {max-width:1600px;padding:28px var(--workspace-gutter) 0}
h1,h2,h3,p {overflow-wrap:break-word}
.heading h1,.guide-copy h2,.measurement-report h1 {
  font-family:var(--font-heading);font-weight:800;letter-spacing:-.015em;line-height:1.05;
}
.heading h1 {font-size:48px}
h2 {font-size:24px;font-weight:600;letter-spacing:-.015em}
h3 {font-size:18px;font-weight:600}
.heading,#measurementView[data-stage=review] .heading {margin:0 0 20px;gap:16px}
.heading p {font-size:16px;max-width:65ch;line-height:1.5}
.small {font-size:14px;line-height:1.5}
.eyebrow {display:none}
.card {border-radius:0;box-shadow:none}
button,input,select,summary {font-family:var(--font-ui)}
button,input,select {border-radius:4px;min-height:48px;font-size:16px}
input,select {border-color:#8d8d8d}
button {padding:10px 16px;font-weight:600;line-height:1.3;touch-action:manipulation}
button:disabled {opacity:.55;cursor:not-allowed}
button:hover:not(:disabled) {background:var(--selection);border-color:var(--muted)}
.control-group,.heading-actions,.view-tools,.record-actions {gap:8px;flex-wrap:wrap}
.control-group button {font-size:14px;min-height:48px}
summary {min-height:48px;padding:12px 0;font-size:14px}
button.primary,.guide-action button.primary,#archiveNew {
  background:var(--accent);color:var(--accent-ink);border-color:var(--accent);
}
button.primary:hover:not(:disabled),.guide-action button.primary:hover:not(:disabled),#archiveNew:hover:not(:disabled) {
  background:#ff8e55;color:#111111;border-color:#ff8e55;
}
.measurement-guide .stop-action {
  background:var(--accent)!important;border-color:var(--accent)!important;color:#111111!important;
}
:root :is(button,input,select,canvas,summary,a):focus-visible {
  outline:3px solid var(--text);outline-offset:4px;
}
:root[data-theme=light] :is(button,input,select,canvas,summary,a):focus-visible {outline-color:#111111}
.topbar :is(button,a):focus-visible,.measurement-guide button:focus-visible {outline-color:#fcfcfc!important}

/* Black masthead: the existing navigation, controls and accessible names. */
.topbar {
  display:flex;align-items:center;flex-wrap:wrap;gap:16px 32px;
  min-height:80px;padding:12px var(--workspace-gutter);
  color:#fcfcfc;background:#111111;border-bottom:1px solid #3e3e3e;
}
.wordmark {color:#fcfcfc;font:800 32px/1 var(--font-heading);letter-spacing:.01em;gap:12px;flex:none}
.wordmark img {filter:grayscale(1);border-radius:0}
.wordmark span {font:400 12px/1.3 var(--font-ui);color:#b4b4b4;margin-top:4px;display:block}
.topbar .workspace-nav {
  display:flex;align-items:center;align-self:stretch;gap:24px;
  border:0;margin:0;padding:0;flex:none;min-width:0;
}
.workspace-nav button,.workspace-nav button:hover:not(:disabled) {
  background:transparent;color:#b4b4b4;border:0;border-radius:0;
  min-height:48px;padding:12px 0;font:600 16px/1.3 var(--font-ui);
}
.workspace-nav button[aria-current] {color:#fcfcfc;box-shadow:inset 0 -3px #f76b15}
.workspace-nav button span {background:#313131;color:#fcfcfc;font:400 12px var(--font-data);padding:2px 6px}
.workspace-nav>span {display:none} /* The full local-storage notices remain in every relevant screen. */
.top-right {margin-left:auto;gap:8px;align-items:center;flex-wrap:wrap}
.top-right .pilot {font:400 12px/1.4 var(--font-ui);color:#b4b4b4}
.topbar .top-right :is(#theme,#help,#device) {
  min-height:48px;padding:10px 12px;font:600 14px/1.3 var(--font-ui);color:#fcfcfc;
  background:transparent;border-color:#646464;
}
.topbar .top-right button:hover:not(:disabled) {background:#313131;border-color:#b4b4b4}
.topbar .top-right .dot {background:#646464}
.topbar .top-right .dot.playing {background:#fcfcfc}

/* Preparation: black instructions beside the existing test/source controls. */
.workflow {margin:20px 0 24px;gap:16px}
.workflow li {padding-top:12px;font-size:14px;border-color:var(--line);color:var(--muted)}
.workflow li span,.workflow [aria-current] span {font:400 13px var(--font-data)}
.workflow [aria-current] {color:var(--text);border-color:var(--text);font-weight:600}
.stage-grid {gap:20px;margin-bottom:24px}
.stage-grid .measurement-guide {
  border:0;border-radius:0;background:#111111;color:#fcfcfc;padding:28px;gap:24px;
}
.guide-copy h2 {font-size:36px;margin:0 0 16px}
.guide-copy p {font-size:16px;line-height:1.5;color:#d9d9d9;max-width:65ch}
.guide-action {gap:16px;flex-direction:row;align-items:center;justify-content:flex-end}
.guide-action button {min-height:52px;font-size:16px;padding:14px 20px;white-space:normal}
.guide-action .mono {font:400 22px/1.3 var(--font-data);color:#fcfcfc;letter-spacing:0}
.stage-grid .preparation {margin:0;padding:0 0 20px;border:0;border-bottom:1px solid var(--line);background:none}
.preparation .panel-title {margin-bottom:16px}
.preparation .panel-title h2 {font-size:24px}
.context-form label,.test-catalog>label {font-size:16px;font-weight:600}
.context-form input,.context-form select {font-size:16px;min-height:48px}
.context-form small {font-size:13px;font-weight:400}
.quick-tests {gap:8px}
.quick-tests button {min-height:76px;padding:12px 16px;gap:4px;border-color:var(--line);background:var(--panel)}
.quick-tests button span {font:600 16px/1.3 var(--font-ui);color:var(--text)}
.quick-tests button small {font:400 13px/1.2 var(--font-data);color:var(--muted);margin:0}
.quick-tests button[aria-pressed=true] {border:2px solid var(--text);padding:11px 15px;box-shadow:none;background:var(--selection)}
.test-purposes {gap:8px;margin:12px 0}
.test-purposes button {min-height:48px;padding:8px 12px;font-size:14px}
.test-purposes [aria-pressed=true] {border-color:var(--text);background:var(--selection)}
.optional-context summary,.optional-context summary span {font-size:14px}
.stage-grid .source-choice {
  border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;
}
.stage-grid .source-choice>summary {padding:12px 0;font-size:18px;color:var(--text)}
.stage-grid .source-choice .connection {padding:0 0 20px;gap:16px}
.source-tabs {padding:0;gap:8px;background:none;border:0;border-radius:0}
.source-tabs button {min-height:48px;font-size:14px;border:1px solid var(--line);border-radius:4px}
.source-tabs .active {border-color:var(--text);background:var(--selection);font-weight:600}
.source-info strong {font-size:16px}
.source-info small {font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.movement-guide {border:0;border-top:1px solid var(--line);background:none}
.movement-guide>summary {padding:16px 0;font-size:16px}
.movement-content {padding:0 0 24px}
.movement-frames {gap:8px}
.movement-frames button {border-color:var(--line)}
.movement-frames [aria-pressed=true] {border-color:var(--text);background:var(--selection)}
.movement-content a,.reference-provenance a {color:var(--text)}

/* Graph first. Geometry, force patterns, selection and downsampling are unchanged. */
.lab-grid {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(248px,280px);
  gap:0;border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
  border-radius:0;overflow:visible;background:var(--panel);
}
.chart-card {min-width:0;border-right:1px solid var(--line)!important}
.chart-heading {padding:20px 20px 8px 0;gap:16px;flex-wrap:wrap}
.chart-heading h2 {font:600 26px/1.2 var(--font-ui);letter-spacing:-.02em}
.chart-caption {font:400 14px/1.4 var(--font-ui);margin-top:6px}
.badge,.tag {font:400 12px/1.4 var(--font-ui);letter-spacing:0;color:var(--text);border-color:var(--line);background:transparent;padding:6px 8px;white-space:normal}
.badge.live {color:var(--text);border-color:var(--text)}
.badge.replay {color:var(--muted);border-color:var(--line)}
.chart-toolbar {padding:0 16px 12px 0;gap:8px 16px;align-items:center}
.legend {gap:16px;flex-wrap:wrap}
.legend button {min-height:48px;padding:8px 0;font:600 14px/1.3 var(--font-ui);gap:8px;color:var(--text)}
.legend button[aria-pressed=false] {color:var(--muted);opacity:1;text-decoration:line-through}
.legend svg.line {width:30px;height:8px}
.view-tools {gap:8px;flex-wrap:wrap}
.view-tools button {min-width:48px;min-height:48px;padding:8px 12px;font-size:14px}
.view-tools button[aria-pressed=true] {color:var(--text);border-color:var(--text);background:var(--selection)}
.canvas-wrap {height:clamp(340px,43vh,520px);margin:0;background:var(--panel);border-top:0}
.chart-empty {padding:24px;text-align:center;gap:8px}
.chart-empty strong {font-size:20px}
.chart-empty p {font-size:14px;line-height:1.5}
.chart-bottom {font:400 12px/1.5 var(--font-data);padding:12px 16px 12px 0;flex-wrap:wrap;gap:8px}
.chart-bottom span:last-child {display:block;font:400 12px/1.5 var(--font-ui)}
.manual-tools {margin:0}
.manual-tools>summary {padding:12px 16px 12px 0;font-size:14px;min-height:48px}
.range-tools {gap:8px;padding:16px;background:var(--panel2)}
.range-tools button,.range-tools select {min-height:48px;padding:10px 12px;font-size:14px;white-space:normal}
.range-tools b {font:400 13px var(--font-data)}
.transport {padding:12px 16px 12px 0;gap:12px;flex-wrap:wrap}
.transport select {min-height:48px;font-size:14px;padding:10px 12px}
.check {font-size:14px;min-height:48px;gap:8px}
.check input {min-height:0;width:20px;height:20px;flex:none;accent-color:var(--text)}
.lab-grid .readout {
  display:flex;flex-direction:column;min-width:0;padding:24px;
  background:var(--panel);box-shadow:none;gap:0;
}
.readout .panel-title {align-items:baseline;flex-wrap:wrap;gap:8px}
.readout .panel-title h2 {font-size:18px;line-height:1.3}
.readout .panel-title>span {font-size:12px}
.total-readout {padding:24px 0 20px}
.total-readout>span:first-child,.channel-values .channel-label {font:600 14px/1.4 var(--font-ui);color:var(--text)}
.readout .total-readout strong {font:400 clamp(32px,3.5vw,48px)/1.2 var(--font-data);letter-spacing:-.03em}
.readout strong,.readout small,.readout .mono,.metric-table {font-variant-numeric:tabular-nums lining-nums}
.total-readout small,.channel-values small {font:400 16px/1.2 var(--font-data);margin-left:8px;color:var(--muted)}
.total-readout .mono {font:400 12px/1.5 var(--font-data);margin-top:8px;overflow-wrap:anywhere}
.channel-values {display:grid;grid-template-columns:1fr;gap:16px;padding:20px 0;border-top:1px solid var(--line)}
.readout .channel-values strong {font:400 28px/1.25 var(--font-data);letter-spacing:-.015em}
:root .readout .left-text,:root[data-theme=light] .readout .left-text,
:root .readout .right-text,:root .readout .left-text .channel-label,:root .readout .right-text .channel-label {color:var(--text)}
.channel-values .channel-label {display:flex!important;align-items:center;gap:8px;margin-bottom:4px}
.channel-values .channel-label::before {content:"";display:inline-block;width:28px;border-top:2px dashed var(--left);flex:none}
.channel-values .right-text .channel-label::before {border-top:3px dotted var(--right)}
.channel-values span[id] {font:400 12px/1.5 var(--font-ui);color:var(--muted);margin-top:4px}
.data-explainer {border-top:1px solid var(--line);margin-top:0;padding-top:16px;gap:8px}
.data-explainer p {font-size:14px;line-height:1.5;color:var(--muted)}
.info-icon {font:600 14px var(--font-ui);color:var(--text)}
.point-panel {padding-top:16px;margin-top:16px}
.point-panel h3 {font-size:16px;margin-bottom:8px}
.point-panel p {font:400 13px/1.6 var(--font-data);overflow-wrap:anywhere}
.point-panel select,.point-panel button {min-height:48px;font-size:14px;padding:10px;max-width:100%}
.point-notes summary {font-size:14px;white-space:normal}

/* Review, results and archive use quiet rules rather than a stack of cards. */
.review-summary {border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:none;padding:16px 0;margin-bottom:20px;gap:16px}
.review-summary strong {font-size:20px;font-weight:600}
.review-summary p,.review-state small {font-size:14px;line-height:1.5}
.review-state button {min-height:48px;font-size:14px;padding:10px 0}
.review-state {gap:8px;min-width:0}
.review-state .tag {max-width:100%;overflow-wrap:anywhere}
#measurementView[data-stage=review] .stage-grid {margin:24px 0;gap:16px}
#measurementView[data-stage=review] .stage-grid .source-choice {justify-self:stretch;max-width:none}
.export-bar {padding:0 0 24px;margin-top:24px;border:0;border-bottom:1px solid var(--line);background:none;gap:20px}
.export-bar strong {font-size:16px;font-weight:600}
.export-bar p {font-size:14px;line-height:1.5;max-width:65ch}
.force-overview,.automatic-panel,.comparison-panel {margin:32px 0;padding:0 0 24px;border:0;border-bottom:1px solid var(--line);background:none;box-shadow:none}
.panel-title {gap:16px;flex-wrap:wrap}
.metric-scroll {max-width:100%;overflow:auto;overscroll-behavior-inline:contain}
.metric-table {font-variant-numeric:tabular-nums;line-height:1.5}
.metric-table th {font:600 14px/1.5 var(--font-ui);background:var(--panel2)}
.metric-table td,.metric-table th {padding:14px 16px;border-bottom:1px solid var(--line)}
.metric-table td {font:400 14px/1.5 var(--font-data)}
.metric-table td:first-child,.metric-table td:last-child {font:400 14px/1.5 var(--font-ui)}
.metric-table td:nth-child(2),.metric-table td:nth-child(3),.automatic-panel .metric-table td:nth-child(2) {color:var(--text)}
.metric-table small {font:400 13px/1.5 var(--font-ui)}
.automatic-panel .metric-table th,.automatic-panel .metric-table td:last-child {font-size:14px}
.automatic-panel .metric-table td:nth-child(2) {font:400 20px/1.4 var(--font-data)}
.automatic-panel .metric-table td:nth-child(3) {font:400 14px/1.5 var(--font-data)}
.auto-trials {gap:8px;margin:16px 0}
.auto-trials button {min-height:48px;font-size:14px}
.auto-trial[aria-pressed=true] {background:var(--selection);border-color:var(--text);color:var(--text)}
.result-footer {font-size:12px;line-height:1.5;flex-wrap:wrap;overflow-wrap:anywhere}
.manual-review {border-radius:0;border:0;border-bottom:1px solid var(--line)}
.manual-review>summary {padding:12px 0;font-size:16px}
.analysis-desk {border:0;border-top:1px solid var(--line)}
.trial-row button {min-height:48px;font-size:14px}
.trial-row button.selected {border:0;box-shadow:none;background:var(--selection);color:var(--text)}
.comparison-slots>div {border:0;padding:0}
.quality,.notes {border:0;padding:20px 0;background:none}
.quality-stats strong {font-family:var(--font-data)}
.quality-stats span,.quality-note,.marker-item,.markers-empty {font-size:14px}
.marker-item button {min-height:48px;min-width:48px;font-size:14px}
.reference-provenance,.recovery-panel {padding:20px;border:1px solid var(--line);border-radius:0;background:var(--panel2)}
.reference-provenance strong {font-size:14px;letter-spacing:0}
.reference-provenance p,.recovery-panel p {font-size:14px;line-height:1.5}
.notice {border-radius:0;font-size:15px;line-height:1.5}
.analysis-availability {font-size:14px;line-height:1.5}
.archive-notice {max-width:75ch;margin:20px 0 28px}
.archive-notice p {font-size:16px;line-height:1.5}
#recordsView .archive-toolbar {gap:12px;margin:24px 0 16px;align-items:center}
.archive-toolbar select {max-width:280px}
.record-list {gap:0;border-top:1px solid var(--line)}
.record-card {padding:24px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;gap:24px;background:none}
.record-test {width:64px;font:800 24px/1.1 var(--font-heading);color:var(--text)}
.record-info strong {font-size:18px;font-weight:600}
.record-info p,.record-info small {font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.record-actions {align-items:center;flex-direction:row}
.record-actions select {font-size:14px;min-height:48px;max-width:260px}
.archive-empty {padding:64px 24px;background:none;border:0}
.archive-empty p {font-size:16px}
footer {padding:32px 0;font-size:12px;gap:16px;flex-wrap:wrap;line-height:1.5}
footer span:first-child {letter-spacing:0;font-weight:600}

/* Native dialogs and the on-screen/PDF report share Pist typography. */
dialog {max-width:720px;padding:32px;border-radius:4px;border:1px solid var(--line)}
dialog::backdrop {background:#111111b3}
dialog h2 {font:800 32px/1.1 var(--font-heading)}
dialog p,dialog li {font-size:16px;line-height:1.6}
.dialog-head {gap:16px;align-items:flex-start}
.dialog-head button[data-close] {min-width:48px;min-height:48px}
.report-dialog {max-width:1120px;width:min(1120px,96vw)}
.report-controls {flex-wrap:wrap}
.measurement-report {--muted:#646464;background:#fcfcfc;color:#111111;padding:32px;font:400 16px/1.6 var(--font-ui);border-radius:0}
.measurement-report header {border-bottom:2px solid #111111;padding-bottom:24px}
.measurement-report h1 {font-size:44px;margin:12px 0}
.measurement-report h2 {font:600 24px/1.3 var(--font-ui);border-color:#d9d9d9}
.measurement-report h3 {font:600 18px/1.4 var(--font-ui)}
.measurement-report table {font-size:14px}
.measurement-report th {background:#f0f0f0;font-weight:600}
.measurement-report th,.measurement-report td {border-color:#d9d9d9;padding:12px 8px;overflow-wrap:anywhere}
.measurement-report td:not(:first-child) {font-family:var(--font-data);font-size:13px;font-variant-numeric:tabular-nums}
.measurement-report .report-status {border:1px solid #646464;background:#f0f0f0;color:#111111;padding:16px}
.measurement-report code,.measurement-report pre {font:400 12px/1.6 var(--font-data)}
.measurement-report img {background:#fcfcfc}
.measurement-report footer {color:#646464;border-color:#d9d9d9;font-size:13px}
#movementSource {display:inline-flex;align-items:center;min-height:44px}

/* Wide preparation gets the approved black instruction column. Record/review
   retain their existing DOM/state order and the full-width instrument. */
@media(min-width:960px) and (orientation:landscape) {
  #measurementView[data-stage=prepare] .stage-grid:not(:has(>.preparation[hidden])) {
    grid-template-columns:300px minmax(0,1fr);gap:24px 32px;
  }
  [data-stage=prepare] .stage-grid .measurement-guide {
    grid-column:1;grid-row:1/4;align-self:start;
    flex-direction:column;align-items:stretch;justify-content:flex-start;
  }
  [data-stage=prepare] .guide-copy h2 {font-size:36px;overflow-wrap:normal;hyphens:none}
  [data-stage=prepare] .guide-action {flex-direction:column;align-items:stretch;justify-content:flex-end}
  [data-stage=prepare] .stage-grid .preparation {grid-column:2;grid-row:1}
  [data-stage=prepare] .stage-grid .source-choice {grid-column:2;grid-row:2}
  [data-stage=prepare] .stage-grid .movement-guide {grid-column:2;grid-row:3}
}
/* Keep the numeric panel beside the chart even on a 1024px landscape tablet. */
@media(min-width:900px) and (orientation:landscape) {
  .lab-grid {grid-template-columns:minmax(0,1fr) minmax(248px,280px)}
  .lab-grid .readout {display:flex;flex-direction:column;border-top:0!important}
  .chart-card {border-right:1px solid var(--line)!important}
}
@media(orientation:portrait),(max-width:899px) {
  .lab-grid {grid-template-columns:minmax(0,1fr)}
  .chart-card {border-right:0!important}
  .lab-grid .readout {
    display:grid;grid-template-columns:1fr 1fr;gap:16px 24px;padding:24px 0;
    border-top:1px solid var(--line)!important;
  }
  .readout .panel-title {grid-column:1/-1}
  .total-readout {padding:0}
  .channel-values {grid-template-columns:1fr 1fr;border:0;padding:0;gap:16px}
  .data-explainer,.point-panel {grid-column:1/-1;margin:0;padding-top:16px}
  .chart-heading {padding-right:0}
  .chart-toolbar {padding-right:0}
  .canvas-wrap {height:clamp(340px,40vh,480px)}
  .stage-grid {grid-template-columns:1fr}
  [data-stage=prepare] .stage-grid :is(.measurement-guide,.preparation,.source-choice,.movement-guide) {grid-column:1;grid-row:auto}
  .stage-grid .measurement-guide {flex-direction:row;align-items:center}
}
@media(max-width:1150px) {
  .topbar {gap:12px 24px}
  .top-right .pilot {display:none}
  .topbar .top-right :is(#theme,#help,#device) {padding:10px 8px;font-size:13px}
  .topbar .workspace-nav {gap:16px}
  .export-bar {flex-direction:column;align-items:stretch}
  .record-card {flex-wrap:wrap}
  .record-actions {width:100%;flex-wrap:wrap}
}
@media(max-width:700px) {
  main {padding-top:20px}
  .topbar {padding:12px 16px;gap:8px 24px;align-items:center;flex-wrap:wrap}
  .topbar .workspace-nav {margin-left:auto;gap:24px}
  .top-right {width:100%;margin:0;justify-content:flex-start;gap:8px}
  .topbar .top-right :is(#theme,#help,#device) {font-size:13px;padding:10px 8px;min-height:48px}
  .topbar .top-right #help {display:inline-flex}
  .topbar .top-right :is(#help,#device) .ui-icon {display:none}
  .heading h1 {font-size:40px}
  .heading,#measurementView[data-stage=review] .heading {flex-wrap:wrap;align-items:flex-start}
  .heading-actions {flex-wrap:wrap}
  .heading-actions button {min-height:48px;font-size:14px;padding:10px 12px}
  .workflow {gap:12px;margin:20px 0}
  .workflow li {gap:6px;font-size:13px}
  .stage-grid .measurement-guide {padding:24px;flex-direction:column;align-items:stretch;gap:16px}
  .guide-copy h2 {font-size:34px}
  .guide-action {justify-content:flex-start;flex-wrap:wrap}
  .guide-action button {width:100%}
  .quick-tests button {padding:12px}
  .quick-tests button[aria-pressed=true] {padding:11px}
  .quick-tests button span {font-size:14px}
  .chart-heading {gap:12px}
  .chart-heading h2 {font-size:24px}
  .chart-heading .badge {font:400 12px/1.4 var(--font-ui)}
  .chart-toolbar {gap:8px;align-items:flex-start}
  .legend {gap:16px}
  .legend button {font-size:14px}
  .legend svg.line {width:26px}
  .view-tools {gap:8px}
  .view-tools button {padding:8px 10px}
  .canvas-wrap {height:320px}
  .chart-bottom span:last-child {display:block;font-size:12px}
  .lab-grid .readout {grid-template-columns:minmax(0,1fr);gap:20px}
  .readout .panel-title,.data-explainer,.point-panel {grid-column:1}
  .channel-values {grid-template-columns:1fr 1fr}
  .readout .total-readout strong {font-size:44px}
  .review-summary {align-items:flex-start;flex-direction:column}
  .review-summary .review-state {flex-direction:row;align-items:center;flex-wrap:wrap}
  .force-overview,.automatic-panel {padding:0 0 24px}
  .metric-table td,.metric-table th {padding:12px}
  .record-card {gap:16px}
  .record-actions select {max-width:100%;width:100%;flex-basis:100%}
  .archive-toolbar {flex-wrap:wrap}
  .archive-toolbar :is(select,button) {max-width:100%;flex:1}
  dialog {padding:20px;width:calc(100vw - 24px)}
  .report-dialog {padding:16px}
  .measurement-report {padding:16px}
  .measurement-report h1 {font-size:36px}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
@media print {
  .measurement-report {background:#fff;padding:0;color:#111}
  .measurement-report h1 {font-size:32px}
  .measurement-report table {font-size:11px}
  .measurement-report td:not(:first-child) {font-size:11px}
}
/* Preserve every visibility decision made by the existing workflow. */
[hidden] {display:none!important}
