/* =========================================================
   Engenharia de Prompt · Edição 2026
   Folha de estilo única, sem dependências externas.
   ========================================================= */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #0b1015;
  --bg-deep: #080c11;
  --panel: #0f1720;
  --panel-2: #131d27;
  --panel-3: #18232f;
  --text: #e7eef4;
  --text-soft: #c2d0da;
  --muted: #8ba0b1;
  --muted-2: #6d8291;
  --line: #1d2b36;
  --line-soft: #16222c;

  --accent: #dcb072;
  --accent-strong: #f0c789;
  --accent-dim: rgba(220, 176, 114, 0.12);
  --teal: #62c9b3;
  --teal-dim: rgba(98, 201, 179, 0.12);
  --rose: #e4808a;
  --rose-dim: rgba(228, 128, 138, 0.1);
  --green: #78c48d;
  --green-dim: rgba(120, 196, 141, 0.1);
  --violet: #a99bea;
  --violet-dim: rgba(169, 155, 234, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.75);

  --topbar-h: 62px;
  --sidebar-w: 306px;
  --rail-w: 218px;
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 780px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="light"] {
  --bg: #f7f4ef;
  --bg-deep: #efeae1;
  --panel: #ffffff;
  --panel-2: #fbf8f3;
  --panel-3: #f3eee5;
  --text: #1a2027;
  --text-soft: #333d47;
  --muted: #5d6b77;
  --muted-2: #7d8b97;
  --line: #e2dace;
  --line-soft: #ece6dc;

  --accent: #9a6a24;
  --accent-strong: #7d5314;
  --accent-dim: rgba(154, 106, 36, 0.1);
  --teal: #1f7f6d;
  --teal-dim: rgba(31, 127, 109, 0.09);
  --rose: #b03a48;
  --rose-dim: rgba(176, 58, 72, 0.07);
  --green: #2f7a48;
  --green-dim: rgba(47, 122, 72, 0.08);
  --violet: #5f4fc4;
  --violet-dim: rgba(95, 79, 196, 0.08);

  --shadow-sm: 0 1px 2px rgba(60, 50, 35, 0.08);
  --shadow-md: 0 10px 28px -14px rgba(60, 50, 35, 0.22);
  --shadow-lg: 0 30px 70px -30px rgba(60, 50, 35, 0.3);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1100px 520px at 12% -12%, rgba(220, 176, 114, 0.055), transparent 62%),
    radial-gradient(900px 520px at 105% 0%, rgba(98, 201, 179, 0.045), transparent 60%);
  background-attachment: fixed;
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(1000px 460px at 8% -10%, rgba(154, 106, 36, 0.07), transparent 60%),
    radial-gradient(860px 460px at 104% 0%, rgba(31, 127, 109, 0.05), transparent 58%);
}

::selection { background: var(--accent-dim); color: var(--text); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #100c05; padding: 10px 16px; border-radius: 0 0 8px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Barra de progresso de leitura ---------- */

.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: transparent; pointer-events: none;
}
.progress-rail__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 120ms linear;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--teal)));
  color: #14100a; font-family: var(--font-serif); font-weight: 700; font-size: 19px;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 14.5px; letter-spacing: 0.01em; font-weight: 650; }
.brand__text small { font-size: 11px; color: var(--muted); letter-spacing: 0.09em; text-transform: uppercase; }

.topbar__spacer { flex: 1; }

.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  cursor: pointer; transition: all 160ms var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.topbar__menu { display: none; }

.icon-sun { display: none; }
html[data-theme="light"] .icon-sun { display: block; }
html[data-theme="light"] .icon-moon { display: none; }

.search-trigger {
  display: flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 12px;
  background: var(--panel-2); color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all 160ms var(--ease);
}
.search-trigger:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.search-trigger svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

kbd {
  font-family: var(--font-mono); font-size: 10.5px; line-height: 1;
  padding: 3px 5px; border-radius: 5px;
  background: var(--panel-3); border: 1px solid var(--line);
  color: var(--muted); box-shadow: 0 1px 0 var(--line);
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rail-w);
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  border-right: 1px solid var(--line-soft);
  overflow: hidden;
}
.sidebar__inner {
  height: 100%; display: flex; flex-direction: column;
  padding: 20px 12px 14px;
}
.sidebar__progress {
  display: flex; align-items: center; gap: 12px;
  padding: 0 8px 18px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
}
.ring { position: relative; width: 44px; height: 44px; flex: none; }
.ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring__bg { stroke: var(--line); }
.ring__fg {
  stroke: var(--accent); stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 119.4;
  transition: stroke-dashoffset 500ms var(--ease);
}
.ring span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 10.5px; font-weight: 650; color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.sidebar__progress-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar__progress-text strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__progress-text span { font-size: 11.5px; color: var(--muted); }

