:root {
  /* Brand colors */
  --color-primary:       #1e3a5f;
  --color-primary-light: #2a4f80;
  --color-accent:        #1a6abd;
  --color-accent-hover:  #1558a0;

  /* Text */
  --color-text:          #1a2332;
  --color-text-muted:    #5a6a7a;

  /* Surfaces & Background */
  --color-bg:            #ffffff;
  --color-surface:       #f7f9fc;
  --color-surface-hover: #edf2f7;
  --color-border:        #e2e8f0;
  --color-card-bg:       #ffffff;
  --color-topbar-bg:     #1e3a5f;
  --color-topbar-text:   #ffffff;

  /* Code */
  --color-code-bg:       #f7f9fc;
  --color-code-border:   #e2e8f0;
  --color-code-text:     #1e3a5f;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;

  /* Font stacks */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

[data-theme="dark"] {
  /* Brand colors */
  --color-primary:       #93c5fd;
  --color-primary-light: #bfdbfe;
  --color-accent:        #38bdf8;
  --color-accent-hover:  #7dd3fc;

  /* Text */
  --color-text:          #e2e8f0;
  --color-text-muted:    #94a3b8;

  /* Surfaces & Background */
  --color-bg:            #0b1120;
  --color-surface:       #151f32;
  --color-surface-hover: #1e293b;
  --color-border:        #26354a;
  --color-card-bg:       #131d2e;
  --color-topbar-bg:     #0b1120;
  --color-topbar-text:   #f8fafc;

  /* Code */
  --color-code-bg:       #131d2e;
  --color-code-border:   #26354a;
  --color-code-text:     #93c5fd;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary:       #93c5fd;
    --color-primary-light: #bfdbfe;
    --color-accent:        #38bdf8;
    --color-accent-hover:  #7dd3fc;

    --color-text:          #e2e8f0;
    --color-text-muted:    #94a3b8;

    --color-bg:            #0b1120;
    --color-surface:       #151f32;
    --color-surface-hover: #1e293b;
    --color-border:        #26354a;
    --color-card-bg:       #131d2e;
    --color-topbar-bg:     #0b1120;
    --color-topbar-text:   #f8fafc;

    --color-code-bg:       #131d2e;
    --color-code-border:   #26354a;
    --color-code-text:     #93c5fd;
  }
}

/* body's font, colours, line-height and padding-bottom live in base.css. */

:not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--color-code-text);
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
}

h1, h2 {
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.25;
}

h3, h4, h5, h6 {
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.3;
}

.audience-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
}
.audience-card h5 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.audience-card ul {
  padding-left: 1.2rem;
  margin-bottom: 0;
}


/* Was `.article.card` — the Bootstrap `card` token is gone from the markup.
   The first five properties came from Bootstrap's .card and are kept so the
   box model is unchanged. flex-direction: column also means these children
   are flex items, which don't collapse margins; block layout happens to
   render identically today (no child has a margin-top) but would silently
   shift the moment one gained one. */
.article {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;

  padding: 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin-bottom: 20px;
}
.article .meta {
  font-weight: bold;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.article .meta a {
  color: var(--color-accent);
}
.article .tags {
  margin-bottom: 6px;
  color: var(--color-text-muted);
}
.article p:last-child {
  margin-bottom: 0;
}

.article-author-box {
  padding: 6px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
}


.book-row {
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
}
.book-row .left {
  flex: 1 auto;
}
.book-row .left img {
  width: 180px;
  margin-right: 1em;
  border: 4px #ccc solid;
}
.book-row .right {
  flex: 0 auto;
}


.banner {
  padding: 8px 12px;
  border: 1px #FEEA89 solid;
  border-radius: 6px;
  background: #FFFDD1;
  color: #713f12;
  margin: 1em 0;
}
[data-theme="dark"] .banner {
  border-color: #854d0e;
  background: #27210e;
  color: #fef08a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .banner {
    border-color: #854d0e;
    background: #27210e;
    color: #fef08a;
  }
}


/* ── Spec map ───────────────────────────────────────────────── */

.map-wrapper {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  margin: 1.5rem 0;
  cursor: default;
  -webkit-overflow-scrolling: touch;
}

.map-canvas {
  position: relative;
  user-select: none;
}

