/* filepath+name "respiratory-therapy/respiratory-tools.css"
   Role: single visual system for ZeBeZo respiratory therapy tool pages.
   Scope: respiratory landing, calculators, exam practice, achievements, and waveform pages.
   Keep games and non-respiratory site sections on their own CSS systems. */

:root {
  --rt-bg: #f5f7fb;
  --rt-bg-soft: #edf6f4;
  --rt-panel: #ffffff;
  --rt-panel-muted: #f8fafc;
  --rt-text: #10213a;
  --rt-muted: #5d7089;
  --rt-line: #d9e3ee;
  --rt-line-strong: #bfd0df;
  --rt-accent: #0f766e;
  --rt-accent-strong: #0b5f70;
  --rt-accent-soft: #e6f7f5;
  --rt-blue: #2563eb;
  --rt-blue-soft: #eaf1ff;
  --rt-good: #0f7a46;
  --rt-good-soft: #eaf8ef;
  --rt-warn: #b45309;
  --rt-warn-soft: #fff7ed;
  --rt-bad: #b42318;
  --rt-bad-soft: #fff1f0;
  --rt-radius: 8px;
  --rt-shadow: 0 16px 42px rgba(16, 33, 58, 0.08);
  --rt-shadow-sm: 0 2px 10px rgba(16, 33, 58, 0.08);
  --rt-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --rt-mono: "SF Mono", "Roboto Mono", Consolas, monospace;
  --rt-page-width: 1120px;
  --rt-tool-width: 1080px;
  --rt-gap: 1rem;
  --rt-control-min: 44px;
}

* {
  box-sizing: border-box;
}

body.respiratory-tools-page {
  margin: 0;
  min-height: 100vh;
  color: var(--rt-text);
  font: 16px/1.55 var(--rt-font);
  background:
    radial-gradient(900px 520px at 15% -10%, #ddf6ff, transparent 70%),
    radial-gradient(760px 480px at 100% 0%, #edf9f3, transparent 68%),
    var(--rt-bg);
}

body.respiratory-tools-page h1,
body.respiratory-tools-page h2,
body.respiratory-tools-page h3,
body.respiratory-tools-page p {
  margin: 0;
}

body.respiratory-tools-page a {
  color: var(--rt-accent-strong);
}

body.respiratory-tools-page a.button-link {
  color: #fff;
  text-decoration: none;
}

body.respiratory-tools-page a.button-link:hover,
body.respiratory-tools-page a.button-link:focus {
  color: #fff;
}

body.respiratory-tools-page img,
body.respiratory-tools-page canvas {
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.activation-gate {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--rt-line-strong);
  border-radius: var(--rt-radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--rt-shadow-sm);
  display: grid;
  gap: .7rem;
}

.activation-gate h2 {
  font-size: 1.25rem;
}

.activation-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.wrap,
.shell,
.page-shell,
.tool-shell,
.paco2-calculator.tool-shell {
  width: min(var(--rt-page-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 54px;
}

.tool-shell,
.paco2-calculator.tool-shell {
  width: min(var(--rt-tool-width), calc(100% - 32px));
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: 1rem;
  color: var(--rt-accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.hero,
.intro {
  margin-bottom: 1.25rem;
}

.hero h1,
.intro h1,
.tool-shell > header h1,
.paco2-calculator h1 {
  max-width: 980px;
  color: var(--rt-text);
  font-size: clamp(2rem, 5vw, 4.7rem);
  line-height: .98;
  letter-spacing: 0;
}

.subtitle,
.hero-copy,
.scope-note,
.muted,
.small-note,
.source-note,
.range-note,
.formula-note,
.safety-note,
.note {
  color: var(--rt-muted);
}

.hero-copy,
.subtitle,
.scope-note {
  max-width: 820px;
  margin-top: .65rem;
  font-size: 1.06rem;
}

.source-note {
  margin-top: 1rem;
  font-size: .9rem;
}

.compact-hide {
  display: block;
}

/* Cards and panels */
.portal-card,
.aggregate-panel,
.section,
.card,
.control-card,
.calc-card,
.question-card,
.stat-card,
.note-box,
.method-card,
.evidence-panel,
.image-container,
.data-table-container,
.certificate,
.modal .content,
.mix-panel {
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--rt-shadow-sm);
}

.section,
.card,
.control-card,
.calc-card,
.question-card,
.note-box,
.aggregate-panel,
.method-card,
.evidence-panel,
.data-table-container {
  padding: 1rem;
}

.section + .section,
.card + .card,
.control-card + .control-card,
.calc-card + .calc-card {
  margin-top: 1rem;
}

.section-title,
.dashboard-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .75rem;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--rt-text);
}

.section-title::before,
.dashboard-section-title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--rt-accent);
  flex: 0 0 auto;
}

summary.section-title {
  cursor: pointer;
}

summary.section-title::marker {
  color: var(--rt-accent);
}

/* Buttons and segmented controls */
button,
.btn,
.button-link,
.primary,
.secondary,
.danger {
  min-height: var(--rt-control-min);
  border: 1px solid var(--rt-accent);
  border-radius: var(--rt-radius);
  padding: .66rem .9rem;
  background: var(--rt-accent);
  color: #fff;
  font: 800 .95rem/1 var(--rt-font);
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover,
.btn:hover,
.button-link:hover {
  border-color: var(--rt-accent);
  background: var(--rt-accent-strong);
  color: #fff;
}

button:disabled,
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.primary,
button.primary,
.btn.primary,
.button-link.primary {
  border-color: var(--rt-accent);
  background: var(--rt-accent);
  color: #fff;
}

.secondary,
button.secondary,
.btn.secondary,
.button-link.secondary {
  border-color: var(--rt-accent);
  background: var(--rt-accent);
  color: #fff;
}

.danger,
button.danger {
  border-color: rgba(180, 35, 24, .35);
  color: var(--rt-bad);
  background: var(--rt-bad-soft);
}

.actions,
.button-row,
.gallery-controls,
.waveform-controls,
.certificate-actions,
.mix-actions,
.control-panel,
.dashboard-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
}

.tabs,
.segmented,
.mobile-waveform-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  margin: 1rem 0;
  padding: .35rem;
  border: 1px solid var(--rt-line);
  border-radius: calc(var(--rt-radius) + 2px);
  background: rgba(255, 255, 255, .76);
}

.tab-button,
.segmented .btn,
.mobile-waveform-tabs button {
  min-height: var(--rt-control-min);
  width: 100%;
  padding: .66rem .9rem;
  background: transparent;
  border-color: transparent;
  color: var(--rt-text);
  font: 800 .95rem/1 var(--rt-font);
  cursor: pointer;
}

.tab-button[aria-selected="true"],
.segmented .btn.active,
.mobile-waveform-tabs button[aria-selected="true"] {
  background: var(--rt-accent);
  border-color: var(--rt-accent);
  color: #fff;
  box-shadow: var(--rt-shadow-sm);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Forms, sliders, and calculator controls */
label,
legend {
  display: block;
  color: var(--rt-muted);
  font-weight: 800;
  font-size: .9rem;
}

input,
select,
.text-input {
  width: 100%;
  min-height: var(--rt-control-min);
  border: 1px solid var(--rt-line-strong);
  border-radius: var(--rt-radius);
  padding: .62rem .72rem;
  color: var(--rt-text);
  background: #fff;
  font: 700 .98rem/1.2 var(--rt-font);
}

input:focus,
select:focus,
button:focus-visible,
.option:focus-visible,
.portal-card:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .22);
  outline-offset: 2px;
}

input[type="range"] {
  min-height: 34px;
  padding: 0;
  accent-color: var(--rt-accent);
}

input.no-spinner::-webkit-outer-spin-button,
input.no-spinner::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

input.no-spinner {
  appearance: textfield;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(120px, .72fr) minmax(140px, 1fr) auto;
  gap: .75rem;
  align-items: center;
}

.value-display,
.field-row strong {
  min-width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-right: .75rem;
  color: var(--rt-text);
}

.radio-option input {
  width: auto;
  min-height: auto;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
  gap: 1rem;
  align-items: start;
}

.practice-results-layout {
  margin-top: 18px;
}

.patient-grid,
.answer-grid,
.stats-grid,
.summary-grid,
.tool-grid,
.waveform-grid,
.method-grid,
.image-gallery {
  display: grid;
  gap: .85rem;
}

.patient-grid,
.answer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid,
.summary-grid,
.tool-grid,
.waveform-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.patient-fact,
.stat-card,
.metric {
  padding: .85rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.patient-fact strong,
.stat-card strong,
.metric strong {
  display: block;
  margin-top: .2rem;
  color: var(--rt-text);
  font-size: 1.35rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Tidal-volume practice layout */
.respiratory-tools-tidal-volume #calculator-content .layout,
.respiratory-tools-tidal-volume #practice-panel .layout {
  align-items: stretch;
}

.respiratory-tools-tidal-volume #calculator-content .layout > .section,
.respiratory-tools-tidal-volume #practice-panel .layout > .section {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.respiratory-tools-tidal-volume #calculator-content .control-card:last-child,
.respiratory-tools-tidal-volume #calculator-content .calculation-gallery,
.respiratory-tools-tidal-volume #practice-panel .question-card {
  flex: 1;
}

.respiratory-tools-tidal-volume #calculator-content .calculation-gallery {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.respiratory-tools-tidal-volume #calculator-content .calculation-gallery-viewport,
.respiratory-tools-tidal-volume #calculator-content .calculation-gallery-track,
.respiratory-tools-tidal-volume #calculator-content .calculation-slide[data-active="true"] {
  height: 100%;
}

.respiratory-tools-tidal-volume #calculator-content .calculation-slide[data-active="true"] {
  display: flex;
  flex-direction: column;
}

.respiratory-tools-page .calc-step {
  display: grid;
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
  margin-top: .55rem;
  padding: .55rem .65rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-page .calc-step:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .22);
  outline-offset: 2px;
}

.respiratory-tools-page .calc-step-label {
  color: var(--rt-accent-strong);
  font-weight: 900;
  white-space: nowrap;
}

.respiratory-tools-page .calc-step-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.respiratory-tools-page .calc-step-result {
  text-align: right;
  font-family: var(--rt-mono);
  font-size: .9rem;
  line-height: 1.25;
  white-space: nowrap;
}

