/* ==========================================================================
   DevForge — Design System
   Modern tech-enterprise style: light base, blue gradient accents,
   rounded modular cards, generous whitespace.
   ========================================================================== */

:root {
  /* Brand */
  --brand-50:  #eef4ff;
  --brand-100: #dbe7fe;
  --brand-200: #bfd3fe;
  --brand-300: #93b4fd;
  --brand-400: #608cfa;
  --brand-500: #3b66f6;
  --brand-600: #2546eb;
  --brand-700: #1d33d7;
  --brand-800: #1e2cae;
  --brand-900: #1e2b89;

  /* Accent (cyan highlight) */
  --accent-400: #22d3ee;
  --accent-500: #06b6d4;
  --accent-600: #0891b2;

  /* Neutrals */
  --ink-900: #0b1220;
  --ink-800: #141d2e;
  --ink-700: #26324a;
  --ink-600: #3d4a63;
  --ink-500: #5b6880;
  --ink-400: #7b879e;
  --ink-300: #a6b0c2;
  --ink-200: #d3dae5;
  --ink-100: #e8edf4;
  --ink-50:  #f4f7fb;
  --white:   #ffffff;

  /* Surfaces */
  --surface:        #ffffff;
  --surface-sunken: #f7f9fc;
  --surface-alt:    #f0f4fa;

  /* Semantic */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger:  #e11d48;
  --danger-bg: #fff1f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;

  /* Geometry */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --shadow-xs: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow-sm: 0 1px 3px rgba(11, 18, 32, .07), 0 1px 2px rgba(11, 18, 32, .04);
  --shadow-md: 0 4px 14px rgba(11, 18, 32, .07), 0 2px 5px rgba(11, 18, 32, .04);
  --shadow-lg: 0 12px 32px rgba(11, 18, 32, .09), 0 4px 10px rgba(11, 18, 32, .05);
  --shadow-brand: 0 8px 24px rgba(37, 70, 235, .22);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "SFMono-Regular",
               Menlo, Consolas, "Liberation Mono", monospace;

  --maxw: 1200px;
  --maxw-prose: 780px;
  --nav-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-700);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02","cv03","cv04","cv11";
}

h1, h2, h3, h4, h5 {
  color: var(--ink-900);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(2rem, 4.4vw, 3rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.015em; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.1em; }

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--brand-500); text-decoration: underline; }

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

ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }
li { margin-bottom: .45em; }

code, pre, kbd {
  font-family: var(--font-mono);
  font-size: .875em;
}
code {
  background: var(--surface-alt);
  color: var(--brand-700);
  padding: .16em .42em;
  border-radius: 5px;
  border: 1px solid var(--ink-100);
  word-break: break-word;
}
pre {
  background: var(--ink-900);
  color: #e6edf7;
  padding: 1.1rem 1.25rem;
  border-radius: var(--r-md);
  overflow-x: auto;
  line-height: 1.6;
  margin: 0 0 1.3em;
  border: 1px solid var(--ink-800);
}
pre code {
  background: none; border: none; color: inherit;
  padding: 0; font-size: .84rem;
}
kbd {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: .12em .45em;
  font-size: .8em;
  color: var(--ink-700);
}

hr {
  border: none;
  border-top: 1px solid var(--ink-100);
  margin: 2.2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: .93rem;
}
th {
  text-align: left;
  background: var(--surface-sunken);
  color: var(--ink-800);
  font-weight: 650;
  padding: .7rem .85rem;
  border-bottom: 2px solid var(--ink-200);
}
td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: top;
}
tbody tr:hover { background: var(--surface-sunken); }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.wrap-prose { max-width: var(--maxw-prose); }
.section { padding: 4rem 0; }
.section-tight { padding: 2.5rem 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ink-100);
}
.nav-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  display: grid; place-items: center;
  box-shadow: var(--shadow-brand);
  flex-shrink: 0;
}
.logo-mark svg { width: 19px; height: 19px; }
.logo em {
  font-style: normal;
  background: linear-gradient(100deg, var(--brand-600), var(--accent-600));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: var(--ink-600);
  font-weight: 560;
  font-size: .93rem;
  padding: 8px 13px;
  border-radius: var(--r-sm);
  transition: all .15s ease;
}
.nav-links a:hover {
  color: var(--brand-600);
  background: var(--brand-50);
  text-decoration: none;
}
.nav-links a.is-active { color: var(--brand-600); background: var(--brand-50); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px; height: 40px;
  border: 1px solid var(--ink-200);
  background: var(--white);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle span {
  display: block; width: 18px; height: 2px;
  background: var(--ink-700); border-radius: 2px;
  position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px;
  background: var(--ink-700); border-radius: 2px;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  background:
    radial-gradient(1100px 460px at 12% -8%, rgba(59,102,246,.10), transparent 60%),
    radial-gradient(900px 420px at 88% 4%, rgba(6,182,212,.10), transparent 62%);
  border-bottom: 1px solid var(--ink-100);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(11,18,32,.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11,18,32,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(680px 340px at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(680px 340px at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--brand-200);
  color: var(--brand-700);
  font-size: .8rem;
  font-weight: 620;
  padding: 5px 13px 5px 9px;
  border-radius: var(--r-full);
  margin-bottom: 1.3rem;
  box-shadow: var(--shadow-xs);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16,185,129,.18);
}

.hero h1 { margin-bottom: .5em; }
.hero-sub {
  font-size: 1.14rem;
  color: var(--ink-600);
  max-width: 640px;
  margin-bottom: 2rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 2.4rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--ink-100);
}
.hero-stats div { min-width: 90px; }
.hero-stats strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 750;
  color: var(--ink-900);
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.hero-stats span {
  font-size: .82rem;
  color: var(--ink-400);
  font-weight: 500;
}

/* Search box */
.searchbox {
  position: relative;
  max-width: 520px;
}
.searchbox input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: all .18s ease;
}
.searchbox input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(59,102,246,.12);
}
.searchbox .icon {
  position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400); pointer-events: none;
  display: flex;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--accent-500));
  opacity: 0;
  transition: opacity .18s ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
  text-decoration: none;
}
.tool-card:hover::before { opacity: 1; }

