﻿/* MAXIMUM DARK FORCE · override parent theme / WP wrapper · belt-and-suspenders */
html, body, .page, .container, .main, main, article, section,
.wp-block-group, .entry-content, .site-content, #content, #main {
  background-color: #0a0a0c !important;
  color: #f4f0e6 !important;
}
[class*="bg-white"], .bg-light, [style*="background:#fff"], [style*="background: #fff"],
[style*="background:white"], [style*="background: white"] {
  background-color: transparent !important;
}
/* DARK THEME FORCED - iCafeFX brand identity */
:root {
  --bg: #0a0a0c !important;
  --bg-elev: #14141a !important;
  --bg-card: #1a1a22 !important;
  --bg-hover: #22222c !important;
  --fg: #f4f0e6 !important;
  --fg-dim: #a8a5a0 !important;
  --fg-mute: #6b6863 !important;
  --gold: #D4A853 !important;
  --gold-dim: #b8924a !important;
  --gold-soft: rgba(212, 168, 83, 0.12) !important;
  --gold-line: rgba(212, 168, 83, 0.3) !important;
  --line: rgba(244, 240, 230, 0.1) !important;
  --line-strong: rgba(244, 240, 230, 0.15) !important;
  color-scheme: dark !important;
}

html, body {
  background: #0a0a0c !important;
  color: #f4f0e6 !important;
  color-scheme: dark !important;
}

/* ============================================================
   iCafeFX Manual Â· Custom Stylesheet v1.0
   Design: Editorial trader aesthetic Â· Dark with gold accents
   Brand color: #D4A853 (iCafeFX gold)
   Fonts: Sarabun (Thai), Fraunces (display), JetBrains Mono (code/numbers)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Brand palette */
  --gold: #D4A853;
  --gold-dim: #b8924a;
  --gold-soft: rgba(212, 168, 83, 0.12);
  --gold-line: rgba(212, 168, 83, 0.3);
  
  /* Dark foundation */
  --bg: #0a0a0c;
  --bg-elev: #14141a;
  --bg-card: #1a1a22;
  --bg-hover: #22222c;
  
  /* Text */
  --fg: #f4f0e6;
  --fg-dim: #a8a5a0;
  --fg-mute: #6b6863;
  
  /* Accents */
  --line: rgba(244, 240, 230, 0.08);
  --line-strong: rgba(244, 240, 230, 0.15);
  --bull: #4ade80;
  --bear: #f87171;
  --news: #fbbf24;
  
  /* Type system */
  --font-display: 'Fraunces', 'Sarabun', Georgia, serif;
  --font-body: 'Sarabun', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Sarabun', monospace;
  
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
}

/* Light theme override removed Â· dark is brand default */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Texture / atmosphere ============ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 1200px 600px at 70% -10%, var(--gold-soft), transparent 60%),
    radial-gradient(ellipse 800px 400px at 10% 100%, rgba(212, 168, 83, 0.04), transparent 60%);
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(255, 255, 255, 0.005) 2px,
      rgba(255, 255, 255, 0.005) 4px
    );
  z-index: 1;
  mix-blend-mode: overlay;
}

/* ============ Layout ============ */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 10;
}

/* ============ Top nav ============ */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 64px;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 12, 0.85);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fg);
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--gold);
}

.brand-sub {
  font-size: 11px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.nav-actions {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: var(--fg-dim);
}

.nav-actions a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-actions a:hover {
  color: var(--gold);
}

/* ============ Hero ============ */
.hero {
  padding: 80px 0 120px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 80px;
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  padding: 6px 12px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  margin-bottom: 32px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 24px;
}

.hero h1 .accent {
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

.hero-lead {
  font-size: 22px;
  color: var(--fg-dim);
  max-width: 720px;
  margin-bottom: 48px;
  line-height: 1.5;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.hero-meta dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-mute);
  margin-bottom: 6px;
}

.hero-meta dd {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--fg);
}

.hero-meta dd.gold {
  color: var(--gold);
}

/* ============ Chapter cards (index page) ============ */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 64px 0;
}

.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chapter-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent 60%, var(--gold-soft));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.chapter-card:hover {
  border-color: var(--gold-line);
  transform: translateY(-2px);
}

.chapter-card:hover::after {
  opacity: 1;
}

.chapter-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.chapter-desc {
  font-size: 14px;
  color: var(--fg-dim);
  line-height: 1.55;
}

