:root {
  --bg: #0A0C0B;
  --ink: #E8EFEA;
  --muted: #96A69E;
  --line: #1A201D;
  --line-2: #232A26;
  --card: #101413;
  --surface: #0C100F;
  --accent: #3BE081;
  --accent-ink: #06170E;
  --accent-2: #FFB74D;
  --accent-soft: #16211C;
  --ok: #7BE0B0;
  --ok-bg: #0E1A14;
  --ok-line: #1E3B2B;
  --warn: #FFB74D;
  --warn-bg: #14110C;
  --warn-line: #3B2F1B;
  --info: #3BE081;
  --info-bg: #0F1614;
  --info-line: #233028;
  --hint: #9EC7DE;
  --hint-bg: #101A22;
  --hint-line: #1F3341;
  --code: #0D1211;
  --code-fg: #C9D6CF;
  --code-chrome: #0A0E0D;
  --sidebar: #0C100F;
  --sidebar-fg: #A9B8B0;
  --sidebar-muted: #5A6B63;
  --radius: 14px;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", ui-monospace, monospace;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans", system-ui, sans-serif;
  --label: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #FBFCFA;
  --ink: #101512;
  --muted: #57655D;
  --line: #E3E7E3;
  --line-2: #E3E7E3;
  --card: #FFFFFF;
  --surface: #F3F5F2;
  --accent: #0E9B5C;
  --accent-ink: #FFFFFF;
  --accent-2: #C47B16;
  --accent-soft: #EDF7F1;
  --ok: #0E7A4A;
  --ok-bg: #EDF7F1;
  --ok-line: #CFE7DA;
  --warn: #C47B16;
  --warn-bg: #FBF4E8;
  --warn-line: #EBD7B0;
  --info: #0E7A4A;
  --info-bg: #EDF7F1;
  --info-line: #CFE7DA;
  --hint: #1E3A5F;
  --hint-bg: #EEF3F8;
  --hint-line: #D0DCE8;
  --code: #0D1211;
  --code-fg: #C9D6CF;
  --code-chrome: #0A0E0D;
  --sidebar: #F3F5F2;
  --sidebar-fg: #46534C;
  --sidebar-muted: #93A099;
}

@keyframes lu-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

