/* ==========================================================================
   AI Intel Radar — Editorial Minimalism Stylesheet
   Google DeepMind & Apple Newsroom Typography + Architectural Plane System
   ========================================================================== */

:root {
  --bg-canvas: #ffffff;
  --bg-surface: #f5f5f7;
  --bg-surface-hover: #ececef;
  --bg-code: #f5f5f7;
  --border-hairline: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text-primary: #1d1d1f;
  --text-body: #515154;
  --text-muted: #6e6e73;
  --text-faint: #86868b;
  --accent-blue: #0066cc;
  --accent-urgent: #c5221f;
  --accent-urgent-dot: #d93025;
  --accent-active: #188038;
  --scrollbar-thumb: rgba(0, 0, 0, 0.16);

  /* Display font: refined Light / Thin geometric sans for headlines */
  --font-display: "DM Sans", "Noto Sans SC", "SF Pro Display", "PingFang SC",
    "Microsoft YaHei Light", "DengXian Light", "Helvetica Neue", sans-serif;

  /* Editorial Serif: calm literary voice for brand & navigation channels */
  --font-nav-serif: "Noto Serif SC", "New York", "Songti SC", "STSong",
    "Source Han Serif SC", Georgia, serif;

  /* Precision Technical Mono: crisp architectural voice for vendor anchors */
  --font-vendor: "IBM Plex Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;

  /* Body font: crisp system UI sans kept distinct from headlines & nav */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Google Sans", "Microsoft YaHei", "Helvetica Neue", sans-serif;

  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo,
    Monaco, Consolas, monospace;
}

html.dark,
html[data-theme="dark"] {
  --bg-canvas: #0b0c0e;
  --bg-surface: #141519;
  --bg-surface-hover: #1b1d24;
  --bg-code: #16181e;
  --border-hairline: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text-primary: #f5f5f7;
  --text-body: #b8b8be;
  --text-muted: #8e8e93;
  --text-faint: #6e6e73;
  --accent-blue: #2997ff;
  --accent-urgent: #ff6961;
  --accent-urgent-dot: #ff453a;
  --accent-active: #30d158;
  --scrollbar-thumb: rgba(255, 255, 255, 0.2);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
  color-scheme: light;
}

html.dark,
html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

main,
header,
nav,
section,
article,
footer,
aside,
#headline-grid,
#headline-grid > *,
#intel-feed,
#intel-feed > * {
  min-width: 0;
  max-width: 100%;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