.chapter-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ============ Chapter content layout ============ */
.chapter-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 80px;
  padding: 40px 0 120px;
}

@media (min-width: 1024px) {
  .chapter-page {
    grid-template-columns: 200px 1fr;
    gap: 80px;
  }
}

.chapter-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  font-size: 13px;
}

.chapter-sidebar h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-mute);
  margin-bottom: 16px;
}

.toc {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc a {
  display: block;
  padding: 6px 0 6px 16px;
  color: var(--fg-dim);
  text-decoration: none;
  border-left: 2px solid var(--line);
  transition: all 0.2s;
}

.toc a:hover, .toc a.active {
  color: var(--gold);
  border-left-color: var(--gold);
  padding-left: 20px;
}

.chapter-main {
  max-width: 760px;
}

/* Section headers */
.section {
  margin-bottom: 64px;
  scroll-margin-top: 100px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.section-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.section h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.section h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
  letter-spacing: -0.01em;
}

.section p {
  margin-bottom: 16px;
  color: var(--fg-dim);
  font-size: 17px;
}

.section strong {
  color: var(--fg);
  font-weight: 600;
}

/* TL;DR list */
.tldr-list {
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 24px 0;
}

.tldr-list li {
  position: relative;
  padding: 8px 0 8px 24px;
  color: var(--fg);
  font-size: 16px;
}

.tldr-list li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--gold);
  font-weight: 600;
}

.tldr-list li + li {
  border-top: 1px solid var(--line);
}

/* Steps */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 24px 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 16px 0 16px 56px;
  color: var(--fg-dim);
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--gold);
  font-weight: 600;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  background: var(--gold-soft);
}

.steps li:last-child {
  border-bottom: none;
}

/* Pro Tip callout */
.pro-tip {
  position: relative;
  background: linear-gradient(135deg, var(--gold-soft), transparent);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  margin: 32px 0;
}

.pro-tip::before {
  content: '\1F4A1\00A0\00A0PRO TIP';
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-bottom: 16px;
  font-weight: 600;
}

.pro-tip blockquote {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.5;
  color: var(--fg);
  font-style: italic;
  border-left: 3px solid var(--gold);
  padding-left: 20px;
  margin: 16px 0;
}

.pro-tip blockquote strong {
  font-style: normal;
  color: var(--gold);
}

.pro-tip-author {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 16px;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}

.faq-question {
  font-weight: 600;
  color: var(--fg);
  font-size: 17px;
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.faq-question::before {
  content: 'Q';
  font-family: var(--font-mono);
  color: var(--gold);
  font-size: 14px;
  font-weight: 600;
}

.faq-answer {
  color: var(--fg-dim);
  font-size: 16px;
  padding-left: 22px;
  line-height: 1.6;
}

/* See also */
.see-also {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.see-also a {
  display: block;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all 0.2s;
}

.see-also a:hover {
  border-color: var(--gold-line);
  background: var(--bg-hover);
}

.see-also a small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.see-also a span {
  color: var(--fg);
  font-size: 15px;
  font-weight: 500;
}

/* Disclaimer footer */
.disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 28px;
  margin: 48px 0;
  font-size: 14px;
  color: var(--fg-dim);
}

.disclaimer strong {
  color: var(--bear);
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  font-weight: 600;
}

/* Site footer */
footer {
  border-top: 1px solid var(--line);
  padding: 64px 0 48px;
  margin-top: 80px;
  color: var(--fg-mute);
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-col h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--fg-dim);
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}

.tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .page { padding: 0 16px; }
  .hero { padding: 48px 0 64px; }
  .hero h1 { font-size: 44px; }
  .hero-lead { font-size: 17px; }
  .chapter-page { padding: 24px 0 64px; }
  .pro-tip { padding: 24px; }
  .pro-tip blockquote { font-size: 17px; }
}

/* Animation on load */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero, .chapter-card, .section {
  animation: fadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chapter-card:nth-child(2) { animation-delay: 0.05s; }
.chapter-card:nth-child(3) { animation-delay: 0.1s; }
.chapter-card:nth-child(4) { animation-delay: 0.15s; }
.chapter-card:nth-child(5) { animation-delay: 0.2s; }
.chapter-card:nth-child(6) { animation-delay: 0.25s; }
.chapter-card:nth-child(7) { animation-delay: 0.3s; }
.chapter-card:nth-child(8) { animation-delay: 0.35s; }
.chapter-card:nth-child(9) { animation-delay: 0.4s; }
.chapter-card:nth-child(10) { animation-delay: 0.45s; }
.chapter-card:nth-child(11) { animation-delay: 0.5s; }
.chapter-card:nth-child(12) { animation-delay: 0.55s; }

/* === FIX_C responsive · v1124c === */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 768px) {
  .container {
    max-width: 880px;
    padding: 0 24px;
  }
}

