/* [split 2/9] servbg.com stylesheet: app shell: layout, header, tools panel, center stack, quiz grid, console, news panel, footer, cookie banner. Split from style.css on 2026-10-12 (lines 89-1584 of the original); the nine css/*.css parts load in numbered order, then the terminal css/app.css. See style.css stub. */
/* === LAYOUT === */
.app {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) auto;   /* footer row auto (was 36px —
     clipped the two-row stat cells added 2026-08-28); minmax(0,..) lets the middle
     row shrink below its content's min-content, so the footer row is never pushed
     off-screen on short viewports (content scrolls internally instead). */
  grid-template-columns: 96px 1fr 320px;   /* rail 74->96px 2026-09-26: 8.5px
     labels were unreadable; 11px labels need the extra width. */
  grid-template-areas:
    "header header header"
    "tools console news"
    "footer footer footer";
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 1200px) {
  .app {
    grid-template-columns: 96px 1fr 280px;
  }
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 88px 1fr 240px;
  }
}

/* Legacy ≤900px rules for .app/.news-panel/.center-stack/#dosTerminal/
   .visitor-info/.header/.footer consolidated into the AUTHORITATIVE MOBILE
   LAYOUT block (≤932px, near EOF) 2026-08-29 — see that block. The
   #dosTerminal ID rule (min-height:58vh) that beat .console-panel's 40vh
   by specificity, causing a height jump at the 900/932px boundary, was
   removed; .console-panel's 40vh (932 block) is now the single source. */

/* === HEADER === */
.header {
  grid-area: header;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 2026-09-26: logo + hero line stack; flex:0 0 auto keeps .visitor-info the
   only shrinking/scrolling child, exactly as when .logo sat here alone. */
.brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  flex: 0 0 auto;
  min-width: 0;
}
.brand-tagline {
  font-size: 12px;
  line-height: 1.25;
  color: var(--text-secondary);   /* 5.6:1 on --bg-secondary */
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.logo-icon { font-size: 16px; }

.visitor-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
}

.visitor-info::-webkit-scrollbar { height: 0; }

.v-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.v-tag svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.v-tag .val {
  color: var(--text-primary);
  font-weight: 500;
}

/* Wave 3 item 1 (2026-08-29): "▸ more" toggle for the collapsed mobile
   visitor-info strip. display:none here so desktop never renders it
   (pill styling + visibility live entirely in the ≤932px block below). */
.v-more-toggle { display: none; }

/* === TOOLS PANEL (Left) === */
.tools-panel {
  grid-area: tools;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  overflow: visible;
  padding: 0;
  position: relative;
}

/* ── Icon rail + flyout ─────────────────────────────────────────────── */
.tool-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 5px;
  gap: 2px;
  scrollbar-width: thin;
}
.tool-rail::-webkit-scrollbar { width: 4px; }
.tool-rail::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.rail-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  padding: 5px 0 3px;
}

.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  padding: 7px 2px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.rail-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.rail-item span { font-size: 11px; font-weight: 600; letter-spacing: 0.03em; line-height: 1; }
.rail-item:hover { background: var(--bg-card); color: var(--accent); }
.rail-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rail-item.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-color));
}
.rail-sep { height: 1px; background: var(--border-color); margin: 5px 6px; flex-shrink: 0; }

/* 2026-09-26: terminal "COPY"/"LINK" actions. app.css styles .term-tab-action
   with display:flex, so [hidden] needs a forced override to win. */
#sbgCopyResult[hidden], #sbgCopyLink[hidden] { display: none !important; }
.rail-spacer { flex: 1 1 auto; min-height: 6px; }

.tool-flyout {
  position: fixed;
  z-index: 1200;
  min-width: 232px;
  max-width: 300px;
  background: var(--bg-secondary);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  padding: 12px;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.tool-flyout.open { opacity: 1; transform: none; pointer-events: auto; }
.tool-flyout-wide { min-width: 262px; max-width: 320px; }
.flyout-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 9px;
}
.flyout-body { display: flex; gap: 6px; align-items: center; }
.flyout-body .tool-input { flex: 1 1 auto; min-width: 0; }
.flyout-body .tool-input.small { flex: 0 0 58px; }
.flyout-body .go-btn { flex: 0 0 auto; }
.flyout-body-block { display: block; max-height: 60vh; overflow-y: auto; }

@media (prefers-reduced-motion: reduce) {
  .tool-flyout { transition: opacity 0.12s ease; transform: none; }
}



.tool-section {
  margin-bottom: 12px;
}