img,
canvas,
svg,
video {
  max-width: 100%;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* --------------------------------------------------------------------------
   1. Editorial Display Typography (Distinct Light-Weight Headlines vs Body)
   -------------------------------------------------------------------------- */
.font-editorial-display {
  font-family: var(--font-display);
  font-weight: 300;
  font-synthesis-weight: none;
}

.font-editorial-ultralight {
  font-family: var(--font-display);
  font-weight: 200;
  font-synthesis-weight: none;
}

.font-editorial-nav {
  font-family: var(--font-nav-serif);
  letter-spacing: 0.06em;
}

.font-editorial-vendor {
  font-family: var(--font-vendor);
  font-weight: 400;
  font-size: 11.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   2. Sticky Frosted Navigation
   -------------------------------------------------------------------------- */
.editorial-nav {
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.radar-wordmark {
  display: block;
  width: 56px;
  height: auto;
  flex: none;
}

.radar-brand-name { text-transform: none; }

.radar-wordmark-footer { width: 38px; color: var(--text-primary); }

#channel-tabs { gap: clamp(16px, 2vw, 30px); }
.nav-channel-btn {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.45;
  color: var(--text-muted);
}

.nav-channel-btn:hover {
  color: var(--text-primary);
}

.nav-channel-btn[data-active="true"] {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-channel-btn[data-active="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background-color: var(--text-primary);
}

#channel-tabs .nav-channel-btn:focus-visible {
  outline: 1px solid var(--accent-blue);
  outline-offset: -1px;
}

@media (max-width: 639px) {
  #channel-tabs {
    width: calc(100% + 24px);
    margin-inline: -12px;
    padding-inline: 2px;
    justify-content: space-between;
    gap: 4px;
    overflow-x: visible;
  }
  .nav-channel-btn { font-size: 12.5px; letter-spacing: -0.01em; }
  .radar-wordmark:not(.radar-wordmark-footer) { width: 50px; }
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* --------------------------------------------------------------------------
   3. Architectural Editorial Surfaces (Apple Newsroom / DeepMind Rhythm)
   -------------------------------------------------------------------------- */
.editorial-lead-surface,
.editorial-secondary-lead,
.editorial-tile {
  background-color: var(--bg-surface);
  transition: background-color 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.editorial-lead-surface:hover,
.editorial-secondary-lead:hover,
.editorial-tile:hover {
  background-color: var(--bg-surface-hover);
}

.editorial-lead-plate {
  position: relative;
  overflow: hidden;
  background: linear-gradient(148deg, #eceef3 0%, #e4e7ef 100%);
}

.editorial-lead-plate[data-tone="urgent"] {
  background: linear-gradient(148deg, #f4ecec 0%, #ede3e4 100%);
}

html.dark .editorial-lead-plate,
html[data-theme="dark"] .editorial-lead-plate {
  background: linear-gradient(148deg, #1a1d27 0%, #13161f 100%);
}

html.dark .editorial-lead-plate[data-tone="urgent"],
html[data-theme="dark"] .editorial-lead-plate[data-tone="urgent"] {
  background: linear-gradient(148deg, #24181b 0%, #171215 100%);
}

.editorial-headline-text {
  transition: opacity 180ms ease;
}

.editorial-lead-surface:hover .editorial-headline-text,
.editorial-secondary-lead:hover .editorial-headline-text,
.editorial-tile:hover .editorial-headline-text {
  opacity: 0.78;
}

/* Line clamping for clean magazine front-face density */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Serene Editorial Reading Drawer (Progressive Disclosure)
   -------------------------------------------------------------------------- */
.reader-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: flex;
  justify-content: flex-end;
  background-color: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background-color 200ms ease, backdrop-filter 200ms ease;
}

.reader-backdrop[hidden] {
  display: none !important;
}

.reader-backdrop[data-open="true"] {
  background-color: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html.dark .reader-backdrop[data-open="true"],
html[data-theme="dark"] .reader-backdrop[data-open="true"] {
  background-color: rgba(0, 0, 0, 0.64);
}

.reader-sheet {
  width: min(660px, 100vw);
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  border-left: 1px solid var(--border-hairline);
  transform: translate3d(28px, 0, 0);
  transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}

.reader-backdrop[data-open="true"] .reader-sheet {
  transform: translate3d(0, 0, 0);
}

.reader-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 639px) {
  .reader-sheet {
    width: 100vw;
    border-left: 0;
    transform: translate3d(0, 20px, 0);
  }
}

/* --------------------------------------------------------------------------
   5. Accessibility & Reduced Motion
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

[hidden], .hidden:not([data-theme-icon]) { display: none !important; }

.feed-tools, .story-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .8rem;
  font-size: 13px;
  color: var(--text-muted);
}
.feed-tools [aria-pressed="true"] { color: var(--text-primary); text-decoration: underline; text-underline-offset: 5px; }
.feed-tools button:disabled { opacity: .45; }
.story-actions { margin-top: .9rem; }
.story-link { color: var(--accent-blue); }
.story-title-button { text-align: inherit; font: inherit; }
.bookmark { margin-inline-start: auto; padding: 5px; color: var(--text-muted); }
.bookmark-icon { display: block; width: 16px; height: 16px; }
.bookmark[aria-pressed="true"] svg { fill: currentColor; color: var(--accent-blue); }
.review-cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 1rem; }
.reader-preview .review-cover { margin: 1.5rem 0 0; }
.reader-metric { margin-top: .75rem; font-size: 14px; color: var(--accent-blue); }

#intel-feed[data-density="brief"] { display: block; }
#top:has(#intel-feed[data-density="brief"]) > header { padding-block: 1.25rem; }
#intel-main:has(#intel-feed[data-density="brief"]) { padding-top: .5rem; }
.brief-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: .42rem 0;
  border-bottom: 1px solid var(--border-hairline);
  cursor: pointer;
}
.brief-date { font: 12px var(--font-mono); color: var(--text-muted); }
.brief-title { font-size: 15px; font-weight: 450; }
.brief-title button { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brief-row .story-actions { margin: 0; }

#model-panel { padding: 0 0 4rem; }
.catalog-controls, .budget {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem 2rem;
  padding-block: 1rem;
  border-block: 1px solid var(--border-hairline);
}
.catalog-controls label, .budget label {
  display: grid;
  gap: .4rem;
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
}
.catalog-controls input, .catalog-controls select, .budget input {
  color: var(--text-primary);
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  padding: .4rem 0;
  font-size: 15px;
}
.budget { margin: 1.8rem 0 1rem; border-top: none; }
.budget legend { font: 400 22px var(--font-display); }
.budget input { width: 9rem; max-width: 100%; font-variant-numeric: tabular-nums; }
.catalog-caption { font-size: 13px; color: var(--text-muted); margin-block: 1.5rem .75rem; }
.spec-scroll { max-width: 100%; overflow-x: auto; }
.spec-table { width: 100%; min-width: 720px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.spec-table th, .spec-table td { padding: .9rem .55rem; text-align: right; border-bottom: 1px solid var(--border-hairline); }
.spec-table th { font-weight: 500; }
.spec-table thead { color: var(--text-muted); font-size: 13px; }
.spec-table th:first-child { text-align: left; padding-left: 0; width: 35%; }
.spec-table td { font-size: 14px; white-space: nowrap; }
.spec-table td:last-child { color: var(--accent-blue); }
.spec-table summary { cursor: pointer; }
.spec-table details p { margin-top: .5rem; font-size: 13px; line-height: 1.5; color: var(--text-muted); }

@media (max-width: 700px) {
  .brief-row { gap: .35rem .75rem; grid-template-columns: minmax(0,1fr) auto; }
  .brief-date { display: none; }
  .brief-row .story-actions { display: contents; }
  .brief-row .bookmark { grid-column: 2; grid-row: 1; }
  .brief-row .story-metric, .brief-row .story-link { font-size: 11px; }
  .brief-row .story-metric { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .catalog-controls, .budget { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
}

.visit-increment { margin: .8rem 0 0; font-size: 13px; color: var(--text-muted); }
.reader-actions { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; margin-top: 1.25rem; color: var(--accent-blue); font-size: 14px; }
.reader-actions :is(button, a):hover { text-decoration: underline; }
#toast-container { z-index: 120; }

/* ==========================================================================
   6. V4.1 Practical Guides — Course Hub + Step-by-Step Walkthrough
   Benchmarked against Apple Developer Docs & Google Codelabs
   ========================================================================== */
.guides-panel {
  padding-bottom: 5rem;
  border-top: 1px solid var(--border-hairline);
}

/* Progress bar shared by Course Hub & Walkthrough Stepper */
.guide-progress-track {
  margin-top: 0.65rem;
  height: 2px;
  width: 100%;
  background: var(--border-hairline);
  overflow: hidden;
}

.guide-progress-fill {
  height: 100%;
  background: var(--accent-blue);
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-toc-track {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.guide-done-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-active);
}

/* ---------------- View 1: Course Hub (教学主页) ---------------- */
.guides-hub-empty {
  padding: clamp(3rem, 7vw, 6rem) 0;
  border-bottom: 1px solid var(--border-hairline);
}

.guides-hub-empty .guide-doc-summary {
  max-width: 36rem;
}

.guides-hub-header {
  padding: 2rem 0 1.75rem;
}

.guides-hub-progress-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.guides-hub-progress-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.guides-hub-progress-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-primary);
}

.guides-hub-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.guides-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.guide-hub-card {
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--bg-surface);
  border-top: 2px solid transparent;
  cursor: pointer;
  min-width: 0;
  transition: background-color 200ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 200ms ease;
}

.guide-hub-card:hover {
  background: var(--bg-surface-hover);
  border-top-color: var(--text-primary);
}

.guide-hub-card[data-completed="true"] {
  border-top-color: var(--accent-active);
}

.guide-hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.guide-hub-status-active {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-blue);
}

.guide-hub-status-muted {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.guide-hub-card-title {
  margin: 1rem 0 0;
  font-size: 21px;
  line-height: 1.34;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.guide-hub-card-summary {
  margin: 0.85rem 0 0;
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-body);
}

.guide-hub-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-hairline);
}

.guide-hub-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.guide-hub-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-blue);
}

