/* Reposition the existing workspace; palette and content stay in their theme. */
.app-shell,.app-shell.sidebar-collapsed{grid-template-columns:minmax(0,1fr)}
.app-sidebar{background:color-mix(in srgb,var(--surface) 76%,transparent);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
.sidebar-backdrop{background:transparent;border-radius:0;cursor:default}
.sidebar-backdrop::before{content:'';position:absolute;inset:0 0 0 auto;width:calc(var(--sidebar-width) + 88px);pointer-events:none;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);mask-image:linear-gradient(to right,transparent,#000 88px);-webkit-mask-image:linear-gradient(to right,transparent,#000 88px)}
.workspace-fit-budget{display:none}
.viewer-heading{display:contents}
.plot-region{border:0;border-radius:12px;background:transparent;box-shadow:none;overflow:visible;--plot-glow:0 0 18px rgb(222 213 162 / 28.102941%),0 0 44px rgb(222 213 162 / 20.07353%)}
/* Follow the visible paper, including when settings reduce its fitting area. */
.plot-region::before{content:'';position:absolute;left:var(--glow-left,0px);top:var(--glow-top,0px);width:var(--glow-width,100%);height:var(--glow-height,100%);border-radius:8px;box-shadow:var(--plot-glow);pointer-events:none}
.plot-region>.plot-scroll{border-radius:8px;scrollbar-width:none}
.plot-region>.plot-scroll::-webkit-scrollbar{display:none}
.plot-scroll{cursor:default}
.plot-scroll.pan-enabled{cursor:grab}
.plot-scroll.is-panning{cursor:grabbing}
.plot-scroll.measuring{cursor:crosshair}
.record-panel-morph-shell{position:absolute;pointer-events:none;border:1px solid var(--line);border-radius:12px;background:var(--surface);z-index:7}
/* A visible teal accent separates an opened panel from the graphite workspace. */
.workspace-layout .record-panel,.workspace-layout.panel-open:has(#quiz) .record-panel,.record-panel-morph-shell{background:linear-gradient(155deg,#34575e 0%,#263c40 42%,#202c32 100%);border-color:#567d81}
.record-panel .option:not(.correct):not(.incorrect):not(:hover){background:#202c32;border-color:#607b80}
.record-panel .quiz-navigation{position:static;background:transparent;flex-wrap:wrap;padding-bottom:4px}
.record-panel .quiz-navigation .button{flex:1 1 90px;min-height:44px}

@media(min-width:761px){
 .app-shell,.app-shell.sidebar-collapsed{--sidebar-width:360px}
 .workspace-layout .record-panel:not([hidden]){animation:none}
 .workspace-layout,.workspace-layout.panel-open{--action-width:112px;--workspace-gap:16px;--content-width:clamp(260px,28vw,380px);position:relative;grid-template-columns:var(--action-width) minmax(0,1fr) var(--action-width);grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px var(--workspace-gap)}
 .workspace-layout.panel-description{grid-template-columns:var(--content-width) minmax(0,1fr) 0}
 .workspace-layout.panel-test{grid-template-columns:0 minmax(0,1fr) var(--content-width)}
 .workspace-fit-budget{display:block;position:absolute;left:calc(var(--action-width) + var(--workspace-gap));right:calc(var(--action-width) + var(--workspace-gap));top:0;bottom:0;visibility:hidden;pointer-events:none}
 .ecg-viewer,.record-workspace,.record-actions{display:contents}
 .viewer-heading{display:flex;grid-column:1/-1;grid-row:1;flex-direction:column;align-items:center;gap:6px;padding:0 56px 6px;min-width:0}
 .viewer-title{flex-basis:auto;text-align:center;margin:0;font-size:24px}
 .viewer-chips{justify-content:center}
 .plot-region{grid-column:2;grid-row:2}
 .measurement-bar{grid-column:1/-1;grid-row:3;border-bottom:0;padding:0}
 .measurement-result{justify-content:center}
 .viewer-toolbar{grid-column:1/-1;grid-row:4;justify-content:center;gap:8px;z-index:6;padding-top:2px}
 .playback-quick{flex-basis:auto;order:0;gap:8px 12px}
 .playback-quick .playback-options{margin-left:0}
 .record-action{grid-row:2;align-self:center;min-height:72px;font-size:13px;border-radius:12px}
 .record-action[data-record-action=description]{grid-column:1}
 .record-action[data-record-action=test]{grid-column:3}
 .workspace-layout.panel-open .record-actions{display:none}
 .workspace-layout .record-panel,.workspace-layout.panel-open:has(#quiz) .record-panel{grid-row:2;position:relative;inset:auto;width:auto;height:100%;min-height:0;margin:0;padding:20px;border:1px solid #567d81;border-radius:12px;overflow:auto;overscroll-behavior:contain}
 .panel-description .record-panel{grid-column:1}
 .panel-test .record-panel{grid-column:3}
 .record-panel:has(#quiz) .record-panel-head{right:8px;top:8px}
 .record-panel:has(#quiz)>.record-panel-body{height:auto;min-height:100%}
 .workspace-layout .sheet{border-radius:8px}
 .viewer-toolbar .button,.viewer-toolbar .select-trigger,.viewer-toolbar .window-presets button,.viewer-settings>summary,.lead-picker>summary{border-radius:10px}
 .viewer-settings>summary,.lead-picker>summary{padding:10px 12px}
 .settings-panel,.lead-picker-panel{top:auto;bottom:calc(100% + 8px);max-height:min(420px,calc(100dvh - 140px))}
 .viewer-toolbar .select-options{top:auto;bottom:calc(100% + 6px)}
 .ecg-viewer.expanded{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:8px;z-index:18}
 .expanded .viewer-heading,.expanded .plot-region,.expanded .measurement-bar,.expanded .viewer-toolbar{grid-column:1}
 .expanded .viewer-toolbar>.screen-toggle{display:flex}
 .expanded .viewer-toolbar>.viewer-settings{order:0}
}
@media(min-width:761px) and (max-width:1050px){
 .workspace-layout,.workspace-layout.panel-open{--action-width:84px;--workspace-gap:12px}
 .viewer-toolbar{gap:6px}
 .viewer-toolbar .button,.viewer-toolbar .select-trigger,.viewer-settings>summary,.lead-picker>summary{padding:8px 10px;font-size:12px;min-height:40px}
 .playback-quick{gap:6px}
 .window-control>span,.playback-speed>span{display:none}
}
@media(max-width:760px){
 .plot-region{border-radius:10px;--plot-glow:0 0 16px rgb(222 213 162 / 23.371324%),0 0 36px rgb(222 213 162 / 16.775735%)}
 .viewer-heading{display:flex;flex-direction:column;grid-row:1;gap:4px;min-width:0}
 .viewer-title{flex-basis:auto}
 .viewer-toolbar{grid-row:2}
 .viewer-toolbar>.screen-toggle{top:auto;bottom:calc(100% + 14px)}
 .expanded .viewer-heading{display:none}
 .expanded .viewer-toolbar{grid-row:1}
 .workspace-layout.panel-open:has(#quiz) .record-actions{display:none}
}

/* Temporary highlight for the new subjects entry. */
.app-sidebar nav a.sidebar-subjects{color:#ff8c8c;background:#e343431a;animation:subjects-pulse 1.8s ease-in-out infinite}
.app-sidebar nav a.sidebar-subjects:hover,.app-sidebar nav a.sidebar-subjects[aria-current=page]{color:#ffb2b2;background:#e3434333}
@keyframes subjects-pulse{0%,100%{box-shadow:inset 0 0 0 1px #e3434333}50%{background:#e3434340;box-shadow:inset 0 0 0 1px #ff8c8c88}}
@media(prefers-reduced-motion:reduce){.app-sidebar nav a.sidebar-subjects{animation:none}}

/* Keep answered ECG quiz options vivid after the buttons become disabled. */
.record-panel #quiz .option:disabled{opacity:1}
.record-panel #quiz .option.correct{background:#176b43;border-color:#58ed98;color:#fff;box-shadow:inset 0 0 0 1px #58ed98}
.record-panel #quiz .option.incorrect{background:#962d3b;border-color:#ff7182;color:#fff;box-shadow:inset 0 0 0 1px #ff7182}
.record-panel #quiz:has(.option.correct) .feedback h3{color:#77f1aa}
.record-panel #quiz:has(.option.incorrect) .feedback h3{color:#ff8492}
@media(forced-colors:active){.record-panel #quiz .option.correct,.record-panel #quiz .option.incorrect{background:Canvas;color:CanvasText;border-color:Highlight;box-shadow:none;outline:2px solid Highlight}}

/* Shared result palette for every subject test and guided answer check. */
.st-test-overlay .st-answer-option.st-correct,.st-test-overlay .st-answer-feedback.st-correct{background:#176b43;border-color:#58ed98;color:#fff;opacity:1}
.st-test-overlay .st-answer-option.st-incorrect,.st-test-overlay .st-answer-feedback.st-incorrect{background:#962d3b;border-color:#ff7182;color:#fff;opacity:1}
.st-test-overlay .st-answer-option.st-correct .st-answer-letter{background:#58ed98;border-color:#58ed98;color:#103722}
.st-test-overlay .st-answer-option.st-incorrect .st-answer-letter{background:#ff7182;border-color:#ff7182;color:#49111b}
.st-test-overlay .st-answer-option.st-correct .st-answer-check{color:#82ffb6}
.st-test-overlay .st-answer-option.st-incorrect .st-answer-check{color:#ff9eaa}
.answer-feedback.correct,.answer-feedback.incorrect{padding:10px 12px;border-radius:8px;border:1px solid;line-height:1.5}
.answer-feedback.correct{background:#176b43;border-color:#58ed98;color:#fff}
.answer-feedback.incorrect{background:#962d3b;border-color:#ff7182;color:#fff}
@media(forced-colors:active){.st-test-overlay .st-answer-option.st-correct,.st-test-overlay .st-answer-option.st-incorrect,.st-test-overlay .st-answer-feedback,.answer-feedback.correct,.answer-feedback.incorrect{background:Canvas;color:CanvasText;border-color:Highlight}}

/* Test entry: two modes, plus a small pointer below the test button. */
.test-mode-choice{display:grid;gap:16px;padding-top:8px}
.test-mode-choice h2{margin:0 0 8px}
.test-mode-choice .eyebrow{margin:0}
.test-mode-button{display:grid;gap:10px;width:100%;padding:20px 16px;text-align:left;border:1px solid #71999c;border-radius:12px;background:#202c32;color:var(--ink);min-height:110px}
.test-mode-button strong{font-size:17px;color:#c9f2ec;line-height:1.4}
.test-mode-button span{font-size:14px;line-height:1.6;color:#b5cbd0}
.test-mode-button:hover,.test-mode-button:focus-visible{background:#31555b;border-color:#9ee7dc}
.record-action[data-record-action=test]{margin-bottom:26px}
.test-new-badge{position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%);padding:3px 9px;border-radius:5px;background:#aa3444;color:#fff;font-size:10px;font-weight:700;letter-spacing:.08em;line-height:1.4;pointer-events:none;animation:test-new-pulse 1.7s ease-in-out infinite}
.test-new-badge::before{content:'';position:absolute;width:7px;height:7px;left:calc(50% - 3.5px);top:-3px;transform:rotate(45deg);background:inherit}
@keyframes test-new-pulse{0%,100%{opacity:1}50%{opacity:.45}}
@media(prefers-reduced-motion:reduce){.test-new-badge{animation:none}}

/* Pathology filters reveal the new list without an abrupt height change. */
#pathology-list{overflow:hidden}
.record-magnifier{display:grid;place-items:center;flex:none;width:44px;height:44px;border-radius:50%;color:#8eafb5;transition:color 180ms ease,background-color 180ms ease}
.record-magnifier .ui-icon{width:24px;height:24px}
.record-magnifier:hover,.pathology-record:focus-visible .record-magnifier{color:#ded5a2;background:#ded5a21a}
.pathology-record:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
@media(prefers-reduced-motion:reduce){.record-magnifier{transition:none}}

/* A single moving pill follows the active pathology filter. */
.pathology-dialog .has-filter-aura{position:relative;isolation:isolate}
.pathology-dialog .has-filter-aura>button{position:relative;z-index:1}
.pathology-dialog .filter-aura{position:absolute;left:0;top:0;z-index:0;pointer-events:none;border-radius:999px;background:#73dbe210;will-change:transform,width,height}
.pathology-dialog .has-filter-aura>button[aria-pressed=true]{background:transparent}
.pathology-dialog .classification-branches .filter-aura{background:#d8c58a0b;border:1px solid #ded5a2}
.pathology-dialog .classification-branches.has-filter-aura>button[aria-pressed=true]{border-color:transparent}
@media(forced-colors:active){.pathology-dialog .filter-aura{background:Highlight}.pathology-dialog .has-filter-aura>button[aria-pressed=true]{color:HighlightText}}

/* Five compact ECG assignment cards in the visual family of other subjects. */
.practice-topics{max-width:1100px;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;padding:8px 0 26px}
.practice-topic{min-height:144px;padding:24px 28px;border:1px solid #ffffff0a;border-radius:20px;background:linear-gradient(108deg,#293238,#253238 56%,#2b4548);overflow:hidden;transition:background-color 200ms ease,border-color 200ms ease}
.practice-topic .practice-topic-copy{display:grid;gap:12px;min-width:0;white-space:normal}
.practice-topic strong{font-size:26px;line-height:1.2;letter-spacing:-.02em}
.practice-topic .practice-topic-art{display:grid;place-items:center;flex:none;width:66px;height:66px;color:#a8dcd7;opacity:.7;transition:transform 240ms ease,opacity 240ms ease}
.practice-topic-art>span,.practice-topic-art .ui-icon{width:52px;height:52px}
.practice-topic:hover,.practice-topic:focus-visible{color:var(--ink);border-color:#8edbd36b}
.practice-topic:hover .practice-topic-art,.practice-topic:focus-visible .practice-topic-art{transform:translateX(-4px);opacity:1}
.practice-topic:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
@media(max-width:760px){.practice-topics{gap:12px}.practice-topic{min-height:122px;padding:20px}.practice-topic strong{font-size:23px}.practice-topic .practice-topic-art{width:48px;height:48px}.practice-topic-art>span,.practice-topic-art .ui-icon{width:42px;height:42px}}
@media(max-width:540px){.practice-topics{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.practice-topic,.practice-topic .practice-topic-art{transition:none}}
