/* One token system, five configurations. Loaded after legacy screen styles. */
html[data-design]{--ds-ink:#17243a;--ds-muted:#53627a;--ds-page:#eaf0f8;--ds-surface:#fff;--ds-soft:#f3f6fb;--ds-line:#d5deeb;--ds-accent:#5865e8;--ds-brand-teal:#20a58a;--ds-on-accent:#fff;--ds-radius:16px;--ds-gap:20px;--ds-pad:24px;--ds-rail:240px;--ds-shadow:0 6px 24px #17243a08;--ds-heading:"Bricolage Grotesque",sans-serif;--ds-body:"Hanken Grotesk",sans-serif;color-scheme:light}
html[data-design]{background:var(--ds-page);--major-background:var(--ds-page)!important;--major-accent:var(--ds-accent)!important;--major-soft:var(--ds-soft)!important;--major-line:var(--ds-line)!important;--major-sidebar:var(--ds-ink)!important}
html[data-design=workspace]{--ds-page:#f5f3ee;--ds-soft:#f8f6f1;--ds-line:#dedbd3;--ds-radius:7px;--ds-shadow:none;--ds-heading:"Hanken Grotesk",sans-serif}
html[data-design=analytics]{--ds-page:#eaf0f8;--ds-radius:12px;--ds-line:#cbd8e9;--ds-shadow:0 8px 28px #17243a0c}
html[data-design=ai]{--ds-page:#eff0fc;--ds-soft:#f4f2ff;--ds-radius:24px;--ds-shadow:0 12px 40px #4653c80a}
html[data-design=classic]{--ds-page:#edf2f4;--ds-soft:#f0f5f5;--ds-radius:8px;--ds-heading:"Hanken Grotesk",sans-serif;--ds-line:#c9d7dc}
html[data-design-accent=teal]{--ds-accent:#08745f}html[data-design-accent=blue]{--ds-accent:#2455cc}html[data-design-accent=plum]{--ds-accent:#7944a2}
html[data-design-accent=graphite]{--ds-accent:#334155}html[data-design-accent=amber]{--ds-accent:#925600}
html[data-design-density=compact]{--ds-gap:12px;--ds-pad:16px}html[data-design-density=spacious]{--ds-gap:28px;--ds-pad:32px}
html[data-color-mode=dark]{color-scheme:dark;--ds-ink:#eef2fb;--ds-muted:#b1bed3;--ds-page:#111a29;--ds-surface:#1b283b;--ds-soft:#24344b;--ds-line:#3d4d65;--ds-accent:#b6baff;--ds-on-accent:#17243a;--ds-shadow:none}
html[data-color-mode=dark][data-design-accent=teal]{--ds-accent:#71dfbf}html[data-color-mode=dark][data-design-accent=blue]{--ds-accent:#a8c4ff}html[data-color-mode=dark][data-design-accent=plum]{--ds-accent:#e0b5ff}
html[data-color-mode=dark][data-design-accent=graphite]{--ds-accent:#cbd5e1}html[data-color-mode=dark][data-design-accent=amber]{--ds-accent:#f9cb74}
@media(prefers-color-scheme:dark){html[data-design]:not([data-color-mode]){color-scheme:dark;--ds-ink:#eef2fb;--ds-muted:#b1bed3;--ds-page:#111a29;--ds-surface:#1b283b;--ds-soft:#24344b;--ds-line:#3d4d65;--ds-accent:#a8c4ff;--ds-on-accent:#17243a}}
html[data-design] body[data-hub]{--hub-ink:var(--ds-ink);--hub-muted:var(--ds-muted);--hub-accent:var(--ds-accent);--hub-soft:var(--ds-soft);--hub-line:var(--ds-line);--ink:var(--ds-ink);--muted:var(--ds-muted);--line:var(--ds-line);--teal:var(--ds-accent);background:var(--ds-page);color:var(--ds-ink);font-family:var(--ds-body)}
html[data-design] body[data-hub] :is(.shell,.shell>main,#today-root,.hub-appbar,.today-tabs){background:var(--ds-page);color:var(--ds-ink)}
html[data-design] body[data-hub] .shell{max-width:none;width:100%;margin:0;padding-left:var(--ds-rail);padding-right:0}
html[data-design] body[data-hub] .shell>main{width:100%;max-width:none;min-width:0}
html[data-design] body[data-hub] #today-root{max-width:none;width:100%;padding:var(--ds-pad);font-family:var(--ds-body)}
html[data-design] body[data-hub] :is(h1,h2,h3,h4){color:var(--ds-ink);font-family:var(--ds-heading)}
html[data-design] body[data-hub] :is(.panel,.course,.today-course,.today-deadlines,.today-course-section,.today-study,.today-exam,.today-open,.chat-sidebar,.chat-main,.academic-event){background:var(--ds-surface);color:var(--ds-ink);border:1px solid var(--ds-line);border-radius:var(--ds-radius);box-shadow:var(--ds-shadow)}
html[data-design] body[data-hub] :is(.muted,.eyebrow,small,.today-label,.today-secondary,.today-course-note,.today-empty,.today-day-note,#today-date,.today-rail-footer p){color:var(--ds-muted)}
html[data-design] body[data-hub] :is(.panel,.today-deadlines,.today-course-section,.today-study,.command-widget){padding:var(--ds-pad)}
html[data-design] body[data-hub] :is(button,input,select,textarea){color:var(--ds-ink);background:var(--ds-surface);border:1px solid var(--ds-line);font-family:var(--ds-body);border-radius:min(var(--ds-radius),12px);min-height:44px;max-width:100%}
html[data-design] body[data-hub] :is(input,select,textarea){padding:10px 12px}
html[data-design] body[data-hub] :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--ds-accent);outline-offset:3px}
html[data-design] body[data-hub] :is(button.primary,a.primary,.today-main-action){background:var(--ds-accent);color:var(--ds-on-accent);border-color:var(--ds-accent)}
html[data-design] body[data-hub] :is(a,.today-section-heading button){color:var(--ds-accent)}
html[data-design] body[data-hub] .today-next{background:#17243a;color:#fff;border-radius:var(--ds-radius);padding:var(--ds-pad);border:1px solid #34465f;min-height:240px}
html[data-design] body[data-hub] #today-next-title{color:#fff;font-family:var(--ds-heading);font-size:clamp(24px,2.4vw,38px)}
html[data-design] body[data-hub] .today-next :is(p,.today-label){color:#d5def0}
html[data-design] body[data-hub] .today-next .today-main-action{background:#fff;color:#17243a}
html[data-design] body[data-hub] .today-next .today-plan-action{background:#273a56;color:#fff;border-color:#6f809d}
html[data-design] body[data-hub] #today-root .today-next :is(p,.today-label){color:#d5def0}
html[data-design] body[data-hub] :is(button,input,select,textarea){transition:box-shadow .12s}
html[data-design] body[data-hub] #today-root button{transition:box-shadow .12s}
html[data-design] body[data-hub] #today-root input::placeholder{color:var(--ds-muted);opacity:1}
html[data-design] body[data-hub] #today-root :is(h1,h2){font-family:var(--ds-heading)}
html[data-design] body[data-hub] #today-root #today-next-title{font-size:clamp(24px,2.4vw,38px);color:#fff}
html[data-design] body[data-hub] #today-root .today-dropzone :is(p,span){color:var(--ds-muted)}
html[data-design] body[data-hub] #today-root .today-dropzone button{background:var(--ds-accent);color:var(--ds-on-accent);border-color:var(--ds-accent)}
html[data-design] body[data-hub] .today-rail-footer{background:var(--ds-soft);border:1px solid var(--ds-line);color:var(--ds-ink);padding:12px;border-radius:var(--ds-radius)}
html[data-design] body[data-hub] .today-rail-footer :is(strong,p,button){color:var(--ds-ink)}
html[data-design] body[data-hub] .today-rail{position:fixed;top:0;bottom:0;overflow-y:auto;left:0;right:auto;width:var(--ds-rail);background:var(--ds-surface);color:var(--ds-ink);border-right:1px solid var(--ds-line);padding:20px 12px}
html[data-design] body[data-hub] .today-rail :is(button,strong,span){color:var(--ds-ink)}
html[data-design] body[data-hub] .today-rail button{background:transparent;border-color:transparent;text-align:left}
html[data-design] body[data-hub] .today-rail button.active{background:var(--ds-soft);color:var(--ds-accent);border-color:var(--ds-line)}
html[data-design] body[data-hub] .today-rail-links>button{padding:10px 12px;font-size:14px;gap:10px}
html[data-design] body[data-hub] .today-rail-links>button>span:first-of-type{flex:1}
html[data-design] body[data-hub] :is(.today-ask,.today-day,.today-dropzone,#learning-view details,.calendar-day,.chat-bubble){background:var(--ds-soft);color:var(--ds-ink);border-color:var(--ds-line)}
html[data-design] body[data-hub] .today-ask input{border:0;background:transparent;color:var(--ds-ink)}
html[data-design] body[data-hub] .today-day.is-today{background:var(--ds-accent);color:var(--ds-on-accent)}
html[data-design] body[data-hub] .today-day.is-today :is(span,strong){color:inherit}
html[data-design] body[data-hub] .today-course-code{background:var(--ds-soft);color:var(--ds-accent)}
html[data-design] body[data-hub] .myday-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--ds-gap);align-items:start;margin-top:var(--ds-gap)}
html[data-design] body[data-hub] .myday-grid>[data-widget]{margin:0;min-width:0;width:100%}
html[data-design] body[data-hub] .myday-grid>[data-widget=week],html[data-design] body[data-hub] .myday-grid>[data-widget=studio]{grid-column:1/-1}
html[data-design] body[data-hub] .today-stats{display:grid;grid-template-columns:1fr 1fr;gap:var(--ds-gap)}
html[data-design] body[data-hub] .today-exam,html[data-design] body[data-hub] .today-open{padding:var(--ds-pad);min-height:240px}
html[data-design] body[data-hub] .today-heading{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
html[data-design] body[data-hub] .today-heading>div{flex:1;min-width:220px}
html[data-design] body[data-hub] .command-widget button{margin:6px 8px 0 0}
html[data-design=workspace] body[data-hub] .myday-grid>[data-widget=courses]{grid-column:1/-1}
html[data-design=workspace] body[data-hub] .today-courses{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}
html[data-design=analytics] body[data-hub] .metric-value{font-variant-numeric:tabular-nums;letter-spacing:-.05em}
html[data-design=ai] body[data-hub] .today-ask{border:2px solid var(--ds-accent);padding:12px 18px;box-shadow:var(--ds-shadow)}
html[data-design=ai] body[data-hub] .myday-grid>[data-widget=recommendations]{grid-column:1/-1;background:var(--ds-soft)}
html[data-design=classic] body[data-hub] .today-week-section{border-top:4px solid var(--ds-accent);padding-top:16px}
html[data-design][data-dashboard-arrangement=focus] body[data-hub] .myday-grid{grid-template-columns:minmax(0,1fr);max-width:1000px;margin-inline:auto}
html[data-design][data-dashboard-arrangement=wide] body[data-hub] .myday-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
html[data-design] body[data-hub] .design-dialog{width:min(1060px,96vw);max-height:92dvh;overflow:auto;padding:clamp(16px,3vw,32px);background:var(--ds-surface);color:var(--ds-ink);border:1px solid var(--ds-line);border-radius:var(--ds-radius)}
html[data-design] body[data-hub] .design-dialog::backdrop{background:#0c162c99;backdrop-filter:blur(4px)}
html[data-design] body[data-hub] .design-heading{display:flex;gap:16px;align-items:center;justify-content:space-between}
html[data-design] body[data-hub] .preset-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:12px;margin-block:24px}
html[data-design] body[data-hub] .preset-choices button{display:flex;flex-direction:column;gap:8px;padding:20px;text-align:left;min-height:140px;background:var(--ds-soft)}
html[data-design] body[data-hub] .preset-choices button[aria-pressed=true]{outline:2px solid var(--ds-accent);outline-offset:2px}
html[data-design] body[data-hub] .preset-choices span{font-size:14px;line-height:1.6;color:var(--ds-muted)}
html[data-design] body[data-hub] .design-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
html[data-design] body[data-hub] .design-field{display:flex;flex-direction:column;gap:8px;min-width:0;margin-bottom:12px}
html[data-design] body[data-hub] .widget-controls{border:1px solid var(--ds-line);padding:16px;margin:20px 0;border-radius:var(--ds-radius)}
html[data-design] body[data-hub] .widget-control{display:flex;gap:8px;align-items:center;border-bottom:1px solid var(--ds-line);padding:4px 0}
html[data-design] body[data-hub] .widget-control label{flex:1;display:flex;align-items:center;gap:12px;min-height:44px}
html[data-design] body[data-hub] .widget-control input{width:20px;min-height:20px;height:20px;accent-color:var(--ds-accent)}
html[data-design] body[data-hub] .design-dialog>button{margin:6px 8px 6px 0}
html[data-design] body[data-hub] .design-preview-bar{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:1000;display:flex;align-items:center;gap:12px;flex-wrap:wrap;width:max-content;max-width:95vw;padding:12px 20px;background:var(--ds-surface);border:2px solid var(--ds-accent);border-radius:16px;box-shadow:0 8px 40px #0003}
html[data-design] body[data-hub] :is(.academic-tabs,.academic-toolbar){display:flex;gap:12px;flex-wrap:wrap;margin-bottom:24px}
html[data-design] body[data-hub] .academic-tabs button[aria-pressed=true]{background:var(--ds-accent);color:var(--ds-on-accent)}
html[data-design] body[data-hub] .academic-table{border-collapse:collapse;width:100%;min-width:500px;background:var(--ds-surface);color:var(--ds-ink)}
html[data-design] body[data-hub] .academic-table :is(th,td){padding:12px;text-align:left;border-bottom:1px solid var(--ds-line)}
html[data-design] body[data-hub] .academic-table caption{text-align:left;padding:12px;color:var(--ds-muted)}
html[data-design] body[data-hub] .table-scroll{overflow:auto;max-width:100%;margin-bottom:24px}
html[data-design] body[data-hub] .academic-event{padding:20px;margin-bottom:12px}
html[data-design] body[data-hub] .command-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin-bottom:24px}
html[data-design] body[data-hub] .command-calendar-day{min-height:100px;padding:8px;background:var(--ds-surface);border:1px solid var(--ds-line);overflow-wrap:anywhere}
html[data-design] body[data-hub] .command-calendar-day p{font-size:12px;line-height:1.4;border-left:3px solid var(--ds-accent);padding-left:4px}
html[data-design] body[data-hub] .command-calendar-day[aria-current=date]{outline:2px solid var(--ds-accent)}
html[data-design][data-calendar-presentation=list] body[data-hub] .command-calendar{display:none}
html[data-design] body[data-hub] .gpa-row{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:12px;align-items:end;margin-bottom:16px}
html[data-design] body[data-hub] .gpa-row label{display:flex;flex-direction:column;gap:8px;min-width:0}
html[data-design] body[data-hub] .metric-value{display:block;font-size:44px;font-family:var(--ds-heading);color:var(--ds-accent)}
html[data-design] body[data-hub] progress{width:100%;accent-color:var(--ds-accent);height:12px}
html[data-design] body[data-hub] .gpa-chart{display:flex;gap:12px;align-items:end;height:160px;padding:20px 10px 0;border-bottom:1px solid var(--ds-line);overflow-x:auto}
html[data-design] body[data-hub] .gpa-bar{height:var(--bar-height);min-height:24px;min-width:44px;flex:1;max-width:110px;background:var(--ds-accent);color:var(--ds-on-accent);text-align:center;border-radius:8px 8px 0 0}
html[data-design] body[data-hub] .gpa-bar span{background:var(--ds-surface);color:var(--ds-ink);padding:2px 4px;border-radius:4px}
@media(min-width:1001px){html[data-design][data-sidebar=collapsed]{--ds-rail:150px}html[data-design][data-sidebar=collapsed] body[data-hub] .today-rail-links>button{font-size:12px;padding:8px 4px;gap:4px}html[data-design][data-sidebar=collapsed] body[data-hub] .today-rail-footer :is(strong,p){display:none}html[data-design][data-sidebar-position=right] body[data-hub] .shell{padding-left:0;padding-right:var(--ds-rail)}html[data-design][data-sidebar-position=right] body[data-hub] .today-rail{left:auto;right:0;border-left:1px solid var(--ds-line);border-right:0}}
@media(min-width:721px) and (max-width:1000px){html[data-design]{--ds-rail:190px}html[data-design] body[data-hub] .design-controls{grid-template-columns:1fr 1fr}html[data-design][data-dashboard-arrangement=wide] body[data-hub] .myday-grid{grid-template-columns:1fr 1fr}}
@media(max-width:720px){html[data-design] body[data-hub] .shell{padding:0}html[data-design] body[data-hub] .shell>main{padding:16px 16px calc(100px + env(safe-area-inset-bottom))}html[data-design] body[data-hub] #today-root{padding:0}html[data-design] body[data-hub] .myday-grid,html[data-design][data-dashboard-arrangement=wide] body[data-hub] .myday-grid{grid-template-columns:minmax(0,1fr)}html[data-design] body[data-hub] .design-controls{grid-template-columns:1fr}html[data-design] body[data-hub] .today-rail{display:none}html[data-design] body[data-hub] .today-tabs{border-color:var(--ds-line)}html[data-design] body[data-hub] .today-tabs button{padding:6px 3px;min-width:44px;border:0;background:transparent;color:var(--ds-muted)}html[data-design] body[data-hub] .today-tabs button.active{color:var(--ds-accent)}html[data-design] body[data-hub] .gpa-row{grid-template-columns:1fr 1fr}html[data-design] body[data-hub] .gpa-row label:first-child{grid-column:1/-1}html[data-design] body[data-hub] .design-preview-bar{bottom:calc(82px + env(safe-area-inset-bottom));padding:10px;font-size:13px}html[data-design] body[data-hub] .command-calendar{overflow-x:auto;grid-template-columns:repeat(7,minmax(90px,1fr))}html[data-design] body[data-hub] .today-stats{grid-template-columns:1fr 1fr}html[data-design] body[data-hub] .today-exam,html[data-design] body[data-hub] .today-open{min-height:180px}}
@media(prefers-reduced-motion:reduce){html[data-design] *,html[data-design] *::before,html[data-design] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

/* Stable shared branding and controls across every screen. */
html[data-design] body[data-hub] :is(.today-brand,.hub-home-action){display:flex;align-items:center;gap:10px;color:var(--ds-ink);background:transparent;box-shadow:none;letter-spacing:-.03em}
html[data-design] body[data-hub] :is(.today-brand,.hub-home-action)>strong{font-size:19px;color:var(--ds-ink);font-weight:700}
html[data-design] body[data-hub] .hub-brand-symbol{width:34px;height:34px;display:block;border-radius:9px;flex-shrink:0}
html[data-design] body[data-hub] .hub-nav-icon{width:20px;height:20px;flex:0 0 20px;vertical-align:middle}
html[data-design] body[data-hub] .hub-labelled-action{display:flex;gap:10px;align-items:center}
html[data-design] body[data-hub] #floating-ai{display:flex;align-items:center;gap:9px;background:var(--ds-accent);color:var(--ds-on-accent)}
html[data-design] body[data-hub] #floating-ai::before,html[data-design] body[data-hub] #floating-ai::after{content:none!important}
html[data-design] body[data-hub] :is(button,.primary){transition:box-shadow .16s ease,transform .16s ease,border-color .16s ease}
html[data-design] body[data-hub] :is(button,.primary):hover:not(:disabled){box-shadow:0 3px 10px #17243a10;border-color:var(--ds-accent)}
html[data-design] body[data-hub] button:active:not(:disabled){transform:translateY(1px)}
html[data-design] body[data-hub] :is(.library-panel,.study-workspace){background:var(--ds-surface);color:var(--ds-ink);border:1px solid var(--ds-line);border-radius:var(--ds-radius)}
html[data-design] body[data-hub] .library-panel :is(h2,strong){color:var(--ds-ink)}
html[data-design] body[data-hub] .library-panel :is(.muted,small,.empty){color:var(--ds-muted)}
html[data-design] body[data-hub] .library-panel :is(.upload-zone,.document-tile,.empty){background:var(--ds-soft);border-color:var(--ds-line);color:var(--ds-ink)}
html[data-design] body[data-hub] .library-panel .upload-zone>span{color:var(--ds-accent)}
html[data-design] body[data-hub] .document-tile.selected{border:2px solid var(--ds-accent);background:var(--ds-soft);color:var(--ds-ink)}
html[data-design] body[data-hub] .study-actions button{background:var(--ds-soft);border-color:var(--ds-line);color:var(--ds-ink)}
html[data-design] body[data-hub] .study-actions button:first-child{background:var(--ds-accent);border-color:var(--ds-accent);color:var(--ds-on-accent)}
html[data-design] body[data-hub] :is(#document-status,.provider-control select,.chat-file,.chat-history,#account-status){background:var(--ds-soft);color:var(--ds-ink);border-color:var(--ds-line)}
html[data-design] body[data-hub] .hub-profile-settings{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
html[data-design] body[data-hub] .hub-profile-settings h2{width:100%;margin:0}
html[data-design] body[data-hub] .hub-profile-settings p{flex:1;min-width:180px;color:var(--ds-muted)}
html[data-design] body[data-hub] [data-profile-avatar]{overflow:hidden}
html[data-design] body[data-hub] [data-profile-avatar] img{width:44px;height:44px;border-radius:50%;object-fit:cover;display:block}
html[data-design] body[data-hub] .saved-profile-avatar{width:52px;height:52px;border-radius:50%;background:var(--ds-soft);display:grid;place-items:center;color:var(--ds-accent);flex-shrink:0}
html[data-design] body[data-hub] #today-account{padding:0;border-radius:50%;background:var(--ds-surface);border:1px solid var(--ds-line);color:var(--ds-accent);display:grid;place-items:center;width:44px;height:44px}
html[data-design] body[data-hub] .hub-appbar-actions [data-profile-avatar]{padding:0;display:grid;place-items:center;width:44px;height:44px;border-radius:50%}
html[data-design] body[data-hub] ::selection{background:var(--ds-soft);color:var(--ds-ink)}
html[data-design] body[data-hub] :is(.sync-bar,#document-form,.study-question){background:var(--ds-soft);color:var(--ds-ink);border-color:var(--ds-line)}
html[data-design] body[data-hub] .sync-bar #sync-status{color:var(--ds-muted)}
html[data-design] body[data-hub] .hub-startup-note{background:var(--ds-surface);color:var(--ds-ink);border:1px solid var(--ds-line)}
html[data-design] body[data-hub] #document-form input{background:transparent;color:var(--ds-ink)}

@media(min-width:1001px){html[data-design][data-sidebar-position=right] body[data-hub] #floating-ai{right:calc(var(--ds-rail) + 24px)}}