* {
  scrollbar-width: thin;
  scrollbar-color: #2A332F var(--card, #101413);
}
html[data-theme="light"] * {
  scrollbar-color: #C5CEC8 #F3F5F2;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #2A332F;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #3A463F;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: #C5CEC8;
}
html[data-theme="light"] *::-webkit-scrollbar-thumb:hover {
  background: #A9B8B0;
}
*::-webkit-scrollbar-corner { background: transparent; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { filter: brightness(1.12); }

.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus {
  left: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 20;
  border-radius: 8px;
}

.layout {
  display: grid;
  grid-template-columns: 276px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--sidebar);
  color: var(--sidebar-fg);
  padding: 26px 18px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand {
  margin: 0 0 8px;
  padding: 0 8px;
  font-size: 0;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 3px;
  text-decoration: none;
  color: inherit;
  font-size: 19px;
}
.wordmark:hover { filter: none; }
.wm-linha,
.wm-um {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.04em;
  font-size: 19px;
}
.wm-linha { color: var(--ink); }
.wm-um { color: var(--accent); }
.wm-cursor {
  display: inline-block;
  width: 5px;
  height: 15px;
  background: var(--accent);
  margin-left: 4px;
  animation: lu-blink 1.1s steps(2) infinite;
  vertical-align: -2px;
}

.mod-list { list-style: none; margin: 0; padding: 0; }
.mod-list a {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 0.84rem;
}
.mod-list a:hover { background: #141A17; color: #F2F7F4; }
html[data-theme="light"] .mod-list a:hover { background: #E7EBE7; color: #101512; }
.mod-list a.on { background: #141A17; color: #F2F7F4; font-weight: 600; }
html[data-theme="light"] .mod-list a.on { background: #E7EBE7; color: #101512; }
.mod-list em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.69rem;
  color: var(--sidebar-muted);
}

.toc-label {
  font-family: var(--label);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  margin: 10px 0 4px;
  padding: 8px 8px 6px;
  font-weight: 500;
  border: 0;
}

.toc-drop {
  margin-top: 6px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}
.toc-drop > summary.toc-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--sidebar-fg);
  letter-spacing: 0.1em;
}
.toc-drop > summary.toc-label::-webkit-details-marker { display: none; }
.toc-drop > summary.toc-label::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  margin-top: -4px;
}
.toc-drop[open] > summary.toc-label::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}
.toc-drop .toc,
.toc-drop .mod-list {
  padding: 0 4px 8px 6px;
  max-height: min(42vh, 320px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.parts {
  list-style: none;
  counter-reset: parte;
  margin: 0;
  padding: 0;
}
.parts li { counter-increment: parte; }
.parts a {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 0.81rem;
  line-height: 1.35;
}
.parts a::before {
  content: counter(parte);
  font-family: var(--mono);
  font-size: 0.69rem;
  color: var(--sidebar-muted);
}
.parts a:hover, .parts a.on { background: #141A17; color: #F2F7F4; }
html[data-theme="light"] .parts a:hover,
html[data-theme="light"] .parts a.on { background: #E7EBE7; color: #101512; }

.toc {
  list-style: none;
  counter-reset: aula;
  margin: 0;
  padding: 0;
  flex: 1;
}
.toc li { counter-increment: aula; }
.toc a {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 8px;
  align-items: baseline;
  color: inherit;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 0.81rem;
  line-height: 1.35;
}
.toc a::before {
  content: counter(aula);
  font-family: var(--mono);
  font-size: 0.69rem;
  color: var(--sidebar-muted);
}
.toc a:hover { background: #141A17; color: #F2F7F4; }
html[data-theme="light"] .toc a:hover { background: #E7EBE7; color: #101512; }
.toc a.active {
  background: #141A17;
  color: #F2F7F4;
  font-weight: 600;
}
html[data-theme="light"] .toc a.active { background: #E7EBE7; color: #101512; }
h2[id] { scroll-margin-top: 16px; }

.progress-wrap { margin: 4px 0 10px; padding: 0 8px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--label);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}
.progress-label .pct { color: var(--accent); }
.progress {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.theme-dock {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  gap: 10px;
}
.theme-dock span.label { font-size: 0.75rem; color: var(--muted); }
.theme-switch {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 99px;
  padding: 3px;
}
.theme-switch button {
  font-family: var(--sans);
  font-size: 0.69rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
  background: transparent;
  color: var(--sidebar-muted);
}
.theme-switch button.on {
  background: #232A26;
  color: #E8EFEA;
}
html[data-theme="light"] .theme-switch button.on {
  background: #FFFFFF;
  border: 1px solid var(--line);
  color: #101512;
}

.content {
  max-width: none;
  width: 100%;
  padding: 48px clamp(28px, 4vw, 64px) 72px;
}
.kicker {
  color: var(--accent);
  font-family: var(--label);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0 0 12px;
}
h1 {
  font-family: var(--display);
  font-size: 2.75rem;
  line-height: 1.05;
  margin: 0 0 16px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: #F5FAF7;
}
html[data-theme="light"] h1 { color: #0B100D; }
h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  margin: 36px 0 14px;
  padding-top: 0;
  border-top: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #F2F7F4;
}
html[data-theme="light"] h2 { color: #0B100D; }
h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
p { margin: 0 0 16px; color: #A9B8B0; }
html[data-theme="light"] p { color: #46534C; }
.lead { font-size: 1.06rem; color: var(--muted); margin-bottom: 28px; }

.home-hero { padding-top: 48px; }
.home-hero h1 { font-size: 2.9rem; max-width: 24ch; }

.continue {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(90deg, rgba(59, 224, 129, 0.1), transparent 60%);
  border: 1px solid #2A3B32;
  border-radius: 16px;
  padding: 22px 26px;
  color: inherit;
  text-decoration: none;
  margin: 0 0 28px;
}
html[data-theme="light"] .continue {
  background: linear-gradient(90deg, rgba(14, 155, 92, 0.1), transparent 60%);
  border-color: #CFE7DA;
}
.continue:hover { filter: none; border-color: var(--accent); }
.continue .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.1rem;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.continue strong { display: block; font-size: 1.05rem; color: var(--ink); }
.continue em {
  font-style: normal;
  font-family: var(--label);
  font-size: 0.75rem;
  color: var(--muted);
}
.continue .go {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 11px 20px;
  border-radius: 10px;
  white-space: nowrap;
}

.mod-grid {
  display: grid;
  gap: 12px;
  margin: 8px 0 28px;
}
@media (min-width: 920px) {
  .home-hero .mod-grid { grid-template-columns: 1fr 1fr; }
}
.mod-card {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
}
.mod-card:hover { border-color: var(--accent); filter: none; }
.mod-card .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.mod-card strong { display: block; font-size: 0.95rem; color: var(--ink); }
.mod-card span {
  font-family: var(--mono);
  color: var(--sidebar-muted);
  font-size: 0.72rem;
}
.mod-card small {
  font-family: var(--label);
  color: var(--sidebar-muted);
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
}

.callout {
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 36px;
  border: 1px solid var(--line-2);
}
.callout strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--label);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.callout.idea {
  background: var(--info-bg);
  border-color: var(--info-line);
  border-left: 3px solid var(--accent);
}
.callout.idea strong { color: var(--accent); }
.callout.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  border-left: 3px solid var(--accent-2);
}
.callout.warn strong { color: var(--accent-2); }
.callout.extra {
  background: var(--info-bg);
  border-color: var(--info-line);
}
.callout.erro {
  background: #1A1010;
  border-color: #3B1F1F;
  border-left: 3px solid #FF8A8A;
}
html[data-theme="light"] .callout.erro {
  background: #FFF0F0;
  border-color: #F0C8C8;
}
.callout.oficina {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  border-left: 3px solid var(--accent-2);
}
.callout.oficina strong { color: var(--accent-2); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.card h3 { margin-top: 0; color: var(--ink); }
.card p { margin: 0; }

.ops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 20px;
}
.ops div {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
}
.ops strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: 6px;
  color: var(--ink);
}
.ops span {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

pre, .terminal {
  background: var(--code);
  color: var(--code-fg);
  border-radius: 12px;
  padding: 18px 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.7;
  margin: 0 0 28px;
  border: 1px solid #232A26;
}
code { font-family: var(--mono); font-size: 0.9em; }
p code, li code, td code, h3 code, h2 code {
  background: #141A17;
  border: 1px solid var(--line-2);
  padding: 1px 6px;
  border-radius: 5px;
  color: var(--code-fg);
  font-size: 0.9em;
}
html[data-theme="light"] p code,
html[data-theme="light"] li code,
html[data-theme="light"] td code,
html[data-theme="light"] h3 code,
html[data-theme="light"] h2 code {
  background: #EFF2EF;
  color: #1B2620;
}
pre code { background: none; padding: 0; color: inherit; border: 0; }
.prompt { color: var(--accent); }
.out { color: #E7D9A8; }
.err { color: #FF8A8A; }
.comment { color: #5A6B63; }
.kw { color: #c792ea; }
.fn { color: #7BB6FF; }
.str { color: #A8E6A0; }
.num { color: #f78c6c; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line-2);
  font-size: 0.95rem;
}
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { background: var(--surface); font-weight: 650; }
tr:last-child td { border-bottom: 0; }

.exercise {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 24px 26px 26px;
  margin: 22px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.exercise.oficina-ex { border-color: var(--warn-line); }
.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--sidebar-muted);
  font-family: var(--label);
  margin: 0;
}
.badge-id {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 3px 8px;
  border-radius: 5px;
  font-weight: 700;
}
.oficina-ex .badge-id {
  background: var(--accent-2);
  color: #06170E;
}
.exercise h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #F2F7F4;
}
html[data-theme="light"] .exercise h3 { color: #0B100D; }

.choices { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.choices label {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: #0D1211;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.91rem;
  line-height: 1.5;
  color: #B7C5BD;
}
html[data-theme="light"] .choices label {
  background: #FAFBF9;
  color: #2E3D35;
}
.choices label:hover { border-color: #3A463F; }
html[data-theme="light"] .choices label:hover { border-color: #B9C6BE; }
.choices input { margin-top: 3px; accent-color: var(--accent); }

kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}

.editor {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto 1fr;
  background: #0A0E0D;
  color: var(--code-fg);
  border: 1px solid #232A26;
  border-radius: 12px;
  margin: 0;
  overflow: hidden;
  font-family: var(--mono);
}
.editor-chrome {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  padding: 9px 14px;
  background: #080B0A;
  color: #5A6B63;
  font-family: var(--label);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid #1E2421;
}
.editor-gutter {
  background: #080B0A;
  color: #3A463F;
  padding: 14px 10px 18px;
  text-align: right;
  line-height: 1.7;
  font-size: 0.88rem;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}
.editor textarea.code-in {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--code-fg);
  caret-color: var(--accent);
  padding: 14px 16px 18px;
  line-height: 1.7;
  font-size: 0.88rem;
  tab-size: 4;
  resize: vertical;
  min-height: 7rem;
  outline: none;
  white-space: pre;
  overflow: auto;
  box-shadow: none;
}
.editor textarea.code-in::placeholder { color: #3A463F; }
.editor:focus-within { box-shadow: 0 0 0 1px var(--accent); }

textarea.code-in, input.code-in {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #232A26;
  background: #0A0E0D;
  color: var(--code-fg);
  margin: 0;
  resize: vertical;
}
input.code-in {
  caret-color: var(--accent);
  font-size: 0.9rem;
  padding: 10px 14px;
  tab-size: 4;
}
input.code-in:focus {
  outline: 1px solid var(--accent);
  outline-offset: 0;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
button {
  font: inherit;
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 600;
}
.btn-check { background: var(--accent); color: var(--accent-ink); }
.btn-check:hover { filter: brightness(1.06); }
.btn-hint { background: var(--accent-soft); color: #7BE0B0; font-weight: 500; }
html[data-theme="light"] .btn-hint { color: #0E7A4A; }
.btn-reset { background: transparent; color: var(--sidebar-muted); font-weight: 500; padding: 10px 8px; }
.feedback {
  margin-top: 0;
  padding: 13px 15px;
  border-radius: 10px;
  display: none;
  font-size: 0.91rem;
  line-height: 1.6;
}
.feedback.show { display: block; }
.feedback.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-line);
}
.feedback.bad {
  background: #1A1010;
  color: #FF8A8A;
  border: 1px solid #3B1F1F;
}
html[data-theme="light"] .feedback.bad {
  background: #FDECEC;
  color: #9B1C1C;
  border-color: #F0C8C8;
}
.hints { margin-top: 0; }
.hint {
  display: none;
  background: var(--hint-bg);
  color: var(--hint);
  border: 1px solid var(--hint-line);
  border-radius: 10px;
  padding: 13px 15px;
  margin-top: 8px;
  font-size: 0.91rem;
}
.hint.show { display: block; }
.hint.solucao {
  background: var(--warn-bg);
  color: #D6C7AC;
  border-color: var(--warn-line);
}
html[data-theme="light"] .hint.solucao { color: #7C2D12; }

.passos {
  counter-reset: p;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.passos li {
  counter-increment: p;
  position: relative;
  padding: 8px 0 8px 44px;
  margin: 0 0 4px;
  color: #A9B8B0;
}
html[data-theme="light"] .passos li { color: #46534C; }
.passos li::before {
  content: counter(p);
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--mono);
}
.ciclo {
  background: var(--code);
  border: 1px solid #232A26;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
  margin: 0 0 18px;
  color: var(--code-fg);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.pager a:last-child { text-align: right; color: var(--accent); }
.pager .pager-k {
  font-family: var(--label);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  font-weight: 500;
}

.ad-slot {
  display: none;
  width: min(336px, 100%);
  margin: 28px 0 32px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--card);
}
.ad-slot.is-on { display: block; }
.ad-kicker {
  margin: 0 0 10px;
  font-family: var(--label);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}
.ad-slot ins.adsbygoogle {
  display: block;
  width: 100%;
  min-height: 250px;
  background: var(--surface);
  border-radius: 8px;
}
.page-404 .ad-slot {
  width: min(336px, 100%);
  text-align: left;
}

footer.aula {
  margin-top: 48px;
  color: var(--sidebar-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  line-height: 1.6;
}

.page-404 {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 40px 20px;
  text-align: center;
  background: radial-gradient(700px 320px at 50% 40%, rgba(59, 224, 129, 0.08), transparent 70%);
}
.page-404 .term {
  width: min(560px, 100%);
  background: #0D1211;
  border: 1px solid #232A26;
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
}
.page-404 .term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #0A0E0D;
  border-bottom: 1px solid #1E2421;
  font-family: var(--mono);
  font-size: 0.69rem;
  color: #6B7A73;
}
.page-404 .dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #2E3630;
}
.page-404 pre {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.page-404 h1 { margin: 8px 0 0; }
.page-404 .lead { max-width: 46ch; }
.page-404 .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.page-404 .btn-check { display: inline-block; padding: 13px 24px; border-radius: 11px; }
.page-404 .ghost {
  border: 1px solid #2E3630;
  color: #E8EFEA;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 11px;
}

@media (max-width: 920px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .content, .home-hero { padding: 28px 18px 64px; }
  .grid-2, .ops { grid-template-columns: 1fr; }
  h1, .home-hero h1 { font-size: 2rem; }
  .mod-card { grid-template-columns: 3rem 1fr; }
  .mod-card small { display: none; }
  .continue { flex-wrap: wrap; }
  .continue .go { margin-left: 0; }
  .theme-dock { margin-top: 16px; }
}
