/* ============================================================
   RianThai Docs — theme for thaiphon documentation
   Ported from the static prototype and adapted for the mkdocs
   DOM: admonitions, tabbed blocks, highlight code fences,
   tables, permalink anchors, and the native TOC.
   ============================================================ */

/* Sarabun is loaded via Google Fonts <link> in base.html; its own CSS
   ships `unicode-range: U+0E01-0E5B, ...` for the Thai subset, so
   the browser reaches for Sarabun only when rendering Thai characters.
   Latin, Cyrillic, IPA, and every other script fall through to the
   theme's normal stack. No span wrappers required. */

/* --- Design Tokens --- */
:root {
  --rt-navy: #16133a;
  --rt-navy-soft: #1e1a4a;
  --rt-indigo: #2d2768;
  --rt-purple: #5a3e9e;
  --rt-purple-light: #7c63bf;

  --rt-gold: #c49a3c;
  --rt-gold-bright: #d4af5a;
  --rt-gold-pale: #f0dca8;
  --rt-gold-glow: rgba(196, 154, 60, 0.15);
  --rt-gold-accessible: #8a6a1e;

  --rt-cream: #faf7f0;
  --rt-warm-white: #fffdf8;

  --rt-text: #2a2640;
  --rt-text-muted: #6f6b82;
  --rt-text-light: #9994ab;
  --rt-text-inverse: #f0edf7;

  --rt-green: #2a8a5c;
  --rt-green-soft: #e8f5ee;
  --rt-red: #c44040;
  --rt-blue: #3574c4;
  --rt-teal: #14695d;

  --rt-border: #e8e4dd;
  --rt-border-light: #f0ece5;

  --rt-shadow-sm: 0 1px 3px rgba(22, 19, 58, 0.06);
  --rt-shadow-md: 0 4px 16px rgba(22, 19, 58, 0.08);
  --rt-shadow-lg: 0 8px 32px rgba(22, 19, 58, 0.10);
  --rt-shadow-gold: 0 4px 20px rgba(196, 154, 60, 0.20);

  --font-thai: 'Prompt', 'Sarabun', sans-serif;
  --font-thai-body: 'Sarabun', sans-serif;
  --font-latin: 'Sarabun', 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Sarabun', 'Fira Mono', SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --rt-code-bg: #1a1740;
  --rt-code-fg: #e9e4f8;
  --rt-code-muted: #9a93c2;
  --rt-code-keyword: #f0dca8;
  --rt-code-string: #a6d9c4;
  --rt-code-comment: #6f6b82;
  --rt-code-name: #d4af5a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

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

body.rt-theme {
  font-family: var(--font-latin);
  color: var(--rt-text);
  background: var(--rt-cream) !important;
  line-height: 1.65;
  overflow-x: hidden;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.rt-theme a { text-decoration: none; transition: color .2s; }
body.rt-theme img { max-width: 100%; height: auto; }

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

/* Scoped prose link colour */
.rt-article a,
.rt-breadcrumb a,
.rt-page-head__lede a,
.rt-note a { color: var(--rt-purple); }
.rt-article a:hover,
.rt-breadcrumb a:hover,
.rt-page-head__lede a:hover,
.rt-note a:hover { color: var(--rt-purple-light); }

/* --- Layout --- */
.rt-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.rt-main { flex: 1 0 auto; }

/* --- Thai text helpers --- */
.thai { font-family: var(--font-thai); }
.thai-body { font-family: var(--font-thai-body); }

/* --- Navigation --- */
.rt-nav {
  background: var(--rt-navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(196, 154, 60, 0.15);
}
.rt-nav__inner {
  display: flex;
  align-items: center;
  height: 60px;
  gap: .75rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.rt-nav__logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}
.rt-nav__logo-thai {
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--rt-gold);
  letter-spacing: .02em;
}
.rt-nav__logo-latin {
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: .8rem;
  color: var(--rt-text-light);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-top: 2px;
}
.rt-nav__logo-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,.12);
  margin: 0 .15rem;
}
.rt-nav__logo-section {
  font-family: var(--font-latin);
  font-size: .82rem;
  font-weight: 600;
  color: var(--rt-text-inverse);
  letter-spacing: .01em;
  text-decoration: none;
}
.rt-nav__logo-section::before { content: 'docs / '; color: var(--rt-text-light); font-weight: 500; }

.rt-nav__links {
  display: flex;
  align-items: center;
  gap: .1rem;
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
}
.rt-nav__links li { flex-shrink: 0; position: relative; }
/* Mobile-only GitHub entry inside the hamburger drawer; hidden elsewhere. */
.rt-nav__mobile-github { display: none; }
.rt-nav a.rt-nav__link,
.rt-nav button.rt-nav__link {
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: .85rem;
  color: var(--rt-text-inverse);
  padding: .4rem .65rem;
  border-radius: var(--radius-sm);
  transition: all .2s;
  opacity: .85;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: none;
  border: none;
  cursor: pointer;
}
.rt-nav a.rt-nav__link:hover,
.rt-nav button.rt-nav__link:hover { opacity: 1; background: rgba(255,255,255,.08); color: var(--rt-gold-bright); }
.rt-nav a.rt-nav__link.active,
.rt-nav button.rt-nav__link.active { opacity: 1; color: var(--rt-gold-bright); background: rgba(196,154,60,.1); }
.rt-nav__more-caret { font-size: .65rem; opacity: .7; }

