/* ============================================================
   CyberUnit @ UNG — Global Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Exo+2:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────── */
:root {
  --bg:          #0d0d0d;
  --surface:     #141414;
  --border:      #1f1f1f;
  --accent:      #00ff88;
  --accent-dim:  #00cc6a;
  --text:        #e0e0e0;
  --text-soft:   #b3b3b3;
  --text-muted:  #666666;
  --danger:      #ff4444;
  --warn:        #ffaa00;
  --info:        #4488ff;
}

/* ─── Global Reset ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Ensure [hidden] always wins over display: flex/grid rules */
[hidden] { display: none !important; }

/* Suppress hover-triggered transitions while a scroll is in flight — see
   initScrollPerf() in main.js. Card grids (resources: 42 cards, about: 18)
   otherwise sweep dozens of :hover targets under a stationary cursor during
   a fast scroll, retriggering each card's transform/box-shadow transition.
   Re-enables ~150ms after the last scroll event, once scrolling settles. */
body.is-scrolling {
  pointer-events: none;
}

html {
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* ─── Base Styles ────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  animation: fadeIn 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text);
  line-height: 1.3;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-dim);
}

code, pre {
  font-family: 'Share Tech Mono', monospace;
}

img {
  max-width: 100%;
  height: auto;
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.03; }
  50%       { opacity: 0.06; }
}

/* ─── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
}

main {
  padding: 2rem 0 4rem;
}

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  /* Solid, not translucent+blurred: backdrop-filter on a fixed element forces
     the browser to re-sample everything scrolling underneath it every frame,
     which is a major cause of scroll jank (measured: cut RasterTask ~35% on
     the /resources page). */
  background: #0d0d0d;
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar .container {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.navbar-logo-img {
  height: 38px;
  width: auto;
  display: block;
  transition: opacity 0.2s;
}
.navbar-logo:hover .navbar-logo-img {
  opacity: 0.8;
}
.navbar-logo-text {
  margin-left: 0.6rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.navbar-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  align-items: center;
}

.navbar-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  transition: color 0.2s;
}
.navbar-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--accent);
}
.navbar-links a:hover::after,
.navbar-links a.active::after {
  transform: scaleX(1);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  aria-label: "Toggle navigation";
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.navbar-links.open {
  display: flex;
}

/* ─── Page offset for fixed navbar ──────────────────────── */
body > main,
.page-body {
  padding-top: 80px;
}

/* ─── Hero Section ───────────────────────────────────────── */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridPulse 4s ease-in-out infinite;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--accent);
}

.hero-brand {
  display: block;
  color: var(--text);
  line-height: 1.1;
}

.hero-typeline {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.6em;
  color: var(--accent);
  min-height: 1.4em;
}

.typewriter-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 1rem 0 2rem;
  max-width: 560px;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Homepage "About the Unit" section — separate it from the topic grid above */
#about-unit {
  margin-top: 3.5rem;
}

/* Homepage intro prose (crawlable body copy) */
.home-intro {
  max-width: 760px;
  margin-top: 1rem;
}
.home-intro p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.home-intro strong {
  color: var(--text);
}
.home-intro a {
  color: var(--accent);
  text-decoration: none;
}
.home-intro a:hover {
  text-decoration: underline;
}

/* ─── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 2rem 0;
  flex-wrap: wrap;
}

.stat-item {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}
.stat-item strong {
  color: var(--accent);
  display: block;
  font-size: 1.4rem;
}

/* ─── Section Heading ────────────────────────────────────── */
.section-heading {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}
.section-heading span {
  color: var(--accent);
}

/* ─── Topic Grid ─────────────────────────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
/* Shared base for the static (non-hover, non-flex-column) "surface box" look
   used by page-specific card-like components (about.html's info/partner/org
   cards, etc.) — those pages only add their own layout/sizing on top. */
.surface-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 255, 136, 0.08);
  border-color: rgba(0, 255, 136, 0.2);
}

/* Whole-card link: the entire topic box is clickable. */
a.card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.card-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-beginner {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.3);
}
.badge-intermediate {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warn);
  border: 1px solid rgba(255, 170, 0, 0.3);
}
.badge-advanced {
  background: rgba(255, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 68, 68, 0.3);
}

/* ─── Difficulty filter chips ────────────────────────────── */
.difficulty-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
}
.chip {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}
.chip[aria-pressed="true"] {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  border-color: rgba(0, 255, 136, 0.4);
}

/* ─── Button ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.2);
  color: var(--accent);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-dim);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: rgba(255, 68, 68, 0.1);
  box-shadow: 0 0 16px rgba(255, 68, 68, 0.2);
  color: var(--danger);
}
.btn-sm {
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  min-height: 36px;
}

/* ─── Code Block ─────────────────────────────────────────── */
.code-block {
  background: #1a1a1a;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  margin: 1rem 0;
  color: var(--text);
}

code {
  background: #1a1a1a;
  border-radius: 3px;
  padding: 0.1em 0.4em;
  font-size: 0.88em;
  color: var(--accent);
}