.nav { flex: 1; overflow-y: auto; padding-right: 2px; margin-right: -6px; }
.nav::-webkit-scrollbar, .rail__inner::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb, .rail__inner::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 99px; border: 2px solid var(--bg);
}
.nav::-webkit-scrollbar-track { background: transparent; }

.nav__group { margin-bottom: 4px; }
.nav__toggle {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 8px; border: 0; background: transparent;
  color: var(--text-soft); font-family: inherit; font-size: 11.5px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.075em; text-align: left; cursor: pointer;
  border-radius: 7px;
}
.nav__toggle:hover { background: var(--panel-2); color: var(--text); }
.nav__num {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--accent); background: var(--accent-dim);
  padding: 2px 5px; border-radius: 4px; letter-spacing: 0;
}
.nav__chev { margin-left: auto; width: 13px; height: 13px; fill: none; stroke: var(--muted-2); stroke-width: 2; transition: transform 200ms var(--ease); }
.nav__group[data-open="false"] .nav__chev { transform: rotate(-90deg); }
.nav__group[data-open="false"] .nav__list { display: none; }

.nav__list { list-style: none; margin: 0 0 8px; padding: 0 0 0 2px; }
.nav__list a {
  display: flex; align-items: center; gap: 8px;
  padding: 6.5px 9px 6.5px 12px;
  color: var(--muted); text-decoration: none; font-size: 13.4px; line-height: 1.42;
  border-radius: 7px; border-left: 2px solid transparent;
  transition: all 140ms var(--ease);
}
.nav__list a:hover { color: var(--text); background: var(--panel-2); }
.nav__list a.is-active {
  color: var(--text); background: linear-gradient(90deg, var(--accent-dim), transparent 85%);
  border-left-color: var(--accent); font-weight: 550;
}
.nav__list a.is-done .nav__dot {
  background: var(--green); border-color: var(--green);
}
.nav__dot {
  flex: none; width: 6px; height: 6px; border-radius: 50%;
  border: 1px solid var(--muted-2); background: transparent;
  transition: all 160ms var(--ease);
}

.sidebar__footer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.link-btn {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--muted-2); font-family: inherit; font-size: 11.5px;
}
.link-btn:hover { color: var(--accent); }
.dot { color: var(--line); }

/* ---------- Conteúdo ---------- */

.main { min-width: 0; padding: 0 46px; }
.main__inner { max-width: var(--maxw); margin: 0 auto; padding: 46px 0 40px; }
.main:focus { outline: none; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 650; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--accent); opacity: 0.6; }

h1, h2, h3, h4 {
  font-family: var(--font-serif); font-weight: 600; color: var(--text);
  letter-spacing: -0.012em; line-height: 1.2;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
h1 { font-size: clamp(2.05rem, 3.6vw, 2.9rem); margin: 14px 0 12px; letter-spacing: -0.025em; }
h2 { font-size: 1.62rem; margin: 2.4em 0 0.7em; padding-bottom: 0.36em; border-bottom: 1px solid var(--line-soft); }
h3 { font-size: 1.19rem; margin: 1.9em 0 0.5em; }
h4 { font-size: 1.03rem; margin: 1.5em 0 0.4em; font-family: var(--font-sans); font-weight: 650; }

p { margin: 0 0 1.05em; }
strong { font-weight: 650; color: var(--text); }
em { font-style: italic; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }

.lead { font-size: 1.13rem; color: var(--text-soft); line-height: 1.68; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--panel);
  font-size: 11.5px; color: var(--muted); letter-spacing: 0.015em;
}
.chip--accent { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); color: var(--accent); background: var(--accent-dim); }
.chip--teal { border-color: color-mix(in srgb, var(--teal) 32%, var(--line)); color: var(--teal); background: var(--teal-dim); }

.hero {
  padding: 8px 0 26px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 34px;
}

ul, ol { margin: 0 0 1.1em; padding-left: 1.35em; }
li { margin: 0.3em 0; }
li::marker { color: var(--muted-2); }
ul ul, ol ol, ul ol, ol ul { margin: 0.3em 0; }
hr { border: 0; height: 1px; background: var(--line-soft); margin: 2.4em 0; }

blockquote {
  margin: 1.6em 0; padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent);
  color: var(--text-soft); font-family: var(--font-serif); font-size: 1.08rem; font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }
blockquote cite { display: block; margin-top: 8px; font-size: 12.5px; font-style: normal; color: var(--muted); font-family: var(--font-sans); }