.map-node {
  position: absolute;
  width: 155px;
  height: 48px;
  border-radius: 6px;
  padding: 6px 10px;
  text-decoration: none !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
  box-sizing: border-box;
  transition: box-shadow 0.12s, opacity 0.12s, transform 0.1s;
}
.map-node:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transform: translateY(-1px);
  z-index: 10;
  opacity: 1 !important;
}
.map-node .node-name {
  font-weight: 700;
  font-size: 11.5px;
  line-height: 1.2;
  color: inherit;
  display: block;
}
.map-node .node-sub {
  font-size: 10px;
  font-family: var(--font-mono);
  opacity: 0.7;
  display: block;
  line-height: 1.2;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-node.group-core       { background: #1e3a5f; color: #fff; }
.map-node.group-grant      { background: #1d4ed8; color: #fff; }
.map-node.group-extension  { background: #0369a1; color: #fff; }
.map-node.group-token      { background: #6d28d9; color: #fff; }
.map-node.group-security   { background: #92400e; color: #fff; }
.map-node.group-discovery  { background: #374151; color: #fff; }
.map-node.group-builton    { background: #166534; color: #fff; }
.map-node.group-deprecated { background: #fff1f2; color: #991b1b; border: 2px dashed #fca5a5; }

[data-theme="dark"] .map-node.group-deprecated {
  background: #3b1114;
  color: #fca5a5;
  border-color: #991b1b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-node.group-deprecated {
    background: #3b1114;
    color: #fca5a5;
    border-color: #991b1b;
  }
}

.map-node.is-dimmed    { opacity: 0.12; }
.map-node.is-active    { box-shadow: 0 0 0 2px #fff, 0 4px 16px rgba(0,0,0,0.3); z-index: 10; }

.map-edge { transition: opacity 0.12s; }
.map-edge.is-dimmed    { opacity: 0.06; }
.map-edge.is-active    { opacity: 1 !important; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
  font-size: var(--text-xs);
}
.map-legend-group { display: flex; flex-direction: column; gap: 0.35rem; }
.map-legend-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  margin-bottom: 0.15rem;
}
.map-legend-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.map-legend-item { display: flex; align-items: center; gap: 5px; }
.map-legend-line {
  width: 22px; height: 3px; border-radius: 2px; flex-shrink: 0;
}
.map-legend-dot {
  width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0;
}
.map-legend-dot.group-deprecated { background: #fff1f2; border: 1.5px dashed #fca5a5; }


/* ── Spec page template ─────────────────────────────────────── */

/* Metadata bar: RFC badge + status pill, sits below the h2 */
.spec-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.spec-status {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.1em 0.5em;
  border-radius: 4px;
  vertical-align: middle;
}
.spec-status--published {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.spec-status--draft {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.spec-status--deprecated {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

[data-theme="dark"] .spec-status--published {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #047857;
}
[data-theme="dark"] .spec-status--draft {
  background: #78350f;
  color: #fde68a;
  border-color: #b45309;
}
[data-theme="dark"] .spec-status--deprecated {
  background: #7f1d1d;
  color: #fca5a5;
  border-color: #b91c1c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .spec-status--published {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #047857;
  }
  :root:not([data-theme="light"]) .spec-status--draft {
    background: #78350f;
    color: #fde68a;
    border-color: #b45309;
  }
  :root:not([data-theme="light"]) .spec-status--deprecated {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #b91c1c;
  }
}

/* One-sentence lede, slightly larger and muted */
.spec-lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

/* "When to use this" callout box */
.spec-when {
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
}
.spec-when strong {
  display: block;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

/* Warning variant of the callout box */
.spec-when--warning {
  border-left-color: #d97706;
}
.spec-when--warning strong {
  color: #92400e;
}
[data-theme="dark"] .spec-when--warning strong {
  color: #fde68a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .spec-when--warning strong {
    color: #fde68a;
  }
}


/* ── Contribution prompt ────────────────────────────────────── */

.contribution-prompt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--color-border);
  border-radius: 6px;
  margin: 2rem 0 0;
}
.contribution-prompt a {
  font-weight: 600;
  margin-left: 0.25rem;
}
.contribution-prompt .divider {
  margin: 0 0.5rem;
  opacity: 0.4;
}


/* Used on spec detail pages for the canonical RFC URL */
.rfc {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  word-break: break-all;
}

/* Inline pill badge for RFC references, e.g. RFC 9700 */
.rfc-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-code-text);
  background: var(--color-code-bg);
  border: 1px solid var(--color-code-border);
  border-radius: 4px;
  padding: 0.1em 0.45em;
  vertical-align: middle;
  white-space: nowrap;
  text-decoration: none !important;
}
.rfc-badge:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}


.home-supported {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  color: var(--color-text);
}
.home-supported .head {
  font-size: 14px;
}
.home-supported .cta {
  font-size: 18px;
}


.event {
  margin-top: 1em;
  margin-bottom: 1em;
}
.event .name {
  font-weight: bold;
  font-size: 1.2em;
}


footer {
  border-top: 3px var(--color-border) solid;
  padding: 30px 0;
  margin-top: 30px;
  margin-bottom: 30px;
  position: relative;
}

footer .follow {
  font-size: 0.7rem;
  margin-right: 40px;
  float: right;
  padding: 20px 0;
}

footer .supported {
  font-size: 0.7rem;
  margin-left: 40px;
  padding: 20px 0;
}

footer .supported a {
  text-decoration: none;
  color: #555;
}

footer .supported a:hover {
  color: #777;
}

footer .supported img {
  vertical-align: middle;
  margin: 0;
  margin-left: 0.3em;
}

footer .source {
  text-align: center;
  font-size: 14px;
}

footer .source a {
  text-decoration: none;
}



#ea {
  position: fixed;
  font-size: 13px;
  box-sizing: border-box;
  bottom: 0px;
  z-index: 5;
  padding: .75em 1em;
  width: 100%;
  background-color: var(--color-surface) !important;
  border-top: 1px var(--color-border) solid;
  color: var(--color-text);
  text-align: center;
  line-height: 1.5;
}

#ea .ea-pixel {
  width: 0;
  height: 0;
  display: none;
}

#ea .ea-content {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  margin-right: 1em;
}

#ea .ea-callout {
  display: inline-block;
  font-size: 12px;
  text-decoration: none;
  color: var(--color-text-muted);
}



.videos {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 10px;
}
.videos .video {
  padding: 6px;
}
.videos .video .title {
  font-weight: bold;
}
.videos .video a {
  color: var(--color-text);
}
.videos .video .date a {
  color: var(--color-text-muted);
}
.videos .video img {
  width: 100%;
  max-width: 100%;
}

@media(max-width: 700px) {
  .videos {
    grid-template-columns: 1fr 1fr;
  }
}

@media(max-width: 500px) {
  .videos {
    grid-template-columns: 1fr;
  }
}


.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.implementations {
  columns: 3;
  column-gap: 20px;
}

.implementations li {
  break-inside: avoid;
}

@media(max-width: 700px) {
  .implementations {
    columns: 2;
  }
}

@media(max-width: 500px) {
  .implementations {
    columns: 1;
  }
}

/* The games page: two columns, one on a phone. */
.games-grid {
  margin-bottom: 1.5rem;
}
@media(max-width: 600px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* Kept off .grid itself, which is shared by /security/
   and /2/client-id-metadata-document/. Was the Bootstrap `mb-4` utility. */
.security-grid {
  margin-bottom: 1.5rem;
}


/* ── Site layout ─────────────────────────────────────────────── */

.site-topbar {
  height: 52px;
  background: var(--color-topbar-bg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 300;
  border-bottom: 1px solid var(--color-border);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none !important;
  color: var(--color-topbar-text);
  font-weight: 700;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
.topbar-brand:hover { color: rgba(255,255,255,0.85); }
.topbar-brand img { display: block; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}
.theme-toggle:active {
  transform: scale(0.95);
}

/* Toggle icons */
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: block;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.site-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 52px);
}

.site-sidebar {
  width: 248px;
  flex-shrink: 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  padding: 1rem 0 2rem;
  overscroll-behavior: contain;
}

.site-main {
  flex: 1;
  min-width: 0;
  padding: 1.5rem 2.5rem 3rem;
}

.site-main .container {
  max-width: 800px;
  padding-left: 0;
  padding-right: 0;
}

.site-overlay {
  display: none;
}

/* ── Global sidebar nav ──────────────────────────────────────── */

.site-sidebar-nav {
  font-size: var(--text-sm);
}

.sidebar-divider {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding: 1.25rem 1.25rem 0.35rem;
  display: block;
}

.sidebar-link {
  display: block;
  padding: 0.28rem 1.25rem;
  color: var(--color-text);
  text-decoration: none !important;
  border-radius: 0;
  transition: color 0.1s, background 0.1s;
}
.sidebar-link:hover { color: var(--color-accent); background: var(--color-surface); }
.sidebar-link.active { color: var(--color-accent); font-weight: 600; background: var(--color-surface); }

/* <details>/<summary> collapsible sections */
.site-sidebar-nav details {
  border: none;
}
.sidebar-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.28rem 1.25rem;
  cursor: pointer;
  list-style: none;
  color: var(--color-text);
  font-size: var(--text-sm);
  user-select: none;
}
.sidebar-summary::-webkit-details-marker { display: none; }
.sidebar-summary::after {
  content: '›';
  font-size: 1.1em;
  color: var(--color-text-muted);
  transition: transform 0.15s;
  flex-shrink: 0;
}
details[open] > .sidebar-summary::after { transform: rotate(90deg); }
.sidebar-summary:hover { color: var(--color-accent); background: var(--color-surface); }
details[open] > .sidebar-summary { color: var(--color-primary); font-weight: 600; }

.sidebar-sub {
  list-style: none;
  padding: 0.15rem 0 0.5rem;
  margin: 0;
}
.sidebar-sub li { margin: 0; }

.sidebar-sublink {
  display: block;
  padding: 0.22rem 1.25rem 0.22rem 2rem;
  color: var(--color-text-muted);
  text-decoration: none !important;
  font-size: 0.8125rem;
  transition: color 0.1s, background 0.1s;
}
.sidebar-sublink:hover { color: var(--color-accent); background: var(--color-surface); }
.sidebar-sublink.active { color: var(--color-accent); font-weight: 600; background: var(--color-surface); }

.sidebar-deprecated {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  background: var(--color-surface-hover);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  margin-right: 0.35rem;
  vertical-align: middle;
}

/* ── Mobile layout ───────────────────────────────────────────── */

@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }

  .site-sidebar {
    position: fixed;
    top: 52px;
    left: -260px;
    height: calc(100vh - 52px);
    width: 248px;
    transition: left 0.25s ease;
    z-index: 200;
  }
  .site-sidebar.is-open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }

  .site-overlay {
    display: block;
    position: fixed;
    inset: 52px 0 0 0;
    background: rgba(0,0,0,0.35);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .site-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .site-main { padding: 1.25rem 1.25rem 3rem; }
}