/* ---------------- View 2: Lesson Walkthrough Shell ---------------- */
.guide-lesson-shell {
  max-width: 78ch;
  margin-inline: auto;
  min-width: 0;
}

.guide-lesson-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-hairline);
}

.guide-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
  transition: color 150ms ease;
}

.guide-back-btn:hover {
  color: var(--accent-blue);
}

.guide-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
}

.guide-mode-btn {
  position: relative;
  border: 0;
  border-bottom: 1.5px solid transparent;
  background: transparent;
  padding: 0.25rem 0;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.guide-mode-btn:hover {
  color: var(--text-primary);
}

.guide-mode-btn[data-active="true"] {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: var(--text-primary);
}

/* Lesson Editorial Header */
.guide-doc-header {
  padding: 2rem 0 1.75rem;
  border-bottom: 1px solid var(--border-hairline);
}

.guide-doc-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 12.5px;
  color: var(--text-muted);
}

.guide-doc-order,
.guide-doc-date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.guide-doc-track {
  color: var(--text-primary);
}

.guide-kicker-sep {
  opacity: 0.35;
  user-select: none;
}

.guide-doc-title {
  margin: 0.85rem 0 0;
  font-size: clamp(25px, 3vw, 35px);
  line-height: 1.22;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  word-break: break-word;
}