.chapter-page {
  display: block;
  padding: 24px 0 80px;
}

.chapter-main {
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .chapter-main {
    max-width: 880px;
  }
}

.chapter-header { margin-bottom: 40px; }

.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 16px;
}

.chapter-hero, .hero-sub {
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--fg-dim);
  line-height: 1.5;
}

.manual-video-preview {
  margin-bottom: 40px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
}

.manual-video-preview h3 {
  margin: 0 0 12px;
  font-size: clamp(16px, 2vw, 18px);
}

.clip-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.clip-wrap video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #000;
}

@media (min-width: 768px) {
  .clip-wrap {
    max-width: 720px;
  }
  .clip-wrap video {
    max-width: 720px;
  }
}

.clip-note {
  margin: 10px 0 0;
  color: var(--fg-dim);
  font-size: 14px;
}

.disclaimer-inline {
  margin: 32px 0;
  padding: 16px;
  border-left: 3px solid var(--gold);
  color: var(--fg-dim);
  font-size: 14px;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 48px 0;
  padding-top: 24px;
  border-top: 1px solid var(--gold-line);
  flex-wrap: wrap;
}

.nav-all {
  color: var(--gold);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--gold-line);
  border-radius: 9999px;
}

/* Index grid */
.chapters-section {
  padding: 48px 0 80px;
}

.chapters-section h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  text-align: center;
  margin-bottom: 16px;
}

.chapters-lead {
  font-size: 18px;
  color: var(--fg-dim);
  max-width: 680px;
  margin: 0 auto 48px;
  text-align: center;
}

.chapters-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .chapters-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .chapters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card-video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  overflow: hidden;
}

.card-video-wrap video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.7) 100%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  pointer-events: none;
}

.card-emoji { font-size: 32px; line-height: 1; }

.card-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(212, 168, 83, 0.92);
  color: #0A0A0F;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.card-body { padding: 24px; }

.download-cta {
  margin: 48px 0;
  padding: 32px;
  background: linear-gradient(135deg, rgba(212,168,83,0.08), rgba(10,10,15,0.4));
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 16px;
  text-align: center;
}

.cta-eyebrow {
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 8px;
  font-weight: 600;
}

.download-cta h2 {
  font-size: 24px;
  color: var(--fg);
  margin: 0 0 8px;
}