/* ── Decision tree ───────────────────────────────────────────── */

.dt-intro {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.dt-header {
  margin-bottom: 1.25rem;
  min-height: 2rem;
}

.dt-back {
  background: none;
  border: none;
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.dt-back:hover { text-decoration: underline; }

.dt-question {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0.5rem 0 0;
}

.dt-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.dt-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.dt-option:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  background: var(--color-surface);
}
.dt-option-text { flex: 1; }
.dt-label {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  font-size: var(--text-base);
  margin-bottom: 0.1rem;
}
.dt-hint {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.dt-arrow {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}
.dt-option:hover .dt-arrow { color: var(--color-accent); transform: translateX(3px); }

.dt-result {
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--color-card-bg);
}
.dt-result-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.dt-result-body {
  color: var(--color-text);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.dt-result-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.dt-result-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}
.dt-result-link:hover { text-decoration: underline; }

.dt-restart-row {
  margin-top: 1.25rem;
  text-align: right;
}
.dt-restart {
  background: none;
  border: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
}
.dt-restart:hover { color: var(--color-accent); text-decoration: underline; }


.flow-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.flow-card {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none !important;
  color: var(--color-text);
  height: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.flow-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  color: var(--color-text);
}
.flow-card .flow-title {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}
.flow-card .flow-grant {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.6rem;
}
.flow-card .flow-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Homepage "Popular Topics" block. Was the Bootstrap `mt-5` utility. */
.home-topics {
  margin-top: 3rem;
}

/* Was `mt-2 mb-3`. The top margin is a no-op in practice — the preceding
   element carries `margin: 40px auto`, which wins the margin collapse. */
.home-learn-heading {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.topic-link {
  display: block;
  padding: 0.6rem 0.9rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none !important;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.topic-link:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

@media (max-width: 600px) {
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


.terminology {
  margin: 0;
}
.terminology dt {
  font-weight: 700;
  color: var(--color-primary);
  margin-top: 1.25rem;
  font-size: var(--text-base);
}
.terminology dt .term-abbr {
  font-weight: 400;
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-left: 0.4rem;
}
.terminology dd {
  margin: 0.25rem 0 0 0;
  padding-left: 1rem;
  border-left: 3px solid var(--color-border);
  color: var(--color-text);
  line-height: 1.6;
}


.faq h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.4rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.faq h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.4rem;
}

.faq h4:first-of-type {
  margin-top: 0;
}

.faq p {
  margin-bottom: 0.4rem;
}


