:root{
  --space-8:8px;
  --space-12:12px;
  --space-16:16px;
  --space-24:24px;
  --touch:44px;
  --btn-radius:12px;
}

.button{
  min-height:var(--touch);
  padding:10px var(--space-16);
  border-radius:var(--btn-radius);
  margin-top:0;
  gap:var(--space-8);
  transition:transform 100ms ease-out, background-color 100ms ease-out, border-color 100ms ease-out;
}
.button-gold{
  background:var(--brass);
  border-color:var(--brass);
  color:var(--ink);
}
.button-outline,
.button-outline-dark{
  background:transparent;
}
.button-quiet,
.text-button{
  min-height:var(--touch);
  padding:8px var(--space-12);
  border-radius:var(--btn-radius);
}
.button-small{
  min-height:var(--touch);
  padding:8px var(--space-12);
}
.button:active,
.button-quiet:active,
.text-button:active,
.main-nav button:active,
.material-folder:active,
.theme-toggle:active{
  transform:scale(0.97);
}

.main-nav button,
.theme-toggle,
.hero-video-mute,
.footer-social a{
  min-height:var(--touch);
}
.main-nav{
  display:flex;
  flex:1 1 auto;
  flex-wrap:nowrap;
  min-width:0;
  justify-content:flex-start;
  gap:var(--space-8);
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
}
.main-nav button{flex:0 0 auto;white-space:nowrap}
body{overflow-x:hidden}
.site-header{
  display:flex;
  flex-wrap:nowrap;
  height:72px;
  gap:var(--space-12);
  padding-block:8px;
  padding-top:max(8px,env(safe-area-inset-top));
  transition:height 160ms ease,padding 160ms ease;
  overflow:hidden;
}
.site-header[data-scrolled="true"]{height:56px;padding-block:4px}
.site-header .brand,.site-header .account-actions{flex:0 0 auto}
.site-header svg{fill:currentColor;stroke:currentColor}
.exam-timing-choice{margin-top:var(--space-16)}
.exam-timing-choice small{display:block;color:var(--muted);font-weight:400}
.exam-utility{display:flex;align-items:center;gap:var(--space-24)}
.exam-timer{display:grid;gap:4px;justify-items:end}
.exam-timer output{font:800 1.45rem/1 ui-monospace,"Cascadia Mono",monospace;color:var(--ink)}
@media (min-width:621px) and (max-width:900px){
  .site-header{height:64px}
  .site-header[data-scrolled="true"]{height:52px}
}
.nav-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.25rem;
  min-height:1.25rem;
  margin-left:var(--space-8);
  padding:0 .35rem;
  border-radius:999px;
  background:var(--brass, #c4a35a);
  color:var(--ink, #10232c);
  font-size:.7rem;
  font-weight:800;
  line-height:1;
}
.hero-actions,
.form-actions,
.quiz-controls,
.danger-zone{
  gap:var(--space-12);
}
.hero-actions{margin-top:var(--space-24)}
.workspace-head{gap:var(--space-24);margin-bottom:var(--space-24)}
.panel{padding:var(--space-24)}
.mcq-choices{gap:var(--space-8);margin:var(--space-24) 0}
.mcq-choices label{min-height:var(--touch);padding:var(--space-12) var(--space-16);gap:var(--space-12)}

[data-view="dashboard"],
[data-view="materials"],
[data-view="quiz"],
[data-view="exam-setup"],
[data-view="exam"],
[data-view="flashcards"]{
  padding-block:clamp(48px,7vw,88px);
}

.materials-ribbon{
  display:inline-flex;
  align-items:center;
  min-height:var(--touch);
  margin:0 0 var(--space-16);
  padding:8px var(--space-16);
  background:var(--brass);
  color:var(--ink);
  font:800 .78rem/1 "Cascadia Mono",Consolas,monospace;
  letter-spacing:.12em;
  text-transform:uppercase;
  border-radius:999px;
}
.materials-frame{
  padding:var(--space-16);
  border:2px solid var(--brass);
  background:var(--theme-surface,#fff);
  border-radius:var(--btn-radius);
}
.materials-back-row{
  display:flex;
  flex-wrap:wrap;
  gap:var(--space-8);
  margin:0 0 var(--space-12);
}
.material-detail{
  margin-top:var(--space-16);
}
.material-detail-card{
  display:grid;
  gap:var(--space-12);
  padding:var(--space-16);
  border:1px solid var(--line);
  border-radius:var(--btn-radius);
  background:var(--theme-surface,#fff);
}
.material-preview{
  width:100%;
  max-height:min(70vh,560px);
  border:0;
  background:transparent;
}
.panel,
.quiz-stage,
.progress-item,
.material-library-card,
.user-row,
.guide-card{
  border-radius:var(--btn-radius);
  box-shadow:none;
}
.material-folder-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--space-12);
  margin:0 0 var(--space-16);
}
.material-folder{
  min-height:7.5rem;
  padding:var(--space-16) var(--space-12);
  gap:var(--space-8);
  border:1px solid var(--line);
  border-top:4px solid var(--brass);
  border-radius:var(--btn-radius);
  background:var(--theme-surface,#fff);
  transition:transform 100ms ease-out, border-color 160ms ease;
}
.material-folder:hover,
.material-folder:focus-visible{
  border-color:var(--brass);
}
.material-folder-icon{width:2rem;height:2rem}
.materials-catalog .panel-head{
  display:grid;
  justify-items:center;
  text-align:center;
  gap:var(--space-8);
}
.materials-catalog #materialsLibraryTitle{
  font-size:0.95rem;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
}
.site-footer img{
  width:99px;
  height:auto;
  object-fit:contain;
}

@media (max-width:620px){
  .site-header{height:64px;gap:var(--space-8);padding:8px 10px;padding-top:max(8px,env(safe-area-inset-top))}
  .site-header[data-scrolled="true"]{height:48px;padding-block:2px}
  .site-header .brand span,.site-header .account-name,.site-header .account-avatar,.theme-toggle [data-theme-label]{display:none}
  .site-header .brand-icon{width:36px;height:36px}
  .site-header .account-actions{gap:4px}
  .site-header .account-actions .button,.site-header .theme-toggle{min-height:40px;padding-inline:8px}
  .main-nav{gap:2px}
  .main-nav button{min-height:40px;padding:6px 8px}
  .legal-banner{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;padding-block:.5rem}
  .exam-utility{align-items:flex-end;flex-direction:column;gap:var(--space-12)}
  .site-footer img{width:79px;height:auto}
  .site-footer{gap:.65rem;padding:max(.85rem,env(safe-area-inset-bottom)) .85rem}
  .site-footer .footer-social{gap:.35rem}
  .site-footer .footer-social a{min-height:36px;padding:.35rem .5rem}
  .material-folder-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (prefers-reduced-motion:reduce){
  .button,
  .button-quiet,
  .text-button,
  .main-nav button,
  .material-folder,
  .theme-toggle,
  .destination-tab{
    transition:none;
    transform:none !important;
    animation:none !important;
  }
}

/* Mobile first-screen hotfix: compact real touch chrome and keep the first CTA above 70vh. */
@media (max-width:767px){
  .site-header{
    height:calc(52px + env(safe-area-inset-top));
    min-height:calc(52px + env(safe-area-inset-top));
    padding:env(safe-area-inset-top) 8px 0;
    gap:6px;
  }
  .site-header[data-collapsed="true"]{
    height:calc(48px + env(safe-area-inset-top));
    min-height:calc(48px + env(safe-area-inset-top));
    padding-bottom:0;
  }
  .site-header .brand-icon{width:32px;height:32px}
  .site-header .account-actions .button,.site-header .theme-toggle,.site-header .main-nav button{min-height:36px}
  .legal-banner{padding:4px 10px;font-size:.68rem;line-height:1.25}
  .dossier-hero{grid-template-columns:minmax(0,1fr);padding:16px;gap:16px}
  .dossier-copy,.dossier-copy .eyebrow,.hero-actions,.hero-video-stage,.exam-docket{min-width:0;max-width:100%}
  .dossier-copy .eyebrow{margin-bottom:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.62rem}
  .dossier-copy h1{max-width:12ch;margin:.08em 0 .2em;font-size:clamp(2.25rem,11vw,3rem);line-height:.98}
  .dossier-copy .hero-lede{display:-webkit-box;max-width:38ch;margin:.35rem 0 0;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:.9rem;line-height:1.35}
  .hero-actions{margin-top:12px;align-items:center;flex-wrap:nowrap}
  .hero-actions .button{min-height:40px;padding:8px 12px}
  .hero-actions [data-open-login]{border:0;background:transparent;color:#fff;padding-inline:6px;text-decoration:underline;text-underline-offset:3px;box-shadow:none}
  .hero-video-stage{max-height:180px;overflow:hidden}
  .hero-video-frame{width:min(100%,20rem);max-width:20rem;max-height:180px;aspect-ratio:16/9}
  .hero-video{object-fit:cover}
  .hero-video-stage figcaption{display:none}
}

@media (min-width:768px) and (max-width:900px){
  .dossier-hero{padding:2rem clamp(1.25rem,5vw,3rem);gap:1.5rem}
}

html[data-theme="dark"] .materials-frame,
html[data-theme="dark"] .material-folder{
  background:var(--theme-surface);
  color:var(--theme-text);
  border-color:var(--theme-line);
  border-top-color:var(--brass);
}
html[data-theme="dark"] .materials-ribbon{
  background:var(--brass);
  color:var(--ink);
}
html[data-theme="dark"] .material-detail-card{
  background:var(--theme-surface);
  color:var(--theme-text);
  border-color:var(--theme-line);
}

/* Icon-only social targets and compact, non-sticky mobile footer. */
.desk-icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
.footer-social a{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}
.footer-social a span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.footer-social a:focus-visible,[data-single-resend]:focus-visible{outline:3px solid #e0b53c;outline-offset:3px}
.directory-avatar{border-radius:50%;object-fit:cover;vertical-align:middle;margin-right:8px}
#singleResendDialog{max-width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:24px;border:1px solid var(--theme-line);background:var(--theme-surface);color:var(--theme-text)}
#singleResendDialog form{display:grid;gap:12px}
.season-greeting{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 16px;background:#122f45;color:#fff;border-left:4px solid var(--season-accent,#e0b53c)}
.season-greeting button{min-width:44px;min-height:44px;background:transparent;color:#fff;border:0}
.season-emblem{flex:none;width:24px;height:24px;color:var(--season-accent,#e0b53c)}
.season-emblem svg{display:block;width:24px;height:24px}
.season-message{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.footer-social svg{color:var(--season-accent,inherit)}
html[data-season="mlk"],html[data-season="presidents"]{--season-accent:#eac784}
html[data-season="memorial"],html[data-season="veterans"]{--season-accent:#b6c9ec}
html[data-season="juneteenth"],html[data-season="independence"]{--season-accent:#f4a5b1}
html[data-season="labor"]{--season-accent:#99dce0}
html[data-season="indigenous"]{--season-accent:#b9dab5}
html[data-season="thanksgiving"]{--season-accent:#eac784}
@media(prefers-reduced-motion:reduce){.season-greeting,.season-emblem,.footer-social svg{animation:none!important;transition:none!important;transform:none!important}}
html[data-season="valentines"]{--season-accent:#eb89a9}
html[data-season="black_friday"]{--season-accent:#e0b53c}
html[data-season="christmas"]{--season-accent:#86cfb1}
html[data-season="new_years_eve"],html[data-season="new_year"]{--season-accent:#e0b53c}
html:not([data-season="default"]) .brand-icon{filter:drop-shadow(0 0 2px var(--season-accent))}
@media(max-width:767px){
  .site-footer{position:static;display:grid;grid-template-columns:32px 1fr;grid-template-rows:20px 44px;gap:0;padding:4px 8px calc(4px + env(safe-area-inset-bottom));margin:0;min-height:0}
  .site-footer>picture{grid-column:1;grid-row:1;line-height:0}
  .site-footer>picture img{width:29px;height:20px}
  .site-footer>div:not(.footer-links){display:none}
  .site-footer .footer-links{grid-column:2;grid-row:1;justify-content:flex-end;gap:0;line-height:16px;font-size:12px}
  .site-footer .footer-links a:not(:first-child){display:none}
  .site-footer .footer-social{grid-column:1/-1;grid-row:2;display:flex;justify-content:center;flex-wrap:nowrap;gap:0;margin:0}
  .site-footer .footer-social a{width:44px;height:44px;min-height:44px;padding:0;border:0}
  .site-footer .footer-social svg{width:18px;height:18px}
  #exam-sitting-dialog{max-height:calc(100dvh - 24px);overflow:auto}
  .dossier-copy h1{max-width:none;font-size:clamp(1.85rem,8.4vw,2.4rem)}
}
