/* ============================================================
   IA Fast Track · Crefaz — design system
   Temas: dark (padrão) e light, via html[data-theme]
   ============================================================ */

:root {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --topbar-h: 60px;
  --content-max: 880px;
  --sidebar-w: 264px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b101e;
  --bg-soft: #0f1526;
  --surface: #141b2d;
  --surface-2: #1a2338;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e8edf7;
  --text-2: #aab5cb;
  --muted: #8b98b0;
  --accent: #f97316;
  --accent-hover: #fb8a3c;
  --accent-text: #fca55e;
  --accent-soft: rgba(249, 115, 22, 0.13);
  --accent-ring: rgba(249, 115, 22, 0.35);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.10);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.10);
  --viz-closed: #e0621f;
  --viz-open: #12a394;
  --shadow: 0 10px 30px rgba(2, 6, 18, 0.45);
  --hero-glow: radial-gradient(60% 50% at 70% 10%, rgba(249, 115, 22, 0.16), transparent 70%),
               radial-gradient(40% 40% at 20% 30%, rgba(56, 128, 246, 0.10), transparent 70%);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: #e4e8f0;
  --border-strong: #cdd5e1;
  --text: #131c33;
  --text-2: #45506b;
  --muted: #67718a;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-text: #c2410c;
  --accent-soft: rgba(234, 88, 12, 0.09);
  --accent-ring: rgba(234, 88, 12, 0.30);
  --ok: #067647;
  --ok-soft: rgba(6, 118, 71, 0.08);
  --warn: #b54708;
  --warn-soft: rgba(181, 71, 8, 0.07);
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, 0.07);
  --viz-closed: #d9531e;
  --viz-open: #0d9488;
  --shadow: 0 8px 24px rgba(19, 28, 51, 0.08);
  --hero-glow: radial-gradient(60% 50% at 70% 0%, rgba(249, 115, 22, 0.12), transparent 70%),
               radial-gradient(40% 40% at 15% 25%, rgba(37, 99, 235, 0.07), transparent 70%);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: 0.35em; }
strong { color: var(--text); }
em { font-style: italic; }
kbd {
  font-family: var(--font-body);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--accent-soft); }

.skip-link {
  position: fixed;
  top: -48px;
  left: 12px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; }

/* ---------- topbar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 20px; }
.brand-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 3px 8px;
  border-radius: 999px;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text); }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="dark"] .ico-moon { display: block; }
html[data-theme="light"] .ico-sun { display: block; }
html[data-theme="light"] .ico-moon { display: none; }
.menu-btn { display: none; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1400px;
  margin: 0 auto;
  padding-top: var(--topbar-h);
}
.content {
  min-width: 0;
  padding: 0 40px 80px;
  max-width: calc(var(--content-max) + 80px);
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 12px 40px 16px;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.35;
}
.side-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-link.top { font-weight: 600; color: var(--text); font-size: 14px; margin-top: 6px; }
.side-link .chap {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 6px;
}
.side-sub { display: flex; flex-direction: column; gap: 1px; margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--border); }
.side-sub .side-link { font-size: 13px; padding: 5px 10px; }
.side-link.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}
.side-divider { height: 1px; background: var(--border); margin: 14px 6px; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(4, 8, 18, 0.55);
  backdrop-filter: blur(2px);
}

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 24px;
  background-image: var(--hero-glow);
  background-repeat: no-repeat;
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}
.hero-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-lead {
  font-size: 18px;
  color: var(--text-2);
  max-width: 640px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 14px;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 12.5px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 4px 11px;
  border-radius: 999px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-ring);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }

/* ---------- seções ---------- */
.section {
  padding-top: 56px;
  margin-top: 24px;
  scroll-margin-top: calc(var(--topbar-h) + 4px);
  border-top: 1px solid var(--border);
}
.section-head { margin-bottom: 8px; }
.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 8px;
}
.section h2 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.015em;
}
.lead { font-size: 17px; color: var(--text-2); max-width: 680px; }
.subsection { margin-top: 40px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.subsection h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.subsection h4 { font-size: 17px; font-weight: 700; margin: 4px 0 10px; }
.mini-h { font-size: 16px; margin-top: 24px; }
.h-quick {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 40px 0 14px;
}
.note { font-size: 13.5px; color: var(--muted); margin-top: 10px; }
.src, .refs { font-size: 13px; color: var(--muted); }
.refs { margin-top: 14px; }

/* ---------- grids e cards ---------- */
.grid { display: grid; gap: 14px; margin: 14px 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 10px;
}
.num-card { display: flex; gap: 14px; align-items: flex-start; }
.num-card .num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
}
.num-card p { color: var(--text-2); font-size: 14.5px; margin-top: 3px; }
.list-card ul { margin: 0; padding-left: 1.15em; }
.list-card li { color: var(--text-2); font-size: 14.5px; }
.ok-card { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); background: linear-gradient(var(--ok-soft), transparent 60%) , var(--surface); }
.warn-card { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); background: linear-gradient(var(--warn-soft), transparent 60%), var(--surface); }
.mini-list { padding-left: 1.15em; }
.mini-list li { font-size: 14.5px; color: var(--text-2); }