.respiratory-tools-page .calc-step::after {
  content: attr(data-tooltip) "\A" "Raw equation: " attr(data-equation);
  position: absolute;
  left: .5rem;
  right: .5rem;
  bottom: calc(100% + .45rem);
  z-index: 20;
  display: none;
  padding: .65rem .75rem;
  border: 1px solid var(--rt-line-strong);
  border-radius: var(--rt-radius);
  background: #fff;
  color: var(--rt-text);
  box-shadow: var(--rt-shadow-sm);
  font: 800 .82rem/1.35 var(--rt-font);
  text-align: left;
  white-space: pre-line;
}

.respiratory-tools-page .calc-step:hover::after,
.respiratory-tools-page .calc-step:focus-visible::after {
  display: block;
}

.respiratory-tools-page .audit-progress-panel {
  display: grid;
  gap: .85rem;
  margin-bottom: 1rem;
}

.respiratory-tools-page .audit-unsaved-warning {
  display: grid;
  gap: .2rem;
  margin: 0 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid #facc15;
  border-radius: var(--rt-radius);
  background: #fefce8;
  color: #713f12;
  font-weight: 800;
}

.respiratory-tools-page .audit-unsaved-warning span {
  font-weight: 700;
}

.audit-unsaved-dialog {
  width: min(560px, calc(100% - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: var(--rt-text, #10213a);
  background: transparent;
}

.audit-unsaved-dialog::backdrop {
  background: rgba(16, 33, 58, .42);
}

.audit-unsaved-dialog-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid #facc15;
  border-radius: 10px;
  background: #fffdf0;
  box-shadow: 0 24px 70px rgba(16, 33, 58, .24);
}

.audit-unsaved-dialog-card h2,
.audit-unsaved-dialog-card p {
  margin: 0;
}

.audit-unsaved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: flex-end;
}

.respiratory-tools-page .audit-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem;
}

.respiratory-tools-page .audit-progress-head .section-title {
  margin-bottom: 0;
}

.respiratory-tools-page .audit-progress-state {
  color: var(--rt-muted);
  font-size: .9rem;
  font-weight: 800;
}

.respiratory-tools-page .audit-progress-toggle {
  display: none;
}

.respiratory-tools-page .audit-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.respiratory-tools-page .audit-progress-item {
  display: grid;
  gap: .45rem;
  min-width: 0;
  padding: .75rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-page .audit-progress-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  color: var(--rt-muted);
  font-size: .86rem;
  font-weight: 800;
}

.respiratory-tools-page .audit-progress-row strong {
  color: var(--rt-text);
  text-align: right;
}

.respiratory-tools-page .audit-progress-bar {
  height: .65rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e3edf6;
}

.respiratory-tools-page .audit-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--rt-accent);
  transition: width .25s ease;
}

.respiratory-tools-page #practice-panel .test-session-group {
  display: grid;
  gap: .75rem;
  margin-bottom: 1rem;
}

.respiratory-tools-page #practice-panel .test-session-group .lock-panel,
.respiratory-tools-page #practice-panel .test-session-group .stats-panel {
  margin-bottom: 0;
  padding: .85rem;
  border: 1px solid var(--rt-line);
  background: var(--rt-panel-muted);
  box-shadow: none;
}

.respiratory-tools-page #practice-panel .test-readiness-panel {
  display: grid;
  gap: .25rem;
  padding: .85rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
  color: var(--rt-muted);
}

.respiratory-tools-page #practice-panel .test-readiness-panel strong {
  color: var(--rt-heading);
}

.respiratory-tools-page #practice-panel .test-readiness-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .35rem;
}

.respiratory-tools-page #practice-panel .test-readiness-card {
  display: grid;
  gap: .1rem;
  min-width: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
}

.respiratory-tools-page #practice-panel .test-readiness-card span {
  color: var(--rt-muted);
  font-size: .8rem;
  font-weight: 800;
}

.respiratory-tools-page #practice-panel .test-readiness-card strong {
  font-size: 1.05rem;
}

.respiratory-tools-page #practice-panel .test-readiness-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .35rem;
}

.respiratory-tools-page #practice-panel .test-readiness-actions .button-link,
.respiratory-tools-page #practice-panel .test-readiness-actions button {
  flex: 1 1 180px;
  min-height: var(--rt-control-min);
}

.respiratory-tools-page #practice-panel .test-readiness-panel.is-ready {
  border-color: rgba(15, 122, 70, .25);
  background: var(--rt-good-soft);
}

.respiratory-tools-page .zine-post-test-gate {
  display: grid;
  gap: .45rem;
  padding: .65rem .75rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: rgba(255, 255, 255, .92);
  color: var(--rt-muted);
}

.respiratory-tools-page .zine-post-test-gate > strong {
  color: var(--rt-heading);
}

.respiratory-tools-page .zine-post-test-gate.is-ready {
  border-color: rgba(15, 122, 70, .35);
  background: var(--rt-good-soft);
}

.respiratory-tools-page .zine-post-test-gate-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  font-weight: 900;
}

.respiratory-tools-page .zine-post-test-gate .button-link {
  justify-content: center;
  min-height: 32px;
}

@media (max-width: 680px) {
  .respiratory-tools-page .audit-progress-grid {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-page #practice-panel .test-readiness-stats {
    grid-template-columns: 1fr;
  }
}

.respiratory-tools-page #practice-panel .test-session-group .lock-panel + .stats-panel,
.respiratory-tools-page #practice-panel .test-session-group [data-respiratory-session-stats] {
  padding-top: 0;
  border-top: 0;
}

.respiratory-tools-page #practice-panel .lock-panel,
.respiratory-tools-page #practice-panel .stats-panel,
.respiratory-tools-page #practice-panel .test-session-group {
  margin-bottom: .85rem;
}

.respiratory-tools-page #practice-panel .lock-panel > summary,
.respiratory-tools-page #practice-panel .stats-panel > summary {
  margin-bottom: .65rem;
}

.respiratory-tools-page #practice-panel .lock-panel:not([open]) > summary,
.respiratory-tools-page #practice-panel .stats-panel:not([open]) > summary {
  margin-bottom: 0;
}

.respiratory-tools-page #practice-panel .lock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: .65rem;
  align-items: end;
}

.respiratory-tools-page #practice-panel .lock-grid button {
  min-width: 150px;
}

.respiratory-tools-page #practice-panel .lock-status {
  margin-top: .6rem;
  color: var(--rt-muted);
  font-size: .9rem;
}

.respiratory-tools-page #practice-panel .stats-scope-card {
  display: grid;
  gap: .15rem;
  margin-bottom: .85rem;
  padding: .85rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-page #practice-panel .stats-scope-card span,
.respiratory-tools-page #practice-panel .stats-scope-card small,
.respiratory-tools-page #practice-panel .stats-subtitle {
  color: var(--rt-muted);
  font-weight: 800;
}

.respiratory-tools-page #practice-panel .stats-scope-card strong {
  color: var(--rt-text);
  font-size: 1rem;
}

.respiratory-tools-page #practice-panel .stats-scope-card small {
  overflow-wrap: anywhere;
}

.respiratory-tools-page #practice-panel .stats-subtitle {
  margin: .95rem 0 .5rem;
  font-size: .9rem;
}

.respiratory-tools-page #practice-panel .section-title {
  margin-bottom: .85rem;
}

.respiratory-tools-page #practice-panel .question-card {
  display: grid;
  gap: 1rem;
}

.respiratory-tools-tidal-volume #practice-panel > .layout {
  grid-template-columns: minmax(0, 1fr);
}

.respiratory-tools-tidal-volume #practice-panel .patient-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.respiratory-tools-page #practice-panel .patient-fact {
  min-height: 88px;
  display: grid;
  align-content: center;
}

.respiratory-tools-page #practice-panel .answer-grid {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  align-items: end;
}

.respiratory-tools-page #practice-panel .answer-grid label {
  display: grid;
  gap: .4rem;
}

.respiratory-tools-page #practice-panel .button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.respiratory-tools-page #practice-panel .button-row button {
  width: 100%;
}

/* Calculation and practice galleries */
.calculation-gallery,
.waveform-gallery {
  display: grid;
  gap: .75rem;
  min-width: 0;
}

.calculation-gallery-header,
.waveform-gallery-header,
.aggregate-head,
.mix-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.gallery-step-counter,
.waveform-step-counter,
.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--rt-line);
  border-radius: 999px;
  padding: .28rem .62rem;
  background: var(--rt-panel-muted);
  color: var(--rt-muted);
  font-size: .78rem;
  font-weight: 800;
}

.badge.active {
  border-color: rgba(15, 118, 110, .3);
  color: var(--rt-accent-strong);
  background: var(--rt-accent-soft);
}

.calculation-gallery-viewport,
.waveform-gallery-viewport {
  overflow: hidden;
  border-radius: var(--rt-radius);
}

.calculation-gallery-track,
.waveform-gallery-track {
  display: grid;
}

.calculation-slide,
.waveform-slide {
  display: none;
  min-width: 0;
}

.calculation-slide[data-active="true"],
.waveform-slide[data-active="true"] {
  display: block;
}

.gallery-dots,
.waveform-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem;
}

.gallery-dot,
.waveform-dot {
  width: 11px;
  height: 11px;
  min-height: 11px;
  padding: 0;
  border-radius: 50%;
  border-color: var(--rt-line-strong);
  background: #fff;
}

.gallery-dot[aria-selected="true"],
.waveform-dot[aria-selected="true"] {
  background: var(--rt-accent);
  border-color: var(--rt-accent);
}

.formula,
.work,
.math-line {
  overflow-wrap: anywhere;
  font-family: var(--rt-mono);
}

.formula {
  color: var(--rt-accent-strong);
  font-weight: 800;
}

.math-work {
  display: grid;
  gap: .5rem;
  margin-top: .65rem;
}

.math-line {
  border-left: 4px solid var(--rt-accent);
  border-radius: var(--rt-radius);
  background: #fbfdff;
  padding: .65rem .75rem;
  color: var(--rt-text);
}

.math-line.result {
  background: var(--rt-blue-soft);
}

.math-line[data-equation] {
  color: var(--rt-muted);
}

.math-line mjx-container {
  max-width: 100%;
  margin: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
}

.math-line mjx-container svg {
  max-width: 100%;
  height: auto;
}

.answer-work-modal {
  position: fixed;
  z-index: 1000;
  inset: auto;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(860px, calc(100vw - 32px));
  max-height: min(78vh, 760px);
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--rt-line-strong);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 0 0 9999px rgba(8, 26, 54, .42), 0 24px 70px rgba(8, 26, 54, .28);
  animation: answerWorkGrow 3s cubic-bezier(.18, .82, .22, 1) both;
}

