/* Shared shell composition for learner and host surfaces. Existing workspace
   controllers and public Start keep their own lifecycle and layout. */
#learnerShell { --shell-rail:72px; --shell-context:240px; height:100dvh; display:grid; grid-template-columns:var(--shell-rail) var(--shell-context) minmax(0,1fr); overflow:hidden; background:var(--learner-canvas); color:var(--learner-ink); font-family:var(--learner-font); }
#learnerShell[hidden] { display:none; }
#learnerShell[data-context=false] { grid-template-columns:var(--shell-rail) minmax(0,1fr); }
#learnerShell [hidden],#shellNavDialog [hidden] { display:none!important; }
#shellSelectedLab { margin:0 12px; font-size:19px; line-height:1.5; }
#learnerShell :is(button,a) { font-family:inherit; }
#learnerShell :is(button,.button),#shellNavDialog :is(button,.button) { min-height:40px; border:0; border-radius:999px; background:var(--learner-inset); color:var(--learner-ink); box-shadow:none; padding:9px 15px; font-size:13px; line-height:1.5; }
#learnerShell :is(button,a,summary):focus-visible,#shellNavDialog :is(button,a):focus-visible { outline:2px solid var(--learner-action); outline-offset:3px; }
#learnerShell button:hover,#shellNavDialog button:hover { background:var(--learner-hover); }
#learnerShell button.primary { background:var(--learner-action); color:var(--learner-on-action); }
#learnerShell button.primary:hover { background:var(--learner-action-hover); }
.shell-skip { position:fixed; top:-100px; left:12px; z-index:100; padding:12px 18px; background:var(--learner-surface); border-radius:12px; }
.shell-skip:focus { top:12px; }
.shell-rail { display:flex; align-items:center; flex-direction:column; padding:20px 6px 12px; gap:28px; min-height:0; overflow:auto; scrollbar-width:none; }
.shell-cloud { display:grid; place-items:center; width:48px; min-height:34px; }
.shell-rail nav,.shell-rail-bottom { display:flex; align-items:center; flex-direction:column; gap:10px; flex-shrink:0; }
.shell-rail-bottom { margin-top:auto; }
#learnerShell .shell-rail :is(nav,.shell-rail-bottom)>:is(a,button) { position:relative; display:flex; align-items:center; justify-content:center; width:48px; height:48px; min-height:48px; padding:12px; border-radius:16px; background:transparent; color:var(--learner-muted); text-decoration:none; }
#learnerShell .shell-rail :is(a,button):hover { color:var(--learner-ink); background:var(--learner-hover); }
#learnerShell .shell-rail [aria-current=page] { background:var(--learner-surface); color:var(--learner-ink); box-shadow:var(--learner-shadow-control); }
.shell-rail .icon { width:23px; height:23px; }
.shell-context { display:flex; flex-direction:column; gap:24px; padding:20px 18px 18px 8px; min-height:0; color:var(--learner-ink); background:var(--learner-canvas); }
.shell-brand { display:flex; flex-direction:column; padding:0 12px; gap:2px; }
.shell-brand b { font-size:23px; font-weight:650; letter-spacing:-.05em; }
.shell-brand span { font-size:12px; color:var(--learner-muted); }
.shell-context-scroll { flex:1; min-height:0; overflow:auto; }
.shell-context-heading { color:var(--learner-muted); font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.07em; padding:10px 12px; margin:0 0 4px; }
.shell-context nav { display:flex; flex-direction:column; gap:5px; margin-bottom:20px; }
#learnerShell .shell-context :is(nav a,nav button),#shellNavDialog .shell-context :is(nav a,nav button) { display:flex; align-items:center; justify-content:flex-start; gap:10px; width:100%; border-radius:13px; background:transparent; padding:11px 12px; text-align:left; font-size:13px; line-height:1.4; text-decoration:none; color:var(--learner-ink); }
#learnerShell .shell-context :is(nav a,nav button):hover,#shellNavDialog .shell-context :is(nav a,nav button):hover { background:var(--learner-hover); }
#learnerShell .shell-context :is([aria-current=page],[aria-pressed=true]),#shellNavDialog .shell-context :is([aria-current=page],[aria-pressed=true]) { background:var(--learner-surface); box-shadow:var(--learner-shadow-surface); }
.shell-context nav button>span:not(.shell-build-copy):not(.rail-label):not(.activity-dot):not(.app-ready):not([data-icon]) { margin-left:auto; font-size:11px; color:var(--learner-muted); }
.shell-context nav .icon { width:18px; height:18px; flex-shrink:0; }
.shell-context-note { font-size:12px; color:var(--learner-muted); line-height:1.8; padding:12px; }
#learnerShell[data-view="workspace"] .shell-context-footer { display:none; }
.shell-context-footer { border-radius:20px; padding:16px; background:var(--learner-surface); font-size:12px; }
.shell-context-footer .shell-context-heading { padding:0; margin-bottom:12px; font-size:10px; }
.shell-context-footer strong { display:block; font-size:13px; }
.shell-context-footer p:not(.shell-context-heading) { font-size:11px; color:var(--learner-muted); margin:5px 0 12px; }
.shell-context-footer button { width:100%; font-size:12px; }
.shell-build-copy { min-width:0; }
.shell-build-copy strong { display:block; font-size:12px; line-height:1.5; }
.shell-build-copy small { display:block; font-size:10px; color:var(--learner-muted); margin-top:3px; }
#shellLabTitle { font-size:17px; letter-spacing:-.02em; line-height:1.5; margin:0 12px 12px; }
#shellStatus { margin:0 12px 22px; }
#shellStatus .host-status { display:flex; font-size:11px; line-height:1.6; color:var(--learner-muted); gap:6px; }
#shellToolSlot .sidebar { display:block; border:0; padding:0; margin:0; background:transparent; overflow:visible; }
#shellToolSlot .sidebar nav { margin:0; }
#shellToolSlot .sidebar .rail-label { display:inline; }
#shellToolSlot .sidebar .sidebar-bottom { display:none; }
#shellToolSlot .sidebar button { position:relative; min-width:0; }
#shellToolSlot .sidebar :is(.activity-dot,.app-ready) { margin-left:auto; width:6px; height:6px; border-radius:50%; background:var(--learner-action); }
.shell-main { min-width:0; min-height:0; display:flex; flex-direction:column; padding-right:16px; }
.shell-bar { min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 14px 14px 12px; flex-shrink:0; }
#learnerShell #shellContextToggle { display:none; }
#shellWorkspaceActions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.shell-join { margin-left:auto; }
#shellWorkspaceActions .actions { display:flex; align-items:center; gap:8px; }
#learnerShell #workspaceMenuButton { display:none; }
#shellContent { flex:1; min-height:0; overflow:hidden; display:flex; flex-direction:column; }
#shellContent:focus { outline:none; }
#learnerShell #hub { flex:1; min-height:0; height:auto; background:transparent; overflow:auto; }
#learnerShell #hub .portal-header { display:none; }
#learnerShell #hub .portal-main { max-width:1180px; margin:0 auto; padding:32px 32px 48px; }
#learnerShell #hub h1[tabindex="-1"]:focus { outline:none; }
#learnerShell #studio { flex:1; min-height:0; height:auto; }
#learnerShell #studio>.topbar { display:none; }
#learnerShell #studio .app-shell { display:flex; min-height:0; }
#learnerShell #studio .workspace { flex:1; min-width:0; padding:0 0 18px; }
#learnerShell #studio .workspace-heading { min-height:82px; padding:10px 18px 20px; }
#learnerShell #studio .workspace-heading h1 { font-size:17px; }
#learnerShell #studio .heading-copy { width:auto; }
#shellFeedback #toast { position:static; transform:none; translate:none; width:auto; max-width:none; margin:0 12px 12px; border-radius:12px; font-size:13px; }
#shellNavDialog { color:var(--learner-ink); background:var(--learner-canvas); border:0; border-radius:0 24px 24px 0; width:min(320px,calc(100vw - 56px)); height:100dvh; max-height:100dvh; max-width:none; margin:0; padding:18px; font-family:var(--learner-font); }
#shellNavDialog::backdrop { background:#10182766; }
#shellNavDialog>header { display:flex; align-items:center; justify-content:space-between; gap:12px; }
#shellNavDialog>header h2 { font-size:16px; margin:0; }
#shellNavDialog>header button { font-size:24px; width:40px; padding:4px; }
#shellDrawerContent { height:calc(100% - 55px); }
#shellNavDialog .shell-context { height:100%; padding:20px 0 0; }
.shell-filter-summary { display:flex; align-items:center; gap:10px; margin:0 0 20px; flex-wrap:wrap; font-size:12px; color:var(--learner-muted); }
#learnerShell .shell-filter-summary button { font-size:12px; min-height:32px; padding:5px 10px; }
.shell-home-hero { display:grid; grid-template-columns:minmax(0,1fr) minmax(210px,.6fr); gap:32px; padding:36px; border-radius:28px; background:var(--learner-surface); margin:28px 0; }
.shell-home-hero h2 { margin:18px 0; font-size:32px; letter-spacing:-.04em; line-height:1.15; max-width:22ch; }
.shell-home-hero p { color:var(--learner-muted); font-size:15px; line-height:1.8; }
.shell-home-next { padding:24px; background:var(--learner-inset); border-radius:20px; }
.shell-home-next h3 { margin:0 0 16px; font-size:16px; }
.shell-home-next p { font-size:13px; margin:0 0 16px; }
.shell-home-facts { display:flex; gap:12px; flex-wrap:wrap; font-size:12px; color:var(--learner-muted); margin-top:20px; }
.shell-home-links { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.shell-home-links article,.shell-build-detail { padding:28px; background:var(--learner-surface); border-radius:28px; min-width:0; }
.shell-home-links p,.shell-build-detail p { color:var(--learner-muted); font-size:14px; line-height:1.8; }
.shell-home-links h2 { font-size:22px; letter-spacing:-.03em; }
.shell-build-detail h2 { font-size:25px; margin:18px 0 12px; }
.shell-build-facts { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:24px 0; }
.shell-build-facts div { background:var(--learner-inset); border-radius:16px; padding:16px; font-size:13px; }
.shell-build-facts dt { color:var(--learner-muted); font-size:11px; margin-bottom:7px; }
.shell-build-facts dd { margin:0; }
@media(max-width:1180px) { #learnerShell { --shell-context:212px; --shell-rail:64px; } .shell-bar { padding-inline:8px; } #learnerShell #hub .portal-main { padding:26px 20px 40px; } .shell-home-hero { padding:28px; gap:20px; } #shellWorkspaceActions .actions { gap:5px; } #shellWorkspaceActions :is(button,a) { font-size:12px; padding-inline:10px; } }
@media(max-width:1000px) { .shell-home-hero,.shell-home-links { grid-template-columns:1fr; } #learnerShell #studio .workspace-heading { min-height:108px; } #learnerShell #studio .heading-copy { width:100%; } }
@media(max-width:760px) {
 #learnerShell { --shell-rail:58px; grid-template-columns:var(--shell-rail) minmax(0,1fr); }
 .shell-context { display:none; }
 #shellNavDialog .shell-context { display:flex; }
 .shell-rail { gap:18px; padding:14px 4px 10px; }
 #learnerShell .shell-rail :is(nav,.shell-rail-bottom)>:is(a,button) { width:48px; height:48px; padding:12px; min-height:48px; border-radius:14px; }
 .shell-rail .icon { width:20px; height:20px; }
 .shell-rail nav,.shell-rail-bottom { gap:5px; }
 .shell-main { padding-right:8px; }
 .shell-bar { min-height:60px; padding:10px 4px; gap:8px; }
 #learnerShell #shellContextToggle { display:inline-flex; padding:10px; width:44px; min-height:44px; }
 #shellWorkspaceActions #labButton,#shellWorkspaceActions #download { display:none; }
 #shellWorkspaceActions #keepButton { font-size:11px; min-height:34px; padding:7px 10px; }
 #learnerShell #workspaceMenuButton { display:inline-flex; width:44px; min-height:44px; padding:10px; }
 #shellWorkspaceActions { gap:4px; }
 #shellWorkspaceActions #keepButton .keep-wide { display:none; }
 #shellWorkspaceActions #keepButton .keep-narrow { display:inline; }
 #shellMobileTools { margin-bottom:8px; flex-shrink:0; }
 #shellMobileTools .sidebar { display:block; background:transparent; padding:0; border:0; }
 #shellMobileTools .sidebar-bottom { display:none; }
 #shellMobileTools .workspace-nav { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:0; }
 #shellMobileTools .workspace-nav button { position:relative; flex-direction:column; gap:3px; min-width:0; width:100%; min-height:54px; border-radius:12px; font-size:10px; padding:7px 0; background:transparent; }
 #shellMobileTools .workspace-nav button[aria-current=page] { background:var(--learner-surface); }
 #shellMobileTools .rail-label { display:inline; }
 #shellMobileTools .workspace-nav .icon { width:18px; height:18px; }
 #shellMobileTools :is(.activity-dot,.app-ready) { position:absolute; right:10%; top:6px; width:5px; height:5px; border-radius:50%; background:var(--learner-action); }
 #learnerShell #studio .workspace { padding:0 0 8px; }
 #learnerShell #studio .workspace-heading { display:none; }
 #learnerShell #hub .portal-main { padding:22px 12px 36px; }
 .shell-home-hero { padding:24px; gap:22px; border-radius:24px; }
 .shell-home-hero h2 { font-size:27px; }
 .shell-home-next { padding:20px; }
 .shell-home-links { gap:14px; }
 .shell-home-links article,.shell-build-detail { padding:23px; border-radius:24px; }
 .shell-build-facts { grid-template-columns:1fr; }
 #shellFeedback #toast { margin-inline:4px; font-size:12px; padding:9px 12px; }
}
@media(max-height:620px) { .shell-rail { gap:10px; padding-top:10px; } .shell-rail nav { gap:3px; } .shell-context { gap:14px; padding-top:10px; } .shell-context-footer { padding:12px; } .shell-bar { min-height:56px; padding-block:8px; } }

#shellToolSlot .sidebar nav button { display:flex; align-items:center; justify-content:flex-start; gap:10px; width:100%; height:auto; min-height:44px; padding:11px 12px; font-size:13px; }
#shellToolSlot .sidebar .rail-label { margin:0; font-size:13px; color:inherit; }
#learnerShell .shell-rail [aria-current=page] { background:var(--learner-surface); }

/* Private account surfaces share the shell's existing composition and tokens. */
.account-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.account-card { padding:28px; border-radius:28px; background:var(--learner-surface); min-width:0; }
.account-card h2 { font-size:22px; margin:0 0 18px; letter-spacing:-.03em; }
.account-card p { font-size:14px; line-height:1.8; color:var(--learner-muted); }
.account-card label:not(.account-appearance label) { display:flex; flex-direction:column; gap:8px; margin:18px 0; font-size:14px; }
.account-card :is(input:not([type=radio]),textarea) { width:100%; min-width:0; padding:12px 14px; border:1px solid var(--learner-line); background:var(--learner-inset); color:var(--learner-ink); border-radius:14px; font:inherit; }
.account-card textarea { resize:vertical; }
.account-card fieldset { border:0; padding:0; margin:20px 0; }
.account-card legend { font-size:14px; margin-bottom:12px; }
.account-appearance { display:flex; flex-wrap:wrap; gap:16px; }
.account-appearance label { display:flex; align-items:center; gap:7px; min-height:44px; }
.account-card .account-sign-out { margin-top:24px; }
.account-card [role=alert] { color:var(--learner-action); }
.account-notice { padding:16px; border-radius:16px; background:var(--learner-inset); }
.account-history { margin-top:24px; }
.account-history ul { list-style:none; padding:0; }
.account-history li { display:flex; justify-content:space-between; align-items:start; gap:20px; padding:20px 0; border-top:1px solid var(--learner-line); }
.account-history li>div { min-width:0; }
.account-history :is(dd,strong,small) { overflow-wrap:anywhere; }
.account-history dd { margin:6px 0 16px; font-family:monospace; font-size:12px; }
.account-history summary { padding:10px 0; cursor:pointer; }
@media(max-width:1100px) { .account-grid { grid-template-columns:1fr; } }
@media(max-width:760px) { .account-card { padding:24px; border-radius:24px; } .account-history li { flex-direction:column; } }

/* Learning outcomes and event history use the same surfaces as the workspace. */
.learning-grid { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(260px,1fr); gap:24px; align-items:start; }
.path-card h2 { margin-top:18px; }
.path-total { display:flex; align-items:center; gap:16px; margin:24px 0 12px; }
.path-total strong { font-size:44px; line-height:1; letter-spacing:-.05em; }
.path-total strong span { color:var(--learner-muted); font-size:26px; }
.path-total>span { color:var(--learner-muted); font-size:13px; }
.path-card progress { width:100%; height:9px; border:0; border-radius:99px; overflow:hidden; accent-color:var(--learner-action); }
.path-card progress::-webkit-progress-bar { background:var(--learner-inset); border-radius:99px; }
.path-card progress::-webkit-progress-value { background:var(--learner-action); border-radius:99px; }
.path-steps,.learning-list { list-style:none; padding:0; margin:24px 0 0; }
.path-steps>li { display:grid; grid-template-columns:32px minmax(0,1fr); gap:16px; padding:24px 0; border-top:1px solid var(--learner-line); }
.path-steps h3 { font-size:17px; line-height:1.4; margin:2px 0 10px; }
.step-mark { display:grid; place-items:center; width:32px; height:32px; border-radius:50%; background:var(--learner-inset); font-size:13px; }
.step-mark .icon { width:17px; height:17px; }
.badge-emblem { display:grid; place-items:center; width:72px; height:72px; background:var(--learner-inset); color:var(--learner-action); border-radius:24px; margin-bottom:24px; }
.badge-emblem .icon { width:40px; height:40px; }
.achievement-card h2 { margin-top:18px; }
.badge-celebration { padding:18px; background:var(--learner-inset); border-radius:18px; margin:20px 0; font-size:14px; }
.badge-celebration button { margin-top:14px; }
.learning-evidence summary { cursor:pointer; padding:12px 0; font-size:13px; }
.learning-evidence dd,.evidence-reference { overflow-wrap:anywhere; font-size:12px; }
.learning-evidence dd { margin:5px 0 14px; }
.learning-evidence dt { font-size:12px; color:var(--learner-muted); }
.learning-activity,.home-progress,.event-join { margin-top:24px; }
.learning-list>li { display:flex; justify-content:space-between; align-items:start; gap:20px; padding:20px 0; border-top:1px solid var(--learner-line); min-width:0; }
.learning-list>li>div { min-width:0; }
.learning-list strong,.event-history h3 { overflow-wrap:anywhere; }
.learning-actions { display:flex; flex-wrap:wrap; gap:12px; }
.event-history>section { margin-bottom:32px; }
.event-history>section>h2 { margin-bottom:22px; font-size:20px; }
.event-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.event-card-top { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; color:var(--learner-muted); font-size:12px; }
.event-history h3 { font-size:23px; line-height:1.3; margin:24px 0 18px; }
.sharing-card { max-width:900px; }
.account-card .sharing-choice { flex-direction:row; align-items:center; gap:12px; }
.account-card .sharing-choice input { width:18px; height:18px; flex-shrink:0; }
.public-preview { border:1px solid var(--learner-line); border-radius:24px; padding:24px; margin-top:28px; overflow-wrap:anywhere; }
.public-preview section { margin-top:24px; padding-top:20px; border-top:1px solid var(--learner-line); }
#sharingPreview>.primary { margin:12px 0 20px; }
#learnerShell .learning-limitation { margin-top:24px; font-size:12px; }
@media(max-width:1180px) { .learning-grid,.event-grid { grid-template-columns:1fr; } }
@media(max-width:760px) { .learning-grid,.event-grid { gap:16px; } .path-steps>li { gap:12px; } .learning-list>li { flex-direction:column; } .public-preview { padding:20px; } }

.journey-event { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:16px; padding:18px 22px; background:var(--learner-inset); border-radius:20px; margin:24px 0; }
.journey-event strong,.journey-event .eyebrow { display:block; }
.journey-event strong { font-size:14px; margin-top:6px; }
.home-section-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.home-section-heading h2 { margin:8px 0 0; font-size:25px; letter-spacing:-.03em; }
.home-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; margin:0; }
.home-metrics div { display:flex; flex-direction:column-reverse; gap:8px; }
.home-metrics dt { color:var(--learner-muted); font-size:12px; }
.home-metrics dd { margin:0; font-size:26px; letter-spacing:-.04em; }
.home-learning-details { border-top:1px solid var(--learner-line); margin-top:20px; padding-top:6px; scroll-margin-top:24px; }
.home-learning-details>summary { cursor:pointer; padding:18px 0; font-size:14px; line-height:1.6; }
.home-learning-details .account-card { background:var(--learner-inset); border-radius:20px; }
.home-learning-details .learning-grid { margin-top:18px; }
.home-catalog { margin-top:30px; }
.home-lab-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin-top:24px; }
.home-lab-grid article { display:flex; flex-direction:column; align-items:start; }
.home-lab-grid h3 { font-size:23px; line-height:1.3; letter-spacing:-.03em; margin:20px 0 0; }
.home-lab-grid p { flex:1; }
.home-lab-meta { font-size:12px; color:var(--learner-muted); margin-bottom:18px; }
#learnerShell[data-context=false] .shell-bar { min-height:32px; padding-block:8px; }
.home-progress:has(.home-learning-overview) { display:grid; grid-template-columns:1fr 1fr; gap:0 24px; }
.home-learning-overview { display:flex; justify-content:space-between; align-items:center; gap:28px; grid-column:1 / -1; }
.home-learning-overview .home-section-heading { display:block; }
.home-learning-overview .home-section-heading h2 { font-size:20px; }
.home-learning-overview .home-section-heading button { margin-top:12px; }
.home-progress>.home-learning-details[open],.home-progress>p,.home-progress>button { grid-column:1 / -1; }
.journey-refresh { font-size:13px; padding:12px 18px; border-radius:16px; background:var(--learner-inset); }
#your-learning { scroll-margin-top:24px; }
.finish-actions #finishNext { grid-column:1 / -1; }
@media(max-width:1050px) { .home-lab-grid { grid-template-columns:1fr; } }
@media(min-width:761px) { #learnerShell[data-view=home] .shell-home-hero { padding:28px; margin:20px 0; gap:24px; } #learnerShell[data-view=home] .shell-home-hero h2 { margin:12px 0; font-size:28px; } }
@media(max-width:900px) { .home-learning-overview { align-items:start; flex-direction:column; gap:24px; } .home-metrics { width:100%; } }
@media(max-width:600px) { .home-progress:has(.home-learning-overview) { grid-template-columns:1fr; } .home-metrics { gap:12px; } .home-metrics dt { font-size:11px; } .home-section-heading h2 { font-size:23px; } }

/* Role-neutral shell identity. Host navigation uses the same context slot and
   mobile dialog as Library/builds; no workspace DOM is needed to mount it. */
#shellIdentity { font-size:12px; color:var(--learner-muted); min-width:0; overflow-wrap:anywhere; }
#learnerShell[data-role=host] #shellWorkspaceActions { display:none; }
#learnerShell[data-role=host] .shell-context-footer { display:none; }
#learnerShell[data-role=host] #hub .portal-main { width:100%; }
#shellNavDialog .host-context-search input { font-family:var(--learner-font); }
@media(max-width:760px) { #shellIdentity { font-size:11px; } }