.room-code-copy {
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.room-code-copy:hover,
.room-code-copy:focus-visible {
  background: #262626;
  color: var(--text);
  outline: none;
}

/* ─── Callout ────────────────────────────────────────────── */
.callout {
  border-left: 3px solid;
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
.callout-info {
  border-color: var(--info);
  background: rgba(68, 136, 255, 0.07);
  color: #88aaff;
}
.callout-warn {
  border-color: var(--warn);
  background: rgba(255, 170, 0, 0.07);
  color: #ffcc55;
}
.callout-danger {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.07);
  color: #ff8888;
}

/* ─── Progress Bar ───────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.3s;
}
.progress-weak   { background: var(--danger); }
.progress-fair   { background: var(--warn); }
.progress-strong { background: var(--accent); }

/* ─── Quiz Box ───────────────────────────────────────────── */
.quiz-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.quiz-question {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-free-response {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.quiz-free-response:focus { border-color: var(--accent); }
.quiz-free-response::placeholder { color: var(--text-muted); }

.quiz-option {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.65rem 1rem;
  color: var(--text-muted);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  min-height: 44px;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(0, 255, 136, 0.04);
}
.quiz-option.correct {
  border-color: var(--accent);
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
}
.quiz-option.wrong {
  border-color: var(--danger);
  background: rgba(255, 68, 68, 0.1);
  color: var(--danger);
}
.quiz-option:disabled {
  cursor: not-allowed;
}

.quiz-feedback {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  border-radius: 4px;
  display: none;
}
.quiz-feedback.correct {
  background: rgba(0, 255, 136, 0.08);
  color: var(--accent);
  border-left: 3px solid var(--accent);
  display: block;
}
.quiz-feedback.wrong {
  background: rgba(255, 68, 68, 0.08);
  color: #ff8888;
  border-left: 3px solid var(--danger);
  display: block;
}

.quiz-score {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1.5rem;
}
.quiz-score-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.quiz-score-msg {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding-top: 80px;
}
.breadcrumb a {
  color: var(--text-muted);
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb span {
  margin: 0 0.4rem;
}

/* ─── Topic Header ───────────────────────────────────────── */
.topic-header {
  margin-bottom: 2rem;
}
.topic-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.topic-icon-large {
  font-size: 2.5rem;
}
.topic-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.read-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ─── Topic Content ──────────────────────────────────────── */
.topic-content {
  margin-bottom: 3rem;
}
.content-section {
  margin-bottom: 2rem;
}
.content-section h3 {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.content-section p {
  color: var(--text);
  margin-bottom: 0.75rem;
}

/* ─── CIA Triad ──────────────────────────────────────────── */
.cia-triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.cia-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  text-align: center;
}
.cia-box .cia-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.cia-box h4 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.cia-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Threat Cards ───────────────────────────────────────── */
.threat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.threat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.threat-card .threat-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.threat-card h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.threat-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Password Table ─────────────────────────────────────── */
.password-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.password-table th {
  font-family: 'Share Tech Mono', monospace;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.password-table th.bad  { color: var(--danger); }
.password-table th.good { color: var(--accent); }
.password-table td {
  padding: 0.5rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  border-bottom: 1px solid rgba(31,31,31,0.5);
}
.password-table .bad-pw { color: var(--danger); }
.password-table .good-pw { color: var(--accent); }

/* ─── Terminal Window ────────────────────────────────────── */
.terminal-window {
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
}
.terminal-titlebar {
  background: #1a1a1a;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red   { background: #ff5f57; }
.terminal-dot.yellow{ background: #ffbd2e; }
.terminal-dot.green { background: #28c840; }
.terminal-titlebar-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}
.terminal-body {
  padding: 1.25rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88rem;
}
.terminal-line {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  margin-bottom: 0.6rem;
  align-items: start;
}
.terminal-cmd {
  color: var(--accent);
}
.terminal-desc {
  color: var(--text-muted);
}
.terminal-prompt {
  color: var(--text-muted);
  margin-right: 0.5rem;
}

/* ─── Network Flow Diagram ───────────────────────────────── */
.network-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.flow-node {
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-align: center;
  min-width: 80px;
}
.flow-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-family: 'Share Tech Mono', monospace;
}

/* ─── IR Lifecycle Diagram ───────────────────────────────── */
.ir-lifecycle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
  counter-reset: ir-step;
}
.ir-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  position: relative;
  counter-increment: ir-step;
}
.ir-step::before {
  content: counter(ir-step);
  display: block;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  line-height: 28px;
  margin: 0 auto 0.5rem;
  font-weight: bold;
}
.ir-step h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.ir-step p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Career Cards ───────────────────────────────────────── */
.career-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
.career-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.career-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}
.career-card h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.career-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ─── Resource Links ─────────────────────────────────────── */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}
.resource-link {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s, background 0.2s;
}
.resource-link:hover {
  border-color: var(--accent);
  background: rgba(0,255,136,0.04);
}
.resource-link h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.resource-link p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.resource-link .link-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  margin-left: 1rem;
  flex-shrink: 0;
}

/* ─── Password Strength Demo ─────────────────────────────── */
.demo-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin: 1rem 0;
}
.demo-box label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.demo-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}
.demo-input:focus {
  border-color: var(--accent);
}
.strength-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0.25rem;
}
.strength-tips {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  list-style: none;
}
.strength-tips li {
  padding: 0.2rem 0;
}
.strength-tips li.pass { color: var(--accent); }
.strength-tips li.fail { color: var(--text-muted); }

/* ─── Caesar Cipher Demo ─────────────────────────────────── */
.cipher-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cipher-slider-wrap {
  grid-column: 1 / -1;
}
.cipher-slider-wrap label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}
.cipher-note {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}
.cipher-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ─── Hygiene Checklist ──────────────────────────────────── */
.checklist {
  list-style: none;
  margin: 0.5rem 0;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(31,31,31,0.6);
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}
.checklist li:last-child { border-bottom: none; }
.checklist li:hover { color: var(--text); }
.checklist li.checked { color: var(--accent); }
.checklist-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}
.checklist li.checked .checklist-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.checklist-checkbox::after {
  content: '';
}
.checklist li.checked .checklist-checkbox::after {
  content: '✓';
  font-size: 0.8rem;
  font-weight: bold;
}
.checklist-score {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  text-align: right;
}
.checklist-score span { color: var(--accent); }

/* ─── Topic Navigation ───────────────────────────────────── */
.topic-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.topic-nav a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.6rem 1rem;
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.topic-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.topic-nav .spacer { flex: 1; }

