/* VR3 interface maintenance: semantic colours shared by text and native controls. */
:root{color-scheme:light;color:var(--text);background:var(--bg)}
body{color:var(--text);background:var(--bg)}
html[data-theme=dark]{color-scheme:dark;--bg:#111927;--surface:#1e2939;--text:#eef3fa;--muted:#b4c1d2;--border:#3a4960;--purple:#a3e0c6;--soft:#263f38;--sidebar:#0d1522;color:var(--text);background:var(--bg)}
:where(button,input,select,textarea){color:var(--text)}
:where(input,select,textarea){background:var(--surface)}
:where(input,textarea)::placeholder{color:var(--muted);opacity:1}
:where(h1,h2,h3,h4,legend,label,summary){color:inherit}
:where(.icon-button,.button:not(.primary):not(.dark):not(.lime),.filter-button:not(.active)){color:var(--text)}
:root[data-theme=dark] .button.primary{background:#a3e0c6;border-color:#a3e0c6;color:#12382b}
:root[data-theme=dark] .button.dark{background:#dae7f6;border-color:#dae7f6;color:#172b43}
:root[data-theme=dark] .continue-card{background:var(--surface);color:var(--text)}
:root[data-theme=dark] .continue-card :is(p,.eyebrow,.resume-meta){color:var(--muted)}
:root[data-theme=dark] :is(input,textarea):-webkit-autofill{-webkit-text-fill-color:var(--text);box-shadow:0 0 0 1000px var(--surface) inset;caret-color:var(--text)}
:root[data-theme=dark] :is(.sidebar .nav-item.active,.mobile-navigation a[aria-current=page]){background:#244a3e;color:#d5f3e5}
:root[data-theme=dark] .sidebar .nav-item.active svg{color:#b8ead3}
:focus-visible{outline:3px solid #368b74;outline-offset:3px}
:root[data-theme=dark] :focus-visible{outline-color:#a5dfc9}
/* A single, recognisable location header; no extra explanation banners. */
body{--section-accent:#28765e;--section-soft:#e6f1eb}
body[data-area=studio],body[data-area=lab]{--section-accent:#296f9b;--section-soft:#e6f0f7}
body[data-area=progress]{--section-accent:#7854a2;--section-soft:#f0eaf7}
body[data-area=glossary]{--section-accent:#886423;--section-soft:#f6efdf}
body[data-area=profile]{--section-accent:#536a85;--section-soft:#eaf0f6}
html[data-theme=dark] body{--section-soft:#2a3c4c;--section-accent:#b3deed}
.topbar{position:sticky;top:0;z-index:32;border-bottom:2px solid var(--section-accent);height:76px;padding-inline:28px;gap:18px}
.navigation-toggle{display:inline-grid;flex-shrink:0;min-width:44px;min-height:44px}
.section-location{display:flex;align-items:center;gap:12px;flex:1;min-width:0}
.section-location>div{display:grid;gap:2px;min-width:0}
.section-location strong{font-size:15px;line-height:1.6}
.section-icon{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;border-radius:12px;background:var(--section-soft);color:var(--section-accent)}
.section-detail{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:38vw}
.topbar-actions{gap:10px;flex-shrink:0}.topbar .icon-button{min-width:42px;min-height:42px}
.content{padding-top:28px}.page-heading{margin-bottom:24px}.page-heading h1{letter-spacing:0}
.sidebar{overflow-y:auto;overscroll-behavior:contain;padding-top:23px;z-index:40;transition:transform .2s ease,visibility .2s}
.sidebar-header{display:flex;align-items:center;gap:9px;margin-bottom:29px}
.sidebar-header .brand{margin:0;padding:0;flex:1;min-width:0;gap:10px;font-size:15px}
.sidebar-close{width:30px;height:30px;min-width:30px;background:transparent;border-color:#455367;color:#d5dfea;flex-shrink:0}
.sidebar-footer{padding-top:22px}.sidebar .nav-more>summary{color:#b2c0d2;min-height:42px;display:flex;align-items:center;gap:8px}
.sidebar .nav-more>summary:before{content:'+';font-size:16px}.sidebar .nav-more[open]>summary:before{content:'−'}
.sidebar .nav-more .nav-item{padding-inline-start:24px;font-size:13px}.sidebar .nav-item>span{flex:1}
.sidebar-backdrop{position:fixed;inset:0;border:0;background:#08152688;z-index:39;backdrop-filter:blur(2px)}
.sidebar-backdrop[hidden]{display:none}
.mobile-navigation{display:none}
.section-help{margin:0 0 22px}.section-help>summary{display:flex;align-items:center;gap:8px;cursor:pointer;color:var(--muted);font-size:12px;min-height:38px;width:fit-content}
.section-help>summary:after{content:'+';font-size:16px}.section-help[open]>summary:after{content:'−'}
.section-help .beginner-coach{margin-top:10px}.section-help summary:hover{color:var(--text)}
.settings-row{gap:18px;min-height:68px}.settings-row strong{font-size:14px;line-height:1.8}
.settings-row .button{flex-shrink:0}.settings-row .language-control{max-width:150px}
.account-options{display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin:14px 0}
.account-options details{font-size:12px;color:var(--muted)}.account-options summary{cursor:pointer;min-height:36px;display:flex;align-items:center}.account-options details p{max-width:420px;line-height:1.9;margin-top:8px}
.settings-grid .panel{min-width:0}.settings-grid .form-actions{margin-top:18px}
.settings-row>div:has(>strong){min-width:0}.settings-row>div>p{display:none}
.level-options .level-option{padding:20px 14px;gap:7px}.level-option>span:not(.level-option-icon){font-size:12px}
.journey-greeting{margin-bottom:24px}.journey-greeting>p{font-size:14px;max-width:600px}
.journey-item{padding-block:17px}.journey-item>span:nth-child(2){gap:0}.journey-item strong{line-height:1.8}
.learning-grid .lesson-card>p,.challenge-card>p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.page-footer{justify-content:center;margin-top:34px;padding-top:16px}.developer-credit{font-size:10px!important;color:var(--muted);opacity:1}
.route-enter{animation:route-arrive .16s ease-out both;transform-origin:top center}@keyframes route-arrive{from{opacity:.3;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1025px){
 .app-layout{display:grid;grid-template-columns:228px minmax(0,1fr);transition:grid-template-columns .18s ease}
 .shell{grid-column:2}.sidebar{visibility:visible;transform:none}
 body[data-sidebar-collapsed=true] .app-layout{grid-template-columns:0 minmax(0,1fr)}
 body[data-sidebar-collapsed=true] .sidebar{transform:translateX(-100%);visibility:hidden}
 html[dir=rtl] body[data-sidebar-collapsed=true] .sidebar{transform:translateX(100%)}
 .sidebar.open{box-shadow:none}
}
@media(max-width:1024px){
 .app-layout{display:block}.shell{width:100%;min-width:0}
 .sidebar{width:min(280px,calc(100vw - 52px));visibility:hidden;transform:translateX(-100%);padding:22px 18px 18px;box-shadow:none}
 html[dir=rtl] .sidebar{transform:translateX(100%)}
 .sidebar.open,html[dir=rtl] .sidebar.open{visibility:visible;transform:translateX(0);box-shadow:0 0 28px #08152633}
 body[data-sidebar-open=true]{overflow:hidden}
 .sidebar .nav-item{min-height:47px}.sidebar .nav-more>summary{min-height:47px}
 .topbar{padding-inline:18px;height:70px;gap:13px}
 .topbar .search-box{display:none}.content{padding:25px 22px calc(100px + env(safe-area-inset-bottom))}
 .mobile-navigation{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;bottom:0;inset-inline:0;z-index:34;background:var(--surface);border-top:1px solid var(--border);padding:7px 10px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -3px 16px #15283b06}
 .mobile-navigation a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:51px;font-size:11px;color:var(--muted);border-radius:10px;text-decoration:none;line-height:1.4}
 .mobile-navigation a[aria-current=page]{background:var(--section-soft);color:var(--section-accent);font-weight:650}
 .mobile-navigation a svg{flex-shrink:0}
 body[data-tournav=true] .tour-coach{bottom:14px;z-index:50}
 body[data-sidebar-open=true] .mobile-navigation{visibility:hidden}
 .section-detail{max-width:36vw}
}
@media(max-width:600px){
 .topbar{padding-inline:12px;gap:10px;height:68px}.section-icon{display:none}.section-location strong{font-size:13px;white-space:nowrap}.section-detail{font-size:10px;max-width:36vw}
 .topbar-actions{gap:6px}.topbar .icon-button{min-width:38px;min-height:42px}.navigation-toggle{min-width:40px!important}
 .topbar .language-select{padding-inline:8px;max-width:93px;min-height:42px;font-size:12px}.content{padding-inline:16px;padding-top:23px}
 .page-heading h1,html[lang=fa] .page-heading h1{font-size:25px;line-height:1.7}.page-heading p{font-size:13px;line-height:1.8}
 .settings-grid{gap:16px}.settings-grid .panel{padding:20px}.settings-row{gap:12px;min-height:66px}.settings-row strong{font-size:13px}.settings-row .button{max-width:52%;white-space:normal;font-size:12px}
 .journey-item{gap:12px;padding:16px 13px}.journey-item strong{font-size:14px}
 .level-options{gap:10px}.level-options .level-option{padding:16px}
 .section-help{margin-bottom:15px}.section-help .beginner-coach{padding:15px}
 .topbar-actions .avatar{display:none}
}
@media(prefers-reduced-motion:reduce){.route-enter,.sidebar,.app-layout{animation:none;transition:none}}
[data-motion=reduced] :is(.route-enter,.sidebar,.app-layout){animation:none;transition:none}

.section-location strong{overflow:hidden;text-overflow:ellipsis}

.settings-grid{align-items:start}.section-links{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:20px}
.switch-label{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.switch-label input{width:18px;height:18px;accent-color:var(--purple)}
.sidebar-close{height:40px;min-width:36px;width:36px}
@media(max-width:1024px){.button,.button.compact,.icon-button,.level-pill{min-height:44px}.sidebar-close{height:44px;min-width:44px;width:44px}}

html[data-theme=dark] body[data-area=dashboard],html[data-theme=dark] body[data-area=learn]{--section-accent:#a3e0c6;--section-soft:#263f38}
html[data-theme=dark] body[data-area=studio],html[data-theme=dark] body[data-area=lab]{--section-accent:#afd8ef;--section-soft:#26394a}
html[data-theme=dark] body[data-area=progress]{--section-accent:#dac3f3;--section-soft:#3b304d}
html[data-theme=dark] body[data-area=glossary]{--section-accent:#e9cf9a;--section-soft:#403723}

/* Short viewports: keep the introduction clear of its real click targets. */
body[data-touractive=true] .route-enter{animation:none;transform:none}
@media(max-height:600px){
 body[data-touractive=true]:not([data-tournav=true]) .tour-coach{position:static;inset:auto}
 body[data-touractive=true] .tour-coach{padding:12px;gap:10px;margin-bottom:16px}
 body[data-touractive=true] .tour-coach .eyebrow{display:none}
 body[data-touractive=true] .tour-coach h2{font-size:15px;line-height:1.6;margin:0 0 6px}
 body[data-touractive=true] .tour-coach p{font-size:12px;line-height:1.8}
 body[data-touractive=true] .tour-meter{font-size:20px;align-self:flex-start}
 body[data-touractive=true] .tour-actions{gap:8px;flex-wrap:wrap}
 body[data-touractive=true] .tour-actions .button{min-height:44px;font-size:12px}
 body[data-touractive=true] .tour-target{scroll-margin-block:88px}
}
/* Drawer widths must stay clear even on tall tablets/desktop-site phone views. */
@media(min-width:600px) and (max-width:1024px),(max-width:1024px) and (max-height:600px){
 body[data-tournav=true]{--tour-drawer-width:min(280px,45vw)}
 body[data-tournav=true] .sidebar{width:var(--tour-drawer-width)}
 body[data-tournav=true] .tour-coach{
  position:fixed;inset-block:12px auto;inset-inline:calc(var(--tour-drawer-width) + 12px) 12px;
  max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);
  overflow-y:auto;overscroll-behavior:contain;margin:0;z-index:50;
  box-shadow:0 5px 35px #10201c44;
 }
 body[data-tournav=true] .tour-coach>div:nth-child(2){min-width:0}
 body[data-tournav=true] .content{padding-bottom:100px}
}
@media(max-width:599px) and (min-height:601px){
 body[data-tournav=true] .tour-coach{
  position:fixed;inset-block:auto 12px;inset-inline:12px;
  max-height:40vh;max-height:40dvh;overflow-y:auto;overscroll-behavior:contain;
 }
}