.tool-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  color: var(--brand-600);
  margin-bottom: 14px;
  flex-shrink: 0;
}
.tool-icon svg { width: 22px; height: 22px; }

.tool-card h3 {
  font-size: 1.06rem;
  margin-bottom: .35em;
  color: var(--ink-900);
}
.tool-card p {
  font-size: .9rem;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.6;
}
.tool-card .tag {
  display: inline-block;
  margin-top: 12px;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--brand-600);
  background: var(--brand-50);
  padding: 3px 9px;
  border-radius: var(--r-full);
  align-self: flex-start;
}

/* Feature / value cards */
.feature {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 26px;
}
.feature-num {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand-500);
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.feature h3 { font-size: 1.08rem; margin-bottom: .4em; }
.feature p { font-size: .92rem; color: var(--ink-500); margin: 0; }

/* --------------------------------------------------------------------------
   Section headers
   -------------------------------------------------------------------------- */
.sec-head { margin-bottom: 2rem; }
.sec-head h2 { margin-bottom: .35em; }
.sec-head p {
  color: var(--ink-500);
  font-size: 1.02rem;
  max-width: 640px;
  margin: 0;
}
.sec-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: .7rem;
  display: block;
}

/* --------------------------------------------------------------------------
   Tool workspace
   -------------------------------------------------------------------------- */
.page-head {
  padding: 2.6rem 0 1.6rem;
  border-bottom: 1px solid var(--ink-100);
  background: var(--surface-sunken);
}
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 7px;
  font-size: .84rem;
  color: var(--ink-400);
  margin-bottom: .9rem;
  align-items: center;
}
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb .sep { color: var(--ink-300); }
.page-head h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: .35em; }
.page-head .lede {
  font-size: 1.06rem;
  color: var(--ink-600);
  max-width: 680px;
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 2rem 0;
}
.pane {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}
.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--ink-100);
  min-height: 46px;
}
.pane-title {
  font-size: .82rem;
  font-weight: 680;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-600);
  display: flex; align-items: center; gap: 8px;
}
.pane-actions { display: flex; gap: 6px; }

.pane-body { padding: 0; flex: 1; display: flex; flex-direction: column; }

textarea.io, .io-out {
  width: 100%;
  border: none;
  resize: vertical;
  padding: 15px;
  font-family: var(--font-mono);
  font-size: .855rem;
  line-height: 1.65;
  color: var(--ink-800);
  background: var(--surface);
  min-height: 260px;
  flex: 1;
}
textarea.io:focus { outline: none; }
.io-out {
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
  max-height: 620px;
  margin: 0;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 15px;
  border-top: 1px solid var(--ink-100);
  background: var(--surface-sunken);
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: .74rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-500);
}
.field select, .field input {
  font-family: inherit;
  font-size: .88rem;
  padding: 8px 11px;
  border: 1px solid var(--ink-200);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink-800);
  min-width: 130px;
}
.field select:focus, .field input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(59,102,246,.11);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 620;
  padding: 9px 17px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  line-height: 1.4;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: var(--white);
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-secondary {
  background: var(--white);
  color: var(--ink-700);
  border-color: var(--ink-200);
}
.btn-secondary:hover { background: var(--surface-sunken); border-color: var(--ink-300); }
.btn-ghost {
  background: transparent;
  color: var(--ink-600);
  border-color: transparent;
  padding: 7px 11px;
  font-size: .84rem;
}
.btn-ghost:hover { background: var(--ink-100); color: var(--ink-800); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }

/* --------------------------------------------------------------------------
   Status / result banners
   -------------------------------------------------------------------------- */
.status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 550;
  margin: 0;
  border: 1px solid transparent;
}
.status-ok      { background: var(--success-bg); color: #047857; border-color: #a7f3d0; }
.status-error   { background: var(--danger-bg);  color: #be123c; border-color: #fecdd3; }
.status-warn    { background: var(--warning-bg); color: #b45309; border-color: #fde68a; }
.status-info    { background: var(--brand-50);   color: var(--brand-700); border-color: var(--brand-200); }
.status:empty { display: none; }

/* Stat strip (token counter etc.) */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--ink-100);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  padding: 14px 16px;
}
.stat-label {
  font-size: .71rem;
  font-weight: 680;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 1.32rem;
  font-weight: 730;
  color: var(--ink-900);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat-value small { font-size: .62em; font-weight: 600; color: var(--ink-400); }

/* Diff viewer */
.diff-out { font-family: var(--font-mono); font-size: .83rem; line-height: 1.6; padding: 0; margin: 0; }
.diff-line { display: flex; padding: 1px 12px; white-space: pre-wrap; word-break: break-word; }
.diff-add  { background: #ecfdf5; color: #065f46; }
.diff-del  { background: #fff1f2; color: #9f1239; }
.diff-same { color: var(--ink-500); }
.diff-sign { display: inline-block; width: 14px; flex-shrink: 0; user-select: none; opacity: .7; }

/* Token highlight */
.tok-list { display: flex; flex-wrap: wrap; gap: 4px; padding: 15px; }
.tok {
  font-family: var(--font-mono);
  font-size: .8rem;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--brand-50);
  color: var(--brand-800);
  border: 1px solid var(--brand-100);
  white-space: pre-wrap;
}

/* Regex highlight */
.rx-highlight { padding: 15px; font-family: var(--font-mono); font-size: .85rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.rx-hit { background: #fde68a; border-radius: 3px; padding: 1px 0; box-shadow: 0 0 0 1px #f59e0b; }
.rx-group { background: #bfdbfe; border-radius: 3px; padding: 1px 0; }

/* Match list */
.match-list { padding: 12px 15px; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.match-item {
  font-family: var(--font-mono); font-size: .8rem;
  padding: 7px 11px; border-radius: var(--r-sm);
  background: var(--surface-sunken); border: 1px solid var(--ink-100);
  display: flex; gap: 10px;
}
.match-item b { color: var(--brand-700); flex-shrink: 0; font-weight: 650; }
.match-item span { word-break: break-all; }

/* JWT blocks */
.jwt-block { padding: 15px; border-bottom: 1px solid var(--ink-100); }
.jwt-block:last-child { border-bottom: none; }
.jwt-block h4 {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-400); margin-bottom: 7px; font-weight: 700;
}
.jwt-block pre { margin: 0; }
.jwt-header { color: #f0abfc !important; }
.jwt-payload { color: #7dd3fc !important; }
.jwt-sig { color: #86efac !important; word-break: break-all; }

/* --------------------------------------------------------------------------
   Prose (guides)
   -------------------------------------------------------------------------- */
.prose {
  max-width: var(--maxw-prose);
  font-size: 1.045rem;
  line-height: 1.78;
  color: var(--ink-700);
}
.prose h2 {
  margin-top: 2.4em;
  padding-top: .35em;
  font-size: 1.55rem;
}
.prose h3 { margin-top: 1.9em; font-size: 1.18rem; }
.prose h4 { margin-top: 1.5em; }
.prose > p:first-of-type { font-size: 1.1rem; color: var(--ink-600); }
.prose ul li, .prose ol li { margin-bottom: .55em; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--brand-400);
  background: var(--brand-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--ink-700);
}
.prose blockquote p:last-child { margin: 0; }

.callout {
  border: 1px solid var(--brand-200);
  background: var(--brand-50);
  border-radius: var(--r-md);
  padding: 16px 20px;
  margin: 1.6em 0;
  font-size: .96rem;
}
.callout strong { color: var(--brand-800); }
.callout p:last-child { margin-bottom: 0; }
.callout-warn { border-color: #fcd34d; background: var(--warning-bg); }
.callout-warn strong { color: #92400e; }

/* Table of contents */
.toc {
  background: var(--surface-sunken);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 2.2rem;
}
.toc h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-500); margin-bottom: .9em; font-weight: 700;
}
.toc ol { margin: 0; padding-left: 1.2em; font-size: .93rem; }
.toc li { margin-bottom: .38em; }
.toc a { color: var(--ink-600); }
.toc a:hover { color: var(--brand-600); }

/* Author / meta line */
.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 1.4rem;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--ink-100);
  font-size: .88rem;
  color: var(--ink-500);
  flex-wrap: wrap;
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  display: grid; place-items: center;
  color: var(--white); font-weight: 700; font-size: .95rem;
  flex-shrink: 0;
}
.byline strong { color: var(--ink-800); display: block; }
.byline .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .85rem; }

/* Guide card */
.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.guide-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
  text-decoration: none;
}
.guide-card h3 { font-size: 1.05rem; margin-bottom: .4em; }
.guide-card p { font-size: .9rem; color: var(--ink-500); margin: 0 0 12px; flex: 1; }
.guide-meta {
  font-size: .78rem;
  color: var(--ink-400);
  display: flex; gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-100);
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq { border: 1px solid var(--ink-100); border-radius: var(--r-lg); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--ink-100); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: none;
  padding: 17px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 620;
  color: var(--ink-800);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background .15s ease;
}
.faq-q:hover { background: var(--surface-sunken); }
.faq-q .chev {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--brand-500);
  transition: transform .22s ease;
}
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 0 20px 18px;
  color: var(--ink-600);
  font-size: .96rem;
}
.faq-a p:last-child { margin-bottom: 0; }
.faq-item.open .faq-a { display: block; }

/* --------------------------------------------------------------------------
   Ad slots
   -------------------------------------------------------------------------- */
.ad-slot {
  width: 100%;
  margin: 2.2rem auto;
  text-align: center;
  overflow: hidden;
  min-height: 0;
}
.ad-slot[data-enabled="false"] { display: none; }
.ad-leaderboard { max-width: 970px; }
.ad-rectangle { max-width: 336px; }
.ad-inarticle { max-width: 780px; }

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */
.cta-band {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-900) 55%, #0f1d4d);
  border-radius: var(--r-xl);
  padding: 44px 40px;
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(34,211,238,.28), transparent 65%);
  top: -180px; right: -110px;
  pointer-events: none;
}
.cta-band h2 { color: var(--white); position: relative; }
.cta-band p {
  color: rgba(255,255,255,.82);
  max-width: 560px;
  margin: 0 auto 1.8rem;
  position: relative;
  font-size: 1.05rem;
}
.cta-band .btn-primary {
  background: var(--white);
  color: var(--brand-700);
  position: relative;
}
.cta-band .btn-primary:hover { background: var(--brand-50); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--ink-900);
  color: var(--ink-300);
  padding: 3.4rem 0 1.8rem;
  margin-top: 4rem;
  font-size: .92rem;
}
.footer h4 {
  color: var(--white);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.1em;
  font-weight: 700;
}
.footer a { color: var(--ink-300); }
.footer a:hover { color: var(--white); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .55em; }
.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 2.4rem;
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.foot-brand p {
  color: var(--ink-400);
  font-size: .9rem;
  max-width: 320px;
  margin-top: 1rem;
}
.foot-brand .logo { color: var(--white); margin-bottom: 0; }
.foot-brand .logo em {
  background: linear-gradient(100deg, #93b4fd, var(--accent-400));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.foot-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 1.6rem;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--ink-400);
}

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */
.muted { color: var(--ink-400); }
.small { font-size: .87rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.badge {
  display: inline-block;
  font-size: .72rem; font-weight: 700;
  padding: 3px 9px; border-radius: var(--r-full);
  background: var(--brand-100); color: var(--brand-700);
  letter-spacing: .03em;
}
.badge-new { background: #dcfce7; color: #15803d; }
.divider { height: 1px; background: var(--ink-100); margin: 2.5rem 0; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translate(-50%, 90px);
  background: var(--ink-900);
  color: var(--white);
  padding: 11px 20px;
  border-radius: var(--r-full);
  font-size: .9rem;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform .26s cubic-bezier(.2,.9,.3,1.2), opacity .26s ease;
  z-index: 200;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--ink-100);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 18px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; font-size: .97rem; }
  .nav-toggle { display: flex; }
  .hero { padding: 3rem 0 2.6rem; }
  .hero-stats { gap: 24px; }
  .cta-band { padding: 34px 24px; }
}

@media (max-width: 620px) {
  body { font-size: 15.5px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 2.8rem 0; }
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
  .foot-bottom { flex-direction: column; align-items: flex-start; }
  .wrap { padding: 0 16px; }
  .prose { font-size: 1rem; }
  .hero-stats { gap: 18px; }
  .hero-stats strong { font-size: 1.35rem; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .pane-actions { gap: 4px; }
}

@media print {
  .nav, .footer, .ad-slot, .cta-band, .controls { display: none !important; }
}