.answer-work-modal.answer-work-closing {
  animation: answerWorkClose .18s ease both;
}

.answer-work-close {
  justify-self: end;
  min-height: 34px;
  padding: .45rem .7rem;
  margin-bottom: .55rem;
}

@keyframes answerWorkGrow {
  0% {
    opacity: 0;
    clip-path: inset(46% 46% 46% 46% round var(--rt-radius));
    transform: translate(calc(-50% + var(--work-start-x, 0px)), calc(-50% + var(--work-start-y, 0px))) scale(.08);
  }
  35% {
    opacity: 1;
    clip-path: inset(28% 28% 28% 28% round var(--rt-radius));
    transform: translate(calc(-50% + (var(--work-start-x, 0px) * .55)), calc(-50% + (var(--work-start-y, 0px) * .55))) scale(.46);
  }
  70% {
    clip-path: inset(8% 8% 8% 8% round var(--rt-radius));
    transform: translate(calc(-50% + (var(--work-start-x, 0px) * .18)), calc(-50% + (var(--work-start-y, 0px) * .18))) scale(.86);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0 round var(--rt-radius));
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes answerWorkClose {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .answer-work-modal,
  .answer-work-modal.answer-work-closing {
    animation-duration: .01ms;
  }
}

.feedback {
  display: none;
  margin-top: .85rem;
  border-radius: var(--rt-radius);
  padding: .75rem .85rem;
  font-weight: 800;
}

.feedback.show {
  display: block;
  border: 1px solid var(--rt-line);
  background: var(--rt-blue-soft);
  color: var(--rt-blue);
}

.feedback.correct,
.feedback.good {
  border-color: rgba(15, 122, 70, .28);
  background: var(--rt-good-soft);
  color: var(--rt-good);
}

.feedback.incorrect,
.feedback.bad {
  border-color: rgba(180, 35, 24, .28);
  background: var(--rt-bad-soft);
  color: var(--rt-bad);
}

.tool-support-details {
  display: none;
}

/* Landing cards */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.portal-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding: 1.1rem;
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}

.portal-card--wide {
  grid-column: 1 / -1;
  min-height: 190px;
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, .45);
}

.portal-card--under-construction,
.portal-card--under-construction:hover,
.portal-card--under-construction:focus-visible {
  cursor: not-allowed;
  transform: none;
  border-color: rgba(180, 83, 9, .35);
  background: linear-gradient(180deg, rgba(255, 247, 237, .98), rgba(255, 255, 255, .98));
  opacity: .82;
}

.portal-kicker {
  color: var(--rt-muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.portal-card h2 {
  font-size: 1.35rem;
  line-height: 1.18;
}

.portal-card p {
  color: var(--rt-muted);
}

.portal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.pill {
  border: 1px solid var(--rt-line);
  border-radius: 999px;
  padding: .2rem .55rem;
  background: rgba(255, 255, 255, .86);
  color: var(--rt-muted);
  font-size: .8rem;
}

.portal-spacer {
  flex: 1;
}

.portal-arrow {
  color: var(--rt-accent-strong);
  font-weight: 900;
}

.portal-card--under-construction .portal-arrow {
  color: var(--rt-warn);
}

.secret-card {
  border-color: rgba(15, 118, 110, .48);
  background: linear-gradient(180deg, rgba(240, 253, 250, .96), rgba(255, 255, 255, .98));
}

/* Exam practice */
.respiratory-tools-exam-practice .shell {
  display: grid;
  grid-template-columns: minmax(260px, .36fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.respiratory-tools-exam-practice aside,
.respiratory-tools-exam-practice main {
  min-width: 0;
}

.respiratory-tools-exam-practice .topline,
.respiratory-tools-exam-practice .score {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
}

.prompt {
  white-space: pre-wrap;
}

.options {
  display: grid;
  gap: .6rem;
  margin-top: .85rem;
}

.option {
  width: 100%;
  min-height: auto;
  text-align: left;
  line-height: 1.35;
  background: #fff;
}

.option.selected {
  border-color: var(--rt-blue);
  background: var(--rt-blue-soft);
}

.option.correct {
  border-color: rgba(15, 122, 70, .35);
  background: var(--rt-good-soft);
}

.option.incorrect {
  border-color: rgba(180, 35, 24, .35);
  background: var(--rt-bad-soft);
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--rt-line);
}

.bar {
  height: 100%;
  width: 0;
  background: var(--rt-accent);
}

.images img {
  display: block;
  max-height: 360px;
  margin: .75rem 0;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
}

.certificate,
.modal {
  display: none;
}

.modal.show {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(16, 33, 58, .44);
}

.modal.show .content {
  width: min(760px, 100%);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1rem;
}

.archive-status.warn {
  color: var(--rt-warn);
}

.mix-rows {
  display: grid;
  gap: .45rem;
}

.mix-row,
.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.mix-row input,
.check-row input {
  width: auto;
  min-height: auto;
}

/* Achievements */
.respiratory-tools-achievements .wrap {
  width: min(1180px, calc(100% - 48px));
  padding-top: 30px;
  padding-bottom: 36px;
}

.respiratory-tools-achievements .hero {
  margin-bottom: 1rem;
}

.respiratory-tools-achievements .hero h1 {
  max-width: 980px;
  font-size: clamp(2.25rem, 3.7vw, 4.1rem);
  line-height: .98;
}

.respiratory-tools-achievements .hero-copy {
  max-width: 940px;
}

.respiratory-tools-achievements .aggregate-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.respiratory-tools-achievements .aggregate-head {
  align-items: end;
}

.respiratory-tools-achievements .name-field {
  display: grid;
  gap: .35rem;
  min-width: min(360px, 100%);
  color: var(--rt-muted);
  font-weight: 800;
}

.respiratory-tools-achievements .summary-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.respiratory-tools-achievements .achievement-section {
  display: grid;
  gap: .85rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--rt-shadow);
}

.respiratory-tools-achievements .achievement-section .section-title {
  margin: 0;
}

.respiratory-tools-achievements .course-record-table-wrap {
  overflow-x: auto;
}

.respiratory-tools-achievements .course-record-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  overflow: hidden;
  background: #fff;
}

.respiratory-tools-achievements .course-record-table th,
.respiratory-tools-achievements .course-record-table td {
  padding: .65rem .7rem;
  border-bottom: 1px solid var(--rt-line);
  color: var(--rt-text);
  font-size: .86rem;
  text-align: left;
  vertical-align: middle;
}

.respiratory-tools-achievements .course-record-table th {
  color: var(--rt-muted);
  background: var(--rt-panel-muted);
  font-size: .78rem;
  font-weight: 900;
}

.respiratory-tools-achievements .course-record-table tr:last-child td {
  border-bottom: 0;
}

.respiratory-tools-achievements .course-record-table td:first-child {
  width: 220px;
}

.respiratory-tools-achievements .course-record-table th:nth-child(2),
.respiratory-tools-achievements .course-record-table td:nth-child(2) {
  width: 90px;
}

.respiratory-tools-achievements .course-record-table th:nth-child(3),
.respiratory-tools-achievements .course-record-table td:nth-child(3),
.respiratory-tools-achievements .course-record-table th:nth-child(5),
.respiratory-tools-achievements .course-record-table td:nth-child(5) {
  width: 118px;
}

.respiratory-tools-achievements .course-record-table th:nth-child(4),
.respiratory-tools-achievements .course-record-table td:nth-child(4),
.respiratory-tools-achievements .course-record-table th:nth-child(6),
.respiratory-tools-achievements .course-record-table td:nth-child(6),
.respiratory-tools-achievements .course-record-table th:nth-child(7),
.respiratory-tools-achievements .course-record-table td:nth-child(7) {
  width: 132px;
}

.respiratory-tools-achievements .course-record-table th:nth-child(8),
.respiratory-tools-achievements .course-record-table td:nth-child(8) {
  width: 150px;
}

.respiratory-tools-achievements .course-record-table td:first-child strong {
  display: block;
  margin-top: .15rem;
}

.respiratory-tools-achievements .record-subtle {
  display: block;
  margin-top: .2rem;
  color: var(--rt-muted);
  font-size: .78rem;
  font-weight: 800;
}

.respiratory-tools-achievements .status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: .22rem .55rem;
  border: 1px solid var(--rt-line);
  border-radius: 999px;
  background: #fff;
  color: var(--rt-muted);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.respiratory-tools-achievements .status-pill.good {
  border-color: rgba(18, 128, 116, .35);
  background: rgba(18, 128, 116, .12);
  color: var(--rt-accent);
}

.respiratory-tools-achievements .status-pill.warn {
  border-color: rgba(245, 129, 26, .35);
  background: rgba(245, 129, 26, .12);
  color: #8a4500;
}

.respiratory-tools-achievements .status-pill.muted {
  border-color: var(--rt-line);
  background: var(--rt-panel-muted);
  color: var(--rt-muted);
}

.respiratory-tools-achievements .learning-record-stack {
  display: grid;
  gap: .7rem;
}

.respiratory-tools-achievements .learning-record-stack > h3 {
  margin: 0;
  font-size: 1rem;
}

.respiratory-tools-achievements .learning-record-card,
.respiratory-tools-achievements .certificate-row {
  min-width: 0;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
  box-shadow: var(--rt-shadow-sm);
}

.respiratory-tools-achievements .learning-record-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
}

.respiratory-tools-achievements .learning-record-card.compact {
  gap: .65rem;
}

.respiratory-tools-achievements .record-card-head {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.respiratory-tools-achievements .record-card-head h3 {
  margin: .15rem 0 0;
  font-size: 1rem;
}

.respiratory-tools-achievements .record-fact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: 0;
}

.respiratory-tools-achievements .record-fact-grid div {
  min-width: 0;
  padding: .6rem .7rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-achievements .record-fact-grid dt {
  color: var(--rt-muted);
  font-size: .76rem;
  font-weight: 900;
}

.respiratory-tools-achievements .record-fact-grid dd {
  margin: .15rem 0 0;
  color: var(--rt-text);
  font-weight: 900;
}

.respiratory-tools-achievements .certificate-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem .85rem;
}

.respiratory-tools-achievements .certificate-row span {
  color: var(--rt-muted);
  font-weight: 800;
}