/* ---------- quick cards (home) ---------- */
.quick-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.quick-card:hover {
  text-decoration: none;
  border-color: var(--accent-ring);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.quick-card .quick-emoji { font-size: 22px; }
.quick-card strong { font-size: 15px; }
.quick-card span:last-child { font-size: 13px; color: var(--muted); }

/* ---------- agenda ---------- */
.agenda-period { font-weight: 700; font-size: 14px; margin-bottom: 10px; color: var(--text); }
.agenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
}
.agenda-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.agenda-item .chap {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 7px;
}

/* ---------- callouts ---------- */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 16px 0;
}
.callout p { font-size: 15px; color: var(--text-2); }
.callout .co-ico { font-size: 18px; line-height: 1.4; }
.callout.warn { border-left-color: var(--warn); background: linear-gradient(90deg, var(--warn-soft), transparent 55%), var(--surface); }
.callout.ok { border-left-color: var(--ok); background: linear-gradient(90deg, var(--ok-soft), transparent 55%), var(--surface); }
.callout.tip { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent 55%), var(--surface); }
.hero-callout {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--surface);
  box-shadow: var(--shadow);
}
.hero-callout p { font-size: 17px; color: var(--text); }

/* ---------- timeline ---------- */
.timeline {
  display: grid;
  gap: 0;
  margin: 18px 0;
  border-left: 2px solid var(--border-strong);
  padding-left: 22px;
}
.tl-item { position: relative; padding: 10px 0 18px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-year {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.tl-item strong { display: block; font-size: 16px; }
.tl-item p { color: var(--text-2); font-size: 14.5px; margin-top: 2px; }
.tl-next .tl-year { background: var(--accent); color: #fff; }

/* ---------- práticas / steps ---------- */
.practice-card { border-left: 3px solid var(--accent); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  color: var(--text-2);
  font-size: 15px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

/* ---------- CAFÉ ---------- */
.cafe-card { display: flex; gap: 16px; }
.cafe-letter {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 4px 14px var(--accent-ring);
}
.cafe-card strong { font-size: 17px; font-family: var(--font-display); }
.cafe-card p { color: var(--text-2); font-size: 14.5px; margin: 4px 0 8px; }
blockquote {
  margin: 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent-ring);
  background: var(--surface-2);
  border-radius: 0 10px 10px 0;
  color: var(--text-2);
  font-size: 14px;
  font-style: italic;
}
.cafe-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}

/* ---------- antes / depois ---------- */
.duel-col { position: relative; padding-top: 46px; }
.duel-badge {
  position: absolute;
  top: 14px;
  left: 20px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
}
.duel-col.bad .duel-badge { background: var(--danger-soft); color: var(--danger); }
.duel-col.good .duel-badge { background: var(--ok-soft); color: var(--ok); }
.duel-col.bad { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.duel-col.good { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.duel-col ul { list-style: none; padding: 0; margin: 12px 0 0; }
.duel-col li { font-size: 14px; color: var(--text-2); }

/* ---------- builder ---------- */
.builder { margin-top: 10px; }
.builder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.field-label small { font-weight: 500; color: var(--muted); }
textarea, input[type="text"], input[type="search"], select {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  transition: border-color 0.15s;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
::placeholder { color: var(--muted); opacity: 0.8; }
.builder-extra { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.builder-extra summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 12px;
  list-style: none;
}
.builder-extra summary::-webkit-details-marker { display: none; }
.field-check { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.field-check input { width: auto; accent-color: var(--accent); width: 18px; height: 18px; }
.builder-out { margin-top: 18px; }
.builder-out pre, pre#entrega-frase {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 6px 0 12px;
  min-height: 64px;
}
.builder-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- prompt cards ---------- */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.prompt-card {
  position: relative;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 16px 52px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prompt-card blockquote { font-style: normal; font-size: 14.5px; color: var(--text); }
.prompt-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.copy-btn {
  position: absolute;
  left: 16px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.copy-btn::before { content: "⧉"; font-size: 13px; }
.copy-btn:hover { border-color: var(--accent-ring); background: var(--accent-soft); }
.copy-btn.copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: var(--ok-soft); }
.copy-btn.copied::before { content: "✓"; }
.prompt-card.slim { padding: 14px 14px 50px; }
.sos-card { margin-top: 18px; border-left: 3px solid var(--danger); }
.sos-card .grid { margin-bottom: 0; }

/* ---------- checklist ---------- */
.check-card { display: grid; gap: 4px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-2);
  transition: background 0.15s;
}
.check-item:hover { background: var(--surface-2); }
.check-item input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}
.check-item input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent-ring); }

/* ---------- escada ---------- */
.ladder {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  margin: 18px 0 6px;
}
.ladder-step {
  --h: 0px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  font-family: var(--font-body);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px calc(12px + var(--h));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.ladder-step:nth-child(1) { --h: 0px; }
.ladder-step:nth-child(2) { --h: 14px; }
.ladder-step:nth-child(3) { --h: 28px; }
.ladder-step:nth-child(4) { --h: 42px; }
.ladder-step:nth-child(5) { --h: 56px; }
.ladder-step:hover { border-color: var(--accent-ring); transform: translateY(-2px); }
.ladder-step[aria-selected="true"] {
  background: linear-gradient(160deg, var(--accent-soft), transparent 80%), var(--surface);
  border-color: var(--accent);
}
.step-n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-text);
  background: var(--accent-soft);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.ladder-step[aria-selected="true"] .step-n { background: var(--accent); color: #fff; }
.step-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--text); }
.step-q { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ladder-axis { text-align: right; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin: 4px 2px 14px; }
.ladder-panel { margin-top: 10px; }
.facts { display: grid; gap: 10px; margin: 12px 0; }
.facts > div { display: grid; grid-template-columns: 128px 1fr; gap: 12px; align-items: start; }
.facts dt {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.facts dd { margin: 0; font-size: 14.5px; color: var(--text-2); }
.mini-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
.mini-flow span {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 11px;
}
.mini-flow span small { font-weight: 500; color: var(--muted); letter-spacing: 0; }
.mini-flow i { color: var(--accent-text); font-style: normal; font-weight: 700; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
.compare th, .compare td, .price-table th, .price-table td, .chart-table th, .chart-table td {
  padding: 11px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.compare thead th {
  font-family: var(--font-display);
  font-size: 13.5px;
  background: var(--surface-2);
  color: var(--text);
  position: sticky;
  top: 0;
}
.compare tbody th {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}
.compare td { color: var(--text-2); min-width: 150px; }
.compare tr:last-child td, .compare tr:last-child th { border-bottom: none; }
.price-table { font-variant-numeric: tabular-nums; }
.price-table td, .price-table th { padding: 8px 6px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.price-table thead th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.price-table tr:last-child td { border-bottom: none; }
.num-cell { text-align: right; white-space: nowrap; }

/* ---------- need cards ---------- */
.need-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: border-color 0.15s, transform 0.12s; }
a.need-card:hover { text-decoration: none; border-color: var(--accent-ring); transform: translateY(-2px); }
.need-degrau {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.need-card strong { font-size: 15px; }
.need-card p { font-size: 13.5px; color: var(--muted); }
.need-card.gold { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), transparent 75%), var(--surface); }

/* ---------- MCP ---------- */
.mcp-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}
.mcp-box {
  flex: 1 1 180px;
  max-width: 240px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
}
.mcp-box strong { display: block; font-family: var(--font-display); font-size: 15px; }
.mcp-box span { font-size: 12.5px; color: var(--muted); }
.mcp-core { border-color: var(--accent); background: linear-gradient(160deg, var(--accent-soft), transparent 80%), var(--surface); box-shadow: 0 4px 18px var(--accent-ring); }
.mcp-link { align-self: center; color: var(--accent-text); font-size: 20px; font-style: normal; }

/* ---------- gráfico (placar) ---------- */
.viz-root { margin: 16px 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 14px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.sw-closed { background: var(--viz-closed); }
.sw-open { background: var(--viz-open); }
.chart-rows { display: grid; gap: 9px; }
.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 34px;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  padding: 2px 4px;
}
.bar-row:hover, .bar-row:focus-visible { background: var(--surface-2); }
.bar-name { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { position: relative; height: 18px; }
.bar {
  height: 100%;
  border-radius: 0 4px 4px 0;
  min-width: 3px;
  transform-origin: left center;
}
.bar.closed { background: var(--viz-closed); }
.bar.open { background: var(--viz-open); }
.bar-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.chart-table { margin-top: 14px; font-size: 13.5px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.chart-table table { margin-top: 10px; }
.chart-table td, .chart-table th { color: var(--text-2); }
.chart-src { font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.viz-tip {
  position: fixed;
  z-index: 300;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  max-width: 240px;
}
.viz-tip small { color: var(--muted); display: block; }

/* ---------- matriz ---------- */
.matriz input, .matriz select { min-width: 140px; }
.matriz td { padding: 6px; border-bottom: 1px solid var(--border); }
.matriz th {
  padding: 10px 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.matriz tr:last-child td { border-bottom: none; }
.matriz select { min-width: 128px; }

/* ---------- peças e fluxos ---------- */
.pieces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.piece {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px;
}
.piece strong { display: block; font-family: var(--font-display); font-size: 13.5px; letter-spacing: 0.03em; text-transform: uppercase; }
.piece span { font-size: 12.5px; color: var(--muted); line-height: 1.4; display: block; margin-top: 4px; }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; counter-reset: fstep; }
.flow-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent-text);
  font-weight: 700;
  z-index: 1;
}
.flow-n {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 8px;
}
.flow-step p { font-size: 13.5px; color: var(--text); margin-bottom: 8px; }
.flow-step small { font-size: 12px; color: var(--muted); }

/* ---------- missões ---------- */
.mission { margin: 22px 0; scroll-margin-top: calc(var(--topbar-h) + 16px); border-left: 3px solid var(--accent); }
.mission-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.mission-n {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  padding: 5px 12px;
  border-radius: 999px;
}
.mission-head h3 { margin: 0; font-size: 20px; }
.mission-sub { font-size: 14px; color: var(--muted); margin: 2px 0 0; }
.mission-tool {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}
.mission-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 12px; }
.mission-meta > div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.mission-meta dt { font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.mission-meta dd { margin: 0; font-size: 13.5px; color: var(--text-2); }
.mission-rule {
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.stat-card { text-align: center; }
.stat-card .stat {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--accent-text);
}
.stat-card p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---------- timer ---------- */
.timer { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.timer-visual { position: relative; width: 168px; height: 168px; flex: 0 0 auto; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 8; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s linear, stroke 0.3s;
}
.timer.done .ring-fg { stroke: var(--danger); }
.timer-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.timer.done .timer-display { color: var(--danger); animation: pulse 1s ease-in-out 4; }
@keyframes pulse { 50% { opacity: 0.35; } }
.timer-presets { display: flex; flex-direction: column; gap: 8px; }
.timer-presets .btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.timer-actions { display: flex; gap: 10px; margin-left: auto; }

/* ---------- takeaways ---------- */
.takeaways { display: grid; gap: 10px; margin: 16px 0; }
.take {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.take span {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
}
.take p { margin: 0; font-size: 15px; color: var(--text-2); }

/* ---------- entrega ---------- */
.entrega-card { border-left: 3px solid var(--accent); }
.entrega-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }

/* ---------- glossário ---------- */
.gloss-filter { max-width: 380px; margin: 4px 0 18px; }
.gloss-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.gloss-item strong { font-family: var(--font-display); font-size: 15.5px; display: block; margin-bottom: 5px; }
.gloss-item p { font-size: 14px; color: var(--text-2); }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; margin-top: 8px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 18px;
  transition: border-color 0.15s;
}
.faq-item[open] { border-color: var(--accent-ring); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 15px 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  position: relative;
  padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-text);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { padding-bottom: 16px; font-size: 14.5px; color: var(--text-2); }

/* ---------- footer ---------- */
.footer {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
}

/* ---------- to-top ---------- */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.to-top:hover { border-color: var(--accent); color: var(--accent-text); }

/* ---------- busca (palette) ---------- */
.palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(4, 8, 18, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.palette-box {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.palette-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.palette-head input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 16px;
  color: var(--text);
}
.palette-head input:focus { box-shadow: none; border: none; }
.palette-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 46vh;
  overflow-y: auto;
}
.palette-results li { margin: 0; }
.p-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--font-body);
}
.p-item .p-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.p-item .p-ctx { font-size: 12.5px; color: var(--muted); }
.p-item:hover, .p-item.active { background: var(--accent-soft); }
.p-empty { padding: 18px 14px; font-size: 14px; color: var(--muted); }

/* ---------- flash ao navegar pela busca ---------- */
@keyframes flash-bg {
  0% { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
  100% { background: transparent; box-shadow: none; }
}
.flash-target { animation: flash-bg 1.6s ease-out 1; border-radius: 10px; }

/* ---------- responsivo ---------- */
@media (max-width: 1079px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: min(300px, 84vw);
    height: auto;
    z-index: 95;
    background: var(--bg);
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: none;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .content { padding: 0 20px 64px; max-width: none; }
}

@media (max-width: 860px) {
  .grid-3, .mission-meta { grid-template-columns: 1fr; }
  .entrega-fields { grid-template-columns: 1fr; }
  .pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: 1fr; }
  .flow-step:not(:last-child)::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -16px;
    transform: translateX(-50%);
  }
  .flow { row-gap: 20px; }
  .ladder { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
  .step-q { display: none; }
  .ladder-step { padding: 9px 8px calc(9px + var(--h) * 0.5); }
  .step-name { font-size: 11px; }
}

@media (max-width: 680px) {
  .grid-2, .prompt-grid, .gloss-list, .builder-grid, .duel { grid-template-columns: 1fr; }
  .search-label { display: none; }
  .search-btn kbd { display: none; }
  .hero { padding-top: 48px; }
  .hero-lead { font-size: 16px; }
  .lead { font-size: 15.5px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  .bar-row { grid-template-columns: 108px 1fr 30px; gap: 8px; }
  .bar-name { font-size: 12px; }
  .mission-tool { margin-left: 0; }
  .timer { justify-content: center; text-align: center; }
  .timer-actions { margin-left: 0; width: 100%; justify-content: center; }
  .timer-presets { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .pieces { grid-template-columns: 1fr; }
  .content { padding: 0 16px 56px; }
}

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

/* ---------- print ---------- */
@media print {
  .topbar, .sidebar, .backdrop, .to-top, .palette-overlay, .viz-tip,
  .hero-actions, .copy-btn, .builder-actions, .timer,
  .search-btn, .menu-btn { display: none !important; }
  .layout { display: block; padding-top: 0; }
  .content { max-width: none; padding: 0; }
  body { background: #fff; color: #000; }
  .card, .callout, .prompt-card, .faq-item { break-inside: avoid; box-shadow: none; }
  .section { page-break-before: always; border-top: none; padding-top: 12px; }
  .hero { padding-top: 0; }
}