.download-cta p {
  color: var(--fg-dim);
  margin: 0 0 20px;
  font-size: 14px;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* App store badges: normalize SVG(App Store) + PNG(Google Play) to equal height,
   never overflow the card (international app-badge standard). Shared = all chapters. */
.cta-buttons a {
  display: inline-flex;
  align-items: center;
}
.cta-buttons img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Inter-chapter nav links: theme color (not default blue underline). Shared shell. */
.chapter-nav a {
  color: var(--fg-dim);
  text-decoration: none;
}
.chapter-nav a:hover { color: var(--gold); }
.chapter-nav a[rel="next"] { color: var(--fg); }

.btn-primary {
  padding: 14px 28px;
  background: var(--gold);
  color: #0A0A0F;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
}

.btn-secondary {
  padding: 14px 28px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
}

.about-section {
  padding: 48px 0;
  text-align: center;
  border-top: 1px solid var(--gold-line);
}

.about-section p {
  color: var(--fg-dim);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.site-footer {
  padding: 32px 24px;
  border-top: 1px solid var(--gold-line);
  text-align: center;
  color: var(--fg-dim);
  font-size: 14px;
}

.site-footer a { color: var(--gold); }

.footer-note {
  margin-top: 8px;
  font-size: 12px;
}

@media (max-width: 767px) {
  .page { padding: 0 20px; }
  .hero { padding: 48px 0 64px; }
  .hero h1 { font-size: 32px; }
  .hero-lead { font-size: 17px; }
  .chapter-premium #breadcrumbs {
    font-size: 0.72rem;
    line-height: 1.45;
    padding: 4px 16px 12px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .chapter-premium #breadcrumbs::-webkit-scrollbar {
    display: none;
  }
  .chapter-premium #breadcrumbs span[itemprop="itemListElement"] {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .chapter-premium #breadcrumbs span[itemprop="name"] {
    white-space: nowrap;
  }
  .chapter-premium .chapter-page {
    padding-top: 8px;
  }
  .chapter-premium .chapter-main {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .chapter-premium .chapter-main > .jump-nav:first-child {
    margin-top: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    overflow: hidden;
  }
  .chapter-premium .jump-nav .toc {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .chapter-premium .jump-nav .toc li {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .chapter-premium .jump-nav .toc a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px 8px 16px;
    border-left: 2px solid var(--line);
    line-height: 1.45;
    font-size: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .chapter-premium .jump-nav .toc a:hover,
  .chapter-premium .jump-nav .toc a:focus,
  .chapter-premium .jump-nav .toc a.active {
    padding-left: 16px;
    border-left-color: var(--gold);
    color: var(--gold);
  }
}

/* === FIX6 layout · jump-nav · badge · see-also === */
.jump-nav {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
}
.jump-nav h4,
.jump-nav-label {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
}
.jump-nav .toc {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.jump-nav .toc a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 14px;
}
.jump-nav .toc a:hover { color: var(--gold); }
.chapter-badge {
  margin: -8px 0 20px;
  padding: 8px 12px;
  background: rgba(212, 168, 83, 0.06);
  border-left: 3px solid var(--gold);
  color: var(--fg-dim);
  font-size: 14px;
  border-radius: 0 6px 6px 0;
}
.chapter-badge strong { color: var(--gold); }
.see-also {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.see-also a {
  display: block;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg);
}
.see-also a small {
  display: block;
  color: var(--fg-dim);
  font-size: 12px;
  margin-bottom: 4px;
}
.see-also a span { color: var(--gold); font-weight: 600; }

/* === INDEX REDESIGN · about-author + rich footer (iCafeFX match) === */
.about-author {
  margin: 64px 0 48px;
  padding: 48px 0;
  border-top: 1px solid var(--gold-line);
  scroll-margin-top: 100px;
}
.about-author h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  color: var(--fg);
}
.about-lead,
.about-bio {
  max-width: 720px;
  margin: 0 0 16px;
  color: var(--fg-dim);
  font-size: 17px;
  line-height: 1.75;
}
.about-author strong { color: var(--fg); font-weight: 600; }

.rich-footer {
  border-top: 1px solid var(--gold-line);
  padding: 64px 0 32px;
  margin-top: 0;
  color: var(--fg-dim);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(2, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}
.footer-col h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--fg-dim);
  margin: 0 0 16px;
  font-weight: 600;
}
.footer-blurb {
  margin: 0;
  line-height: 1.7;
  color: var(--fg-dim);
  font-size: 14px;
}
.footer-col a {
  display: block;
  color: var(--fg-dim);
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--gold-line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
}
.network-row {
  margin-top: 32px;
  text-align: center;
}
.network-label {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--fg-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.network-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 8px;
  font-size: 13px;
}
.network-links a {
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.network-links a:hover { color: var(--gold); }
.net-sep { color: var(--gold-line); user-select: none; }
.footer-disclaimer {
  margin: 24px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--fg-dim);
}
/* Histats — track-only: hide all counter widgets (dynamic ids + canvas from js15_as.js) */
#histats_counter,
[id^="histats_counter"],
[id*="histats_counter"] canvas,
a[href*="histats.com"],
img[src*="histats.com"],
iframe[src*="histats.com"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  pointer-events: none !important;
}
.histats-wrap {
  display: none !important;
  border-top: none;
  padding: 0;
  margin: 0;
  height: 0;
  overflow: hidden;
}
#histats_counter {
  display: none !important;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.histats-box {
  display: inline-block;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--gold-line);
  border-radius: var(--r-lg);
}
.histats-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .about-author { margin: 48px 0 32px; padding: 32px 0; }
}

/* === CARD TYPOGRAPHY · v1124g · grid index only (not chapter h1) === */
.chapters-grid .chapter-card.mpv107-card {
  padding: 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
}

.chapters-grid .chapter-card .card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chapters-grid .chapter-card .chapter-number {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #D4A853;
  letter-spacing: 0.04em;
  margin: 0;
}