.respiratory-tools-achievements .tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.respiratory-tools-achievements .record-tabs-section {
  gap: 1rem;
}

.respiratory-tools-achievements .record-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .5rem;
}

.respiratory-tools-achievements .record-tab {
  color: var(--rt-text);
  border-color: var(--rt-line);
  background: #fff;
}

.respiratory-tools-achievements .record-tab[aria-selected="true"] {
  color: #fff;
  border-color: var(--rt-accent);
  background: var(--rt-accent);
}

.respiratory-tools-achievements .record-tab-panel {
  display: none;
}

.respiratory-tools-achievements .record-tab-panel.active {
  display: grid;
  gap: .85rem;
}

.respiratory-tools-achievements .course-record-grid,
.respiratory-tools-achievements .test-outcome-grid {
  display: grid;
  gap: .75rem;
}

.respiratory-tools-achievements .waveform-grid {
  grid-template-columns: 1fr;
  gap: .55rem;
}

.respiratory-tools-achievements .course-record-card,
.respiratory-tools-achievements .test-outcome-empty,
.respiratory-tools-achievements .tool-card,
.respiratory-tools-achievements .waveform-row {
  min-width: 0;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
  box-shadow: var(--rt-shadow-sm);
}

.respiratory-tools-achievements .tool-card {
  display: grid;
  gap: .85rem;
  padding: 1rem;
}

.respiratory-tools-achievements .course-record-card,
.respiratory-tools-achievements .test-outcome-empty {
  display: grid;
  gap: .85rem;
  padding: 1rem;
}

.respiratory-tools-achievements .course-record-head {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.respiratory-tools-achievements .course-record-head h3,
.respiratory-tools-achievements .test-outcome-empty h3 {
  margin: .15rem 0 0;
  font-size: 1.05rem;
}

.respiratory-tools-achievements .course-record-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
  justify-items: stretch;
}

.respiratory-tools-achievements .course-record-actions .button-link {
  width: 100%;
  min-height: 38px;
  padding: .55rem .65rem;
}

.respiratory-tools-achievements .course-state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.respiratory-tools-achievements .button-link.is-disabled {
  opacity: .55;
  pointer-events: none;
  cursor: not-allowed;
}

.respiratory-tools-achievements .print-certificate-action {
  width: 100%;
}

.respiratory-tools-achievements .print-document {
  display: none;
}

.respiratory-tools-achievements .print-document.active {
  display: block;
}

.respiratory-tools-achievements .tool-head {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
}

.respiratory-tools-achievements .tool-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.respiratory-tools-achievements .display-source-field,
.respiratory-tools-achievements .selected-test-id {
  display: grid;
  gap: .25rem;
}

.respiratory-tools-achievements .display-source-field {
  color: var(--rt-muted);
  font-weight: 800;
}

.respiratory-tools-achievements .display-source-field select {
  min-width: 0;
  width: 100%;
  min-height: 2.35rem;
  padding: .45rem .55rem;
  border: 1px solid var(--rt-line-strong);
  border-radius: var(--rt-radius);
  background: #fff;
  color: var(--rt-text);
  font: inherit;
  font-weight: 800;
}

.respiratory-tools-achievements .selected-test-id {
  padding: .65rem .75rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-achievements .selected-test-id span,
.respiratory-tools-achievements .selected-test-id small {
  color: var(--rt-muted);
  font-weight: 800;
}

.respiratory-tools-achievements .selected-test-id strong {
  overflow-wrap: anywhere;
  color: var(--rt-text);
  font-size: .9rem;
}

.respiratory-tools-achievements .badge.active {
  border-color: rgba(18, 128, 116, .32);
  background: rgba(18, 128, 116, .1);
  color: var(--rt-accent);
}

.respiratory-tools-achievements .metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}

.respiratory-tools-achievements .waveform-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem .85rem;
}

.respiratory-tools-achievements .waveform-row span {
  color: var(--rt-muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.respiratory-tools-achievements .actions {
  margin-top: 1rem;
}

.print-certificate {
  display: none;
}

.print-summary,
.print-breakdown {
  display: grid;
  gap: .5rem;
}

/* Waveform page and dashboard */
.respiratory-tools-waveforms .page-shell {
  width: min(1180px, calc(100% - 48px));
  padding-top: 26px;
  padding-bottom: 28px;
}

.respiratory-tools-waveforms .hero {
  margin-bottom: 1rem;
}

.respiratory-tools-waveforms .hero h1 {
  max-width: 1120px;
  font-size: clamp(2.45rem, 3.35vw, 3.85rem);
  line-height: .98;
}

.respiratory-tools-waveforms .hero p {
  max-width: 1080px;
  margin-top: .45rem;
}

.respiratory-tools-waveforms .mobile-waveform-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: .75rem;
  margin-bottom: .85rem;
}

.respiratory-tools-waveforms .evidence-panel {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.respiratory-tools-waveforms .evidence-panel h2 {
  margin-bottom: .35rem;
}

.respiratory-tools-waveforms .evidence-panel p {
  margin: .35rem 0;
}

.respiratory-tools-waveforms .mechanical-ventilator-intro {
  display: grid;
  gap: .85rem;
  margin: .65rem 0 .85rem;
}

.respiratory-tools-waveforms .mechanical-ventilator-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #06111f;
}

.respiratory-tools-waveforms .mechanical-ventilator-video iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.respiratory-tools-waveforms .mechanical-ventilator-definition {
  padding: .75rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-waveforms .mechanical-ventilator-definition h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
  line-height: 1.12;
}

.respiratory-tools-waveforms .ventilator-menu-figure {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  margin: 0;
  padding: .65rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
}

.respiratory-tools-waveforms .ventilator-menu-figure img {
  display: block;
  width: min(128px, 34vw);
  height: auto;
  border-radius: 6px;
}

.respiratory-tools-waveforms .ventilator-menu-figure figcaption {
  display: grid;
  gap: .42rem;
  color: var(--rt-muted);
  font-size: .82rem;
  line-height: 1.18;
}

.respiratory-tools-waveforms .ventilator-menu-figure figcaption p {
  margin: 0;
}

.respiratory-tools-waveforms .evidence-card-grid {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(0, 1.22fr);
  gap: 1rem;
  align-items: stretch;
}

.respiratory-tools-waveforms .evidence-summary-card,
.respiratory-tools-waveforms .evidence-photo-card {
  min-width: 0;
  min-height: 0;
  padding: 1rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
  box-shadow: var(--rt-shadow);
}

.respiratory-tools-waveforms .evidence-summary-card {
  align-self: start;
}

.respiratory-tools-waveforms .evidence-photo-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: .75rem;
  max-height: min(610px, calc(100vh - 405px));
  overflow: hidden;
}

.image-gallery,
.method-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-container {
  overflow: hidden;
  padding: 0;
}

.image-container img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-container figcaption {
  padding: .75rem;
  color: var(--rt-muted);
  font-size: .9rem;
}

.respiratory-tools-waveforms .evidence-carousel-viewport {
  display: grid;
  gap: .75rem;
  min-height: 0;
}

.respiratory-tools-waveforms .evidence-item {
  display: none;
}

.respiratory-tools-waveforms .evidence-item[data-active="true"] {
  display: grid;
  min-height: 0;
}

.respiratory-tools-waveforms .evidence-set {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: .75rem;
  min-height: 0;
}

.respiratory-tools-waveforms .evidence-set .image-container {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.respiratory-tools-waveforms .evidence-set .image-container img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #f8fbff;
}

.respiratory-tools-waveforms .evidence-carousel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: flex-end;
}

.respiratory-tools-waveforms .evidence-carousel-counter {
  margin-right: auto;
  color: var(--rt-muted);
  font-weight: 900;
}

.respiratory-tools-waveforms .large-image-button {
  position: absolute;
  top: .75rem;
  right: .75rem;
  min-height: 34px;
  padding: .45rem .7rem;
  box-shadow: 0 8px 22px rgba(8, 26, 54, .16);
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
  box-shadow: var(--rt-shadow);
}

.respiratory-tools-waveforms .identify-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .36fr);
  gap: 1rem;
  align-items: start;
}

.respiratory-tools-waveforms .identify-card,
.respiratory-tools-waveforms .identify-score-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
  box-shadow: var(--rt-shadow);
}

.respiratory-tools-waveforms .identify-prompt-head {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}

.respiratory-tools-waveforms .identify-visual {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-bottom: .85rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
}

.respiratory-tools-waveforms .identify-pin-image {
  display: block;
  width: min(620px, 100%);
  height: auto;
  padding: .75rem;
  border-radius: var(--rt-radius);
  background: #fff;
}

.respiratory-tools-waveforms .identify-chart-shell {
  width: 100%;
  height: min(380px, 48vh);
  min-height: 260px;
  padding: .75rem;
  border-radius: var(--rt-radius);
  background: #fff;
}

.respiratory-tools-waveforms .identify-chart-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.respiratory-tools-waveforms .identify-chart-caption {
  width: 100%;
  margin: .65rem .75rem .75rem;
  color: var(--rt-muted);
  font-size: .92rem;
}

.respiratory-tools-waveforms .waveform-post-test .identify-layout {
  grid-template-columns: minmax(0, 1fr) minmax(240px, .28fr);
}

.respiratory-tools-waveforms .waveform-post-test .identify-card {
  display: grid;
  grid-template-rows: auto minmax(280px, 44vh) auto auto auto;
  gap: .75rem;
}

.respiratory-tools-waveforms .waveform-post-test .identify-visual {
  min-height: 0;
  margin-bottom: 0;
}

.respiratory-tools-waveforms .waveform-post-test .identify-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
}

@media (max-width: 760px) {
  .respiratory-tools-waveforms .waveform-post-test .identify-layout {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-waveforms .waveform-post-test .identify-card {
    grid-template-rows: auto minmax(180px, 30vh) auto auto auto;
  }

  .respiratory-tools-waveforms .waveform-post-test .identify-options {
    grid-template-columns: 1fr;
  }
}

.respiratory-tools-waveforms .identify-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .85rem;
}

.respiratory-tools-waveforms .identify-option {
  justify-content: flex-start;
  min-height: 48px;
  text-align: left;
}

.respiratory-tools-waveforms .identify-option.is-correct {
  border-color: rgba(12, 125, 70, .45);
  background: rgba(12, 125, 70, .12);
  color: #064f2b;
}