.tool-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-section-title svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.tool-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 4px;
  transition: border-color 0.15s;
}

.tool-row:hover {
  border-color: var(--border-hover);
}

.tool-row:focus-within {
  border-color: var(--accent);
}

.tool-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

.tool-input {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 6px 8px;
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  width: 100%;
  min-width: 0;
}

.tool-input:focus {
  outline: none;
  border-color: var(--accent);
}

.tool-input::placeholder {
  color: var(--text-muted);
  font-size: 10px;
}

.go-btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 3px;
  padding: 6px 10px;
  color: var(--accent);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.go-btn:hover {
  background: var(--accent);
  color: #000;
}

/* Tool with two inputs */
.tool-row.split {
  grid-template-columns: 70px 1fr 50px auto;
}

.tool-input.small {
  width: 50px;
  text-align: center;
}

/* Tool with options row */
.tool-with-opts {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-bottom: 4px;
}

.tool-with-opts .tool-main {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 5px 6px;
}

.tool-opts {
  display: flex;
  gap: 8px;
  padding: 4px 6px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.tool-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
}

.tool-opt input[type="checkbox"] {
  accent-color: var(--accent);
  width: 12px;
  height: 12px;
}

.tool-opt input[type="number"] {
  width: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 2px 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 10px;
  text-align: center;
}

/* Special buttons */
.tool-btn-special {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  background: var(--accent-dim);
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  margin-bottom: 4px;
}

.tool-btn-special:hover {
  background: var(--accent);
  border-style: solid;
  color: #000;
}

.tool-btn-special svg {
  width: 14px;
  height: 14px;
}

/* === CENTER STACK (Terminal 60% top + Quiz inline 40% bottom) === */
.center-stack {
  grid-area: console;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.15fr);   /* terminal smaller, quiz taller;
     minmax(0,..) lets both cells shrink and scroll internally on short viewports. */
  min-height: 0;
  overflow: hidden;
  background: var(--bg-console);
}

/* Full-screen terminal overlay (maximize). No ancestor uses transform, so
   position:fixed escapes the grid cleanly. Sits above the cookie banner (2000). */
#dosTerminal[data-maximized="true"] {
  position: fixed;
  inset: 0;
  z-index: 3000;
  border-radius: 0;
}
body.terminal-maximized { overflow: hidden; }
#termMaxBtn { font-size: 13px; line-height: 1; }

.center-stack > .console-panel,
.center-stack > .quiz-inline {
  min-height: 0;
  overflow: hidden;
}

.quiz-inline {
  background: var(--bg-secondary);
  border-top: 2px solid var(--accent);            /* accent strip — matches news-header chrome */
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 10px 14px 8px;
  gap: 8px;
  overflow-y: auto;
  position: relative;
}

.quiz-inline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);  /* same as .news-header */
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.1em;                         /* match news-header tracking */
  text-transform: uppercase;
}

.quiz-inline-header > span {
  font-weight: 600;
  color: var(--text-muted);
}

.quiz-inline-link {
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.quiz-inline-link:hover { color: var(--accent); }

/* === 4-panel quiz grid === */
.quiz-panels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.5fr;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  /* Internal scroll, matching the centre column's own convention: .center-stack
     rows are minmax(0, 1fr), so each cell shrinks and scrolls instead of pushing
     the page. Without this the grid shrank (flex:1 1 auto + min-height:0) while
     its children kept natural height and painted over #quizStatsFooterInline —
     reproduced 2026-09-26 at 1366x768: the strip laid out at y 480-510, inside
     the card band y 320-547, on top of the Open Employer Portal button.
     Scroll, not clip: every card stays whole and reachable. Mobile (≤932) keeps
     overflow:visible — the panels stack there and .quiz-inline scrolls instead. */
  overflow-y: auto;
}

.qp-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 0;
  min-height: 0;
}

.qp-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.qp-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}

.qp-feats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.qp-feat {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.qp-feat svg { flex-shrink: 0; color: var(--accent); opacity: 0.75; margin-top: 1px; }
.qp-feat strong { color: var(--text-primary); font-weight: 600; }

.qp-action {
  display: block;
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 5px 10px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  margin-top: auto;
}
.qp-action:hover { border-color: var(--accent); color: var(--accent); }
.qp-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.quiz-pill.quiz-pill-full {
  width: 100%;
  justify-content: center;
}

/* 2026-10-10: was a 3-column grid; nowrap pills overflowed the ~160px card at 1280 ("Surviva").
   Flex-wrap: a pill that does not fit drops to its own line instead of being clipped. */
.qp-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.qp-mode-row .quiz-pill {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  font-size: 10px;
  padding: 4px 6px;
}

/* Inline variant of the quiz stats strip — tighter, no big top margin */
.quiz-stats-footer.quiz-stats-footer-inline {
  margin: 0;
  padding: 6px 8px;
  font-size: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 4px;
}


.quiz-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quiz-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  white-space: nowrap;
  line-height: 1.2;
}
.quiz-pill:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.quiz-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-pill svg { flex-shrink: 0; }