/* ---------- Cards ---------- */

.cards {
  display: grid; gap: 14px; margin: 1.6em 0 1.9em;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card {
  position: relative;
  padding: 17px 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms var(--ease), border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow-md); }
.card__icon {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 8px;
  font-size: 15px; margin-bottom: 10px;
  background: var(--accent-dim); color: var(--accent);
}
.card__title { display: block; font-weight: 650; font-size: 14.6px; margin-bottom: 5px; color: var(--text); letter-spacing: -0.005em; }
.card p { margin: 0; font-size: 13.9px; color: var(--text-soft); line-height: 1.62; }
.card--teal .card__icon { background: var(--teal-dim); color: var(--teal); }
.card--teal:hover { border-color: color-mix(in srgb, var(--teal) 32%, var(--line)); }
.card--violet .card__icon { background: var(--violet-dim); color: var(--violet); }
.card--rose .card__icon { background: var(--rose-dim); color: var(--rose); }

.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Callouts ---------- */

.callout {
  margin: 1.6em 0; padding: 15px 18px 15px 17px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.7px; line-height: 1.66;
}
.callout p:last-child { margin-bottom: 0; }
.callout__label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
}
.callout--key { border-left-color: var(--accent); background: linear-gradient(100deg, var(--accent-dim), var(--panel-2) 55%); }
.callout--key .callout__label { color: var(--accent); }
.callout--warn { border-left-color: var(--rose); background: linear-gradient(100deg, var(--rose-dim), var(--panel-2) 55%); }
.callout--warn .callout__label { color: var(--rose); }
.callout--tip { border-left-color: var(--teal); background: linear-gradient(100deg, var(--teal-dim), var(--panel-2) 55%); }
.callout--tip .callout__label { color: var(--teal); }
.callout--research { border-left-color: var(--violet); background: linear-gradient(100deg, var(--violet-dim), var(--panel-2) 55%); }
.callout--research .callout__label { color: var(--violet); }

/* ---------- Exemplos comparativos ---------- */

