/* Graphite theme. Keep light Astra geometry; colour roles belong to these tokens. */
html[data-theme=dark]:has(body.beta){
 color-scheme:dark;
 --ui-bg:#101216;--ui-surface:#1b1e25;--ui-soft:#252a33;--ui-elevated:#2c323d;
 --ui-text:#e9ecf3;--ui-muted:#a5afc1;--ui-border:#353d4a;
 --ui-accent:#96b1ff;--ui-accent-soft:#263653;--ui-on-accent:#101b32;
 --ui-action:#496de5;--ui-on-action:#fff;
 --ui-success:#87d8b1;--ui-success-bg:#193b30;
 --ui-warning:#edc88a;--ui-warning-bg:#3f341f;
 --ui-danger:#f4a1af;--ui-danger-bg:#442831;
 background:var(--ui-bg);
}
html[data-theme=dark] body.beta{
 --ink:var(--ui-text);--muted:var(--ui-muted);--blue:var(--ui-accent);--bg:var(--ui-bg);--surface:var(--ui-surface);--line:var(--ui-border);
 --study-positive:var(--ui-success);--study-positive-soft:var(--ui-success-bg);--study-negative:var(--ui-danger);--study-negative-soft:var(--ui-danger-bg);
 color:var(--ui-text);background:var(--ui-bg);font-family:Inter,system-ui,sans-serif;
}
html[data-theme=dark] body.beta #beta-app{background:transparent}
html[data-theme=dark] body.beta .study-layout{background:transparent;border-color:transparent}
html[data-theme=dark] body.beta :is(h1,h2,h3,h4){color:var(--ui-text)}
html[data-theme=dark] body.beta .study-main h1{font-size:26px;line-height:1.2;letter-spacing:-.7px}
html[data-theme=dark] body.beta .study-heading{margin:0 0 14px}
html[data-theme=dark] body.beta .study-top{display:flex;align-items:center;gap:12px;background:transparent}
html[data-theme=dark] body.beta .study-wordmark{color:var(--ui-accent);font-family:Inter,system-ui,sans-serif;font-size:23px;letter-spacing:0}
html[data-theme=dark] body.beta .study-institution{color:var(--ui-muted);border-color:var(--ui-border)}
html[data-theme=dark] body.beta .study-footer{display:none}
html[data-theme=dark] body.beta .study-nav{background:var(--ui-surface);border:1px solid var(--ui-border)}
html[data-theme=dark] body.beta .study-nav button{color:var(--ui-muted);background:transparent;border-radius:18px}
html[data-theme=dark] body.beta .study-nav button.active{color:var(--ui-accent);background:var(--ui-accent-soft)}
html[data-theme=dark] body.beta .study-nav button svg{color:inherit;stroke:currentColor}
html[data-theme=dark] body.beta :is(.study-nav button,.campus-chip)::before,
html[data-theme=dark] body.beta :is(.study-nav button,.campus-chip)::after{display:none}
html[data-theme=dark] body.beta :is(.campus-card,.campus-post,.campus-profile-header,.course-item>summary,.course-detail,.profile-sheet,.beta-card,.detail-sheet,.semester-control,.grade-search,.study-empty,.directory-entry){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border)}
html[data-theme=dark] body.beta :is(.quiet-text,.data-timestamp,.study-eyebrow,.campus-muted,.campus-registration,.campus-handle,.campus-post time){color:var(--ui-muted)}
html[data-theme=dark] body.beta :is(.icon-button,.campus-icon-button,.astra-notifications,.astra-profile-settings,.campus-role-tag){background:var(--ui-soft);color:var(--ui-muted);border-color:var(--ui-border)}
html[data-theme=dark] body.beta :is(.study-button,.campus-button,.astra-compose,.campus-compose-fab):not(.secondary):not(.campus-secondary):not(.campus-danger){background:var(--ui-action);color:var(--ui-on-action)}
html[data-theme=dark] body.beta #study-main :is(.campus-settings-content,.campus-avatar-window) .campus-button{background:var(--ui-action);color:var(--ui-on-action)}
html[data-theme=dark] body.beta #study-main .banner-editor-save{background:var(--ui-action);color:var(--ui-on-action)}
html[data-theme=dark] body.beta :is(.campus-secondary,.study-button.secondary,.campus-profile-edit,.campus-follow-author){background:var(--ui-soft);color:var(--ui-text)}
html[data-theme=dark] body.beta :is(.campus-destructive,.beta-danger){background:var(--ui-danger-bg);color:var(--ui-danger)}
html[data-theme=dark] body.beta :is(.campus-chip-strip,.study-section-tabs,.campus-profile-tabs,.campus-club-segments){background:var(--ui-soft);border-color:var(--ui-border)}
html[data-theme=dark] body.beta :is(.campus-chip,.study-section-tabs button){background:transparent;color:var(--ui-muted)}
html[data-theme=dark] body.beta :is(.campus-chip[aria-pressed=true],.study-section-tabs button[aria-pressed=true]){background:var(--ui-elevated);color:var(--ui-accent);box-shadow:none}
html[data-theme=dark] body.beta .campus-feed-bar .campus-chip[aria-pressed=true]{background:var(--ui-elevated);color:var(--ui-accent)}
html[data-theme=dark] body.beta :where(input:not([type=checkbox]):not([type=radio]):not([type=color]),textarea,select){background:var(--ui-soft);color:var(--ui-text);border-color:var(--ui-border)}
html[data-theme=dark] body.beta :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:1}
html[data-theme=dark] body.beta :is(.grade-search,.campus-useful-search) input{background:transparent;border:0}
html[data-theme=dark] body.beta .semester-control{min-height:44px;height:44px;padding:0 14px;display:flex;align-items:center;border:1px solid var(--ui-border);border-radius:14px}
html[data-theme=dark] body.beta .semester-control>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
html[data-theme=dark] body.beta .semester-control select{background:transparent;border:0;width:100%;min-height:42px;font-size:14px;font-weight:600;padding:0}
html[data-theme=dark] body.beta .course-item>summary{padding:16px;gap:12px}
html[data-theme=dark] body.beta .course-item[open]>summary{background:#202b40;border-color:#394b69}
html[data-theme=dark] body.beta .course-item[open] .course-label>strong{font-size:16px;line-height:22px}
html[data-theme=dark] body.beta .course-label>strong{font-size:15px;line-height:21px;font-weight:600}
html[data-theme=dark] body.beta .course-detail{border-color:var(--ui-border)}
html[data-theme=dark] body.beta .course-totals strong{color:var(--ui-text)}
html[data-theme=dark] body.beta .grade-toolbar>span{color:var(--ui-text);font-size:16px;font-weight:600}
html[data-theme=dark] body.beta .task-work>strong{color:var(--ui-text);font-size:14px;line-height:20px;font-weight:600}
html[data-theme=dark] body.beta :is(.task-row,.course-detail,.km-columns){border-color:var(--ui-border)}
html[data-theme=dark] body.beta .mark-excellent{color:var(--ui-success);background:var(--ui-success-bg)}
html[data-theme=dark] body.beta .mark-good{color:var(--ui-accent);background:var(--ui-accent-soft)}
html[data-theme=dark] body.beta .mark-pass{color:var(--ui-warning);background:var(--ui-warning-bg)}
html[data-theme=dark] body.beta .mark-fail{color:var(--ui-danger);background:var(--ui-danger-bg)}
html[data-theme=dark] body.beta .mark-neutral{color:#c3ccdc;background:var(--ui-soft)}
html[data-theme=dark] body.beta .km-dot.km-missing{background:#596375}
html[data-theme=dark] body.beta .km-dot.km-pass{background:var(--ui-warning)}
html[data-theme=dark] body.beta .day-strip{padding:0;background:transparent;border:0}
html[data-theme=dark] body.beta .day-strip button{background:var(--ui-surface);color:var(--ui-muted);border-color:transparent;border-radius:16px}
html[data-theme=dark] body.beta .day-strip button[aria-pressed=true]{background:var(--ui-accent-soft);color:var(--ui-text);border-color:var(--ui-accent)}
html[data-theme=dark] body.beta .day-strip button[aria-pressed=true]>strong{color:var(--ui-text)}
html[data-theme=dark] body.beta .lesson-body{background:var(--ui-surface);border:1px solid var(--ui-border);color:var(--ui-text)}
html[data-theme=dark] body.beta .lesson-body.amber{background:#322c21;border-color:#544734}
html[data-theme=dark] body.beta .lesson-body.mint{background:#1b3029;border-color:#315145}
html[data-theme=dark] body.beta .lesson-body :is(.lesson-title,.lesson-place,.lesson-teacher){color:var(--ui-text)}
html[data-theme=dark] body.beta .lesson-body .lesson-kind{color:var(--ui-muted)}
html[data-theme=dark] body.beta .campus-avatar{background:var(--ui-accent-soft);color:var(--ui-accent)}
html[data-theme=dark] body.beta .campus-profile-photo .campus-avatar{border-color:var(--ui-surface)}
html[data-theme=dark] body.beta .campus-profile-title h1{font-size:22px;line-height:28px}
html[data-theme=dark] body.beta .campus-profile-tabs{border-radius:16px}
html[data-theme=dark] body.beta .campus-banner-action{background:#252a33ed;color:var(--ui-text)}
html[data-theme=dark] body.beta .campus-profile-bio{color:var(--ui-text)}
html[data-theme=dark] body.beta #study-main :is(.campus-compose-surface,.campus-compose-card,.campus-comment,.campus-compose-editor){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border)}
html[data-theme=dark] body.beta #study-main :is(.campus-comment-compose,.campus-compose-text,.campus-compose-options,.campus-emoji-picker){background:var(--ui-soft);color:var(--ui-text);border-color:var(--ui-border)}
html[data-theme=dark] body.beta #study-main .astra-notification-badge[data-enabled=true]{background:var(--ui-success-bg);color:var(--ui-success)}
html[data-theme=dark] body.beta #study-main .astra-mode-info{background:var(--ui-accent-soft);color:var(--ui-text)}
html[data-theme=dark] body.beta #study-main .astra-storage-settings aside{background:var(--ui-warning-bg);color:var(--ui-warning)}
html[data-theme=dark] body.beta #study-main .astra-storage-settings aside strong{color:var(--ui-warning)}
html[data-theme=dark] body.beta .study-role-speech,html[data-theme=dark] body.beta .study-role-speech::before{background:var(--ui-elevated);border-color:var(--ui-border)}
html[data-theme=dark] body.beta :is(.resource-error,.campus-error,.study-notice.error){background:var(--ui-danger-bg);color:var(--ui-danger);border-color:var(--ui-danger)}
html[data-theme=dark] body.beta .study-empty{box-shadow:none}
@media(max-width:999px){
 html[data-theme=dark] body.beta #beta-app{max-width:none;padding:var(--app-safe-top,env(safe-area-inset-top)) 0 0}
 html[data-theme=dark] body.beta .study-top{position:static;width:100%;height:40px;min-height:40px;margin:0 0 20px;padding:0}
 html[data-theme=dark] body.beta .study-nav{top:auto;display:flex;flex-direction:row;left:50%;right:auto;transform:translateX(-50%)}
 html[data-theme=dark] body.beta .study-nav button{min-width:0;min-height:54px;height:54px;flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:0 2px;font:500 11px/14px Inter,system-ui,sans-serif}
}
@media(min-width:1000px){
 html[data-theme=dark] body.beta .study-top{background:var(--ui-surface);border-bottom:1px solid var(--ui-border)}
 html[data-theme=dark] body.beta .study-nav{border:0;background:transparent}
 html[data-theme=dark] body.beta .study-main h1{font-size:32px;line-height:38px}
}
@media(hover:hover){html[data-theme=dark] body.beta :is(.study-nav button:not(.active),.campus-chip:not([aria-pressed=true]),.icon-button,.campus-icon-button):hover{background:var(--ui-elevated)}}
@media(max-width:359px){html[data-theme=dark] body.beta .study-nav button>span{font-size:9.5px}}

/* Surface geometry follows the light design, avoiding old square feed panels. */
html[data-theme=dark] body.beta .campus-feed-controls{gap:12px;margin-bottom:14px}
html[data-theme=dark] body.beta .campus-feed-options>summary{background:var(--ui-surface);border-color:var(--ui-border);border-radius:12px}
html[data-theme=dark] body.beta .campus-post{padding:16px;margin:0 0 14px;border:1px solid var(--ui-border);border-radius:20px}
html[data-theme=dark] body.beta .campus-post-text{font-size:13px;line-height:20px;margin:10px 0}
html[data-theme=dark] body.beta .campus-post h3{font-size:17px;line-height:23px;margin:10px 0 6px}
html[data-theme=dark] body.beta .campus-post time{font-size:11px;line-height:16px}
html[data-theme=dark] body.beta .campus-post-actions{gap:18px;margin-top:10px;padding:0;border:0}
html[data-theme=dark] body.beta .campus-post .campus-action{min-height:32px;padding:4px 0;background:transparent;border:0;font-size:12px;gap:6px}
html[data-theme=dark] body.beta .campus-action .campus-icon,html[data-theme=dark] body.beta .campus-study-heart{width:20px;height:20px}
html[data-theme=dark] body.beta .study-nav button .ui-icon{width:21px;height:21px}
html[data-theme=dark] body.beta .grade-controls{padding:0;margin:12px 0;background:transparent}
html[data-theme=dark] body.beta .grade-search input{min-height:40px;font-size:13px}
html[data-theme=dark] body.beta .campus-profile-header{border:1px solid var(--ui-border);border-radius:24px;overflow:visible;padding:0}
html[data-theme=dark] body.beta .campus-profile-cover{height:auto;aspect-ratio:3/1;margin:0;border-radius:24px 24px 0 0;overflow:hidden}
html[data-theme=dark] body.beta .campus-profile-content{padding:0 18px 18px}
html[data-theme=dark] body.beta .campus-profile-title{display:flex;align-items:center;justify-content:center;gap:6px}
html[data-theme=dark] body.beta .campus-profile-meta{font-size:12px;line-height:18px;color:var(--ui-muted)}
html[data-theme=dark] body.beta .campus-profile-bio{font-size:13px;line-height:20px;margin:10px 0}
html[data-theme=dark] body.beta .campus-social-counts{font-size:12px;gap:24px;line-height:22px;margin:0}
html[data-theme=dark] body.beta .campus-social-counts strong{font-size:18px;font-weight:650}
html[data-theme=dark] body.beta .campus-registration{font-size:11px;line-height:16px;opacity:1;margin:0}
html[data-theme=dark] body.beta .campus-profile-tabs{height:48px;padding:4px;gap:4px;margin:14px 0;border:0;border-radius:16px}
html[data-theme=dark] body.beta .campus-profile-tabs .campus-chip{height:40px;min-height:40px;flex:1;padding:0 10px;font-size:13px;border-radius:12px}
html[data-theme=dark] body.beta #study-main .campus-profile-tabs .campus-chip[aria-pressed=true]{background:var(--ui-elevated);color:var(--ui-accent)}
html[data-theme=dark] body.beta .campus-discovery section{padding:16px;margin-top:14px;border-radius:18px;background:var(--ui-surface)}
html[data-theme=dark] body.beta .campus-institute{border-color:var(--ui-border);color:var(--ui-text)}
html[data-theme=dark] body.beta #study-main .campus-composer-text{color:var(--ui-text);background:transparent}
html[data-theme=dark] body.beta #study-main .campus-composer-text:empty::before{color:var(--ui-muted)}
html[data-theme=dark] body.beta #beta-app:has(#study-main[data-study-view=profile] .campus-profile-header) .study-top{display:flex}
html[data-theme=dark] body.beta .study-nav button svg{stroke:none}
html[data-theme=dark] body.beta .campus-role-tag[data-role=admin]{background:var(--ui-accent-soft);color:var(--ui-accent)}
html[data-theme=dark] body.beta :is(.campus-post-menu,.campus-composer-more,.campus-emoji-picker,.campus-feed-options)>div{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border);box-shadow:0 12px 36px #0005}
html[data-theme=dark] body.beta #study-main .campus-emoji-picker>.astra-sticker-screen{background:var(--ui-bg)}
html[data-theme=dark] body.beta .campus-sticker-option{background:var(--ui-soft);color:var(--ui-muted);border-color:var(--ui-border)}
html[data-theme=dark] body.beta :is(.campus-post-menu,.campus-composer-more) .text-button{color:var(--ui-text)}
html[data-theme=dark] body.beta :is(.campus-post-menu,.campus-composer-more) .campus-danger{color:var(--ui-danger)}
html[data-theme=dark] body.beta #study-main .lesson-body:is(.is-upcoming,.is-current){background:var(--ui-action);color:var(--ui-on-action);border-color:transparent}
html[data-theme=dark] body.beta #study-main .lesson-body:is(.is-upcoming,.is-current) :is(.lesson-title,.lesson-meta,.lesson-kind,.lesson-place,.lesson-status,.lesson-teacher){color:var(--ui-on-action)}
html[data-theme=dark] body.beta .task-work{overflow-wrap:anywhere}
html[data-theme=dark] body.beta #study-main .banner-editor-tools{background:transparent;border-color:var(--ui-border)}
html[data-theme=dark] body.beta #study-main .banner-editor-options{border-color:var(--ui-border)}
html[data-theme=dark] body.beta #study-main .astra-stroke-done{background:var(--ui-action);color:var(--ui-on-action)}
/* Replaying Study or reconnecting keeps the selected application theme. */
html[data-theme=dark] body.beta .study-intro{background:var(--ui-bg);color:var(--ui-text);color-scheme:dark}
html[data-theme=dark] body.beta .study-intro::backdrop{background:var(--ui-bg)}
html[data-theme=dark] body.beta :is(.study-intro-bubble,.study-intro-choices button,.study-mode-card-body,.study-login-guide-copy){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-border);box-shadow:0 10px 32px #0003}
html[data-theme=dark] body.beta :is(.study-intro-text,.study-intro-progress,.study-mode-lead,.study-mode-footnote,.study-mode-note,.study-mode-eyebrow,.study-login-guide p){color:var(--ui-muted)}
html[data-theme=dark] body.beta :is(.study-intro-skip,.study-intro-back){background:var(--ui-soft);color:var(--ui-muted)}
html[data-theme=dark] body.beta .study-intro-next{background:var(--ui-action);color:var(--ui-on-action)}
html[data-theme=dark] body.beta :is(.study-intro-brand,.study-coach-grip,.study-intro-reaction,.study-intro-choices b){color:var(--ui-accent)}
html[data-theme=dark] body.beta .study-mode-choice{color:var(--ui-text)}
html[data-theme=dark] body.beta .study-mode-card input:checked+.study-mode-card-body{background:var(--ui-accent-soft);border-color:var(--ui-accent);box-shadow:0 0 0 1px var(--ui-accent)}
html[data-theme=dark] body.beta .study-mode-card input:checked+span .study-mode-radio{background:var(--ui-surface);border-color:var(--ui-accent)}
html[data-theme=dark] body.beta .study-mode-card input:checked+span .study-mode-icon{color:var(--ui-accent)}
html[data-theme=dark] body.beta .study-intro.is-tour .study-top{background:var(--ui-bg)}
html[data-theme=dark] body.beta .study-login-guide{color:var(--ui-text)}
html[data-theme=dark] body.beta .study-login-guide strong{color:var(--ui-text)}
html[data-theme=dark] body.beta .study-login-guide.is-success .study-login-guide-copy{background:var(--ui-surface);border-color:var(--ui-border)}
html[data-theme=dark] body.beta .study-login-guide-controls button{color:var(--ui-muted)}
html[data-theme=dark] body.beta .study-login-guide.is-collapsed .study-login-guide-controls button{background:var(--ui-surface);border-color:var(--ui-border)}