/* ─── Footer ─────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Share Tech Mono', monospace;
}

/* ─── Inline SVG Illustrations ───────────────────────────── */
.topic-svg-wrap {
  margin: 1.5rem 0 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.topic-svg-wrap svg {
  max-width: 100%;
  height: auto;
}

/* ─── Topic Page Two-Column Layout ──────────────────────── */
.topic-container {
  max-width: 1220px;
}

.topic-layout {
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 0 2.5rem;
  align-items: start;
}

.topic-main {
  min-width: 0; /* prevent grid blowout */
}

/* ─── Table of Contents Sidebar ──────────────────────────── */
.toc {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.84rem;
  /* Thin custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.toc::-webkit-scrollbar       { width: 4px; }
.toc::-webkit-scrollbar-track { background: transparent; }
.toc::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 4px; }

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.toc-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 5px;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
  /* hidden on desktop — TOC is always expanded */
  display: none;
}
.toc-toggle:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.toc-list {
  list-style: none;
  padding: 0.4rem 0 0.6rem;
  margin: 0;
}

.toc-list.toc-collapsed { display: none; }

.toc-sep {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0.75rem;
}

.toc-link {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.32rem 0.75rem 0.32rem 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.toc-link:hover {
  color: var(--text);
  background: rgba(0, 255, 136, 0.04);
  color: var(--text);
}
.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0, 255, 136, 0.06);
}

.toc-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  color: #444;
  min-width: 18px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.toc-link.active .toc-num { color: var(--accent-dim); }

.toc-text {
  flex: 1;
  font-family: 'Exo 2', sans-serif;
  font-size: 0.82rem;
  /* Prevent very long headings from blowing out the sidebar */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Quiz entry gets a distinct colour */
.toc-quiz .toc-text        { color: var(--info); }
.toc-quiz.active .toc-text { color: var(--info); }
.toc-quiz.active           { border-left-color: var(--info); background: rgba(68,136,255,0.06); }
.toc-quiz .toc-num         { color: var(--info); opacity: 0.6; }

/* ─── Command Reference Table ────────────────────────────── */
.cmd-group {
  margin-bottom: 1.25rem;
}
.cmd-group-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.6rem;
  background: rgba(0, 255, 136, 0.06);
  border-left: 2px solid var(--accent);
  margin-bottom: 0.4rem;
}
.cmd-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 4px;
  overflow: hidden;
}
.cmd-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  border-bottom: 1px solid rgba(31, 31, 31, 0.6);
  align-items: stretch;
}
.cmd-row:last-child { border-bottom: none; }
.cmd-row:hover { background: rgba(0, 255, 136, 0.03); }
.cmd-cell {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0.5rem 0.9rem;
  background: rgba(0, 0, 0, 0.2);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  word-break: break-all;
}
.cmd-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 0.5rem 0.9rem;
  display: flex;
  align-items: center;
}

/* ─── Permissions Table ──────────────────────────────────── */
@media (max-width: 640px) {
  .perm-tables {
    grid-template-columns: 1fr !important;
  }
}

/* ─── SSH Key Steps ──────────────────────────────────────── */
.ssh-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.ssh-step {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.ssh-step:last-child { border-bottom: none; }
.ssh-step-num {
  width: 48px;
  min-width: 48px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--bg);
  background: var(--accent);
  font-weight: bold;
}
.ssh-step-body {
  flex: 1;
  padding: 1rem 1.25rem;
  background: var(--surface);
}
.ssh-step-body h4 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.6rem;
}
.ssh-code {
  white-space: pre;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 0.5rem 0 !important;
}
.ssh-step-note {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  border-left: 2px solid var(--border);
  padding-left: 0.6rem;
}