/* More dropdown */
.rt-nav__more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--rt-navy-soft);
  border: 1px solid rgba(196,154,60,.25);
  border-radius: var(--radius-md);
  padding: .4rem;
  list-style: none;
  margin: 0;
  box-shadow: var(--rt-shadow-lg);
  display: none;
  z-index: 1001;
}
.rt-nav__more-menu[data-open="true"] { display: block; }
.rt-nav__more-menu li { display: block; }
.rt-nav__more-menu a {
  display: block;
  font-family: var(--font-latin);
  font-weight: 500;
  font-size: .86rem;
  color: var(--rt-text-inverse);
  padding: .5rem .7rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  opacity: .9;
  transition: all .15s;
}
.rt-nav__more-menu a:hover,
.rt-nav__more-menu a.active {
  background: rgba(196,154,60,.12);
  color: var(--rt-gold-bright);
  opacity: 1;
}

.rt-nav__right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; margin-left: auto; }
.rt-nav__version {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--rt-gold-pale);
  background: rgba(196,154,60,.1);
  border: 1px solid rgba(196,154,60,.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: .02em;
}
.rt-nav__github {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.8);
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.15);
  transition: all .2s;
  text-decoration: none;
}
.rt-nav__github:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(196,154,60,.4); }

/* Mobile hamburger */
.rt-nav__toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: var(--rt-text-inverse);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}
.rt-nav__toggle:hover { background: rgba(255,255,255,.08); }

/* --- Hero --- */
.rt-hero {
  background: linear-gradient(135deg, var(--rt-navy) 0%, var(--rt-navy-soft) 50%, var(--rt-indigo) 100%);
  position: relative;
  overflow: hidden;
  padding: 5rem 0 3.5rem;
}
.rt-hero::before {
  content: '\0E20';
  font-family: var(--font-thai);
  font-weight: 800;
  font-size: clamp(280px, 32vw, 460px);
  color: rgba(196, 154, 60, .04);
  position: absolute;
  right: -2%;
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
  pointer-events: none;
}
.rt-hero::after {
  content: '';
  position: absolute;
  top: -80px; left: -80px;
  width: 280px; height: 280px;
  border: 1px solid rgba(196, 154, 60, .08);
  border-radius: 50%;
  pointer-events: none;
}
.rt-hero__inner { position: relative; z-index: 1; }
.rt-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(196, 154, 60, .12);
  border: 1px solid rgba(196, 154, 60, .2);
  color: var(--rt-gold-pale);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  letter-spacing: .02em;
}
.rt-hero__badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rt-gold);
  box-shadow: 0 0 0 3px rgba(196,154,60,.25);
}
.rt-hero__title {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3rem);
  color: #fff;
  line-height: 1.15;
  max-width: 720px;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}
.rt-hero__title .gold { color: var(--rt-gold-bright); font-family: var(--font-mono); font-weight: 500; }
.rt-hero__title .thai { font-family: var(--font-thai); font-weight: 700; }
.rt-hero__sub {
  font-family: var(--font-latin);
  font-size: 1.08rem;
  color: rgba(255, 255, 255, .65);
  max-width: 620px;
  margin: 0 0 2rem;
  line-height: 1.65;
}
.rt-hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; }

/* --- Buttons --- */
.rt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: .92rem;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  line-height: 1;
}
.rt-btn.rt-btn--gold,
body.rt-theme a.rt-btn--gold { background: var(--rt-gold); color: var(--rt-navy); }
.rt-btn.rt-btn--gold:hover,
body.rt-theme a.rt-btn--gold:hover { background: var(--rt-gold-bright); color: var(--rt-navy); box-shadow: var(--rt-shadow-gold); transform: translateY(-2px); }
.rt-btn.rt-btn--outline,
body.rt-theme a.rt-btn--outline { background: transparent; color: var(--rt-gold-pale); border: 1px solid rgba(196,154,60,.3); }
.rt-btn.rt-btn--outline:hover,
body.rt-theme a.rt-btn--outline:hover { background: rgba(196,154,60,.1); border-color: var(--rt-gold); color: var(--rt-gold-bright); }
.rt-btn--sm { font-size: .82rem; padding: 8px 18px; }

/* --- Breadcrumb --- */
.rt-breadcrumb {
  padding: 1.25rem 0 .5rem;
  font-size: .85rem;
  color: var(--rt-text-muted);
}
.rt-breadcrumb a { color: var(--rt-purple); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(90,62,158,.5); }
.rt-breadcrumb a:hover { color: var(--rt-gold-accessible); text-decoration-color: rgba(196,154,60,.5); }
.rt-breadcrumb__sep { margin: 0 .5rem; color: var(--rt-text-light); }