.chapters-grid .chapter-card h3.chapter-title {
  font-family: 'Sarabun', sans-serif;
  font-size: clamp(1.05rem, 1.08rem + 0.12vw, 1.3rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  margin: 0;
  color: var(--fg);
  word-break: normal;
  overflow-wrap: break-word;
  line-break: auto;
  hyphens: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.chapters-grid .chapter-card .chapter-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--fg-mute);
  margin: 0;
  word-break: normal;
  overflow-wrap: break-word;
  line-break: auto;
  hyphens: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.chapters-grid .chapter-card .chapter-arrow {
  margin-top: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

/* === PREMIUM chapter redesign · v1124i === */
.chapter-premium {
  --premium-bg: #0a0e16;
  --premium-surface: #131a26;
  --premium-surface2: #0f1520;
  --premium-gold-soft: #e7c87f;
  --premium-muted: #9a968c;
  --premium-muted2: #6f6c64;
  --premium-line: rgba(212, 168, 83, 0.18);
  --premium-line2: rgba(255, 255, 255, 0.06);
  line-height: 1.75;
}

.chapter-premium .chapter-page {
  display: block;
  padding: 32px 0 80px;
}

.chapter-premium .chapter-header {
  margin-bottom: 36px;
  padding-bottom: 0;
}

.chapter-premium .chapter-header .section-eyebrow {
  margin-bottom: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--premium-muted2);
}

.chapter-premium .chapter-header .section-eyebrow::before {
  width: 20px;
  height: 2px;
  background: var(--gold);
}

.chapter-premium .chapter-title {
  font-family: var(--font-body);
  font-size: clamp(1.75rem, 4.5vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.chapter-premium .chapter-hero,
.chapter-premium .hero-sub {
  font-size: 1.05rem;
  color: var(--premium-muted);
  font-weight: 400;
  line-height: 1.75;
  margin-bottom: 18px;
}

.chapter-premium .chapter-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 28px;
  padding: 6px 14px;
  background: rgba(212, 168, 83, 0.08);
  border: 1px solid var(--premium-line);
  border-left: 1px solid var(--premium-line);
  border-radius: 999px;
  color: var(--premium-gold-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.chapter-premium .chapter-badge strong {
  color: var(--premium-gold-soft);
  font-weight: 600;
}

.chapter-premium .manual-video-preview {
  margin-bottom: 48px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.chapter-premium .manual-video-preview h3 {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--premium-muted2);
  margin: 0 0 10px;
  letter-spacing: 0.02em;
}

.chapter-premium .clip-wrap video {
  border-radius: 16px;
  border: 1px solid var(--premium-line2);
  aspect-ratio: 16 / 9;
}

.chapter-premium .clip-note {
  font-size: 0.82rem;
  color: var(--premium-muted2);
  margin-top: 10px;
}

.chapter-premium .section {
  margin-bottom: 50px;
  scroll-margin-top: 96px;
}

.chapter-premium .section .section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.chapter-premium .section .section-eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--gold);
  flex-shrink: 0;
}

.chapter-premium .section h2 {
  font-family: var(--font-body);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.chapter-premium .section h3 {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 600;
}

.chapter-premium .section p {
  font-size: 1rem;
  color: var(--premium-muted);
  line-height: 1.75;
}

.chapter-premium .section strong,
.chapter-premium .section b {
  color: var(--premium-gold-soft);
  font-weight: 600;
}

.chapter-premium .tldr-card {
  background: var(--premium-surface);
  border: 1px solid var(--premium-line2);
  border-left: 3px solid var(--gold);
  border-radius: 0 14px 14px 0;
  padding: 22px 26px;
  margin: 0 0 8px;
}

.chapter-premium .tldr-card .tldr-list {
  list-style: none;
  background: transparent;
  border: none;
  border-left: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chapter-premium .tldr-card .tldr-list li {
  display: flex;
  gap: 12px;
  padding: 0;
  font-size: 1rem;
  color: var(--fg);
  border: none;
}

.chapter-premium .tldr-card .tldr-list li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 11px;
  position: static;
}

.chapter-premium .tldr-card .tldr-list li + li {
  border-top: none;
}

.chapter-premium .faq-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--premium-line2);
}

.chapter-premium .faq-item:last-child {
  border-bottom: none;
}

.chapter-premium .faq-question {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--fg);
}