/* ─── Script Example ─────────────────────────────────────── */
.script-example {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.script-title {
  background: #1a1a1a;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.script-title::before {
  content: '📄';
}
.script-example .code-block {
  border-left: none;
  border-radius: 0;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.65;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .topic-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Collapse TOC into header card on narrow screens ─────── */
@media (max-width: 1100px) {
  /* Switch to single-column — TOC floats to the top */
  .topic-layout {
    grid-template-columns: 1fr;
  }
  .topic-main {
    order: 2;
  }
  .toc {
    order: 1;
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 1.5rem;
  }
  /* Show the toggle button */
  .toc-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Wider container falls back to 960px cap */
  .topic-container {
    max-width: 960px;
  }
  /* Allow full-width text in TOC on small screens */
  .toc-text {
    white-space: normal;
  }
}

@media (max-width: 900px) {
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
  .cia-triad  { grid-template-columns: repeat(3, 1fr); }
  .threat-grid { grid-template-columns: repeat(2, 1fr); }
  .career-grid { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .navbar-logo-text { display: none; }
}

@media (max-width: 768px) {
  .topic-grid  { grid-template-columns: repeat(2, 1fr); }
  .cia-triad   { grid-template-columns: 1fr; }
  .ir-lifecycle { grid-template-columns: repeat(2, 1fr); }
  .cipher-controls { grid-template-columns: 1fr; }

  .hamburger { display: flex; }

  .navbar-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(13,13,13,0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
  }
  .navbar-links.open {
    display: flex;
  }
  #authNavItem {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-bar { gap: 1.25rem; }
  .hero { padding: 3rem 0 2.5rem; }
}

@media (max-width: 480px) {
  .topic-grid  { grid-template-columns: 1fr; }
  .threat-grid { grid-template-columns: 1fr; }
  .ir-lifecycle { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; }
  .topic-nav { flex-direction: column; }
  .container { padding: 0 1rem; }
  .cmd-row { grid-template-columns: 1fr; }
  .cmd-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .ssh-step-num { width: 36px; min-width: 36px; font-size: 0.75rem; }
}

/* ─── Auth Nav ───────────────────────────────────────────── */
#authNavItem {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Discord invite: a real .btn (border/padding/hover), not a plain nav link —
   opt out of .navbar-links a's uppercase/letter-spacing/underline styling,
   same pattern as .navbar-username below. */
.navbar-links a.navbar-discord-btn {
  text-transform: none;
  letter-spacing: normal;
  padding: 0.4rem 0.9rem;
}
.navbar-links a.navbar-discord-btn::after {
  display: none;
}

/* Username link: keeps its own face but inherits the animated ::after
   underline from .navbar-links a — no text-decoration underline on top */
.navbar-links a.navbar-username {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;
  color: var(--accent);
  text-transform: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.navbar-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ─── Profile page avatar ────────────────────────────────── */
.profile-account {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface);
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-account .results-summary-grid {
  flex: 1;
  min-width: 260px;
}

/* ─── Profile visibility toggle ──────────────────────────── */
.profile-visibility {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.visibility-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.visibility-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.visibility-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.visibility-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.2s;
}
.visibility-toggle input:checked + .visibility-toggle-slider {
  background: var(--accent);
}
.visibility-toggle input:checked + .visibility-toggle-slider::before {
  transform: translateX(18px);
}
.visibility-toggle input:disabled + .visibility-toggle-slider {
  opacity: 0.6;
  cursor: not-allowed;
}
.visibility-toggle input:focus-visible + .visibility-toggle-slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visibility-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
}
.visibility-toggle-copy strong {
  color: var(--text);
}
.visibility-toggle-copy span {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.visibility-toggle-copy code {
  color: var(--accent);
}

.profile-discord {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
}
.profile-discord strong {
  color: var(--text);
}
#discordStatusText {
  color: var(--text-muted);
  font-size: 0.8rem;
}
#discordStatusText code {
  color: var(--accent);
}

.profile-sign-out-everywhere {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
}
.profile-sign-out-everywhere strong {
  color: var(--text);
}
.profile-sign-out-everywhere span {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex: 1 1 auto;
  min-width: 220px;
}
.profile-sign-out-everywhere #signOutEverywhereError {
  flex-basis: 100%;
}

/* ─── Nav Dropdown (wrench) ──────────────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  position: relative;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  line-height: 1;
  transition: border-color 0.2s, color 0.2s;
}
/* Unread-announcements indicator — a small dot on the hamburger toggle
   (visible without opening the menu) and inline next to the menu item
   itself. Cleared by initAnnouncementsPage() via POST /api/announcements/seen. */
.nav-badge-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}
.nav-dropdown-toggle .nav-badge-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  box-shadow: 0 0 4px rgba(255, 68, 68, 0.7);
}
.nav-dropdown-item .nav-badge-dot {
  margin-left: 0.4rem;
  vertical-align: middle;
}
.nav-dropdown-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.nav-dropdown-menu {
  /* Fixed + centered on the *viewport*, not anchored to the toggle button —
     the button sits left of the avatar/username/sign-out controls, so a
     button-anchored menu drifts off-center from the page as a whole. Fixed
     positioning also means it isn't clipped by any ancestor's overflow and
     stays put regardless of scroll. */
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 2rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  padding: 0.4rem 0;
  /* Mobile-first: one column, sections stacked vertically (there's no room
     to go wide on a phone-width menu). Widened into side-by-side columns
     at the min-width breakpoint below. */
  display: flex;
  flex-direction: column;
}
.nav-dropdown-col + .nav-dropdown-col {
  border-top: 1px solid var(--border);
}
@media (min-width: 769px) {
  /* Each content-type section becomes its own column, so the menu grows
     wider rather than taller as sections/links accumulate. Wraps onto a
     second row (rather than clipping) if the viewport isn't wide enough
     to fit every column on one line within max-width above. */
  .nav-dropdown-menu {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0.4rem 0;
    min-width: 0;
    /* Without an explicit width, a wrapping flex container's shrink-to-fit
       sizing resolves toward its narrowest possible layout (one column per
       row) even when max-width leaves plenty of room for a single row —
       asking for its full preferred (max-content) width here, clamped by
       max-width above, is what actually gets every column onto one row
       when there's space. */
    width: max-content;
  }
  .nav-dropdown-col {
    display: flex;
    flex-direction: column;
    min-width: 170px;
    flex: 1 0 auto;
  }
  .nav-dropdown-col + .nav-dropdown-col {
    border-top: none;
    border-left: 1px solid var(--border);
  }
}
/* Small uppercase heading above each content-type column (Learn, Community,
   Quizzes, Staff, More). */