/* --- Section / Eyebrow --- */
.rt-section { padding: 4.5rem 0; }
.rt-section--tight { padding: 3rem 0; }
.rt-section__header { margin-bottom: 2.5rem; }
.rt-section__header--center { text-align: center; margin-bottom: 3rem; }
.rt-section__eyebrow {
  font-family: var(--font-latin);
  font-size: .74rem;
  font-weight: 700;
  color: var(--rt-gold-accessible);
  text-transform: uppercase;
  letter-spacing: .18em;
  margin-bottom: .6rem;
}
.rt-section__title {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  color: var(--rt-text);
  line-height: 1.2;
  margin: 0 0 .4rem;
  letter-spacing: -0.01em;
}
.rt-section__subtitle {
  font-size: 1rem;
  color: var(--rt-text-muted);
  margin: .25rem 0 0;
  max-width: 620px;
}
.rt-section__header--center .rt-section__subtitle { margin-left: auto; margin-right: auto; }

/* --- Feature cards --- */
.rt-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.rt-feature-card {
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all .3s cubic-bezier(.25,.46,.45,.94);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}
.rt-feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--rt-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
.rt-feature-card:hover { border-color: var(--rt-gold-pale); box-shadow: var(--rt-shadow-md); transform: translateY(-4px); }
.rt-feature-card:hover::before { transform: scaleX(1); }
.rt-feature-card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.2rem;
  color: #fff;
}
.rt-feature-card__icon--api      { background: linear-gradient(135deg, var(--rt-indigo), var(--rt-purple)); }
.rt-feature-card__icon--arch     { background: linear-gradient(135deg, #b88a2b, var(--rt-gold)); }
.rt-feature-card__icon--renderers{ background: linear-gradient(135deg, #0f5a4f, var(--rt-teal)); }
.rt-feature-card__icon--phon     { background: linear-gradient(135deg, #814035, var(--rt-red)); }
.rt-feature-card__icon--testing  { background: linear-gradient(135deg, #2a5e9e, var(--rt-blue)); }
.rt-feature-card__icon--scheme   { background: linear-gradient(135deg, var(--rt-navy), var(--rt-indigo)); color: var(--rt-gold-pale); }
.rt-feature-card__title {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--rt-text);
  margin: 0 0 .4rem;
}
.rt-feature-card__desc { font-size: .9rem; color: var(--rt-text-muted); line-height: 1.6; margin: 0; }
.rt-feature-card__meta {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--rt-gold-accessible);
  letter-spacing: .05em;
}

/* --- Page header --- */
.rt-page-head {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--rt-border-light);
  background: linear-gradient(180deg, rgba(196,154,60,.04), transparent);
}
.rt-page-head h1 {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  color: var(--rt-text);
  line-height: 1.15;
  margin: .25rem 0 .5rem;
  letter-spacing: -0.015em;
}
.rt-page-head__lede {
  font-size: 1.05rem;
  color: var(--rt-text-muted);
  max-width: 720px;
  margin: 0;
  line-height: 1.6;
}
.rt-page-head__meta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--rt-gold-accessible);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 700;
}

/* --- Docs layout (TOC sidebar + article) --- */
.rt-docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
  padding: 2.5rem 0 5rem;
}
.rt-docs-layout--no-toc {
  grid-template-columns: 1fr;
}

.rt-toc {
  position: sticky;
  top: 80px;
  padding: 1.25rem 1rem 1.25rem .75rem;
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border-light);
  border-radius: var(--radius-md);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.rt-toc__title {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--rt-text-muted);
  margin-bottom: 1rem;
}
.rt-toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1px; }
.rt-toc ul ul { margin-top: 2px; padding-left: 0; }
.rt-toc a {
  display: block;
  font-size: .88rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--rt-text-muted);
  transition: all .2s;
  border-left: 2px solid transparent;
  text-decoration: none;
  line-height: 1.4;
}
.rt-toc a:hover { color: var(--rt-text); background: var(--rt-gold-glow); }
.rt-toc a.active { color: var(--rt-gold-accessible); background: rgba(196,154,60,.07); border-left-color: var(--rt-gold); font-weight: 600; }
.rt-toc ul ul a { padding-left: 24px; font-size: .82rem; }
.rt-toc ul ul ul a { padding-left: 36px; font-size: .8rem; }

/* --- Prose (inside .rt-article) --- */
.rt-article { min-width: 0; max-width: 820px; }
/* Home article already has the hero H1; hide the markdown-generated one
   plus any immediate intro paragraph the hero lede already covers is not hidden
   (the intro paragraph still reads well below the hero). */
