@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500&display=swap");

:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --surface-2: #e9e5db;
  --ink: #0f262e;
  --muted: #506063;
  --line: #c5cbc7;
  --control-line: #7a898c;
  --coral: #bd432f;
  --coral-pale: #f8ded5;
  --green: #156f63;
  --green-pale: #dcece6;
  --amber: #a46714;
  --amber-pale: #f4e9cc;
  --danger: #b43838;
  --danger-pale: #f4dede;
  --shadow: 0 18px 45px rgba(20, 49, 59, .08);
  --font-sans: "Manrope", system-ui, sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  --font-mono: "DM Mono", monospace;
}

.dark {
  color-scheme: dark;
  --paper: #10262e;
  --surface: #17343e;
  --surface-2: #1d3d47;
  --ink: #f0f4f2;
  --muted: #b5c5c4;
  --line: #58727b;
  --control-line: #81969c;
  --coral: #ff866d;
  --green: #62d8c9;
  --amber: #ffc96b;
  --danger: #ff9393;
  --coral-pale: #55342f;
  --green-pale: #1f4a45;
  --amber-pale: #4d4027;
  --danger-pale: #513030;
  --shadow: 0 18px 45px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  min-width: 320px;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.app-header {
  align-items: center;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 76px;
  padding: 0 clamp(20px, 4vw, 64px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 18px;
  gap: 11px;
  text-decoration: none;
  width: fit-content;
}

.brand-mark {
  align-items: flex-end;
  background: var(--ink);
  border-radius: 8px;
  display: flex;
  gap: 3px;
  height: 31px;
  justify-content: center;
  padding: 8px 7px;
  width: 31px;
}

.brand-mark i {
  background: var(--coral);
  display: block;
  height: 6px;
  transform: skewY(-35deg);
  width: 3px;
}
.brand-mark i:nth-child(2) { height: 16px; transform: skewY(35deg); }
.brand-mark i:nth-child(3) { height: 10px; }

.mode-switch {
  background: var(--surface-2);
  border-radius: 999px;
  display: flex;
  padding: 4px;
}

.mode-switch button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
}

.mode-switch button.active {
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 4px 12px rgba(20, 49, 59, .12);
}

.header-actions { align-items: center; display: flex; gap: 9px; justify-content: flex-end; }
.icon-button, .case-browser-button, .tool-button, .secondary-button {
  background: var(--surface);
  border: 1.5px solid var(--control-line);
  color: var(--ink);
}
.icon-button {
  align-items: center;
  border-radius: 50%;
  display: flex;
  font-size: 19px;
  height: 39px;
  justify-content: center;
  width: 39px;
}
.case-browser-button {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
}
.case-browser-button span {
  background: var(--coral);
  border-radius: 50%;
  color: white;
  display: inline-grid;
  font-family: var(--font-mono);
  font-size: 10px;
  height: 19px;
  margin-left: 6px;
  place-items: center;
  width: 19px;
}
.session-timer {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  margin-right: 8px;
}
.gate-badge {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .04em;
  margin-right: 4px;
  white-space: nowrap;
}
.gate-badge.is-empty { color: var(--danger); }
.language-toggle { font-size: 12px; font-weight: 700; letter-spacing: .04em; }

main { min-height: calc(100vh - 136px); }

.case-intro {
  margin: 0 auto;
  max-width: 1480px;
  padding: 46px clamp(20px, 4vw, 64px) 35px;
}

.case-kicker { align-items: center; display: flex; flex-wrap: wrap; gap: 12px; }
.case-kicker span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.case-kicker i { background: var(--line); height: 1px; width: 35px; }
.case-kicker .pathologisch { color: var(--coral); }
.case-kicker .physiologisch { color: var(--green); }

.case-title-row {
  align-items: end;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr) 310px;
  margin-top: 16px;
}

.case-title-row h1 {
  font-family: var(--font-serif);
  font-size: clamp(45px, 5.2vw, 78px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .95;
  margin: 0;
}
.case-title-row > div:first-child > p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 16px 0 0;
  max-width: 680px;
}
.mode-explainer { border-left: 1px solid var(--line); padding-left: 20px; }
.mode-explainer span { color: var(--coral); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.mode-explainer p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 6px 0 0; }

.workbench {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr);
  margin: 0 auto;
  max-width: 1480px;
  padding: 0 clamp(20px, 4vw, 64px) 70px;
}
.tracing-column { min-width: 0; }
.worksheet-column { min-width: 0; }

