/* Shared UI contract: readable typography, consistent controls, content-driven breakpoints. */
:root{--blue:#2563eb;--ink:#172b4d;--muted:#60718b;--line:#e2e9f3;--soft:#f3f6fc;--shadow:0 4px 20px #1d355709}
body{font-size:15px;line-height:1.6;background:#f6f8fc;color:var(--ink)}
h1,h2,h3,h4{font-weight:700;line-height:1.3;letter-spacing:-.025em;color:var(--ink)}
h1{font-size:clamp(26px,3vw,38px);margin:8px 0 14px}h2{font-size:22px;margin:4px 0 14px}h3{font-size:18px;margin:4px 0 10px}p{margin:0 0 16px}
img{max-width:100%}main{min-height:55vh}.container{width:calc(100% - 64px);max-width:1400px}
.section{padding:32px 0}.muted{font-size:14px;line-height:1.7}.eyebrow{font-size:12px;letter-spacing:.09em}
.card,.home-panel,.journey-card{border:1px solid var(--line);box-shadow:var(--shadow);border-radius:20px;padding:24px;min-width:0}
.grid>* ,.lesson-layout>*,.dashboard-layout>*,.home-top-grid>*,.home-bottom>*{min-width:0}
.card h2:last-child,.card p:last-child{margin-bottom:0}
.btn{font-family:inherit;font-size:14px;font-weight:600;line-height:1.4;min-height:44px;padding:11px 18px;border-radius:11px;gap:8px;transition:background .16s,box-shadow .16s,transform .16s;white-space:normal;text-align:center;border:1px solid transparent}
.btn-primary{background:var(--blue);color:#fff;box-shadow:0 3px 8px #2563eb20}.btn-primary:hover{background:#1d4ed8;box-shadow:0 5px 12px #2563eb30}.btn-secondary{background:#fff;color:#25416b;border-color:#d8e2f0}.btn-secondary:hover{background:#f0f5ff;border-color:#a8bfe3}.btn-ghost{background:#edf3ff;color:#255ec5}.btn-ghost:hover{background:#dfebff}
.btn:active:not(:disabled){transform:translateY(1px)}.btn-block{width:100%}.btn:disabled,button:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}
button,input,textarea,select{font-family:inherit;font-size:14px}button{cursor:pointer}button svg,.btn svg{flex-shrink:0}
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]),textarea,select){max-width:100%;min-width:0;border:1px solid #cdd8e8;border-radius:10px;background:#fff;color:var(--ink);padding:11px 13px;line-height:1.5;min-height:46px}
.field{margin-bottom:20px}.field label{font-size:13px;font-weight:600;color:#334761;margin-bottom:7px}
.field input,.field textarea,.field select{border:1px solid #cdd8e8;background:#fff;padding:11px 13px;border-radius:10px;line-height:1.5;min-height:46px;font-size:15px}
textarea{resize:vertical;min-height:110px}select{cursor:pointer;padding-right:28px!important}
input::placeholder,textarea::placeholder{color:#8391a6;opacity:1}
:where(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #93b4ff;outline-offset:3px}
.field :is(input,select,textarea):focus{border-color:var(--blue);box-shadow:0 0 0 3px #2563eb14}
input[aria-invalid=true]{border-color:#d44747!important;background:#fffafa}.field-error{display:block;color:#af2b36;margin-top:5px}
input[type=checkbox],input[type=radio]{accent-color:var(--blue);width:18px;height:18px;min-height:18px;flex-shrink:0}
.input-wrap{position:relative}.input-wrap:has(.password-toggle) input{padding-right:52px}.password-toggle{position:absolute;right:5px;top:3px;width:40px;height:40px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#64748b}.password-toggle:hover{background:#edf3ff}
.alert{padding:14px 16px;font-size:14px;line-height:1.6;overflow-wrap:anywhere}.alert ul{padding-left:20px;margin:6px 0 0}.alert.error{border:1px solid #f4cdd0;background:#fff4f4;color:#a92c39}.alert.success{border:1px solid #c5eadb;background:#effbf5;color:#166646}
[hidden]{display:none!important}
.site-header,body:has(.home-page) .site-header{position:sticky;top:0;height:80px;background:#fffffffa;border-bottom:1px solid var(--line);color:var(--ink);backdrop-filter:blur(14px)}
.site-header .nav{position:relative;display:flex;align-items:center;gap:20px;overflow:visible;height:100%;max-width:1400px}
.site-header .brand{min-width:0;flex:0 0 auto;gap:10px}.site-header .brand-title,body:has(.home-page) .site-header .brand-title{display:block;font-size:23px;color:var(--ink);line-height:1.15;letter-spacing:-1px}.site-header .brand-title span,body:has(.home-page) .site-header .brand-title span{color:var(--blue)}
.site-header .brand-sub,body:has(.home-page) .site-header .brand-sub{display:block;font-size:9px;color:#60718b;margin-top:3px}.brand-mark{width:40px;height:40px;flex-shrink:0}
.site-header .nav-links{display:flex;min-width:0;flex:1;gap:2px;overflow:visible;justify-content:center}
.site-header .nav-links>a,body:has(.home-page) .site-header .nav-links>a{display:inline-flex;align-items:center;gap:6px;font-size:12px;padding:10px 8px;border-radius:9px;color:#475875;line-height:1.4;min-height:42px}
.site-header .nav-links>a:hover,.site-header .nav-links>a.is-active,body:has(.home-page) .site-header .nav-links>a.is-active{background:#edf3ff;color:#1e5bd4}
.site-header .search{display:none}.header-actions{display:flex;gap:10px;align-items:center;flex-shrink:0;margin-left:auto}.site-header .btn{font-size:13px;min-height:40px;padding:10px 13px;white-space:nowrap}
.site-header .header-bell,body:has(.home-page) .site-header .header-bell{display:grid;width:40px;height:40px;border-radius:10px;color:#526681}.header-bell:hover{background:#edf3ff}
.site-header .mobile-menu{display:none;border:1px solid var(--line);background:#fff;border-radius:10px;width:42px;height:42px;color:var(--ink);margin:0;place-items:center}
.nav-search{display:none}.account-menu{position:relative}.account-menu summary{list-style:none;display:flex;gap:8px;align-items:center;cursor:pointer;border-radius:10px}.account-menu summary::-webkit-details-marker{display:none}.account-name{max-width:95px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600}.account-menu .avatar{width:36px;height:36px;background:#edf3ff;color:var(--blue)}
.account-dropdown{position:absolute;right:0;top:calc(100% + 16px);width:240px;padding:10px;background:#fff;border:1px solid var(--line);box-shadow:0 12px 35px #1d355722;border-radius:14px;z-index:60}
.account-dropdown>strong{display:block;padding:10px;font-size:13px;overflow-wrap:anywhere;border-bottom:1px solid var(--line);margin-bottom:5px}.account-dropdown a,.account-dropdown button{display:block;padding:11px;width:100%;font-size:14px;border:0;background:none;border-radius:8px;text-align:left}.account-dropdown a:hover,.account-dropdown button:hover{background:#f0f5ff}.account-dropdown button{color:#b43945}
.skip-link{position:fixed;top:-100px;left:20px;z-index:100;background:#fff;border-radius:10px;padding:12px;color:var(--blue)}.skip-link:focus{top:10px}
.auth-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(360px,460px);gap:70px;align-items:center;max-width:1100px;padding-top:48px;padding-bottom:48px}.auth-intro h1{font-size:clamp(30px,3.4vw,46px);line-height:1.25;margin:16px 0}.auth-intro h1 span{color:var(--blue)}.auth-intro p{color:var(--muted);max-width:470px}.auth-intro img{width:100%;height:250px;object-fit:cover;border-radius:20px;margin:18px 0}.auth-benefits{display:flex;gap:18px;flex-wrap:wrap;font-size:12px;color:#526681}.auth-benefits span{display:flex;align-items:center;gap:7px}
.auth-card{padding:32px;box-shadow:0 14px 45px #2447700b}.auth-card h2{font-size:28px;margin-top:16px}.auth-card>p{margin-bottom:24px}.auth-terms{font-size:12px}.auth-switch{text-align:center;font-size:14px;margin:24px 0 0!important}.auth-switch a,.auth-terms a{color:var(--blue);font-weight:600}
.lesson-layout{grid-template-columns:minmax(0,1fr) 320px}.lesson-row>span{min-width:0}.section-head{gap:16px;flex-wrap:wrap}.practice-actions .btn{flex:1}.filter-row{gap:16px}.filter-row .btn{flex:0 1 auto}.answer{padding:14px;min-height:62px}.answer span{min-width:0;overflow-wrap:anywhere}.answer:has(input:checked){border-color:var(--blue);outline:0;box-shadow:0 0 0 1px var(--blue)}
.question-nav button{min-height:40px;font-size:13px}.history-item{font:inherit;font-size:13px;padding:12px;line-height:1.6}.history-item:hover{background:#e2ecfc}.table th,.table td{padding:16px;vertical-align:middle}.table td:nth-child(2){min-width:200px;overflow-wrap:anywhere}.admin-main{padding:32px;min-width:0}.admin-sidebar{padding:24px 14px}.admin-sidebar a{min-height:44px}
.home-hero-inner{grid-template-columns:minmax(0,1.15fr) minmax(20px,.45fr) minmax(300px,.8fr);gap:24px;padding-top:38px;padding-bottom:38px;min-height:440px}.home-copy h1{font-size:clamp(30px,3.4vw,48px)}.hero-actions{flex-wrap:wrap}.home-top-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.home-bottom{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.home-panel-title,.home-section-head{gap:12px;align-items:start}.home-panel-title h2{font-size:18px;min-width:0}.home-panel-title>a{white-space:nowrap;font-size:12px}
.lesson-feature,.simulation-preview{grid-template-columns:1fr}.simulation-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px;font-size:13px}.simulation-controls .btn{grid-column:1/-1;font-size:14px}.lesson-image,.wire-pyramid{height:190px}.lesson-info h3{font-size:20px}.lesson-info p,.practice-row small,.ai-content p{font-size:13px}.lesson-info .btn{font-size:14px;min-height:44px}.practice-row strong{font-size:14px}.practice-row{padding:14px 12px;min-height:76px}
.home-section{padding:24px 0 0}.home-bottom{padding-bottom:30px}.mini-cards strong,.game-cards strong,.explore-row strong{font-size:13px;line-height:1.5}.explore-row small{font-size:12px}.explore-row{padding:12px 0}.ai-suggestions a{font-size:12px;padding:8px 10px}.ai-input{font-size:13px;padding:12px}.journey-head{flex-wrap:wrap}.journey-items div{font-size:12px}.donut{flex-shrink:0}.continue-box{flex-wrap:wrap}
.app-inputs input{min-height:46px;padding:12px}.app-inputs label{font-size:13px}.app-calc{margin-top:auto}.game-cards span{height:100px}.footer-links{flex-wrap:wrap;font-size:13px}
.chat-card{max-width:900px;margin:auto}.chat-heading{display:flex;gap:20px;align-items:center}.chat-heading img{width:80px;height:80px;object-fit:cover;border-radius:18px}.chat-messages{display:flex;flex-direction:column;gap:14px;min-height:220px;max-height:60vh;overflow:auto;margin:24px 0;padding:20px;border-radius:16px;background:#f5f8fc}.chat-message{padding:14px 18px;background:#fff;border:1px solid var(--line);border-radius:14px;max-width:92%;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message.is-user{align-self:flex-end;background:#edf3ff;border-color:#d6e4ff}.chat-message.is-error{color:#a92c39;background:#fff3f3}.chat-form{display:flex;gap:12px;align-items:end}.chat-form .field{flex:1;margin:0}.chat-form textarea{width:100%;min-height:80px}.chat-notice{font-size:12px;color:var(--muted)}
@media(min-width:1600px){.site-header .search{display:flex;flex:0 1 180px;min-width:120px}.site-header .search input{min-height:0;padding:0;border:0;background:transparent}.site-header .nav{gap:14px}}
@media(max-width:1399px){.site-header .nav-links{display:none}.site-header .mobile-menu{display:grid}.site-header .nav-links.mobile-open{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));position:absolute;left:0;right:0;top:calc(100% + 8px);background:#fff;padding:16px;border:1px solid var(--line);border-radius:16px;box-shadow:0 14px 35px #1d355722;max-height:calc(100dvh - 105px);overflow:auto;gap:8px}.site-header .nav-links.mobile-open>a{color:#334761!important;font-size:14px;min-height:46px;padding:12px}.site-header .nav-links.mobile-open>a.is-active{color:var(--blue)!important}.nav-search{display:flex;gap:8px;grid-column:1/-1;padding-top:10px;border-top:1px solid var(--line)}.nav-search input{flex:1;width:100%}.home-hero-inner{grid-template-columns:minmax(0,1fr) minmax(300px,.75fr)}.home-hero-art{display:none}.home-hero-inner .journey-card{grid-column:auto}.account-name{max-width:150px}}
@media(max-width:1100px){.grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}.lesson-layout{grid-template-columns:1fr}.lesson-layout>aside{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.lesson-layout>aside>.card{margin-top:0!important}.home-top-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.home-top-grid .panel-green{grid-column:1/-1}.auth-layout{gap:35px}.admin-shell{grid-template-columns:200px minmax(0,1fr)}.home-copy h1{letter-spacing:-1px}.hero-actions .btn{padding:11px 14px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.container{width:calc(100% - 32px);max-width:720px}.site-header,body:has(.home-page) .site-header{height:72px}.site-header .nav{gap:10px}.site-header .brand-title{font-size:21px}.site-header .brand-sub{display:none!important}.site-header .brand{gap:8px}.header-actions{gap:7px}.site-header .btn{font-size:12px;padding:9px 10px}.site-header .header-bell{display:none}.account-name{display:none}.home-hero-inner{display:block;min-height:0;padding:32px 0}.home-hero-inner .journey-card{margin-top:28px}.home-copy{padding:0}.home-copy h1{font-size:36px}.home-bottom,.home-top-grid,.grid-3,.dashboard-layout{grid-template-columns:1fr}.home-top-grid .panel-green{grid-column:auto}.home-panel{padding:22px}.home-section{padding-top:20px}.home-panel-title h2{font-size:17px}.home-panel-title{flex-wrap:wrap}.auth-layout{display:block;padding-top:28px;padding-bottom:32px;max-width:520px}.auth-intro{display:none}.auth-card{padding:26px}.admin-shell{display:block}.admin-sidebar{display:flex;overflow-x:auto;flex-wrap:nowrap;gap:6px;padding:10px 16px}.admin-sidebar a{flex-shrink:0;padding:10px 12px}.admin-sidebar .brand{display:none}.admin-main{padding:24px 16px}.lesson-layout>aside{display:block}.lesson-layout>aside>.card+.card{margin-top:18px!important}.card{padding:20px}.lesson-title{font-size:28px}.section{padding:24px 0}.filter-row .field{flex:1 1 100%}.filter-row .btn{flex:1 1 140px}.answer-grid{grid-template-columns:1fr}.practice-actions .btn{flex:1 1 140px}.form-grid{grid-template-columns:1fr}.chat-form{flex-wrap:wrap}.chat-form .field{flex-basis:100%}.chat-form>.btn{width:100%}.chat-heading{gap:12px;align-items:start}.chat-heading img{width:55px;height:55px}.chat-heading h1{font-size:24px}.chat-message{max-width:100%;font-size:14px}.chat-messages{padding:12px}.field input,.field textarea,.field select{font-size:16px}}
@media(max-width:420px){.site-header .brand-mark{width:32px;height:32px;border-radius:10px}.site-header .brand-title{font-size:19px}.site-header .brand{gap:6px}.site-header .login-link{display:none}.site-header .mobile-menu{width:40px;height:40px}.site-header .nav-links.mobile-open{grid-template-columns:1fr}.stats,.grid-4{grid-template-columns:1fr}.home-copy h1{font-size:31px}.hero-actions .btn{width:100%}.mini-cards{grid-template-columns:1fr 1fr}.journey-body{gap:10px}.journey-items div{font-size:11px}.donut{width:85px;height:85px;border-width:8px}.auth-card{padding:22px}.maze-grid{grid-template-columns:repeat(5,40px)}.maze-cell{width:40px;height:40px}.maze-controls{gap:6px;margin:14px 0}.maze-controls button{padding:10px 14px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