.rt-article--home > h1:first-child { display: none; }
.rt-article h1 {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.2vw, 2.5rem);
  color: var(--rt-text);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.015em;
}
.rt-article h2 {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--rt-text);
  margin: 3rem 0 .75rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 80px;
}
.rt-article h2:first-child { margin-top: 0; }
.rt-article h2::before {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: var(--rt-gold);
  border-radius: 2px;
  margin-bottom: .65rem;
}
.rt-article h3 {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--rt-text);
  margin: 2rem 0 .5rem;
  scroll-margin-top: 80px;
}
.rt-article h4 {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--rt-text);
  margin: 1.5rem 0 .4rem;
  scroll-margin-top: 80px;
}
.rt-article p { margin: 0 0 1rem; line-height: 1.75; }
.rt-article ul, .rt-article ol { margin: 0 0 1rem; padding-left: 1.35rem; line-height: 1.75; }
.rt-article li { margin-bottom: .25rem; }
.rt-article li > p { margin-bottom: .35rem; }
.rt-article strong { color: var(--rt-text); font-weight: 700; }
.rt-article hr {
  border: none;
  border-top: 1px solid var(--rt-border-light);
  margin: 2.5rem 0;
}
.rt-article blockquote {
  border-left: 3px solid var(--rt-gold);
  padding: .5rem 1rem;
  margin: 1.25rem 0;
  color: var(--rt-text-muted);
  background: rgba(196,154,60,.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.rt-article blockquote p:last-child { margin-bottom: 0; }

/* Inline code */
.rt-article p code,
.rt-article li code,
.rt-article td code,
.rt-article th code,
.rt-article h1 code,
.rt-article h2 code,
.rt-article h3 code,
.rt-article h4 code,
.rt-article blockquote code,
.rt-note code,
.rt-page-head__lede code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: rgba(45, 39, 104, .06);
  border: 1px solid rgba(45, 39, 104, .12);
  border-radius: 4px;
  padding: .1em .4em;
  color: var(--rt-indigo);
  white-space: nowrap;
}

/* Inside tables, long inline code must wrap — otherwise the cell's intrinsic
   minimum width blows past narrow viewports and forces the whole page to
   scroll horizontally. Same for raw long tokens without spaces. */
.rt-article td,
.rt-article th {
  overflow-wrap: anywhere;
}
.rt-article td code,
.rt-article th code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Permalink anchors (pymdownx) */
.rt-article .headerlink {
  opacity: 0;
  margin-left: .4em;
  color: var(--rt-gold-accessible);
  font-weight: 400;
  text-decoration: none;
  transition: opacity .15s;
}
.rt-article h1:hover .headerlink,
.rt-article h2:hover .headerlink,
.rt-article h3:hover .headerlink,
.rt-article h4:hover .headerlink { opacity: 1; }

/* --- Code blocks (pymdownx.highlight) --- */
.rt-article .highlight,
.rt-article .highlighttable {
  background: var(--rt-code-bg);
  color: var(--rt-code-fg);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: .88rem;
  line-height: 1.65;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--rt-shadow-md);
  border: 1px solid rgba(255,255,255,.04);
  position: relative;
}
.rt-article .highlight pre,
.rt-article .highlighttable pre {
  margin: 0;
  padding: 1rem 1.25rem 1.15rem;
  overflow-x: auto;
  background: transparent;
}
.rt-article .highlight pre code,
.rt-article .highlighttable pre code {
  font-family: inherit;
  background: none;
  padding: 0;
  color: inherit;
  border: none;
  white-space: pre;
  font-size: inherit;
}
.rt-article .highlighttable {
  display: block;
}
.rt-article .highlighttable > tbody,
.rt-article .highlighttable > tbody > tr { display: block; }
.rt-article .highlighttable td { display: block; padding: 0; border: none; }
.rt-article .highlighttable .linenos {
  display: none;
}

/* Minimal floating copy button injected by copy-code.js — no window chrome,
   no traffic-light dots, just a small control anchored to the top-right. */
.rt-code-copy {
  position: absolute;
  top: .55rem;
  right: .6rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,.12);
  color: var(--rt-code-muted);
  font-family: var(--font-mono);
  font-size: .72rem;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  opacity: 0;
}
.rt-article .highlight:hover .rt-code-copy,
.rt-article .highlighttable:hover .rt-code-copy,
.rt-code-copy:focus-visible { opacity: 1; }
.rt-code-copy:hover { border-color: var(--rt-gold); color: var(--rt-gold-pale); }

