/* ============================================================
   main.css — Oyamori Landing Page
   Mobile-first. No framework. Custom properties throughout.
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Colors */
  --color-bg:       #0a0a0a;
  --color-surface:  #111111;
  --color-border:   #222222;
  --color-text:     #f0f0f0;
  --color-muted:    #888888;
  --color-subtle:   #444444;
  --color-brand:    #D5477F;  /* brand pink — logo, active states */
  --color-newsvibe: #d4a017;  /* Newsvibe amber — signals, badges */
  --color-cta-bg:   #f0f0f0;
  --color-cta-text: #0a0a0a;

  /* Spacing */
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  32px;
  --space-lg:  64px;
  --space-xl:  96px;
  --space-2xl: 128px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-doto: 'Doto', monospace;

  /* Border radius */
  --radius-card:   12px;
  --radius-btn:    6px;
  --radius-code:   8px;
  --radius-pill:   999px;

  /* Transitions — none by design (static precision is the brand) */
}


/* ── Light theme ─────────────────────────────────────────── */
:root[data-theme="light"] {
  --color-bg:       #f5f5f5;
  --color-surface:  #ebebeb;
  --color-border:   #d0d0d0;
  --color-text:     #0a0a0a;
  --color-muted:    #555555;
  --color-subtle:   #b0b0b0;
  --color-cta-bg:   #0a0a0a;
  --color-cta-text: #f0f0f0;
}

:root[data-theme="light"] .course-card,
:root[data-theme="light"] .hub-course-card,
:root[data-theme="light"] .hub-course-list-item {
  background: #e8e8e8;
}

:root[data-theme="light"] .hub-course-list-item__meta {
  color: #444;
}

/* ── System theme — follows OS preference ────────────────── */
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --color-bg:       #f5f5f5;
    --color-surface:  #ebebeb;
    --color-border:   #d0d0d0;
    --color-text:     #0a0a0a;
    --color-muted:    #555555;
    --color-subtle:   #b0b0b0;
    --color-cta-bg:   #0a0a0a;
    --color-cta-text: #f0f0f0;
  }
  :root[data-theme="system"] .course-card,
  :root[data-theme="system"] .hub-course-card,
  :root[data-theme="system"] .hub-course-list-item {
    background: #e8e8e8;
  }
  :root[data-theme="system"] .hub-course-list-item__meta {
    color: #444;
  }
}

/* ── Nav background override for light / system ──────────── */
:root[data-theme="light"] .site-nav,
:root[data-theme="system"] .site-nav {
  background: rgba(245, 245, 245, 0.92);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .site-nav {
    background: rgba(10, 10, 10, 0.92);
  }
}


/* ── Light / system table overrides ─────────────────────── */
:root[data-theme="light"] .article-body tbody td {
  border-bottom-color: #d0d0d0;
}
:root[data-theme="light"] .article-body tbody tr:nth-child(even) td {
  background-color: #e4e4e4;
}
:root[data-theme="light"] .article-body tbody tr:hover td {
  background-color: #dcdcdc;
}
:root[data-theme="light"] .compare-table thead th {
  background: #e0e0e0;
  color: #D5477F;
}
:root[data-theme="light"] .compare-table__key {
  background: #e8e8e8 !important;
  color: #555 !important;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .article-body tbody td {
    border-bottom-color: #d0d0d0;
  }
  :root[data-theme="system"] .article-body tbody tr:nth-child(even) td {
    background-color: #e4e4e4;
  }
  :root[data-theme="system"] .article-body tbody tr:hover td {
    background-color: #dcdcdc;
  }
  :root[data-theme="system"] .compare-table thead th {
    background: #e0e0e0;
    color: #D5477F;
  }
  :root[data-theme="system"] .compare-table__key {
    background: #e8e8e8 !important;
    color: #555 !important;
  }
}


/* ── Light / system: course sidebar + lesson overrides ─────── */
:root[data-theme="light"] .course-sidebar {
  background: #f0f0f0;
}
:root[data-theme="light"] .course-nav-item--locked { color: #999; }
:root[data-theme="light"] .course-nav-item__time { color: #777; }

/* ── Light / system: details (collapse) overrides ───────────── */
:root[data-theme="light"] .article-details__summary:hover {
  background: #dcdcdc;
}

/* ── Light / system: calc widget overrides ──────────────────── */
:root[data-theme="light"] .calc-widget__title {
  background: #e0e0e0;
}

/* ── Light / system: Prism code block overrides ─────────────── */
:root[data-theme="light"] .article-body pre[class*="language-"] {
  background: #e8e8e8;
}
:root[data-theme="light"] .article-body pre[class*="language-"] code {
  color: #1a1a1a;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .course-sidebar { background: #f0f0f0; }
  :root[data-theme="system"] .course-nav-item--locked { color: #999; }
  :root[data-theme="system"] .course-nav-item__time { color: #777; }
  :root[data-theme="system"] .article-details__summary:hover { background: #dcdcdc; }
  :root[data-theme="system"] .calc-widget__title { background: #e0e0e0; }
  :root[data-theme="system"] .article-body pre[class*="language-"] { background: #e8e8e8; }
  :root[data-theme="system"] .article-body pre[class*="language-"] code { color: #1a1a1a; }
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  text-decoration: underline;
}

ul, ol {
  list-style: none;
}

/* ============================================================
   3. TYPOGRAPHY UTILITIES
   ============================================================ */
.label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

section {
  padding: var(--space-lg) 0;
}

/* ============================================================
   5. BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-block;
  background-color: var(--color-cta-bg);
  color: var(--color-cta-text);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-primary:hover {
  background-color: #d8d8d8;
  text-decoration: none;
}

.btn-secondary {
  display: inline-block;
  background-color: transparent;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 11px 24px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.btn-secondary:hover {
  border-color: var(--color-muted);
  text-decoration: none;
}

/* ============================================================
   6. CODE BLOCKS
   ============================================================ */
.code-block {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-code);
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre;
}

.code-block code {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Newsvibe accent: amber left border */
.code-block--newsvibe {
  border-left: 3px solid var(--color-newsvibe);
}

/* ============================================================
   7. SECTION DIVIDERS
   ============================================================ */
.section-rule {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* ============================================================
   8. HERO SECTION
   ============================================================ */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100vh;
  overflow: hidden;
  padding: var(--space-xl) var(--space-sm) 0;
}

.hero__mark {
  margin-bottom: var(--space-md);
}

.hero__mark svg {
  display: block;
  margin: 0 auto;
}
.site-logo--inline {  display: flex;  align-items: center;  justify-content: center;  gap: 12px;  margin-bottom: var(--space-md);}.site-logo__wordmark {  font-family: var(--font-doto);  font-size: 1.25rem;  font-weight: 700;  letter-spacing: 0.15em;  color: var(--color-text);}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--color-text);
  max-width: 800px;
  margin: 0 auto var(--space-sm);
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--color-muted);
  max-width: 620px;
  margin: 0 auto var(--space-md);
  line-height: 1.7;
}

.hero__ctas {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  align-items: center;
  margin-bottom: var(--space-md);
}

.hero__rule {
  width: 100%;
  max-width: 600px;
  border: none;
  border-top: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .hero__ctas {
    flex-direction: row;
    justify-content: center;
    gap: var(--space-sm);
  }
}

/* ============================================================
   9. VALUE PROPOSITION SECTION
   ============================================================ */
.value-prop {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

.value-prop__header {
  margin-bottom: var(--space-md);
}

.value-prop__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.value-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-md);
}

.value-card__icon {
  margin-bottom: var(--space-sm);
  width: 24px;
  height: 24px;
}

.value-card h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.value-card p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.65;
}

.value-card code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  padding: 1px 5px;
  border-radius: 3px;
}

@media (min-width: 768px) {
  .value-prop__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   10. HOW IT WORKS SECTION
   ============================================================ */
.how-it-works {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.how-it-works__header {
  margin-bottom: var(--space-lg);
}

.how-it-works__header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-top: var(--space-xs);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.step {
  position: relative;
}

.step__number {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 400;
  color: var(--color-subtle);
  line-height: 1;
  margin-bottom: var(--space-xs);
  user-select: none;
}

.step h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.step p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.65;
  max-width: 480px;
}

.step__code {
  margin-top: var(--space-md);
}

@media (min-width: 768px) {
  .steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    position: relative;
  }

  .steps::before {
    content: '';
    position: absolute;
    top: 2.5rem;
    left: 16.666%;
    right: 16.666%;
    height: 1px;
    border-top: 1px dashed var(--color-subtle);
    pointer-events: none;
  }
}

/* ============================================================
   11. EDGES GRID SECTION
   ============================================================ */
.edges-grid {
  background-color: var(--color-bg);
}

.edges-grid__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.edges-grid__header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.edges-grid__count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: var(--space-xs);
}

.featured-edges {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.edge-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: var(--space-md);
}

.edge-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.edge-card__badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
}

.edge-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.01em;
}

.edge-card p {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.65;
}

.edges-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.edge-tile {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--color-muted);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  white-space: nowrap;
}

.edges-grid__cta {
  margin-top: var(--space-sm);
}

.edges-grid__cta a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
}