.quiz-pill-accent { border-color: var(--accent); color: var(--accent); }
.quiz-pill-accent:hover { background: var(--accent-dim); }

.quiz-pill-mode { font-weight: 600; }
.quiz-pill-nightmare { color: var(--error); border-color: rgba(248,81,73,0.35); }
.quiz-pill-nightmare:hover { background: var(--error-dim); border-color: var(--error); color: var(--error); }
.quiz-pill-survival  { color: var(--warning); border-color: rgba(210,153,34,0.35); }
.quiz-pill-survival:hover  { background: var(--warning-dim); border-color: var(--warning); color: var(--warning); }

/* Achievement strip below pills */
.quiz-inline-achievements {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 2px;
  font-size: 10px;
  color: var(--text-muted);
  min-height: 18px;
}
.qia-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
  color: var(--text-primary);
  font-size: 10px;
  line-height: 1.4;
}
.qia-badge.qia-locked { opacity: 0.55; font-style: italic; }
.qia-badge .qia-icon { font-size: 11px; }
.qia-empty { color: var(--text-muted); font-style: italic; }
.qia-cta {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
}

/* === Quiz streak / next-badge hint (logged-in only) === */
.quiz-streak-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-secondary);
}
.quiz-streak-hint[hidden] { display: none; }
.quiz-streak-hint .qsh-line { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.quiz-streak-hint .qsh-line b { color: var(--text-primary); font-weight: 600; }
.quiz-streak-hint .qsh-muted { color: var(--text-muted); font-style: italic; }
.quiz-streak-hint .qsh-next  { color: var(--text-muted); }
.quiz-streak-hint .qsh-next b { color: var(--accent); }
.quiz-streak-hint .qsh-icon  { font-size: 11px; }

/* === Quiz mini leaderboard (top 3 nightmare) === */
.quiz-mini-lb {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 6px 9px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.quiz-mini-lb:hover  { border-color: var(--accent); background: var(--accent-dim); }
.quiz-mini-lb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-mini-lb .qmlb-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0 8px;
  flex-shrink: 0;
}
.quiz-mini-lb .qmlb-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.quiz-mini-lb .qmlb-head {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.quiz-mini-lb .qmlb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.quiz-mini-lb .qmlb-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-primary);
}
.quiz-mini-lb .qmlb-medal { font-size: 12px; line-height: 1; text-align: center; }
.quiz-mini-lb .qmlb-nick  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-mini-lb .qmlb-score {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 600;
}
.quiz-mini-lb .qmlb-empty {
  font-size: 10.5px;
  color: var(--text-muted);
  font-style: italic;
}