/* Pygments tokens (default pymdownx palette, adjusted for cream/navy) */
.rt-article .highlight .k, .rt-article .highlight .kd, .rt-article .highlight .kn, .rt-article .highlight .kr { color: var(--rt-code-keyword); }
.rt-article .highlight .s, .rt-article .highlight .s1, .rt-article .highlight .s2, .rt-article .highlight .sb { color: var(--rt-code-string); }
.rt-article .highlight .c, .rt-article .highlight .c1, .rt-article .highlight .cm { color: var(--rt-code-comment); font-style: italic; }
.rt-article .highlight .nf, .rt-article .highlight .fm { color: var(--rt-code-name); }
.rt-article .highlight .nb { color: #c9bff5; }
.rt-article .highlight .nn { color: #b5a7e8; }
.rt-article .highlight .mi, .rt-article .highlight .mf { color: #e4b072; }
.rt-article .highlight .o { color: var(--rt-code-muted); }
.rt-article .highlight .p { color: var(--rt-text-light); }
.rt-article .highlight .n { color: var(--rt-code-fg); }
.rt-article .highlight .cp { color: #e4b072; }
.rt-article .highlight .err { color: #ff8b8b; background: transparent; }

/* Inline highlighted code (pymdownx.inlinehilite) */
.rt-article p > code.highlight,
.rt-article li > code.highlight { background: rgba(45,39,104,.06); color: var(--rt-indigo); }

/* --- Admonitions (pymdownx.admonition) --- */
.rt-article .admonition,
.rt-article details.admonition {
  background: var(--rt-cream);
  border-left: 3px solid var(--rt-gold);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .94rem;
  color: var(--rt-text);
  line-height: 1.65;
}
.rt-article .admonition > .admonition-title,
.rt-article details.admonition > summary {
  display: block;
  font-family: var(--font-latin);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--rt-gold-accessible);
  margin: 0 0 .4rem;
  padding: 0;
  cursor: default;
}
.rt-article details.admonition > summary { cursor: pointer; }
.rt-article .admonition > :nth-child(2) { margin-top: 0; }
.rt-article .admonition > :last-child { margin-bottom: 0; }
.rt-article .admonition p { margin-bottom: .5rem; }
.rt-article .admonition p:last-child { margin-bottom: 0; }

.rt-article .admonition.note,
.rt-article .admonition.info,
.rt-article .admonition.abstract,
.rt-article .admonition.summary {
  background: rgba(45,39,104,.04);
  border-left-color: var(--rt-indigo);
}
.rt-article .admonition.note > .admonition-title,
.rt-article .admonition.info > .admonition-title,
.rt-article .admonition.abstract > .admonition-title,
.rt-article .admonition.summary > .admonition-title { color: var(--rt-indigo); }

.rt-article .admonition.tip,
.rt-article .admonition.hint,
.rt-article .admonition.success {
  background: var(--rt-green-soft);
  border-left-color: var(--rt-green);
}
.rt-article .admonition.tip > .admonition-title,
.rt-article .admonition.hint > .admonition-title,
.rt-article .admonition.success > .admonition-title { color: var(--rt-green); }

.rt-article .admonition.warning,
.rt-article .admonition.caution,
.rt-article .admonition.attention {
  background: rgba(196,154,60,.08);
  border-left-color: var(--rt-gold);
}

.rt-article .admonition.danger,
.rt-article .admonition.error,
.rt-article .admonition.failure,
.rt-article .admonition.bug {
  background: rgba(196,64,64,.05);
  border-left-color: var(--rt-red);
}
.rt-article .admonition.danger > .admonition-title,
.rt-article .admonition.error > .admonition-title,
.rt-article .admonition.failure > .admonition-title,
.rt-article .admonition.bug > .admonition-title { color: var(--rt-red); }

.rt-article .admonition.example,
.rt-article .admonition.quote {
  background: rgba(90,62,158,.04);
  border-left-color: var(--rt-purple);
}
.rt-article .admonition.example > .admonition-title,
.rt-article .admonition.quote > .admonition-title { color: var(--rt-purple); }

/* --- Tabbed blocks (pymdownx.tabbed, alternate_style) --- */
.rt-article .tabbed-set {
  display: flex;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  position: relative;
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.rt-article .tabbed-set > input { display: none; }
.rt-article .tabbed-labels {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--rt-border-light);
  background: rgba(196,154,60,.04);
  overflow-x: auto;
  width: 100%;
  list-style: none;
  padding: 0 .5rem;
  margin: 0;
}
.rt-article .tabbed-labels > label {
  font-family: var(--font-latin);
  font-weight: 600;
  font-size: .92rem;
  color: var(--rt-text-muted);
  padding: .75rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.rt-article .tabbed-labels > label:hover { color: var(--rt-text); background: rgba(196,154,60,.06); }
.rt-article .tabbed-content { width: 100%; padding: 1.25rem 1.5rem; }
.rt-article .tabbed-block { display: none; }
.rt-article .tabbed-set > input:nth-child(1):checked ~ .tabbed-content > .tabbed-block:nth-child(1),
.rt-article .tabbed-set > input:nth-child(2):checked ~ .tabbed-content > .tabbed-block:nth-child(2),
.rt-article .tabbed-set > input:nth-child(3):checked ~ .tabbed-content > .tabbed-block:nth-child(3),
.rt-article .tabbed-set > input:nth-child(4):checked ~ .tabbed-content > .tabbed-block:nth-child(4),
.rt-article .tabbed-set > input:nth-child(5):checked ~ .tabbed-content > .tabbed-block:nth-child(5),
.rt-article .tabbed-set > input:nth-child(6):checked ~ .tabbed-content > .tabbed-block:nth-child(6) { display: block; }
.rt-article .tabbed-set > input:nth-child(1):checked ~ .tabbed-labels > label:nth-child(1),
.rt-article .tabbed-set > input:nth-child(2):checked ~ .tabbed-labels > label:nth-child(2),
.rt-article .tabbed-set > input:nth-child(3):checked ~ .tabbed-labels > label:nth-child(3),
.rt-article .tabbed-set > input:nth-child(4):checked ~ .tabbed-labels > label:nth-child(4),
.rt-article .tabbed-set > input:nth-child(5):checked ~ .tabbed-labels > label:nth-child(5),
.rt-article .tabbed-set > input:nth-child(6):checked ~ .tabbed-labels > label:nth-child(6) {
  color: var(--rt-gold-accessible);
  border-bottom-color: var(--rt-gold);
}
.rt-article .tabbed-block > :first-child { margin-top: 0; }
.rt-article .tabbed-block > :last-child { margin-bottom: 0; }

/* --- Figures --- */
.rt-article figure {
  margin: 2rem 0 2.5rem;
  padding: 0;
}
.rt-article figure img,
.rt-article figure svg,
.rt-article figure object {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.rt-article figcaption {
  margin-top: .85rem;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--rt-text-muted);
  font-style: italic;
  text-align: center;
  padding: 0 1rem;
}
.rt-article figcaption code {
  font-style: normal;
  font-size: .85em;
  padding: 1px 5px;
  background: rgba(196,154,60,.08);
  border-radius: 3px;
  color: var(--rt-text);
}

/* Pipeline figure gets a little extra reverence */
.rt-pipeline-figure {
  position: relative;
  margin: 2.5rem 0 3rem !important;
}
.rt-pipeline-figure::before,
.rt-pipeline-figure::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,154,60,.4), transparent);
  margin: 0 auto;
  width: 60%;
}
.rt-pipeline-figure::before { margin-bottom: 1.25rem; }
.rt-pipeline-figure::after { margin-top: 1.25rem; }
.rt-pipeline-figure img { max-width: 720px; margin: 0 auto; }

/* --- Tables --- */
/* Wrapper injected by the on_page_content hook in src/hooks.py.
   Wide tables (e.g. the tone-derivation matrix) overflow horizontally
   within this wrapper instead of squishing columns; narrow tables look
   unchanged because the wrapper only scrolls when content exceeds it. */
.rt-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid var(--rt-border-light);
  border-radius: var(--radius-md);
  background: var(--rt-warm-white);
}
.rt-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: .93rem;
  background: transparent;
  border: none;
  border-radius: 0;
  table-layout: auto;
}
.rt-article table thead { background: rgba(196,154,60,.04); }
.rt-article table th {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--rt-text-muted);
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--rt-border);
}
.rt-article table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--rt-border-light);
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.rt-article table tr:last-child td { border-bottom: none; }
.rt-article table tr:hover td { background: rgba(196,154,60,.05); }