.edges-grid__cta a:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .edges-grid__header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .featured-edges {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   12. NEWSVIBE SECTION
   ============================================================ */
.newsvibe {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.newsvibe__accent-rule {
  width: 40px;
  height: 2px;
  background-color: var(--color-newsvibe);
  margin-bottom: var(--space-md);
  border: none;
}

.newsvibe__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.newsvibe__text h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.newsvibe__text p {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.newsvibe__text p:last-child {
  font-size: 0.875rem;
  color: var(--color-subtle);
  font-style: italic;
}

.newsvibe__text a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.newsvibe__visual {
  flex: none;
}

@media (min-width: 768px) {
  .newsvibe__inner {
    flex-direction: row;
    align-items: flex-start;
  }

  .newsvibe__text {
    flex: 1;
  }

  .newsvibe__visual {
    flex: 1;
    min-width: 0;
  }
}

/* ============================================================
   13. TRUST SECTION
   ============================================================ */
.trust {
  background-color: var(--color-bg);
}

.trust__header {
  margin-bottom: var(--space-lg);
}

.trust__header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-top: var(--space-xs);
}

.trust__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.trust-col__icon {
  width: 24px;
  height: 24px;
  margin-bottom: var(--space-sm);
}

.trust-col h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.trust-col p {
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.65;
}

.trust__philosophy {
  border-left: 2px solid var(--color-border);
  padding-left: var(--space-md);
  margin-top: var(--space-lg);
}

.trust__philosophy blockquote {
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.7;
  font-style: italic;
}

@media (min-width: 768px) {
  .trust__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   14. WAITLIST SECTION
   ============================================================ */
.waitlist {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: var(--space-xl) var(--space-sm);
}

.waitlist__inner {
  max-width: 560px;
  margin: 0 auto;
}

.waitlist h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.waitlist__sub {
  font-size: 1rem;
  color: var(--color-muted);
  line-height: 1.65;
  margin-bottom: var(--space-md);
}

.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.waitlist__input {
  width: 100%;
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1;
  outline: none;
}

.waitlist__input:focus {
  border-color: var(--color-muted);
}

.waitlist__input::placeholder {
  color: var(--color-subtle);
}

.waitlist__form .btn-primary {
  width: 100%;
  padding: 12px 24px;
  font-size: 0.9375rem;
}

.waitlist__fine-print {
  font-size: 0.8125rem;
  color: var(--color-subtle);
}

.waitlist__success {
  display: none;
  padding: var(--space-md);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
}

.waitlist__success.is-visible {
  display: block;
}

.waitlist__success p {
  font-size: 0.9375rem;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.waitlist__success .label {
  font-size: 10px;
  color: var(--color-subtle);
}

.waitlist__error {
  font-size: 0.875rem;
  color: #e05252;
  margin-top: var(--space-xs);
  display: none;
}

.waitlist__error.is-visible {
  display: block;
}

@media (min-width: 560px) {
  .waitlist__form {
    flex-direction: row;
  }

  .waitlist__form .btn-primary {
    width: auto;
    flex-shrink: 0;
  }

  .waitlist__input {
    flex: 1;
  }
}

/* ============================================================
   15. FOOTER
   ============================================================ */
.footer {
  background-color: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0 var(--space-md);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer__brand-mark {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.footer__brand-name {
  font-family: var(--font-doto);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-top: var(--space-xs);
}

.footer__nav-heading {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin-bottom: var(--space-sm);
}

.footer__nav-list li {
  margin-bottom: 10px;
}

.footer__nav-list a {
  font-size: 0.9rem;
  color: var(--color-muted);
  text-decoration: none;
}

.footer__nav-list a:hover {
  color: var(--color-text);
  text-decoration: none;
}

.footer__bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer__copyright {
  font-size: 0.8125rem;
  color: var(--color-subtle);
}

.footer__disclaimer {
  font-size: 0.75rem;
  color: var(--color-subtle);
  line-height: 1.5;
  max-width: 720px;
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-md);
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

/* ============================================================
   16. SECTION HEADING PATTERN (reused across sections)
   ============================================================ */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.section-heading {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

/* ============================================================
   17. RECAPTCHA v3 BADGE
   ============================================================ */
.grecaptcha-badge {
  display: none !important;
}

/* ============================================================
   18. NAVIGATION
   ============================================================ */

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  height: 60px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-text);
}

.logo-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-brand__wordmark {
  font-family: var(--font-doto);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-text);
}

.nav-links {
  display: none;
  list-style: none;
  align-items: center;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-muted);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--color-text);
  text-decoration: none;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  color: var(--color-muted);
  cursor: pointer;
  padding: 6px;
  width: 34px;
  height: 34px;
}

.theme-toggle:hover {
  border-color: var(--color-subtle);
  color: var(--color-text);
}

.theme-icon { display: none; flex-shrink: 0; }

[data-theme="dark"]   .theme-icon[data-theme-icon="dark"],
[data-theme="light"]  .theme-icon[data-theme-icon="light"],
[data-theme="system"] .theme-icon[data-theme-icon="system"] { display: block; }

:root:not([data-theme]) .theme-icon[data-theme-icon="dark"] { display: block; }

.nav-cta { display: none; }

@media (min-width: 768px) {
  .nav-cta { display: inline-flex; }
}

.btn--sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  cursor: pointer;
  padding: 6px 8px;
  width: 38px;
  height: 34px;
}

.burger:hover { border-color: var(--color-subtle); }

.burger__bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--color-text);
  border-radius: 2px;
}

@media (min-width: 768px) {
  .burger { display: none; }
}

.nav-drawer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-drawer[hidden] { display: none; }

.nav-drawer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-drawer__link {
  display: block;
  padding: 10px var(--space-sm);
  font-size: 0.9375rem;
  color: var(--color-muted);
  text-decoration: none;
  border-radius: var(--radius-btn);
}

.nav-drawer__link:hover {
  color: var(--color-text);
  background: var(--color-bg);
  text-decoration: none;
}

.nav-drawer__cta {
  width: 100%;
  text-align: center;
}

body { padding-top: 60px; }

/* ============================================================
   19. HERO BACKGROUND VIDEO
   ============================================================ */

.hero-bg-video {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero__content {
  position: relative;
  z-index: 2;
}

.hero-bg-video iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 177.78vh;
  min-width: 100%;
  height: 56.25vw;
  min-height: 100%;
  border: none;
  opacity: 0.18;
}


/* ============================================================
   20. LEARNING HUB — page layout, hub cards, article grid
   ============================================================ */

/* ── Page wrapper ─────────────────────────────────────────── */

.page-content {
  padding: var(--space-lg) 0 var(--space-2xl);
}


/* ── Page header ──────────────────────────────────────────── */

.page-header {
  margin-bottom: var(--space-lg);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: var(--space-xs) 0 var(--space-sm);
}

.page-header__sub {
  font-size: 1.0625rem;
  color: var(--color-muted);
  max-width: 640px;
  line-height: 1.6;
}

.page-header__meta {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-top: var(--space-xs);
}

/* ── Hub topic cards ──────────────────────────────────────── */

.hub-topics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

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

.hub-topic-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s;
}

.hub-topic-card:hover {
  border-color: var(--color-subtle);
  text-decoration: none;
}

.hub-topic-card__icon {
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
}

.hub-topic-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.hub-topic-card__desc {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.hub-topic-card__meta {
  font-size: 0.8125rem;
  color: var(--color-subtle);
  margin: 0;
  margin-top: 4px;
}

.hub-topic-card:hover .hub-topic-card__meta {
  color: var(--color-muted);
}

/* ── Hero search ──────────────────────────────────────────── */

.hero-search-wrap {
  margin-top: var(--space-sm);
  max-width: 420px;
  position: relative;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 10px var(--space-sm);
  color: var(--color-muted);
  transition: border-color .15s;
}

.hero-search:focus-within {
  border-color: var(--color-subtle);
}

.hero-search__icon {
  flex-shrink: 0;
  opacity: .5;
}

.hero-search__input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  width: 100%;
}

.hero-search__input::placeholder {
  color: var(--color-subtle);
}

.hero-search__clear {
  background: none;
  border: none;
  color: var(--color-subtle);
  cursor: pointer;
  padding: 0 2px;
  font-size: .85rem;
  flex-shrink: 0;
}

.hero-search__clear:hover { color: var(--color-muted); }

.hero-search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #161616;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}

.hero-search__results-meta {
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--color-subtle);
  padding: .6rem 1rem .3rem;
}

.hero-search__results-list {
  list-style: none;
  padding: 0 0 .5rem;
  margin: 0;
}

.hero-search__no-results {
  padding: 1rem;
  font-size: .85rem;
  color: var(--color-subtle);
  text-align: center;
}

/* hide native browser clear button on search inputs */
.hero-search__input::-webkit-search-cancel-button,
.hero-search__input::-webkit-search-decoration { display: none; }

/* ── Search result items ──────────────────────────────────── */

.hero-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 1rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}

.hero-result-item:last-child { border-bottom: none; }

.hero-result-item:hover {
  background: #1a1a1a;
  text-decoration: none;
}

.hero-result-item__left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.hero-result-item__cat {
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-subtle);
}

.hero-result-item__title {
  font-size: .88rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-result-item__right {
  flex-shrink: 0;
}

.hero-result-item__read {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--color-subtle);
  white-space: nowrap;
}

/* ── Hub CTA section ─────────────────────────────────────── */

.hub-cta {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0;
}

.hub-cta__inner {
  max-width: var(--max-w, 1080px);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.hub-cta__label {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 .5rem;
}

.hub-cta__heading {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 1.25rem;
  line-height: 1.2;
}

.hub-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--color-brand, #D5477F);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 600;
  padding: .6rem 1.4rem;
  border-radius: var(--radius-btn);
  transition: opacity .15s;
}

.hub-cta__btn:hover {
  opacity: .85;
  text-decoration: none;
}

/* ── Hub featured cards ───────────────────────────────────── */

.hub-featured {
  margin-bottom: var(--space-md);
}

.hub-featured__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

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

@media (max-width: 540px) {
  .hub-featured__grid { grid-template-columns: 1fr; }
}

.hub-featured__card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s;
}

.hub-featured__card:hover {
  border-color: var(--color-subtle);
  transform: translateY(-2px);
  text-decoration: none;
}

.hub-featured__img {
  width: 100%;
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: #1a1a1a;
}

.hub-featured__body {
  padding: var(--space-sm);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hub-featured__cat {
  font-family: var(--font-mono);
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
}

.hub-featured__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  line-height: 1.35;
}

.hub-featured__desc {
  font-size: .82rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.hub-featured__read {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--color-brand, #D5477F);
  margin-top: 4px;
}

/* ── Hub filter buttons ───────────────────────────────────── */

.hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.hub-filter-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  color: var(--color-muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .06em;
  padding: .3rem .85rem;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}

.hub-filter-btn:hover {
  border-color: var(--color-subtle);
  color: var(--color-text);
}

.hub-filter-btn.active {
  background: var(--color-brand, #D5477F);
  border-color: var(--color-brand, #D5477F);
  color: #fff;
}

/* ── Hub section header (All Articles row) ────────────────── */

.hub-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: var(--space-sm);
}

.hub-article-count {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--color-subtle);
  margin: 0 0 var(--space-sm);
}

/* ── Section divider label ────────────────────────────────── */

.hub-section-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

/* ── Controls: search + view toggle ──────────────────────── */

.hub-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.hub-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  padding: 8px var(--space-sm);
  color: var(--color-muted);
}

.hub-search:focus-within {
  border-color: var(--color-subtle);
}

.hub-search svg {
  flex-shrink: 0;
}

.hub-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  width: 100%;
}

.hub-search input::placeholder {
  color: var(--color-subtle);
}

.hub-view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  color: var(--color-subtle);
  cursor: pointer;
}

.view-btn:hover {
  border-color: var(--color-subtle);
  color: var(--color-muted);
}

.view-btn.is-active {
  border-color: var(--color-muted);
  color: var(--color-text);
}

/* ── Article grid / list ──────────────────────────────────── */

.article-grid[data-view="grid"] {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

@media (max-width: 900px) {
  .article-grid[data-view="grid"] { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .article-grid[data-view="grid"] { grid-template-columns: 1fr; }
}

.article-grid[data-view="list"] {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

/* ── Article card ─────────────────────────────────────────── */

.article-card[hidden] { display: none !important; }

.article-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s;
}

.article-card:hover {
  border-color: var(--color-subtle);
  text-decoration: none;
}

.article-grid[data-view="list"] .article-card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  flex-direction: row;
  align-items: baseline;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

.article-grid[data-view="list"] .article-card:last-child {
  border-bottom: none;
}

.article-card__category {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0;
}

.article-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin: 0;
}

.article-card:hover .article-card__title {
  color: var(--color-text);
}

.article-card__desc {
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.article-grid[data-view="list"] .article-card__desc {
  display: none;
}

.article-card__meta {
  display: flex;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--color-subtle);
  margin-top: auto;
}

.article-grid[data-view="list"] .article-card__meta {
  margin-top: 0;
  margin-left: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

.hub-no-results {
  color: var(--color-muted);
  font-size: 0.9375rem;
  padding: var(--space-md) 0;
}

/* ── Sub-hub page header ──────────────────────────────────── */

.sub-hub-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.sub-hub-header__back {
  display: inline-block;
  font-size: 0.8125rem;
  color: var(--color-muted);
  text-decoration: none;
  margin-bottom: var(--space-sm);
}

.sub-hub-header__back:hover { color: var(--color-text); }

/* ── Article breadcrumb ───────────────────────────────────── */

.article-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #555;
  margin: 0 0 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #1a1a1a;
}
.article-breadcrumb a {
  color: #777;
  text-decoration: none;
  transition: color 0.15s;
}
.article-breadcrumb a:hover { color: var(--color-brand); }
.article-breadcrumb__sep { color: #333; font-size: 0.6rem; }
.article-breadcrumb__cat { font-weight: 500; }
.article-breadcrumb__current {
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}

/* ── Article page ─────────────────────────────────────────── */

.article-body {
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text);
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: var(--space-md) 0 var(--space-sm);
  color: #D5477F;
}

.article-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: var(--space-sm) 0 var(--space-xs);
  color: var(--color-text);
}

