.topbar .top-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: nowrap; }
.topbar .top-right > :is(button,.site-preferences,.typing-style-open,.site-theme-toggle) {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 height: 32px;
 min-height: 32px;
 margin: 0;
 vertical-align: middle;
 border-radius: 7px;
 box-sizing: border-box;
}

html[data-site-page=race] .topbar {
 --race-control-face: #1c3242;
 --race-control-ink: #f6f4eb;
 --race-control-line: #587382;
 background: transparent;
 border-bottom: 0;
}
html[data-site-page=race] .top-inner {
 width: min(1440px, calc(100% - 64px));
 max-width: none;
 margin: auto;
 min-height: 54px;
 padding: 8px 0;
 border-bottom: 1px solid #c9eafb29;
}
html[data-site-page=race] main {
 width: min(1440px, calc(100% - 64px));
 max-width: none;
 margin: auto;
 padding: 10px 0 20px;
}
html[data-site-page=race] .home-link {
 display: flex;
 align-items: center;
 gap: 10px;
 color: inherit;
 text-decoration: none;
}
html[data-site-page=race] .wordmark {
 font: 700 2rem/1 'DM Sans', system-ui, sans-serif;
 letter-spacing: -3.5px;
 color: inherit;
}
html[data-site-page=race] .wordmark span {
 display: inline-block;
 font: 700 0.78rem/1 'DM Sans', system-ui, sans-serif;
 vertical-align: top;
 letter-spacing: 0;
 margin: 2px 0 0 0;
 color: inherit;
}
html[data-site-page=race] .home-caption {
 font: 700 0.76rem/1.2 'Space Mono', ui-monospace, monospace;
 letter-spacing: 0.045em;
 padding-left: 0;
 border-left: 0;
 color: #b7ccd3;
}
html[data-site-page=race][data-site-theme=light] .topbar {
 --race-control-face: #fffef9;
 --race-control-ink: #253b2b;
 --race-control-line: #c9d6bd;
 background: transparent;
 border-bottom: 0;
}
html[data-site-page=race][data-site-theme=light] .top-inner {
 border-bottom-color: #dcded5;
}
html[data-site-page=race] .top-actions {
 display: flex;
 align-items: center;
 justify-content: flex-end;
 gap: 8px;
 flex-wrap: nowrap;
}
html[data-site-page=race] .topbar :is(.icon-button,.typing-style-open,.site-theme-toggle) {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 height: 36px;
 min-height: 36px;
 margin: 0;
 padding: 0 11px;
 border: 1px solid var(--race-control-line);
 border-radius: 8px;
 font: 600 0.82rem/1 'DM Sans', system-ui, sans-serif;
 color: var(--race-control-ink);
 background: var(--race-control-face);
 white-space: nowrap;
}
html[data-site-page=race] .topbar .site-theme-toggle {
 width: 36px;
 padding: 0;
}
html[data-site-page=race] .topbar :is(.icon-button,.typing-style-open,.site-theme-toggle):hover {
 background: color-mix(in srgb,var(--race-control-face) 90%,var(--race-control-ink));
}
html[data-site-page=race] .topbar .icon-button[aria-pressed=true] {
 border-color: var(--race-control-ink);
}
html[data-site-page=race][data-site-theme=light] .topbar :is(.wordmark,.wordmark span) { color: #292d27; }
html[data-site-page=race][data-site-theme=light] .topbar .home-caption { color: #4e594c; }
html[data-site-page=race][data-prompt-theme] #prompt .ch.cursor {
 color: var(--prompt-correct,#213c2d);
 background: color-mix(in srgb,var(--prompt-hot) 17%,var(--prompt-face));
 border-bottom: 2px solid var(--prompt-hot);
 text-shadow: none;
}
html[data-site-page=race][data-typing-palette] #prompt .ch.cursor {
 color: var(--typing-ink);
 background: color-mix(in srgb,var(--typing-accent) 18%,var(--typing-ground));
 border-bottom-color: var(--typing-accent);
}
.tour-brief { gap: 5px 12px; }
html[data-site-page=race] .typing-card .card-head {
 min-height: 44px;
 padding: 9px 14px;
 font: 600 0.86rem/1.3 'DM Sans', system-ui, sans-serif;
}
html[data-site-page=race] .typing-card.blocked .card-head {
 padding: 11px 14px;
 background: #64242b;
 border-bottom-color: #ff927a75;
}
html[data-site-page=race] .typing-card.blocked .card-head #instruction {
 font: 700 0.98rem/1.3 'DM Sans', system-ui, sans-serif;
 color: #fff3eb;
 letter-spacing: 0.005em;
}
html[data-site-page=race][data-site-theme=light] .typing-card.blocked .card-head {
 background: #fde2de;
 border-bottom-color: #e29b90;
}
html[data-site-page=race][data-site-theme=light] .typing-card.blocked .card-head #instruction {
 color: #8a1d14;
}
html[data-site-page=race] #erase-word {
 font: 700 0.8rem/1 'DM Sans', system-ui, sans-serif;
 padding: 6px 10px;
}
.race-radar-dock:not([hidden]) { margin-block-start: 6px; }
.race-radar-dock .race-radar { position: static; width: 100%; box-sizing: border-box; }
.race-radar-dock:not(:has(.race-radar:not([hidden]))) { display: none; }
.race-site-footer {
 width: min(1440px, calc(100% - 64px));
 margin: 8px auto 0;
 display: flex;
 justify-content: space-between;
 align-items: center;
 flex-wrap: wrap;
 gap: 12px 24px;
 padding: 22px 0 28px;
 border-top: 1px solid #c9eafb29;
 font: 700 0.875rem/1.5 'Space Mono', ui-monospace, monospace;
 letter-spacing: 0.045em;
 color: #b7ccd3;
}
.race-site-footer a { color: #cce3e7; text-underline-offset: 3px; }
#progress-track input[type=file] {
 width: min(100%,28rem);
 min-width: 0;
 color: inherit;
 font: inherit;
}
#progress-track input::file-selector-button {
 border: 1px solid var(--site-line,#8fa69a);
 border-radius: 7px;
 background: var(--site-raised,#edf3ec);
 color: var(--site-ink,#20382e);
 font: inherit;
 font-weight: 650;
 padding: .55em .75em;
 margin-inline-end: .55em;
 cursor: pointer;
}
#progress-track input[type=file]:focus-visible {
 outline: 2px solid var(--site-ink,#20382e);
 outline-offset: 3px;
 border-radius: 7px;
}
 @media (max-width:900px) {
 html[data-site-page=race] :is(.top-inner,main,.race-site-footer) {
  width: min(100% - 32px, 760px);
 }
}
@media (max-width:740px) {
 html[data-site-page=race] .top-inner {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  min-height: 0;
  padding: 14px 0;
  gap: 10px 8px;
 }
 html[data-site-page=race] .top-inner .home-link { grid-area: 1 / 1; }
 html[data-site-page=race] .top-inner .game-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
 html[data-site-page=race] .top-inner .top-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 6px;
 }
 html[data-site-page=race] .top-inner :is(.top-actions button,.typing-style-open) {
  height: 38px;
  min-height: 38px;
  padding: 0 11px;
  white-space: nowrap;
  flex: 0 0 auto;
 }
 html[data-site-page=race] .top-inner .top-actions .site-theme-toggle {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  margin-left: auto;
 }
 .tour-brief { display: grid; gap: 3px; justify-items: start; }
 .tour-brief strong,.tour-brief span { margin: 0; }
}

html[data-site-theme=night] {
 --typing-error-text:#ffe6e1;
 --typing-error-fill:#722c3d;
}
html[data-site-theme=night][data-prompt-theme=paper],
html[data-site-theme=night][data-prompt-theme=ocean],
html[data-site-theme=night][data-typing-tone=light] {
 --typing-error-text:#671529;
 --typing-error-fill:#ffd1d8;
}
html[data-site-theme=night] :is(#lab-prompt,#daily-prompt,#text-display,#perf-text,#prompt) :is(.lab-error,.wrong,.error),
html[data-site-theme=night] #test-lab #lab-prompt .flow-glyph.lab-error {
 color:var(--typing-error-text);
 background:var(--typing-error-fill);
 text-decoration:underline;
 text-decoration-thickness:2px;
 text-underline-offset:2px;
}
#keyboard-scene,
.keyboard-wrap .keyboard-hands-fallback {
 display:block;
 width:100%;
 aspect-ratio:2.42 / 1;
 margin:9px 0 4px;
 border:1px solid #d9d5c8;
 border-radius:10px;
 background:#f3f1e9;
}
#keyboard-scene.hands-hidden {
 aspect-ratio:2.95 / 1;
}
html[data-site-theme=night] #keyboard-scene,
html[data-site-theme=night] .keyboard-wrap .keyboard-hands-fallback {
 border-color:#2a3830;
 background:#131a16;
}
#keyboard-scene.keyboard-awaiting-model,
#keyboard-scene[hidden],
.keyboard-wrap .keyboard-hands-fallback[hidden] {display:none}
html[data-site-theme=night] #foundation-track .lesson-keyboard>summary,
html[data-site-theme=night] .keyboard-wrap .keyboard-controls>span {color:#c9e1d1}
html[data-site-theme=night] .keyboard-wrap .keyboard-title {color:#c9e1d1}
footer.site-footer,footer.race-site-footer {display:flex;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}
footer.site-footer nav,footer.race-site-footer nav {display:flex;gap:8px 16px;flex-wrap:wrap}
footer.site-footer a {color:#233d2d;text-underline-offset:3px}
footer.site-footer a:hover {color:#13261b}

html[data-site-theme=night] #error-message {color:#ffd2cb}
html[data-site-theme=night] .trainer:has(#error-message:not(:empty)):not(:has(#error-message button)) #text-display :is(.cursor,.current) {
 color:var(--typing-error-text);
 background:var(--typing-error-fill);
 text-decoration:underline;
 text-decoration-thickness:2px;
 text-underline-offset:2px;
}

/* Compact below-the-fold SEO reference card on subpages */
#page-seo-guide-slot:empty { display: none; }
.seo-guide {
 margin: 28px auto 18px;
 padding: 20px 22px;
 border: 1px solid var(--site-line, #dce4d5);
 border-radius: 12px;
 background: var(--site-surface, #fffef9);
 color: var(--site-ink, #23362a);
}
.seo-guide-head h2 {
 margin: 0 0 6px;
 font: 700 1.15rem/1.25 'DM Sans', system-ui, sans-serif;
 letter-spacing: -0.02em;
 color: inherit;
}
.seo-guide-head p {
 margin: 0;
 font-size: 0.92rem;
 line-height: 1.55;
 color: var(--site-muted, #4f6357);
 max-width: 78ch;
}
.seo-guide-grid {
 display: grid;
 grid-template-columns: repeat(3, minmax(0, 1fr));
 gap: 12px;
 margin: 16px 0 14px;
}
.seo-guide-card {
 padding: 12px 14px;
 border: 1px solid var(--site-line, #e2e8dc);
 border-radius: 9px;
 background: var(--site-raised, #f5f7ef);
}
.seo-guide-card h3 {
 margin: 0 0 4px;
 font: 700 0.88rem/1.3 'DM Sans', system-ui, sans-serif;
 color: inherit;
}
.seo-guide-card p {
 margin: 0;
 font-size: 0.84rem;
 line-height: 1.48;
 color: var(--site-muted, #4f6357);
}
.seo-guide-faqs {
 display: grid;
 gap: 6px;
 margin: 12px 0 14px;
}
.seo-guide-faqs details {
 padding: 9px 12px;
 border: 1px solid var(--site-line, #e2e8dc);
 border-radius: 8px;
 background: var(--site-raised, #f7f9f2);
}
.seo-guide-faqs summary {
 cursor: pointer;
 font: 600 0.87rem/1.35 'DM Sans', system-ui, sans-serif;
 color: inherit;
}
.seo-guide-faqs p {
 margin: 6px 0 0;
 font-size: 0.85rem;
 line-height: 1.5;
 color: var(--site-muted, #4f6357);
}
.seo-guide-related {
 display: flex;
 flex-wrap: wrap;
 align-items: center;
 gap: 6px 8px;
 padding-top: 10px;
 border-top: 1px solid var(--site-line, #e2e8dc);
}
.seo-guide-related > span {
 font: 700 0.72rem/1 'Space Mono', ui-monospace, monospace;
 letter-spacing: 0.06em;
 text-transform: uppercase;
 color: var(--site-muted, #5c6e5b);
 margin-right: 4px;
}
.seo-guide-related a {
 display: inline-flex;
 align-items: center;
 padding: 5px 10px;
 border: 1px solid var(--site-line, #ced9c6);
 border-radius: 999px;
 background: var(--site-raised, #f3f6ee);
 color: var(--site-ink, #233d2d);
 font: 600 0.8rem/1.2 'DM Sans', system-ui, sans-serif;
 text-decoration: none;
}
.seo-guide-related a:hover {
 border-color: #6d8c64;
 text-decoration: underline;
}
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide {
 background: #142634;
 border-color: #365265;
 color: #ecf4f8;
}
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-head p,
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-card p,
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-faqs p,
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-related > span {
 color: #b7ccd3;
}
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-card,
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-faqs details {
 background: #1b3142;
 border-color: #344e61;
}
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-related {
 border-top-color: #314b5d;
}
html[data-site-page=race]:not([data-site-theme=light]) .seo-guide-related a {
 background: #1c3446;
 border-color: #466479;
 color: #eef6fa;
}
@media (max-width: 780px) {
 .seo-guide-grid { grid-template-columns: 1fr; }
}