.ekg-viewer, .worksheet, .feedback-report {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.viewer-toolbar, .worksheet-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 73px;
  padding: 14px 18px;
}
.viewer-toolbar > div:first-child, .worksheet-header > div { display: flex; flex-direction: column; gap: 4px; }
.eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.viewer-toolbar strong { font-family: var(--font-serif); font-size: 25px; font-weight: 500; }
.viewer-actions { align-items: center; display: flex; gap: 10px; }
.calibration { color: var(--muted); font-family: var(--font-mono); font-size: 10px; }
.viewer-select { align-items: center; color: var(--muted); display: flex; font-size: 11px; gap: 6px; }
.viewer-select select {
  background: var(--surface);
  border: 1.5px solid var(--control-line);
  border-radius: 4px;
  color: var(--ink);
  font-family: inherit;
  font-size: 11px;
  padding: 7px 8px;
}
.tool-button { border-radius: 4px; font-size: 11px; font-weight: 700; padding: 9px 11px; }
.tool-button.active, .tool-button.is-active { background: var(--green); border-color: var(--green); color: white; }
.dark .tool-button.active, .dark .tool-button.is-active,
.dark .primary-button:hover, .dark .case-browser-button span { color: #0b2026; }

.caliper-bar {
  align-items: center;
  background: var(--green-pale);
  border-bottom: 1px solid color-mix(in srgb, var(--green) 25%, transparent);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  padding: 9px 18px;
}
.caliper-modes { display: flex; gap: 5px; }
.caliper-readout { display: flex; gap: 18px; margin: 0; }
.caliper-readout div { display: flex; flex-direction: column; gap: 2px; }
.caliper-readout dt {
  color: var(--green);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.caliper-readout dd {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  margin: 0;
}
.caliper-readout dd small { font-size: 9px; opacity: .6; }
.zoom-controls { align-items: center; display: flex; gap: 5px; }
.zoom-controls .zoom-level {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  min-width: 40px;
  text-align: center;
}

/* The renderer fits the whole paper into this box and manages its own pixel
   density, so the wrapper only has to provide a stable size to measure. */
.canvas-wrap {
  background: #fffdf8;
  height: min(62vh, 620px);
  overflow: hidden;
  position: relative;
  touch-action: none;
}
.ekg-canvas { cursor: grab; display: block; height: 100%; width: 100%; }
.ekg-canvas:active { cursor: grabbing; }
.ekg-canvas:focus-visible { outline: 2px solid var(--coral); outline-offset: -2px; }
.viewer-caption { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; padding: 11px 15px 14px; }

.worksheet-header h2 { font-family: var(--font-serif); font-size: 25px; font-weight: 500; margin: 0; }
.worksheet-progress {
  background: var(--coral-pale);
  border-radius: 999px;
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 7px 9px;
  text-transform: uppercase;
}
.worksheet-section { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 49px minmax(0, 1fr); }
.worksheet-section:last-child { border-bottom: 0; }
.worksheet-section.locked { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.section-index {
  border-right: 1px solid var(--line);
  color: var(--coral);
  font-family: var(--font-mono);
  font-size: 10px;
  padding-top: 24px;
  text-align: center;
}
.locked .section-index { color: var(--muted); }
.section-body { min-width: 0; padding: 22px 20px; }
.section-title { align-items: flex-start; display: flex; gap: 18px; justify-content: space-between; }
.section-title h3 { font-family: var(--font-serif); font-size: 24px; font-weight: 500; margin: 0; }
.section-title p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 5px 0 0; }
.section-state {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 5px 7px;
  text-transform: uppercase;
}
.completed .section-state { background: var(--green-pale); border-color: transparent; color: var(--green); }
fieldset { border: 0; margin: 19px 0 0; padding: 0; }
fieldset:disabled { opacity: .46; }
.fields-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: block; min-width: 0; }
.field > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.field small { font-weight: 400; }
.field-wide { grid-column: 1 / -1; }
.field-label { align-items: center; display: flex !important; gap: 6px; justify-content: space-between; }
.info-button {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  border-radius: 50%;
  color: var(--green);
  cursor: pointer;
  flex: none;
  font-family: var(--font-serif);
  font-size: 10px;
  font-style: italic;
  height: 16px;
  line-height: 1;
  padding: 0;
  width: 16px;
}
.info-button:hover, .info-button[aria-expanded="true"] { background: var(--green); border-color: var(--green); color: white; }
.field-reference {
  color: var(--muted);
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  margin-top: 4px;
}
.info-card {
  background: var(--green-pale);
  border: 1px solid color-mix(in srgb, var(--green) 28%, transparent);
  border-radius: 6px;
  margin-top: 8px;
  padding: 12px 30px 12px 13px;
  position: relative;
}
.info-card strong { display: block; font-family: var(--font-serif); font-size: 15px; font-weight: 500; margin-top: 2px; }
.info-card p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 4px 0 8px; }
.info-card ul { display: grid; gap: 6px; margin: 0; padding-left: 15px; }
.info-card li { font-size: 11px; line-height: 1.65; }
.info-close {
  background: transparent;
  border: 0;
  color: var(--green);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  position: absolute;
  right: 5px;
  top: 7px;
}
input, select, textarea {
  background: var(--surface);
  border: 1.5px solid var(--control-line);
  border-radius: 3px;
  color: var(--ink);
  font-size: 13px;
  min-height: 44px;
  padding: 10px 11px;
  width: 100%;
}
textarea { line-height: 1.55; resize: vertical; }
.number-wrap { display: grid; grid-template-columns: 1fr auto; }
.number-wrap input { border-radius: 3px 0 0 3px; }
.number-wrap > span {
  align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--control-line);
  border-left: 0;
  border-radius: 0 3px 3px 0;
  color: var(--muted);
  display: flex;
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 0 9px;
}
.field.is-correct input, .field.is-correct select { border-color: var(--green); }
.field.is-partial input, .field.is-partial select { border-color: var(--amber); }
.field.is-incorrect input, .field.is-incorrect select { border-color: var(--danger); }
.field-result { font-family: var(--font-mono); font-size: 10px; line-height: 1.5; margin: 5px 0 0; }
.field-result.correct { color: var(--green); }
.field-result.partial { color: var(--amber); }
.field-result.incorrect { color: var(--danger); }
.section-actions { align-items: center; display: flex; justify-content: flex-end; margin-top: 16px; }
.primary-button, .secondary-button {
  align-items: center;
  border-radius: 3px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 18px;
  justify-content: center;
  min-height: 41px;
  padding: 10px 14px;
}
.primary-button { background: var(--ink); border: 1px solid var(--ink); color: var(--surface); }
.primary-button:hover { background: var(--coral); border-color: var(--coral); color: white; }
.primary-button:disabled { cursor: not-allowed; opacity: .35; }
.practice-note { color: var(--muted); font-size: 11px; font-style: italic; }
.section-feedback {
  border-radius: 3px;
  display: grid;
  gap: 12px;
  grid-template-columns: 32px 1fr;
  margin-top: 16px;
  padding: 13px;
}
.section-feedback.correct { background: var(--green-pale); color: var(--green); }
.section-feedback.partial { background: var(--amber-pale); color: var(--amber); }
.section-feedback.incorrect { background: var(--danger-pale); color: var(--danger); }
.feedback-mark {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: flex;
  font-family: var(--font-mono);
  height: 28px;
  justify-content: center;
  width: 28px;
}
.section-feedback strong { display: block; font-family: var(--font-serif); font-size: 17px; font-weight: 500; margin: 2px 0 4px; }
.section-feedback p { font-size: 12px; line-height: 1.6; margin: 0; }
.guided-complete { background: var(--green-pale); border-radius: 3px; color: var(--green); padding: 12px; width: 100%; }
.guided-complete p { font-size: 12px; line-height: 1.6; margin: 3px 0 0; }

