/* A compact ECG working surface, sized from the viewport rather than the paper width. */
.playback-controls{display:flex;gap:4px;align-items:center;font-size:14px}
.app-shell{--sidebar-width:280px;display:grid;grid-template-columns:minmax(0,1fr) var(--sidebar-width);min-height:100dvh;background:radial-gradient(ellipse at 78% 0%,#2a343b55,transparent 62%),linear-gradient(135deg,#15191d,#20282f)}.app-shell.sidebar-collapsed{grid-template-columns:minmax(0,1fr) 0}.app-shell>main{grid-column:1;min-width:0;width:100%;max-width:1600px;margin:0 auto;padding:32px 24px}.sidebar-collapsed main>.page-heading{padding-right:54px}
.app-sidebar{position:fixed;inset:0 0 0 auto;z-index:20;width:var(--sidebar-width);height:100dvh;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:0;padding:24px 16px 16px;background:#1b2227f5;border-left:1px solid var(--line);transform:translateX(0);transition:transform 200ms cubic-bezier(.2,.7,.2,1)}.sidebar-collapsed .app-sidebar{transform:translateX(100%)}.brand{display:flex;align-items:center;gap:10px;padding:0 44px 28px 8px}.brand-symbol{color:var(--accent)}.brand-symbol .ui-icon{width:28px;height:28px}.brand-copy{display:flex;flex-direction:column;gap:4px}.brand-copy strong{font-size:17px}.brand-copy small{font-size:12px;color:var(--muted)}.sidebar-menu{flex:1}.sidebar-menu>summary{display:none}.app-sidebar nav{display:flex;flex-direction:column;gap:4px}.app-sidebar nav a,.sidebar-unavailable,.sidebar-pathologies button,.sidebar-records button{display:flex;align-items:center;gap:12px;min-height:48px;width:100%;padding:12px;text-align:left;font-size:14px;border-radius:999px}.app-sidebar nav a:hover,.sidebar-pathologies button:hover,.sidebar-records button:hover{background:#ffffff08}.app-sidebar nav a[aria-current=page],.sidebar-pathologies button[aria-pressed=true],.sidebar-records button[aria-pressed=true]{background:#73dbe210;color:#8ee4e8;font-weight:600}.app-sidebar .ui-icon{width:20px;height:20px}.sidebar-unavailable{color:var(--muted);flex-wrap:wrap;opacity:1!important}.coming-soon{font-size:12px;margin-left:32px;color:var(--muted)}.sidebar-pathologies{border-top:1px solid var(--line);margin-top:18px;padding-top:18px}.sidebar-caption{margin:0 12px 8px;color:var(--muted);font-size:12px}.sidebar-records{margin-top:12px}.footer{margin-top:24px;padding:14px 12px 0;font-size:12px;text-align:right;color:var(--muted)}.sidebar-toggle{position:fixed;right:16px;top:16px;z-index:24;width:44px;height:44px;display:grid;place-items:center;border:1px solid #566168;background:#1b2227f5;border-radius:999px}.sidebar-toggle .ui-icon{width:24px;height:24px;transition:transform 140ms ease-out}.sidebar-toggle[aria-expanded=true] .ui-icon{transform:translateX(-2px)}.sidebar-toggle:hover{background:#73dbe210}.sidebar-backdrop{position:fixed;inset:0;z-index:19;background:#090c10aa}
.ecg-screen{height:100dvh;min-height:0;overflow:hidden}.ecg-screen>main{height:100dvh;min-height:0;max-width:none;margin:0;padding:16px}.workspace-layout{--rail-width:112px;display:grid;grid-template-columns:minmax(0,1fr) var(--rail-width);gap:20px;height:100%;min-height:0}.workspace-layout.panel-open{--rail-width:360px}.ecg-viewer{display:grid;grid-template-rows:auto auto auto minmax(0,1fr);row-gap:8px;min-width:0;min-height:0;height:100%;position:relative;background:transparent;border:0;padding:0}.viewer-toolbar{grid-row:1;display:flex;align-items:center;flex-wrap:wrap;gap:8px;position:relative;z-index:6}.viewer-title{flex-basis:100%;margin:0 0 4px;font-size:26px;font-weight:500;line-height:1.3;letter-spacing:.025em;text-transform:uppercase}.viewer-toolbar .button,.viewer-settings>summary,.lead-picker>summary{min-height:44px;padding:10px 12px;font-size:14px;font-weight:500;background:#ffffff04;border:1px solid var(--line);border-radius:999px;display:flex;align-items:center;gap:8px}.viewer-toolbar .play{background:#ffffff04;color:var(--ink)}.viewer-toolbar .ruler[aria-pressed=true]{background:#73dbe20c;color:var(--accent);border-color:var(--accent)}.layout-select{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:14px}.layout-select .custom-select{min-width:116px}.viewer-chips{grid-row:2;display:flex;align-items:center;flex-wrap:wrap;gap:4px 0;color:var(--muted);font-size:12px;line-height:1.5}.viewer-chips>span+span::before{content:'·';margin:0 9px;color:#7b878e}.viewer-chips>span{background:transparent;padding:0;border:0}.viewer-settings,.lead-picker{position:relative}.viewer-settings>summary,.lead-picker>summary{list-style:none}.lead-picker>summary>.ui-icon:last-child{width:14px;height:14px;transform:rotate(90deg)}.lead-current:empty{display:none}.lead-current{font-weight:600;color:var(--accent)}
.settings-panel,.lead-picker-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:8;width:340px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 140px);overflow:auto;padding:16px;background:var(--surface);border:1px solid #566168;border-radius:16px;box-shadow:none}.settings-panel{display:grid;gap:12px}.settings-panel>label{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px}.settings-panel .custom-select{max-width:62%}.window-offset{flex-wrap:wrap}.window-start{flex:1;min-width:90px}.window-readout{font-size:12px}.timeline{display:flex;align-items:center;gap:10px;font-size:12px}.play-position{flex:1}.repeat-label{justify-content:flex-start!important}.viewer-note{font-size:12px;line-height:1.5;color:var(--muted);margin:0}.lead-picker-panel{width:280px}.lead-picker-panel p{font-size:14px;margin-bottom:12px}.lead-picker-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.lead-picker-grid button{min-height:44px;border:1px solid var(--line);border-radius:999px;background:#ffffff04;font-size:14px;font-weight:600}.lead-picker-grid button:hover{background:#73dbe210}.lead-picker-grid button[aria-pressed=true]{background:#73dbe214;color:var(--accent);border-color:var(--accent)}
.measurement-bar{grid-row:3;padding:6px 0;border-bottom:1px solid var(--line)}.measurement-result{display:flex;align-items:center;flex-wrap:wrap;gap:6px 22px;color:var(--muted);font-size:14px;line-height:1.5}.measurement-result strong{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums;margin-left:8px}
.plot-scroll{grid-row:4;min-width:0;min-height:0;overflow:auto;overscroll-behavior:auto;touch-action:pan-y;display:flex;align-items:flex-start;justify-content:flex-start;background:transparent;border:0;cursor:grab}.plot-scroll.measuring{cursor:crosshair}.sheet{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:auto;flex:none;align-items:start;outline:1px solid #e5cbd1;background:#fffafb}.sheet.layout-6x2{grid-template-columns:repeat(2,minmax(0,1fr))}.sheet.layout-single,.sheet.layout-12x1,.sheet.layout-strip,.sheet.layout-source{grid-template-columns:1fr}.lead-cell{position:relative;display:grid;grid-template-columns:32px minmax(0,1fr);min-width:0;align-items:center}.lead-cell svg{grid-column:2;grid-row:1;display:block;max-width:100%;touch-action:pan-y;flex:none}.lead-label{grid-column:1;grid-row:1;justify-self:center;align-self:center;min-height:0;max-height:100%;overflow:hidden;padding:2px 0;width:30px;border:0;background:transparent;font-size:12px;line-height:1.2;color:#3e5760;font-weight:600}.lead-label:hover{color:var(--accent);background:#d9e8e5}.time-axis{grid-column:2;grid-row:2;display:none;align-items:center;justify-content:space-between;height:16px;font-size:10px;padding-right:4px;color:#627983}.layout-single .time-axis,.layout-12x1 .lead-cell:last-child .time-axis,.layout-strip .time-axis,.layout-6x2 .lead-cell:nth-last-child(-n+2) .time-axis,.layout-3x4 .lead-cell:nth-last-child(-n+4) .time-axis{display:flex}.layout-source .lead-cell,.layout-strip .lead-cell{display:block}.mark{cursor:move;touch-action:none}.expanded{position:fixed;inset:12px;z-index:90;background:#171c20;padding:16px;border:1px solid var(--line);height:auto}
.record-workspace{min-width:0;min-height:0;display:flex;flex-direction:column;gap:18px;padding-top:52px}.record-actions{display:flex;flex-direction:column;gap:8px}.record-action{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;min-height:72px;width:100%;font-size:13px;line-height:1.4;letter-spacing:.025em;border:1px solid #566168;border-radius:24px;background:transparent;position:relative}.record-action .ui-icon{width:19px;height:19px;color:var(--muted)}.record-action:hover{background:#ffffff08;border-color:#8d9da5}.record-action[aria-pressed=true]{background:#73dbe210;border-color:var(--accent);color:var(--accent)}.panel-open .record-actions{flex-direction:row}.panel-open .record-action{flex:1;min-width:0;min-height:56px;flex-direction:row;gap:8px}.record-panel{flex:1;min-height:0;overflow:auto;padding-left:18px;border-left:1px solid #566168;outline:none}.record-panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}.record-panel-head h2{font-size:18px;margin:0}.record-panel-head .icon-button{border:0;background:transparent;width:36px;min-height:36px;padding:7px}.record-panel-body h3,#quiz h2{font-size:17px;font-weight:600;line-height:1.5}.record-panel-body p{font-size:15px;line-height:1.65}.record-panel .option{font-size:14px;padding:12px}.record-panel .feedback{font-size:14px}.record-panel #quiz>.eyebrow{display:none}
.pathology-dialog{width:880px}.pathology-tabs,.pathology-subgroups{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:16px}.pathology-tabs{border-bottom:1px solid var(--line);padding-bottom:10px}.pathology-tabs button,.pathology-subgroups button{padding:10px 12px;min-height:44px;font-size:14px;color:var(--muted);border-radius:999px}.pathology-tabs button[aria-pressed=true],.pathology-subgroups button[aria-pressed=true]{background:#73dbe210;color:#8ee4e8;font-weight:600}.pathology-dialog>input{width:100%}.pathology-subgroups{margin-top:16px}.pathology-records{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}.pathology-record{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 0;border-bottom:1px solid var(--line);min-width:0}.pathology-record h3{font-size:16px;margin:0 0 6px}.pathology-record .small,.record-status{font-size:12px}.record-status{color:var(--accent);flex:none}.pathology-record[aria-current=true]{color:var(--accent)}.release-list{max-width:960px}.release{padding:26px 0;border-bottom:1px solid var(--line)}.release header{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:16px;font-size:14px}.release-version{font-weight:600;color:var(--accent)}.release-current{color:#cfc591;font-size:12px}.release time{margin-left:auto;color:var(--muted)}.release li{line-height:1.65;margin-bottom:8px}
/* Only transient controls move. The paper and its ancestors stay fully visible and still. */
@keyframes panel-in{from{opacity:.96;transform:translateX(6px)}to{opacity:1;transform:translateX(0)}}
@keyframes menu-in{from{opacity:.94;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}
.record-panel:not([hidden]){animation:panel-in 160ms cubic-bezier(.2,.7,.2,1)}
.viewer-settings[open] .settings-panel,.lead-picker[open] .lead-picker-panel,.select-open .select-options{animation:menu-in 140ms cubic-bezier(.2,.7,.2,1)}
dialog[open]{animation:menu-in 160ms cubic-bezier(.2,.7,.2,1)}
.app-sidebar nav a{transition:color 120ms,background-color 120ms}

@media(max-width:1050px){.workspace-layout{--rail-width:96px;gap:14px}.workspace-layout.panel-open{--rail-width:300px}.record-action{font-size:12px}.panel-open .record-action .ui-icon{display:none}}
@media(max-width:760px){.app-shell{--sidebar-width:min(280px,calc(100vw - 32px));display:block}.app-shell>main{padding:76px 16px 24px}.ecg-screen>main{padding:12px 10px;height:100dvh}.workspace-layout,.workspace-layout.panel-open{--rail-width:84px;gap:8px}.viewer-title{font-size:18px;margin-bottom:0}.viewer-toolbar{gap:6px}.layout-select{font-size:12px;gap:4px}.layout-select .custom-select{min-width:94px}.layout-select .select-trigger{padding:9px 7px;font-size:12px}.viewer-toolbar .button,.viewer-settings>summary,.lead-picker>summary{padding:10px;gap:5px}.viewer-toolbar .ruler span,.viewer-toolbar .play span,.viewer-settings>summary span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.viewer-toolbar .ui-icon{width:19px;height:19px}.lead-picker>summary{font-size:12px}.lead-picker>summary>.ui-icon:first-child,.lead-picker>summary>.ui-icon:last-child{display:none}.viewer-chips{font-size:12px}.viewer-chips>span+span::before{margin:0 4px}.measurement-result{gap:3px 12px;font-size:12px}.measurement-result strong{margin-left:4px}.settings-panel,.lead-picker-panel{position:fixed;top:var(--menu-top,112px);left:12px;right:auto;width:min(340px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - var(--menu-top,112px) - 12px)}.record-workspace{padding-top:48px}.record-action{min-height:64px;font-size:12px;gap:6px}.panel-open .record-actions{flex-direction:column}.panel-open .record-action{flex:none;flex-direction:column;min-height:64px}.record-panel{position:fixed;top:76px;bottom:12px;right:104px;left:12px;z-index:12;padding:18px;background:var(--surface);border:1px solid #566168;border-radius:16px;box-shadow:none}.sidebar-toggle{top:12px;right:16px}.pathology-records{grid-template-columns:1fr}.release time{margin-left:0;width:100%}.expanded{inset:6px;padding:10px}.expanded .settings-panel{right:0}}
@media(max-height:540px) and (min-width:761px){.ecg-screen>main{padding:10px}.viewer-title{font-size:18px}.viewer-toolbar{gap:6px}.viewer-toolbar .button,.viewer-settings>summary,.lead-picker>summary{min-height:40px;padding:8px}.viewer-chips{font-size:12px}.record-workspace{padding-top:44px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){.app-sidebar,.sidebar-toggle,.record-panel{background:Canvas;color:CanvasText}.record-action{border:1px solid CanvasText}.record-action[aria-pressed=true]{outline:2px solid Highlight}.sheet{border:1px solid CanvasText}}

.record-action{padding:12px 8px}.record-panel .option{border-radius:20px}.lead-label{border-radius:999px}.sidebar-toggle{border-radius:50%}

@media(max-width:760px){.record-action{padding:12px 4px}}

/* Rounded, flat graphite chrome. The ECG paper is deliberately isolated. */
.viewer-toolbar .button,.viewer-settings>summary,.lead-picker>summary{padding:10px 18px;letter-spacing:.035em;text-transform:uppercase}
.record-action,.sidebar-toggle,.lead-picker-grid button,.sidebar-pathologies button,.sidebar-records button{transition:background-color 120ms ease-out,border-color 120ms ease-out,color 120ms ease-out}
.app-sidebar nav a[aria-current=page]{background:#d8ce9110;color:#ded5a2;font-weight:500}
.app-sidebar nav a[aria-current=page] .ui-icon{color:#ded5a2}
.app-sidebar nav a,.sidebar-pathologies button,.sidebar-records button{font-weight:400}
.settings-panel,.lead-picker-panel{border-radius:20px}
.sidebar-toggle{background:#20272ce8;border-color:#566168;color:var(--ink)}
.sidebar-toggle:hover{background:#2b353c}
.sheet{color:#243044;border-radius:4px}.sheet .time-axis{color:#627983}
.record-panel-head h2{font-weight:500}.record-panel p{color:#cbd2d6}
.release-version{color:var(--ink);font-size:18px;letter-spacing:.025em;font-weight:500}.release p{margin:0;color:var(--muted);font-size:14px}
@media(max-width:760px){.viewer-toolbar .button,.viewer-settings>summary,.lead-picker>summary{padding:10px}.viewer-title{font-size:18px}.record-action{border-radius:22px}}
@media(forced-colors:active){.sidebar-toggle,.app-sidebar nav a[aria-current=page],.viewer-toolbar .ruler[aria-pressed=true]{background:Canvas;color:CanvasText}.sheet{color:#243044}.record-action[aria-pressed=true]{color:CanvasText}}

.playback-quick{order:2;flex-basis:100%;display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px}.viewer-toolbar>.viewer-settings{order:1}.window-control,.playback-speed{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}.window-presets{display:flex;gap:4px}.window-presets button{min-height:40px;min-width:44px;padding:8px;border:1px solid var(--line);background:#ffffff04;color:var(--ink);border-radius:999px;font-size:13px}.window-presets button[aria-pressed=true]{border-color:#ded5a2;color:#ded5a2;background:#d8c58a0b}.playback-speed .custom-select{min-width:88px}.playback-speed .select-trigger{min-height:40px;padding:8px 12px;font-size:13px}.playback-quick .show-all{min-height:40px;padding:8px 12px;font-size:12px}.window-presets button:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:760px){.playback-quick{gap:6px}.window-control{gap:4px}.window-control>span,.playback-speed>span,.playback-quick .show-all span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.window-presets{gap:3px}.window-presets button{min-width:34px;padding:7px 5px}.playback-speed .custom-select{min-width:72px}.playback-speed .select-trigger{padding:8px}.playback-quick .show-all{padding:9px}}
@media(max-height:540px) and (min-width:761px){.playback-quick{gap:6px 12px}.window-presets button,.playback-speed .select-trigger,.playback-quick .show-all{min-height:34px;padding-top:5px;padding-bottom:5px}}

/* Phone workspace: full-width paper with a bottom action bar. */
@keyframes mobile-panel-in{from{opacity:.97;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:760px){
 .app-shell>main{padding:68px 14px 24px}.ecg-screen>main{padding:12px 12px max(10px,env(safe-area-inset-bottom));height:100dvh}
 .workspace-layout,.workspace-layout.panel-open{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:10px}
 .ecg-viewer{grid-row:1;row-gap:7px}.viewer-title{padding-right:48px;font-size:18px;line-height:1.35;margin-bottom:8px;letter-spacing:.01em}
 .viewer-toolbar{gap:6px}.layout-select{font-size:0;gap:0}.layout-select .custom-select{min-width:110px}.layout-select .select-trigger{min-height:44px;font-size:12px;padding:10px}
 .viewer-toolbar>.button,.viewer-settings>summary{min-width:44px;min-height:44px;justify-content:center}.lead-picker>summary{min-height:44px;padding:10px 12px;font-size:12px}
 .playback-quick{display:grid;grid-template-columns:minmax(0,1fr) 82px 44px;gap:8px}.window-control,.window-presets{width:100%;min-width:0}.window-presets{gap:4px}.window-presets button{flex:1;min-width:0;min-height:44px;font-size:13px}.playback-speed .custom-select{width:82px;min-width:0}.playback-speed .select-trigger,.playback-quick .show-all{min-height:44px}.playback-quick .show-all{justify-content:center;padding:10px}
 .viewer-chips{font-size:11px;line-height:1.5;gap:0}.viewer-chips>span+span::before{margin:0 5px}.viewer-chips>span:last-child{color:#8f9ba3}
 .plot-scroll{justify-content:center;align-items:flex-start;overscroll-behavior:contain}.sheet{margin:0 auto;align-self:flex-start}.lead-label{font-size:11px}
 .record-workspace{grid-row:2;padding-top:0;gap:0}.record-actions,.panel-open .record-actions{flex-direction:row;gap:8px}.record-action,.panel-open .record-action{flex:1;flex-direction:row;min-height:48px;padding:10px 12px;gap:8px;border-radius:999px;font-size:12px;letter-spacing:.04em}.record-action .ui-icon,.panel-open .record-action .ui-icon{display:block;width:18px;height:18px}
 .record-panel{left:12px;right:12px;top:64px;bottom:calc(76px + env(safe-area-inset-bottom));padding:20px;border:1px solid #566168;border-radius:20px;overscroll-behavior:contain;scroll-behavior:smooth}.record-panel:not([hidden]){animation:mobile-panel-in 180ms cubic-bezier(.2,.7,.2,1)}
 .sidebar-toggle{top:10px;right:12px;width:42px;height:42px}.settings-panel,.lead-picker-panel{left:12px;width:calc(100vw - 24px);max-width:420px}
 .catalog-tabs,.pathology-tabs,.pathology-subgroups{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-behavior:smooth;scrollbar-width:none}.catalog-tabs>button,.pathology-tabs>button,.pathology-subgroups>button{flex:none;scroll-snap-align:start}
 .page-heading h1{font-size:24px}.reading{font-size:16px}.record-panel-body p{font-size:15px}
}
@media(max-width:760px) and (max-height:480px){.ecg-screen>main{padding:6px 10px}.viewer-title{font-size:15px;margin-bottom:0}.viewer-toolbar{gap:4px}.workspace-layout,.workspace-layout.panel-open{gap:6px}.viewer-toolbar>.button,.viewer-settings>summary,.lead-picker>summary,.layout-select .select-trigger,.window-presets button,.playback-speed .select-trigger,.playback-quick .show-all{min-height:34px;padding-top:5px;padding-bottom:5px}.record-action,.panel-open .record-action{min-height:36px;padding:6px 12px}.record-panel{top:48px;bottom:48px}.sidebar-toggle{top:5px;width:34px;height:34px}}

.brand-logo{display:block;flex:none;width:40px;height:24px;object-fit:contain}

/* A visible phone shortcut; expansion uses the whole app viewport. */
.viewer-toolbar>.screen-toggle{display:none}
@media(max-width:760px){
 .viewer-title{padding-right:98px}
 .viewer-toolbar>.screen-toggle{display:flex;position:absolute;right:50px;top:-2px;width:44px;height:44px;padding:10px;z-index:7}
 .screen-toggle span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 .ecg-viewer.expanded{inset:0;height:100dvh;width:100%;padding:max(8px,env(safe-area-inset-top)) 8px max(8px,env(safe-area-inset-bottom));border:0;row-gap:4px;grid-template-rows:auto 0 auto minmax(0,1fr)}
 .expanded .viewer-title,.expanded .viewer-chips,.expanded .lead-picker{display:none}
 .expanded .viewer-toolbar>.screen-toggle{position:static;order:1;flex:none}
 .expanded .viewer-toolbar>.viewer-settings{order:0}
 .expanded .layout-select .custom-select{min-width:95px}
 .expanded .layout-select .select-trigger{padding:10px 7px}
 .expanded .plot-scroll{align-items:center}
 .expanded .sheet{margin:auto}
 body:has(.ecg-viewer.expanded) .record-workspace,body:has(.ecg-viewer.expanded) .sidebar-toggle{visibility:hidden}
}
@media(max-width:760px) and (max-height:480px){.viewer-toolbar>.screen-toggle{top:0;width:34px;height:34px;min-width:34px;min-height:34px;padding:7px}.expanded .viewer-toolbar>.screen-toggle{min-width:44px}}

.topic-subgroups{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 24px}.topic-subgroups a{padding:10px 14px;border:1px solid var(--line);border-radius:999px;font-size:14px;color:var(--muted)}.topic-subgroups a[aria-current=page]{color:#ded5a2;border-color:#ded5a2;background:#d8c58a0b}.theory-examples{display:inline-block;margin:4px 0 14px;font-size:14px;color:var(--accent)}
@media(max-width:760px){.topic-subgroups,.coronary-tabs{flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;scroll-behavior:smooth;overscroll-behavior-x:contain}.topic-subgroups a,.coronary-tabs button{flex:none;scroll-snap-align:start}.topic-subgroups{padding-bottom:6px}}

.classification-intro{padding:10px 0 14px}.classification-intro h2{font-size:18px;margin-bottom:8px}.classification-intro p{font-size:14px;line-height:1.6;color:var(--muted);margin:4px 0}.classification-branches{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}.classification-branches button{padding:10px 12px;border:1px solid var(--line);border-radius:999px;font-size:13px;color:var(--muted)}.classification-branches button[aria-pressed=true]{color:#ded5a2;border-color:#ded5a2;background:#d8c58a0b}.record-classification,.record-leads{display:block;font-size:12px;line-height:1.6;color:var(--muted);margin:5px 0}.record-classification{color:#cbd2d6}
@media(max-width:760px){.classification-branches{flex-wrap:nowrap;overflow-x:auto;scroll-snap-type:x proximity;scroll-behavior:smooth}.classification-branches button{flex:none;scroll-snap-align:start}}

/* Layout supplied by the user: paper controls and a separate question panel. */
.plot-region{grid-row:4;position:relative;min-width:0;min-height:0}.plot-region>.plot-scroll{height:100%;width:100%}
.playback-quick .playback-options{margin-left:auto;order:0}.playback-options>summary{min-height:40px;padding:8px 12px;text-transform:none;letter-spacing:0;font-size:12px}.playback-options .settings-panel{width:300px}
.record-workspace{justify-content:center;padding-top:0}.record-actions{gap:14px}.record-action{min-height:104px;font-size:15px}.record-action .ui-icon{width:25px;height:25px}
.workspace-layout.panel-open:has(#quiz) .record-actions{display:none}.workspace-layout.panel-open:has(#quiz) .record-panel{border:1px solid #43535e;border-radius:16px;padding:24px;height:100%}.record-panel:has(#quiz){position:relative}.record-panel:has(#quiz) .record-panel-head{position:absolute;right:8px;top:8px;margin:0}.record-panel:has(#quiz) .record-panel-head h2{display:none}.record-panel:has(#quiz) .record-panel-head .icon-button{width:28px;min-height:28px;padding:6px;color:var(--muted)}
#quiz{display:flex;flex-direction:column;min-height:100%;gap:20px}.quiz-progress{padding-bottom:18px;border-bottom:1px solid var(--line)}.quiz-progress>span{display:block;font-size:14px;color:var(--muted)}.quiz-progress>strong{display:block;font-size:32px;line-height:1.3;font-weight:600;margin:6px 0 14px}.quiz-progress b{color:var(--accent);font-weight:600}.quiz-steps{display:flex;gap:3px}.quiz-steps>span{height:7px;flex:1;background:#34434e;border-radius:999px}.quiz-steps>.answered{background:#779899}.quiz-steps>.current{background:var(--accent)}
.record-panel #quiz h2{font-size:22px;line-height:1.35;margin:0;font-weight:500}.record-panel #quiz .options{display:grid;gap:8px}.record-panel #quiz .option{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:14px;font-size:14px;line-height:1.5;text-align:left}.record-panel #quiz .option::before{content:'';flex:none;width:16px;height:16px;border:1.5px solid #a8b9c5;border-radius:50%}.record-panel #quiz .option[aria-pressed=true]::before{background:currentColor;border-color:currentColor;box-shadow:inset 0 0 0 3px var(--surface)}.record-panel #quiz .feedback:empty{display:none}.record-panel #quiz .feedback{font-size:14px;margin:0}.record-panel #quiz .feedback p{font-size:14px;line-height:1.6}.quiz-source{font-size:12px;color:var(--muted)}.quiz-source p{font-size:12px!important}
.quiz-navigation{display:flex;gap:8px;margin-top:auto;padding-top:18px;border-top:1px solid var(--line)}.quiz-navigation .button{flex:1;min-width:0;padding:10px 8px;border-radius:14px;font-size:12px;text-transform:uppercase}.quiz-result{display:flex;flex-direction:column;gap:16px}.quiz-result h2{color:var(--accent);font-size:38px!important}
@media(min-width:1051px){.workspace-layout.panel-open{--rail-width:380px;gap:18px}}
@media(max-width:760px){.playback-quick .playback-options{grid-column:1/-1;margin-left:0;justify-self:end}.playback-options>summary{min-height:30px;padding:4px 8px}.playback-options>summary span{font-size:11px}.playback-options .settings-panel{left:12px;width:calc(100vw - 24px)}.record-workspace{justify-content:initial}.record-action,.panel-open .record-action{min-height:48px;font-size:12px}.record-action .ui-icon{width:18px;height:18px}.workspace-layout.panel-open:has(#quiz) .record-actions{display:flex}.workspace-layout.panel-open:has(#quiz) .record-panel{position:fixed;left:12px;right:12px;top:64px;bottom:calc(76px + env(safe-area-inset-bottom));height:auto;padding:22px 18px}.record-panel #quiz h2{font-size:19px}.quiz-progress>strong{font-size:28px}#quiz{gap:16px}.quiz-navigation{position:sticky;bottom:0;background:var(--surface);padding-bottom:4px}.expanded .playback-options{display:none}}

.spaced-paper .lead-cell{align-content:center;height:100%}.sidebar-pathologies .ui-icon{width:24px;height:24px}.quiz-navigation .button.primary{background:#54dbe9;color:#14232b;border:1px solid #54dbe9}.quiz-navigation .button.quiet{border:1px solid #52646f}.quiz-navigation .button:disabled{opacity:.4}

.record-panel:has(#quiz)>.record-panel-body{height:100%;min-height:100%}.record-panel #quiz{padding-bottom:0}.record-panel .quiz-navigation{position:sticky;bottom:0;background:var(--surface);z-index:2}


.record-panel #quiz .option:disabled{opacity:1}.record-panel #quiz .option[aria-pressed=true]{color:var(--ink);border-color:#7daba8;background:#6aa39b15}

.spaced-paper svg>.paper-background,.spaced-paper svg>.paper-grid{display:none}



.spaced-paper{margin:0 auto;align-content:start;background-color:#fffafb;background-image:linear-gradient(#dcbdc755 1px,transparent 1px),linear-gradient(90deg,#dcbdc755 1px,transparent 1px),linear-gradient(#eedce155 1px,transparent 1px),linear-gradient(90deg,#eedce155 1px,transparent 1px);background-size:var(--paper-grid-major-x) var(--paper-grid-major-y),var(--paper-grid-major-x) var(--paper-grid-major-y),var(--paper-grid-x) var(--paper-grid-y),var(--paper-grid-x) var(--paper-grid-y)}
@media(max-width:760px){.expanded .plot-scroll{align-items:flex-start}.expanded .sheet{margin:0 auto}}

@media(min-width:761px){.record-panel:has(#quiz) .record-panel-head{right:54px}}

.record-panel #quiz>.quiz-context{display:block;font-size:12px;line-height:1.4;color:var(--muted);margin:0 0 -10px}.plot-scroll{touch-action:none;user-select:none}.plot-scroll.is-panning{cursor:grabbing}.plot-scroll.measuring{cursor:crosshair}

/* Flat chapter navigation keeps the normal-ECG reading list manageable. */
.normal-chapter{border-bottom:1px solid var(--line);margin-bottom:12px}.normal-chapter>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;list-style:none;padding:18px 0;cursor:pointer;font-size:18px;font-weight:500}.normal-chapter>summary::after{content:'+';font-size:22px;color:var(--muted)}.normal-chapter[open]>summary::after{content:'−';color:var(--accent)}.normal-chapter>summary>small{font-size:12px;font-weight:400;color:var(--muted);margin-left:auto;white-space:nowrap}.normal-chapter>summary:hover,.normal-chapter[open]>summary{color:var(--accent)}.normal-chapter>summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:8px}.normal-chapter-body{padding:0 0 10px}.normal-chapter-body .theory-section h2{font-size:20px}
 .normal-chapter>summary::before{content:none}
/* Keep the reader controls outside the signal and retain access to all leads. */
@media(max-width:760px){
 .expanded .lead-picker{display:block}
 .expanded.reading-mode .lead-picker>summary>span:not(.lead-current){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 .expanded.reading-mode .plot-region{display:block}
 .expanded.reading-mode .plot-region>.plot-scroll{height:100%;min-height:0;justify-content:flex-start}
 .expanded.reading-mode .sheet{margin:auto}
}