.example {
  margin: 1.7em 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--panel);
}
.example__head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft);
  background: var(--panel-2);
  font-size: 11px; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase; color: var(--muted);
}
.example__cols { display: grid; grid-template-columns: 1fr 1fr; }
.example__col { padding: 15px 17px; min-width: 0; }
.example__col + .example__col { border-left: 1px solid var(--line-soft); }
.example__col h5 {
  margin: 0 0 8px; font-family: var(--font-sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.example__col--bad h5 { color: var(--rose); }
.example__col--good h5 { color: var(--green); }
.example__col--bad { background: linear-gradient(180deg, var(--rose-dim), transparent 70%); }
.example__col--good { background: linear-gradient(180deg, var(--green-dim), transparent 70%); }
.example__col p, .example__col li { font-size: 14.2px; color: var(--text-soft); }
.example__col p:last-child, .example__col ul:last-child, .example__col pre:last-child { margin-bottom: 0; }
.example__why {
  padding: 12px 17px; border-top: 1px solid var(--line-soft);
  font-size: 13.6px; color: var(--muted); background: var(--panel-2);
}
.example__why strong { color: var(--text-soft); }

/* ---------- Código e prompts ---------- */

pre {
  position: relative;
  margin: 1.3em 0; padding: 15px 17px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.1px; line-height: 1.62;
  color: #d6e4ec;
  tab-size: 2;
}
html[data-theme="light"] pre { background: #f2ede4; color: #2a323a; border-color: var(--line); }
pre code { font-family: inherit; background: none; padding: 0; border: 0; font-size: inherit; color: inherit; white-space: pre; }
pre .tok-tag { color: #8fd0c1; }
pre .tok-attr { color: #dcb072; }
pre .tok-str { color: #c9de8f; }
pre .tok-com { color: #6d8291; font-style: italic; }
pre .tok-key { color: #b3a4ef; }

code {
  font-family: var(--font-mono); font-size: 0.875em;
  background: var(--panel-3); color: var(--text-soft);
  padding: 1.5px 5px; border-radius: 5px; border: 1px solid var(--line-soft);
  white-space: nowrap;
}

.copy-btn {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 6px;
  background: color-mix(in srgb, var(--panel-3) 88%, transparent);
  border: 1px solid var(--line); color: var(--muted);
  font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em;
  cursor: pointer; opacity: 0; transition: all 160ms var(--ease);
}
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.copy-btn.is-copied { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); opacity: 1; }

.prompt-label {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 1.5em 0 -0.7em; padding: 3px 9px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-dim); border-radius: 5px;
}

/* ---------- Tabelas ---------- */

.table-wrap { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.9px; background: var(--panel); }
thead th {
  text-align: left; padding: 10px 14px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); background: var(--panel-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); color: var(--text-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
td strong { color: var(--text); }

/* ---------- Síntese ---------- */

.summary {
  position: relative;
  margin: 2.6em 0 1.6em; padding: 22px 24px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: var(--radius);
  background:
    radial-gradient(600px 200px at 0% 0%, var(--accent-dim), transparent 70%),
    var(--panel);
  box-shadow: var(--shadow-sm);
}
.summary__label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.summary__label::after { content: ""; flex: 1; height: 1px; background: color-mix(in srgb, var(--accent) 22%, transparent); }
.summary h3 { margin: 0 0 12px; font-size: 1.25rem; }
.summary ul { margin: 0; padding-left: 0; list-style: none; }
.summary li {
  position: relative; padding-left: 22px; margin: 0.5em 0;
  font-size: 14.6px; color: var(--text-soft);
}
.summary li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 7px; height: 7px; border-radius: 2px;
  background: var(--accent); opacity: 0.85; transform: rotate(45deg);
}
.summary__principle {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed color-mix(in srgb, var(--accent) 24%, transparent);
  font-family: var(--font-serif); font-size: 15.4px; font-style: italic; color: var(--text);
}

/* ---------- Checklist ---------- */

.checklist { margin: 1.5em 0; padding: 0; list-style: none; }
.checklist li {
  position: relative; padding: 7px 0 7px 30px; margin: 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14.5px; color: var(--text-soft);
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 13px;
  width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--accent-dim);
}

/* ---------- Detalhes / exercícios ---------- */

details {
  margin: 1.2em 0; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); overflow: hidden;
}
summary {
  padding: 12px 16px; cursor: pointer; list-style: none;
  font-size: 13.8px; font-weight: 600; color: var(--text-soft);
  display: flex; align-items: center; gap: 9px;
  transition: background 160ms var(--ease);
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+"; display: grid; place-items: center;
  width: 18px; height: 18px; border-radius: 5px; flex: none;
  background: var(--accent-dim); color: var(--accent);
  font-family: var(--font-mono); font-size: 13px; line-height: 1;
}
details[open] summary::before { content: "−"; }
summary:hover { background: var(--panel-2); }
details > *:not(summary) { padding: 0 16px; }
details > *:not(summary):last-child { padding-bottom: 14px; }
details[open] summary { border-bottom: 1px solid var(--line-soft); margin-bottom: 12px; }

/* ---------- Métricas / números ---------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 1.6em 0; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.stat__value { font-family: var(--font-serif); font-size: 1.6rem; color: var(--accent); line-height: 1.1; }
.stat__label { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* ---------- Steps ---------- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.6em 0; }
.steps li {
  position: relative; padding: 0 0 18px 44px; margin: 0;
  border-left: 1px solid var(--line);
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: -14px; top: -2px;
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel-3); border: 1px solid var(--line);
  color: var(--accent); font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
}
.steps strong { display: block; margin-bottom: 2px; }

/* ---------- Navegação entre lições ---------- */

.lesson-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 52px 0 0; padding-top: 26px; border-top: 1px solid var(--line-soft);
}
.lesson-nav a {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); text-decoration: none; color: inherit;
  transition: all 180ms var(--ease);
}
.lesson-nav a:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--panel-2); transform: translateY(-1px); }
.lesson-nav span { font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.lesson-nav strong { font-size: 14px; font-weight: 600; }
.lesson-nav a:last-child { text-align: right; align-items: flex-end; }
.lesson-nav a.is-disabled { visibility: hidden; }

.lesson-actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.btn-done {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  background: var(--accent-dim); color: var(--accent);
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 160ms var(--ease);
}
.btn-done:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.btn-done.is-done { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: var(--green-dim); color: var(--green); }
.btn-done svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Rail / TOC ---------- */

.rail {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h)); overflow: hidden;
}
.rail__inner { height: 100%; overflow-y: auto; padding: 46px 20px 30px 0; }
.rail__label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-2); margin: 0 0 10px;
}
.toc { display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--line); }
.toc a {
  padding: 5px 0 5px 12px; margin-left: -1px;
  font-size: 12.4px; line-height: 1.45; color: var(--muted); text-decoration: none;
  border-left: 1px solid transparent;
  transition: all 140ms var(--ease);
}
.toc a:hover { color: var(--text-soft); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc a.toc__sub { padding-left: 22px; font-size: 12px; color: var(--muted-2); }

/* ---------- Home ---------- */

.home-hero { padding: 30px 0 10px; }
.home-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); letter-spacing: -0.03em; }
.home-hero .lead { font-size: 1.2rem; max-width: 40ch; }
.home-modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 2em 0; }
.module-card {
  display: block; text-decoration: none; color: inherit;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); transition: all 190ms var(--ease); position: relative; overflow: hidden;
}
.module-card::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0; transition: opacity 200ms var(--ease);
}
.module-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow-md); }
.module-card:hover::after { opacity: 1; }
.module-card__num { font-family: var(--font-mono); font-size: 10.5px; color: var(--accent); letter-spacing: 0.08em; }
.module-card strong { display: block; margin: 6px 0 4px; font-family: var(--font-serif); font-size: 1.1rem; font-weight: 600; }
.module-card p { margin: 0; font-size: 13.4px; color: var(--muted); line-height: 1.55; }
.module-card__meta { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted-2); }
.module-card__bar { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.module-card__bar i { display: block; height: 100%; background: var(--accent); width: 0; }

/* ---------- Rodapé ---------- */

.page-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 26px 0 40px;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: 11.5px; color: var(--muted-2);
}
.page-footer__hint kbd { margin: 0 1px; }