.respiratory-tools-waveforms .identify-option.is-incorrect {
  border-color: rgba(190, 42, 28, .45);
  background: rgba(190, 42, 28, .1);
  color: #8b1d12;
}

.respiratory-tools-waveforms .identify-actions {
  margin-top: .9rem;
}

.respiratory-tools-waveforms .identify-score-card .stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.respiratory-tools-waveforms .dashboard-controls {
  justify-content: space-between;
}

.respiratory-tools-waveforms .control-panel,
.respiratory-tools-waveforms .waveform-view-panel {
  min-width: 0;
}

.respiratory-tools-waveforms .waveform-view-panel {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rt-line);
  padding-bottom: .75rem;
}

.respiratory-tools-waveforms .waveform-overview-note {
  flex-basis: 100%;
  display: grid;
  gap: .25rem;
  max-width: 72ch;
}

.respiratory-tools-waveforms .waveform-overview-note h4,
.respiratory-tools-waveforms .waveform-overview-note p {
  margin: 0;
}

.respiratory-tools-waveforms .waveform-overview-note h4 {
  font-size: .98rem;
}

.respiratory-tools-waveforms .waveform-overview-note p {
  color: var(--rt-muted);
}

.dashboard-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .32fr);
  gap: 1rem;
  min-height: 0;
}

.respiratory-tools-waveforms .dashboard-content {
  grid-template-columns: minmax(0, 1fr);
}

.respiratory-tools-waveforms [hidden] {
  display: none !important;
}

.chart-container {
  display: flex;
  height: clamp(320px, 43vh, 480px);
  min-height: 0;
  flex-direction: column;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
  overflow: hidden;
}

.chart-title {
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--rt-line);
  color: var(--rt-text);
  font-size: .96rem;
}

.chart-wrapper {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: .5rem;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.waveform-slide[data-active="true"] {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .7fr);
  gap: .85rem;
  align-items: stretch;
}

.waveform-explainer {
  min-width: 0;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: #fff;
}

.respiratory-tools-waveforms .signal-specs {
  display: grid;
  grid-template-columns: 1fr;
  gap: .65rem;
  margin: .75rem 0 0;
}

.signal-specs dt {
  color: var(--rt-muted);
  font-weight: 800;
}

.signal-specs dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.data-table-container {
  min-height: 0;
  overflow: hidden;
}

.table-scroll-container {
  max-height: 620px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

th,
td {
  border-bottom: 1px solid var(--rt-line);
  padding: .42rem .5rem;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: var(--rt-panel-muted);
  color: var(--rt-muted);
}

body.respiratory-tools-waveforms.large-graph-open {
  overflow: hidden;
}

body.respiratory-tools-waveforms.large-image-open {
  overflow: hidden;
}

body.respiratory-tools-waveforms .large-graph-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 28px);
  background: rgba(7, 24, 48, .58);
}

body.respiratory-tools-waveforms .large-graph-overlay[hidden] {
  display: none !important;
}

body.respiratory-tools-waveforms .large-graph-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: .75rem;
  width: min(1500px, calc(100vw - 56px));
  height: min(900px, calc(100vh - 56px));
  min-height: 0;
  padding: 1rem;
  border: 1px solid rgba(190, 211, 235, .9);
  border-radius: calc(var(--rt-radius) + 2px);
  background: #fff;
  box-shadow: 0 24px 86px rgba(0, 0, 0, .35);
}

body.respiratory-tools-waveforms .large-graph-header,
body.respiratory-tools-waveforms .large-graph-footer {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
}

body.respiratory-tools-waveforms .large-graph-header h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.45rem);
}

body.respiratory-tools-waveforms .large-graph-header p {
  margin: .2rem 0 0;
  color: var(--rt-muted);
  font-weight: 800;
}

body.respiratory-tools-waveforms .large-graph-canvas-wrap {
  min-width: 0;
  min-height: 0;
  padding: .65rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
  overflow: hidden;
}

body.respiratory-tools-waveforms .large-graph-canvas-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

body.respiratory-tools-waveforms .large-graph-footer {
  justify-content: flex-end;
}

body.respiratory-tools-waveforms .large-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 2450;
  display: grid;
  place-items: center;
  padding: clamp(14px, 2vw, 28px);
  background: rgba(7, 24, 48, .58);
}

body.respiratory-tools-waveforms .large-image-overlay[hidden] {
  display: none !important;
}

body.respiratory-tools-waveforms .large-image-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: .75rem;
  width: min(1500px, calc(100vw - 56px));
  height: min(900px, calc(100vh - 56px));
  min-height: 0;
  padding: 1rem;
  border: 1px solid rgba(190, 211, 235, .9);
  border-radius: calc(var(--rt-radius) + 2px);
  background: #fff;
  box-shadow: 0 24px 86px rgba(0, 0, 0, .35);
}

body.respiratory-tools-waveforms .large-image-header {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: space-between;
}

body.respiratory-tools-waveforms .large-image-header h2 {
  margin: 0;
  font-size: clamp(1.05rem, 1.45vw, 1.45rem);
}

body.respiratory-tools-waveforms .large-image-header p {
  margin: .2rem 0 0;
  color: var(--rt-muted);
  font-weight: 800;
}

body.respiratory-tools-waveforms .large-image-frame {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  padding: .65rem;
  border: 1px solid var(--rt-line);
  border-radius: var(--rt-radius);
  background: var(--rt-panel-muted);
  overflow: auto;
}

body.respiratory-tools-waveforms .large-image-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.chart-container .graph-fullscreen-close {
  display: none;
}

.chart-container.fullscreen .graph-fullscreen-close {
  display: inline-flex;
}

.chart-container.fullscreen,
body.waveform-graph-fullscreen .chart-container.fullscreen {
  position: fixed;
  inset: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  z-index: 2000;
  min-height: 0;
  background: #fff;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .32);
}

.chart-container.fullscreen .chart-wrapper {
  min-height: 0;
}

.graph-fullscreen-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 2010;
}

.fullscreen-stack-controls {
  display: none;
}

body.waveform-graph-fullscreen .fullscreen-stack-controls {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 2010;
  display: flex;
  transform: translateX(-50%);
  gap: .5rem;
  padding: .45rem;
  border: 1px solid var(--rt-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--rt-shadow);
}