.article-body p {
  margin-bottom: var(--space-sm);
}

.article-body ul {
  list-style-type: disc;
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

.article-body ol {
  list-style-type: decimal;
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

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

.article-body a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--color-muted);
}

.article-body strong {
  font-weight: 600;
  color: var(--color-text);
}

.article-body em {
  font-style: italic;
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-md) 0;
}

.article-body blockquote {
  border-left: 3px solid var(--color-subtle);
  padding: var(--space-xs) var(--space-sm);
  background-color: #111111;
  border-radius: 0 var(--radius-btn) var(--radius-btn) 0;
  color: var(--color-muted);
  margin: var(--space-sm) 0;
  font-style: italic;
}


/* ── Article body: missing element styles ─────────────────── */

/* h1 inside markdown (defensive; most articles start at h2) */
.article-body h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--color-text);
  line-height: 1.2;
}

/* h4–h6 */
.article-body h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: var(--space-sm) 0 var(--space-xs);
  color: var(--color-text);
}

.article-body h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: var(--space-sm) 0 var(--space-xs);
  color: var(--color-muted);
}

.article-body h6 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: var(--space-sm) 0 var(--space-xs);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Inline code */
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: #161616;
  color: var(--color-brand);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  white-space: nowrap;
}

/* Fenced / indented code blocks */
.article-body pre {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-code);
  padding: 12px 16px;
  overflow-x: auto;
  margin: var(--space-sm) 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre;
}

/* Reset inline-code overrides inside a pre block */
.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  white-space: inherit;

}

/* ── Prism syntax highlighting overrides ────────────────────── */
/* Tune Prism Tomorrow theme to fit dark site (#0a0a0a bg) */
.article-body pre[class*="language-"] {
  background: #161616;
  border-color: #2a2a2a;
  margin: 1.5rem 0;
  padding: 14px 18px;
  font-size: 0.8125rem;
  line-height: 1.5;
  tab-size: 2;
}
.article-body pre[class*="language-"] code {
  color: #ccc;
  text-shadow: none;
}
/* Language label badge */
.article-body pre[class*="language-"] {
  position: relative;
}
.article-body pre[class*="language-"]::before {
  content: attr(data-language);
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}
/* Inline code — keep distinct from syntax blocks */
.article-body :not(pre) > code {
  background: #1a1a1a;
  color: #e2b96f;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82em;
  font-family: var(--font-mono);
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  margin: var(--space-sm) 0;
  display: block;
  overflow-x: auto;
}

.article-body thead th {
  background-color: var(--color-surface);
  color: var(--color-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.article-body tbody td {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid #1a1a1a;
  color: var(--color-muted);
  vertical-align: top;
  line-height: 1.5;
}

.article-body tbody tr:nth-child(even) td {
  background-color: #111111;
}

.article-body tbody tr:hover td {
  background-color: #161616;
}



/* Images inside article */
.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-sm) 0;
  border-radius: var(--radius-btn);
}

/* Nested lists */
.article-body ul ul,
.article-body ol ol,
.article-body ul ol,
.article-body ol ul {
  margin-top: 4px;
  margin-bottom: 4px;
  padding-left: var(--space-md);
}

.article-footer {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.article-back {
  font-size: 0.875rem;
  color: var(--color-muted);
  text-decoration: none;
}

.article-back:hover {
  color: var(--color-text);
  text-decoration: none;
}

/* ── Nav brand hover — no underline, brand pink on wordmark ── */

.nav-brand:hover {
  text-decoration: none;
}

.nav-brand:hover .nav-brand__wordmark {
  color: var(--color-brand);
}

/* ── Nav active states ────────────────────────────────────── */

.nav-link.is-active {
  color: var(--color-brand);
  font-weight: 600;
}

.nav-link.is-active:hover {
  color: var(--color-brand);
}

.nav-drawer__link.is-active {
  color: var(--color-text);
  background: var(--color-bg);
  font-weight: 600;
}

.nav-drawer__link.is-active::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--color-brand);
  border-radius: 2px;
  margin-right: 8px;
  vertical-align: middle;
}

/* ─── Signal Portal ─── */

/* Page wrapper */
.sp-page { max-width:1080px; margin:0 auto; padding:2.5rem 1.5rem 4rem; }

