@import url('/css/shared/font-standard.css');
@import url('./control-tokens.css');
@import url('./form-controls.css');

.bb-standard-site .bb-simple-navigation {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  display: flex;
  align-items: center;
  min-height: 80px;
  padding: 12px 24px;
  background: var(--bb-bg, var(--theme-component-page-20));
  border-bottom: 1px solid var(--bb-control-border);
}
.bb-has-simple-navigation body { padding-top: 96px; }
html.bb-standard-site[data-bb-theme='cyber'] { --bb-text-dim: var(--theme-component-muted-11); --bb-text-muted: var(--theme-component-muted-11); --bb-control-muted: var(--theme-component-muted-11); }
.bb-standard-site .bb-footer-actions a { color: var(--bb-kelly, var(--theme-component-primary-1)) !important; }
html.bb-standard-site[data-bb-theme='cyber'] :is(.terminal .muted,.endpoint-state) { color: var(--theme-component-muted-11); }
html.bb-standard-site[data-bb-theme='cyber'] .stage .number { background: var(--theme-component-primary-64); color: var(--theme-component-ink-28); }
html.bb-standard-site[data-bb-theme='cyber'] .pill.danger { background: var(--theme-component-error-4); color: var(--theme-component-ink-28); }

.bb-standard-site .bb-return-pair {
  display: inline-flex !important;
  flex-direction: row !important;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0;
  max-width: 100%;
}
.bb-standard-site .bb-return-logo { display: inline-flex !important; flex: 0 0 44px; align-items: center; }
.bb-standard-site .bb-return-logo img { width: 44px !important; height: 44px !important; object-fit: contain; }
.bb-standard-site .bb-return-link {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  position: static !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0;
  min-height: 44px !important;
  max-width: 240px;
  padding: 10px 14px !important;
  border: 1px solid var(--bb-control-border) !important;
  border-radius: 6px !important;
  clip-path: none !important;
  background: var(--bb-control-surface) !important;
  color: var(--bb-control-ink) !important;
  font: 800 15px/1.3 var(--bb-control-font) !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: none;
  white-space: normal;
  box-shadow: none !important;
}
.bb-standard-site .bb-return-link:hover { border-color: var(--bb-control-accent) !important; }
.bb-standard-site .bb-return-link:focus-visible { outline: 2px solid var(--bb-control-accent); outline-offset: 3px; }
.bb-standard-site .bb-return-host { flex-shrink: 0; height: auto !important; min-height: 80px; box-sizing: border-box; padding-right: 148px !important; }
.bb-standard-site .bb-return-host > .bb-container { height: auto !important; padding-right: 0 !important; display: flex !important; flex-direction: row !important; align-items: center; justify-content: flex-start; gap: 16px; }
.bb-standard-site .bb-return-host .nav-category { margin-left: auto; }
.bb-standard-site .bb-return-host .logo { flex: 0 0 auto !important; width: auto !important; min-width: 0; }
.bb-standard-site .bb-return-host .bb-return-link { white-space: normal; flex-shrink: 0 !important; }
/* Page header standard (2026-10-12): BB logo + Return to <hub> + (labs) Mission Debrief, same spot on every page. */
.bb-standard-site .bb-return-pair button.bb-return-link { cursor: pointer; }
.bb-standard-site .bb-return-link.bb-debrief-link { border-color: var(--bb-control-accent) !important; color: var(--bb-control-accent) !important; }
.bb-standard-site .bb-return-link.bb-debrief-link:hover { background: color-mix(in srgb, var(--bb-control-accent) 14%, var(--bb-control-surface)) !important; }
.bb-standard-site .bb-return-link.bb-debrief-link[disabled] { opacity: .45; cursor: not-allowed; }
.bb-standard-site .bb-return-link.bb-validate-link { background: var(--bb-control-accent) !important; border-color: var(--bb-control-accent) !important; color: var(--theme-component-on-primary-5) !important; font-weight: 800 !important; }
.bb-standard-site .bb-return-link.bb-validate-link:hover { filter: brightness(1.1); }
.bb-standard-site .bb-return-link.bb-validate-link[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
[data-bb-validate-source] { display: none !important; }
.bb-standard-site .bb-return-link.bb-chaos-link { border-color: var(--theme-component-error-2) !important; color: var(--theme-component-warning-5) !important; }
.bb-standard-site .bb-return-link.bb-chaos-link:hover, .bb-standard-site .bb-return-link.bb-chaos-link[aria-pressed="true"] { background: var(--theme-component-error-14) !important; border-color: var(--theme-component-error-1) !important; color: var(--theme-component-error-1) !important; }
[data-bb-click-source] { display: none !important; }
.bb-standard-site .bb-return-link.bb-reset-link:hover { border-color: var(--bb-error, var(--theme-component-error-1)) !important; color: var(--bb-error, var(--theme-component-error-1)) !important; }
@media (max-width: 560px) {
  .bb-standard-site .bb-return-pair { flex-wrap: wrap !important; row-gap: 6px !important; }
}
.bb-standard-site :is(.cursor,.cursor-dot,.cursor-coords,.reticle,.reticle-dot) { pointer-events: none !important; }
.bb-standard-site .bb-mobile-navigation-toggle { display: none; }
.bb-standard-site select.bb-field { color-scheme: dark; }
html.bb-standard-site[data-bb-theme='patriotic'] select.bb-field { color-scheme: light; }

/* Keep compact lab controls usable without changing board or device geometry. */
.bb-standard-site :is(.lab-btn,.btn-tactical,.cvv-btn,.mini-action,.mini-btn,.header-action-btn,.dash-action-btn,.control-pill) {
  box-sizing: border-box;
  min-height: 44px;
  border-radius: 6px !important;
  font-family: var(--bb-control-font);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.3;
  clip-path: none !important;
}
.bb-standard-site :is(.lab-btn,.btn-tactical,.cvv-btn,.mini-action,.mini-btn,.header-action-btn,.dash-action-btn,.control-pill):focus-visible { outline: 2px solid var(--bb-control-accent); outline-offset: 3px; }
.bb-standard-site :is(.lab-btn:not(.secondary):not(.danger),.btn-tactical.primary,.cvv-btn.primary,.btn.primary) { background: var(--bb-control-accent); color: var(--bb-control-on-accent); border-color: var(--bb-control-accent); }
.bb-standard-site :is(.lab-btn.secondary,.cvv-btn:not(.primary):not(.danger),.btn.secondary,.btn.ghost) { background: var(--bb-control-surface); color: var(--bb-control-ink); border-color: var(--bb-control-border); }
.bb-standard-site :is(.lab-select,.bb-select,.q-select,.tac-select) { min-height: 44px; border-radius: 6px; font-size: 16px; background: var(--bb-control-field-surface); color: var(--bb-control-ink); border-color: var(--bb-control-field-border); }
.bb-standard-site :is(.lab-select,.bb-select,.q-select,.tac-select):focus-visible { outline: 2px solid var(--bb-control-accent); outline-offset: 2px; }
.bb-standard-site :is(.nav-tab,.tab-btn,.tab-button,.bb-tab-btn,.cvv-tab,.mode-tab,.mode-btn,.floor-tab,.console-tab) {
  min-height: 44px;
  border-radius: 6px;
  font-family: var(--bb-control-font);
  letter-spacing: 0;
}
.bb-standard-site :is(.port-table,.symptom-table,.tactical-table,.triage-matrix-shell table) {
  box-sizing: border-box;
  max-width: 100%;
  background: var(--theme-component-surface-18);
  border: 1px solid var(--theme-component-primary-28);
  border-radius: 6px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.bb-standard-site :is(.port-table,.symptom-table,.tactical-table,.triage-matrix-shell table) th { background: var(--theme-component-surface-19); color: var(--theme-component-primary-29); }
.bb-standard-site :is(.port-table,.symptom-table,.tactical-table,.triage-matrix-shell table) td { color: var(--theme-component-ink-14); border-bottom: 1px solid var(--theme-component-primary-30); }
.bb-standard-site :is(.port-table,.symptom-table,.tactical-table,.triage-matrix-shell table) tbody tr:nth-child(even) { background: var(--theme-component-primary-31); }
.bb-standard-site :is(.port-table,.symptom-table,.tactical-table,.triage-matrix-shell table) tr:last-child td { border-bottom: 0; }
/* Phones and tablets get the slide-out Menu at any width, including "Desktop site" mode (Brett 10/29). */
@media (max-width: 980px), (hover: none) and (pointer: coarse) {
  .bb-standard-site .bb-mobile-navigation-toggle {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    min-height: 44px;
    padding: 8px 14px;
    margin-right: 148px;
    border: 1px solid var(--bb-control-border);
    border-radius: 6px;
    color: var(--bb-control-ink);
    background: var(--bb-control-field-surface);
    font: 700 14px var(--bb-control-font);
  }
  .bb-standard-site :is(nav.bb-site-nav ul,.topbar .nav-links).bb-navigation-open {
    display: flex !important;
    position: fixed !important;
    inset: 80px 12px auto !important;
    flex-direction: column;
    align-items: stretch !important;
    width: auto !important;
    padding: 16px !important;
    border: 1px solid var(--bb-control-border) !important;
    border-radius: 6px;
    background: var(--bb-control-field-surface) !important;
  }
  .bb-standard-site .bb-navigation-open li { display: block !important; }
  .bb-standard-site .bb-navigation-open a { justify-content: flex-start !important; min-height: 44px !important; width: 100% !important; }
}
@media (max-width: 560px) {
  .bb-standard-site .page-tools.bb-return-host { padding-right: 0 !important; }
  .bb-standard-site .page-tools.bb-return-host > .bb-container { flex-direction: column !important; align-items: stretch; }
  .bb-standard-site .page-tools .tool-left { box-sizing: border-box; padding-right: 156px !important; min-width: 0; max-width: 100%; }
  .bb-standard-site .page-tools .tool-right { min-width: 0; max-width: 100%; }
  .bb-theme-document .intel-card h3 { flex-wrap: wrap; }
  .bb-standard-site :is(.symptom-table,.port-table) { width: 100%; table-layout: fixed; }
  .bb-standard-site :is(.symptom-table,.port-table) :is(th,td) { overflow-wrap: anywhere; }
  .bb-standard-site .ws-table { display: block; max-width: 100%; overflow-x: auto; }
  .bb-standard-site .bb-return-host { padding-right: 156px !important; }
  .bb-standard-site .bb-return-pair { gap: 8px !important; }
  .bb-standard-site .bb-return-logo { flex-basis: 36px; }
  .bb-standard-site .bb-return-logo img { width: 36px !important; height: 36px !important; }
  .bb-standard-site .bb-return-link { padding: 8px 10px !important; max-width: 170px; font-size: 15px !important; }
  .bb-standard-site .bb-return-link i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bb-standard-site .bb-return-link { transition: none; }
}

/* Nav "tilt pop" (matches navigation-standard.css): header logos and nav buttons tip clockwise,
   grow and glow on hover. Nav only, on purpose; regular page buttons keep their normal lift. */
nav .logo img, .bb-return-logo img, .nav-bar .brand-link img, .learn-brand img, .bb-brand > a img, .tools-logo img, .branding-logo-link img,
nav .nav-tools a, .bb-standard-site .bb-return-link, .tool-left a.bb-action, .nav-bar .return-link, .learn-nav-links a, #bbNavAuth .bb-nav-pill {
  transition: transform 0.25s cubic-bezier(.3, 1.6, .5, 1), filter 0.25s, background-color 180ms ease, border-color 180ms ease, color 0.2s ease;
}
nav .logo a:hover img, .bb-return-logo:hover img, .nav-bar .brand-link:hover img, .learn-brand:hover img, .bb-brand > a:hover img,
.tools-logo:hover img, .branding-logo-link:hover img, #bbNavAuth .bb-nav-pill:hover {
  transform: rotate(4deg) scale(1.06);
  filter: drop-shadow(0 0 10px var(--theme-component-primary-60));
}
nav .nav-tools a.bb-action.bb-action:hover, nav .nav-tools a:hover, .bb-standard-site .bb-return-link.bb-return-link:hover, .tool-left a.bb-action.bb-action:hover,
.nav-bar .return-link:hover, .learn-nav-links a:hover {
  transform: rotate(4deg) scale(1.06);
  filter: drop-shadow(0 0 8px var(--theme-component-primary-60));
}
@media (prefers-reduced-motion: reduce) {
  nav .logo a:hover img, .bb-return-logo:hover img, .nav-bar .brand-link:hover img, .learn-brand:hover img, .bb-brand > a:hover img,
  .tools-logo:hover img, .branding-logo-link:hover img, #bbNavAuth .bb-nav-pill:hover,
  nav .nav-tools a.bb-action.bb-action:hover, nav .nav-tools a:hover, .bb-standard-site .bb-return-link.bb-return-link:hover, .tool-left a.bb-action.bb-action:hover,
  .nav-bar .return-link:hover, .learn-nav-links a:hover { transform: none; }
}