.chapter-premium .faq-question::before {
  content: "Q";
  font-family: var(--font-body);
  font-style: normal;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.chapter-premium .faq-answer {
  color: var(--premium-muted);
  padding-left: 24px;
  font-size: 0.98rem;
  line-height: 1.75;
}

.chapter-premium .pro-tip {
  background: var(--premium-surface);
  border: 1px solid var(--premium-line2);
  border-radius: 14px;
  padding: 24px 28px;
}

.chapter-premium .pro-tip blockquote {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 1rem;
  line-height: 1.75;
  border-left: 3px solid var(--gold);
  padding-left: 18px;
}

.chapter-premium .disclaimer-inline {
  margin: 48px 0 32px;
  padding: 16px 20px;
  background: var(--premium-surface2);
  border: 1px solid var(--premium-line2);
  border-left: none;
  border-radius: 12px;
  font-size: 0.86rem;
  color: var(--premium-muted2);
  line-height: 1.65;
}

.chapter-premium #see-also.section .section-eyebrow,
.chapter-premium #see-also.section h2 {
  /* See-also unchanged structurally */
}

@media (max-width: 767px) {
  .chapter-premium .chapter-main {
    max-width: 100%;
  }
  .chapter-premium .tldr-card {
    padding: 18px 20px;
  }
}

/* skip-link (staging theme) */
.skip-link{position:absolute;left:-9999px;top:0;background:var(--gold);color:#0a0a0c;padding:8px 14px;border-radius:0 0 8px 0;z-index:9999;font-size:14px;text-decoration:none;}
.skip-link:focus{left:0;}

/* ============================================================
   Step 03 — breadcrumbs + topnav search (no Font Awesome)
   ============================================================ */
/* Breadcrumbs: text divider › (FA-free fix). Plugin renders the divider as
   <i class=""></i> after each non-last crumb; we paint the glyph via ::before. */
#breadcrumbs{
  max-width:1100px;margin:14px auto 0;padding:6px 24px 0;
  display:flex;flex-wrap:wrap;align-items:center;gap:0;
  font-size:.82rem;line-height:1.6;color:var(--fg-dim);
}
/* Chapter shell: keep breadcrumb block separate from jump-nav (no text overlap) */
.chapter-premium #breadcrumbs{
  position:relative;z-index:2;clear:both;
  margin-bottom:14px;padding-bottom:12px;
  background:var(--bg,#0a0a0c);
}
.chapter-premium .chapter-main > .jump-nav:first-child{
  position:relative;z-index:1;clear:both;margin-top:0;
}
#breadcrumbs a{color:var(--fg-dim) !important;text-decoration:none;}
#breadcrumbs a:hover span[itemprop="name"]{color:var(--gold) !important;}
#breadcrumbs span[itemprop="itemListElement"]{display:inline-flex;align-items:center;}
#breadcrumbs span[itemprop="itemListElement"]:last-child span[itemprop="name"]{color:var(--gold) !important;}
#breadcrumbs i{font-style:normal;display:inline-block;margin:0 8px;color:var(--fg-mute) !important;}
#breadcrumbs i::before{content:"\203A";} /* › */

/* Topnav search box (TNTSearch, dropdown:false) */
.topnav .nav-actions .tntsearch-form{display:inline-flex;align-items:center;margin:0;position:relative;}
.topnav .nav-actions #tntsearch-wrapper{position:relative;display:inline-flex;align-items:center;}
.topnav .nav-actions .tntsearch-field{
  background:var(--bg-elev);border:1px solid var(--gold-line);color:var(--fg);
  border-radius:8px;padding:6px 12px;font-size:.85rem;width:170px;max-width:42vw;
}
.topnav .nav-actions .tntsearch-field::placeholder{color:var(--fg-mute);}
.topnav .nav-actions .tntsearch-field:focus{outline:none;border-color:var(--gold);}
.topnav .nav-actions .tntsearch-clear{position:absolute;right:10px;color:var(--fg-mute);cursor:pointer;}
.topnav .nav-actions .tntsearch-results{
  position:absolute;top:calc(100% + 6px);right:0;min-width:280px;max-width:420px;z-index:60;
  background:var(--bg-card);border:1px solid var(--line);border-radius:10px;
  max-height:60vh;overflow:auto;box-shadow:0 18px 40px rgba(0,0,0,.45);
}
.topnav .nav-actions .tntsearch-results:empty{display:none;}
.topnav .nav-actions .tntsearch-powered-by{display:none;}

