:root{--primary:#006ce0;--primary-dark:#002b66;--primary-light:#f0fbff;--secondary:#f90;--green:#037a0c;--orange:#b45309;--red:#d91515;--yellow:#8d6605;--gray-50:#f4f4f7;--gray-100:#ebebf0;--gray-200:#c6c6cd;--gray-300:#b4b4bb;--gray-400:#6a7480;--gray-500:#424650;--gray-600:#39414c;--gray-700:#2b323b;--gray-800:#0f141a;--gray-900:#0f141a;--bg:#fff;--bg-card:#fff;--bg-inset:#f8f8f8;--bg-subtle:#f4f4f7;--bg-hover:#ebebf0;--text:#0f141a;--border:#c6c6cd;--tint-green:#f0fdf4;--tint-red:#fef2f2;--tint-orange:#fff7ed;--tint-yellow:#fffbeb;--tint-blue:#f0f9ff;--radius:4px;--radius-lg:6px;--shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.06);--shadow-md:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--shadow-lg:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--font:'Inter',sans-serif;--mono:'JetBrains Mono',monospace;color-scheme:light;}
*{box-sizing:border-box;margin:0;padding:0;}
body{font-family:var(--font);color:var(--gray-800);background:var(--bg);line-height:1.6;}
a{color:var(--primary);text-decoration:none;}
a:hover{text-decoration:underline;}

/* NAVBAR */
.navbar{position:sticky;top:0;z-index:100;background:#16191f;border-bottom:1px solid #313842;height:60px;}
.nav-inner{max-width:1280px;margin:0 auto;padding:0 1.5rem;height:100%;display:flex;align-items:center;gap:1rem;}
.nav-brand{display:flex;align-items:center;gap:.5rem;font-weight:700;font-size:1.1rem;color:#fff;text-decoration:none;}
.brand-icon{color:#f90;font-size:1.4rem;}
.nav-links{display:flex;gap:.25rem;margin-left:1.5rem;}
.nav-link{display:flex;align-items:center;gap:.35rem;padding:.4rem .75rem;border-radius:var(--radius);color:#eaeded;font-size:.9rem;transition:all .15s;}
.nav-link:hover{background:rgba(255,255,255,.1);color:#fff;text-decoration:none;}
.nav-link.active{background:rgba(255,153,0,.15);color:#ff9900;}
.nav-auth{margin-left:auto;display:flex;align-items:center;gap:.5rem;}
.hamburger{display:none;background:none;border:none;cursor:pointer;font-size:1.3rem;color:#eaeded;}
.mobile-nav{display:none;flex-direction:column;background:var(--bg-card);border-bottom:1px solid var(--gray-200);padding:.4rem;position:absolute;top:100%;left:0;right:0;box-shadow:var(--shadow-lg);max-height:calc(100vh - 54px);overflow-y:auto;}
.mobile-link{padding:.6rem 1rem;color:var(--gray-700);border-radius:var(--radius);font-size:.95rem;}
.mobile-link:hover{background:var(--gray-50);}
@media(max-width:768px){
  .nav-links,.nav-auth{display:none;}
  .hamburger{display:flex;align-items:center;justify-content:center;width:44px;height:44px;margin-left:auto;margin-right:-.5rem;font-size:1.35rem;border-radius:var(--radius);}
  .navbar{height:54px;}
  .nav-inner{padding:0 1rem;gap:.5rem;}
  .nav-brand{font-size:1.02rem;}
  .brand-icon{font-size:1.25rem;}
}
.mobile-nav.open{display:flex;animation:navDrop .18s ease-out;}
@keyframes navDrop{from{opacity:0;translate:0 -6px;}to{opacity:1;translate:0 0;}}

/* BUTTONS */
.btn{display:inline-flex;align-items:center;gap:.4rem;padding:.5rem 1rem;border-radius:var(--radius);border:1px solid var(--primary);background:var(--bg-card);color:var(--text);font-size:.875rem;font-weight:500;cursor:pointer;transition:all .15s;white-space:nowrap;}
.btn:hover{background:var(--primary-light);border-color:var(--primary-dark);text-decoration:none;}
.btn-primary{background:#f90;border-color:#f90;color:#fff;}
.btn-primary:hover{background:#fa6f00;border-color:#fa6f00;color:#fff;}
.btn-outline{background:transparent;border-color:var(--primary);color:var(--primary);}
.btn-outline:hover{background:var(--primary-light);}
.btn-sm{padding:.3rem .7rem;font-size:.8rem;}
.btn-lg{padding:.7rem 1.4rem;font-size:1rem;}
.btn-success{background:var(--green);border-color:var(--green);color:#fff;}
.btn-danger{background:var(--red);border-color:var(--red);color:#fff;}
.btn-white{background:#fff;border-color:#fff;color:var(--primary);}

/* LAYOUT */
.main-content{min-height:calc(100vh - 60px - 80px);}
.container{max-width:1280px;margin:0 auto;padding:2rem 1.5rem;}
.two-col{display:grid;grid-template-columns:260px 1fr;gap:2rem;align-items:start;}
@media(max-width:900px){.two-col{grid-template-columns:1fr;}}

/* BREADCRUMB */
.breadcrumb{display:flex;align-items:center;gap:.4rem;font-size:.85rem;color:var(--gray-500);margin-bottom:1rem;}
.breadcrumb a{color:var(--gray-500);}
.breadcrumb a:hover{color:var(--primary);}

/* PAGE HEADER */
.page-header{margin-bottom:2rem;}
.page-header h1{font-size:1.75rem;font-weight:700;margin-bottom:.4rem;}
.page-header p{color:var(--gray-500);}

/* SECTION TITLE */
.section-title{font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--gray-500);margin-bottom:1rem;}

/* ALERTS */
.alert{padding:.75rem 1rem;border-radius:var(--radius);margin-bottom:1rem;font-size:.9rem;}
.alert-info{background:var(--tint-blue);color:var(--primary);border:1px solid var(--primary);}
.alert-danger,.alert-error{background:var(--tint-red);color:var(--red);border:1px solid var(--red);}
.alert-success{background:var(--tint-green);color:var(--green);border:1px solid var(--green);}
.messages-container{max-width:1280px;margin:1rem auto;padding:0 1.5rem;}

/* HERO */
.hero{background:linear-gradient(180deg,var(--bg-subtle) 0%,var(--bg) 100%);color:var(--text);padding:5rem 1.5rem;text-align:center;}
.hero-content{max-width:700px;margin:0 auto;}
.hero-badge{display:inline-block;background:var(--bg-card);padding:.3rem .9rem;border-radius:99px;font-size:.8rem;margin-bottom:1.25rem;border:1px solid var(--border);color:var(--gray-500);font-weight:500;}
.hero-title{font-size:clamp(2rem,5vw,3.2rem);font-weight:800;line-height:1.15;margin-bottom:1rem;}
.gradient-text{background:linear-gradient(90deg,#006ce0,#f90);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;}
.hero-sub{font-size:1.1rem;color:#545b64;margin-bottom:2rem;}
.hero-actions{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap;}
.hero-stats{display:flex;gap:2rem;justify-content:center;margin-top:3rem;flex-wrap:wrap;}
.stat{text-align:center;}
.stat-n{display:block;font-size:2rem;font-weight:700;color:var(--text);}
.stat-l{font-size:.8rem;color:#545b64;}

/* EXAM CARDS */
.exam-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:1.5rem;margin-bottom:2rem;}
.exam-card{border:1.5px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.5rem;background:var(--bg-card);transition:box-shadow .2s;}
.exam-card:hover{box-shadow:var(--shadow-lg);}
.exam-card.orange{border-top:4px solid var(--orange);}
.exam-card.blue{border-top:4px solid var(--primary);}
.exam-card-header{display:flex;align-items:center;gap:1rem;margin-bottom:1rem;}
.exam-icon{font-size:2rem;}
.exam-card.orange .exam-icon{color:var(--orange);}
.exam-card.blue .exam-icon{color:var(--primary);}
.exam-badge{padding:.2rem .7rem;border-radius:99px;font-size:.75rem;font-weight:600;}
.exam-badge.orange{background:var(--tint-orange);color:var(--orange);}
.exam-badge.blue{background:var(--primary-light);color:var(--primary);}
.exam-card h2{font-size:1.2rem;margin-bottom:.4rem;}
.exam-card p{font-size:.875rem;color:var(--gray-500);margin-bottom:1rem;}
.exam-meta{display:flex;gap:1rem;flex-wrap:wrap;font-size:.8rem;color:var(--gray-500);margin-bottom:.75rem;}
.exam-domains{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:1rem;}
.domain-pill{font-size:.7rem;padding:.15rem .6rem;border-radius:99px;background:var(--gray-100);color:var(--gray-600);}
.exam-actions{display:flex;gap:.5rem;flex-wrap:wrap;}

/* FEATURES GRID */
.features-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1.25rem;}
.feature-card{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.25rem;background:var(--bg-card);}
.feature-icon{font-size:1.75rem;margin-bottom:.75rem;}
.feature-icon.blue{color:var(--primary);}
.feature-icon.orange{color:var(--orange);}
.feature-icon.green{color:var(--green);}
.feature-icon.purple{color:var(--secondary);}
.feature-icon.yellow{color:var(--yellow);}
.feature-icon.red{color:var(--red);}
.feature-card h3{font-size:1rem;font-weight:600;margin-bottom:.4rem;}
.feature-card p{font-size:.875rem;color:var(--gray-500);}

/* STATS GRID */
.stats-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1rem;}
.stat-card{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.25rem;text-align:center;}
.stat-icon{font-size:1.5rem;display:block;margin-bottom:.5rem;}
.stat-icon.orange{color:var(--orange);}
.stat-icon.yellow{color:var(--yellow);}
.stat-icon.green{color:var(--green);}
.stat-icon.blue{color:var(--primary);}
.stat-val{font-size:1.75rem;font-weight:700;color:var(--gray-900);}
.stat-lbl{font-size:.8rem;color:var(--gray-500);}

/* NOTES */
.exam-section{margin-bottom:2.5rem;}
.exam-section-header{display:flex;align-items:flex-start;gap:1.25rem;padding:1.25rem;border-radius:var(--radius-lg);margin-bottom:1rem;color:#fff;}
.exam-section-header.orange{background:linear-gradient(135deg,#ea580c,#f97316);}
.exam-section-header.blue{background:linear-gradient(135deg,#0053a6,#006ce0);}
.exam-section-icon{font-size:2rem;flex-shrink:0;margin-top:.2rem;}
.exam-section-code{font-size:.8rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;opacity:.8;}
.exam-section-name{font-size:1.1rem;font-weight:700;margin:.2rem 0;}
.exam-section-desc{font-size:.85rem;opacity:.85;}
.exam-section-header .btn-white{margin-left:auto;flex-shrink:0;}
.domain-list{display:grid;gap:.75rem;}
.domain-item{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1rem 1.25rem;background:var(--bg-card);}
.domain-item-header{display:flex;align-items:center;gap:.75rem;margin-bottom:.5rem;}
.domain-num{font-size:.75rem;font-weight:700;background:var(--primary-light);color:var(--primary);padding:.15rem .5rem;border-radius:99px;}
.domain-title{font-weight:600;flex:1;}
.domain-weight{font-size:.8rem;color:var(--gray-500);}
.domain-progress-bar{height:4px;background:var(--gray-100);border-radius:2px;margin-bottom:.75rem;}
.domain-progress-fill{height:100%;border-radius:2px;}
.domain-progress-fill.orange{background:var(--orange);}
.domain-progress-fill.blue{background:var(--primary);}
.topic-pills{display:flex;flex-wrap:wrap;gap:.4rem;}
.topic-pill{font-size:.75rem;padding:.2rem .65rem;border-radius:99px;background:var(--gray-50);color:var(--gray-600);border:1px solid var(--gray-200);transition:all .15s;}
.topic-pill:hover{background:var(--primary-light);color:var(--primary);border-color:var(--primary);text-decoration:none;}

/* SIDEBAR */
.sidebar{position:sticky;top:80px;}
.sidebar-title{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--gray-400);margin-bottom:.75rem;padding:0 .75rem;}
.sidebar-domain{margin-bottom:1rem;}
.sidebar-domain-header{display:flex;align-items:center;gap:.5rem;padding:.4rem .75rem;background:var(--gray-50);border-radius:var(--radius);margin-bottom:.25rem;}
.sidebar-domain-num{font-size:.7rem;font-weight:700;color:var(--primary);}
.sidebar-domain-title{font-size:.8rem;font-weight:600;flex:1;}
.sidebar-domain-weight{font-size:.7rem;color:var(--gray-400);}
.sidebar-topic{display:block;padding:.3rem .75rem .3rem 1.5rem;font-size:.82rem;color:var(--gray-600);border-left:2px solid transparent;transition:all .15s;}
.sidebar-topic:hover,.sidebar-topic.active{color:var(--primary);border-left-color:var(--primary);background:var(--primary-light);text-decoration:none;}

/* DOMAIN CARD */
.domain-card-full{border:1px solid var(--gray-200);border-radius:var(--radius-lg);overflow:hidden;margin-bottom:1.5rem;}
.domain-card-header{display:flex;align-items:center;justify-content:space-between;padding:1rem 1.25rem;color:#fff;}
.domain-card-header.orange{background:linear-gradient(135deg,#ea580c,#f97316);}
.domain-card-header.blue{background:linear-gradient(135deg,#0053a6,#006ce0);}
.domain-card-header h2{font-size:1.1rem;font-weight:700;}
.domain-weight-badge{background:rgba(255,255,255,.2);padding:.2rem .6rem;border-radius:99px;font-size:.8rem;}
.domain-card-body{padding:1.25rem;}
.domain-desc{color:var(--gray-500);font-size:.9rem;margin-bottom:1rem;}
.topic-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:.75rem;}
.topic-card{border:1px solid var(--gray-200);border-radius:var(--radius);padding:.9rem 1rem;display:flex;flex-direction:column;gap:.5rem;transition:all .15s;position:relative;}
.topic-card:hover{border-color:var(--primary);box-shadow:var(--shadow-md);text-decoration:none;}
.topic-card-title{font-size:.9rem;font-weight:600;color:var(--gray-800);}
.topic-services{display:flex;flex-wrap:wrap;gap:.3rem;}
.svc-tag{font-size:.68rem;padding:.1rem .45rem;border-radius:99px;background:var(--gray-100);color:var(--gray-500);}
.topic-card-arrow{margin-left:auto;color:var(--gray-400);}

/* TOPIC DETAIL */
.topic-layout{display:grid;grid-template-columns:240px 1fr;gap:2rem;align-items:start;}
@media(max-width:900px){.topic-layout{grid-template-columns:1fr;}}
.topic-sidebar{position:sticky;top:80px;max-height:calc(100vh - 100px);overflow-y:auto;padding-right:.5rem;}
.topic-header{margin-bottom:1.5rem;}
.topic-domain-badge{display:inline-block;font-size:.78rem;padding:.2rem .7rem;border-radius:99px;margin-bottom:.75rem;font-weight:500;}
.topic-domain-badge.orange{background:var(--tint-orange);color:var(--orange);}
.topic-domain-badge.blue{background:var(--primary-light);color:var(--primary);}
.topic-header h1{font-size:1.6rem;font-weight:700;margin-bottom:.75rem;}
.topic-services-row{display:flex;flex-wrap:wrap;gap:.4rem;}
.exam-tip-box{border-left:4px solid var(--yellow);background:var(--tint-yellow);padding:.9rem 1rem;border-radius:0 var(--radius) var(--radius) 0;margin-bottom:1.5rem;}
.exam-tip-label{font-size:.78rem;font-weight:600;text-transform:uppercase;color:var(--yellow);margin-bottom:.3rem;}
.exam-tip-text{font-size:.9rem;color:var(--gray-700);}
.topic-content{font-size:.95rem;line-height:1.8;}
.topic-content h2{font-size:1.2rem;font-weight:700;margin:1.5rem 0 .75rem;color:var(--gray-900);}
.topic-content h3{font-size:1rem;font-weight:600;margin:1.25rem 0 .5rem;color:var(--gray-800);}
.topic-content h4{font-size:.95rem;font-weight:600;margin:1rem 0 .5rem;color:var(--gray-800);}
.topic-content h5{font-size:.9rem;font-weight:600;margin:.9rem 0 .4rem;color:var(--gray-700);}
.topic-content p{margin-bottom:.75rem;line-height:1.7;}
.topic-content strong{font-weight:700;color:var(--gray-900);}
.topic-content em{font-style:italic;color:var(--gray-700);}
.topic-content ul,.topic-content ol{margin-left:1.5rem;margin-bottom:1rem;padding-left:0;}
.topic-content ul li,.topic-content ol li{margin-bottom:.5rem;line-height:1.6;}
.topic-content ul{list-style-type:disc;}
.topic-content ul ul{list-style-type:circle;margin-top:.5rem;}
.topic-content ul ul ul{list-style-type:square;}
.topic-content ol{list-style-type:decimal;}
.topic-content ol ol{list-style-type:lower-alpha;margin-top:.5rem;}
.topic-content blockquote{border-left:4px solid var(--primary);background:var(--tint-blue);padding:.75rem 1rem;margin:1rem 0;border-radius:0 var(--radius) var(--radius) 0;color:var(--gray-700);font-style:italic;}
.topic-content blockquote p{margin-bottom:.25rem;}
.topic-content hr{border:none;border-top:2px solid var(--gray-200);margin:1.5rem 0;}
.topic-content table{width:100%;border-collapse:collapse;margin:1rem 0;font-size:.88rem;}
.topic-content th{background:var(--primary);color:#fff;padding:.5rem .75rem;text-align:left;font-weight:600;}
.topic-content td{padding:.5rem .75rem;border-bottom:1px solid var(--gray-200);}
.topic-content tr:nth-child(even) td{background:var(--gray-50);}
.topic-content code{font-family:var(--mono);background:var(--gray-100);padding:.1rem .35rem;border-radius:4px;font-size:.85em;color:var(--primary);}
.topic-content pre{background:var(--bg-inset);color:var(--text);padding:1rem;border-radius:var(--radius);overflow-x:auto;margin:1rem 0;border:1px solid var(--border);}
.topic-content pre code{background:none;padding:0;font-size:.85rem;color:var(--text);}
.topic-content a{color:var(--primary);text-decoration:none;border-bottom:1px dotted var(--primary);}
.topic-content a:hover{text-decoration:underline;}
.topic-nav{display:flex;justify-content:space-between;margin-top:2rem;padding-top:1.5rem;border-top:1px solid var(--gray-200);}

/* SEARCH */
.search-bar{display:flex;align-items:center;gap:.5rem;border:1.5px solid var(--gray-300);border-radius:var(--radius-lg);padding:.5rem .75rem .5rem 1rem;max-width:600px;margin-top:1rem;}
.search-icon{color:var(--gray-400);}
.search-input{flex:1;border:none;outline:none;font-size:.95rem;font-family:var(--font);}

/* MARKDOWN CONTENT */
.markdown-content{font-size:.95rem;line-height:1.8;}
.markdown-content h1{font-size:1.75rem;font-weight:700;margin:2rem 0 1rem;color:var(--gray-900);}
.markdown-content h2{font-size:1.4rem;font-weight:700;margin:1.75rem 0 .9rem;color:var(--gray-900);}
.markdown-content h3{font-size:1.1rem;font-weight:600;margin:1.25rem 0 .6rem;color:var(--gray-800);}
.markdown-content h4{font-size:1rem;font-weight:600;margin:1rem 0 .5rem;color:var(--gray-800);}
.markdown-content p{margin-bottom:1rem;line-height:1.7;}
.markdown-content strong{font-weight:700;color:var(--gray-900);}
.markdown-content em{font-style:italic;color:var(--gray-700);}
.markdown-content u{text-decoration:underline;text-decoration-color:var(--primary);}
.markdown-content ul,.markdown-content ol{margin-left:1.5rem;margin-bottom:1rem;}
.markdown-content ul li,.markdown-content ol li{margin-bottom:.6rem;line-height:1.6;}
.markdown-content ul{list-style-type:disc;}
.markdown-content ul ul{list-style-type:circle;}
.markdown-content ul ul ul{list-style-type:square;}
.markdown-content ol{list-style-type:decimal;}
.markdown-content ol ol{list-style-type:lower-alpha;}
.markdown-content blockquote{border-left:4px solid var(--primary);background:var(--tint-blue);padding:1rem;margin:1.5rem 0;border-radius:0 var(--radius) var(--radius) 0;color:var(--gray-700);}
.markdown-content blockquote p{margin-bottom:.5rem;}
.markdown-content blockquote strong{color:var(--gray-900);}
.markdown-content hr{border:none;border-top:2px solid var(--gray-200);margin:2rem 0;}
.markdown-content a{color:var(--primary);text-decoration:none;border-bottom:1px solid transparent;}
.markdown-content a:hover{border-bottom-color:var(--primary);text-decoration:none;}
.markdown-content code{font-family:var(--mono);background:var(--gray-100);padding:.1rem .35rem;border-radius:4px;font-size:.85em;color:var(--primary);}
.markdown-content pre{background:var(--bg-inset);color:var(--text);padding:1rem;border-radius:var(--radius);overflow-x:auto;margin:1rem 0;border:1px solid var(--border);}
.markdown-content pre code{background:none;padding:0;font-size:.85rem;color:var(--text);}
.markdown-table{width:100%;border-collapse:collapse;margin:1.5rem 0;font-size:.875rem;}
.markdown-table th{background:var(--bg-subtle);color:var(--text);padding:.65rem .85rem;text-align:left;font-weight:600;border:1px solid var(--border);}
.markdown-table td{padding:.65rem .85rem;border:1px solid var(--border);vertical-align:top;}
.markdown-table tbody tr:nth-child(even) td{background:var(--bg-subtle);}
.markdown-table tbody tr:hover td{background:var(--primary-light);}
.search-results-info{font-size:.875rem;color:var(--gray-500);margin-bottom:1rem;}
.search-result-card{display:block;border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1rem 1.25rem;margin-bottom:.75rem;transition:all .15s;}
.search-result-card:hover{border-color:var(--primary);box-shadow:var(--shadow);text-decoration:none;}
.result-exam-badge{font-size:.7rem;font-weight:700;padding:.1rem .5rem;border-radius:99px;display:inline-block;margin-bottom:.4rem;}
.result-title{font-size:1rem;font-weight:600;color:var(--gray-900);margin-bottom:.25rem;}
.result-domain{font-size:.8rem;color:var(--gray-500);margin-bottom:.25rem;}
.result-services{font-size:.8rem;color:var(--gray-400);}
.empty-state{text-align:center;padding:4rem 2rem;color:var(--gray-400);}
.empty-state i{font-size:3rem;display:block;margin-bottom:1rem;}

/* QUIZ */
.quiz-container{max-width:800px;margin:0 auto;padding:2rem 1.5rem;}
#quiz-app{min-height:400px;}
.config-form{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.75rem;background:var(--bg-card);}
.form-group{margin-bottom:1.25rem;}
.form-label{display:block;font-size:.875rem;font-weight:500;margin-bottom:.4rem;color:var(--gray-700);}
.form-select,.form-input{width:100%;padding:.55rem .75rem;border:1.5px solid var(--gray-300);border-radius:var(--radius);font-size:.9rem;font-family:var(--font);color:var(--gray-800);outline:none;transition:border-color .15s;}
.form-select:focus,.form-input:focus{border-color:var(--primary);}
.radio-group{display:flex;gap:.75rem;flex-wrap:wrap;}
.radio-label{display:flex;align-items:center;gap:.4rem;cursor:pointer;font-size:.875rem;}
.range-input{width:100%;margin-top:.4rem;}
.diff-badge{padding:.15rem .6rem;border-radius:99px;font-size:.75rem;font-weight:500;}
.diff-badge.easy{background:var(--tint-green);color:var(--green);}
.diff-badge.medium{background:var(--tint-yellow);color:var(--yellow);}
.diff-badge.hard{background:var(--tint-red);color:var(--red);}
.attempts-list{display:grid;gap:.5rem;}
.attempt-row{display:flex;align-items:center;gap:1rem;border:1px solid var(--gray-200);border-radius:var(--radius);padding:.75rem 1rem;transition:all .15s;}
.attempt-row:hover{border-color:var(--primary);text-decoration:none;}
.attempt-exam{font-weight:600;font-size:.85rem;min-width:80px;}
.attempt-score{font-size:1.1rem;font-weight:700;min-width:50px;}
.attempt-score.pass{color:var(--green);}
.attempt-score.fail{color:var(--red);}
.attempt-detail{font-size:.82rem;color:var(--gray-500);flex:1;}
.attempt-date{font-size:.8rem;color:var(--gray-400);}
.attempt-badge{font-size:.7rem;font-weight:700;padding:.15rem .5rem;border-radius:99px;}
.attempt-badge.pass{background:var(--tint-green);color:var(--green);}
.attempt-badge.fail{background:var(--tint-red);color:var(--red);}

/* QUIZ TAKE */
.quiz-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1.5rem;padding:1rem;background:var(--gray-50);border-radius:var(--radius-lg);}
.quiz-prog-bar{height:6px;background:var(--gray-200);border-radius:3px;margin-bottom:1.5rem;}
.quiz-prog-fill{height:100%;background:var(--primary);border-radius:3px;transition:width .3s;}
.quiz-question-card{border:1.5px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.5rem;margin-bottom:1rem;}
.quiz-question-text{font-size:1.05rem;font-weight:500;margin-bottom:1.25rem;line-height:1.6;}
.quiz-choices{display:grid;gap:.6rem;}
.quiz-choice{display:flex;align-items:flex-start;gap:.75rem;padding:.75rem 1rem;border:1.5px solid var(--gray-200);border-radius:var(--radius);cursor:pointer;transition:all .15s;text-align:left;background:var(--bg-card);font-size:.9rem;line-height:1.5;}
.quiz-choice:hover{border-color:var(--primary);background:var(--primary-light);}
.quiz-choice.selected{border-color:var(--primary);background:var(--primary-light);}
.quiz-choice.correct{border-color:var(--green);background:var(--tint-green);}
.quiz-choice.wrong{border-color:var(--red);background:var(--tint-red);}
.choice-letter-badge{font-size:.8rem;font-weight:700;width:24px;height:24px;border-radius:99px;background:var(--gray-100);display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.quiz-nav{display:flex;justify-content:space-between;align-items:center;margin-top:1rem;}
.quiz-timer{font-size:1.1rem;font-weight:600;color:var(--gray-600);}

/* RESULTS */
.results-hero{text-align:center;padding:2.5rem;border-radius:var(--radius-lg);margin-bottom:1.5rem;color:#fff;}
.results-hero.pass{background:linear-gradient(135deg,#15803d,#16a34a);}
.results-hero.fail{background:linear-gradient(135deg,#b91c1c,#dc2626);}
.results-icon{font-size:3rem;margin-bottom:.5rem;}
.results-title{font-size:1.4rem;font-weight:700;margin-bottom:.5rem;}
.results-score{font-size:4rem;font-weight:800;line-height:1;}
.results-detail{font-size:.9rem;opacity:.85;margin:.5rem 0;}
.results-badge{display:inline-block;padding:.25rem .9rem;border-radius:99px;background:rgba(255,255,255,.2);font-weight:700;margin-top:.5rem;}
.results-actions{display:flex;gap:.75rem;flex-wrap:wrap;margin-bottom:2rem;}
.result-question{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.25rem;margin-bottom:1rem;}
.result-question.correct{border-left:4px solid var(--green);}
.result-question.incorrect{border-left:4px solid var(--red);}
.rq-header{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem;}
.rq-num{font-size:.8rem;font-weight:600;background:var(--gray-100);padding:.15rem .5rem;border-radius:99px;}
.rq-status{font-size:.85rem;font-weight:600;}
.result-question.correct .rq-status{color:var(--green);}
.result-question.incorrect .rq-status{color:var(--red);}
.rq-text{font-weight:500;margin-bottom:.75rem;font-size:.95rem;}
.rq-choices{display:grid;gap:.4rem;margin-bottom:.75rem;}
.rq-choice{display:flex;align-items:center;gap:.6rem;padding:.5rem .75rem;border-radius:var(--radius);font-size:.875rem;border:1px solid var(--gray-200);}
.rq-choice.correct-choice{background:var(--tint-green);border-color:var(--green);color:var(--green);}
.rq-choice.wrong-choice{background:var(--tint-red);border-color:var(--red);color:var(--red);}
.choice-letter{font-weight:600;width:20px;}
.rq-explanation{background:var(--tint-yellow);border-left:3px solid var(--yellow);padding:.7rem .9rem;border-radius:0 var(--radius) var(--radius) 0;font-size:.875rem;color:var(--gray-700);}

/* LABS */
.labs-section{margin-bottom:2.5rem;}
.labs-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:1.25rem;}
.lab-card{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.25rem;background:var(--bg-card);display:flex;flex-direction:column;gap:.6rem;transition:box-shadow .2s;}
.lab-card:hover{box-shadow:var(--shadow-lg);}
.lab-card-top{display:flex;align-items:center;justify-content:space-between;}
.lab-icon{width:44px;height:44px;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;font-size:1.3rem;}
.lab-icon.orange{background:var(--tint-orange);color:var(--orange);}
.lab-icon.blue{background:var(--primary-light);color:var(--primary);}
.lab-icon-lg{width:60px;height:60px;border-radius:var(--radius-lg);display:flex;align-items:center;justify-content:center;font-size:1.75rem;flex-shrink:0;}
.lab-level{font-size:.72rem;font-weight:600;padding:.15rem .55rem;border-radius:99px;}
.lab-level.beginner{background:var(--tint-green);color:var(--green);}
.lab-level.intermediate{background:var(--tint-yellow);color:var(--yellow);}
.lab-level.advanced{background:var(--tint-red);color:var(--red);}
.lab-title{font-size:1rem;font-weight:600;}
.lab-desc{font-size:.85rem;color:var(--gray-500);flex:1;}
.lab-meta{display:flex;gap:1rem;flex-wrap:wrap;font-size:.8rem;color:var(--gray-400);}
.lab-progress-done{display:flex;align-items:center;gap:.4rem;font-size:.82rem;color:var(--green);font-weight:500;}
.lab-progress-partial{display:flex;align-items:center;gap:.6rem;}
.lab-progress-label{font-size:.75rem;color:var(--gray-500);white-space:nowrap;}
.lab-progress-bar-wrap{background:var(--gray-100);border-radius:99px;height:6px;overflow:hidden;}
.lab-progress-bar-fill{background:var(--primary);height:100%;border-radius:99px;transition:width .3s;}
.lab-services{display:flex;flex-wrap:wrap;gap:.3rem;}

/* LAB DETAIL */
.lab-header{display:flex;gap:1.25rem;align-items:flex-start;margin-bottom:1.5rem;}
.lab-header-info h1{font-size:1.5rem;font-weight:700;margin:.4rem 0;}
.lab-badges{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center;}
.lab-time{font-size:.8rem;color:var(--gray-500);}
.lab-level-badge{font-size:.72rem;font-weight:600;padding:.15rem .55rem;border-radius:99px;}
.lab-services-row{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem;}
.lab-progress-header{display:flex;align-items:center;background:var(--gray-50);padding:.75rem 1rem;border-radius:var(--radius);margin-bottom:1.5rem;font-size:.9rem;gap:.75rem;}
.badge-complete{color:var(--green);font-weight:600;font-size:.85rem;display:flex;align-items:center;gap:.3rem;}
.badge-progress{color:var(--yellow);font-weight:600;font-size:.85rem;}
.lab-steps{display:grid;gap:.75rem;}
.lab-step{border:1px solid var(--gray-200);border-radius:var(--radius-lg);overflow:hidden;transition:border-color .15s;}
.lab-step.done{border-color:var(--green);}
.step-header{display:flex;align-items:center;gap:.75rem;padding:.9rem 1.1rem;cursor:pointer;background:var(--bg-card);user-select:none;}
.step-header:hover{background:var(--gray-50);}
.step-check{width:22px;height:22px;border-radius:99px;border:2px solid var(--gray-300);flex-shrink:0;cursor:pointer;transition:all .15s;}
.step-check.checked{background:var(--green);border-color:var(--green);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");background-size:14px;background-repeat:no-repeat;background-position:center;}
.step-num{font-size:.75rem;color:var(--gray-400);font-weight:500;}
.step-title{font-weight:600;font-size:.95rem;flex:1;}
.step-arrow{color:var(--gray-400);font-size:1.1rem;transition:transform .2s;}
.step-body{padding:1.1rem 1.25rem;border-top:1px solid var(--gray-100);display:none;}
.step-instructions{font-size:.9rem;color:var(--gray-700);line-height:1.7;white-space:pre-line;margin-bottom:1rem;}
.code-block{border:1px solid var(--gray-200);border-radius:var(--radius);overflow:hidden;margin:1rem 0;}
.code-header{display:flex;align-items:center;justify-content:space-between;padding:.4rem .75rem;background:var(--bg-hover);color:var(--gray-500);font-size:.8rem;border-bottom:1px solid var(--border);}
.code-lang{font-family:var(--mono);}
.copy-btn{background:none;border:none;cursor:pointer;color:var(--gray-400);font-size:.8rem;display:flex;align-items:center;gap:.3rem;}
.copy-btn:hover{color:#fff;}
.code-block pre{background:var(--bg-inset);padding:1rem;overflow-x:auto;margin:0;}
.code-block code{font-family:var(--mono);font-size:.85rem;color:var(--text);}
.step-tip{background:var(--tint-yellow);border-left:3px solid var(--yellow);padding:.6rem .9rem;border-radius:0 var(--radius) var(--radius) 0;font-size:.875rem;color:var(--gray-700);margin:.75rem 0;}
.step-actions{display:flex;gap:.5rem;margin-top:.75rem;}
.lab-progress-card{display:block;border:1px solid var(--gray-200);border-radius:var(--radius);padding:.9rem 1rem;transition:all .15s;}
.lab-progress-card:hover{border-color:var(--primary);text-decoration:none;}
.lab-progress-title{font-weight:600;font-size:.9rem;margin-bottom:.25rem;}
.lab-progress-exam{font-size:.78rem;color:var(--gray-500);margin-bottom:.4rem;}

/* GAMES */
.games-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:1.25rem;margin-bottom:2rem;}
.game-card{border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.5rem;background:var(--bg-card);transition:box-shadow .2s;}
.game-card:hover{box-shadow:var(--shadow-lg);}
.game-card.purple{border-top:4px solid var(--secondary);}
.game-card.green{border-top:4px solid var(--green);}
.game-card.orange{border-top:4px solid var(--orange);}
.game-icon{font-size:2rem;margin-bottom:.75rem;}
.game-card.purple .game-icon{color:var(--secondary);}
.game-card.green .game-icon{color:var(--green);}
.game-card.orange .game-icon{color:var(--orange);}
.game-card h3{font-size:1rem;font-weight:600;margin-bottom:.4rem;}
.game-card p{font-size:.875rem;color:var(--gray-500);margin-bottom:.75rem;}
.game-meta{display:flex;gap:.75rem;font-size:.8rem;color:var(--gray-400);margin-bottom:1rem;}

/* FLASHCARD */
.fc-stats-bar{display:flex;align-items:center;gap:1rem;margin-bottom:1rem;font-size:.9rem;}
.fc-card-wrap{perspective:1000px;cursor:pointer;margin-bottom:1rem;}
.fc-card{min-height:200px;border:1.5px solid var(--gray-200);border-radius:var(--radius-lg);padding:2rem;background:var(--bg-card);transition:transform .5s;transform-style:preserve-3d;position:relative;}
.fc-card.flipped{transform:rotateY(180deg);}
.fc-front,.fc-back{backface-visibility:hidden;-webkit-backface-visibility:hidden;}
.fc-back{position:absolute;inset:2rem;transform:rotateY(180deg);overflow-y:auto;-webkit-overflow-scrolling:touch;}
.fc-label{font-size:.72rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--gray-400);margin-bottom:.75rem;}
.fc-term{font-size:1.3rem;font-weight:700;color:var(--gray-900);margin-top:.5rem;}
.fc-def{font-size:.95rem;color:var(--gray-700);line-height:1.7;}
.fc-hint{position:absolute;bottom:1rem;right:1.25rem;font-size:.78rem;color:var(--gray-400);}
.fc-controls{display:flex;gap:.5rem;justify-content:center;flex-wrap:wrap;}
.fc-progress-bar{margin-top:1rem;background:var(--gray-100);border-radius:99px;height:4px;}
.fc-complete{display:none;flex-direction:column;align-items:center;text-align:center;padding:2.5rem;background:var(--tint-green);border:1px solid var(--green);border-radius:var(--radius-lg);gap:.75rem;}
.fc-complete i{font-size:3rem;color:var(--yellow);}
.fc-complete h2{font-size:1.4rem;font-weight:700;color:var(--gray-900);}
.fc-complete p{color:var(--gray-600);}
.fc-complete-note{font-size:.85rem;color:var(--gray-500);}

/* MEMORY */
.memory-stats{display:flex;align-items:center;gap:1.5rem;margin-bottom:1rem;font-size:.9rem;background:var(--gray-50);padding:.75rem 1rem;border-radius:var(--radius);}
.memory-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.75rem;margin-bottom:1rem;}
@media(max-width:600px){.memory-grid{grid-template-columns:repeat(3,1fr);}}
.mem-card{aspect-ratio:1;min-height:72px;border:1.5px solid var(--gray-200);border-radius:var(--radius);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.8rem;text-align:center;padding:.5rem;transition:all .3s;background:var(--bg-card);position:relative;overflow:hidden;}
.mem-card .mem-front{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:1.5rem;color:var(--gray-300);background:var(--gray-50);}
.mem-card .mem-back{display:none;font-size:.78rem;line-height:1.4;padding:.4rem;}
.mem-card.flipped .mem-front{display:none;}
.mem-card.flipped .mem-back{display:flex;align-items:center;justify-content:center;}
.mem-card.flipped{border-color:var(--primary);background:var(--primary-light);}
.mem-card.matched{border-color:var(--green);background:var(--tint-green);cursor:default;}
.mem-card.matched .mem-front{display:none;}
.mem-card.matched .mem-back{display:flex;align-items:center;justify-content:center;font-size:.78rem;color:var(--green);}
.memory-win{display:none;flex-direction:column;align-items:center;text-align:center;padding:2rem;background:var(--tint-green);border-radius:var(--radius-lg);gap:.75rem;}
.memory-win i{font-size:3rem;color:var(--yellow);}

/* SPEEDRUN */
.game-start-screen,.game-end-screen{text-align:center;padding:3rem 2rem;border:1px solid var(--gray-200);border-radius:var(--radius-lg);}
.game-start-icon{font-size:3.5rem;color:var(--orange);margin-bottom:1rem;}
.game-end-screen{display:none;flex-direction:column;align-items:center;gap:1rem;}
.end-icon{font-size:3rem;color:var(--yellow);}
.end-score{font-size:5rem;font-weight:800;color:var(--primary);}
.end-detail{color:var(--gray-500);}
.speedrun-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.5rem;}
.speedrun-timer{font-size:2.5rem;font-weight:800;color:var(--primary);}
.speedrun-score{font-size:1rem;color:var(--gray-600);}
.speedrun-progress{margin-bottom:1.5rem;}
.speedrun-question{font-size:1.1rem;font-weight:600;margin-bottom:1rem;line-height:1.5;min-height:80px;}
.speedrun-choices{display:grid;grid-template-columns:1fr 1fr;gap:.5rem;}
.sr-choice{padding:.7rem;border:1.5px solid var(--gray-200);border-radius:var(--radius);background:var(--bg-card);cursor:pointer;font-size:.875rem;transition:all .15s;}
.sr-choice:hover:not(:disabled){border-color:var(--primary);background:var(--primary-light);}
.sr-choice.correct{border-color:var(--green);background:var(--tint-green);}
.sr-choice.wrong{border-color:var(--red);background:var(--tint-red);}

/* LEADERBOARD */
.leaderboard-list{border:1px solid var(--gray-200);border-radius:var(--radius-lg);overflow:hidden;}
.lb-row{display:flex;align-items:center;gap:1rem;padding:.75rem 1rem;border-bottom:1px solid var(--gray-100);font-size:.875rem;}
.lb-row:last-child{border-bottom:none;}
.lb-row.highlight{background:var(--primary-light);}
.lb-rank{width:32px;text-align:center;font-weight:700;}
.ti.gold{color:#ca8a04;}
.ti.silver{color:#6b7280;}
.ti.bronze{color:#92400e;}
.lb-user{font-weight:600;flex:1;}
.lb-exam{font-size:.78rem;padding:.1rem .45rem;border-radius:99px;background:var(--gray-100);}
.lb-type{font-size:.78rem;color:var(--gray-500);}
.lb-score{font-weight:700;color:var(--primary);}
.lb-date{font-size:.78rem;color:var(--gray-400);}

/* AUTH */
.auth-container{min-height:80vh;display:flex;align-items:center;justify-content:center;padding:2rem;}
.auth-card{width:100%;max-width:420px;border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:2rem;box-shadow:var(--shadow-md);}
.auth-logo{font-size:2.5rem;color:var(--primary);text-align:center;margin-bottom:1rem;}
.auth-title{font-size:1.4rem;font-weight:700;text-align:center;margin-bottom:.3rem;}
.auth-sub{font-size:.875rem;color:var(--gray-500);text-align:center;margin-bottom:1.5rem;}
.auth-form input[type=text],.auth-form input[type=password],.auth-form input[type=email],.auth-form ul{width:100%;padding:.55rem .75rem;border:1.5px solid var(--gray-300);border-radius:var(--radius);font-size:.9rem;font-family:var(--font);outline:none;margin-top:.3rem;}
.auth-form input:focus{border-color:var(--primary);}
.auth-footer{text-align:center;font-size:.875rem;color:var(--gray-500);margin-top:1.25rem;}
.field-error{color:var(--red);font-size:.8rem;margin-top:.25rem;}
.helptext{font-size:.78rem;color:var(--gray-400);margin-top:.25rem;display:block;}

/* FOOTER */
.footer{background:#16191f;color:#d5dbdb;padding:2.5rem 1.5rem 1.5rem;}
.footer-inner{max-width:1280px;margin:0 auto;}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:2rem;padding-bottom:2rem;border-bottom:1px solid #39414c;}
@media(max-width:768px){
  .footer{padding:.6rem 1rem;}
  .footer-grid{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-bottom:0;border-bottom:none;}
  .footer-col:not(:first-child){display:none;}
  .footer-brand{font-size:.85rem;margin:0;}
  .footer-brand i{font-size:.95rem;}
  .footer-col p{display:none;}
  .footer-bottom{padding-top:0;}
  .footer-bottom p{font-size:.68rem;margin:0;}
  .footer-note{display:none;}
}
.footer-brand{display:flex;align-items:center;gap:.5rem;color:#fff;font-weight:700;font-size:1.1rem;margin-bottom:.5rem;}
.footer-brand i{color:#f90;font-size:1.3rem;}
.footer-col p{font-size:.85rem;margin:0;}
.footer-heading{font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:#8d9497;margin-bottom:.75rem;}
.footer-col a{display:flex;align-items:center;gap:.4rem;font-size:.85rem;color:#d5dbdb;padding:.2rem 0;}
.footer-col a:hover{color:#ff9900;text-decoration:none;}
.footer-bottom{text-align:center;padding-top:1.5rem;}
.footer-bottom p{font-size:.85rem;margin:.25rem 0;}
.footer-note{font-size:.78rem;}
.footer a{color:#d5dbdb;}
.footer a:hover{color:#ff9900;}

/* STUDY ROADMAP */
.roadmap{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1.5rem;margin-bottom:2rem;}
.roadmap-step{position:relative;border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:1.5rem;background:var(--bg-card);transition:box-shadow .2s;}
.roadmap-step:hover{box-shadow:var(--shadow-lg);}
.roadmap-num{width:40px;height:40px;border-radius:99px;background:var(--primary-light);color:var(--primary);font-weight:700;display:flex;align-items:center;justify-content:center;font-size:1.1rem;margin-bottom:.75rem;}
.roadmap-step h3{font-size:1rem;font-weight:600;margin-bottom:.4rem;color:var(--gray-900);}
.roadmap-step p{font-size:.85rem;color:var(--gray-500);}
.roadmap-cta{background:linear-gradient(135deg,#16191f 0%,#0053a6 100%);color:#fff;}
.roadmap-cta .roadmap-num{background:rgba(255,255,255,.15);color:#fff;}
.roadmap-cta p{color:rgba(255,255,255,.8);}
.roadmap-cta .btn{margin-top:.5rem;}

/* EXAM SECTION */
.exam-header-badge{display:inline-flex;align-items:center;gap:.4rem;padding:.25rem .8rem;border-radius:99px;font-size:.82rem;font-weight:600;margin-bottom:.75rem;}
.exam-header-badge.orange{background:var(--tint-orange);color:var(--orange);}
.exam-header-badge.blue{background:var(--primary-light);color:var(--primary);}

/* TABLE SCROLL WRAPPER (wide tables scroll instead of overflowing) */
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:1.5rem 0;}
.table-wrap .markdown-table{margin:0;min-width:600px;}
.table-wrap::-webkit-scrollbar{height:8px;}
.table-wrap::-webkit-scrollbar-thumb{background:var(--gray-300);border-radius:4px;}

/* RESPONSIVE — tablets and below */
@media(max-width:900px){
  .container{padding:1.5rem 1rem;}
  .quiz-container{padding:1.5rem 1rem;}
  .topic-header h1{font-size:1.35rem;line-height:1.35;}
  /* Topic sidebar becomes a horizontal pill scroller instead of a tall list */
  .topic-sidebar{position:static;max-height:none;overflow:visible;display:flex;flex-direction:row;flex-wrap:nowrap;gap:.4rem;overflow-x:auto;padding:.25rem .25rem .75rem;-webkit-overflow-scrolling:touch;}
  .topic-sidebar .sidebar-title{font-size:.68rem;margin-bottom:.15rem;white-space:nowrap;}
  .topic-sidebar .sidebar-topic{white-space:nowrap;flex:0 0 auto;border-left:none;border:1px solid var(--gray-200);border-radius:99px;background:var(--gray-50);padding:.3rem .75rem;}
  .topic-sidebar .sidebar-topic.active{border-color:var(--primary);}
  /* Exam-detail sidebar becomes a compact scroll box */
  .sidebar{position:static;max-height:45vh;overflow-y:auto;border:1px solid var(--gray-200);border-radius:var(--radius-lg);padding:.75rem;}
  .exam-section-header{flex-wrap:wrap;gap:.75rem;}
  .exam-section-header .btn-white{margin-left:0;width:100%;}
  .domain-card-header{flex-wrap:wrap;gap:.5rem;padding:.875rem 1rem;}
  .domain-card-header h2{font-size:1rem;line-height:1.35;}
  .topic-nav{flex-direction:column;gap:.6rem;}
  .topic-nav .btn{width:100%;justify-content:center;white-space:normal;line-height:1.35;}
  .lab-header{flex-wrap:wrap;}
  .markdown-content pre code,.code-block code{font-size:.78rem;}
  .markdown-content,.quiz-question-text,.rq-text{overflow-wrap:break-word;}
}

/* RESPONSIVE — phones */
@media(max-width:600px){
  .nav-inner{padding:0 1rem;}
  .hero{padding:3rem 1rem;}
  .hero-sub{font-size:1rem;}
  .hero-stats{gap:1.25rem;margin-top:2rem;}
  .stat-n{font-size:1.6rem;}
  .messages-container{padding:0 1rem;}
  .page-header h1{font-size:1.4rem;}
  .breadcrumb{flex-wrap:wrap;font-size:.78rem;row-gap:.15rem;}
  .search-bar{max-width:none;}
  /* Quiz */
  .quiz-header{flex-wrap:wrap;gap:.5rem;padding:.75rem;}
  .quiz-question-card{padding:1rem;}
  .quiz-choice{padding:.65rem .75rem;}
  .quiz-nav{flex-wrap:wrap;gap:.6rem;}
  .quiz-nav .btn{flex:1;justify-content:center;}
  /* Results */
  .results-hero{padding:1.75rem 1rem;}
  .results-score{font-size:3rem;}
  .result-question{padding:1rem;}
  .rq-header{flex-wrap:wrap;}
  /* Games */
  .speedrun-choices{grid-template-columns:1fr;}
  .speedrun-timer{font-size:1.75rem;}
  .speedrun-question{min-height:auto;}
  .end-score{font-size:3.25rem;}
  .game-start-screen,.game-end-screen{padding:2rem 1rem;}
  .fc-card{padding:1.25rem;min-height:180px;}
  .fc-back{inset:1.25rem;}
  .fc-term{font-size:1.1rem;}
  .fc-controls .btn{flex:1;justify-content:center;}
  .memory-grid{gap:.5rem;}
  .mem-card .mem-back{font-size:.68rem;padding:.3rem;}
  .memory-stats{gap:1rem;flex-wrap:wrap;}
  /* Lists */
  .lb-row{flex-wrap:wrap;row-gap:.2rem;}
  .lb-date{display:none;}
  .attempt-row{flex-wrap:wrap;}
  .attempt-detail{flex-basis:100%;}
  /* Forms */
  .auth-card{padding:1.5rem;}
  .config-form{padding:1.25rem;}
  /* Labs */
  .step-header{padding:.75rem .85rem;}
  .step-title{font-size:.9rem;}
  .step-body{padding:.9rem .95rem;}
  .code-header{font-size:.72rem;}
}

/* RESPONSIVE — very small phones */
@media(max-width:380px){
  .hero-title{font-size:1.7rem;}
  .hero-actions .btn{width:100%;justify-content:center;}
  .memory-grid{grid-template-columns:repeat(2,1fr);}
  .lb-type{display:none;}
  .exam-actions .btn,.game-meta{flex-wrap:wrap;}
  .footer-grid{gap:.9rem 1rem;}
  .lab-progress-header{flex-wrap:wrap;}
}

/* ACCESSIBILITY */
:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:4px;}
img{max-width:100%;height:auto;}

/* RESPECT REDUCED MOTION */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;transition-duration:.01ms !important;scroll-behavior:auto !important;}
}

/* DARK MODE — AWS dark tokens */
[data-theme="dark"]{
  color-scheme:dark;
  --bg:#131920;--bg-card:#1b232d;--bg-inset:#161d26;--bg-subtle:#1e252e;--bg-hover:#2a323d;
  --text:#eaeded;--border:#39434e;
  --gray-50:#1a2028;--gray-100:#20262e;--gray-200:#2b333d;--gray-300:#39434e;--gray-400:#8d97a3;--gray-500:#98a2ae;--gray-600:#c1c9d2;--gray-700:#d3dae1;--gray-800:#e8edf2;--gray-900:#f4f7fa;
  --primary:#42b4ff;--primary-dark:#75cfff;--primary-light:rgba(66,180,255,.14);
  --green:#5fc265;--yellow:#e8c96a;--orange:#ffa26b;--red:#ff8585;
  --tint-green:#03220d;--tint-red:#381111;--tint-orange:#2e1d07;--tint-yellow:#2b2410;--tint-blue:#0e1c33;
  --shadow:0 1px 3px rgba(0,0,0,.5),0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 4px 6px -1px rgba(0,0,0,.5),0 2px 4px -2px rgba(0,0,0,.4);
  --shadow-lg:0 10px 15px -3px rgba(0,0,0,.5),0 4px 6px -4px rgba(0,0,0,.4);
}
[data-theme="dark"] .hero::after{
  background-image:linear-gradient(rgba(255,255,255,.05) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.05) 1px,transparent 1px);
}

/* THEME TOGGLE */
.theme-toggle{display:flex;align-items:center;justify-content:center;width:40px;height:40px;background:none;border:none;cursor:pointer;font-size:1.1rem;color:#eaeded;border-radius:var(--radius);transition:all .15s;margin-left:.25rem;}
.theme-toggle:hover{background:rgba(255,255,255,.1);color:#fff;}