/* A lab's directions source is never shown in place: it lives in the Mission Brief pop-up. */
[data-bb-brief-source], [data-bb-debrief-source] { display: none !important; }
/* Labs whose layout reserved a directions column give that space back to the lab. */
#container:has(> [data-bb-brief-source]) { grid-template-columns: 1fr !important; }

/* Mission Brief + Mission Debrief pop-ups (js/bb-page-header.js): one shared look, two variants.
   Brief = directions (green accent, solid kicker). Debrief = after-action review (gold accent, left rail on sections).
   Sits below the tactical reticle (z 2147483646+). */
.bb-standard-site .bb-return-link.bb-brief-link { border-color: color-mix(in srgb, var(--bb-control-accent) 55%, var(--bb-control-border)) !important; }
/* Keep every lab reticle above the shared mission overlays, including page-local cursors.
   Match cursor-standard.css without replacing each page's geometry or preference rules. */
html.bb-standard-site body > .cursor { z-index: 2147483646 !important; }
html.bb-standard-site body > .cursor-dot { z-index: 2147483647 !important; }

.bb-mission-overlay { --m-accent: var(--theme-component-primary-1); --m-accent-soft: var(--theme-component-primary-65); --m-ink-on: var(--theme-component-surface-33);
  position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; padding: 16px; background: var(--theme-component-page-44); backdrop-filter: blur(4px); }