/* --- Callout / note boxes --- */
.rt-note {
  background: var(--rt-cream);
  border-left: 3px solid var(--rt-gold);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .94rem;
  color: var(--rt-text);
  line-height: 1.65;
}
.rt-note__label {
  display: inline-block;
  font-family: var(--font-latin);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--rt-gold-accessible);
  margin-bottom: .35rem;
}
.rt-note--info { background: rgba(45,39,104,.04); border-left-color: var(--rt-indigo); }
.rt-note--info .rt-note__label { color: var(--rt-indigo); }
.rt-note--warn { background: rgba(196,64,64,.04); border-left-color: var(--rt-red); }
.rt-note--warn .rt-note__label { color: var(--rt-red); }

/* --- Stat cards --- */
.rt-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.75rem 0;
}
.rt-stat-card {
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: border-color .2s, box-shadow .2s;
}
.rt-stat-card:hover { border-color: var(--rt-gold-pale); box-shadow: var(--rt-shadow-sm); }
.rt-stat-card__value {
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: 2rem;
  color: var(--rt-indigo);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.rt-stat-card__unit {
  font-size: .82rem;
  font-weight: 600;
  color: var(--rt-text-muted);
  margin-left: .25rem;
}
.rt-stat-card__label {
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: .82rem;
  color: var(--rt-text);
  margin-top: .5rem;
  letter-spacing: .02em;
}
.rt-stat-card__note {
  font-size: .75rem;
  color: var(--rt-text-muted);
  margin-top: .2rem;
  line-height: 1.45;
}

/* --- Scheme comparison cards --- */
.rt-scheme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.rt-scheme-card {
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border-light);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.5rem;
  position: relative;
  transition: all .2s;
}
.rt-scheme-card:hover { border-color: var(--rt-gold-pale); box-shadow: var(--rt-shadow-sm); }
.rt-scheme-card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(196,154,60,.12);
  color: var(--rt-gold-accessible);
  letter-spacing: .04em;
  margin-bottom: .6rem;
}
.rt-scheme-card__name { font-family: var(--font-latin); font-weight: 700; font-size: 1.1rem; color: var(--rt-text); margin: 0 0 .2rem; }
.rt-scheme-card__desc { font-size: .88rem; color: var(--rt-text-muted); margin: 0 0 .9rem; line-height: 1.55; }
.rt-scheme-card__sample {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem .85rem;
  background: var(--rt-cream);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--rt-border);
}
.rt-scheme-card__sample-thai { font-family: var(--font-thai-body); font-size: 1.3rem; color: var(--rt-text); font-weight: 600; }
.rt-scheme-card__sample-out { font-family: var(--font-mono); font-size: .92rem; color: var(--rt-indigo); font-weight: 500; }