/* Compact calculator mode */
@media (max-width: 860px) {
  .wrap,
  .shell,
  .page-shell,
  .tool-shell,
  .paco2-calculator.tool-shell {
    width: min(100% - 20px, var(--rt-page-width));
    padding-top: 28px;
  }

  .layout,
  .respiratory-tools-exam-practice .shell,
  .dashboard-content,
  .waveform-slide[data-active="true"] {
    grid-template-columns: 1fr;
  }

  .portal-grid,
  .image-gallery,
  .method-grid,
  .respiratory-tools-waveforms .evidence-card-grid,
  .respiratory-tools-waveforms .identify-layout,
  .stats-grid,
  .summary-grid,
  .tool-grid,
  .waveform-grid,
  .patient-grid,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .field-row,
  .lock-grid {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-tidal-volume #practice-panel .patient-grid,
  .respiratory-tools-tidal-volume #practice-panel .answer-grid,
  .respiratory-tools-tidal-volume #practice-panel .button-row {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-page .calc-step {
    grid-template-columns: 1fr;
    gap: .35rem;
  }

  .respiratory-tools-page .calc-step-result {
    text-align: left;
  }

  .value-display,
  .field-row strong {
    text-align: left;
  }

  .hero h1,
  .intro h1,
  .tool-shell > header h1,
  .paco2-calculator h1 {
    font-size: clamp(1.75rem, 10vw, 3rem);
  }

  .respiratory-tools-waveforms .evidence-photo-card {
    max-height: none;
  }

  .respiratory-tools-waveforms .evidence-set .image-container img {
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .respiratory-tools-waveforms .identify-options,
  .respiratory-tools-waveforms .identify-score-card .stats-grid {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-achievements .wrap {
    width: min(100% - 20px, var(--rt-page-width));
  }

  .respiratory-tools-achievements .aggregate-head,
  .respiratory-tools-achievements .waveform-row {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-achievements .aggregate-head {
    display: grid;
    align-items: start;
  }

  .respiratory-tools-achievements .metric-row {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-achievements .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .respiratory-tools-achievements .record-fact-grid {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-achievements .record-card-head,
  .respiratory-tools-achievements .certificate-row {
    display: grid;
    justify-content: stretch;
  }

  .respiratory-tools-achievements .record-tabs {
    grid-template-columns: 1fr;
  }

  .respiratory-tools-achievements .course-state-grid {
    grid-template-columns: 1fr;
  }

  body.respiratory-tools-waveforms .large-graph-overlay {
    padding: 10px;
  }

  body.respiratory-tools-waveforms .large-graph-card {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
    padding: .75rem;
  }

  body.respiratory-tools-waveforms .large-graph-footer {
    justify-content: flex-start;
  }
}

@media (max-width: 480px), (max-height: 760px) {
  body.respiratory-tools-page:has(.tool-shell) {
    overflow-x: hidden;
  }

  .tool-shell,
  .paco2-calculator.tool-shell {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    height: 100dvh;
    padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    overflow: hidden;
  }

  .tool-shell > header,
  .paco2-calculator.tool-shell .intro {
    display: grid;
    gap: 4px;
    min-height: 0;
    margin: 0;
  }

  .tool-shell h1,
  .paco2-calculator.tool-shell h1 {
    font-size: clamp(1.1rem, 5vw, 1.45rem);
    line-height: 1.08;
  }

  .tool-shell h1[data-compact-title],
  .paco2-calculator.tool-shell h1[data-compact-title] {
    font-size: 0;
  }

  .tool-shell h1[data-compact-title]::after,
  .paco2-calculator.tool-shell h1[data-compact-title]::after {
    content: attr(data-compact-title);
    font-size: clamp(1.1rem, 5vw, 1.45rem);
  }

  .subtitle,
  .hero-copy,
  .paco2-calculator.tool-shell .intro > p:not(.note-box) {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--rt-muted);
    font-size: .82rem;
    line-height: 1.18;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .tabs {
    margin: 0;
  }

  .tab-panel.active,
  .tool-shell #calculator-content,
  .paco2-calculator.tool-shell #calculator-content,
  .practice-shell {
    min-height: 0;
    overflow: hidden;
    display: grid;
  }

  .tool-shell .layout,
  .paco2-calculator.tool-shell .layout {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    grid-template-rows: minmax(0, .85fr) minmax(0, 1.15fr);
  }

  .tool-shell .section,
  .tool-shell .control-card,
  .tool-shell .card,
  .tool-shell .calc-card,
  .tool-shell .question-card,
  .tool-shell .stat-card,
  .paco2-calculator.tool-shell .section,
  .paco2-calculator.tool-shell .card,
  .paco2-calculator.tool-shell .calc-card,
  .paco2-calculator.tool-shell .question-card,
  .paco2-calculator.tool-shell .stat-card {
    padding: 8px;
  }

  .tool-shell .layout > .section,
  .paco2-calculator.tool-shell .layout > .section {
    min-height: 0;
    overflow: auto;
  }

  .calculation-slide,
  .waveform-slide {
    overflow: auto;
  }

  .button-row,
  .gallery-controls,
  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button-row button,
  .gallery-controls button,
  .actions button {
    width: 100%;
  }

  .tool-support-details {
    display: block;
  }

  .compact-hide,
  .source-note {
    display: none !important;
  }
}

/* Waveform phone zine shell: title/progress header, page content center, navigation bottom. */
@media (max-width: 600px) {
  html:has(body.respiratory-tools-waveforms),
  body.respiratory-tools-waveforms {
    height: 100%;
    overflow: hidden;
  }

  .respiratory-tools-waveforms .page-shell {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding: max(6px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    display: grid;
    grid-template-areas:
      "title"
      "progress"
      "zine"
      "nav";
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: .34rem;
    overflow: hidden;
  }

  .respiratory-tools-waveforms .top-link {
    display: none;
  }

  .respiratory-tools-waveforms .source-note {
    display: none !important;
  }

  .respiratory-tools-waveforms .hero {
    grid-area: title;
    min-height: 0;
    margin-bottom: 0;
    padding: .42rem .52rem;
    border: 1px solid rgba(191, 208, 223, .84);
    border-radius: var(--rt-radius);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--rt-shadow-sm);
  }

  .respiratory-tools-waveforms .hero h1 {
    font-size: clamp(1rem, 5.25vw, 1.46rem);
    line-height: 1;
  }

  .respiratory-tools-waveforms .hero p {
    display: none;
  }

  .respiratory-tools-waveforms [data-course-audit-progress] {
    grid-area: progress;
    min-height: 0;
    margin: 0;
  }

  .respiratory-tools-waveforms .audit-progress-panel {
    padding: .34rem .46rem;
    border-radius: 8px;
    gap: .28rem;
  }

  .respiratory-tools-waveforms .audit-progress-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .35rem;
    align-items: center;
    margin-bottom: 0;
  }

  .respiratory-tools-waveforms .audit-progress-head .section-title {
    font-size: .82rem;
    line-height: 1.05;
  }

  .respiratory-tools-waveforms .audit-progress-head .section-title::before {
    width: .42rem;
    height: .42rem;
  }

  .respiratory-tools-waveforms .audit-progress-state {
    overflow: hidden;
    color: var(--rt-muted);
    font-size: .68rem;
    line-height: 1;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .respiratory-tools-waveforms .audit-progress-toggle {
    display: inline-grid;
    place-items: center;
    min-height: 24px;
    padding: .25rem .45rem;
    border-radius: 999px;
    font-size: .68rem;
  }

  .respiratory-tools-waveforms .audit-progress-panel:not(.is-expanded) .audit-progress-grid {
    display: none;
  }

  .respiratory-tools-waveforms .audit-progress-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
  }

  .respiratory-tools-waveforms .audit-progress-item {
    padding: .38rem;
    border-radius: 8px;
  }

  .respiratory-tools-waveforms .audit-progress-row {
    display: grid;
    gap: .2rem;
  }

  .respiratory-tools-waveforms .audit-progress-row span {
    font-size: .7rem;
  }

  .respiratory-tools-waveforms .audit-progress-row strong {
    font-size: .78rem;
  }

  .respiratory-tools-waveforms .audit-progress-bar {
    height: 8px;
    margin-top: .35rem;
  }

  .respiratory-tools-waveforms .mobile-waveform-tabs {
    grid-area: nav;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 2.4rem;
    grid-template-columns: none;
    gap: .28rem;
    margin: 0;
    padding: .3rem;
    border: 1px solid rgba(191, 208, 223, .9);
    border-radius: var(--rt-radius);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -8px 26px rgba(16, 33, 58, .08);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .respiratory-tools-waveforms .mobile-waveform-tabs button {
    display: inline-grid;
    place-items: center;
    min-height: 40px;
    padding: .32rem .24rem;
    border-color: var(--rt-line-strong);
    background: #fff;
    color: var(--rt-muted);
    font-size: .84rem;
    line-height: 1.05;
  }

  .respiratory-tools-waveforms .mobile-waveform-tabs button[aria-selected="true"] {
    border-color: var(--rt-accent);
    background: var(--rt-accent);
    color: #fff;
  }

  .respiratory-tools-waveforms .mobile-waveform-tabs button[aria-selected="true"]::before {
    color: rgba(255, 255, 255, .86);
  }

  body.mobile-zine-active .mobile-waveform-tabs button::before {
    content: none;
  }

  .respiratory-tools-waveforms .evidence-panel,
  .respiratory-tools-waveforms .dashboard-container {
    grid-area: zine;
    min-height: 0;
    height: 100%;
    margin-top: 0;
    border-radius: var(--rt-radius);
    overflow: hidden;
  }

  .respiratory-tools-waveforms .evidence-panel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-columns: none;
    gap: .65rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .respiratory-tools-waveforms .evidence-panel > * {
    min-width: 0;
    min-height: 0;
    padding: .72rem;
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius);
    background: #fff;
    box-shadow: var(--rt-shadow);
    overflow: auto;
    scroll-snap-align: start;
  }

  .respiratory-tools-waveforms .evidence-summary-card,
  .respiratory-tools-waveforms .evidence-panel > p,
  .respiratory-tools-waveforms .method-card,
  .respiratory-tools-waveforms .image-container figcaption {
    font-size: .78rem;
    line-height: 1.22;
  }

  .respiratory-tools-waveforms .evidence-panel > h2 {
    display: none;
  }

  .respiratory-tools-waveforms .evidence-card-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-columns: none;
    gap: .55rem;
    min-height: 0;
    align-items: start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
    scrollbar-width: thin;
  }

  .respiratory-tools-waveforms .evidence-summary-card,
  .respiratory-tools-waveforms .evidence-photo-card {
    min-height: 0;
    padding: .72rem;
    overflow: hidden;
    scroll-snap-align: start;
  }

  .respiratory-tools-waveforms .evidence-summary-card {
    height: auto;
    max-height: 100%;
    overflow: auto;
  }

  .respiratory-tools-waveforms .evidence-summary-card h2 {
    font-size: .95rem;
    line-height: 1.08;
  }

	  .respiratory-tools-waveforms .evidence-summary-card p {
	    font-size: .72rem;
	    line-height: 1.18;
	  }

	  .respiratory-tools-waveforms .mechanical-ventilator-intro {
	    gap: .45rem;
	    margin: .45rem 0 .55rem;
	  }

	  .respiratory-tools-waveforms .mechanical-ventilator-definition {
	    padding: .46rem;
	  }

	  .respiratory-tools-waveforms .mechanical-ventilator-definition h3 {
	    margin-bottom: .22rem;
	    font-size: .78rem;
	    line-height: 1.08;
	  }

	  .respiratory-tools-waveforms .mechanical-ventilator-definition .small-note {
	    font-size: .62rem;
	  }

	  .respiratory-tools-waveforms .ventilator-menu-figure {
	    gap: .42rem;
	    padding: .42rem;
	  }

	  .respiratory-tools-waveforms .ventilator-menu-figure img {
	    width: min(96px, 30vw);
	  }

	  .respiratory-tools-waveforms .ventilator-menu-figure figcaption {
	    font-size: .62rem;
	    line-height: 1.12;
	  }

	  .respiratory-tools-waveforms .evidence-photo-card {
	    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    gap: .5rem;
  }

  body.mobile-zine-active[data-mobile-zine-type="summary"] .evidence-card-grid,
  body.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-card-grid {
    display: block;
    height: 100%;
    overflow: hidden;
  }

  body.mobile-zine-active[data-mobile-zine-type="summary"] .evidence-summary-card,
  body.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-photo-card {
    height: 100%;
  }

  body.mobile-zine-active[data-mobile-zine-type="summary"] .evidence-photo-card,
  body.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-summary-card {
    display: none;
  }

  body.mobile-zine-active .evidence-carousel-controls,
  body.mobile-zine-active .waveform-view-panel,
  body.mobile-zine-active .waveform-dots {
    display: none !important;
  }

  .respiratory-tools-waveforms .evidence-carousel-viewport,
  .respiratory-tools-waveforms .evidence-item[data-active="true"],
  .respiratory-tools-waveforms .evidence-set,
  .respiratory-tools-waveforms .evidence-set .image-container {
    min-height: 0;
    height: 100%;
  }

  .respiratory-tools-waveforms .evidence-set {
    overflow: hidden;
  }

  .respiratory-tools-waveforms .evidence-set-image {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .45rem;
  }

  .respiratory-tools-waveforms .evidence-set-image .image-container {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .respiratory-tools-waveforms .evidence-set-image .image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .respiratory-tools-waveforms .evidence-set-image .image-container figcaption {
    max-height: 3.6em;
    overflow: auto;
    padding: .42rem;
    font-size: .7rem;
    line-height: 1.18;
  }

  .respiratory-tools-waveforms .evidence-set-image .method-card {
    max-height: 5.6em;
    padding: .52rem;
    overflow: auto;
    box-shadow: none;
    font-size: .72rem;
    line-height: 1.18;
  }

  .respiratory-tools-waveforms .evidence-set-text {
    display: grid;
    align-content: center;
    padding: 1rem;
    font-size: .9rem;
    line-height: 1.22;
  }

  .respiratory-tools-waveforms .evidence-set-text .method-card {
    height: auto;
    padding: .75rem;
    box-shadow: none;
  }

  .respiratory-tools-waveforms .evidence-carousel-controls {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .34rem;
    align-items: center;
  }

  .respiratory-tools-waveforms .evidence-carousel-controls button {
    min-height: 36px;
    padding: .45rem .6rem;
    font-size: .82rem;
  }

  .respiratory-tools-waveforms .evidence-carousel-counter {
    min-width: 0;
    margin-right: 0;
    overflow: hidden;
    font-size: .82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .respiratory-tools-waveforms .evidence-panel h2,
  .respiratory-tools-waveforms .dashboard-section-title {
    font-size: 1rem;
    line-height: 1.08;
  }

  .respiratory-tools-waveforms .evidence-panel > p,
  .respiratory-tools-waveforms .dashboard-header h3 {
    font-size: .78rem;
    line-height: 1.22;
  }

  .respiratory-tools-waveforms .image-gallery,
  .respiratory-tools-waveforms .method-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(82vw, 1fr);
    grid-template-columns: none;
    gap: .75rem;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .respiratory-tools-waveforms .image-gallery > *,
  .respiratory-tools-waveforms .method-grid > * {
    min-height: 0;
    overflow: auto;
    scroll-snap-align: start;
  }

  .respiratory-tools-waveforms .image-container img {
    aspect-ratio: 16 / 10;
  }

  .respiratory-tools-waveforms .image-container figcaption,
  .respiratory-tools-waveforms .method-card {
    font-size: .86rem;
  }

  .respiratory-tools-waveforms .dashboard-container {
    padding: .54rem;
    gap: .52rem;
  }

  .respiratory-tools-waveforms #waveform-explore-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .respiratory-tools-waveforms #fullscreen-stack-controls-dock {
    display: none;
  }

  .respiratory-tools-waveforms #waveform-explore-panel > .dashboard-header,
  .respiratory-tools-waveforms #waveform-explore-panel > .dashboard-controls,
  .respiratory-tools-waveforms #waveform-explore-panel > .dashboard-content {
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: .85rem;
    border: 1px solid var(--rt-line);
    border-radius: var(--rt-radius);
    background: #fff;
    box-shadow: var(--rt-shadow-sm);
    overflow: hidden;
  }

  .respiratory-tools-waveforms #waveform-explore-panel > .dashboard-header {
    display: none;
  }

  .respiratory-tools-waveforms #waveform-explore-panel > .dashboard-controls {
    height: auto;
    padding: .34rem;
  }

  .respiratory-tools-waveforms #waveform-explore-panel > .dashboard-content {
    flex: 1;
    padding: .46rem;
  }

  .respiratory-tools-waveforms .dashboard-container > .dashboard-content,
  .respiratory-tools-waveforms .dashboard-container > .identify-layout {
    flex: 1;
    min-height: 0;
  }

  .respiratory-tools-waveforms .dashboard-header {
    min-height: 0;
    gap: .45rem;
    padding-bottom: .5rem;
  }

  .respiratory-tools-waveforms .dashboard-header h3 {
    display: none;
  }

  .respiratory-tools-waveforms .dashboard-controls {
    display: grid;
    gap: .28rem;
    align-content: start;
  }

  .respiratory-tools-waveforms .control-panel,
  .respiratory-tools-waveforms .waveform-view-panel,
  .respiratory-tools-waveforms .waveform-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .28rem;
    width: 100%;
    margin-left: 0;
  }

  .respiratory-tools-waveforms .control-panel button,
  .respiratory-tools-waveforms .waveform-controls button {
    min-height: 28px;
    padding: .28rem .22rem;
    font-size: .64rem;
  }

  .respiratory-tools-waveforms .speed-indicator,
  .respiratory-tools-waveforms .waveform-step-counter {
    grid-column: 1 / -1;
    justify-self: start;
    font-size: .66rem;
  }

  .respiratory-tools-waveforms .waveform-gallery {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-x;
  }

  .respiratory-tools-waveforms .waveform-gallery-viewport {
    height: auto;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .respiratory-tools-waveforms .waveform-slide[data-active="true"] {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-columns: none;
    gap: .5rem;
    align-items: stretch;
    overflow: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    touch-action: pan-x;
  }

  .respiratory-tools-waveforms .chart-container,
  .respiratory-tools-waveforms .waveform-explainer {
    min-width: 0;
    height: 100%;
    scroll-snap-align: start;
  }

  .respiratory-tools-waveforms .chart-container {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    max-height: 100%;
    min-height: 0;
  }

  .respiratory-tools-waveforms .chart-title {
    padding: .38rem .5rem;
    font-size: .78rem;
  }

  .respiratory-tools-waveforms .chart-wrapper {
    min-height: 0;
    height: auto;
    max-height: 100%;
    contain: layout size;
    padding: .25rem;
  }

  .respiratory-tools-waveforms .chart-wrapper canvas {
    display: block;
    max-width: 100% !important;
    max-height: 100% !important;
  }

  .respiratory-tools-waveforms .waveform-explainer {
    max-height: 100%;
    padding: .75rem;
  }

  .respiratory-tools-waveforms .signal-specs {
    gap: .45rem;
  }

  .respiratory-tools-waveforms .waveform-dots {
    z-index: 2;
    gap: .36rem;
    margin-top: .3rem;
    padding: .25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
  }

  .respiratory-tools-waveforms .waveform-dot {
    width: 10px;
    height: 10px;
  }

  .respiratory-tools-waveforms .data-table-container {
    display: none;
  }

	  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] #waveform-explore-panel > .dashboard-header {
	    display: grid;
	    align-content: center;
	    gap: .65rem;
	    overflow: auto;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] #waveform-explore-panel > .dashboard-header h3 {
	    display: block;
	    color: var(--rt-muted);
	    font-size: .82rem;
	    line-height: 1.22;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] .waveform-overview-note {
	    gap: .32rem;
	    max-width: none;
	    padding-top: .2rem;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] .waveform-overview-note h4 {
	    font-size: .88rem;
	    line-height: 1.12;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] .waveform-overview-note p {
	    font-size: .78rem;
	    line-height: 1.2;
	  }

  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] #waveform-explore-panel > .dashboard-content,
  body.mobile-zine-active[data-mobile-zine-type="explore-intro"] .data-table-container,
  body.mobile-zine-active[data-mobile-zine-type="data"] #waveform-explore-panel > .dashboard-header,
  body.mobile-zine-active[data-mobile-zine-type="data"] #waveform-explore-panel > .dashboard-controls,
  body.mobile-zine-active[data-mobile-zine-type="data"] #waveform-explore-panel > .dashboard-content {
    display: none;
  }

	  body.mobile-zine-active[data-mobile-zine-type="data"] .data-table-container {
	    display: block;
	    height: 100%;
	    overflow: auto;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="data"] .data-table-container h3 {
	    margin: 0 0 .55rem;
	    font-size: 1.08rem;
	    line-height: 1.1;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="data"] #dataTable {
	    width: 100%;
	    min-width: 0;
	    table-layout: fixed;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="data"] #dataTable th,
	  body.mobile-zine-active[data-mobile-zine-type="data"] #dataTable td {
	    padding: .34rem .28rem;
	    overflow: hidden;
	    font-size: .62rem;
	    line-height: 1.08;
	    text-overflow: ellipsis;
	    white-space: nowrap;
	  }

  .respiratory-tools-waveforms .identify-layout {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-template-columns: none;
    gap: .7rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-layout {
    display: block;
    overflow: hidden;
  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-card {
	    display: block;
	    height: 100%;
	    overflow: auto;
	  }

  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-score-card,
  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-actions {
    display: none;
  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-visual {
	    min-height: 0;
	    max-height: none;
	    margin: .45rem 0 .55rem;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-pin-image {
	    min-height: 0;
	    padding: .28rem;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .identify-pin-image svg {
	    display: block;
	    width: 100%;
	    height: auto;
	    max-height: 82px;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] img.identify-pin-image {
	    width: 100%;
	    max-height: 82px;
	    object-fit: contain;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] #identify-question {
	    display: none;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .mobile-identify-question-list {
	    display: grid;
	    gap: .52rem;
	    margin: 0;
	    padding-left: 1rem;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .mobile-identify-question-list li {
	    display: grid;
	    gap: .34rem;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .mobile-identify-question-list strong {
	    font-size: .68rem;
	    line-height: 1.14;
	  }

	  body.mobile-zine-active[data-mobile-zine-type="identify"] .mobile-identify-choice-list {
	    display: grid;
	    grid-template-columns: 1fr;
	    gap: .24rem;
	  }

  .respiratory-tools-waveforms .identify-card,
  .respiratory-tools-waveforms .identify-score-card {
    min-height: 0;
    padding: .75rem;
    overflow: hidden;
    scroll-snap-align: start;
  }

  .respiratory-tools-waveforms .identify-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    gap: .24rem;
  }

  .respiratory-tools-waveforms .identify-prompt-head {
    margin-bottom: 0;
  }

  .respiratory-tools-waveforms .identify-prompt-head .zbc-kicker,
  .respiratory-tools-waveforms .identify-prompt-head strong {
    font-size: .72rem;
  }

  .respiratory-tools-waveforms .identify-visual {
    min-height: 0;
    margin-bottom: 0;
    overflow: hidden;
  }

  .respiratory-tools-waveforms .identify-chart-shell {
    height: 100%;
    min-height: 0;
    padding: .24rem;
  }

  .respiratory-tools-waveforms .identify-chart-caption {
    display: none;
  }

  .respiratory-tools-waveforms #identify-question {
    display: -webkit-box;
    overflow: hidden;
    font-size: .62rem;
    line-height: 1.08;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .respiratory-tools-waveforms .identify-pin-image {
    padding: .45rem;
  }

  .respiratory-tools-waveforms .identify-options,
  .respiratory-tools-waveforms .identify-score-card .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .32rem;
  }

  .respiratory-tools-waveforms .identify-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .32rem;
  }

	  .respiratory-tools-waveforms .identify-option {
	    min-height: 26px;
	    padding: .22rem .28rem;
	    font-size: .58rem;
	    line-height: 1.1;
	  }

  .respiratory-tools-waveforms .identify-actions button {
    min-height: 28px;
    padding: .28rem .34rem;
    font-size: .62rem;
  }

	  body.respiratory-tools-waveforms .large-graph-card,
	  body.respiratory-tools-waveforms .large-image-card {
	    width: calc(100vw - 16px);
	    height: calc(100dvh - 16px);
	    padding: .6rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-carousel-controls,
	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-carousel-controls button,
	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-carousel-counter,
	  body.respiratory-tools-waveforms.mobile-zine-active .dashboard-controls,
	  body.respiratory-tools-waveforms.mobile-zine-active .control-panel,
	  body.respiratory-tools-waveforms.mobile-zine-active .waveform-view-panel,
	  body.respiratory-tools-waveforms.mobile-zine-active .waveform-controls,
	  body.respiratory-tools-waveforms.mobile-zine-active .waveform-dots {
	    display: none !important;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] #waveform-explore-panel > .dashboard-content {
	    padding: .34rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] #waveform-explore-panel > .dashboard-controls {
	    display: block !important;
	    height: auto;
	    padding: .24rem;
	    overflow: hidden;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .control-panel {
	    display: grid !important;
	    grid-auto-flow: column;
	    grid-auto-columns: max-content;
	    grid-template-columns: none;
	    gap: .18rem;
	    align-items: center;
	    overflow-x: auto;
	    overscroll-behavior-x: contain;
	    scrollbar-width: none;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .control-panel button {
	    min-height: 26px;
	    padding: .22rem .38rem;
	    border-radius: 7px;
	    font-size: .54rem;
	    line-height: 1.05;
	    white-space: nowrap;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .control-panel .speed-indicator {
	    align-self: center;
	    font-size: .56rem;
	    line-height: 1.05;
	    white-space: nowrap;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-gallery,
	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-gallery-viewport,
	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-gallery-track {
	    height: 100%;
	    min-height: 0;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-slide[data-active="true"] {
	    display: grid;
	    grid-template-rows: minmax(0, 1fr) minmax(5rem, 22%);
	    gap: .34rem;
	    height: 100%;
	    overflow: hidden;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-slide[data-active="true"] .waveform-explainer {
	    display: block;
	    height: 100%;
	    max-height: none;
	    padding: .46rem;
	    overflow: auto;
	    font-size: .62rem;
	    line-height: 1.14;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-explainer h4 {
	    margin-bottom: .22rem;
	    font-size: .72rem;
	    line-height: 1.08;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-explainer p {
	    margin-bottom: .28rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-explainer .signal-specs {
	    display: grid;
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	    gap: .24rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-explainer dt,
	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .waveform-explainer dd {
	    font-size: .58rem;
	    line-height: 1.1;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .chart-container {
	    height: 100%;
	    max-height: 100%;
	    overflow: hidden;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .chart-title {
	    padding: .36rem .48rem;
	    font-size: .72rem;
	    line-height: 1.08;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="waveform"] .chart-wrapper {
	    height: 100%;
	    min-height: 0;
	    padding: .18rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-photo-card,
	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-carousel-viewport,
	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-item[data-active="true"],
	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set {
	    height: 100%;
	    min-height: 0;
	    overflow: hidden;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set-image {
	    display: grid;
	    grid-template-rows: minmax(0, 1fr) minmax(4.15rem, auto);
	    gap: .42rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set-image .image-container {
	    height: auto;
	    min-height: 0;
	    overflow: hidden;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set-image .image-container img {
	    display: block;
	    width: 100%;
	    height: 100%;
	    max-height: 100%;
	    object-fit: contain;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set-image .image-container figcaption {
	    max-height: 2.7em;
	    padding: .34rem;
	    overflow: auto;
	    font-size: .64rem;
	    line-height: 1.12;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set-image .method-card {
	    max-height: 4.4rem;
	    padding: .42rem;
	    overflow: auto;
	    font-size: .64rem;
	    line-height: 1.12;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="evidence"] .evidence-set-image .method-card h3 {
	    margin-bottom: .16rem;
	    font-size: .78rem;
	    line-height: 1.06;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .identify-card {
	    display: grid;
	    grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
	    gap: .42rem;
	    height: 100%;
	    overflow: hidden;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .identify-visual {
	    margin: 0;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] #identify-question {
	    display: block;
	    overflow: visible;
	    font-size: .82rem;
	    line-height: 1.12;
	    -webkit-line-clamp: unset;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .identify-options {
	    display: grid;
	    grid-template-columns: 1fr;
	    gap: .28rem;
	    min-height: 0;
	    overflow: auto;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .identify-option {
	    min-height: 30px;
	    padding: .34rem .42rem;
	    font-size: .66rem;
	    line-height: 1.08;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .feedback {
	    min-height: 1.15rem;
	    font-size: .62rem;
	    line-height: 1.12;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .identify-actions {
	    display: grid;
	    grid-template-columns: 1fr 1fr;
	    gap: .3rem;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active[data-mobile-zine-type="identify"] .identify-actions button {
	    min-height: 28px;
	    padding: .3rem .36rem;
	    font-size: .6rem;
	    line-height: 1.05;
	  }

	  body.respiratory-tools-waveforms.mobile-zine-active #waveform-collect-panel,
	  body.respiratory-tools-waveforms.mobile-zine-active #waveform-explore-panel,
	  body.respiratory-tools-waveforms.mobile-zine-active #waveform-identify-panel,
	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-card-grid,
	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-summary-card,
	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-photo-card,
	  body.respiratory-tools-waveforms.mobile-zine-active .evidence-carousel-viewport,
	  body.respiratory-tools-waveforms.mobile-zine-active .dashboard-content,
	  body.respiratory-tools-waveforms.mobile-zine-active .waveform-gallery,
	  body.respiratory-tools-waveforms.mobile-zine-active .waveform-slide[data-active="true"],
	  body.respiratory-tools-waveforms.mobile-zine-active .data-table-container,
	  body.respiratory-tools-waveforms.mobile-zine-active .identify-card,
	  body.respiratory-tools-waveforms.mobile-zine-active .identify-layout {
	    touch-action: pan-y;
	  }
	}

@media (max-width: 430px) {
  .respiratory-tools-waveforms .page-shell {
    padding-inline: max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right));
  }

  .respiratory-tools-waveforms .hero h1 {
    font-size: clamp(1.16rem, 6.4vw, 1.55rem);
  }

  .respiratory-tools-waveforms .hero p {
    font-size: .82rem;
    -webkit-line-clamp: 1;
  }

  .respiratory-tools-waveforms .dashboard-header h3,
  .respiratory-tools-waveforms .evidence-panel > p {
    -webkit-line-clamp: 1;
  }

  .respiratory-tools-waveforms .control-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .respiratory-tools-waveforms .waveform-view-panel {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
  }

  .respiratory-tools-waveforms .waveform-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .respiratory-tools-waveforms .chart-container {
    height: 100%;
  }

  .respiratory-tools-waveforms .waveform-explainer {
    max-height: 100%;
  }

  .respiratory-tools-waveforms .image-gallery,
  .respiratory-tools-waveforms .method-grid {
    grid-auto-columns: minmax(88vw, 1fr);
  }

  .respiratory-tools-waveforms .identify-chart-shell {
    height: 100%;
    min-height: 0;
  }
}

@media (max-width: 380px), (max-height: 740px) {
  .respiratory-tools-waveforms .page-shell {
    padding-top: max(4px, env(safe-area-inset-top));
  }

  .respiratory-tools-waveforms .hero {
    margin-bottom: .3rem;
  }

  .respiratory-tools-waveforms .hero h1 {
    font-size: clamp(1.2rem, 7vw, 1.55rem);
  }

  .respiratory-tools-waveforms .hero p,
  .respiratory-tools-waveforms .dashboard-header h3,
  .respiratory-tools-waveforms .evidence-panel > p,
  .respiratory-tools-waveforms .source-note {
    display: none !important;
  }

  .respiratory-tools-waveforms .mobile-waveform-tabs button,
  .respiratory-tools-waveforms .control-panel button,
  .respiratory-tools-waveforms .waveform-controls button {
    min-height: 28px;
    padding: .28rem .22rem;
    font-size: .64rem;
  }

  .respiratory-tools-waveforms .dashboard-container {
    padding: .5rem;
  }

  .respiratory-tools-waveforms .chart-container {
    height: 100%;
  }

  .respiratory-tools-waveforms .waveform-explainer {
    max-height: 100%;
    padding: .6rem;
  }

  .respiratory-tools-waveforms .identify-chart-shell {
    height: 100%;
    min-height: 0;
  }

  .respiratory-tools-waveforms .identify-prompt-head,
  .respiratory-tools-waveforms .identify-actions {
    gap: .4rem;
  }
}

@media print {
  @page {
    margin: .45in;
  }

  body.respiratory-tools-page {
    background: #fff;
    color: #000;
  }

  .top-link,
  .tabs,
  .button-row,
  .actions,
  .dashboard-controls,
  .mobile-waveform-tabs {
    display: none !important;
  }

  .tab-panel,
  .certificate,
  .print-certificate {
    display: block !important;
  }

  .section,
  .card,
  .stat-card,
  .aggregate-panel,
  .certificate {
    box-shadow: none;
  }

  body.respiratory-tools-achievements .wrap {
    width: 100%;
    padding: 0;
  }

  body.respiratory-tools-achievements .wrap > :not(.print-certificate) {
    display: none !important;
  }

  body.respiratory-tools-achievements .print-certificate {
    display: grid !important;
    gap: .18rem;
    font-size: 10pt;
    line-height: 1.18;
  }

  body.respiratory-tools-achievements .print-document {
    display: none !important;
  }

  body.respiratory-tools-achievements .print-document.active {
    display: block !important;
  }

  body.respiratory-tools-achievements .print-certificate p,
  body.respiratory-tools-achievements .print-certificate h2,
  body.respiratory-tools-achievements .print-certificate h3 {
    margin: 0;
  }

  body.respiratory-tools-achievements .print-certificate h2 {
    font-size: 18pt;
    line-height: 1.05;
  }

  body.respiratory-tools-achievements .print-course-title {
    margin: .05rem 0 .12rem;
    font-size: 14pt;
    line-height: 1.1;
  }

  body.respiratory-tools-achievements .print-name {
    margin: .05rem 0;
    font-size: 15pt;
    font-weight: 900;
  }

  body.respiratory-tools-achievements #printLearningRecord .print-summary {
    display: none;
  }

  body.respiratory-tools-achievements .certificate-print-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .12rem;
    margin: .15rem 0;
  }

  body.respiratory-tools-achievements .print-detail {
    display: grid;
    gap: .08rem;
    padding: .25rem .3rem;
    border: 1px solid #bbb;
  }

  body.respiratory-tools-achievements .print-detail strong {
    font-size: 13pt;
    line-height: 1;
  }

  body.respiratory-tools-achievements .print-breakdown {
    display: grid;
    gap: .12rem;
    margin-top: .15rem;
    font-size: 9.5pt;
  }

  body.respiratory-tools-achievements .print-breakdown div {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