.bb-mission--debrief { --m-accent: var(--theme-component-ink-9); --m-accent-soft: var(--theme-component-ink-30); --m-ink-on: var(--theme-component-surface-34); }
.bb-mission-overlay[hidden] { display: none; }
.bb-mission-panel { width: min(820px, 100%); max-height: min(88vh, 940px); display: flex; flex-direction: column; background: var(--theme-component-surface-35);
  border: 1px solid color-mix(in srgb, var(--m-accent) 50%, transparent); border-top: 3px solid var(--m-accent); border-radius: 12px;
  box-shadow: 0 24px 80px var(--theme-component-page-45), 0 0 40px -18px var(--m-accent); overflow: hidden; animation: bbMissionIn 0.22s ease-out; }
.bb-mission-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--m-accent-soft); }
.bb-mission-kicker { grid-column: 1; justify-self: start; font: 800 14px/1 var(--bb-control-font, monospace); letter-spacing: .14em; text-transform: uppercase; color: var(--m-accent); }
.bb-mission--brief .bb-mission-kicker { background: var(--m-accent-soft); padding: 4px 8px; border-radius: 4px; }
.bb-mission--debrief .bb-mission-kicker::before { content: "\25C6  "; }
.bb-mission-head h2 { grid-column: 1; margin: 0; font-size: 1.4rem; color: var(--theme-component-ink-18); }
.bb-mission-close { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--theme-component-border-10); background: transparent; color: var(--theme-component-ink-18); font-size: 24px; line-height: 1; cursor: pointer; }
.bb-mission-close:hover, .bb-mission-close:focus-visible { border-color: var(--m-accent); color: var(--m-accent); outline: none; }
.bb-mission-body { padding: 16px 18px; overflow-y: auto; color: var(--theme-component-ink-15); font-size: 15px; line-height: 1.65; }
.bb-mission-body h1, .bb-mission-body h2, .bb-mission-body h3, .bb-mission-body h4 { color: var(--m-accent); font-size: max(15px, 0.95rem); letter-spacing: .07em; text-transform: uppercase; margin: 18px 0 6px; }
.bb-mission-body > :first-child, .bb-mission-body > * > :first-child { margin-top: 0; }
.bb-mission-body ul, .bb-mission-body ol { padding-left: 22px; }
.bb-mission-body li { margin: 4px 0; }
.bb-mission-body strong { color: var(--theme-component-ink-5); }
.bb-mission-body a { color: var(--m-accent); text-underline-offset: 3px; }
.bb-mission-body code { font-family: var(--bb-control-font, monospace); background: var(--theme-component-ink-16); padding: 1px 5px; border-radius: 4px; }
/* Debrief tables (Brett 2026-11-02): ruled grid, accent header row, top-aligned cells, zebra rows. */
.bb-mission-body table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 14px; line-height: 1.5; border: 1px solid var(--m-accent-soft); border-radius: 6px; }
.bb-mission-body th, .bb-mission-body td { padding: 8px 12px; text-align: left; vertical-align: top; border: 1px solid var(--m-accent-soft); }
.bb-mission-body th { color: var(--m-accent); background: var(--theme-component-ink-16); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.bb-mission-body tr:nth-child(even) td { background: color-mix(in srgb, var(--theme-component-ink-16) 55%, transparent); }
.bb-mission-body td:first-child { font-weight: 700; color: var(--theme-component-ink-5); }
.bb-mission-body td { overflow-wrap: break-word; }
.bb-mission-body td:first-child { min-width: 9em; }
/* lab-audit.css makes tables scroll boxes for phones; on wider screens they stay real tables so the grid fills its border. */
@media (min-width: 700px) { html.bb-standard-site .bb-mission-overlay .bb-mission-body table { display: table; } }
/* Debrief sections read as an after-action report: each heading's block gets a gold rail. */
.bb-mission--debrief .bb-mission-body h3, .bb-mission--debrief .bb-mission-body h4 { border-left: 3px solid var(--m-accent); padding-left: 10px; }
.bb-mission-foot { padding: 12px 18px 16px; border-top: 1px solid var(--m-accent-soft); display: flex; justify-content: flex-end; }
.bb-mission-foot .bb-mission-go { background: var(--m-accent) !important; color: var(--m-ink-on) !important; border-color: var(--m-accent) !important; font-weight: 800; }
html.bb-mission-open { overflow: hidden; }
html[data-bb-theme='patriotic'] .bb-mission-overlay { --m-accent: var(--theme-component-info-10); --m-ink-on: var(--theme-component-ink-28); }
html[data-bb-theme='patriotic'] .bb-mission--debrief { --m-accent: var(--theme-component-error-4); }
html[data-bb-theme='patriotic'] .bb-mission-panel { background: var(--theme-component-ink-28); }
html[data-bb-theme='patriotic'] .bb-mission-head h2, html[data-bb-theme='patriotic'] .bb-mission-body strong { color: var(--theme-component-on-primary-6); }
html[data-bb-theme='patriotic'] .bb-mission-body { color: var(--theme-component-info-11); }
html[data-bb-theme='patriotic'] .bb-mission-close { color: var(--theme-component-on-primary-6); border-color: var(--theme-component-surface-36); }
@keyframes bbMissionIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bb-mission-panel { animation: none; } }