/* --- Footer --- */
.rt-footer { background: var(--rt-navy); color: rgba(255,255,255,.55); padding: 4rem 0 2rem; position: relative; margin-top: 5rem; flex-shrink: 0; }
.rt-footer::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--rt-gold), transparent); }
.rt-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.rt-footer__brand-thai { font-family: var(--font-thai); font-weight: 700; font-size: 1.3rem; color: var(--rt-gold); margin-bottom: .4rem; }
.rt-footer__brand-section { font-family: var(--font-mono); font-size: .78rem; color: var(--rt-gold-pale); letter-spacing: .08em; margin-bottom: .75rem; }
.rt-footer__brand-desc { font-size: .88rem; line-height: 1.7; max-width: 320px; margin: 0; }
.rt-footer__heading { font-family: var(--font-latin); font-weight: 700; font-size: .78rem; color: rgba(255,255,255,.8); text-transform: uppercase; letter-spacing: .12em; margin: 0 0 1rem; }
.rt-footer__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.rt-footer .rt-footer__links a { color: rgba(255,255,255,.75); font-size: .88rem; line-height: 1.3; transition: color .2s; text-decoration: none; }
.rt-footer .rt-footer__links a:hover { color: var(--rt-gold-pale); }
.rt-footer__bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.06); font-size: .8rem; flex-wrap: wrap; gap: 1rem; }
.rt-footer__bottom a { color: var(--rt-gold-pale); }
.rt-footer__bottom a:hover { color: var(--rt-gold-bright); }
.rt-footer__bottom code { font-family: var(--font-mono); font-size: .78rem; background: rgba(255,255,255,.04); padding: 2px 8px; border-radius: 4px; color: var(--rt-gold-pale); }

/* --- Search (top-right, inline) --- */
.rt-search {
  position: relative;
  display: flex;
  align-items: center;
}
.rt-search__input {
  width: 150px;
  padding: 6px 12px 6px 32px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: var(--rt-text-inverse);
  font-family: var(--font-latin);
  font-size: .82rem;
  transition: all .2s;
}
.rt-search__input::placeholder { color: rgba(255,255,255,.45); }
.rt-search__input:focus {
  outline: none;
  width: 220px;
  background: rgba(255,255,255,.1);
  border-color: rgba(196,154,60,.4);
}
.rt-search__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.5);
  font-size: .85rem;
  pointer-events: none;
}
.rt-search__results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(420px, 90vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border);
  border-radius: var(--radius-md);
  box-shadow: var(--rt-shadow-lg);
  z-index: 1002;
  display: none;
  padding: .5rem;
}
.rt-search__results[data-open="true"] { display: block; }
.rt-search__result {
  display: block;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--rt-text);
  border-bottom: 1px solid var(--rt-border-light);
}
.rt-search__result:last-child { border-bottom: none; }
.rt-search__result:hover { background: var(--rt-cream); }
.rt-search__result-title { font-weight: 600; font-size: .9rem; color: var(--rt-indigo); }
.rt-search__result-snippet { font-size: .8rem; color: var(--rt-text-muted); line-height: 1.4; margin-top: 2px; }
.rt-search__empty { padding: .75rem; color: var(--rt-text-muted); font-size: .85rem; text-align: center; }