/* ---------- Busca ---------- */

.search-modal { position: fixed; inset: 0; z-index: 90; }
.search-modal[hidden] { display: none; }
.search-modal__backdrop { position: absolute; inset: 0; background: rgba(4, 8, 12, 0.62); backdrop-filter: blur(3px); }
.search-modal__panel {
  position: relative; max-width: 640px; margin: 12vh auto 0;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden;
  animation: pop 180ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.99); } }
.search-modal__input {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.search-modal__input svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.search-modal__input input {
  flex: 1; background: none; border: 0; outline: none;
  font-family: inherit; font-size: 15px; color: var(--text);
}
.search-modal__input input::placeholder { color: var(--muted-2); }
.search-modal__results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-result {
  display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: inherit;
  border: 1px solid transparent;
}
.search-result:hover, .search-result.is-focus { background: var(--panel-2); border-color: var(--line); }
.search-result__crumb { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.search-result strong { display: block; font-size: 14px; margin: 2px 0 2px; font-weight: 600; }
.search-result p { margin: 0; font-size: 12.7px; color: var(--muted); line-height: 1.5; }
.search-result mark { background: var(--accent-dim); color: var(--accent); padding: 0 2px; border-radius: 3px; }
.search-empty { padding: 22px 14px; text-align: center; color: var(--muted-2); font-size: 13px; margin: 0; }

/* ---------- Voltar ao topo ---------- */

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: all 200ms var(--ease); box-shadow: var(--shadow-md);
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.to-top svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }

/* ---------- Responsivo ---------- */

@media (max-width: 1280px) {
  :root { --rail-w: 0px; }
  .rail { display: none; }
  .layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 280px; }
  .main { padding: 0 32px; }
}

@media (max-width: 860px) {
  .topbar__menu { display: grid; }
  .brand__text small { display: none; }
  .search-trigger span { display: none; }
  .search-trigger kbd { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 45;
    width: 300px; max-width: 86vw; background: var(--bg);
    transform: translateX(-102%); transition: transform 240ms var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after {
    content: ""; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(0,0,0,0.5);
    z-index: 44;
  }
  .main { padding: 0 20px; }
  .main__inner { padding-top: 30px; }
  .example__cols { grid-template-columns: 1fr; }
  .example__col + .example__col { border-left: 0; border-top: 1px solid var(--line-soft); }
  .lesson-nav { grid-template-columns: 1fr; }
  .lesson-nav a:last-child { text-align: left; align-items: flex-start; }
  .page-footer { flex-direction: column; }
  .home-hero h1 { font-size: 2.05rem; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .main { padding: 0 15px; }
  h2 { font-size: 1.42rem; }
  .summary { padding: 18px 16px; }
  .card { padding: 15px; }
}

/* ---------- Impressão ---------- */

@media print {
  .topbar, .sidebar, .rail, .to-top, .progress-rail, .lesson-nav, .lesson-actions,
  .search-modal, .copy-btn, .page-footer__hint { display: none !important; }
  body { background: #fff; color: #111; font-size: 11.5pt; }
  .layout { display: block; }
  .main { padding: 0; }
  .main__inner { max-width: none; padding: 0; }
  h1, h2, h3 { color: #111; page-break-after: avoid; }
  pre { background: #f5f5f5; color: #111; border: 1px solid #ddd; page-break-inside: avoid; }
  .card, .callout, .example, .summary { break-inside: avoid; border-color: #ddd; background: #fafafa; }
  a { color: #111; text-decoration: none; }
  .lesson-block { page-break-after: always; }
}