/* Fonts: Ultra is for titles only; buttons and header links stay in bold Geist for readability. */
:root body :is(.bb-return-link, .bb-return-pair a, .bb-return-pair button, button, .btn, [role="button"]) { font-family: 'Geist', sans-serif !important; font-weight: 700; letter-spacing: 0; }

/* T088: Intel reading standard. Pixel tokens remain stable on legacy pages with reduced root sizes. */
:root { --bb-body-size: 17px; --bb-body-color: var(--theme-component-ink-1); --bb-lead-size: 18.88px; --bb-lead-color: var(--theme-component-muted-1); --bb-reading-strong: var(--theme-component-ink-2); }
html.bb-standard-site:not(:has(link[href*="lab-audit.css"])) body :is(main p, .intel-content p, .hero p):not(:where(.mp-eyebrow, .port-line, .kicker, .eyebrow, .mono, .badge, .tag, .pill, .breadcrumb, .breadcrumbs, nav, aside, footer, button, [role="button"], .bb-opt, .choices, .terminal, .terminal-window, .console, .packet-table, .packet-inspector, .packet-info-panel, .ws-table, .os-window, .sim-window, .simulated-ui, .render-preview-card, .xss-output-panel, .fetch-result-panel, .status-brief, .mp-eyebrow *, .port-line *, .kicker *, .eyebrow *, .mono *, .badge *, .tag *, .pill *, .breadcrumb *, .breadcrumbs *, nav *, aside *, footer *, button *, [role="button"] *, .bb-opt *, .choices *, .terminal *, .terminal-window *, .console *, .packet-table *, .packet-inspector *, .packet-info-panel *, .ws-table *, .os-window *, .sim-window *, .simulated-ui *, .render-preview-card *, .xss-output-panel *, .fetch-result-panel *, .status-brief *)) { font-size: var(--bb-body-size) !important; line-height: 1.65 !important; color: var(--bb-body-color) !important; font-weight: 500; overflow-wrap: break-word; }
html.bb-standard-site:not(:has(link[href*="lab-audit.css"])) body :is(main li, .intel-content li, .rl-desc, .rl-row-sub, .exam-tip, .note-box, .mp-small):not(:where(.mp-eyebrow, .port-line, .kicker, .eyebrow, .mono, .badge, .tag, .pill, .breadcrumb, .breadcrumbs, nav, aside, footer, button, [role="button"], .bb-opt, .choices, .terminal, .terminal-window, .console, .packet-table, .packet-inspector, .packet-info-panel, .ws-table, .os-window, .sim-window, .simulated-ui, .render-preview-card, .xss-output-panel, .fetch-result-panel, .status-brief, .mp-eyebrow *, .port-line *, .kicker *, .eyebrow *, .mono *, .badge *, .tag *, .pill *, .breadcrumb *, .breadcrumbs *, nav *, aside *, footer *, button *, [role="button"] *, .bb-opt *, .choices *, .terminal *, .terminal-window *, .console *, .packet-table *, .packet-inspector *, .packet-info-panel *, .ws-table *, .os-window *, .sim-window *, .simulated-ui *, .render-preview-card *, .xss-output-panel *, .fetch-result-panel *, .status-brief *)) { font-size: var(--bb-body-size) !important; line-height: 1.6 !important; color: var(--bb-body-color) !important; overflow-wrap: break-word; }
html.bb-standard-site.bb-standard-site:root body :is(.hero p, .hero-mini p, .mission-header-content > p, .mission-subtitle, .hero-subtitle, .rl-hero-lead, .mp-lead, .lead, .intro, .subtitle) { font-size: var(--bb-lead-size) !important; line-height: 1.65 !important; color: var(--bb-lead-color) !important; font-weight: 500; max-width: 720px; overflow-wrap: break-word; }
html.bb-standard-site.bb-standard-site:root body :is(.hero p, .hero-mini p, .mission-header-content > p, .mission-subtitle, .hero-subtitle, .rl-hero-lead, .mp-lead, .lead, .intro, .subtitle) strong { color: var(--bb-reading-strong); }
/* Brett 10/17: Core Learning (.intel-content) paragraphs are full width; only loose page-level paragraphs keep the 720px measure. */
html.bb-standard-site body main > p { max-width: 720px; }
/* Preserve readable contrast in the existing light theme. */
html.bb-standard-site[data-bb-theme='patriotic'] { --bb-body-color: var(--theme-component-info-11); --bb-lead-color: var(--theme-component-info-12); --bb-reading-strong: var(--theme-component-surface-37); }

