/* One palette and navigation system for the subject library and AI tutor. */
:root{--font:Inter,'Helvetica Neue',Arial,sans-serif;--heading:var(--font);--gold:#7047eb;--gold-2:#5933cc;--gold-soft:#eee8ff;--navy:#191625;--navy-2:#231c38;--rai-paper:#f7f7fc;--rai-surface:#fff;--rai-border:#e8e5f1;--rai-text:#191625;--rai-muted:#6e687d;--rai-soft:#f0edf8;--ink:#191625;--ink-2:#423b55;--line:#e8e5f1;--bg:#f7f7fc;--head:#191625;--mint:#8bf0cf}
:root[data-theme="dark"]{--gold:#b29aff;--gold-2:#c7b6ff;--gold-soft:#35264f;--navy:#15111f;--navy-2:#1d172b;--rai-paper:#15111f;--rai-surface:#211a30;--rai-border:#3b304d;--rai-text:#f4efff;--rai-muted:#b9afc9;--rai-soft:#2d243c;--ink:#f4efff;--ink-2:#dbd2ea;--line:#3b304d;--bg:#15111f;--head:#f4efff}
.btn.p,.btn.g,.greet .btn.p,.greet .btn.g{background:#7047eb;border-color:#7047eb;color:#fff}.btn.p:hover,.btn.g:hover{background:#6037d7;border-color:#6037d7}
.side{background:var(--navy-2)}
.rai-workspace-nav{display:block!important;overflow-y:auto}
.rai-workspace-nav .rai-primary-nav{display:grid;gap:5px;margin-bottom:24px}
#nav.rai-workspace-nav a{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:9px;font-size:13px;line-height:1.45;font-weight:500;color:#c8bfd9;background:transparent;white-space:normal;margin:0;border:0}
#nav.rai-workspace-nav a:hover{color:white;background:#ffffff09}
#nav.rai-workspace-nav a.on,#nav.rai-workspace-nav a.active{background:#ffffff12;color:#fff;box-shadow:inset 3px 0 0 #8bf0cf}
.rai-workspace-nav svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.rai-workspace-group{border-top:1px solid #ffffff13;padding-top:9px;margin-top:9px}
.rai-workspace-group summary{display:flex;align-items:center;justify-content:space-between;list-style:none;padding:11px 14px;color:#a99dbd;font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;cursor:pointer}
.rai-workspace-group summary::-webkit-details-marker{display:none}.rai-workspace-group summary:after{content:'+';font-size:16px;line-height:1}.rai-workspace-group[open] summary:after{content:'−'}
#nav.rai-workspace-nav .rai-workspace-group a{font-size:12px;padding:9px 14px}
.rai-ai-tabs{display:flex;align-items:center;gap:24px;border-bottom:1px solid var(--rai-border);margin:0 0 24px;padding:0;background:transparent;border-radius:0;overflow-x:auto}
.rai-ai-tabs a{display:flex;align-items:center;min-height:46px;padding:10px 0 12px;border-bottom:2px solid transparent;color:var(--rai-muted);font-size:13px;font-weight:500;border-radius:0;white-space:nowrap}
.rai-ai-tabs a:hover{background:transparent;color:var(--gold)}.rai-ai-tabs a[aria-current]{color:var(--gold);border-bottom-color:var(--gold);font-weight:600}
.rai-session-summary{display:flex;align-items:center;justify-content:space-between;gap:20px;border:1px solid var(--rai-border);border-radius:12px;background:var(--rai-surface);padding:17px 20px;margin-top:16px;color:var(--rai-text)}
.rai-session-summary>span:first-child{display:flex;align-items:center;gap:14px}.rai-session-summary svg{width:24px;height:24px;fill:none;stroke:var(--gold);stroke-width:1.5}.rai-session-summary strong{font-size:13px;display:block}.rai-session-summary small{display:block;font-size:11px;color:var(--rai-muted);margin-top:3px}
.rai-ai-note{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:20px;font-size:11px;color:var(--rai-muted)}.rai-ai-note a{color:var(--gold)}
.rai-unified-tutor .tcard{padding:20px}.rai-unified-tutor .tcard .t{font-size:14px!important}.rai-unified-tutor .tcard p{margin:8px 0 0;color:var(--rai-muted);font-size:12px;line-height:1.7}
.rai-dashboard-welcome{background:var(--rai-surface)!important;border:1px solid var(--rai-border);box-shadow:none!important}.rai-dashboard-welcome:before,.rai-dashboard-welcome:after{display:none!important}.rai-dashboard-welcome h1{color:var(--rai-text);font-size:29px}.rai-dashboard-welcome p,.rai-dashboard-welcome .sub{color:var(--rai-muted)}
.rai-dashboard .rai-quick-start{margin-top:24px}.rai-quick-card{box-shadow:none!important;border-radius:12px!important}.rai-quick-card .rai-quick-icon{background:var(--rai-soft);color:var(--gold)}
/* Interactive tutor shares the account shell; lesson controls stay inside its workspace. */
.sidebar{width:258px;background:var(--navy-2);color:#fff;border:0;padding:25px 18px 20px}
.sidebar .unified-brand{display:flex;flex-direction:column;align-items:flex-start;gap:5px;padding:0 12px 24px}.unified-brand img{width:172px;height:auto}.unified-brand>span{font-size:10px;letter-spacing:.15em;text-transform:uppercase;color:#b3a7c7}
.sidebar .workspace-label{margin:8px 14px 18px;color:#9c8fb0;font-size:9px}.sidebar .side-bottom{padding-top:12px}.sidebar .side-link{color:#bdb1ce;font-size:12px}.sidebar .profile{border-color:#ffffff19;color:white}.sidebar .profile small{color:#bdb1ce}.sidebar .profile-avatar{background:#51406e;color:#f4edff;border-color:#51406e}
.shell{margin-left:258px}.topbar{height:72px}.topbar .workspace-menu{display:none}.topbar .preview-badge{font-size:10px}.app-footer{font-size:10px}.app-footer a{color:var(--muted)}
.shell main{padding-top:22px}.shell .page-heading{margin-bottom:22px}.shell .page-heading h1{font-size:27px}.shell .heading-action{margin-top:2px}.shell .lesson-bar{border-radius:12px}.shell .board-kicker{display:none}.shell .board-header{padding:19px 22px 14px}.shell .board-title{font-size:19px}.shell .studio-grid{grid-template-columns:minmax(210px,.78fr) minmax(0,2fr);gap:20px}.shell .coach-stage,.shell .coaching-mode .coach-stage{height:220px}.shell .coach-art{width:240px}.shell .coach-caption{padding:18px}.shell .coach-caption p{font-size:12px;line-height:1.75}.shell .coach-name{font-size:10px}.shell .caption-heading{font-size:12px}.shell .mode-tabs{padding:0 20px;flex-wrap:nowrap!important;gap:18px}.shell .mode-tabs button{padding:12px 0;font-size:12px;min-height:42px}.shell .mode-tabs button .ico{display:none}
.more-activities{display:flex;align-items:center;justify-content:flex-end;gap:9px;padding:10px 22px 0;font-size:10px;color:var(--muted)}.more-activities select{font:11px var(--font);color:var(--body);border:1px solid var(--line);border-radius:7px;background:var(--surface);padding:6px 8px;max-width:160px}
.shell .coaching-toolbar{margin-bottom:16px}.shell .coaching-studio{padding:17px 22px 22px}.shell .coaching-intro h3{font-size:23px}.shell .coaching-intro>p{font-size:13px}.shell .coaching-orbit{display:none}.shell .coaching-plan{margin:20px 0;padding:16px 0}.shell .interaction{border-radius:13px}.shell .ask-form{padding-left:17px}.shell .interaction-extra{gap:15px}.shell .subject-card{border-radius:14px}.shell .page-heading p a,.shell .below-note a{color:var(--violet)}
.workspace-more{display:none}
@media(min-width:1024px){.shell .rai-ai-tabs{margin-bottom:25px}.sidebar #nav{flex:1;min-height:0}.sidebar .side-bottom{flex:none}.shell main{max-width:1450px}}
@media(max-width:1023px){
 .sidebar{inset:auto 0 0;width:auto;height:68px;padding:0;background:var(--surface);border-top:1px solid var(--line);z-index:35;border-radius:0;display:block}
 .sidebar .brand,.sidebar .workspace-label,.sidebar .side-bottom{display:none}.shell{margin-left:0}.topbar{padding:0 20px;height:64px}.topbar .workspace-menu{display:inline-grid}.topbar .programme-btn{display:none}.shell main{padding:20px 20px 32px}.app-footer{padding-bottom:92px}.sidebar #nav{overflow:visible;max-width:none!important;width:100%;padding:0}
 .sidebar .rai-primary-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:0;gap:0}
 #nav.rai-workspace-nav .rai-primary-nav>a,.workspace-more{min-height:66px;min-width:0;display:flex;flex-direction:column;gap:5px;justify-content:center;align-items:center;padding:8px 3px;font-size:10px;font-weight:500;color:var(--muted);border:0;border-radius:0;background:none}
 #nav.rai-workspace-nav .rai-primary-nav>a.active{background:transparent;color:var(--violet);box-shadow:none}
 .sidebar .rai-primary-nav>a:nth-child(5){display:none!important}.sidebar .rai-workspace-group{display:none}.workspace-more svg{width:19px;height:19px}.shell .studio-grid{grid-template-columns:minmax(190px,.7fr) minmax(0,2fr)}
 .navigation-open .sidebar{height:auto;max-height:75vh;overflow-y:auto;background:var(--navy-2);border-radius:18px 18px 0 0;padding:20px}
 .navigation-open .sidebar .rai-primary-nav{display:grid;grid-template-columns:1fr 1fr;margin-bottom:15px}
 .navigation-open #nav.rai-workspace-nav .rai-primary-nav>a{display:flex!important;flex-direction:row;justify-content:flex-start;min-height:46px;padding:12px;color:#ddd3ea;font-size:13px}
 .navigation-open #nav.rai-workspace-nav .rai-primary-nav>a.active{background:#ffffff12;color:#fff}
 .navigation-open .sidebar .rai-workspace-group{display:block}.navigation-open .workspace-more{color:#ddd3ea;min-height:46px;flex-direction:row}
}
@media(max-width:760px){
 .rai-ai-tabs{gap:20px;margin-bottom:20px}.rai-ai-tabs a{font-size:12px}.rai-ai-note{font-size:11px}.rai-dashboard-welcome h1{font-size:26px}.rai-session-summary{padding:16px}
 .shell main{padding:16px}.shell .page-heading{gap:10px;align-items:flex-start}.shell .page-heading h1{font-size:24px}.shell .page-heading p{font-size:12px;max-width:235px}.shell .heading-action .btn{padding:8px 10px;font-size:10px}.shell .heading-action .ico{display:none}
 .shell .studio-grid{display:flex;flex-direction:column;gap:15px}.shell .board-card{order:1;width:100%}.shell .coach-card{order:2;width:100%;position:static;display:grid;grid-template-columns:90px minmax(0,1fr);align-items:stretch}.shell .coach-stage,.shell .coaching-mode .coach-stage{height:100%;min-height:130px;border-radius:0}.shell .coach-stage .stage-top,.shell .coach-name,.shell .stage-deco,.shell .stage-orbit{display:none}.shell .coach-art,.shell .coaching-mode .coach-art{width:145px;min-width:145px;bottom:0}.shell .coach-caption,.shell .coaching-mode .coach-caption{padding:13px}.shell .coach-caption p,.shell .coaching-mode .coach-caption p{max-height:115px;font-size:12px}.shell .caption-heading{font-size:11px;margin-bottom:6px}.shell .caption-controls{margin-top:10px}.shell .caption-controls .btn{font-size:10px;min-height:32px}
 .shell .board-header{padding:18px 16px 10px}.shell .mode-tabs{padding:0 16px;gap:22px}.shell .mode-tabs button{font-size:11px}.more-activities{padding:10px 16px 0}.shell .coaching-studio{padding:16px}.shell .coaching-intro h3{font-size:22px}.shell .coaching-plan{gap:10px}.shell .coaching-plan b{font-size:12px}.shell .coaching-plan small{font-size:10px}.shell .interaction-extra{flex-wrap:wrap;gap:10px}.shell .interaction-toggles{margin-left:auto}.shell .ask-form input{font-size:16px}.shell .top-actions{gap:10px}.shell .breadcrumbs{gap:8px;font-size:11px}.shell .topbar{padding:0 16px}.shell .preview-badge{max-width:110px;line-height:1.4;text-align:left}
}

.rai-quick-icon svg{fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#appShell{background:var(--rai-paper)}

/* Review fixes (learn W1): a visible focus ring on the AI Tutor's question box (F66); footer words at 12 px in the
   secondary text colour, 4.5:1 in both themes, with real targets (F67); the curve switch at 32 px (F68); focus kept
   clear of the bottom navigation on narrow screens of the AI Tutor (F28; the learn pages: learn/learn.css). */
.ask-form:focus-within{outline:2px solid var(--violet);outline-offset:2px}
.app-footer,.app-footer button{font-size:12px}
.app-footer{color:var(--muted)}
.app-footer a,.app-footer button{color:var(--muted);display:inline-flex;align-items:center;min-height:24px}
.app-footer .ico{width:14px;height:14px}
.formula-switch button{min-height:32px;padding:6px 10px;font-size:12px}
@media(max-width:1023px){:root:has(> body > .sidebar){scroll-padding-bottom:calc(68px + 16px + env(safe-area-inset-bottom))}}
