:root {
  --bg: #f6f3ec;
  --bg-soft: #fbfaf7;
  --panel: #ffffff;
  --panel-alt: #f4f1ea;
  --panel-strong: #ebe6dc;
  --text: #1f2430;
  --muted: #5f6673;
  --line: #d6d0c4;
  --line-strong: #b8af9e;
  --accent: #223a5e;
  --accent-soft: #e9eef5;
  --accent-2: #5a4a2f;
  --success: #2f5d45;
  --danger: #8a3b32;
  --warning: #8a6a2f;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(28, 34, 44, 0.08);
  --content-width: 1160px;
  --reading-width: 76ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(to bottom, rgba(34, 58, 94, 0.035), rgba(34, 58, 94, 0) 180px),
    var(--bg);
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

code,
pre {
  font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace;
}

.site-shell {
  width: min(var(--content-width), calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 236, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #faf8f2, #ece6da);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.brand-mark svg,
.brand-mark img {
  width: 22px;
  height: 22px;
  opacity: 0.92;
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent);
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #ccd7e7;
  text-decoration: none;
}

.hero {
  padding: 44px 0 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr minmax(280px, 350px);
  gap: 24px;
  align-items: stretch;
}

.hero-card,
.panel,
.article-card,
.metric-card,
.snippet-card,
.quiz-shell,
.footer-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 34px;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(to right, var(--accent), var(--accent-2));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #d3dbe8;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: #182235;
  line-height: 1.22;
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin-top: 16px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  margin-bottom: 8px;
}

h3 {
  font-size: 1.22rem;
  margin-bottom: 8px;
}

p {
  margin: 0 0 14px;
  color: var(--text);
}

.muted {
  color: var(--muted);
}

.hero-card > p,
.article-body > p,
.snippet-card > p,
.panel > p {
  max-width: var(--reading-width);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn:hover {
  background: #f7f5f0;
  border-color: #9cacbf;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: #1b304f;
  border-color: #1b304f;
}

.panel {
  padding: 22px;
  height: 100%;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-head img {
  width: 64px;
  height: 64px;
  padding: 10px;
  border-radius: 50%;
  background: var(--panel-alt);
  border: 1px solid var(--line);
}

.metrics-grid,
.card-grid,
.snippet-grid,
.feature-grid {
  display: grid;
  gap: 16px;
}

.metrics-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.metric-card {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff, #fbfaf7);
}

.metric-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
}

.section {
  padding: 18px 0 26px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.snippet-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-card,
.snippet-card {
  padding: 22px;
  position: relative;
}

.article-card:hover,
.snippet-card:hover,
.metric-card:hover {
  border-color: var(--line-strong);
}

.card-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  color: var(--accent-2);
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.article-card p,
.snippet-card p {
  color: var(--muted);
  margin-bottom: 16px;
}

a.article-card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.breadcrumbs {
  padding-top: 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs span {
  color: var(--accent);
  font-weight: 600;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
  padding: 32px 0 34px;
}

.article-header {
  padding-bottom: 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.article-header h1 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  line-height: 1.25;
}

.article-header .muted {
  margin: 0;
}

.content-main {
  display: grid;
  gap: 18px;
}

.article-card.article-body {
  padding: 30px;
}

.article-card.article-body > * {
  max-width: var(--reading-width);
}

.article-card.article-body > .article-header,
.article-card.article-body > .article-meta,
.article-card.article-body > pre,
.article-card.article-body > .callout,
.article-card.article-body > .quiz-source {
  max-width: 100%;
}

.article-card.article-body h2,
.article-card.article-body h3 {
  margin-top: 24px;
}

.article-card.article-body ul,
.article-card.article-body ol {
  max-width: var(--reading-width);
  margin: 0 0 16px;
  padding-left: 22px;
}

.article-card.article-body li {
  margin-bottom: 8px;
}

.article-card.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 0.96rem;
}

.article-card.article-body th,
.article-card.article-body td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-card.article-body th {
  background: var(--panel-alt);
  font-weight: 700;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
  align-items: center;
  justify-content: space-between;
}

.article-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-date {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.callout {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: #f4f7fb;
  color: #243247;
}

.callout strong {
  color: var(--accent);
}

pre.code-block {
  margin: 16px 0 0;
  padding: 18px;
  border-radius: 8px;
  overflow-x: auto;
  background: #1f2430;
  border: 1px solid #2b3242;
  color: #edf2fb;
  line-height: 1.58;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

code {
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: #f0ece4;
  color: #4a3321;
}

pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.sidebar-stack {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 92px;
}

.quiz-shell {
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #fcfbf8);
}

.quiz-source {
  display: none;
}

.quiz-question {
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: #182235;
}

.quiz-options {
  display: grid;
  gap: 10px;
}

.quiz-option {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.quiz-option:hover {
  background: #f7f5f0;
  border-color: var(--line-strong);
}

.quiz-option.is-correct {
  border-color: #9bc5ae;
  background: #edf7f1;
  color: var(--success);
}

.quiz-option.is-wrong {
  border-color: #ddb0aa;
  background: #fbefed;
  color: var(--danger);
}

.quiz-progress {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.quiz-feedback {
  margin-top: 14px;
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--muted);
}

.list-clean {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.list-clean li {
  margin-bottom: 8px;
}

.footer-wrap {
  padding: 22px 0 34px;
}

/* Neutralise the highlight.js theme background so our dark pre.code-block controls it */
pre.code-block code.hljs {
  background: transparent;
  padding: 0;
}

.footer-notice-link {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.footer-notice-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.header-profile {
  display: flex;
  align-items: center;
}

.header-profile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
}

.header-profile-link:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(28, 34, 44, 0.06);
  text-decoration: none;
}

.header-profile-link img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.profile-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 80px;
}

.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2f5d45, #4a8b65);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.footer-card {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  background: #faf8f3;
}

.kicker-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 12px;
}

.icon-chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-alt);
  border: 1px solid var(--line);
}

.empty-state {
  padding: 18px;
  border-radius: 8px;
  border: 1px dashed var(--line-strong);
  background: #faf8f3;
  color: var(--muted);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}

blockquote {
  margin: 18px 0;
  padding: 10px 0 10px 18px;
  border-left: 3px solid var(--line-strong);
  color: #424b59;
  font-style: italic;
}

::selection {
  background: #dce6f5;
  color: #14233c;
}

:focus-visible {
  outline: 2px solid #7c9bc5;
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .hero-grid,
  .content-layout,
  .card-grid,
  .feature-grid,
  .snippet-grid {
    grid-template-columns: 1fr;
  }

  .sidebar-stack {
    position: static;
  }
}

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 20px, var(--content-width));
  }

  .header-bar {
    min-height: 68px;
    padding: 10px 0;
  }

  .nav-list {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-card,
  .article-card.article-body,
  .panel,
  .quiz-shell {
    padding: 20px;
  }

  .footer-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   Tab blocks  (.tab-block generated by build.py from [Label]: bullet lists)
   -------------------------------------------------------------------------- */

.tab-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.25rem 0;
}