/* Core Learning uses the shared pop-up with the module reading standard. */
.bb-mission--module .bb-mission-body, .bb-mission--module .bb-mission-body :is(p, li) { font-size: 17px; line-height: 1.65; color: var(--bb-body-color, var(--theme-component-ink-1)); font-weight: 500; }

/* Lab Standard v2: all mission layout lives here. */
.bb-mission-v2 { --mission-ink:var(--theme-component-ink-1); --mission-strong:var(--theme-component-ink-2); color:var(--mission-ink); font:500 17px/1.65 'Geist',sans-serif; overflow-wrap:anywhere; }
.bb-mission-v2 *, .bb-mission-v2 *::before { box-sizing:border-box; }
.bb-mission-v2 .bb-mission-section { margin:0 0 28px; padding:0 0 24px; border-bottom:1px solid var(--m-accent-soft); }
.bb-mission-v2 .bb-mission-section:last-child { margin-bottom:0; border-bottom:0; }
.bb-mission-v2 .bb-mission-section > h3 { display:flex; gap:10px; align-items:center; margin:0 0 16px; padding:0; border:0; font:700 19px/1.4 'Geist',sans-serif; letter-spacing:0; text-transform:none; }
.bb-mission-v2 h4 { font:700 17px/1.5 'Geist',sans-serif; letter-spacing:0; text-transform:none; border:0 !important; padding:0 !important; }
.bb-mission-v2 :is(p,li,dd) { font-size:17px; line-height:1.65; color:var(--mission-ink); }
.bb-mission-v2 p { margin:12px 0; }
.bb-mission-icon { flex:0 0 32px; display:inline-grid; place-items:center; min-height:32px; font:700 15px/1.2 'Geist',sans-serif; border:1px solid var(--m-accent); border-radius:8px; background:var(--m-accent-soft); }
.bb-mission-v2 .bb-mission-glossary { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.bb-mission-glossary > div { padding:16px; border:1px solid var(--m-accent-soft); border-radius:8px; min-width:0; }
.bb-mission-glossary dt { color:var(--mission-strong); font-weight:700; }
.bb-mission-glossary dd { margin:8px 0 0; }
.bb-mission-v2 .bb-mission-cert { display:inline-block; padding:5px 12px; border:1px solid currentColor; border-radius:999px; font:700 15px/1.5 'Geist',sans-serif; margin-top:12px; }
.bb-mission-cert.cert-a { color:var(--theme-component-primary-66); background:var(--theme-component-surface-38); }
.bb-mission-cert.cert-net { color:var(--theme-component-info-13); background:var(--theme-component-surface-39); }
.bb-mission-cert.cert-sec { color:var(--theme-component-ink-31); background:var(--theme-component-surface-40); }
.bb-mission-cert.cert-cysa { color:var(--theme-component-ink-32); background:var(--theme-component-surface-41); }
.bb-mission-v2 .bb-mission-traps { padding:18px; border:1px solid var(--m-accent); border-radius:10px; background:var(--m-accent-soft); }
.bb-mission-v2 .bb-mission-diagram { margin:20px 0; padding:14px; border:1px solid var(--m-accent); border-radius:10px; background:color-mix(in srgb,var(--m-accent) 5%,transparent); color:var(--mission-strong); }
.bb-mission-diagram svg { display:block; width:100%; height:auto; overflow:visible; }
.bb-mission-diagram svg text { fill:currentColor; font:15px 'Geist',sans-serif; }
.bb-mission-diagram figcaption { font-size:15px; line-height:1.65; margin-top:12px; }
.bb-mission-v2 :is(button,.bb-mission-links a) { min-height:44px; min-width:44px; font:700 16px/1.5 'Geist',sans-serif; white-space:normal; overflow-wrap:anywhere; }
.bb-mission-v2 button { cursor:pointer; border:1px solid var(--m-accent); border-radius:8px; padding:10px 16px; color:var(--mission-strong); background:var(--m-accent-soft); }
.bb-mission-v2 button:hover:not(:disabled) { background:color-mix(in srgb,var(--m-accent) 27%,transparent); }
.bb-mission-v2 :is(button,a):focus-visible { outline:3px solid var(--m-accent); outline-offset:3px; }
.bb-mission-v2 .bb-solution-toggle { width:100%; background:var(--m-accent); color:var(--m-ink-on); }
.bb-solution-preview { filter:blur(5px); user-select:none; pointer-events:none; padding:18px; max-height:76px; overflow:hidden; }
.bb-solution-wrap { display:grid; grid-template-rows:0fr; opacity:0; filter:blur(9px); visibility:hidden; transition:grid-template-rows .35s ease,filter .35s ease,opacity .35s ease,visibility .35s; }
.bb-solution-content { min-height:0; overflow:hidden; }
.bb-solution-wrap.is-open { grid-template-rows:1fr; filter:blur(0); opacity:1; visibility:visible; }
.bb-mission-question { min-width:0; padding:16px; margin:18px 0; border:1px solid var(--m-accent-soft); border-radius:10px; }
.bb-mission-question legend { font-size:17px; color:var(--mission-strong); padding:0 6px; }
.bb-mission-question .bb-selfcheck-choice { display:block; width:100%; text-align:left; margin:10px 0; }
.bb-mission-question button:disabled { opacity:1; cursor:default; }
.bb-mission-links { list-style:none; padding:0 !important; }
.bb-mission-links a { display:flex; align-items:center; padding:8px 0; }
[data-bb-graded].bb-q-right { border:2px solid var(--theme-component-primary-67) !important; box-shadow:0 0 0 1px var(--theme-component-primary-67),0 0 22px var(--theme-component-primary-68),inset 0 0 20px var(--theme-component-primary-69) !important; }
[data-bb-graded].bb-q-wrong { border:2px solid var(--theme-component-warning-6) !important; box-shadow:0 0 0 1px var(--theme-component-warning-6),0 0 22px var(--theme-component-error-15),inset 0 0 20px var(--theme-component-error-16) !important; }
.bb-grade-why { display:block; font:500 15px/1.5 'Geist',sans-serif; color:var(--theme-component-warning-7); margin-top:8px; }
.bb-mission-overlay .bb-mission-panel { min-width:0; max-height:calc(100dvh - 32px); }
.bb-mission-overlay .bb-mission-body { min-height:0; }
html[data-bb-theme='patriotic'] .bb-mission-v2 { --mission-ink:var(--theme-component-info-11); --mission-strong:var(--theme-component-surface-37); }
html[data-bb-theme='patriotic'] .bb-mission--brief { --m-accent:var(--theme-component-primary-70); --m-accent-soft:var(--theme-component-primary-71); --m-ink-on:var(--theme-on-primary); }
html[data-bb-theme='patriotic'] .bb-mission--debrief { --m-accent:var(--theme-component-error-17); --m-accent-soft:var(--theme-component-warning-8); --m-ink-on:var(--theme-on-primary); }
html[data-bb-theme='patriotic'] .bb-grade-why { color:var(--theme-component-error-18); }
@media(max-width:600px) { .bb-mission-overlay { padding:8px; } .bb-mission-overlay .bb-mission-panel { max-height:calc(100dvh - 16px); } .bb-mission-v2 .bb-mission-glossary { grid-template-columns:1fr; } .bb-mission-v2 .bb-mission-section > h3 { font-size:18px; } }
@media(prefers-reduced-motion:reduce) { .bb-solution-wrap { transition:none; } }

/* Validation evidence remains readable outside the compact map workspace. */
.workspace-tools .floor-feedback:has([data-bb-graded]) { max-height:360px; padding:4px; }
.floor-feedback [data-bb-graded] { padding:12px; margin:10px 0; border-radius:8px; }

/* Shared placement targets remain finger-sized in the v2 pilot and rollout. */
.bb-standard-site :is(.palette-tool,.ap-slot,.mw-slot,.walkie-slot)[data-bb-place-target], .bb-standard-site .palette-tool { min-width:40px; min-height:40px; }

.bb-standard-site :is(.ap-slot,.mw-slot,.walkie-slot)[data-bb-place-target] { z-index:4; scroll-margin-top:360px; }

.bb-mission-v2 .bb-solution-toggle:hover:not(:disabled) { background:var(--m-accent); filter:brightness(1.08); }

.bb-mission-diagram svg { max-width:420px; margin-inline:auto; }

/* T163: selected Chaos must remain distinct from hover and survive pointer exit. */
.bb-standard-site .bb-return-link.bb-chaos-link[aria-pressed="true"]{background:var(--theme-component-error-19) !important;color:var(--theme-component-ink-5) !important;border:2px solid var(--theme-component-warning-9) !important;box-shadow:inset 0 0 0 1px var(--theme-component-error-19) !important}
.bb-standard-site .bb-return-link.bb-chaos-link[aria-pressed="true"]::before{content:"✓";margin-right:7px;font-weight:700}

/* T163: account is in the action row; phones need no reserved side gutter or sticky wall. */
@media(max-width:700px){
 .bb-standard-site .bb-page-header.bb-return-host{position:static !important;padding-right:0 !important}
 .bb-standard-site .bb-page-header .bb-return-pair{width:100%}
}

/* Intel post header on phones (Brett 10/23): two tidy rows instead of a 247px stacked column.
   Row 1: logo · Return to Intel · Account. Row 2: Mission Brief · Mission Debrief · Join. */
@media (max-width: 700px) {
  .site-header-inner:has(.bb-brief-link) { flex-wrap: wrap; gap: 6px; padding-block: 8px; }
  .site-header-inner:has(.bb-brief-link) > .bb-return-pair { display: contents; }
  .site-header-inner:has(.bb-brief-link) .site-brand { order: 1; }
  .site-header-inner:has(.bb-brief-link) .site-brand img { width: 36px; height: 36px; }
  .site-header-inner:has(.bb-brief-link) .bb-return-link { order: 2; min-height: 40px !important; padding: 8px 9px !important; font-size: 14px !important; white-space: nowrap !important; }
  .site-header-inner:has(.bb-brief-link) > .bb-nav-in-header { order: 3; margin-left: auto; }
  .site-header-inner:has(.bb-brief-link)::after { content: ""; order: 4; flex-basis: 100%; height: 0; }
  .site-header-inner:has(.bb-brief-link) .bb-brief-link { order: 5; }
  .site-header-inner:has(.bb-brief-link) .bb-debrief-link { order: 6; }
  .site-header-inner:has(.bb-brief-link) > .site-cta { order: 7; margin-left: auto; }
}

/* Lab standard (Brett 10/29): the lab header (Brief, Validate, Debrief, Reset) stays pinned at every width while the
   learner scrolls. Only labs carry .bb-reset-link. An overflow:hidden/auto html or body turns sticky off, so labs clip
   sideways overflow instead (still no horizontal scroll). Wins over the phone static rule above. */
html:has(.bb-page-header .bb-reset-link),
html:has(.bb-page-header .bb-reset-link) body { overflow-x: clip !important; overflow-y: visible !important; }
html.bb-standard-site body > .bb-page-header.bb-return-host:has(.bb-reset-link) { position: sticky !important; top: 0 !important; z-index: 2000; }
/* Pinned means opaque: lab content must not show through the header while it scrolls under it (2026-11-01). */
html.bb-standard-site body > .bb-page-header.bb-return-host:has(.bb-reset-link) { background-color: var(--theme-header, var(--bb-bg-deep, #05080a)); }

/* Lab menu on phones (Brett 10/29): the pinned lab header is the logo plus a "Lab Menu" toggle (added by bb-page-header.js);
   tapping it pops out Brief, Validate, Debrief, Reset and the lab's own actions. */
html .bb-page-header .bb-return-pair .bb-return-link.bb-lab-menu-toggle { display: none !important; }
@media (max-width: 700px) {
  .bb-page-header .bb-return-pair:has(.bb-lab-menu-toggle) { display: flex !important; flex-wrap: wrap !important; align-items: center; gap: 8px; }
  html .bb-page-header .bb-return-pair .bb-return-link.bb-lab-menu-toggle { display: inline-flex !important; margin-left: auto; }
  .bb-page-header .bb-lab-menu-toggle::after { content: "\25BE"; margin-left: 6px; }
  .bb-page-header.bb-lab-menu-open .bb-lab-menu-toggle::after { content: "\25B4"; }
  .bb-page-header:not(.bb-lab-menu-open) .bb-return-pair:has(.bb-lab-menu-toggle) > :not(.bb-return-logo):not(.bb-lab-menu-toggle) { display: none !important; }
  .bb-page-header.bb-lab-menu-open .bb-return-pair > :not(.bb-return-logo):not(.bb-lab-menu-toggle):not([hidden]) { flex: 1 1 calc(50% - 8px); justify-content: center; }
}