.gate-notice {
  border-radius: 3px;
  display: grid;
  gap: 12px;
  grid-template-columns: 32px 1fr;
  margin-top: 16px;
  padding: 13px;
}
.gate-notice.cooldown { background: var(--amber-pale); color: var(--amber); }
.gate-notice.limit { background: var(--danger-pale); color: var(--danger); }
.gate-mark {
  align-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: flex;
  font-family: var(--font-mono);
  height: 28px;
  justify-content: center;
  width: 28px;
}
.gate-notice strong { display: block; font-family: var(--font-serif); font-size: 17px; font-weight: 500; margin: 2px 0 4px; }
.gate-notice p { font-size: 12px; line-height: 1.6; margin: 0; }
.gate-offline { font-style: italic; margin-top: 4px !important; opacity: .8; }

.case-drawer {
  background: var(--surface);
  bottom: 0;
  box-shadow: -20px 0 55px rgba(20, 49, 59, .16);
  max-width: 430px;
  overflow-y: auto;
  padding: 30px;
  position: fixed;
  right: 0;
  top: 0;
  transform: translateX(105%);
  transition: transform .3s ease;
  width: 90vw;
  z-index: 50;
}
.case-drawer.open { transform: translateX(0); }
.drawer-scrim { background: rgba(12, 35, 43, .38); inset: 0; opacity: 0; pointer-events: none; position: fixed; transition: opacity .3s; z-index: 40; }
.drawer-scrim.visible { opacity: 1; pointer-events: auto; }
.drawer-top { align-items: flex-start; display: flex; justify-content: space-between; }
.drawer-top h2 { font-family: var(--font-serif); font-size: 38px; font-weight: 400; margin: 4px 0 0; }
.difficulty-filter { color: var(--muted); display: block; font-size: 10px; margin: 25px 0 17px; }
.difficulty-filter select { margin-top: 7px; }
.case-list { display: grid; gap: 8px; }
.case-card {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  display: grid;
  gap: 13px;
  grid-template-columns: 30px 1fr auto;
  padding: 15px 13px;
  text-align: left;
}
.case-card:hover, .case-card.active { background: var(--coral-pale); border-color: var(--coral); }
.case-number { color: var(--coral); font-family: var(--font-mono); font-size: 11px; }
.case-card-copy { display: flex; flex-direction: column; gap: 4px; }
.case-card-copy strong { font-family: var(--font-serif); font-size: 17px; font-weight: 500; }
.case-card-copy small { color: var(--muted); font-size: 11px; }
.case-arrow { font-size: 14px; }
.drawer-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 20px; }

