/* Shared signed-in navigation; isolated from the public landing header. */
.account-tools[hidden],.account-tools [hidden]{display:none!important}
#account-header.has-account-tools{display:grid;grid-template-columns:minmax(160px,1fr) auto auto;gap:18px;align-items:center}
#account-header.has-account-tools .brand{min-width:0}
#account-header.has-account-tools .topbar-nav{width:auto;max-width:none;justify-content:flex-end}
.account-tools{display:flex;align-items:center;gap:8px;border-left:1px solid #ffffff29;padding-left:18px}
.account-tools a{display:flex;align-items:center;justify-content:center;gap:9px;min-height:48px;padding:8px 14px;box-sizing:border-box;border:1px solid #ffffff36;border-radius:12px;background:#ffffff09;color:#fff;text-decoration:none;font-size:14px;font-weight:750;line-height:1.2;transition:background .15s,border-color .15s}
.account-tools a:hover{background:#ffffff19;border-color:#ffce55}
.account-tools a[aria-current=page]{border-color:#ffce55}
.account-tools .account-wallet{background:#ffe49b;color:#15243a;border-color:#ffe49b}
.account-tools .account-wallet:hover{background:#ffda73}
.account-wallet__copy{display:grid;gap:3px;text-align:left}
.account-wallet__copy>span{font-size:11px;font-weight:650;letter-spacing:.04em;text-transform:uppercase}
.account-wallet__copy strong{font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}
.account-icon{display:flex;flex:none}.account-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.account-tools a:focus-visible{outline:3px solid #ffcf45;outline-offset:4px}
@media(max-width:1100px){#account-header.has-account-tools{grid-template-columns:1fr auto}#account-header.has-account-tools .brand-copy small{display:none}.account-tools{grid-column:1/-1;justify-content:flex-end;border-left:0;border-top:1px solid #ffffff24;padding:10px 0 0}#account-header.has-account-tools{row-gap:10px}}
@media(max-width:600px){#account-header.has-account-tools{padding:12px 16px;gap:10px;grid-template-columns:minmax(0,1fr) auto}#account-header.has-account-tools .brand{gap:7px}#account-header.has-account-tools .brand-mark{width:34px;height:34px}#account-header.has-account-tools .brand strong{font-size:17px}#account-header.has-account-tools .topbar-nav{display:flex!important;gap:5px;flex-wrap:wrap;max-width:160px;width:auto!important}#account-header.has-account-tools .topbar-nav a{min-height:44px;padding:8px 9px;font-size:12px}.account-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;justify-content:stretch;gap:8px}.account-tools .account-wallet{justify-content:flex-start}.account-wallet__copy{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.account-tools a{min-height:44px;padding:8px 12px}.account-tools .account-access{padding-inline:15px}}
@media(prefers-reduced-motion:reduce){.account-tools a{transition:none}}

.account-nav-compact{display:none}
.account-tools .account-logout{min-height:44px;padding:8px 12px;font:inherit;white-space:nowrap}
.account-tools .account-logout:focus-visible{outline:3px solid #ffcf45;outline-offset:4px}
@media(max-width:600px){.has-account-tools .account-nav-wide{display:none}.has-account-tools .account-nav-compact{display:inline}}

/* Legacy navigation styles target every span; labels must remain plain text. */
#account-header .topbar-nav a>span{padding:0;border:0;box-shadow:none;background:none;min-height:0;font:inherit;color:inherit;letter-spacing:inherit}
#account-header .topbar-nav a>span::before{content:none}
#account-header .account-nav-wide{display:inline}
#account-header .account-nav-compact{display:none}
#account-header.has-account-tools .topbar-nav a:focus-visible{outline:3px solid #ffcf45;outline-offset:3px}
@media(max-width:600px){#account-header.has-account-tools .account-nav-wide{display:none}#account-header.has-account-tools .account-nav-compact{display:inline}}

#account-header.has-account-tools .topbar-nav a{min-height:44px}
#account-header.has-account-tools .account-wallet{min-width:0}
#account-header.has-account-tools .account-wallet__copy{min-width:0}
#account-header.has-account-tools .account-wallet__copy strong{white-space:normal;overflow-wrap:anywhere}

@media(max-width:600px){#account-header.has-account-tools{position:relative}#account-header.has-account-tools .account-tools{display:flex;flex-wrap:wrap}#account-header.has-account-tools .account-wallet{flex:1 1 170px}#account-header.has-account-tools .account-access{flex:1 1 90px}#account-header.has-account-tools .account-wallet__copy>span{overflow-wrap:anywhere}}

#account-header .account-tools a:focus-visible{outline:3px solid #ffcf45;outline-offset:4px}

/* Keep the session control on the same row on narrow screens. */
#account-header .account-tools .account-logout{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;padding:8px;border:1px solid #ffffff4d;border-radius:10px;background:#ffffff09;color:#fff;box-shadow:none}
#account-header .account-tools .account-logout:hover{background:#ffffff24}
@media(max-width:600px){#account-header.has-account-tools .account-tools{flex-wrap:nowrap}#account-header.has-account-tools .account-wallet{flex:1 1 auto;padding:8px}#account-header.has-account-tools .account-access{flex:0 0 auto;padding:8px 10px}#account-header.has-account-tools .account-wallet__copy{display:grid;gap:3px}#account-header.has-account-tools .account-icon svg{width:19px;height:19px}#account-header.has-account-tools .account-wallet__copy strong{font-size:12px}#account-header.has-account-tools .account-access{font-size:13px}}

/* Reserve the account row before JS, capability flags, balance and session arrive. */
html.account-layout #account-header{display:grid;grid-template-columns:minmax(130px,1fr) auto minmax(min-content,352px);grid-template-rows:minmax(56px,auto);gap:16px;align-items:center}
html.account-layout #account-header .brand{min-width:0;gap:8px}
html.account-layout #account-header .brand strong{white-space:nowrap;overflow-wrap:normal}
html.account-layout #account-header .topbar-nav{width:auto;max-width:none;justify-content:flex-end}
html.account-layout #account-header .topbar-nav a{min-height:44px}
html.account-layout #account-header .account-tools{grid-column:3;min-width:0;min-height:56px;box-sizing:border-box;display:flex;flex-wrap:nowrap}
html.account-layout #account-header .account-wallet{flex:1;min-width:min-content;min-height:48px}
html.account-layout #account-header .account-wallet__copy strong{overflow-wrap:normal}
html.account-layout #account-header .account-access{flex:none}
html.account-layout #account-header .account-tools :is(.account-wallet,.account-logout)[hidden]{display:flex!important;visibility:hidden;pointer-events:none}
@media(max-width:1100px){
  html.account-layout #account-header{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:minmax(44px,auto) minmax(48px,auto);gap:8px;padding:10px 16px}
  html.account-layout #account-header .brand-copy small{display:none}
  html.account-layout #account-header .account-tools{grid-column:1/-1;min-height:48px;justify-content:flex-end;padding:0;border-left:0;border-top:0}
  html.account-layout #account-header .account-wallet{flex:0 1 200px}
}
@media(max-width:600px){
  html.account-layout #account-header{display:flex;flex-wrap:wrap;align-content:flex-start;min-height:120px;padding:10px 12px;box-sizing:border-box}
  html.account-layout #account-header .brand{flex:0 0 auto;gap:6px}
  html.account-layout #account-header .brand-mark{width:32px;height:32px;flex-basis:32px;margin:0}
  html.account-layout #account-header .brand strong{font-size:1rem}
  html.account-layout #account-header .topbar-nav{display:flex!important;flex:1 1 auto;gap:6px;flex-wrap:wrap;max-width:100%;width:auto!important;margin-left:auto}
  html.account-layout #account-header .topbar-nav :is(a,button){min-height:44px;padding:8px 9px;font-size:.75rem}
  html.account-layout #account-header .account-tools{flex:1 0 100%;flex-wrap:wrap;gap:6px}
  html.account-layout #account-header .account-wallet{flex:1 1 7.5rem;min-height:48px;padding:6px}
  html.account-layout #account-header .account-tools .account-logout{flex:0 0 44px}
  html.account-layout #account-header .account-access{min-height:48px;padding:6px 8px;font-size:.8125rem}
  html.account-layout #account-header .account-wallet__copy strong{font-size:.8125rem}
}
/* A landscape phone has room for one row, but little vertical space. */
@media(min-width:601px) and (max-width:1100px) and (max-height:520px){
  html.account-layout #account-header{position:relative;grid-template-columns:auto auto minmax(0,1fr);grid-template-rows:minmax(48px,auto);gap:10px;padding:8px 12px}
  html.account-layout #account-header .brand-mark{width:32px;height:32px;flex-basis:32px;margin:0}
  html.account-layout #account-header .brand strong{font-size:1rem}
  html.account-layout #account-header .topbar-nav{display:flex!important;gap:6px;width:auto!important}
  html.account-layout #account-header .topbar-nav :is(a,button){min-height:44px;padding:8px;font-size:.75rem}
  html.account-layout #account-header .account-tools{grid-column:3;gap:6px}
  html.account-layout #account-header .account-wallet{flex:1;min-height:48px;padding:6px 8px}
  html.account-layout #account-header .account-wallet__copy strong{font-size:.8125rem}
  html.account-layout #account-header .account-access{font-size:.8125rem;padding:8px}
}

@media(max-width:600px){html.account-layout #account-header .account-nav-wide{display:none}html.account-layout #account-header .account-nav-compact{display:inline}}

/* Visible route-specific shell before the deferred application and API finish. */
.builder-prerender{display:none}
.account-prerender{display:none}
html:is([data-app-view=wallet],[data-app-view=access]) #app>.account-prerender{display:block}
html:is([data-app-view=wallet],[data-app-view=access]) #app>.lpv3-prerender{display:none}
html:is([data-app-view=wallet],[data-app-view=access]) #app{max-width:1240px;margin-inline:auto;padding:28px 24px 48px;min-height:100svh;box-sizing:border-box}
.account-prerender{padding:24px 20px;color:#10243c;background:#f8f3e8;border-radius:16px}
.initial-account-intro{margin-bottom:24px}
.initial-account-intro h1{font-size:clamp(28px,3vw,38px);line-height:1.04;letter-spacing:-.035em;margin:0 0 12px;color:#0b2038;font-weight:900;width:auto;max-width:none}
.initial-account-intro h1 em{font-style:normal;color:#a4430c}
.initial-account-intro>p{font-size:16px;line-height:1.6;margin:0;color:#56667a}
.initial-account-intro .initial-account-eyebrow{font:750 12px/1.4 ui-monospace,monospace;letter-spacing:.13em;text-transform:uppercase;color:#835006;margin:0 0 14px;display:flex;align-items:center;gap:9px}
.initial-account-eyebrow:before{content:"";width:10px;height:10px;background:#ff7615;border:2px solid #ffc344;border-radius:50%}
html[data-app-view=wallet] .initial-access,html[data-app-view=access] .initial-wallet{display:none}
.initial-account-loading{min-height:440px;padding:45px 20px;text-align:center;background:#fffdf7;border:1px solid #cad4de;border-radius:16px;color:#50647a;box-sizing:border-box}
html[data-app-view=builder] #app>.builder-prerender{display:block}
html[data-app-view=builder] #app>.lpv3-prerender{display:none}
html[data-app-view=builder] #app{width:min(calc(100% - 40px),1480px);max-width:1480px;padding:0;margin:24px auto 48px;color:#10243c;min-height:100svh;box-sizing:border-box}
html[data-app-view=builder] #app .builder-hero{display:grid;grid-template-columns:minmax(0,1fr) 320px;align-items:start;gap:20px;padding:0;margin:0 0 24px;background:none;border:0;box-shadow:none;min-height:0}
html[data-app-view=builder] #app .builder-hero-card{display:grid;grid-template-columns:minmax(0,1fr) 220px;align-items:center;gap:24px;min-height:320px;padding:28px 30px;max-width:none;border:1px solid #ffffff1a;border-radius:14px;box-shadow:0 20px 54px #07101f21;background:linear-gradient(90deg,#ffffff0e 1px,transparent 1px),linear-gradient(0deg,#ffffff0b 1px,transparent 1px),radial-gradient(circle at 12% 16%,#ff7a1a33,transparent 320px),linear-gradient(118deg,#07101f 0%,#0d223d 56%,#12375d 100%);background-size:44px 44px,44px 44px,auto,auto;color:#fffaf2}
html[data-app-view=builder] #app .builder-hero-card::after{content:none}
html[data-app-view=builder] #app .builder-hero .hero-copy{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;padding:0;margin:0;width:100%;max-width:100%;min-width:0;align-content:start;align-self:center}
html[data-app-view=builder] #app .builder-hero .hero-copy>*{min-width:0}
html[data-app-view=builder] #app .builder-hero h1{font-size:clamp(36px,3.6vw,52px);line-height:1.04;letter-spacing:-.035em;color:#fffaf2;margin:0;width:auto;max-width:min(12ch,100%)}
html[data-app-view=builder] #app .builder-hero .hero-kicker{font:800 12px/1.5 ui-monospace,monospace;color:#ffd264;letter-spacing:.09em;margin:0;text-transform:uppercase;max-width:none}
html[data-app-view=builder] #app .builder-hero .builder-hero-copy{font-size:16px;line-height:1.55;color:#f2f0eb;max-width:66ch;margin:0}
html[data-app-view=builder] #app .builder-hero-actions{display:flex;flex-wrap:wrap;gap:10px;margin:2px 0 0;width:100%;max-width:100%;min-width:0}
html[data-app-view=builder] #app .builder-hero-actions .btn{min-height:48px;padding:12px 16px;font-size:15px;line-height:1.4;min-width:0;max-width:100%;width:auto;flex:0 1 auto;white-space:normal}
html[data-app-view=builder] #app .builder-hero-actions .btn.secondary{color:#fffaf2;border:1px solid #ffffff59;background:#ffffff14;box-shadow:inset 0 1px 0 #ffffff14}
html[data-app-view=builder] #app .builder-hero-map{display:grid;grid-template-columns:1fr;gap:10px;align-self:center;min-width:0}
html[data-app-view=builder] #app .builder-map-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:3px 10px;min-height:60px;padding:11px 12px;border:1px solid #ffffff40;border-radius:12px;background:#ffffff14;box-shadow:inset 0 1px 0 #ffffff0a}
html[data-app-view=builder] #app .builder-map-card>span{display:grid;place-items:center;width:29px;height:29px;border:1px solid #ffd7b6;border-radius:50%;background:#ff7a1a;color:#07101f;font:850 12px/1 ui-monospace,monospace;box-shadow:none}
html[data-app-view=builder] #app .builder-map-card strong{font-size:14px;line-height:1.3;color:#fffaf2}
html[data-app-view=builder] #app .builder-map-card small{grid-column:2;font-size:12px;line-height:1.3;color:#eceef1}
html[data-app-view=builder] #app .builder-session-card{padding:24px;min-width:0;border:1px solid #07101f21;border-radius:14px;background:linear-gradient(#fffaf2f7,#fff4e4eb);box-shadow:0 10px 28px #07101f14}
html[data-app-view=builder] #app .builder-session-card h2{font-size:25px;line-height:1.12;margin:0 0 14px;color:#10243c;letter-spacing:-.025em}
html[data-app-view=builder] #app .builder-session-card>p:not(.module-eyebrow){font-size:14px;line-height:1.55;color:#45566a;margin:0}
html[data-app-view=builder] #app .builder-hero-limits{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0}
html[data-app-view=builder] #app .builder-hero-limits>div{display:grid;gap:5px;min-width:0;padding:10px;border:1px solid #07101f21;border-radius:10px;background:#ffffffa8}
html[data-app-view=builder] #app .builder-hero-limits small{font:700 11px/1.4 ui-monospace,monospace;color:#5b6879;text-transform:uppercase}
html[data-app-view=builder] #app .builder-hero-limits strong{font-size:13px;line-height:1.35;color:#10243c}
html[data-app-view=builder] #app .builder-session-card .builder-ai-note{padding-top:14px;border-top:1px solid #07101f21;font-size:12px!important;line-height:1.5}
html[data-app-view=builder] #app .builder-hero-error{grid-column:1/-1;display:grid;gap:12px;min-width:0}
html[data-app-view=builder] #app .builder-hero-error .btn{justify-self:start;max-width:100%;transform:none!important}
html[data-app-view=builder] #app .module-eyebrow{font:700 11px/1.5 ui-monospace,monospace;letter-spacing:.07em;margin:0 0 8px;color:#8a460e}
html[data-app-view=builder] #app .builder-hero-actions .btn.primary{background:linear-gradient(135deg,#ff8b32,#f27620)!important;color:#07101f!important;border:1px solid #ba4b00!important;text-shadow:none!important;box-shadow:0 3px 0 #a64911,0 12px 24px #ff7a1a26,inset 0 1px 0 #ffffff52!important}
html[data-app-view=builder] #app .builder-hero-actions .btn:disabled{opacity:.5;box-shadow:none!important}
.builder-loading{max-width:calc(100% - 340px);min-height:430px;padding:24px;border:1px solid #07101f21;border-radius:14px;background:linear-gradient(#fffaf2f7,#fff4e4eb);box-shadow:0 10px 28px #07101f14;box-sizing:border-box}
.builder-loading h2{font-size:23px;line-height:1.25;letter-spacing:-.025em;color:#10243c;margin:0 0 8px}
.builder-loading>p:not(.module-eyebrow){font-size:14px;line-height:1.5;color:#50647a;margin:16px 0}
.initial-placeholder{height:140px;border-radius:10px;background:linear-gradient(#edf2f6 0 64px,transparent 64px 76px,#edf2f6 76px);margin-top:24px}
/* Keep the help/footer below the first viewport while content is being loaded. */
#account-page .access-wrap{min-height:100svh;box-sizing:border-box;display:flex;flex-direction:column}
#account-page .account-help{margin-top:auto;padding-top:38px}
#account-page :is(#wallet-content,#access-content)>.account-loading{min-height:440px;box-sizing:border-box}
@media(max-width:1100px){html[data-app-view=builder] #app .builder-hero-card{grid-template-columns:minmax(0,1fr)}html[data-app-view=builder] #app .builder-hero-map{display:none}}
@media(max-width:900px){html[data-app-view=builder] #app .builder-hero{grid-template-columns:minmax(0,1fr)}html[data-app-view=builder] #app .builder-session-card{display:none}html[data-app-view=builder] #app .builder-hero-actions .btn.secondary{display:none}.builder-loading{max-width:100%}}
@media(max-width:520px){html[data-app-view=builder] #app{width:calc(100% - 24px);padding:0;margin:16px auto 36px}html[data-app-view=builder] #app .builder-hero{margin-bottom:16px}html[data-app-view=builder] #app .builder-hero-card{min-height:0;padding:20px 18px;gap:0}html[data-app-view=builder] #app .builder-hero .hero-copy{gap:14px}html[data-app-view=builder] #app .builder-hero h1{font-size:32px;line-height:1.06;max-width:16ch}html[data-app-view=builder] #app .builder-hero .hero-kicker{font-size:10px}html[data-app-view=builder] #app .builder-hero .builder-hero-copy{font-size:14px;line-height:1.5}html[data-app-view=builder] #app .builder-hero-actions .btn.primary{width:100%;min-height:48px;margin:0}.builder-loading{padding:20px 16px;min-height:520px}.builder-loading h2{font-size:22px}}
@media(max-width:520px){html:is([data-app-view=wallet],[data-app-view=access]) #app{padding:24px 16px 36px}.account-prerender{padding:20px 0}.initial-account-intro>p{font-size:14px}.initial-account-intro .initial-account-eyebrow{font-size:10px;margin-bottom:10px}}

/* Asset-gated routes never display or fetch the hidden landing hero. */
html[data-app-view]:not([data-app-view=landing]) #app>.lpv3-prerender{display:none}

/* Public student/teacher links must reflow before enlarged text reaches the logo. */
@media (max-width: 760px) {
  html:is([data-app-view="public-link"], [data-app-view="classroom-panel"]) body:not(.public-page):not(.pricing-page):not(.public-documents):not(.legal-page) #account-header {
    display: flex;
    flex-wrap: wrap;
  }

  html:is([data-app-view="public-link"], [data-app-view="classroom-panel"]) body:not(.public-page):not(.pricing-page):not(.public-documents):not(.legal-page) #account-header .topbar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    max-width: 100%;
  }
}

/* Reserve wrapped balance text and the login label before capabilities arrive. */
@media(min-width:1101px){
  html.account-layout #account-header{grid-template-rows:minmax(68px,auto)}
  html.account-layout #account-header .account-tools{min-height:68px}
}
@media(max-width:350px){
  html.account-layout #account-header{min-height:136px}
  html.account-layout #account-header .account-tools{flex-wrap:wrap;min-height:63px}
  html.account-layout #account-header .account-wallet{flex:1 1 0;min-width:min-content;min-height:63px}
  html.account-layout #account-header .account-wallet__copy strong{overflow-wrap:normal}
  html.account-layout #account-header .account-access{flex:0 1 100px;min-width:min-content}
}