/* --- Cookie consent banner --- */
.rt-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1060;
  padding: 0 1rem 1rem;
}
.rt-consent__inner {
  max-width: 720px;
  margin: 0 auto;
  background: var(--rt-warm-white);
  border: 1px solid var(--rt-border);
  border-radius: .75rem;
  box-shadow: 0 -2px 16px rgba(0,0,0,.10);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
}
.rt-consent__text {
  flex: 1 1 300px;
  min-width: 0;
  font-size: .9rem;
  color: var(--rt-text);
  line-height: 1.5;
}
.rt-consent__link { color: var(--rt-gold-accessible); text-decoration: underline; text-underline-offset: 2px; }
.rt-consent__link:hover { color: var(--rt-gold); }
.rt-consent__actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.rt-consent .rt-btn--outline {
  color: var(--rt-text);
  border-color: var(--rt-border);
  background: transparent;
}
.rt-consent .rt-btn--outline:hover {
  color: var(--rt-text);
  background: var(--rt-cream);
  border-color: var(--rt-border);
}
.rt-consent .rt-btn--gold {
  background: var(--rt-gold-accessible);
  color: #fff;
}
.rt-consent .rt-btn--gold:hover {
  background: #755a18;
  color: #fff;
  box-shadow: none;
  transform: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .rt-docs-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .rt-toc { position: static; max-height: none; order: 2; }
  .rt-toc ul { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .rt-toc ul ul { flex-basis: 100%; padding-left: .5rem; }
  .rt-toc a { border-left: none; border-bottom: 2px solid transparent; padding: 6px 10px; font-size: .82rem; }
  .rt-toc a.active { border-bottom-color: var(--rt-gold); border-left-color: transparent; }
}

@media (max-width: 1100px) {
  .rt-search { display: none; }
}

@media (max-width: 900px) {
  .rt-nav__toggle { display: inline-flex; align-items: center; justify-content: center; order: 3; }
  .rt-nav__inner { flex-wrap: wrap; height: auto; min-height: 56px; padding-top: .5rem; padding-bottom: .5rem; }
  .rt-nav__links {
    order: 10;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    padding-bottom: .35rem;
    display: none;
  }
  .rt-nav__links[data-open="true"] { display: flex; }
  .rt-nav a.rt-nav__link,
  .rt-nav button.rt-nav__link { padding: .6rem .8rem; width: 100%; }
  .rt-nav__more-menu { position: static; width: 100%; box-shadow: none; background: transparent; border: none; padding-left: 1rem; }
  .rt-nav__right { margin-left: auto; }
  .rt-search { display: none; }
  .rt-nav__version { display: none; }
}

@media (max-width: 820px) {
  .rt-hero { padding: 3.5rem 0 2.5rem; }
  .rt-section { padding: 3rem 0; }
  .rt-footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .rt-footer__bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .rt-footer__grid { grid-template-columns: 1fr; }
  .rt-hero__title { font-size: 1.8rem; }

  /* Compact nav: keep the header on one row. Breadcrumb ("docs / thaiphon")
     is redundant with the hamburger-menu section labels. GitHub button
     is surfaced inside the hamburger drawer via .rt-nav__mobile-github. */
  .rt-nav__logo-sep,
  .rt-nav__logo-section,
  .rt-nav__github { display: none; }
  .rt-nav__mobile-github { display: list-item; }
  .rt-consent__inner {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: .85rem 1rem;
    gap: .65rem;
  }
  /* In column layout, flex-basis targets height; reset so the text row hugs its content. */
  .rt-consent__text { flex: 0 0 auto; }
  .rt-consent__actions { flex: 0 0 auto; justify-content: flex-end; }

  /* Tables at narrow widths: tighter padding + smaller type. Wide tables
     scroll horizontally inside their .rt-table-wrap parent; narrow tables
     still fit the viewport thanks to aggressive wrap-inside-cells. */
  .rt-article table:not(.highlighttable) { font-size: .85rem; }
  .rt-article table th,
  .rt-article table td {
    padding: .55rem .6rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .rt-article table th { font-size: .7rem; }
}

/* --- Print --- */
@media print {
  .rt-nav, .rt-footer, .rt-toc, .rt-breadcrumb, .rt-consent, .rt-search, .rt-nav__toggle { display: none !important; }
  body.rt-theme { background: #fff !important; }
  .rt-docs-layout { grid-template-columns: 1fr; }
  .rt-article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .75em; color: #666; }
  .rt-article .highlight { box-shadow: none; border: 1px solid #ccc; }
}

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

/* --- "Try it in your browser" callout --- */
.rt-article .callout {
  display: flex;
  gap: 16px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-radius: 10px;
  padding: 18px 20px;
  border-left: 4px solid #6366f1;
  margin: 1.5rem 0;
}
.rt-article .callout-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
  min-width: 220px;
}
.rt-article .callout-sub {
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: normal;
  text-transform: none;
  margin-top: 4px;
}
.rt-article .callout-content {
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
}
.rt-article .callout-content a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.rt-article .callout-content a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .rt-article .callout { flex-direction: column; gap: 10px; padding: 16px; }
  .rt-article .callout-label { min-width: 0; }
}

/* --- "Pick a thread" tabbed audience selector --- */
.rt-article .threads {
  max-width: 1150px;
  margin: 0 auto;
  padding: 40px 0;
}
.rt-article .threads .section-kicker {
  width: 28px;
  height: 3px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #b7791f;
}
.rt-article .threads h2 {
  margin: 0 0 24px;
  font-size: 26px;
  line-height: 1.2;
  color: #1f1b3d;
  border-bottom: none;
  padding-bottom: 0;
}
.rt-article .thread-card {
  background: #fffdf8;
  border: 1px solid #eadfca;
  border-radius: 10px;
  overflow: hidden;
}
.rt-article .thread-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 8px 0;
  border-bottom: 1px solid #eadfca;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.rt-article .thread-tab {
  flex: 0 0 auto;
  padding: 12px 18px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #625d78;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.rt-article .thread-tab.active {
  color: #8a5a12;
  border-bottom-color: #c58a25;
  background: #fff8e8;
  border-radius: 8px 8px 0 0;
}
.rt-article .thread-tab:hover { color: #4f46e5; }
.rt-article .thread-tab:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: -2px;
}
.rt-article .thread-content {
  padding: 26px;
  color: #1f1b3d;
  font-size: 16px;
  line-height: 1.65;
}
.rt-article .thread-content p { margin: 0 0 18px; }
.rt-article .thread-content ul { margin: 0; padding-left: 22px; }
.rt-article .thread-content li + li { margin-top: 10px; }
.rt-article .thread-content a {
  color: #4f46e5;
  font-weight: 500;
  text-decoration: none;
}
.rt-article .thread-content a:hover { text-decoration: underline; }
.rt-article .thread-content[aria-hidden="true"] { display: none; }
@media (max-width: 640px) {
  .rt-article .threads { padding: 28px 0; }
  .rt-article .threads h2 { font-size: 23px; margin-bottom: 18px; }
  .rt-article .thread-tabs { padding: 6px 6px 0; }
  .rt-article .thread-tab { padding: 11px 14px; font-size: 13px; }
  .rt-article .thread-content { padding: 20px 16px; font-size: 15px; }
  .rt-article .thread-content ul { padding-left: 18px; }
}