.guide-doc-summary {
  margin: 0.95rem 0 0;
  font-size: 15.5px;
  line-height: 1.72;
  color: var(--text-body);
}

.guide-author-note {
  margin: 1.2rem 0 0;
  padding: 0.7rem 1rem;
  border-left: 2px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

.guide-author-note-label {
  font-weight: 500;
  color: var(--text-primary);
}

.guide-doc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: 1.35rem;
}

.guide-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13.5px;
  color: var(--accent-blue);
  background: transparent;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
  transition: opacity 150ms ease, color 150ms ease;
}

.guide-action-link:hover {
  opacity: 0.75;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.guide-action-link[data-completed="true"] {
  color: var(--accent-active);
}

/* Step Progress Bar & Clickable Step Nodes */
.guide-stepper {
  padding: 1.5rem 0 0;
}

.guide-stepper-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1rem;
}

.guide-stepper-counter {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.guide-stepper-current-name {
  font-size: 13px;
  color: var(--text-muted);
}

.guide-step-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.guide-step-node {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-bottom: 2px solid var(--border-hairline);
  background: transparent;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.guide-step-node:hover {
  background: var(--bg-surface);
}

.guide-step-node[data-active="true"] {
  background: var(--bg-surface);
  border-bottom-color: var(--text-primary);
}

.guide-step-node[data-done="true"]:not([data-active="true"]) {
  border-bottom-color: var(--accent-active);
}

.guide-step-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.guide-step-node-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.guide-step-node[data-active="true"] .guide-step-node-num {
  color: var(--text-primary);
  font-weight: 600;
}

.guide-step-node-check {
  color: var(--accent-active);
  display: inline-flex;
  align-items: center;
}

.guide-step-node-label {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-step-node[data-active="true"] .guide-step-node-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* Step Sections */
.guide-steps {
  display: flex;
  flex-direction: column;
}

.guide-step {
  padding-block: 2.25rem;
  border-bottom: 1px solid var(--border-hairline);
  scroll-margin-top: 84px;
  min-width: 0;
}

.guide-step-focused {
  border-bottom: 0;
  padding-bottom: 1.5rem;
}

.guide-step-header {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.guide-step-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.11em;
  color: var(--text-muted);
}

.guide-step-title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 27px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.guide-step-body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

.guide-para {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--text-body);
  overflow-wrap: anywhere;
}

.guide-figure {
  margin: 0;
  min-width: 0;
}

.guide-image-trigger {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--border-hairline);
  border-radius: 0;
  background: var(--bg-surface);
  cursor: zoom-in;
}

.guide-image-trigger:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.guide-image-trigger:disabled {
  cursor: default;
}

.guide-image-trigger:focus-visible,
.guide-lightbox-close:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 3px;
}

.guide-image-inline {
  display: inline-block;
  width: auto;
  vertical-align: middle;
}

.guide-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.guide-figcaption {
  margin-top: 0.65rem;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.guide-image-fallback {
  display: block;
  padding: 1rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

html:has(.guide-lightbox[open]) {
  overflow-y: hidden;
}

.guide-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 3vw, 32px);
  border: 0;
  background: transparent;
  color: var(--text-primary);
}

.guide-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-lightbox::backdrop {
  background: color-mix(in srgb, var(--bg-canvas) 90%, transparent);
}

.guide-lightbox-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  max-height: 100%;
  min-width: 0;
  border: 1px solid var(--border-hairline);
  background: var(--bg-canvas);
}

.guide-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
}