.tab-bar {
  display: flex;
  gap: 0;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab-btn {
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--panel);
}

.tab-panels {
  /* grid stacking: all panels share one cell so height = tallest panel */
  display: grid;
  background: transparent;
}

.tab-panel {
  grid-area: 1 / 1;
  padding: 16px 20px;
  background: var(--panel);
  line-height: 1.65;
  visibility: hidden;
  min-width: 0;
}

.tab-panel.active {
  visibility: visible;
}

/* Code panels: dark background fills the panel edge-to-edge */
.tab-panel--code {
  padding: 0;
  background: #1f2430;
  overflow: hidden;
}

.tab-panel--code > .code-block {
  margin: 0 !important;
  padding: 18px !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

/* Copy button inside .tab-bar — margin-left:auto pushes it to the right end */
.tab-bar > .copy-btn {
  position: static;
  flex-shrink: 0;
  margin-left: auto;
  padding: 8px 12px;
  width: auto;
  height: auto;
  border-radius: 0;
  opacity: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-left: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-bar > .copy-btn:hover {
  background: var(--panel);
  color: var(--text);
}

.tab-bar > .copy-btn.copy-btn--copied {
  color: #5a9e3a;
}

/* Copy button wrapper for standalone code blocks */
.code-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #a0aab8;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.code-wrap:hover .copy-btn,
.copy-btn:focus {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #edf2fb;
}

.copy-btn--copied {
  color: #a3d977 !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Code-bar: always-visible action toolbar above standalone code blocks.
   Matches the dark code block background; Run and Copy buttons sit here.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Give .code-wrap border-radius + overflow:hidden so children are clipped. */
.code-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
}

/* Pre inside a code-wrap loses its own margin/radius — wrap controls layout. */
.code-wrap > pre.code-block {
  margin: 0;
  border-radius: 0;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: #181c29;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 34px;
}

/* Copy button inside .code-bar: override the absolute+opacity:0 base rules. */
.code-bar .copy-btn {
  position: static !important;
  opacity: 1 !important;
  width: auto;
  height: 34px;
  border-radius: 0;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0 11px;
  background: transparent;
  color: #8a95a8;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.code-bar .copy-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #dce4ef;
}

.code-bar .copy-btn.copy-btn--copied {
  color: #7ec86b !important;
}

/* First child of code-bar gets no left border (nothing to separate from). */
.code-bar > :first-child {
  border-left: none;
}

/* ── Run button (C++ WebAssembly execution) ── */

.run-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
  color: #7cbf64;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.run-btn:hover {
  background: rgba(124, 191, 100, 0.1);
  color: #a0d47e;
}

.run-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════════════════════════════
   C++ WASM output terminal
   ═══════════════════════════════════════════════════════════════════════════ */

.code-output {
  background: #11141d;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.code-output-bar {
  display: flex;
  align-items: center;
  background: #181c29;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  min-height: 32px;
}

.code-output-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
}