.nav-dropdown-label {
  padding: 0.5rem 1rem 0.3rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.nav-dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.55rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-item:hover {
  background: var(--bg);
  color: var(--accent);
}
/* Dropdown items inherit .navbar-links a::after's animated underline, which
   sits at bottom: -4px (fine in the horizontal navbar). .nav-dropdown-menu
   clips overflow for its rounded corners, so the last item's underline —
   the only one that actually reaches the container edge — gets cut off.
   Dropdown rows have their own padding, so pull the underline inside the
   row instead of past it. */
.navbar-links .nav-dropdown-item::after {
  bottom: 2px;
}
.nav-dropdown-item--danger { color: var(--danger); }
.nav-dropdown-item--danger:hover {
  background: var(--bg);
  color: var(--danger);
}

/* ─── Auth Modal ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  position: relative;
  margin: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: color 0.2s;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.modal-tabs[hidden] { display: none; }

.modal-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 1.25rem;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.modal-tab:hover { color: var(--text); }

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.modal-form[hidden] { display: none; }

.modal-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal-divider::before,
.modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.confirm-modal {
  max-width: 340px;
  border-color: var(--danger);
}
.confirm-modal--neutral {
  border-color: var(--border);
}
.confirm-message {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-hint {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.7rem;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; font-family: 'Exo 2', sans-serif; }

/* ─── Manual Quiz Builder ────────────────────────────────── */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.quiz-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.quiz-card-index {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.quiz-card-remove,
.quiz-answer-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: color 0.2s;
  line-height: 1;
}
.quiz-card-remove:hover,
.quiz-answer-remove:hover:not(:disabled) { color: var(--danger); }
.quiz-answer-remove:disabled { opacity: 0.3; cursor: not-allowed; }

.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.quiz-answer-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.quiz-answer-row input[type="radio"] {
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.quiz-answer-text {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.88rem;
  padding: 0.5rem 0.65rem;
  outline: none;
  transition: border-color 0.2s;
}
.quiz-answer-text:focus { border-color: var(--accent); }

.quiz-add-answer { margin-top: 0.1rem; }

.quiz-fr-note {
  background: rgba(68,136,255,0.06);
  border: 1px solid rgba(68,136,255,0.2);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.form-error {
  color: var(--danger);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 0.25rem 0;
}
.form-error[hidden] { display: none; }

/* Inline text-styled buttons — "Forgot password?" / "Back to Sign In" links
   that need JS click handling (openForgotView etc.) rather than navigation. */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent-dim); }

.modal-forgot-links {
  text-align: center;
  margin: -0.25rem 0 0.5rem;
}
.modal-forgot-links[hidden] { display: none; }

/* ─── Progress Indicators ────────────────────────────────── */
.card-completed { border-color: rgba(0, 255, 136, 0.2); }

.card-progress {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.15rem 0.5rem;
}

.progress-star { font-size: 0.7rem; }

.prev-score-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
}
.prev-score-label { color: var(--text-muted); }
.prev-score-value { color: var(--accent); font-size: 1rem; }
.prev-score-perfect { color: var(--accent); }

/* ─── Admin Table ─────────────────────────────────────────────────────────── */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.875rem;
}
.admin-table th {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--surface); }
.admin-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.admin-table th.sortable:hover { color: var(--text); }
.admin-table th.sortable::after {
  content: ' ↕';
  opacity: 0.35;
  font-size: 0.7em;
}
.admin-table th.sort-asc::after  { content: ' ↑'; opacity: 1; color: var(--accent); }
.admin-table th.sort-desc::after { content: ' ↓'; opacity: 1; color: var(--accent); }
.admin-table th.sort-asc,
.admin-table th.sort-desc { color: var(--accent); }
.admin-user-link {
  color: var(--text);
  text-decoration: none;
}
.admin-user-link:hover { color: var(--accent); text-decoration: underline; }
.role-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.role-select:focus { outline: 1px solid var(--accent); }
.role-select:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Instructor Panel ────────────────────────────────────────────────────── */

.instructor-section {
  margin-bottom: 2.5rem;
}

.instructor-section-heading {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.instructor-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* File input */
.file-input-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.file-input-wrap {
  position: relative;
}

.file-input-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.55rem 0.9rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
}

.file-input-label:hover,
.file-input-hidden:focus + .file-input-label {
  border-color: var(--accent);
  color: var(--text);
}

.file-input-icon { font-size: 1rem; flex-shrink: 0; }

/* Room created success banner */
.room-created-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(0, 255, 136, 0.06);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-open {
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-closed {
  background: rgba(102, 102, 102, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status-student {
  background: rgba(68, 136, 255, 0.1);
  color: var(--info);
  border: 1px solid rgba(68, 136, 255, 0.3);
}

/* Room action buttons — tighter spacing */
.room-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Results summary grid */
.results-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.results-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.results-stat-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.5rem;
  color: var(--accent);
  overflow-wrap: anywhere;
  min-width: 0;
}

.results-stat-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Expand button */
.expand-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  transition: color 0.2s;
  font-family: 'Share Tech Mono', monospace;
}

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

/* Per-student answer breakdown */
.answer-detail-wrap {
  padding: 0.5rem 0.75rem 0.75rem 2.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
}

.answer-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(31, 31, 31, 0.5);
  font-size: 0.85rem;
}

.answer-row:last-child { border-bottom: none; }

.answer-icon {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  font-weight: bold;
  text-align: center;
}

.answer-correct .answer-icon { color: var(--accent); }
.answer-wrong .answer-icon   { color: var(--danger); }

.answer-question {
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
}

.answer-choice {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.answer-correct .answer-choice { color: var(--accent); }
.answer-wrong .answer-choice   { color: var(--danger); }

.answer-row-fr {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(31, 31, 31, 0.5);
  font-size: 0.85rem;
}
.answer-row-fr:last-child { border-bottom: none; }
.answer-row-fr .answer-question { display: flex; align-items: center; gap: 0.3rem; }
.answer-row-fr.answer-pending .answer-icon { color: #4488ff; }
.answer-row-fr.answer-correct .answer-icon { color: var(--accent); }
.answer-row-fr.answer-wrong   .answer-icon { color: var(--danger); }

.grade-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

/* Format guide (collapsible <details>) */
.format-guide {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.format-guide-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  list-style: none;
  background: var(--surface);
  transition: color 0.2s, background 0.2s;
}
.format-guide-summary::-webkit-details-marker { display: none; }
.format-guide-summary::marker { display: none; }
.format-guide-summary:hover { color: var(--text); background: rgba(0,255,136,0.04); }
.format-guide[open] .format-guide-summary { color: var(--accent); border-bottom: 1px solid var(--border); }

.format-guide-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.format-guide[open] .format-guide-arrow { transform: rotate(180deg); }

.format-guide-body {
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background: var(--bg);
}

.format-guide-body > div {
  min-width: 0; /* prevent grid blowout from pre content */
}

.format-tab-heading {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
}

.format-col-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}
.format-col-table th {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.format-col-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid rgba(31,31,31,0.5);
  vertical-align: top;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.format-col-table td:first-child {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  white-space: nowrap;
}
.format-col-table .req { color: var(--accent); font-size: 0.72rem; font-family: 'Share Tech Mono', monospace; }
.format-col-table .opt { color: var(--text-muted); font-size: 0.72rem; font-family: 'Share Tech Mono', monospace; }
.format-col-table tr:last-child td { border-bottom: none; }

.format-code {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
  margin-top: 0.5rem;
}
.format-code .hl { color: var(--accent); }

/* ─── Quiz Entry Page ───────────────────────────────── */

.quiz-entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 440px;
}

.quiz-entry-input-wrap {
  display: flex;
  gap: 0.5rem;
}

.quiz-entry-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.75rem;
  text-transform: uppercase;
  transition: border-color 0.2s;
}
.quiz-entry-input:focus { outline: none; border-color: var(--accent); }