/* In-page search results (/search) */
.tntsearch-results-inpage{margin-top:18px;}
.tntsearch-results-inpage .tnt-result,
.tntsearch-results-inpage li{padding:14px 0;border-bottom:1px solid var(--line);}
.tntsearch-results-inpage a{color:var(--gold) !important;text-decoration:none;font-weight:600;}
.tntsearch-results-inpage a:hover{text-decoration:underline;}
.tntsearch-field-inpage{
  width:100%;background:var(--bg-elev);border:1px solid var(--gold-line);color:var(--fg);
  border-radius:10px;padding:12px 16px;font-size:1rem;
}
.tntsearch-field-inpage:focus{outline:none;border-color:var(--gold);}

/* Responsive YouTube/iframe wrapper (Step 03 native-light) */
.video-embed{position:relative;width:100%;padding-top:56.25%;margin:24px 0;border-radius:12px;overflow:hidden;background:#000;}
.video-embed iframe{position:absolute;inset:0;width:100%;height:100%;border:0;}

/* Social share row (Step 03) */
.social-share{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:28px 0 8px;}
.social-share .share-label{color:var(--fg-mute);font-size:.85rem;}
.social-share a{
  display:inline-flex;align-items:center;gap:6px;padding:7px 14px;font-size:.85rem;
  border:1px solid var(--gold-line);border-radius:999px;color:var(--fg-dim) !important;text-decoration:none;
}
.social-share a:hover{border-color:var(--gold);color:var(--gold) !important;}

/* Footer network row mobile guard (Step 03 FIX P6): prevent overflow 320-375px */
.network-row{display:flex;flex-direction:column;align-items:center;flex-wrap:wrap;}
@media (max-width:375px){
  .network-row{margin-top:24px;padding:0 8px;}
  .network-label{font-size:9px;letter-spacing:0.18em;}
  .network-links{gap:3px 6px;font-size:12px;word-break:break-word;}
  .net-sep{margin:0 1px;}
}

/* Phase B mega: topnav search overflow guard <=480px (wrap search below links,
   prevents horizontal scroll on chapter pages; shared shell, improves WARP too) */
@media (max-width:480px){
  .topnav .nav-actions{flex-wrap:wrap;justify-content:flex-end;gap:10px 14px;}
  .topnav .nav-actions .tntsearch-field{max-width:58vw;}
}

/* Phase B mobile menu — final cascade (after all base rules; @media mobile only) */
@media (max-width: 767px) {
  body.chapter-premium #breadcrumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    height: auto !important;
    line-height: 1.45 !important;
    padding-inline-start: 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  body.chapter-premium #breadcrumbs::-webkit-scrollbar {
    display: none;
  }
  body.chapter-premium #breadcrumbs span[itemprop="itemListElement"] {
    display: inline-flex !important;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0 !important;
  }
  body.chapter-premium #breadcrumbs a,
  body.chapter-premium #breadcrumbs span[itemprop="name"] {
    white-space: nowrap !important;
  }

  /* DEEP SCAN mobile: prevent any element overflow at 375px */
  body.chapter-premium .chapter-main,
  body.chapter-premium .section,
  body.chapter-premium .download-cta {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  body.chapter-premium .section img,
  body.chapter-premium .clip-wrap video,
  body.chapter-premium blockquote,
  body.chapter-premium .tldr-card,
  body.chapter-premium .pro-tip {
    max-width: 100%;
    box-sizing: border-box;
  }
  body.chapter-premium .section img:not(.cta-buttons img) {
    height: auto;
  }

  /* Download CTA + app badges: stack centered, equal height, no overflow */
  body.chapter-premium .download-cta {
    padding: 28px 18px;
  }
  body.chapter-premium .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  body.chapter-premium .cta-buttons a {
    width: auto;
    justify-content: center;
  }
  body.chapter-premium .cta-buttons img {
    height: 46px;
    width: auto;
    max-width: 80vw;
  }

  /* Inter-chapter nav: stack so the "next" link does not wrap into a narrow column */
  body.chapter-premium .chapter-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  body.chapter-premium .chapter-nav .nav-all {
    text-align: center;
  }
  body.chapter-premium .chapter-nav a[rel="next"] {
    text-align: left !important;
    flex: none !important;
  }
}