#report-root { margin: 0 auto; max-width: 1120px; padding: 0 clamp(20px, 4vw, 64px) 70px; }
.feedback-report { outline: 0; }
.report-hero {
  align-items: center;
  background: var(--ink);
  color: var(--surface);
  display: flex;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 58px);
}
.report-hero h2 { font-family: var(--font-serif); font-size: clamp(38px, 6vw, 65px); font-weight: 400; letter-spacing: -.04em; margin: 8px 0; }
.report-hero p { color: color-mix(in srgb, var(--surface) 65%, transparent); font-size: 12px; margin: 0; }
.score-ring {
  align-items: baseline;
  background: conic-gradient(var(--coral) calc(var(--score) * 1%), rgba(255,255,255,.12) 0);
  border-radius: 50%;
  display: flex;
  flex-shrink: 0;
  height: 116px;
  justify-content: center;
  position: relative;
  width: 116px;
}
.score-ring::before { background: var(--ink); border-radius: 50%; content: ""; inset: 7px; position: absolute; }
.score-ring strong, .score-ring span { position: relative; }
.score-ring strong { font-family: var(--font-serif); font-size: 36px; font-weight: 400; }
.score-ring span { font-family: var(--font-mono); font-size: 9px; }
.critical-alert {
  align-items: flex-start;
  background: var(--danger-pale);
  color: var(--danger);
  display: grid;
  gap: 14px;
  grid-template-columns: 34px 1fr;
  padding: 20px clamp(20px, 4vw, 40px);
}
.alert-icon { align-items: center; border: 1px solid currentColor; border-radius: 50%; display: flex; height: 31px; justify-content: center; }
.critical-alert p { font-size: 11px; line-height: 1.5; margin: 4px 0 0; }
.breakdown {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(5, 1fr);
  padding: 25px clamp(20px, 4vw, 40px);
}
.breakdown div { display: grid; gap: 7px; }
.breakdown span { color: var(--muted); font-size: 9px; }
.breakdown strong { font-family: var(--font-mono); font-size: 13px; }
.breakdown i { background: var(--surface-2); display: block; height: 3px; overflow: hidden; }
.breakdown i b { background: var(--green); display: block; height: 100%; }
.report-section { border-bottom: 1px solid var(--line); padding: 27px clamp(20px, 4vw, 40px); }
.report-section-heading { align-items: center; display: flex; justify-content: space-between; }
.report-section-heading h3 { font-family: var(--font-serif); font-size: 25px; font-weight: 500; margin: 0; }
.report-section-heading span { color: var(--green); font-family: var(--font-mono); font-size: 11px; }
.comparison-table { margin-top: 16px; }
.comparison-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  font-size: 12px;
  gap: 13px;
  grid-template-columns: 1.1fr 1fr 1.4fr 63px;
  padding: 10px 0;
}
.comparison-row.header { border-top: 0; color: var(--muted); font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; }
.comparison-row strong { font-weight: 600; }
.result-chip { border-radius: 999px; font-family: var(--font-mono); font-size: 9px; padding: 6px 7px; text-align: center; }
.result-chip.correct { background: var(--green-pale); color: var(--green); }
.result-chip.partial { background: var(--amber-pale); color: var(--amber); }
.result-chip.incorrect { background: var(--danger-pale); color: var(--danger); }
.expert-note { color: var(--muted); font-family: var(--font-serif); font-size: 16px; line-height: 1.6; margin: 13px 0 0; }
.takeaway-card { background: var(--surface-2); padding: 30px clamp(20px, 4vw, 40px); }
.takeaway-card h3 { font-family: var(--font-serif); font-size: 31px; font-weight: 400; margin: 6px 0 18px; }
.takeaway-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.takeaway-grid p { align-items: center; background: var(--surface); border: 1.5px solid var(--line); display: flex; font-size: 12px; gap: 10px; line-height: 1.5; margin: 0; padding: 14px; }
.takeaway-grid span { color: var(--coral); font-family: var(--font-mono); font-size: 8px; }
.rationale-review { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.rationale-review p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 5px 0 0; }
.report-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 22px clamp(20px, 4vw, 40px); }

footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10px;
  gap: 10px 24px;
  justify-content: space-between;
  letter-spacing: .06em;
  padding: 22px clamp(20px, 4vw, 64px);
  text-transform: uppercase;
}
footer nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
footer a, .footer-link { color: var(--muted); }
.footer-link {
  background: none;
  border: 0;
  font: inherit;
  letter-spacing: inherit;
  padding: 0;
  text-decoration: underline;
  text-transform: inherit;
}
footer a:hover, .footer-link:hover { color: var(--ink); }

/* Advertising runs in automatic mode: Google injects its own containers, so
   there is nothing of ours to style. Keeping the ads clear of the tracing
   matters — an ad wedged into the ECG canvas would be read as part of the
   recording — which is configured in the AdSense account, not here. */

.dev-notice {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  box-shadow: var(--shadow);
  color: var(--ink);
  max-width: 620px;
  padding: 32px clamp(22px, 5vw, 40px) 26px;
  width: calc(100vw - 32px);
}
.dev-notice::backdrop { backdrop-filter: blur(3px); background: rgba(15, 38, 46, .55); }
.dev-notice-eyebrow {
  color: var(--coral);
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.dev-notice h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 400;
  line-height: 1.15;
  margin: 12px 0 0;
}
.dev-notice-points { list-style: none; margin: 22px 0 0; padding: 0; }
.dev-notice-points li {
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  padding: 14px 0;
}
.dev-notice-points strong { display: block; }
.dev-notice-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-top: 20px;
}
.dev-notice-actions a { color: var(--muted); font-size: 12px; }
.dev-notice-accept {
  background: var(--ink);
  border: 0;
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  padding: 13px 26px;
}

@media (max-width: 1100px) {
  .workbench { grid-template-columns: 1fr; }
  .worksheet-column { order: 2; }
  .canvas-wrap { height: min(52vh, 460px); }
}

@media (max-width: 720px) {
  .app-header { grid-template-columns: 1fr auto; height: auto; min-height: 66px; padding: 12px 18px; }
  .mode-switch { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; }
  .mode-switch button { flex: 1; }
  .theme-toggle { display: none; }
  .case-intro { padding-top: 34px; }
  .case-title-row { gap: 22px; grid-template-columns: 1fr; }
  .case-title-row h1 { font-size: 50px; }
  .mode-explainer { border-left: 0; border-top: 1px solid var(--line); padding: 14px 0 0; }
  .workbench { padding-left: 12px; padding-right: 12px; }
  .viewer-toolbar { align-items: flex-start; flex-direction: column; }
  .viewer-actions { flex-wrap: wrap; margin-top: 10px; }
  .caliper-bar { gap: 10px; }
  .caliper-readout { gap: 12px; }
  .canvas-wrap { height: 380px; }
  .fields-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .section-title { display: block; }
  .section-state { display: inline-block; margin-top: 8px; }
  .report-hero { align-items: flex-start; }
  .score-ring { height: 82px; width: 82px; }
  .score-ring strong { font-size: 26px; }
  .breakdown { grid-template-columns: 1fr 1fr; }
  .comparison-row { grid-template-columns: 1fr 1fr; }
  .comparison-row.header { display: none; }
  .comparison-row > *:nth-child(3) { color: var(--muted); }
  .takeaway-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