.quiz-entry-hint {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
}

/* ─── Join Classroom Page ────────────────────────────────── */
.login-gate {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.public-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.room-card-title {
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.room-card-meta {
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
}

.room-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.room-card-footer code {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ─── Quiz Room Page ────────────────────────────────── */

.room-state-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem 0;
}

.room-error-msg {
  color: var(--danger);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
}

.room-active-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.room-title {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  font-size: 1.3rem;
  margin: 0 0 0.2rem;
}

.room-code-display {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
  letter-spacing: 0.06em;
}

.room-progress {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
  white-space: nowrap;
}

/* Selected option (pre-submission — no colour feedback yet) */
.quiz-option.room-selected {
  border-color: var(--accent);
  background: rgba(0, 255, 135, 0.07);
  color: var(--text);
}

.room-submit-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.room-submit-hint {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

/* Results */
.room-results-header { margin-bottom: 1.5rem; }

.room-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.room-score-num {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}

.room-score-pct {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.1rem;
}

.room-score-msg {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

.room-result-box { border-left: 3px solid var(--border); }
.room-result-box.result-correct { border-left-color: var(--accent); }
.room-result-box.result-wrong   { border-left-color: var(--danger); }
.room-result-box.result-pending { border-left-color: #4488ff; }

.result-icon { margin-right: 0.3rem; }
.room-result-box.result-correct .result-icon { color: var(--accent); }
.room-result-box.result-wrong   .result-icon { color: var(--danger); }
.room-result-box.result-pending .result-icon { color: #4488ff; }

.quiz-free-response-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.quiz-grading-notes {
  background: rgba(255,170,0,0.06);
  border: 1px solid rgba(255,170,0,0.2);
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.quiz-grading-notes strong { color: var(--warn); }

.quiz-pending-badge {
  display: inline-block;
  margin-top: 0.6rem;
  background: rgba(68,136,255,0.1);
  border: 1px solid rgba(68,136,255,0.35);
  color: #4488ff;
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.room-already-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.room-pending-banner {
  border-color: rgba(68,136,255,0.35);
  color: #4488ff;
}

/* Responsive */
@media (max-width: 680px) {
  .instructor-form-grid { grid-template-columns: 1fr; }
  .room-actions { gap: 0.3rem; }
  .format-guide-body { grid-template-columns: 1fr; }
  .room-active-header { flex-direction: column; }
}

@media (max-width: 480px) {
  .results-summary-grid { grid-template-columns: 1fr; }
  .answer-row { grid-template-columns: 20px 1fr; }
  .answer-choice { grid-column: 2; }
  .quiz-entry-input-wrap { flex-direction: column; }
  .room-score-card { gap: 0.75rem; }
}

/* ═══ Beginner Pathway (/start) ═══════════════════════════════ */

/* Intro — reading copy is sans (default), accents stay mono */
.pw-intro { margin: 1rem 0 2.5rem; }
.pw-boot {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  opacity: 0.85;
}
.pw-title {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 1rem;
}
.pw-lede {
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 640px;
}

/* Status: progress bar + streak + resume */
.pw-status { margin-top: 1.75rem; max-width: 640px; }
.pw-progress-track {
  height: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.pw-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  transition: width 0.9s ease;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.5);
}
.pw-progress-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
.pw-streak {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
  color: var(--warn);
  margin-top: 0.4rem;
}
.pw-resume { margin-top: 1rem; }

/* The path + connecting line */
.pathway { list-style: none; margin: 0; padding: 0; position: relative; }
.pathway::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--border), var(--accent-dim), var(--border));
  opacity: 0.5;
}
.pw-stage { position: relative; padding: 0 0 2.75rem 68px; min-height: 46px; }

/* Node */
.pw-node {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.pw-node-num {
  font-family: 'Share Tech Mono', monospace;
  font-weight: bold;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color 0.3s;
}
.pw-stage.is-active .pw-node {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.12), 0 0 18px rgba(0, 255, 136, 0.4);
  animation: pwPulse 2.2s ease-in-out infinite;
}
.pw-stage.is-active .pw-node-num { color: var(--accent); }
.pw-stage.is-done .pw-node { border-color: var(--accent); background: var(--accent); }
.pw-stage.is-done .pw-node-num { display: none; }
.pw-stage.is-done .pw-node::after {
  content: '✓';
  color: var(--bg);
  font-size: 1.35rem;
  font-weight: bold;
  line-height: 1;
}
@keyframes pwPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(0, 255, 136, 0.12), 0 0 18px rgba(0, 255, 136, 0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0.06), 0 0 26px rgba(0, 255, 136, 0.55); }
}

/* Stage head */
.pw-stage-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.pw-kicker {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.pw-stage-title { font-family: 'Share Tech Mono', monospace; font-size: 1.25rem; color: var(--text); margin: 0; }
.pw-track {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid;
}
.pw-track--everyone { color: var(--accent); border-color: rgba(0, 255, 136, 0.4); background: rgba(0, 255, 136, 0.08); }
.pw-track--aspiring-pro { color: var(--warn); border-color: rgba(255, 170, 0, 0.4); background: rgba(255, 170, 0, 0.08); }
.pw-hook { color: var(--text-soft); line-height: 1.65; margin: 0 0 1rem; max-width: 620px; }

/* Badge (dim/locked by default, lights up when the stage is done) */
.pw-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px dashed var(--border);
  border-radius: 999px;
  margin-bottom: 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.7;
  transition: all 0.3s;
}
.pw-badge-icon { filter: grayscale(1); opacity: 0.6; transition: all 0.3s; }
.pw-stage.is-done .pw-badge {
  border-style: solid;
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.08);
  color: var(--accent);
  opacity: 1;
}
.pw-stage.is-done .pw-badge-icon { filter: none; opacity: 1; }

/* Module cards inside a stage */
.pw-modules { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 0; }

/* Finish / what's-next */
.pw-finish {
  margin-top: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}
.pw-finish-title { font-family: 'Share Tech Mono', monospace; color: var(--accent); font-size: 1.3rem; margin-bottom: 0.75rem; }
.pw-finish-copy { color: var(--text-soft); line-height: 1.7; max-width: 560px; margin: 0 auto 1.5rem; }
.pw-finish-links { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 600px) {
  .pw-stage { padding-left: 56px; }
  .pw-node { width: 40px; height: 40px; }
  .pathway::before { left: 19px; }
}

/* ═══ Homepage → Pathway CTA banner ═══════════════════════════ */
.pw-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 3rem;
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(0, 255, 136, 0.06), rgba(0, 255, 136, 0.01));
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.pw-cta:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.12);
  transform: translateY(-2px);
}
.pw-cta-kicker {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.pw-cta-title { color: var(--text); font-size: 1.05rem; line-height: 1.4; }
.pw-cta-title strong { color: var(--accent); }
.pw-cta-go {
  flex-shrink: 0;
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .pw-cta { flex-direction: column; align-items: flex-start; gap: 0.9rem; }
}

/* ═══ Pathway motion + completed-module marker ════════════════ */
/* Hidden/animated states apply ONLY when JS adds .js-motion, so no-JS
   users and crawlers always see the content. */
.pathway.js-motion .pw-stage {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.pathway.js-motion .pw-stage.is-revealed { opacity: 1; transform: none; }
.pathway.js-motion::before { transform-origin: top; animation: pwLineGrow 1.1s ease forwards; }
@keyframes pwLineGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Completed module — a small check in the top corner */
.pw-module-done::after {
  content: '✓';
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .pw-stage.is-active .pw-node { animation: none; }
  .pw-progress-fill { transition: none; }
}

/* ═══ Topic beginner framing: hook + key takeaway ═════════════ */
.topic-hook {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 0.15rem 0 0.15rem 1.1rem;
  margin: 0 0 2rem;
}
.topic-takeaway {
  margin: 2.5rem 0 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  background: rgba(0, 255, 136, 0.05);
}
.topic-takeaway-label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.topic-takeaway p { margin: 0; color: var(--text-soft); line-height: 1.7; }

/* ═══ Profile: pathway badge shelf ════════════════════════════ */
.pf-badges { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.pf-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 112px;
  padding: 1rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.pf-badge:hover, .pf-badge:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 255, 136, 0.1);
}
.pf-badge-icon { font-size: 1.9rem; line-height: 1; }
.pf-badge-name { font-family: 'Share Tech Mono', monospace; font-size: 0.75rem; color: var(--text); }

.pf-badge.is-earned { border-color: rgba(0, 255, 136, 0.4); background: rgba(0, 255, 136, 0.06); }
.pf-badge.is-earned .pf-badge-name { color: var(--accent); }
.pf-badge.is-locked { opacity: 0.6; }
.pf-badge.is-locked .pf-badge-icon { filter: grayscale(1); }
.pf-badge.is-locked .pf-badge-name { color: var(--text-muted); }

/* Hover/focus tooltip */
.pf-badge-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 220px;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.pf-badge:hover .pf-badge-tip, .pf-badge:focus-visible .pf-badge-tip { opacity: 1; visibility: visible; }

@media (max-width: 480px) { .pf-badge { width: calc(33.333% - 0.6rem); } }

/* ═══ Profile: Top Performers leaderboard ═════════════════════ */
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lb-table th {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.lb-table th:nth-child(2) { text-align: left; }
.lb-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-soft); }
.lb-table tbody tr:hover { background: var(--surface); }
.lb-rank { font-family: 'Share Tech Mono', monospace; text-align: center; width: 3.5rem; }
.lb-user { color: var(--text); font-family: 'Share Tech Mono', monospace; }
.lb-pts { font-family: 'Share Tech Mono', monospace; color: var(--accent); font-weight: bold; text-align: center; }
.lb-sub { color: var(--text-muted); text-align: center; }
.lb-me { background: rgba(0, 255, 136, 0.07); }
.lb-me td { color: var(--text); }
.lb-you {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(0, 255, 136, 0.4);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin-left: 0.4rem;
}
.lb-footnote { margin-top: 1rem; color: var(--text-muted); font-family: 'Share Tech Mono', monospace; font-size: 0.82rem; }
.lb-footnote strong { color: var(--accent); }