.guide-lightbox-close {
  flex-shrink: 0;
  padding: 0.4rem 0.5rem;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.guide-lightbox-figure {
  margin: 0;
  padding: clamp(12px, 2vw, 24px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.guide-lightbox-figure .guide-image {
  max-height: calc(100dvh - 12rem);
  object-fit: contain;
}

.guide-lightbox-figure .guide-figcaption {
  text-align: center;
}

.guide-sub-heading {
  margin: 0.6rem 0 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}

.guide-strong {
  font-weight: 600;
  color: var(--text-primary);
}

.guide-inline-code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  padding: 0.12em 0.38em;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 2px;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.guide-jump-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
  min-width: 0;
  max-width: 100%;
  padding: 1.25rem 0;
  border-block: 1px solid var(--border-hairline);
  color: var(--text-primary);
  text-decoration: none;
}

.guide-jump-card:hover {
  border-color: var(--border-strong);
}

.guide-jump-card:focus-visible,
.guide-link:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
}

.guide-jump-details {
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.guide-jump-title {
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.guide-jump-host {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
}

.guide-jump-action {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-blue);
  font-size: 13px;
}

.guide-link {
  display: inline;
  overflow-wrap: anywhere;
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease, opacity 150ms ease;
}

.guide-link:hover {
  border-bottom-color: currentColor;
}

.guide-link .guide-link-icon {
  margin-inline-start: 0.18rem;
}

.guide-link-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  transform: translateY(1px);
  flex-shrink: 0;
}

/* Lists */
.guide-ol,
.guide-ul {
  margin: 0;
  padding-left: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.guide-ol { list-style: decimal; }
.guide-ul { list-style: disc; }

.guide-li {
  font-size: 15px;
  line-height: 1.76;
  color: var(--text-body);
  padding-left: 0.2rem;
  overflow-wrap: anywhere;
}

.guide-li::marker {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Code Blocks with Copy Header */
.guide-code-block {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--border-hairline);
  background: var(--bg-code);
  overflow: hidden;
}

.guide-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border-hairline);
}

.guide-code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.guide-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 12.5px;
  color: var(--accent-blue);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.guide-copy-btn:hover { opacity: 0.72; }
.guide-copy-btn[data-copied="true"] { color: var(--accent-active); }

.guide-code-pre {
  margin: 0;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  max-width: 100%;
}

.guide-code-text {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.68;
  color: var(--text-primary);
  white-space: pre;
}

/* Markdown Tables */
.guide-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--border-hairline);
}

.guide-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.62;
}

.guide-table th,
.guide-table td {
  padding: 0.85rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-hairline);
}

.guide-table th:first-child,
.guide-table td:first-child { padding-left: 0; }
.guide-table th:last-child,
.guide-table td:last-child { padding-right: 0; }

.guide-table th {
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.guide-table td { color: var(--text-body); }
.guide-table td:first-child { color: var(--text-primary); font-weight: 500; }

/* Risk Note Callout & Quote */
.guide-risk-note {
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--accent-urgent-dot);
  background: rgba(217, 48, 37, 0.045);
}

html.dark .guide-risk-note,
html[data-theme="dark"] .guide-risk-note {
  background: rgba(255, 69, 58, 0.09);
}

.guide-risk-label {
  margin: 0 0 0.35rem;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-urgent);
}

.guide-risk-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-primary);
}

.guide-quote {
  margin: 0;
  padding: 0.8rem 1.1rem;
  border-left: 2px solid var(--border-strong);
  background: var(--bg-surface);
}

.guide-quote-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-body);
}

/* Bottom Walkthrough Action Bar */
.guide-walkthrough-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-hairline);
}

.guide-walkthrough-prev {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.1rem;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 150ms ease, opacity 150ms ease;
}

.guide-walkthrough-prev:hover:not(:disabled) {
  background: var(--bg-surface);
}

.guide-walkthrough-prev:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.guide-walkthrough-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.4rem;
  border: 0;
  background: var(--accent-blue);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.guide-walkthrough-next:hover {
  opacity: 0.88;
}

.guide-walkthrough-finish {
  background: var(--accent-active);
}

/* Related Live Radar Intel */
.guide-related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-hairline);
}

.guide-related-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-hairline);
}

.guide-related-heading {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.guide-related-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.guide-related-list {
  display: flex;
  flex-direction: column;
}

.guide-related-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  text-align: left;
  padding: 1.05rem 0;
  border: 0;
  border-bottom: 1px solid var(--border-hairline);
  background: transparent;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.guide-related-row:hover { opacity: 0.72; }

.guide-related-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.guide-related-vendor-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
}

.guide-urgent-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--accent-urgent-dot);
  flex-shrink: 0;
}

.guide-related-value {
  font-size: 12.5px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.guide-related-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .guides-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .guides-hub-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .guide-hub-card {
    padding: 1.5rem;
  }

  .guide-step-nodes {
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
    gap: 0.25rem;
  }

  .guide-step-node {
    padding: 0.55rem 0.2rem;
    align-items: center;
    text-align: center;
  }

  .guide-step-node-top {
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
  }

  .guide-step-node-num {
    font-size: 11px;
    letter-spacing: 0;
    white-space: nowrap;
  }

  .guide-step-node-check {
    width: 11px;
    height: 11px;
  }

  .guide-step-node-label {
    display: none;
  }

  .guide-walkthrough-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .guide-walkthrough-prev,
  .guide-walkthrough-next {
    width: 100%;
    justify-content: center;
  }
}
