/* App shell: frosted top bar, segmented navigation and unified controls. Loaded last; scoped to .topbar. */
:root{--shell-h:58px;--shell-radius:11px;--shell-ease:cubic-bezier(.2,.8,.2,1)}
html body .topbar{height:var(--shell-h);padding:0 20px;gap:16px;display:flex;align-items:center;justify-content:space-between;background:color-mix(in srgb,var(--ground,#15171c) 72%,transparent);-webkit-backdrop-filter:saturate(180%) blur(22px);backdrop-filter:saturate(180%) blur(22px);border-bottom:1px solid color-mix(in srgb,var(--line,#2a2e36) 70%,transparent);box-shadow:none;transition:box-shadow .25s ease,background .25s ease;flex-wrap:nowrap}
html body .topbar[data-scrolled]{box-shadow:0 10px 30px -18px rgba(0,0,0,.65);background:color-mix(in srgb,var(--ground,#15171c) 82%,transparent)}
html body .topbar .export-nav-left{display:flex;align-items:center;gap:14px;min-width:0;flex:1 1 auto}
html body .topbar .export-nav-divider{display:none}
html body .topbar .brand{display:inline-flex;align-items:center;gap:9px;flex-shrink:0;text-decoration:none;color:var(--ink);font-size:14.5px;letter-spacing:-.01em;padding:6px 8px 6px 4px;border-radius:10px;transition:background .2s}
html body .topbar .brand:hover{background:color-mix(in srgb,var(--ink) 5%,transparent)}
html body .topbar .export-brand-dot{width:9px;height:9px;border-radius:50%;background:var(--cyan,#22d3ee);box-shadow:0 0 0 3px color-mix(in srgb,var(--cyan,#22d3ee) 18%,transparent),0 0 14px color-mix(in srgb,var(--cyan,#22d3ee) 60%,transparent)}
html body .topbar .brand .font-mono{font-weight:650}
/* Segmented navigation */
html body .topbar nav{position:relative;display:flex;align-items:center;gap:2px;padding:3px;border-radius:calc(var(--shell-radius) + 3px);background:color-mix(in srgb,var(--ink,#fff) 4.5%,transparent);border:1px solid color-mix(in srgb,var(--line,#2a2e36) 60%,transparent);min-width:0;overflow-x:auto;scrollbar-width:none;flex:0 1 auto}
html body .topbar nav::-webkit-scrollbar{display:none}
html body .topbar nav .nav-indicator{position:absolute;left:0;top:3px;bottom:3px;width:0;border-radius:var(--shell-radius);background:color-mix(in srgb,var(--ground-2,#1e2128) 88%,var(--ink,#fff));box-shadow:0 1px 2px rgba(0,0,0,.35),inset 0 0 0 1px color-mix(in srgb,var(--ink,#fff) 9%,transparent);transition:transform .38s var(--shell-ease),width .38s var(--shell-ease),opacity .2s;pointer-events:none;z-index:0;opacity:0}
html body .topbar .nav-btn{position:relative;z-index:1;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 11px;border:0;border-radius:var(--shell-radius);background:transparent;color:var(--muted,#9aa3b2);font:560 13px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",Manrope,sans-serif;letter-spacing:-.005em;white-space:nowrap;cursor:pointer;transition:color .2s ease;box-shadow:none}
html body .topbar .nav-btn:hover:not(:disabled){color:var(--ink,#fff)}
html body .topbar .nav-btn.active{color:var(--ink,#fff);background:transparent}
html body .topbar .nav-btn.active:after,html body .topbar .nav-btn:after{display:none}
html body .topbar .nav-btn:focus-visible{outline:2px solid var(--cyan,#22d3ee);outline-offset:1px}
html body .topbar .nav-btn:disabled{opacity:.45;cursor:default}
.shell-icon{width:15px;height:15px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;opacity:.85}
.nav-btn.active .shell-icon{opacity:1;stroke:var(--cyan,#22d3ee)}
/* Right-side controls */
html body .topbar .export-nav-right{display:flex;align-items:center;gap:6px;flex-shrink:0}
html body .topbar .export-nav-right>button,html body .topbar .appearance>summary{display:inline-flex;align-items:center;gap:6px;height:34px;min-height:34px;padding:0 12px;border-radius:var(--shell-radius);border:1px solid transparent;background:transparent;color:var(--ink-2,var(--ink));font:560 13px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",Manrope,sans-serif;cursor:pointer;transition:background .18s ease,border-color .18s ease,color .18s ease,transform .15s ease;box-shadow:none;list-style:none}
html body .topbar .appearance>summary::-webkit-details-marker{display:none}
html body .topbar .export-nav-right>button:hover:not(:disabled),html body .topbar .appearance>summary:hover,html body .topbar .appearance[open]>summary{background:color-mix(in srgb,var(--ink,#fff) 7%,transparent);border-color:color-mix(in srgb,var(--line,#2a2e36) 80%,transparent)}
html body .topbar .export-nav-right>button:active:not(:disabled){transform:scale(.97)}
html body .topbar #formula-toggle[aria-expanded=true]{background:color-mix(in srgb,var(--cyan,#22d3ee) 14%,transparent);border-color:color-mix(in srgb,var(--cyan,#22d3ee) 45%,transparent);color:var(--ink)}
html body .topbar .export-nav-right>button#account-menu{display:inline-flex;padding:0 10px 0 4px;gap:8px;white-space:nowrap;flex-direction:row;max-width:200px;overflow:hidden;text-overflow:ellipsis}
html body .topbar .export-nav-right>button{white-space:nowrap}
html body .topbar .export-nav-right>button#account-menu:before{content:attr(data-initial);display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:linear-gradient(135deg,color-mix(in srgb,var(--cyan,#22d3ee) 70%,#6366f1),color-mix(in srgb,var(--cyan,#22d3ee) 30%,#0f172a));color:#fff;font:700 11.5px/1 -apple-system,BlinkMacSystemFont,sans-serif}
html body .topbar .export-nav-right>button#account-menu:not([data-initial]):before{content:'•'}
html body .topbar .export-nav-right>button#top-dashboard{height:34px;padding:0 15px;border-radius:var(--shell-radius);border:0;background:var(--cyan,#22d3ee);color:#06232b;font:700 13px/1 -apple-system,BlinkMacSystemFont,"SF Pro Text",Manrope,sans-serif;letter-spacing:.01em;text-transform:none;box-shadow:0 6px 16px -8px color-mix(in srgb,var(--cyan,#22d3ee) 70%,transparent)}
html body .topbar .export-nav-right>button#top-dashboard:hover:not(:disabled){background:color-mix(in srgb,var(--cyan,#22d3ee) 88%,#fff);border-color:transparent}
html body .topbar .report-issue-button{padding:0 10px}
/* Light theme */
html[data-theme=light] body .topbar{background:color-mix(in srgb,#fff 74%,transparent);border-bottom-color:rgba(15,23,42,.08)}
html[data-theme=light] body .topbar[data-scrolled]{box-shadow:0 10px 28px -20px rgba(15,23,42,.35)}
html[data-theme=light] body .topbar nav{background:rgba(15,23,42,.045);border-color:rgba(15,23,42,.06)}
html[data-theme=light] body .topbar nav .nav-indicator{background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.16),0 0 0 1px rgba(15,23,42,.05)}
html[data-theme=light] body .topbar .export-nav-right>button#top-dashboard{background:#0e7490;color:#fff}
html[data-theme=light] .nav-btn.active .shell-icon{stroke:#0e7490}
/* Page content enters smoothly on screen changes */
@keyframes shell-enter{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
#app.shell-entering>*{animation:shell-enter .32s var(--shell-ease) both}
/* Narrow screens: one tidy row, nav scrolls sideways under the brand */
@media(max-width:700px){html body .topbar .nav-btn .shell-icon{display:none}html body .topbar .nav-btn{padding:0 9px}}
@media(max-width:1220px){
 html body .topbar{height:auto;min-height:var(--shell-h);padding:8px 12px;flex-wrap:wrap;row-gap:8px}
 html body .topbar .export-nav-left{display:contents}
 html body .topbar .brand{order:0}
 html body .topbar .export-nav-right{order:1;margin-left:auto}
 html body .topbar nav{order:2;position:relative;flex:1 1 100%;width:100%;justify-content:space-between;top:auto;left:auto;right:auto;transform:none}
 html body .topbar .export-nav-right>button,html body .topbar .appearance>summary{padding:0 9px}
}
@media(prefers-reduced-motion:reduce){#app.shell-entering>*{animation:none}html body .topbar nav .nav-indicator{transition:none}}
/* Account menu: profile, settings, report and dashboard in one dropdown */
html body .topbar .export-nav-right{position:relative;z-index:30}
html body .topbar .shell-menu{position:relative;display:inline-flex}
html body .topbar .export-nav-right .shell-menu-trigger{display:inline-flex;align-items:center;gap:4px;height:36px;padding:0 6px 0 4px;border-radius:999px;border:1px solid color-mix(in srgb,var(--line,#2a2e36) 80%,transparent);background:color-mix(in srgb,var(--ink,#fff) 4%,transparent);color:var(--ink);cursor:pointer;transition:background .18s,border-color .18s,transform .15s}
html body .topbar .export-nav-right .shell-menu-trigger:hover,html body .topbar .export-nav-right .shell-menu-trigger[aria-expanded=true]{background:color-mix(in srgb,var(--ink,#fff) 9%,transparent);border-color:color-mix(in srgb,var(--cyan,#22d3ee) 40%,var(--line,#2a2e36))}
html body .topbar .export-nav-right .shell-menu-trigger:active{transform:scale(.96)}
html body .topbar .export-nav-right .shell-menu-trigger:focus-visible{outline:2px solid var(--cyan,#22d3ee);outline-offset:2px}
.shell-avatar{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,color-mix(in srgb,var(--cyan,#22d3ee) 70%,#6366f1),color-mix(in srgb,var(--cyan,#22d3ee) 30%,#0f172a));color:#fff;font:700 12px/1 -apple-system,BlinkMacSystemFont,sans-serif}
.shell-chevron{width:16px;height:16px;fill:none;stroke:var(--muted,#9aa3b2);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .25s var(--shell-ease)}
.shell-menu-trigger[aria-expanded=true] .shell-chevron{transform:rotate(180deg)}
.shell-menu-panel{position:absolute;right:0;top:calc(100% + 10px);z-index:1100;width:260px;padding:6px;border-radius:16px;border:1px solid color-mix(in srgb,var(--line,#2a2e36) 85%,transparent);background:color-mix(in srgb,var(--ground-2,#1b1e25) 94%,transparent);-webkit-backdrop-filter:saturate(180%) blur(24px);backdrop-filter:saturate(180%) blur(24px);box-shadow:0 24px 60px -20px rgba(0,0,0,.6),0 0 0 .5px rgba(255,255,255,.04) inset;opacity:0;transform:translateY(-4px) scale(.98);transform-origin:top right;transition:opacity .16s ease,transform .22s var(--shell-ease)}
.shell-menu-panel.open{opacity:1;transform:none}
.shell-menu-profile:empty{display:none}
.shell-menu-profile,.shell-menu-items{padding-bottom:6px;margin-bottom:6px;border-bottom:1px solid color-mix(in srgb,var(--line,#2a2e36) 70%,transparent)}
.shell-menu-items{display:grid;gap:1px}
html body .topbar .shell-menu-panel button{display:flex;align-items:center;gap:10px;width:100%;height:auto;min-height:38px;padding:8px 10px;border:0;border-radius:10px;background:transparent;color:var(--ink,#eef);font:560 13.5px/1.2 -apple-system,BlinkMacSystemFont,"SF Pro Text",Manrope,sans-serif;text-align:left;text-transform:none;letter-spacing:0;cursor:pointer;box-shadow:none;max-width:none;white-space:nowrap}
html body .topbar .shell-menu-panel button:hover:not(:disabled),html body .topbar .shell-menu-panel button:focus-visible{background:color-mix(in srgb,var(--cyan,#22d3ee) 13%,transparent);outline:none}
html body .topbar .shell-menu-panel .shell-icon{width:17px;height:17px;opacity:.8}
html body .topbar .shell-menu-panel button#account-menu{min-height:48px;font-weight:650}
html body .topbar .shell-menu-panel button#account-menu:before{content:attr(data-initial);display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,color-mix(in srgb,var(--cyan,#22d3ee) 70%,#6366f1),color-mix(in srgb,var(--cyan,#22d3ee) 30%,#0f172a));color:#fff;font:700 13px/1 -apple-system,BlinkMacSystemFont,sans-serif}
html body .topbar .shell-menu-panel button#account-menu:after{content:'Account';margin-left:auto;font:500 11.5px/1 -apple-system,BlinkMacSystemFont,sans-serif;color:var(--muted,#9aa3b2)}
html body .topbar .shell-menu-panel button.report-issue-button:before{content:'';width:17px;height:17px;flex-shrink:0;background:currentColor;opacity:.8;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 20.5V4.5M5.5 4.5h10l-1.8 3.6 1.8 3.9h-10'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 20.5V4.5M5.5 4.5h10l-1.8 3.6 1.8 3.9h-10'/%3E%3C/svg%3E") center/contain no-repeat}
html body .topbar .shell-menu-panel button#top-dashboard{justify-content:center;min-height:40px;background:var(--cyan,#22d3ee);color:#06232b;font-weight:700;box-shadow:0 6px 16px -8px color-mix(in srgb,var(--cyan,#22d3ee) 70%,transparent)}
html body .topbar .shell-menu-panel button#top-dashboard:hover:not(:disabled){background:color-mix(in srgb,var(--cyan,#22d3ee) 85%,#fff)}
html body .topbar .shell-menu-panel button#top-dashboard:disabled{opacity:.5}
html body .topbar .shell-menu-panel button#top-dashboard:after{content:'→';margin-left:6px}
/* Settings stays a real <details>; its summary is replaced by the menu item and its panel drops under the bar */
html body .topbar .appearance.shell-settings{position:static;display:contents}
html body .topbar .appearance.shell-settings>summary{display:none}
html body .topbar .appearance.shell-settings .appearance-panel{position:absolute;top:calc(100% + 10px);right:0;left:auto;z-index:1100}
html[data-theme=light] .shell-menu-panel{background:rgba(255,255,255,.94);border-color:rgba(15,23,42,.08);box-shadow:0 22px 50px -20px rgba(15,23,42,.35)}
html[data-theme=light] body .topbar .shell-menu-panel button#top-dashboard{background:#0e7490;color:#fff}
html[data-theme=light] body .topbar .export-nav-right .shell-menu-trigger{background:rgba(15,23,42,.04);border-color:rgba(15,23,42,.1)}
@media(prefers-reduced-motion:reduce){.shell-menu-panel,.shell-chevron{transition:none}}
/* Older responsive rules (report.css) force icon-only/ellipsis header buttons with !important; inside the menu every item is a full row */
html body .topbar .shell-menu-panel button#account-menu{display:flex!important;max-width:none!important;text-overflow:clip}
html body .topbar .shell-menu-panel button.report-issue-button{font-size:13.5px!important;width:100%!important;padding:8px 10px!important;justify-content:flex-start!important;text-align:left!important;margin:0!important}
html body .topbar .shell-menu-panel button.report-issue-button::before{content:''!important;font-size:0!important}
html body .topbar .shell-menu-panel button#top-dashboard{font:700 13.5px/1.2 -apple-system,BlinkMacSystemFont,"SF Pro Text",Manrope,sans-serif!important;text-transform:none!important;letter-spacing:0!important}
html body .topbar .shell-menu-panel{background:color-mix(in srgb,var(--ground-2,#1b1e25) 98%,transparent)}
html body .topbar .export-nav-right>button.exam-countdown{gap:8px;border-color:color-mix(in srgb,var(--line,#2a2e36) 80%,transparent);font-variant-numeric:tabular-nums}
html body .topbar .export-nav-right>button.exam-countdown[hidden]{display:none}
html body .topbar .exam-countdown-dot{width:7px;height:7px;border-radius:50%;background:var(--cyan,#22d3ee)}
html body .topbar .exam-countdown[data-state="soon"] .exam-countdown-dot{background:var(--amber,#f59e0b)}
html body .topbar .exam-countdown[data-state="today"] .exam-countdown-dot,html body .topbar .exam-countdown[data-state="live"] .exam-countdown-dot{background:var(--red,#ef4444);animation:exam-pulse 1.6s ease-in-out infinite}
@keyframes exam-pulse{50%{opacity:.35}}
@media(prefers-reduced-motion:reduce){html body .topbar .exam-countdown-dot{animation:none!important}}