/* Right side: random preview question */
.quiz-inline-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.quiz-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}
.quiz-preview-body::-webkit-scrollbar { width: 6px; }
.quiz-preview-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
.quiz-preview-body::-webkit-scrollbar-track { background: transparent; }
.quiz-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.quiz-preview-tag {
  color: var(--accent);
  font-weight: 600;
}
.quiz-preview-cat {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 60%;
}
.quiz-preview-q {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}
.quiz-preview-opts {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.quiz-preview-opt {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 8px;
  text-align: left;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.quiz-preview-opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.quiz-preview-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.quiz-preview-opt .qpo-letter {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  flex-shrink: 0;
}
.quiz-preview-opt.qpo-correct {
  border-color: var(--success, #3fb950);
  background: rgba(63,185,80,0.18);
  color: var(--success, #3fb950);
}
.quiz-preview-opt.qpo-wrong {
  border-color: var(--error);
  background: var(--error-dim);
  color: var(--error);
}
.quiz-preview-opt:disabled { cursor: default; }
.quiz-preview-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  margin-top: auto;
}
.quiz-preview-msg {
  color: var(--text-muted);
  font-style: italic;
}
.quiz-preview-msg.is-good { color: var(--success, #3fb950); font-style: normal; }
.quiz-preview-msg.is-bad  { color: var(--error); font-style: normal; }
.quiz-preview-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
}
.quiz-preview-skip:hover { color: var(--accent); }

/* Header chrome action button — matches console-btn but slightly smaller */
.quiz-inline-header .quiz-inline-link.console-btn {
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
  padding: 3px 8px;
}



/* === CONSOLE (Middle) === */
.console-panel {
  grid-area: console;
  background: var(--bg-console);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* When wrapped inside .center-stack, the panel no longer owns the grid cell. */
.center-stack > .console-panel {
  grid-area: auto;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.console-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.console-title svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.console-actions {
  display: flex;
  gap: 4px;
}

.console-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 5px 10px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.console-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.console-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  font-family: var(--font-ui);
}

.console-entry {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.console-entry:last-child {
  border-bottom: none;
}

.console-timestamp {
  color: var(--text-muted);
  font-size: 10px;
  margin-bottom: 2px;
}

.console-command {
  color: var(--accent);
  margin-bottom: 6px;
  font-size: 11px;
}

.console-command::before {
  content: '❯ ';
  opacity: 0.7;
}

.console-output {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
  max-height: 400px;
  overflow-y: auto;
}

.console-output.success { border-color: var(--accent-border); }
.console-output.error { border-color: rgba(248, 81, 73, 0.4); color: var(--error); }

.console-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 60px 20px;
  font-size: 11px;
}

.console-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* Console Tables */
.console-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

.console-table th {
  text-align: left;
  padding: 5px 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
}

.console-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-color);
}

.console-table tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-success { background: var(--accent-dim); color: var(--accent); }
.badge-error { background: var(--error-dim); color: var(--error); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info { background: var(--info-dim); color: var(--info); }

/* === NEWS PANEL (Right) === */
.news-panel {
  grid-area: news;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.news-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.news-header svg {
  width: 12px;
  height: 12px;
  color: var(--accent);
}

.news-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.news-item {
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: border-color 0.15s;
}

.news-item:hover {
  border-color: var(--accent-border);
}

.news-source {
  color: var(--accent);
  font-size: 10px;
  margin-bottom: 4px;
  font-weight: 600;
}

.news-text {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-text a {
  color: var(--info);
  text-decoration: none;
}

.news-text a:hover {
  text-decoration: underline;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.news-time {
  color: var(--text-muted);
  font-size: 10px;
}

.news-search-wrap {
  padding: 8px 10px 4px;
  border-bottom: 1px solid var(--border-color);
}

.news-search-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 4px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.news-search-input:focus {
  border-color: var(--accent);
}

.news-tag-chips {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
}

/* Chips live in their own strip so the Filter toggle stays pinned outside the
   collapsed row's horizontal scroll. */
.news-chips-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.news-chip {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.news-chip-active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* 2026-09-26 item A: the chip row is one line by default (All + 5 busiest +
   Filter toggle). .news-chip-extra is everything behind the toggle; an active
   chip never gets that class, so a live filter stays on screen. */
.news-tag-chips.news-chips-collapsed .news-chip-extra { display: none; }
.news-tag-chips.news-chips-collapsed .news-chips-strip {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
.news-tag-chips.news-chips-collapsed .news-chips-strip::-webkit-scrollbar { display: none; }
/* 2026-10-10: the last chip is cut by the strip edge next to the Filter toggle; fade it. */
.news-tag-chips.news-chips-collapsed .news-chips-strip {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.news-tag-chips.news-chips-collapsed .news-chip { flex: 0 0 auto; }

.news-chips-toggle {
  flex: 0 0 auto;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  cursor: pointer;
  font-family: inherit;
}
.news-chips-toggle:hover { color: var(--accent); border-color: var(--accent); }
.news-chips-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 2026-09-26 item B: collapsed CVE burst. One summary row stands in for a run
   of near-identical advisories; the members render inside .news-cve-items on
   first expand. */
.news-cve-group {
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  margin-bottom: 6px;
  background: var(--bg-primary);
}
.news-cve-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-secondary);
}
.news-cve-count { color: var(--accent); font-weight: 600; }
.news-cve-sep   { color: var(--text-muted); }
.news-cve-prod  { color: var(--text-primary); }
.news-cve-chan  { color: var(--accent); font-size: 10px; }
.news-cve-toggle {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--info);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}
.news-cve-toggle:hover { color: var(--accent); }
.news-cve-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.news-cve-items { display: none; padding: 0 6px 6px; }
.news-cve-items.is-open { display: block; }
.news-cve-items .news-item { margin-bottom: 6px; }
.news-cve-items .news-item:last-child { margin-bottom: 0; }

/* 2026-09-26 item C: post-answer explanation under the quiz options and in the
   survival feedback banner. #8b949e on the panel ground is 7.0:1. */
.qp-why {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #8b949e;
  word-break: break-word;
}

/* Wave 3 item 2 (2026-08-29): collapse/expand indicator for the mobile
   "SECURITY NEWS ▸" toggle header. Hidden on desktop (the panel is always
   expanded there) — only shown + wired ≤932px. */
.news-toggle-indicator { display: none; margin-left: auto; font-size: 11px; color: var(--text-muted); }

/* === FOOTER === */
.footer {
  grid-area: footer;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;     /* even breathing room top+bottom (row is auto-sized) */
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;       /* narrow desktops: links wrap under stats, no scroll */
  gap: 4px 16px;
  font-size: 10px;
  color: var(--text-muted);
  overflow-x: visible;   /* was auto — the scrollable-footer bug on full HD */
}

.footer::-webkit-scrollbar { height: 0; }

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Footer stats: two-row cells — label on top, number below (2026-08-28,
   replaces the pipe-separated single row that overflowed even full-HD). */
.footer-left .stat {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.footer .stat-sep { display: none; }

.footer-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-link {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 4px 10px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.footer-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === COOKIE BANNER === */
.cookie-banner {
  position: fixed;
  /* 2026-09-26: was bottom:84px, floating over the app grid. The desktop
     layout is a 100vh non-scrolling grid, so a fixed banner permanently
     covered whatever sat under it (quiz options, the Skip button, news
     items — clicks were intercepted). The banner now docks to the bottom
     edge and the page reserves its strip instead (see .consent-reserved
     below), so it obscures nothing. */
  bottom: 16px;
  right: 16px;
  left: auto;
  width: min(380px, calc(100vw - 32px));
  background: var(--bg-secondary);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 14px 16px;
  z-index: 2000;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

/* Space reservation for the consent banner. --consent-space is measured in JS
   (syncCookieBannerSpace) and cleared when the banner is dismissed. On desktop
   .app is height:100vh with a minmax(0,1fr) middle row that scrolls
   internally, so shrinking it is safe: the footer stays on screen and nothing
   ends up underneath the banner. */
@media (min-width: 933px) {
  body.consent-reserved .app { height: calc(100vh - var(--consent-space, 0px)); }
}

@media (max-width: 932px) {
  /* REDESIGNED 2026-08-29 (mobile overhaul wave 1, fix 3): a true
     bottom-anchored sheet instead of the old magic `bottom:336px`
     mid-viewport placement. That offset was sized to clear the (now-fixed)
     inflated footer height and, in short landscape viewports (e.g. 844x390),
     put the banner's top edge up near y=0 — colliding with modal close
     buttons anchored at the top of full-screen mobile modals. Anchoring to
     the true bottom edge (bottom:0) means the banner's footprint is always
     the last ~70-140px of the viewport, never the top, regardless of
     viewport height or footer layout — so the landscape collision is gone
     by construction, not just by z-index. z-index is still hardened
     defensively: .modal-overlay was raised to 2100 (was 1000), above this
     banner's 2000, so an open modal always wins the stacking order if any
     future layout change ever reintroduces overlap. */
  .cookie-banner {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 12px 12px 0 0;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  }
  /* Compact single row when there's room (~480px+); wraps to two rows below
     that instead of a fixed breakpoint, so it degrades gracefully. */
  .cookie-content {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .cookie-text { min-width: 200px; }
  .cookie-buttons { margin-left: auto; }
  /* Wave 2 item 4 (2026-08-29): 36px accept/essential buttons undersized for
     touch — bump to the 44px tap-target floor on mobile only. */
  .cookie-btn { min-height: 44px; }
}

.cookie-text {
  flex: 1;
  min-width: 280px;
}

.cookie-text strong {
  color: var(--accent);
  font-size: 13px;
  display: block;
  margin-bottom: 4px;
}

.cookie-text p {
  color: var(--text-secondary);
  font-size: 11px;
  margin: 0;
  line-height: 1.5;
}

.cookie-text a {
  color: var(--accent);
}

.cookie-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.cookie-btn.accept {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #000;
}

.cookie-btn.accept:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.cookie-btn.reject {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.cookie-btn.reject:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stat-label {
  color: var(--text-muted);
}

.stat-val {
  color: var(--accent);
  font-weight: 600;
}

.stat-sep {
  color: var(--border-color);
  margin: 0 4px;
}