/* Page header */
.sp-header { display:flex; justify-content:space-between; align-items:flex-end; margin-bottom:2rem; flex-wrap:wrap; gap:1rem; }
.sp-header__left {}
.sp-header__title { font-family:'JetBrains Mono',monospace; font-size:1.05rem; font-weight:700; color:#fff; letter-spacing:.06em; text-transform:uppercase; margin:0 0 .3rem; }
.sp-header__meta { font-size:.78rem; color:#555; font-family:'JetBrains Mono',monospace; }
.sp-date-form {}
.sp-date-select { appearance:none; -webkit-appearance:none; background:#111 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23666' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right .75rem center; border:1px solid #2a2a2a; color:#ccc; padding:.4rem 2.2rem .4rem .9rem; border-radius:6px; font-family:'JetBrains Mono',monospace; font-size:.82rem; cursor:pointer; transition:border-color .15s; }
.sp-date-select:focus { outline:none; border-color:#D5477F; }

/* Column labels */
.sp-col-labels { display:grid; grid-template-columns:120px 1fr 80px 120px 1fr; gap:1rem; align-items:center; padding:.4rem 1.2rem; margin-bottom:.25rem; }
.sp-col-label { font-family:'JetBrains Mono',monospace; font-size:.65rem; color:#3a3a3a; letter-spacing:.12em; text-transform:uppercase; }

/* Row */
.sp-row { display:grid; grid-template-columns:120px 1fr 80px 120px 1fr; gap:1rem; align-items:center; padding:.9rem 1.2rem; border:1px solid #1a1a1a; border-radius:8px; margin-bottom:.5rem; text-decoration:none; color:inherit; transition:border-color .2s, background .2s; position:relative; overflow:hidden; }
.sp-row::before { content:''; position:absolute; left:0; top:0; bottom:0; width:3px; background:transparent; transition:background .2s; }
.sp-row:hover { background:#0e0e0e; border-color:#2a2a2a; text-decoration:none; }
.sp-row:hover::before { background:var(--color-brand,#D5477F); }
.sp-row--buy::before { background:#10b98122; }
.sp-row--buy:hover::before { background:#10b981; }
.sp-row--watch::before { background:#f59e0b22; }
.sp-row--watch:hover::before { background:#f59e0b; }
.sp-row--skip::before, .sp-row--dimmed::before { background:transparent; }
.sp-row--dimmed { opacity:.35; pointer-events:none; }

/* Symbol cell */
.sp-symbol { font-family:'JetBrains Mono',monospace; font-weight:700; font-size:1rem; color:#fff; line-height:1; }
.sp-company { font-size:.72rem; color:#555; margin-top:.3rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* Bar cell */
.sp-bar-cell {}
.sp-bar-track { height:5px; background:#1c1c1c; border-radius:3px; overflow:hidden; margin-bottom:.4rem; }
.sp-bar-fill { height:100%; border-radius:3px; transition:width .4s ease; }
.sp-bar-fill--buy   { background:linear-gradient(90deg,#0d8f63,#10b981); }
.sp-bar-fill--watch { background:linear-gradient(90deg,#b57d0e,#f59e0b); }
.sp-bar-fill--skip  { background:#2a2a2a; }

/* Score cell */
.sp-score { font-family:'JetBrains Mono',monospace; font-size:1.4rem; font-weight:700; color:#fff; line-height:1; text-align:center; }
.sp-score--muted { color:#444; }

/* Verdict cell */
.sp-verdict { display:inline-flex; align-items:center; gap:.4rem; padding:.3rem .75rem; border-radius:20px; border:1px solid; font-size:.72rem; font-family:'JetBrains Mono',monospace; font-weight:700; letter-spacing:.08em; text-transform:uppercase; white-space:nowrap; }
.sp-verdict--buy   { color:#10b981; border-color:#10b98155; background:#10b98108; }
.sp-verdict--watch { color:#f59e0b; border-color:#f59e0b55; background:#f59e0b08; }
.sp-verdict--skip  { color:#ef4444; border-color:#ef444455; background:#ef444408; }

/* Note cell */
.sp-note { font-size:.76rem; color:#555; font-family:'JetBrains Mono',monospace; line-height:1.4; }

/* Section separator */
.sp-section-sep { display:flex; align-items:center; gap:.75rem; margin:1.5rem 0 .75rem; }
.sp-section-sep__line { flex:1; height:1px; background:#1a1a1a; }
.sp-section-sep__label { font-family:'JetBrains Mono',monospace; font-size:.65rem; color:#3a3a3a; letter-spacing:.12em; text-transform:uppercase; white-space:nowrap; }

/* Empty state */
.sp-empty { padding:3rem 1rem; text-align:center; font-family:'JetBrains Mono',monospace; font-size:.85rem; color:#444; }

/* ─── Signal Detail Page ─── */

.sd-page { max-width:800px; margin:0 auto; padding:2rem 1.5rem 5rem; }

/* Back link */
.sd-back { display:inline-flex; align-items:center; gap:.4rem; color:#D5477F; font-family:'JetBrains Mono',monospace; font-size:.78rem; text-decoration:none; margin-bottom:2rem; opacity:.8; transition:opacity .15s; }
.sd-back:hover { opacity:1; text-decoration:none; }

/* Hero card */
.sd-hero { background:#0e0e0e; border:1px solid #1e1e1e; border-radius:12px; padding:2rem; margin-bottom:1.5rem; position:relative; overflow:hidden; }
.sd-hero::before { content:''; position:absolute; top:0; left:0; right:0; height:2px; background:linear-gradient(90deg,transparent,var(--color-brand,#D5477F),transparent); }
.sd-hero__top { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:1rem; margin-bottom:1.5rem; }
.sd-hero__company { font-size:.75rem; color:#555; letter-spacing:.1em; text-transform:uppercase; font-family:'JetBrains Mono',monospace; margin-bottom:.35rem; }
.sd-hero__title { font-size:1.6rem; font-weight:700; color:#fff; line-height:1.2; margin:0; }
.sd-hero__price { font-family:'JetBrains Mono',monospace; font-size:.85rem; color:#888; margin-top:.3rem; }
.sd-hero__right { text-align:right; }
.sd-hero__score-num { font-family:'JetBrains Mono',monospace; font-size:3.5rem; font-weight:700; color:#fff; line-height:1; }
.sd-hero__score-denom { font-family:'JetBrains Mono',monospace; font-size:.85rem; color:#444; }
.sd-hero__verdict { margin-top:.5rem; display:flex; justify-content:flex-end; gap:.5rem; flex-wrap:wrap; }
.sd-hero__bottom { display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.sd-hero__date { font-family:'JetBrains Mono',monospace; font-size:.75rem; color:#444; }

/* Verdict badge */
.sd-badge { display:inline-flex; align-items:center; gap:.35rem; padding:.3rem .85rem; border-radius:20px; border:1px solid; font-size:.75rem; font-family:'JetBrains Mono',monospace; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.sd-badge--buy   { color:#10b981; border-color:#10b98155; background:#10b98110; }
.sd-badge--watch { color:#f59e0b; border-color:#f59e0b55; background:#f59e0b10; }
.sd-badge--skip  { color:#ef4444; border-color:#ef444455; background:#ef444410; }

/* Score bar on hero */
.sd-hero__bar-track { height:4px; background:#1c1c1c; border-radius:2px; overflow:hidden; margin-top:1.25rem; }
.sd-hero__bar-fill { height:100%; border-radius:2px; }
.sd-hero__bar-fill--buy   { background:linear-gradient(90deg,#0d8f63,#10b981); }
.sd-hero__bar-fill--watch { background:linear-gradient(90deg,#b57d0e,#f59e0b); }
.sd-hero__bar-fill--skip  { background:#2a2a2a; }

/* Sections */
.sd-section { margin-bottom:1.25rem; }
.sd-section__title { font-family:'JetBrains Mono',monospace; font-size:.65rem; color:#444; letter-spacing:.14em; text-transform:uppercase; margin-bottom:.75rem; padding-bottom:.5rem; border-bottom:1px solid #1a1a1a; }

/* Gates row */
.sd-gates { display:flex; flex-wrap:wrap; gap:.5rem; }
.sd-gate-pill { display:inline-flex; align-items:center; gap:.4rem; padding:.3rem .85rem; border-radius:20px; border:1px solid; font-size:.75rem; font-family:'JetBrains Mono',monospace; }
.sd-gate-pill--pass { color:#10b981; border-color:#10b98133; background:#10b98108; }
.sd-gate-pill--fail { color:#ef4444; border-color:#ef444433; background:#ef444408; }

/* Report markdown styling */
.sd-report { background:#0a0a0a; border:1px solid #1a1a1a; border-radius:10px; padding:1.5rem; }
.sd-report h1 { font-size:1.1rem; color:#fff; margin:.5rem 0 1rem; border-bottom:1px solid #1e1e1e; padding-bottom:.75rem; }
.sd-report h2 { font-family:'JetBrains Mono',monospace; font-size:.7rem; color:#555; letter-spacing:.12em; text-transform:uppercase; margin:1.5rem 0 .75rem; }
.sd-report h3 { font-size:.9rem; color:#ccc; margin:1rem 0 .5rem; }
.sd-report p { font-size:.88rem; color:#888; line-height:1.75; margin-bottom:.75rem; }
.sd-report em { color:#666; font-style:italic; }
.sd-report strong { color:#ccc; font-weight:600; }
.sd-report table { width:100%; border-collapse:collapse; font-family:'JetBrains Mono',monospace; font-size:.78rem; margin:1rem 0; }
.sd-report thead th { color:#555; font-size:.65rem; letter-spacing:.1em; text-transform:uppercase; text-align:left; padding:.4rem .75rem; border-bottom:1px solid #1e1e1e; }
.sd-report tbody td { padding:.5rem .75rem; border-bottom:1px solid #111; color:#888; }
.sd-report tbody tr:hover td { background:#0f0f0f; color:#aaa; }
.sd-report ul, .sd-report ol { padding-left:1.25rem; margin:.5rem 0 .75rem; }
.sd-report li { font-size:.88rem; color:#888; line-height:1.75; margin-bottom:.25rem; }
.sd-report li strong { color:#ccc; }
.sd-report code { font-family:'JetBrains Mono',monospace; font-size:.82rem; background:#161616; padding:.1em .35em; border-radius:3px; color:#D5477F; }
.sd-report blockquote { border-left:3px solid #D5477F; padding:.5rem 1rem; margin:1rem 0; background:#0f0f0f; border-radius:0 6px 6px 0; }

/* History */
.sd-history { background:#0a0a0a; border:1px solid #1a1a1a; border-radius:10px; overflow:hidden; }
.sd-history__row { display:flex; align-items:center; gap:1rem; padding:.7rem 1.2rem; border-bottom:1px solid #111; font-family:'JetBrains Mono',monospace; font-size:.78rem; color:#555; transition:background .15s; }
.sd-history__row:last-child { border-bottom:none; }
.sd-history__row:hover { background:#0f0f0f; }
.sd-history__date { min-width:90px; color:#666; }
.sd-history__score { min-width:45px; color:#888; font-weight:600; }
.sd-history__note { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#444; }
.sd-history__link { color:#3a3a3a; text-decoration:none; transition:color .15s; white-space:nowrap; }
.sd-history__link:hover { color:#D5477F; text-decoration:none; }

/* Responsive */
@media (max-width:768px) {
  .sp-col-labels { display:none; }
  .sp-row { grid-template-columns:90px 1fr 65px; }
  .sp-row > .sp-note { display:none; }
  .sd-hero__score-num { font-size:2.5rem; }
  .sd-hero { padding:1.5rem; }
  .sd-report table { font-size:.72rem; }
  .sd-history__note { display:none; }
}

/* ─── Signal Portal: Ticker Logos ─── */
.sp-symbol-cell { display:flex; align-items:center; gap:.6rem; }
.sp-logo { width:28px; height:28px; border-radius:50%; object-fit:cover; flex-shrink:0; background:#111; }
.sd-hero__left { display:flex; align-items:flex-start; gap:1rem; }
.sd-logo { width:48px; height:48px; border-radius:50%; object-fit:cover; flex-shrink:0; background:#111; margin-top:.15rem; }

/* ─── Signal Timeline ─── */
.tl-page { max-width:740px; margin:0 auto; padding:2rem var(--space-md,1.5rem) 4rem; }
.tl-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:2rem; flex-wrap:wrap; }
.tl-header__title { font-size:1.1rem; font-weight:700; color:#fff; margin-bottom:.3rem; }
.tl-header__meta { font-family:'JetBrains Mono',monospace; font-size:.75rem; color:#555; }
.tl-date-sep { display:flex; align-items:center; gap:.75rem; margin:1.75rem 0 .75rem; }
.tl-date-sep__line { flex:1; height:1px; background:#1a1a1a; }
.tl-date-sep__label { font-family:'JetBrains Mono',monospace; font-size:.65rem; color:#3a3a3a; letter-spacing:.08em; white-space:nowrap; }
.tl-run { background:#0d0d0d; border:1px solid #1a1a1a; border-radius:10px; padding:1rem 1.25rem; margin-bottom:.6rem; transition:border-color .15s; }
.tl-run:hover { border-color:#2a2a2a; }
.tl-run__meta { display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; margin-bottom:.6rem; }
.tl-run__time { font-family:'JetBrains Mono',monospace; font-size:.72rem; color:#3a3a3a; min-width:38px; }
.tl-run__name { font-family:'JetBrains Mono',monospace; font-size:.85rem; color:#D5477F; text-decoration:none; font-weight:600; letter-spacing:.01em; }
.tl-run__name:hover { color:#e05a8a; }
.tl-run__counts { font-family:'JetBrains Mono',monospace; font-size:.7rem; color:#444; margin-left:auto; }
.tl-run__counts-buy { color:#10b981; }
.tl-run__counts-watch { color:#f59e0b; }
.tl-chips { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; }
.tl-chip { display:inline-flex; align-items:center; gap:.3rem; padding:.2rem .6rem; border-radius:20px; font-family:'JetBrains Mono',monospace; font-size:.72rem; font-weight:600; text-decoration:none; border:1px solid; transition:background .15s; }
.tl-chip--buy { color:#10b981; border-color:#10b98133; background:#10b98108; }
.tl-chip--buy:hover { background:#10b98120; }
.tl-chip--watch { color:#f59e0b; border-color:#f59e0b33; background:#f59e0b08; }
.tl-chip--watch:hover { background:#f59e0b20; }
.tl-chip-score { opacity:.65; font-weight:400; }
.tl-chip-sep { color:#2a2a2a; font-size:.9rem; padding:0 .1rem; user-select:none; }
.tl-chip-more { font-family:'JetBrains Mono',monospace; font-size:.68rem; color:#3a3a3a; text-decoration:none; padding:.2rem .5rem; border-radius:20px; border:1px solid #222; transition:color .15s,border-color .15s; }
.tl-chip-more:hover { color:#888; border-color:#333; }
.tl-empty { text-align:center; padding:5rem 1rem; font-family:'JetBrains Mono',monospace; font-size:.85rem; color:#444; }
.tl-empty code { color:#D5477F; background:#1a1a1a; padding:.15em .45em; border-radius:4px; }

/* Universe portal extras */
.sp-univ-back { display:inline-flex; align-items:center; gap:.4rem; font-family:'JetBrains Mono',monospace; font-size:.72rem; color:#555; text-decoration:none; margin-bottom:1.5rem; transition:color .15s; }
.sp-univ-back:hover { color:#D5477F; }
.sp-univ-tag { display:inline-flex; align-items:center; font-family:'JetBrains Mono',monospace; font-size:.6rem; color:#555; background:#111; border:1px solid #1e1e1e; border-radius:20px; padding:.15rem .55rem; margin-left:.5rem; letter-spacing:.08em; text-transform:uppercase; vertical-align:middle; }

/* History universe badge */
.sd-history__univ { font-family:'JetBrains Mono',monospace; font-size:.62rem; color:#3a3a3a; background:#111; border:1px solid #1e1e1e; border-radius:20px; padding:.1rem .45rem; white-space:nowrap; }

@media (max-width:600px) {
  .tl-run__counts { margin-left:0; width:100%; margin-top:.3rem; }
  .tl-chip-score { display:none; }
}

/* ── Related Articles section ─────────────────────────────── */

.related-articles {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

.related-articles__inner {
  max-width: 720px;
}

.related-articles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.related-article-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s, transform 0.15s;
}

.related-article-card:hover {
  border-color: var(--color-subtle);
  text-decoration: none;
  transform: translateY(-1px);
}

.related-article-card__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
  margin: 0;
}

.related-article-card:hover .related-article-card__title {
  color: var(--color-text);
}

.related-article-card__desc {
  font-size: 0.8125rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-article-card .article-card__readtime {
  font-size: 0.75rem;
  color: #10b981;
  margin-top: auto;
}

@media (max-width: 768px) {
  .related-articles__grid {
    grid-template-columns: 1fr;
  }
}

/* ── Article hero image ─────────────────────────────────────── */
.article-hero-image {
  margin: var(--space-md) 0 var(--space-lg);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.article-hero-image img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}
.article-hero-image__credit {
  font-size: 0.6875rem;
  color: var(--color-muted);
  text-align: right;
  padding: 4px 8px;
  background: rgba(0,0,0,0.4);
  margin: 0;
}

/* ── Hub card thumbnail ─────────────────────────────────────── */
.article-card__image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: var(--radius-btn) var(--radius-btn) 0 0;
  margin: calc(-1 * var(--space-sm)) calc(-1 * var(--space-sm)) var(--space-xs);
}
.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: transform 0.3s ease;
}
.article-card:hover .article-card__image img {
  transform: scale(1.04);
}

/* ── Article hero image ─────────────────────────────────────── */
.article-hero-image {
  margin: var(--space-md) 0 var(--space-lg);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.article-hero-image img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}
.article-hero-image__credit {
  font-size: 0.6875rem;
  color: var(--color-muted);
  text-align: right;
  padding: 4px 8px;
  background: rgba(0,0,0,0.4);
  margin: 0;
}

/* ── Hub card thumbnail ─────────────────────────────────────── */
.article-card__image {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: var(--radius-btn) var(--radius-btn) 0 0;
  margin: calc(-1 * var(--space-sm)) calc(-1 * var(--space-sm)) var(--space-xs);
}
.article-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  transition: transform 0.3s ease;
}
.article-card:hover .article-card__image img {
  transform: scale(1.04);
}

.article-card__image { display: none; }

/* ── Callout blocks ─────────────────────────────────────────── */
.callout {
  border-left: 4px solid;
  border-radius: 4px;
  margin: 1.75rem 0;
  overflow: hidden;
}
.callout__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  opacity: 0.9;
}
.callout__body {
  padding: 10px 14px 12px;
  font-size: 0.92rem;
  line-height: 1.6;
}
.callout--tip {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}
.callout--tip .callout__label {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}
.callout--warning {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
.callout--warning .callout__label {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}
.callout--danger {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}
.callout--danger .callout__label {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}
.callout--info {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}
.callout--info .callout__label {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
}

/* ── Collapsible / details blocks ───────────────────────────── */
.article-details {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  margin: 1.5rem 0;
  overflow: hidden;
}
.article-details__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  user-select: none;
  list-style: none;
  transition: background 0.15s;
}
.article-details__summary::-webkit-details-marker { display: none; }
.article-details__summary::before {
  content: '▶';
  font-size: 0.6rem;
  color: var(--color-muted, #666);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.article-details[open] .article-details__summary::before {
  transform: rotate(90deg);
}
.article-details__summary:hover {
  background: #1a1a1a;
}
.article-details__body {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--color-border);
  font-size: 0.92rem;
  line-height: 1.65;
}
.article-details__body > *:first-child { margin-top: 0; }
.article-details__body > *:last-child  { margin-bottom: 0; }

/* ── Interactive calculators ────────────────────────────────── */
.calc-widget {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.75rem 0;
}
.calc-widget__title {
  background: #161616;
  padding: 11px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #D5477F;
  border-bottom: 1px solid var(--color-border);
}
.calc-widget__body {
  padding: 18px 16px 20px;
}
.calc-widget__fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.calc-field__label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666;
  margin-bottom: 5px;
}
.calc-field__input {
  width: 100%;
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.calc-field__input:focus {
  outline: none;
  border-color: #D5477F;
}
.calc-widget__btn {
  background: #D5477F;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 9px 22px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.calc-widget__btn:hover { background: #c03a6e; }
.calc-widget__result {
  margin-top: 16px;
  min-height: 0;
}
.calc-result-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.calc-result-item {
  flex: 1 1 110px;
  background: #111;
  border: 1px solid #222;
  border-radius: 6px;
  padding: 12px 10px;
  text-align: center;
}
.calc-result-val {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #D5477F;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.calc-result-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  margin-top: 5px;
}
.calc-error {
  font-size: 0.85rem;
  color: #ef4444;
}
.calc-warning {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #f59e0b;
  padding: 8px 12px;
  background: rgba(245,158,11,0.08);
  border-radius: 4px;
  border-left: 3px solid #f59e0b;
}

/* ── Comparison table ───────────────────────────────────────── */
.compare-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.compare-table thead th {
  padding: 11px 14px;
  background: #161616;
  color: #D5477F;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: left;
  border-bottom: 2px solid #D5477F;
  white-space: nowrap;
}
.compare-table thead th.compare-table__keycol {
  color: transparent;
  border-bottom-color: var(--color-border);
  min-width: 120px;
}
.compare-table tbody tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}
.compare-table tbody tr:hover td {
  background: rgba(213,71,127,0.05);
}
.compare-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  color: var(--color-text);
  line-height: 1.4;
}
.compare-table tbody tr:last-child td {
  border-bottom: none;
}
.compare-table__key {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888 !important;
  white-space: nowrap;
  background: #111 !important;
}
.compare-table__empty {
  color: #444 !important;
}

/* ── KaTeX math blocks ──────────────────────────────────────── */
.katex-block {
  display: block;
  text-align: center;
  margin: 1.75rem 0;
  padding: 18px 16px;
  background: #0f0f14;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow-x: auto;
}
.katex-inline {
  display: inline;
}
.katex-block .katex,
.katex-inline .katex {
  color: #e2e2e2;
  font-size: 1.1em;
}
.katex-block .katex { font-size: 1.2em; }

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.75rem 0;
}
.tabs__nav {
  display: flex;
  overflow-x: auto;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: none;
}
.tabs__nav::-webkit-scrollbar { display: none; }
.tabs__btn {
  flex-shrink: 0;
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-muted, #666);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.tabs__btn:hover { color: var(--color-text); }
.tabs__btn--active {
  color: #D5477F;
  border-bottom-color: #D5477F;
}
.tabs__panel {
  padding: 18px 20px;
  font-size: 0.92rem;
  line-height: 1.65;
}
.tabs__panel[hidden] { display: none; }
.tabs__panel > *:first-child { margin-top: 0; }
.tabs__panel > *:last-child  { margin-bottom: 0; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 1.75rem 0;
}
.stat-card {
  flex: 1 1 130px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px 14px 14px;
  text-align: center;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.stat-card__value {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.4;
  font-family: var(--font-mono);
  overflow-wrap: break-word;
  word-break: break-word;
  flex: 1;
}
.stat-card__label {
  font-size: 0.7rem;
  color: var(--color-muted, #666);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin-top: auto;
  padding-top: 8px;
}
@media (max-width: 480px) {
  .stat-card { flex: 1 1 calc(50% - 6px); }
}

/* ── Mermaid diagram blocks ─────────────────────────────────── */
.mermaid-wrap {
  margin: 1.75rem 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #0f0f14;
  padding: 24px 16px;
  text-align: center;
}
.mermaid-wrap .mermaid {
  display: inline-block;
  max-width: 100%;
}
/* Force dark bg on Mermaid SVG output */
.mermaid-wrap svg {
  max-width: 100%;
  height: auto;
  background: transparent !important;
}
.mermaid-wrap .mermaid > svg {
  border-radius: 4px;
}

/* ============================================================
   COURSES — Oyamori Learning
   ============================================================ */

/* Course grid (index page) */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.course-card {
  background: #0f0f14;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s;
}
.course-card:hover { border-color: #D5477F; }

.course-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.course-card__icon { font-size: 2rem; line-height: 1; }

.course-card__badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
}
.course-card__badge--free { background: rgba(16,185,129,0.15); color: #10b981; }
.course-card__badge--pro  { background: rgba(213,71,127,0.15); color: #D5477F; }

.course-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.course-card__desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}
.course-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}
.course-card__dots { display: flex; gap: 4px; }
.course-dot { font-size: 0.6rem; color: #444; transition: color 0.15s; }
.course-dot.dot--done { color: #D5477F; }

.course-card__cta {
  display: block;
  text-align: center;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(213,71,127,0.12);
  color: #D5477F;
  border: 1px solid rgba(213,71,127,0.3);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  margin-top: auto;
}
.course-card__cta:hover { background: rgba(213,71,127,0.22); border-color: #D5477F; }

/* Course breadcrumb */
.course-breadcrumb {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}
.course-breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.course-breadcrumb a:hover { color: #D5477F; }

/* Course landing */
.course-landing__header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 40px;
}
.course-landing__icon { font-size: 3rem; line-height: 1; flex-shrink: 0; }
.course-landing__title { font-size: 1.8rem; font-weight: 700; margin: 8px 0 8px; }
.course-landing__desc { color: var(--color-text-muted); font-size: 1rem; line-height: 1.7; margin: 0 0 8px; }
.course-landing__meta { font-size: 0.8rem; color: #888; margin: 0; }

.course-lesson-list { margin-bottom: 40px; }
.course-lesson-list__title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #888; margin-bottom: 12px; }

.course-lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  transition: background 0.12s;
}
.course-lesson-row:first-of-type { border-top: 1px solid var(--color-border); }
.course-lesson-row:hover:not(.course-lesson-row--locked) { background: rgba(213,71,127,0.05); }
.course-lesson-row--locked { color: #555; cursor: default; }
.course-lesson-row__num { min-width: 24px; font-weight: 700; color: #D5477F; font-size: 0.8rem; }
.course-lesson-row--locked .course-lesson-row__num { color: #555; }
.course-lesson-row__title { flex: 1; }
.course-lesson-row__time { color: #666; font-size: 0.75rem; }
.course-lesson-row__lock-label { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em; color: #D5477F; background: rgba(213,71,127,0.12); padding: 2px 6px; border-radius: 3px; }

.course-paywall-cta {
  background: linear-gradient(135deg, rgba(213,71,127,0.1), rgba(99,102,241,0.07));
  border: 1px solid rgba(213,71,127,0.25);
  border-radius: 10px;
  padding: 28px 32px;
  text-align: center;
}
.course-paywall-cta p { color: var(--color-text-muted); margin: 0 0 16px; }
.course-paywall-cta__btn {
  display: inline-block;
  padding: 12px 28px;
  background: #D5477F;
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}
.course-paywall-cta__btn:hover { background: #c03870; }

/* ── Course Lesson Layout (two-column) ── */
.course-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.course-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  background: #09090d;
  border-right: 1px solid var(--color-border);
  position: sticky;
  top: var(--nav-height, 60px);
  height: calc(100vh - var(--nav-height, 60px));
  overflow-y: auto;
  padding: 24px 0;
}
.course-sidebar__header { padding: 0 16px 16px; border-bottom: 1px solid var(--color-border); margin-bottom: 8px; }
.course-sidebar__back { font-size: 0.8rem; color: #888; text-decoration: none; display: block; }
.course-sidebar__back:hover { color: #D5477F; }

.course-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  border-left: 3px solid transparent;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.course-nav-item:hover { background: rgba(213,71,127,0.06); color: var(--color-text); }
.course-nav-item--active { border-left-color: #D5477F; color: var(--color-text); background: rgba(213,71,127,0.07); font-weight: 600; }
.course-nav-item--locked { color: #444; cursor: default; }
.course-nav-item__icon { flex-shrink: 0; min-width: 18px; font-size: 0.8rem; padding-top: 1px; }
.course-nav-item__label { flex: 1; }
.course-nav-item__time { font-size: 0.7rem; color: #555; flex-shrink: 0; margin-top: 1px; }

.progress-check--done { color: #D5477F; }

.course-mobile-bar { display: none; }

.course-content {
  grid-column: 2;
  grid-row: 1 / -1;
  padding: 40px 48px 80px;
  max-width: 780px;
}

.course-content__meta {
  font-size: 0.78rem;
  color: #666;
  margin-bottom: 24px;
}
.course-content__meta a { color: #888; text-decoration: none; }
.course-content__meta a:hover { color: #D5477F; }

.course-content__lesson-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #D5477F;
  margin: 0 0 8px;
}
.course-content__title { font-size: 2rem; font-weight: 700; margin: 0 0 8px; line-height: 1.2; }
.course-content__reading-time { font-size: 0.8rem; color: #666; margin: 0 0 40px; }

.course-article-body { /* inherits .article-body styles */
  max-width: 720px;
  margin: 0 auto;
}



/* Lock wall */
.course-lock-wall {
  text-align: center;
  padding: 80px 32px;
  background: linear-gradient(135deg, rgba(213,71,127,0.06), rgba(0,0,0,0));
  border: 1px solid rgba(213,71,127,0.15);
  border-radius: 12px;
  margin-top: 40px;
}
.course-lock-wall__icon { font-size: 3rem; margin-bottom: 16px; }
.course-lock-wall__title { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; }
.course-lock-wall__desc { color: var(--color-text-muted); max-width: 400px; margin: 0 auto 24px; line-height: 1.7; }
.course-lock-wall__btn {
  display: inline-block;
  padding: 13px 32px;
  background: #D5477F;
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
}
.course-lock-wall__btn:hover { background: #c03870; }
.course-lock-wall__back { display: block; margin-top: 16px; font-size: 0.85rem; color: #888; text-decoration: none; }
.course-lock-wall__back:hover { color: #D5477F; }

/* Nav footer */
.course-nav-footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.course-nav-footer__nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.course-complete-btn {
  align-self: flex-start;
  padding: 9px 20px;
  background: transparent;
  border: 1px solid rgba(16,185,129,0.4);
  color: #10b981;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.course-complete-btn:hover { background: rgba(16,185,129,0.08); border-color: #10b981; }
.course-complete-btn--done { background: rgba(16,185,129,0.12); border-color: #10b981; cursor: default; }

.course-nav-btn {
  padding: 11px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.course-nav-btn:hover { border-color: #D5477F; color: #D5477F; }
.course-nav-btn--next { margin-left: auto; background: rgba(213,71,127,0.08); border-color: rgba(213,71,127,0.3); color: #D5477F; }
.course-nav-btn--next:hover { background: rgba(213,71,127,0.18); border-color: #D5477F; }
.course-nav-btn--finish { margin-left: auto; background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3); color: #10b981; }
.course-nav-btn--finish:hover { background: rgba(16,185,129,0.16); border-color: #10b981; }
.course-nav-btn--locked { opacity: 0.6; cursor: default; }
.course-nav-btn--locked:hover { border-color: var(--color-border); color: var(--color-text-muted); }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .course-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .course-sidebar { display: none; }

  .course-mobile-bar {
    display: block;
    grid-column: 1;
    grid-row: 1;
    background: #09090d;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: var(--nav-height, 60px);
    z-index: 10;
  }
  .course-mobile-bar__toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: transparent;
    border: none;
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
  }
  .course-mobile-bar__toggle svg { transition: transform 0.2s; flex-shrink: 0; }
  .course-mobile-nav { border-top: 1px solid var(--color-border); }
  .course-mobile-nav__item {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .course-mobile-nav__item--active { color: var(--color-text); background: rgba(213,71,127,0.07); }
  .course-mobile-nav__item--locked { color: #444; }

  .course-content {
    grid-column: 1;
    grid-row: 2;
    padding: 28px 20px 60px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .course-layout { min-height: unset; }

  .courses-grid { grid-template-columns: 1fr; }
  .course-landing__header { flex-direction: column; gap: 12px; }
  .course-nav-footer__nav { flex-direction: column; }
  .course-nav-btn--next, .course-nav-btn--finish { margin-left: 0; }
}


/* Hub courses section */
.hub-courses-section { margin-top: 56px; }
.hub-section-see-all { font-size: 0.8rem; color: #888; text-decoration: none; }
.hub-section-see-all:hover { color: #D5477F; }
.hub-courses-sub { color: var(--color-text-muted); font-size: 0.875rem; margin: -8px 0 20px; }

.hub-courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.hub-course-card {
  background: #0f0f14;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.hub-course-card:hover { border-color: #D5477F; }
.hub-course-card__top { display: flex; align-items: center; justify-content: space-between; }
.hub-course-card__icon { font-size: 1.5rem; }
.hub-course-card__title { font-size: 0.9rem; font-weight: 700; color: var(--color-text); margin: 0; }
.hub-course-card__desc { font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.55; margin: 0; flex: 1; }
.hub-course-card__meta { font-size: 0.75rem; color: #D5477F; font-weight: 600; margin-top: 4px; }

/* Hub overview two-column (topic cards left, courses right) */
.hub-overview {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 48px;
}
.hub-overview__courses-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.hub-overview__courses-sub {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 0 0 14px;
}
.hub-course-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hub-course-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #0f0f14;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.hub-course-list-item:hover { border-color: #D5477F; background: rgba(213,71,127,0.05); }
.hub-course-list-item__icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1; }
.hub-course-list-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-course-list-item__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hub-course-list-item__meta { font-size: 0.72rem; color: #666; }
@media (max-width: 900px) {
  .hub-overview { grid-template-columns: 1fr; gap: 24px; }
}

/* Hub overview header row — same proportions as hub-overview, left empty */
.hub-overview-header {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  margin-bottom: 10px;
}
.hub-overview__courses-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.hub-overview__courses-header .hub-section-label { flex: 1; margin: 0; }
.hub-overview__courses-header .hub-section-see-all { margin: 0; }
.hub-overview__courses-header .hub-overview__courses-sub {
  width: 100%;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin: 4px 0 0;
}
@media (max-width: 900px) {
  .hub-overview-header { grid-template-columns: 1fr; }
  .hub-overview-header > div:first-child { display: none; }
}

/* ── Mermaid zoom + fullscreen modal ─────────────────────────────────── */
.mermaid-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  text-align: center;
  margin-top: 6px;
  margin-bottom: 12px;
}
#mermaid-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}
#mermaid-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mermaid-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
}
.mermaid-modal-inner {
  position: relative;
  z-index: 1;
  width: 92vw;
  height: 85vh;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mermaid-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mermaid-modal-close:hover {
  background: rgba(255,255,255,0.2);
}
.mermaid-modal-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 16px;
  touch-action: none;
}
.mermaid-modal-content svg {
  max-width: 100%;
  max-height: 100%;
}
@media (max-width: 768px) {
  .mermaid-hint {
    display: none;
  }
}

/* ── Widget System ───────────────────────────────────── */
.oy-widget-wrap {
  position: relative;
  width: 100%;
  margin: 28px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
}
.oy-widget-iframe {
  width: 100%;
  border: none;
  display: block;
  overflow: hidden;
  min-height: 400px;
  transition: height 0.2s ease;
}
.oy-widget-fullscreen {
  min-height: 60vh;
}
.oy-widget-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.oy-widget-expand-btn {
  font-size: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #475569;
  border-radius: 6px;
  transition: all 0.2s;
}
.oy-widget-expand-btn:hover {
  color: #60a5fa;
  border-color: #60a5fa;
}
/* Widget gallery */
.widget-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.widget-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: block;
}
.widget-card:hover {
  border-color: #D5477F;
  transform: translateY(-2px);
}
.widget-card h3 {
  color: var(--color-text);
  margin-bottom: 8px;
  font-size: 1rem;
}
.widget-fullscreen-wrap {
  width: 100%;
}
@media (max-width: 768px) {
  .oy-widget-fullscreen {
    min-height: 50vh;
  }
}

/* ── Article TOC Sidebar ─────────────────────────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0 48px;
  align-items: start;
}

.article-body--toc {
  max-width: 100%;
  min-width: 0;
}

.article-toc {
  position: sticky;
  top: calc(var(--nav-height, 64px) + 24px);
  max-height: calc(100vh - var(--nav-height, 64px) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
}
.article-toc::-webkit-scrollbar { display: none; }

.article-toc__inner {
  background: var(--color-surface, #111);
  border: 1px solid var(--color-border, #222);
  border-radius: 10px;
  padding: 16px 18px;
}

.article-toc__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted, #666);
  margin-bottom: 12px;
  cursor: default;
}

.article-toc__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.article-toc__link {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted, #888);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 5px;
  line-height: 1.4;
  transition: color 0.15s, background 0.15s;
}

.article-toc__link:hover {
  color: var(--color-text, #e2e8f0);
  background: rgba(255,255,255,0.05);
}

.article-toc__link.is-active {
  color: #D5477F;
  font-weight: 600;
  background: rgba(213, 71, 127, 0.08);
}

.article-toc__link--sub {
  padding-left: 18px;
  font-size: 0.75rem;
}

.article-body h2,
.article-body h3 {
  scroll-margin-top: calc(var(--nav-height, 64px) + 24px);
}

/* Mobile — hide sidebar, show as collapsed top block */
@media (max-width: 1024px) {
  .article-layout {
    display: block;
  }
  .article-body--toc {
    max-width: 720px;
  }
  .article-toc {
    position: static;
    max-height: none;
    margin-bottom: 28px;
  }
  .article-toc__inner {
    padding: 12px 16px;
  }
  .article-toc__label {
    cursor: pointer;
    margin-bottom: 0;
  }
  .article-toc__label::after {
    content: ' ▾';
    font-size: 0.65rem;
  }
  .article-toc__nav {
    display: none;
    margin-top: 10px;
  }
  .article-toc__inner.is-open .article-toc__nav {
    display: flex;
  }
  .article-toc__inner.is-open .article-toc__label::after {
    content: ' ▴';
  }
}

/* ── Search ──────────────────────────────────────────────────── */
.nav-search-btn {
  background: none;
  border: none;
  color: var(--color-muted, #888);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
  margin-right: 8px;
}
.nav-search-btn:hover { color: var(--color-text, #e2e8f0); }

/* Hub search box */
.learning-search-wrap {
  max-width: 600px;
  margin: 24px auto 32px;
  position: relative;
}
.learning-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface, #111);
  border: 1px solid var(--color-border, #2a2a2a);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.learning-search-box:focus-within {
  border-color: #D5477F;
  box-shadow: 0 0 0 3px rgba(213,71,127,0.12);
}
.learning-search-icon { color: var(--color-muted, #666); flex-shrink: 0; }
.learning-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--color-text, #e2e8f0);
  font-size: 0.95rem;
}
.learning-search-input::placeholder { color: var(--color-muted, #555); }
.learning-search-kbd {
  font-size: 0.7rem;
  color: var(--color-muted, #555);
  border: 1px solid var(--color-border, #333);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.learning-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--color-surface, #111);
  border: 1px solid var(--color-border, #2a2a2a);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 200;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

/* Modal overlay */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal-overlay[hidden] { display: none; }
.search-modal {
  width: 100%;
  max-width: 600px;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.search-modal-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #2a2a2a;
  color: var(--color-muted, #666);
}
.search-modal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--color-text, #e2e8f0);
}
.search-modal-input::placeholder { color: #555; }
.search-modal-close {
  background: #222;
  border: 1px solid #333;
  color: #666;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  font-family: var(--font-mono);
}
.search-modal-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 8px;
}
.search-modal-empty { padding: 8px; }
.search-modal-empty-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-muted, #555);
  padding: 8px 8px 4px;
}

/* Shared result items */
.search-result-item {
  display: block;
  padding: 10px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}
.search-result-item:hover { background: rgba(255,255,255,0.05); }
.search-result-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
  margin-bottom: 3px;
}
.search-result-title mark {
  background: rgba(213,71,127,0.25);
  color: #D5477F;
  border-radius: 2px;
  padding: 0 1px;
}
.search-result-excerpt {
  font-size: 0.78rem;
  color: var(--color-muted, #777);
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-result-cat {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #D5477F;
}
.search-result-time {
  font-size: 0.68rem;
  color: var(--color-muted, #666);
}
.search-no-results {
  text-align: center;
  color: var(--color-muted, #666);
  padding: 24px;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .learning-search-wrap { margin: 16px auto 24px; padding: 0 16px; }
  .learning-search-kbd { display: none; }
  .search-modal-overlay { padding-top: 20px; align-items: flex-start; }
  .search-modal { border-radius: 12px 12px 0 0; margin-top: auto; }
}

/* ============================================================
   MEMBER HOME — Widget system
   ============================================================ */

/* Member home: hidden by default, shown for auth users */
#member-home { display: none; }

.member-home__inner {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 16px 80px;
}

.mh-widget--full  { grid-column: span 12; }
.mh-widget--half  { grid-column: span 6; }
.mh-widget--third { grid-column: span 4; }
@media (max-width: 800px) {
  .mh-widget--half, .mh-widget--third { grid-column: span 12; }
}

/* ── Greeting widget ───────────────────────────────────────── */
.widget-greeting {
  background: linear-gradient(135deg, #0f0f14 0%, #18101a 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 32px 36px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  position: relative; overflow: hidden;
}
:root[data-theme="light"] .widget-greeting,
:root[data-theme="system"] .widget-greeting {
  background: linear-gradient(135deg, #e8e8f0 0%, #ede8ef 100%);
}
.widget-greeting::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(213,71,127,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.greeting-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-brand);
  background: rgba(213,71,127,0.1);
  border: 1px solid rgba(213,71,127,0.25);
  border-radius: 4px; padding: 3px 8px; margin-bottom: 12px;
}
.greeting-headline {
  font-size: 1.75rem; font-weight: 700; line-height: 1.2; margin-bottom: 8px;
}
.greeting-sub { font-size: 0.9rem; color: var(--color-muted); line-height: 1.5; }
.greeting-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--color-muted);
  border: 1px solid var(--color-border); border-radius: 6px;
  padding: 9px 18px; font-size: 0.875rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.btn-ghost:hover { color: var(--color-text); border-color: var(--color-subtle); }
.greeting-mascot { font-size: 4rem; line-height: 1; flex-shrink: 0; opacity: 0.85; }
@media (max-width: 600px) { .greeting-mascot { display: none; } }

/* ── Widget section label ──────────────────────────────────── */
.widget-section-label {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-muted); margin-bottom: 12px;
}

/* ── Quick links ───────────────────────────────────────────── */
.quick-links-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
@media (max-width: 800px) { .quick-links-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .quick-links-grid { grid-template-columns: 1fr; } }

.quick-link-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.quick-link-card:hover { border-color: var(--color-brand); background: rgba(213,71,127,0.04); }
.ql-icon {
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.ql-icon--cli     { background: rgba(213,71,127,0.12); }
.ql-icon--edges   { background: rgba(99,102,241,0.12); }
.ql-icon--signals { background: rgba(16,185,129,0.12); }
.ql-icon--learn   { background: rgba(212,160,23,0.12); }
.ql-title { font-size: 0.9rem; font-weight: 700; color: var(--color-text); }
.ql-desc  { font-size: 0.78rem; color: var(--color-muted); line-height: 1.45; flex: 1; }
.ql-arrow { font-size: 0.75rem; color: var(--color-brand); font-weight: 600; margin-top: 4px; }

/* ── Generic widget card ───────────────────────────────────── */
.widget-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex; flex-direction: column;
  height: 100%;
}
.widget-card__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.widget-card__title {
  font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-muted);
}
.widget-card__see-all { font-size: 0.75rem; color: var(--color-brand); font-weight: 600; }
.widget-card__see-all:hover { text-decoration: underline; }

/* ── Article list (latest-learning widget) ─────────────────── */
.article-list { display: flex; flex-direction: column; }
.article-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--color-border);
  text-decoration: none; color: inherit;
  transition: color 0.12s;
}
.article-item:last-child { border-bottom: none; }
.article-item:hover .article-item__title { color: var(--color-brand); }
.article-num {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--color-subtle); width: 18px; flex-shrink: 0; padding-top: 2px;
}
.article-item__body { flex: 1; min-width: 0; }
.article-item__title {
  font-size: 0.855rem; font-weight: 600; line-height: 1.4;
  color: var(--color-text); transition: color 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.article-item__meta { display: flex; gap: 8px; margin-top: 3px; }
.article-tag {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-muted);
}
.article-time { font-size: 0.65rem; color: var(--color-subtle); }

/* ── Signal placeholder ────────────────────────────────────── */
.signal-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px 0;
}
.signal-placeholder__icon { font-size: 2.2rem; opacity: 0.4; }
.signal-placeholder__label { font-size: 0.8rem; color: var(--color-muted); line-height: 1.5; }
.signal-coming-soon {
  display: inline-block;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-subtle); border: 1px solid var(--color-border);
  border-radius: 4px; padding: 3px 8px; margin-top: 4px;
}

/* ── Member footer ─────────────────────────────────────────── */
.mh-footer {
  grid-column: span 12;
  text-align: center; padding: 24px 0 0;
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem; color: var(--color-subtle);
}
.mh-footer a { color: var(--color-brand); }
.mh-footer a:hover { text-decoration: underline; }

/* ============================================================
   SIGNALS PAGE — Light / system theme overrides
   ============================================================ */

/* sp-* (scan panel / signal rows) */
:root[data-theme="light"] .sp-header__title,
:root[data-theme="light"] .sp-header__meta { color: var(--color-text); }

:root[data-theme="light"] .sp-date-select {
  background-color: #e8e8e8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23555' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  border-color: #c8c8c8;
  color: #1a1a1a;
}
:root[data-theme="light"] .sp-col-label { color: #888; }
:root[data-theme="light"] .sp-row {
  border-color: #d8d8d8;
  background: var(--color-surface);
  color: var(--color-text);
}
:root[data-theme="light"] .sp-row:hover { background: #dedede; border-color: #c0c0c0; }
:root[data-theme="light"] .sp-bar-track { background: #d0d0d0; }
:root[data-theme="light"] .sp-bar-fill--skip { background: #b8b8b8; }
:root[data-theme="light"] .sp-section-sep__line { background: #d0d0d0; }
:root[data-theme="light"] .sp-logo { background: #e0e0e0; }
:root[data-theme="light"] .sp-univ-tag {
  color: #666; background: #e4e4e4; border-color: #ccc;
}

/* sd-* (signal detail / daily report) */
:root[data-theme="light"] .sd-hero {
  background: #e8e8e8; border-color: #d0d0d0;
}
:root[data-theme="light"] .sd-hero__bar-track { background: #c8c8c8; }
:root[data-theme="light"] .sd-hero__bar-fill--skip { background: #b8b8b8; }
:root[data-theme="light"] .sd-report {
  background: var(--color-surface); border-color: var(--color-border);
}
:root[data-theme="light"] .sd-report tbody tr:hover td { background: #dedede; color: #1a1a1a; }
:root[data-theme="light"] .sd-report code { background: #dcdcdc; color: #D5477F; }
:root[data-theme="light"] .sd-report blockquote { background: #e4e4e4; }
:root[data-theme="light"] .sd-history {
  background: var(--color-surface); border-color: var(--color-border);
}
:root[data-theme="light"] .sd-history__row:hover { background: #e0e0e0; }
:root[data-theme="light"] .sd-logo { background: #e0e0e0; }
:root[data-theme="light"] .sd-history__univ {
  color: #666; background: #e4e4e4; border-color: #ccc;
}

/* System theme mirrors light */
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .sp-header__title,
  :root[data-theme="system"] .sp-header__meta { color: var(--color-text); }
  :root[data-theme="system"] .sp-date-select { background-color: #e8e8e8; border-color: #c8c8c8; color: #1a1a1a; }
  :root[data-theme="system"] .sp-col-label { color: #888; }
  :root[data-theme="system"] .sp-row { border-color: #d8d8d8; background: var(--color-surface); }
  :root[data-theme="system"] .sp-row:hover { background: #dedede; border-color: #c0c0c0; }
  :root[data-theme="system"] .sp-bar-track { background: #d0d0d0; }
  :root[data-theme="system"] .sp-bar-fill--skip { background: #b8b8b8; }
  :root[data-theme="system"] .sp-section-sep__line { background: #d0d0d0; }
  :root[data-theme="system"] .sp-logo { background: #e0e0e0; }
  :root[data-theme="system"] .sp-univ-tag { color: #666; background: #e4e4e4; border-color: #ccc; }
  :root[data-theme="system"] .sd-hero { background: #e8e8e8; border-color: #d0d0d0; }
  :root[data-theme="system"] .sd-hero__bar-track { background: #c8c8c8; }
  :root[data-theme="system"] .sd-hero__bar-fill--skip { background: #b8b8b8; }
  :root[data-theme="system"] .sd-report { background: var(--color-surface); border-color: var(--color-border); }
  :root[data-theme="system"] .sd-report tbody tr:hover td { background: #dedede; color: #1a1a1a; }
  :root[data-theme="system"] .sd-report code { background: #dcdcdc; color: #D5477F; }
  :root[data-theme="system"] .sd-report blockquote { background: #e4e4e4; }
  :root[data-theme="system"] .sd-history { background: var(--color-surface); border-color: var(--color-border); }
  :root[data-theme="system"] .sd-history__row:hover { background: #e0e0e0; }
  :root[data-theme="system"] .sd-logo { background: #e0e0e0; }
  :root[data-theme="system"] .sd-history__univ { color: #666; background: #e4e4e4; border-color: #ccc; }
}

/* ── Signals timeline (tl-*) light / system overrides ──────── */
:root[data-theme="light"] .tl-header__title { color: var(--color-text); }
:root[data-theme="light"] .tl-header__meta  { color: var(--color-muted); }
:root[data-theme="light"] .tl-date-sep__line  { background: #d0d0d0; }
:root[data-theme="light"] .tl-date-sep__label { color: #888; }
:root[data-theme="light"] .tl-run {
  background: var(--color-surface);
  border-color: var(--color-border);
}
:root[data-theme="light"] .tl-run:hover { border-color: #b8b8b8; }
:root[data-theme="light"] .tl-run__time    { color: #888; }
:root[data-theme="light"] .tl-run__counts  { color: #666; }
:root[data-theme="light"] .tl-chip-sep     { color: #bbb; }
:root[data-theme="light"] .tl-chip-more    { color: #666; border-color: #ccc; }
:root[data-theme="light"] .tl-chip-more:hover { color: #333; border-color: #999; }
:root[data-theme="light"] .tl-empty        { color: #888; }
:root[data-theme="light"] .tl-empty code   { background: #e0e0e0; color: #D5477F; }

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .tl-header__title { color: var(--color-text); }
  :root[data-theme="system"] .tl-header__meta  { color: var(--color-muted); }
  :root[data-theme="system"] .tl-date-sep__line  { background: #d0d0d0; }
  :root[data-theme="system"] .tl-date-sep__label { color: #888; }
  :root[data-theme="system"] .tl-run { background: var(--color-surface); border-color: var(--color-border); }
  :root[data-theme="system"] .tl-run:hover { border-color: #b8b8b8; }
  :root[data-theme="system"] .tl-run__time   { color: #888; }
  :root[data-theme="system"] .tl-run__counts { color: #666; }
  :root[data-theme="system"] .tl-chip-sep    { color: #bbb; }
  :root[data-theme="system"] .tl-chip-more   { color: #666; border-color: #ccc; }
  :root[data-theme="system"] .tl-empty       { color: #888; }
  :root[data-theme="system"] .tl-empty code  { background: #e0e0e0; color: #D5477F; }
}



/* ── MEMBER HOME v2 — Terminal Dashboard ─────────────────── */

/* Background & layout */
#member-home { display: none; position: relative; overflow: hidden; }
.mh-bg-grid { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mh-bg-grid::before {
  content: '';
  position: absolute; inset: -50%;
  background-image: linear-gradient(rgba(213,71,127,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(213,71,127,0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  animation: mh-grid-move 30s linear infinite;
}
.mh-bg-grid::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 30%, var(--color-bg) 100%);
}
@keyframes mh-grid-move { from { transform: translate(0,0); } to { transform: translate(52px,52px); } }
.mh-bg-orb {
  position: absolute; top: -120px; right: -120px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(213,71,127,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.mh-inner {
  position: relative; z-index: 2;
  max-width: 1140px; margin: 0 auto;
  padding: 48px 16px 80px;
  display: flex; flex-direction: column; gap: 24px;
}

/* Terminal card */
.mh-terminal {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: 0 0 0 1px rgba(213,71,127,0.05), 0 0 80px rgba(213,71,127,0.06), 0 32px 80px rgba(0,0,0,0.6);
}
.mh-terminal-bar {
  background: #111116; border-bottom: 1px solid var(--color-border);
  padding: 11px 18px; display: flex; align-items: center; gap: 8px;
}
.mh-td { width: 12px; height: 12px; border-radius: 50%; }
.mh-td-r { background: #ff5f57; }
.mh-td-y { background: #ffbd2e; }
.mh-td-g { background: #28c940; }
.mh-terminal-title {
  flex: 1; text-align: center;
  font-family: var(--font-mono); font-size: 0.68rem; color: #50505e; letter-spacing: 0.06em;
}
.mh-terminal-ver {
  font-family: var(--font-doto); font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.65rem; color: #444450; letter-spacing: 0.06em;
}
.mh-terminal-body {
  background: #090910;
  display: grid; grid-template-columns: 1fr 220px;
}

/* Terminal left — CLI */
.mh-term-left {
  padding: 28px 32px 32px; border-right: 1px solid var(--color-border);
  font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.9;
}
.mh-t-row { display: flex; align-items: baseline; }
.mh-t-p   { color: var(--color-brand); margin-right: 6px; flex-shrink: 0; }
.mh-t-c   { color: #d0d0de; }
.mh-t-f   { color: #6366f1; }
.mh-t-v   { color: #10b981; }
.mh-t-v a { color: #10b981; text-decoration: none; }
.mh-t-v a:hover { text-decoration: underline; }
.mh-t-cm  { color: #484856; }
.mh-t-sep { border: none; border-top: 1px solid #14141c; margin: 14px 0; }
.mh-t-key { font-family: var(--font-mono); font-size: 0.75rem; color: #525260; min-width: 190px; flex-shrink: 0; display: inline-block; }
.mh-t-ok  { color: #10b981; }
.mh-t-warn { color: #f59e0b; }
.mh-t-dim  { color: #505060; }
.mh-cursor {
  display: inline-block; width: 7px; height: 13px;
  background: var(--color-brand); vertical-align: middle;
  animation: mh-blink 1.1s step-end infinite; margin-left: 2px;
}
@keyframes mh-blink { 0%,100% { opacity:1 } 50% { opacity:0 } }

/* Terminal right — Doto scoreboard */
.mh-term-right {
  padding: 24px 24px 28px; background: #07070e;
  display: flex; flex-direction: column;
}
.mh-score-label {
  font-family: var(--font-mono); font-size: 0.55rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: #484856; margin-bottom: 4px;
}
.mh-score-num {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 900;
  font-size: 3.2rem; line-height: 1; color: var(--color-text);
}
.mh-score-num--brand { color: var(--color-brand); }
.mh-score-num--green { color: #10b981; }
.mh-score-num--amber { color: #f59e0b; }
.mh-score-sub {
  font-family: var(--font-mono); font-size: 0.6rem; color: #777788;
  margin-top: 2px; margin-bottom: 18px;
}
.mh-score-div { border: none; border-top: 1px solid #1e1e2a; margin: 2px 0 16px; }

/* Quick actions */
.mh-strip-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mh-strip-label {
  font-family: var(--font-doto); font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.65rem; color: #404050; letter-spacing: 0.1em; white-space: nowrap;
}
.mh-strip-line { flex: 1; height: 1px; background: #111116; }
.mh-actions { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.mh-action {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 12px; padding: 18px 16px 16px; text-decoration: none; color: inherit;
  cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.mh-action::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--color-brand); transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s;
}
.mh-action:hover { border-color: rgba(213,71,127,0.3); background: rgba(213,71,127,0.04); }
.mh-action:hover::after { transform: scaleX(1); }
.mh-action-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; }
.ic-cli  { background: rgba(213,71,127,0.1); }
.ic-edge { background: rgba(99,102,241,0.1); }
.ic-sig  { background: rgba(16,185,129,0.1); }
.ic-lrn  { background: rgba(212,160,23,0.1); }
.mh-action-name { font-size: 0.88rem; font-weight: 700; color: var(--color-text); }
.mh-action-cmd { font-family: var(--font-mono); font-size: 0.6rem; color: #50505e; margin-top: 2px; }
.mh-action-arrow { margin-left: auto; align-self: flex-end; font-family: var(--font-mono); font-size: 0.65rem; color: #3a3a48; transition: color 0.15s; }
.mh-action:hover .mh-action-arrow { color: var(--color-brand); }

/* Widget cards */
.mh-widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mh-widget { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.mh-widget-head { background: #0d0d11; border-bottom: 1px solid var(--color-border); padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; }
.mh-widget-title {
  font-family: var(--font-doto); font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.62rem; color: #484856; letter-spacing: 0.1em;
}
.mh-widget-title::before { content: '// '; color: var(--color-brand); opacity: 0.5; font-family: var(--font-mono); }
.mh-widget-link { font-family: var(--font-mono); font-size: 0.62rem; color: var(--color-brand); opacity: 0.9; }
.mh-widget-link:hover { opacity: 1; text-decoration: none; }
.mh-widget-body { padding: 4px 0; flex: 1; }

/* Article items */
.mh-art-item {
  display: grid; grid-template-columns: 36px 1fr auto;
  align-items: baseline; gap: 8px; padding: 10px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.03); text-decoration: none; color: inherit;
  transition: background 0.12s;
}
.mh-art-item:last-child { border-bottom: none; }
.mh-art-item:hover { background: rgba(213,71,127,0.04); }
.mh-art-idx {
  font-family: var(--font-doto); font-variation-settings: 'ROND' 0, 'wght' 800;
  font-size: 0.85rem; color: var(--color-brand); opacity: 0.55; line-height: 1;
}
.mh-art-name { font-size: 0.8rem; color: #aaaabc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.mh-art-time { font-family: var(--font-mono); font-size: 0.6rem; color: #484856; flex-shrink: 0; }

/* Signal placeholder */
.mh-signal-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 28px 20px; }
.mh-signal-icon { font-size: 1.8rem; opacity: 0.15; }
.mh-signal-text { font-family: var(--font-mono); font-size: 0.68rem; color: #4a4a58; line-height: 1.7; }
.mh-signal-tag {
  font-family: var(--font-doto); font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.6rem; color: #3e3e50; border: 1px solid #2a2a38; border-radius: 4px; padding: 4px 10px; letter-spacing: 0.08em;
}

/* Member home footer */
.mh-footer {
  text-align: center; padding-top: 8px;
  font-family: var(--font-doto); font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.6rem; color: #363644; letter-spacing: 0.1em;
}
.mh-footer a { color: var(--color-brand); opacity: 0.4; }
.mh-footer a:hover { opacity: 0.7; text-decoration: none; }

/* Theme overrides — terminal stays dark in ALL themes (permanent dark island).
   Only page-level elements (bg, cards, widgets) follow light/system. */

/* Light mode — page elements only */
:root[data-theme="light"] .mh-bg-grid::after {
  background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 30%, var(--color-bg) 100%);
}
:root[data-theme="light"] .mh-action { background: var(--color-surface); }
:root[data-theme="light"] .mh-widget { background: var(--color-surface); }
:root[data-theme="light"] .mh-widget-head { background: #e8e8ec; }
:root[data-theme="light"] .mh-art-name { color: #333; }

/* System mode (OS = light) — same page elements, terminal hardcoded dark unaffected */
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] .mh-bg-grid::after {
    background: radial-gradient(ellipse 70% 60% at 50% 50%, transparent 30%, var(--color-bg) 100%);
  }
  :root[data-theme="system"] .mh-action { background: var(--color-surface); }
  :root[data-theme="system"] .mh-widget { background: var(--color-surface); }
  :root[data-theme="system"] .mh-widget-head { background: #e8e8ec; }
  :root[data-theme="system"] .mh-art-name { color: #333; }
}

/* Mobile responsive */
@media (max-width: 800px) {
  .mh-terminal-body { grid-template-columns: 1fr; }
  .mh-term-left { border-right: none; border-bottom: 1px solid var(--color-border); }
  .mh-term-right { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; padding: 16px; }
  .mh-score-num { font-size: 2rem; }
  .mh-score-div { display: none; }
  .mh-actions { grid-template-columns: repeat(2,1fr); }
  .mh-widgets { grid-template-columns: 1fr; }
}

/* ── END MEMBER HOME v2 ───────────────────────────────────── */


/* ── Doto global utility classes ─────────────────────────── */
.doto-sharp {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 800;
}
.doto-soft {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
}

/* ── Doto extension — signals / learning ──────────────────── */

/* Signals: chip scores (e.g. 83.1 inside BUY/WATCH chips) */
.tl-chip-score {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 800;
  opacity: 1;
}

/* Signals: BUY / WATCH count text in timeline run row */
.tl-run__counts-buy,
.tl-run__counts-watch {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 700;
  letter-spacing: 0.04em;
}

/* Signals: date separator labels (2026-05-28) */
.tl-date-sep__label {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
  color: #404050;
  font-size: 0.7rem;
}

/* Signals: header meta (timeline — "N scan runs · N BUY signals") */
.tl-header__meta {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* Signals: universe-portal header meta (date · stocks · BUY · WATCH) */
.sp-header__meta {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* Signals: stock counts wrapper in timeline run row */
.tl-run__counts {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

/* Signals: score number in universe-portal sp-row */
.sp-score {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 800;
}

/* Learning: article counts in hub topic cards ("25 articles →") */
.hub-topic-card__meta {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 0, 'wght' 800;
}

/* Learning: lesson counts in course list items ("5 lessons", "44 lessons") */
.hub-course-list-item__meta {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

/* Learning: reading time in article cards ("7 min read") */
.article-card__readtime {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
}

/* Learning: article count display ("Showing N of N articles") */
.hub-article-count {
  font-family: var(--font-doto);
  font-variation-settings: 'ROND' 1, 'wght' 700;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

/* Visible scrollbar for wide tables (macOS hides overlay scrollbars) */
.compare-wrap,
.article-body table {
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.compare-wrap::-webkit-scrollbar,
.article-body table::-webkit-scrollbar {
  height: 8px;
}
.compare-wrap::-webkit-scrollbar-track,
.article-body table::-webkit-scrollbar-track {
  background: transparent;
}
.compare-wrap::-webkit-scrollbar-thumb,
.article-body table::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}
.compare-wrap:hover::-webkit-scrollbar-thumb,
.article-body table:hover::-webkit-scrollbar-thumb {
  background: #D5477F;
}

/* ============================================================
   MOBILE NAV REBUILD — auth pill, drawer controls (2026-06-03)
   ============================================================ */

/* Auth pill — compact Google photo + first name */
.nav-avatar__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 3px 12px 3px 3px;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.8125rem;
}
.nav-avatar__chip:hover {
  border-color: var(--color-subtle);
}
.nav-avatar__img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.nav-avatar__name {
  font-size: 13px;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Drawer controls section */
.nav-drawer__controls {
  border-top: 1px solid var(--color-border);
  margin-top: 12px;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nav-drawer__row {
  display: flex;
  gap: 10px;
}
.nav-drawer__ctrl {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 14px;
}
.nav-drawer__ctrl:hover {
  border-color: var(--color-brand);
}

/* ── Mobile: minimize top bar (<768px) ── */
@media (max-width: 767px) {
  /* Theme toggle and search moved into drawer */
  .site-nav__inner .theme-toggle,
  .site-nav__inner .nav-search-btn {
    display: none;
  }
  .nav-brand { flex-shrink: 0; }
  .nav-avatar__name { max-width: 72px; }
  .nav-controls { gap: 8px; }
  /* Hide logged-out Sign In button from top bar on mobile (it lives in the drawer) */
  #nav-auth .btn-primary { display: none; }
  /* Keep the avatar chip visible when logged in */
  #nav-auth .nav-avatar__chip { display: inline-flex; }
}

/* Desktop: hide drawer controls (they live in the top bar) */
@media (min-width: 768px) {
  .nav-drawer__controls { display: none; }
}