/* ═══ Profile: top-3 rank tile (gold / silver / bronze) ═══════ */
/* Clickable stat tile (Rank → leaderboard) */
.results-stat--link { text-decoration: none; color: inherit; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s; }
.results-stat--link:hover, .results-stat--link:focus-visible { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0, 255, 136, 0.12); }
.results-stat--link:not(.pf-rank):hover { border-color: var(--accent); }

.pf-rank--gold   { border-color: #ffd700; box-shadow: 0 0 16px rgba(255, 215, 0, 0.15); }
.pf-rank--gold   .results-stat-val { color: #ffd700; }
.pf-rank--silver { border-color: #cfd4da; box-shadow: 0 0 16px rgba(207, 212, 218, 0.12); }
.pf-rank--silver .results-stat-val { color: #cfd4da; }
.pf-rank--bronze { border-color: #cd7f32; box-shadow: 0 0 16px rgba(205, 127, 50, 0.15); }
.pf-rank--bronze .results-stat-val { color: #cd7f32; }

/* ═══ Leaderboard mode toggle ═════════════════════════════════ */
.lb-modes { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.lb-mode-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lb-mode-btn:hover { color: var(--text); border-color: var(--accent); }
.lb-mode-btn.is-active { color: var(--accent); border-color: var(--accent); background: rgba(0, 255, 136, 0.08); }

/* ─── Announcements ──────────────────────────────────────── */
.announcements-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
}
.announcements-toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: 'Exo 2', sans-serif;
  font-size: 0.9rem;
}
.announcements-toolbar input[type="search"]:focus { border-color: var(--accent); outline: none; }
/* Reuses .lb-mode-btn's look for a single button that cycles state instead
   of a button group. */
#announcementSortBtn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
#announcementSortBtn:hover { color: var(--accent); border-color: var(--accent); }

.announcement-card { margin-bottom: 1rem; }
.announcement-card .card-desc { white-space: pre-wrap; }
.announcement-footer { flex-wrap: wrap; gap: 0.75rem; }
.announcement-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'Share Tech Mono', monospace;
}
.announcement-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.announcement-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.announcement-form-actions { display: flex; gap: 0.75rem; align-items: center; }

/* ═══ Profile name header (large, centered, green) ════════════ */
.profile-name {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Leaderboard user avatar */
.lb-user-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}
.lb-user-cell:hover span:not(.lb-you) { color: var(--accent); text-decoration: underline; }
.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* ─── Downloadable-Challenge Pages (log-analysis-challenge, network-traffic-
   challenge, challenge-module.html) ──────────────────────────────────────
   Was duplicated as an inline <style> block in each of the first two pages;
   promoted here once a third consumer (the generic /challenges/:id shell)
   existed, per docs/plan-intermediate-track.md. Union of every class either
   of the first two pages used — safe superset, nothing removed from either. */
.lac-downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}
.lac-download-card {
  text-decoration: none;
  color: inherit;
  padding: 1.25rem;
  text-align: center;
}
.lac-download-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0,255,136,0.3);
  box-shadow: 0 6px 20px rgba(0,255,136,0.07);
  color: inherit;
}
.lac-download-icon { font-size: 1.6rem; display: block; margin-bottom: 0.5rem; }
.lac-download-name { font-family: 'Share Tech Mono', monospace; color: var(--accent); display: block; margin-bottom: 0.3rem; }
.lac-download-desc { font-size: 0.8rem; color: var(--text-muted); }

.lac-toolbox {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2.5rem;
}
.lac-tool {
  padding: 0.9rem 1rem;
}
.lac-tool-name { font-family: 'Share Tech Mono', monospace; color: var(--accent); font-size: 0.9rem; display: block; margin-bottom: 0.25rem; }
.lac-tool-desc { font-size: 0.8rem; color: var(--text-muted); }

.lac-challenge {
  margin-bottom: 1rem;
}
.lac-challenge-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.lac-challenge-num {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.lac-difficulty {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
}
.lac-difficulty--super-easy, .lac-difficulty--easy { border-color: rgba(0,255,136,0.4); color: var(--accent); }
.lac-difficulty--medium { border-color: rgba(255,189,46,0.5); color: #ffbd2e; }
.lac-difficulty--hard { border-color: rgba(255,68,68,0.5); color: var(--danger); }
.lac-challenge-title { margin: 0; font-size: 1.05rem; }
.lac-challenge-desc { color: var(--text-muted); margin: 0.4rem 0 0.6rem; font-size: 0.9rem; }
.lac-target-file {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.lac-target-label { color: var(--text-muted); }
.lac-target-name {
  font-family: 'Share Tech Mono', monospace;
  background: #1a1a1a;
  border-left: 3px solid var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 0 3px 3px 0;
  color: var(--accent);
}
.lac-steps {
  margin: 0.75rem 0 1rem;
  padding-left: 1.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.lac-steps li { margin-bottom: 0.4rem; }
.lac-steps code {
  font-family: 'Share Tech Mono', monospace;
  background: #1a1a1a;
  color: var(--accent);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
}
.lac-ethics {
  border-left: 3px solid var(--danger);
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.lac-ethics strong { color: var(--text); }
.lac-next {
  margin-top: 2.5rem;
}
.lac-progress-summary {
  font-family: 'Share Tech Mono', monospace;
  color: var(--accent);
  margin-left: 0.5rem;
}
.lac-submit {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
}
.lac-answer-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lac-answer-input {
  flex: 1 1 200px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.85rem;
}
.lac-answer-input:focus {
  outline: none;
  border-color: var(--accent);
}
.lac-answer-feedback {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
}
.lac-answer-feedback--error { color: var(--danger); }
.lac-answer-feedback--success { color: var(--accent); }
.lac-completed-badge {
  margin: 0;
  color: var(--accent);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
}

/* Prev/next/hub nav at the bottom of every CTF module page. */
.lac-module-nav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.lac-module-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 0;
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.lac-module-nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lac-module-nav-link--next { justify-content: flex-end; text-align: right; }
.lac-module-nav-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  flex-shrink: 0;
}
.lac-module-nav-text { min-width: 0; }
.lac-module-nav-label {
  display: block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.lac-module-nav-hub {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.75rem 1.1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.lac-module-nav-hub:hover { color: var(--accent); }
@media (max-width: 640px) {
  .lac-module-nav { flex-direction: column; }
  .lac-module-nav-link--next { justify-content: flex-start; text-align: left; }
}