.code-output-tab {
  padding: 0 14px;
  height: 32px;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  color: #5f6a7a;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.code-output-tab.is-active {
  color: #c2cedd;
  background: rgba(255, 255, 255, 0.04);
}

.code-output-tab:hover:not(.is-active) {
  color: #8d99ac;
  background: rgba(255, 255, 255, 0.02);
}

.code-output-status {
  font-size: 11px;
  color: #4e5a6b;
  padding: 0 10px;
  font-family: "Cascadia Code", Consolas, monospace;
  flex-shrink: 0;
}

.code-output-close {
  background: transparent;
  border: none;
  color: #4e5a6b;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 8px;
  margin-right: 2px;
  border-radius: 3px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.code-output-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #8d99ac;
}

.code-output-pre {
  margin: 0;
  padding: 12px 18px;
  background: transparent;
  color: #b8c5d6;
  font-family: "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  border-radius: 0;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 52px;
  max-height: 260px;
  overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   C++ WASM loader overlay
   Covers the code block + output area while compiling or running.
   ═══════════════════════════════════════════════════════════════════════════ */

.code-loader {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 19, 28, 0.85);
  backdrop-filter: blur(3px);
  border-radius: 0; /* parent .code-wrap overflow:hidden clips to its radius */
}

.code-loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

@keyframes cpp-wasm-spin {
  to { transform: rotate(360deg); }
}

.code-loader-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(34, 58, 94, 0.35);
  border-top-color: #4a80c4;
  border-radius: 50%;
  animation: cpp-wasm-spin 0.7s linear infinite;
}

.code-loader-text {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: #7a8ba0;
  letter-spacing: 0.03em;
}

/* ─── GDPR Consent Banner ──────────────────────────────────────────────── */
#gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #141824;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
  padding: 14px 16px;
}

.gdpr-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.gdpr-text {
  flex: 1;
  min-width: 220px;
}

.gdpr-text strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 3px;
  color: #e8edf5;
}

.gdpr-text p {
  margin: 0;
  font-size: 0.8rem;
  color: #8a96a8;
  line-height: 1.5;
}

.gdpr-text a {
  color: var(--accent, #6aa6ff);
}

.gdpr-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.gdpr-btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.gdpr-btn--reject {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #a0aab8;
}

.gdpr-btn--reject:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.35);
  color: #e8edf5;
}

.gdpr-btn--accept {
  background: var(--accent, #6aa6ff);
  color: #0b1220;
  border-color: var(--accent, #6aa6ff);
}

.gdpr-btn--accept:hover {
  background: #90bbff;
  border-color: #90bbff;
}

/* Lock icon shown in header when user has not accepted functional cookies */
.header-consent-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: #8a96a8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.header-consent-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--accent, #6aa6ff);
  color: var(--accent, #6aa6ff);
}

/* Inline consent notice (profile panel, quiz result, profile page) */
.consent-notice {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  text-align: center;
}

.consent-notice p {
  margin: 0 0 12px;
  color: #8a96a8;
  font-size: 0.88rem;
}

.consent-notice .btn {
  margin: 0 auto;
}