/* =========================================================
   llm.css   o design system da SÉRIE DIDÁTICA

   ATENÇÃO ao nome do arquivo: ele nasceu para llm.html, mas
   hoje é a base visual de TODAS as páginas da série. O nome
   ficou por causa de cache: renomear invalida o arquivo para
   quem já visitou o site, e não compra nada em troca.

   Camada 1 de 3 da série:
     styles.css   tokens globais do site (mono, branco, verde)
     llm.css      ESTE arquivo   tokens de etapa + .llm-*
     didatica.css componentes compartilhados (.emb-*, .dd-*)
     <pagina>.css o que só existe numa página

   O que mora aqui: as variáveis --c-* / --hair* / --ink-*, o
   esqueleto (.llm-shell, .llm-aside, .llm-main, .llm-stage),
   a navegação, e os componentes de conteúdo (.llm-panel,
   .llm-card, .llm-note, .llm-bar, .llm-grid, .llm-formula…).

   REGRA DE ALTERAÇÃO: mudar qualquer seletor .llm-* ou
   qualquer variável do :root abaixo afeta todas as páginas da
   série de uma vez. Se a mudança serve a uma página só, ela
   pertence ao CSS daquela página   não a este arquivo.
   Adicionar seletor novo é seguro; alterar ou remover exige
   revisar a série inteira.
   ========================================================= */

:root {
  /* paleta de etapas, calibrada pra contraste em fundo branco */
  --c-blue: #2f6fed;
  --c-amber: #a76a00;
  --c-green: #2f9e44;
  --c-pink: #d1436b;
  --c-purple: #7c3aed;
  --c-cyan: #0e7f92;

  --hair: rgba(14, 16, 22, 0.14);
  --hair-soft: rgba(14, 16, 22, 0.08);
  --ink-60: rgba(14, 16, 22, 0.62);
  --ink-45: rgba(14, 16, 22, 0.45);
  --ink-80: rgba(14, 16, 22, 0.80);
}

/* o reset global do site pinta TODO elemento de branco; dentro dos painéis
   com tinta de cor isso viraria um retângulo branco por cima. :where() mantém
   especificidade zero, então qualquer classe daqui continua mandando mais. */
:where(.llm-page) :where(div, p, span, ul, li, label, h1, aside, main, nav,
  article, small, b, strong, em, sub, sup, svg, path, circle, rect) {
  background: transparent;
}

/* o reset global (`* { color: var(--bg) }`) zera a herança de cor em cada
   elemento; onde o texto é composto por spans aninhados, devolvemos a herança */
.llm-list li > span,
.llm-metric__value > span,
.llm-legend span {
  color: inherit;
  background: transparent;
}

body.llm-page {
  min-height: 100vh;
}

/* =========================
   Shell: trilho lateral + palco
   ========================= */
.llm-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.llm-aside {
  position: sticky;
  top: 0;
  flex: 0 0 268px;
  width: 268px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--md);
  padding: var(--lg) var(--md);
  border-right: 1px solid var(--hair);
  overflow-y: auto;
}

.llm-back {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--sm) / 1.4);
  font-size: calc(var(--md) / 1.15);
  text-decoration: none;
  color: var(--ink-60);
}

.llm-brand {
  display: flex;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
  font-size: calc(var(--md) * 1.15);
  font-weight: 700;
  line-height: 1.15;
}

.llm-brand__dot {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--prompt-green);
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.14);
}

.llm-brand__sub {
  margin-top: calc(var(--sm) / 2);
  font-size: calc(var(--sm) / 1.02);
  line-height: 1.5;
  color: var(--ink-45);
}

.llm-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.llm-nav__item {
  display: flex;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
  padding: calc(var(--sm) / 1.4) calc(var(--sm) / 1.2);
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.llm-nav__item:hover {
  background: rgba(14, 16, 22, 0.035);
  transform: translateX(2px);
}

.llm-nav__item.is-active {
  background: rgba(63, 185, 80, 0.07);
  border-color: rgba(63, 185, 80, 0.45);
}

.llm-nav__n {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(14, 16, 22, 0.05);
  color: var(--ink-45);
  font-size: calc(var(--sm) / 1.02);
  font-weight: 700;
  transition: background .2s ease, color .2s ease;
}

.llm-nav__item.is-active .llm-nav__n {
  background: var(--prompt-green);
  color: #fff;
}

.llm-nav__label {
  font-size: calc(var(--md) / 1.14);
  line-height: 1.25;
  color: var(--ink-60);
  background: transparent;
}

.llm-nav__item.is-active .llm-nav__label {
  color: var(--bg);
  font-weight: 700;
}

.llm-aside__foot {
  margin-top: auto;
  font-size: calc(var(--sm) / 1.06);
  line-height: 1.6;
  color: var(--ink-45);
}

.llm-main {
  flex: 1;
  /* O .llm-shell usa align-items: flex-start, então no empilhamento de
     celular o .llm-main é dimensionado pelo conteúdo   e qualquer bloco
     com min-content acima da viewport (tabela larga, <pre> de código)
     empurra a página inteira em vez de rolar por dentro. Em linha, o
     flex-basis manda e o width é ignorado; na coluna, ele conserta. */
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.llm-stage {
  flex: 1;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: var(--lg) var(--lg) var(--md);
}

/* =========================
   Cabeçalho da etapa
   ========================= */
.llm-progress {
  display: flex;
  align-items: center;
  gap: var(--md);
}

.llm-progress__track {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(14, 16, 22, 0.08);
  overflow: hidden;
}

.llm-progress__bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: var(--prompt-green);
  transition: width .35s ease;
}

.llm-progress__count {
  font-size: calc(var(--sm) / 1.02);
  color: var(--ink-45);
  white-space: nowrap;
}

.llm-eyebrow {
  margin: var(--lg) 0 calc(var(--sm) / 1.4);
  font-size: calc(var(--sm) / 1.08);
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--ink-45);
}

.llm-title {
  font-size: clamp(26px, 3.6vw, calc(var(--lg) * 2));
  line-height: 1.12;
  margin-bottom: calc(var(--sm) / 1.2);
}

.llm-lead {
  max-width: 660px;
  font-size: var(--md);
  line-height: 1.6;
  color: var(--ink-60);
}

.llm-cta {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
  margin-top: var(--md);
  padding: calc(var(--sm) / 1.4) var(--md);
  border: 1px solid rgba(63, 185, 80, 0.45);
  border-radius: 999px;
  background: rgba(63, 185, 80, 0.06);
  font-size: calc(var(--md) / 1.05);
  line-height: 1.35;
}

.llm-cta__icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--prompt-green);
  color: #fff;
}

.llm-cta__icon svg { display: block; width: 12px; height: 12px; }

/* =========================
   Blocos de conteúdo
   ========================= */
.llm-step { margin-top: var(--lg); }
.llm-step[hidden] { display: none; }

.llm-step > * + * { margin-top: var(--md); }

.llm-panel {
  padding: var(--lg);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #fff;
}

/* painel com sotaque de cor: borda e tinta derivadas de --c */
.llm-panel--accent {
  border-color: color-mix(in srgb, var(--c, var(--prompt-green)) 42%, transparent);
  background: color-mix(in srgb, var(--c, var(--prompt-green)) 4%, #fff);
}

.llm-panel__tag {
  margin-bottom: calc(var(--sm) / 1.2);
  font-size: calc(var(--sm) / 1.08);
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--c, var(--prompt-green));
  background: transparent;
}

.llm-panel__title {
  font-size: var(--lg);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: calc(var(--sm) / 1.6);
}

.llm-text {
  font-size: calc(var(--md) / 1.02);
  line-height: 1.6;
  color: var(--ink-60);
}

.llm-text + .llm-text { margin-top: calc(var(--sm) / 1.2); }
.llm-text strong { color: var(--bg); font-weight: 700; }
.llm-text em { font-style: italic; }

.llm-note {
  padding: var(--md) var(--lg);
  border: 1px solid color-mix(in srgb, var(--c, var(--prompt-green)) 38%, transparent);
  border-left: 3px solid var(--c, var(--prompt-green));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--c, var(--prompt-green)) 4%, #fff);
  font-size: calc(var(--md) / 1.02);
  line-height: 1.6;
  color: var(--ink-80);
}

.llm-note b { color: var(--c, var(--prompt-green)); }

.llm-grid {
  display: grid;
  gap: var(--md);
}

.llm-grid--2 { grid-template-columns: 1fr 1fr; }
.llm-grid--3 { grid-template-columns: repeat(3, 1fr); }
.llm-grid--4 { grid-template-columns: repeat(4, 1fr); }

/* card com o mesmo lift dos cards do currículo */
.llm-card {
  display: flex;
  flex-direction: column;
  gap: calc(var(--sm) / 1.6);
  padding: var(--md) var(--lg);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.llm-card__title {
  font-size: calc(var(--md) * 1.05);
  font-weight: 700;
  line-height: 1.25;
  color: var(--c, var(--bg));
  background: transparent;
}

.llm-card--action { cursor: pointer; }

.llm-card--action:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 16, 22, 0.30);
  box-shadow: 0 14px 38px rgba(14, 16, 22, 0.10);
}

.llm-card__head {
  display: flex;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
}

.llm-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--c, var(--prompt-green));
  color: #fff;
  font-size: calc(var(--sm) / 1.02);
  font-weight: 700;
}

/* =========================
   Fórmulas
   ========================= */
.llm-formula {
  padding: calc(var(--sm) / 1.1) var(--md);
  border: 1px solid var(--hair-soft);
  border-radius: 10px;
  background: rgba(14, 16, 22, 0.035);
  font-size: calc(var(--md) * 1.05);
  line-height: 1.5;
  overflow-x: auto;
  white-space: nowrap;
}

.llm-formula sub, .llm-formula sup { font-size: .72em; }

.llm-formula-card {
  cursor: pointer;
  padding: var(--md);
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.llm-formula-card:hover {
  transform: translateY(-3px);
  border-color: var(--c, var(--prompt-green));
  box-shadow: 0 12px 30px rgba(14, 16, 22, 0.08);
}

.llm-formula-card__tag {
  display: block;
  margin-bottom: calc(var(--sm) / 1.6);
  font-size: calc(var(--sm) / 1.1);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c, var(--prompt-green));
  background: transparent;
}

.llm-formula-card__body {
  display: block;
  font-size: calc(var(--md) * 1.02);
  overflow-x: auto;
}

/* cores nomeadas dentro de fórmulas e textos */
.c-blue { color: var(--c-blue); background: transparent; }
.c-amber { color: var(--c-amber); background: transparent; }
.c-green { color: var(--c-green); background: transparent; }
.c-pink { color: var(--c-pink); background: transparent; }
.c-purple { color: var(--c-purple); background: transparent; }
.c-cyan { color: var(--c-cyan); background: transparent; }

/* =========================
   Pipeline (visão geral)
   ========================= */
.llm-pipeline {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: calc(var(--sm) / 1.2);
}

.llm-pipeline__step {
  display: flex;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
  animation: llm-flow .5s both;
}

.llm-pipeline__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--sm) / 1.6);
  width: 96px;
  text-align: center;
}

.llm-pipeline__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c);
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 8%, #fff);
  color: var(--c);
  font-size: 20px;
}

.llm-pipeline__icon svg { display: block; width: 20px; height: 20px; }

.llm-pipeline__label {
  font-size: calc(var(--sm) / 1.02);
  font-weight: 700;
  line-height: 1.2;
}

.llm-pipeline__sub {
  font-size: calc(var(--sm) / 1.12);
  line-height: 1.3;
  color: var(--ink-45);
}

.llm-pipeline__arrow {
  color: var(--prompt-green);
  font-size: var(--lg);
  background: transparent;
}

/* =========================
   Tokens, chips e peças
   ========================= */
.llm-tokens {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--sm) / 1.4);
  min-height: 56px;
}

.llm-token {
  padding: calc(var(--sm) / 1.6) calc(var(--sm) / 1.05);
  border: 1px solid var(--c, var(--hair));
  border-radius: 9px;
  background: color-mix(in srgb, var(--c, #fff) 8%, #fff);
  font-size: var(--md);
  line-height: 1.2;
  white-space: nowrap;
}

.llm-token--plain {
  border-color: var(--hair);
  background: rgba(14, 16, 22, 0.04);
}

.llm-token--ghost {
  border: 1px dashed rgba(63, 185, 80, 0.6);
  background: rgba(63, 185, 80, 0.06);
  color: var(--c-green);
}

.llm-token--merged {
  border-color: var(--c-purple);
  background: rgba(124, 58, 237, 0.14);
  transform: scale(1.06);
}

.llm-token--sep {
  border-color: transparent;
  background: transparent;
  color: var(--ink-45);
  padding-left: 0;
  padding-right: 0;
}

.llm-token-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--sm) / 2);
  animation: llm-pop .45s both;
}

.llm-token-id {
  font-size: calc(var(--sm) / 1.1);
  color: var(--ink-45);
}

.llm-caret {
  display: inline-block;
  width: 2px;
  height: 22px;
  background: var(--prompt-green);
  animation: llm-caret 1s step-end infinite;
}

/* botão-token (atenção) */
.llm-token-btn {
  padding: calc(var(--sm) / 1.4) var(--sm);
  border: 1px solid rgba(47, 111, 237, 0.35);
  border-radius: 9px;
  background: rgba(47, 111, 237, 0.06);
  font-size: var(--md);
  transition: all .25s ease;
}

.llm-token-btn.is-focus {
  border-color: var(--c-amber);
  background: rgba(167, 106, 0, 0.14);
  font-weight: 700;
}

/* =========================
   Barras (atenção, probs, sims)
   ========================= */
.llm-bars {
  display: flex;
  flex-direction: column;
  gap: calc(var(--sm) / 1.3);
}

.llm-bar {
  display: flex;
  align-items: center;
  gap: var(--sm);
}

.llm-bar__label {
  flex: 0 0 auto;
  width: 96px;
  font-size: calc(var(--md) / 1.1);
  color: var(--ink-80);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.llm-bar__label--right { text-align: right; }

.llm-bar__label--wide {
  width: 168px;
  white-space: normal;
  line-height: 1.3;
}

.llm-bar__track {
  flex: 1;
  height: 16px;
  border-radius: 8px;
  background: rgba(14, 16, 22, 0.06);
  overflow: hidden;
}

.llm-bar__track--tall { height: 24px; }

.llm-bar__fill {
  height: 100%;
  border-radius: 8px;
  background: var(--c, var(--prompt-green));
  transition: width .4s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

.llm-bar__value {
  flex: 0 0 auto;
  width: 46px;
  font-size: calc(var(--sm) / 1.02);
  color: var(--ink-45);
}

.llm-bar__inline {
  font-size: calc(var(--sm) / 1.02);
  color: #fff;
  font-weight: 700;
  background: transparent;
  white-space: nowrap;
}

.llm-scale {
  display: flex;
  justify-content: space-between;
  gap: var(--sm);
  margin-top: calc(var(--sm) / 1.4);
  font-size: calc(var(--sm) / 1.08);
  color: var(--ink-45);
}

/* =========================
   Embeddings
   ========================= */
.llm-embeds {
  display: flex;
  flex-wrap: wrap;
  gap: var(--md);
}

.llm-embed {
  padding: var(--sm);
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: all .25s ease;
}

.llm-embed.is-active {
  border-color: var(--c, var(--prompt-green));
  box-shadow: 0 10px 26px rgba(14, 16, 22, 0.08);
  transform: translateY(-3px);
}

.llm-embed__word {
  margin-bottom: calc(var(--sm) / 1.4);
  text-align: center;
  font-size: calc(var(--md) / 1.05);
  color: var(--c, var(--bg));
  background: transparent;
}

.llm-embed__bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 68px;
}

.llm-embed__bar {
  width: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--c-blue), var(--prompt-green));
  transition: height .4s ease;
}

.llm-vec {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--sm) / 1.6);
}

.llm-vec span {
  padding: calc(var(--sm) / 2.2) calc(var(--sm) / 1.4);
  border: 1px solid var(--hair-soft);
  border-radius: 8px;
  background: rgba(14, 16, 22, 0.03);
  font-size: calc(var(--md) / 1.15);
}

.llm-scatter {
  position: relative;
  height: 220px;
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  background:
    linear-gradient(rgba(14, 16, 22, 0.05) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(14, 16, 22, 0.05) 1px, transparent 1px) 0 0 / 44px 100%;
  overflow: hidden;
}

.llm-scatter__pt {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
  animation: llm-pop .5s both;
  background: transparent;
}

.llm-scatter__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 18%, transparent);
}

.llm-scatter__txt {
  font-size: calc(var(--md) / 1.15);
  color: var(--ink-80);
  background: transparent;
}

/* =========================
   Grades de células (RAM, pesos)
   ========================= */
.llm-cells {
  display: grid;
  gap: 4px;
}

.llm-cells--ram { grid-template-columns: repeat(16, minmax(0, 22px)); }
.llm-cells--weights { grid-template-columns: repeat(24, minmax(0, 18px)); }

.llm-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(14, 16, 22, 0.07);
  transition: background .4s ease;
}

.llm-cell.is-on { background: var(--c-cyan); }

.llm-cell--w { background: var(--c, var(--prompt-green)); }

.llm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--md);
  margin-top: var(--sm);
  font-size: calc(var(--sm) / 1.06);
  color: var(--ink-45);
}

.llm-legend > span {
  display: inline-block;
  background: transparent;
}

/* inline-block (e não flex) pra não abrir gap entre o texto e o número */
.llm-legend i.key {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 3px;
  background: var(--c, var(--prompt-green));
}

/* modo treino: pesos cintilam; modo uso: respiram devagar */
.llm-cells--weights.is-train .llm-cell--w { animation: llm-twinkle 1.4s ease-in-out infinite; }
.llm-cells--weights.is-infer .llm-cell--w { animation: llm-pulse 2.4s ease-in-out infinite; }

/* =========================
   Métricas
   ========================= */
.llm-metric {
  padding: var(--md);
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  background: rgba(14, 16, 22, 0.025);
}

.llm-metric__label {
  margin-bottom: calc(var(--sm) / 2);
  font-size: calc(var(--sm) / 1.12);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-45);
  background: transparent;
}

.llm-metric__value {
  font-size: calc(var(--lg) * 1.05);
  font-weight: 700;
  line-height: 1.15;
  color: var(--c, var(--bg));
  background: transparent;
}

.llm-metric__value small {
  font-size: calc(var(--sm) / 1.02);
  font-weight: 400;
  color: var(--ink-45);
  background: transparent;
}

/* =========================
   Controles
   ========================= */
.llm-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
}

.llm-btn {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--sm) / 1.4);
  padding: calc(var(--sm) / 1.3) var(--md);
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #fff;
  font-size: calc(var(--md) / 1.06);
  line-height: 1;
  transition: border-color .25s ease, background .25s ease, transform .25s ease, color .25s ease;
}

.llm-btn:hover {
  border-color: var(--prompt-green);
  background: rgba(63, 185, 80, 0.07);
  transform: translateY(-2px);
}

.llm-btn--primary {
  border-color: var(--prompt-green);
  background: var(--prompt-green);
  color: #fff;
  font-weight: 700;
}

.llm-btn--primary:hover {
  background: #37a446;
  border-color: #37a446;
  color: #fff;
}

.llm-btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.llm-btn__hint {
  font-size: calc(var(--sm) / 1.02);
  color: var(--ink-45);
  background: transparent;
}

.llm-toggle {
  display: flex;
  gap: calc(var(--sm) / 1.4);
}

.llm-toggle button {
  padding: calc(var(--sm) / 1.3) var(--md);
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: #fff;
  font-size: calc(var(--md) / 1.06);
  transition: all .25s ease;
}

.llm-toggle button.is-on {
  border-color: var(--c, var(--prompt-green));
  background: color-mix(in srgb, var(--c, var(--prompt-green)) 12%, #fff);
  color: var(--c, var(--prompt-green));
  font-weight: 700;
}

.llm-tabs {
  display: flex;
  gap: calc(var(--sm) / 1.4);
}

.llm-tabs button {
  flex: 1;
  padding: calc(var(--sm) / 1.1) var(--sm);
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #fff;
  font-size: var(--md);
  font-weight: 700;
  transition: all .25s ease;
}

.llm-tabs button.is-on {
  border-color: var(--c, var(--prompt-green));
  background: color-mix(in srgb, var(--c, var(--prompt-green)) 12%, #fff);
  color: var(--c, var(--prompt-green));
}

.llm-field {
  display: block;
  margin-bottom: calc(var(--sm) / 1.4);
  font-size: calc(var(--md) / 1.1);
  color: var(--ink-60);
}

.llm-input {
  width: 100%;
  padding: var(--sm) var(--md);
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: #fff;
  font-family: var(--font-mono);
  font-size: var(--md);
  color: var(--bg);
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.llm-input:focus {
  border-color: var(--prompt-green);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.14);
}

.llm-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 5px;
  background: rgba(14, 16, 22, 0.10);
  outline: none;
}

.llm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--prompt-green);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.18);
}

.llm-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: var(--prompt-green);
  cursor: pointer;
  box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.18);
}

.llm-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sm);
  margin-bottom: calc(var(--sm) / 1.2);
}

/* =========================
   Saída da geração
   ========================= */
.llm-output {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 88px;
  padding: var(--lg);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: rgba(14, 16, 22, 0.025);
  font-size: calc(var(--md) * 1.05);
  line-height: 1.7;
}

.llm-output__seed { color: var(--ink-45); background: transparent; }
.llm-output__new { color: var(--c-green); background: transparent; animation: llm-pop .35s both; }

/* fita de contexto */
.llm-ctx {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.llm-ctx span {
  padding: calc(var(--sm) / 2.4) calc(var(--sm) / 1.4);
  border: 1px solid var(--hair-soft);
  border-radius: 7px;
  background: rgba(14, 16, 22, 0.03);
  font-size: calc(var(--md) / 1.2);
  color: var(--ink-45);
  transition: all .3s ease;
}

.llm-ctx span.in-window {
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.08);
  color: var(--c-purple);
}

.llm-ctx span.is-dropping { opacity: .35; }

/* curva de erro do treino */
.llm-curve {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 118px;
}

.llm-curve__bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  background: rgba(14, 16, 22, 0.08);
  transition: height .35s ease, background .35s ease;
}

.llm-curve__bar.is-on { background: var(--c-blue); }
.llm-curve__bar.is-now { background: var(--c-pink); }

/* ciclo de treino */
.llm-cycle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(var(--sm) / 1.6);
}

.llm-cycle__item {
  width: 116px;
  padding: var(--sm) calc(var(--sm) / 1.2);
  border: 1px solid var(--c);
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 6%, #fff);
  text-align: center;
  animation: llm-pulse 2.4s ease-in-out infinite;
}

.llm-cycle__icon {
  display: flex;
  justify-content: center;
  margin-bottom: calc(var(--sm) / 2.4);
  font-size: 19px;
  color: var(--c);
  background: transparent;
}

.llm-cycle__icon svg { display: block; width: 19px; height: 19px; }

.llm-cycle__label {
  font-size: calc(var(--sm) / 1.02);
  font-weight: 700;
  line-height: 1.25;
}

.llm-cycle__sep {
  color: var(--c-pink);
  font-size: var(--md);
  background: transparent;
}

.llm-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--sm) / 1.3);
}

.llm-list li {
  display: flex;
  align-items: center;
  gap: calc(var(--sm) / 1.2);
  font-size: calc(var(--md) / 1.06);
  line-height: 1.45;
  color: var(--ink-60);
}

.llm-list li .ico {
  flex: 0 0 auto;
  display: flex;
  font-size: 16px;
  color: var(--c, var(--prompt-green));
  background: transparent;
}

.llm-list li .ico svg { display: block; width: 16px; height: 16px; }

/* recap: trilho vertical no mesmo espírito da timeline do currículo */
.llm-recap { display: flex; flex-direction: column; }

.llm-recap__row {
  display: flex;
  gap: var(--md);
  animation: llm-flow .45s both;
}

.llm-recap__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.llm-recap__n {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  font-size: calc(var(--md) / 1.1);
}

.llm-recap__line {
  width: 1px;
  flex: 1;
  min-height: 16px;
  background: var(--hair);
}

.llm-recap__body { padding-bottom: var(--md); }

.llm-recap__title {
  font-size: calc(var(--md) * 1.05);
  font-weight: 700;
  margin-bottom: 2px;
}

/* Turing */
.llm-turing {
  display: flex;
  gap: var(--lg);
  align-items: flex-start;
}

.llm-turing__badge {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 16px;
  background: rgba(124, 58, 237, 0.07);
  color: var(--c-purple);
  font-size: 28px;
}

.llm-turing__badge svg { display: block; width: 28px; height: 28px; }

.llm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--sm) / 1.6);
  margin-top: var(--sm);
}

.llm-tags span {
  padding: calc(var(--sm) / 2.4) calc(var(--sm) / 1.5);
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.08);
  color: var(--c-purple);
  font-size: calc(var(--sm) / 1.06);
}

/* =========================
   Rodapé de navegação
   ========================= */
.llm-foot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: var(--sm) var(--lg) var(--md);
  border-top: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 42%);
}

.llm-foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sm);
  max-width: 940px;
  margin: 0 auto;
}

.llm-dots {
  display: flex;
  gap: 6px;
}

.llm-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(14, 16, 22, 0.14);
  transition: background .2s ease, transform .2s ease;
}

.llm-dots button:hover { transform: scale(1.25); }
.llm-dots button.is-seen { background: rgba(14, 16, 22, 0.32); }
.llm-dots button.is-active { background: var(--prompt-green); transform: scale(1.3); }

/* =========================
   Animações
   ========================= */
@keyframes llm-fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes llm-pop { 0% { opacity: 0; transform: scale(.7); } 60% { transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@keyframes llm-flow { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes llm-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes llm-twinkle { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes llm-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.llm-step.is-entering > * { animation: llm-fade-up .45s both; }

@media (prefers-reduced-motion: reduce) {
  .llm-step.is-entering > *,
  .llm-pipeline__step,
  .llm-token-group,
  .llm-scatter__pt,
  .llm-recap__row,
  .llm-cycle__item,
  .llm-cells--weights .llm-cell--w,
  .llm-output__new,
  .llm-caret {
    animation: none;
  }
}

/* =========================
   Responsivo
   ========================= */
@media (max-width: 1040px) {
  .llm-aside { flex-basis: 232px; width: 232px; }
}

@media (max-width: 900px) {
  .llm-shell { flex-direction: column; }

  .llm-aside {
    position: sticky;
    top: 0;
    z-index: 10;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    gap: var(--sm);
    padding: var(--sm) var(--md);
    border-right: 0;
    border-bottom: 1px solid var(--hair);
    background: #fff;
  }

  .llm-brand__sub,
  .llm-aside__foot { display: none; }

  .llm-nav {
    flex-direction: row;
    gap: calc(var(--sm) / 1.4);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .llm-nav::-webkit-scrollbar { display: none; }

  .llm-nav__item {
    flex: 0 0 auto;
    border: 1px solid var(--hair);
    border-radius: 999px;
  }

  .llm-nav__item:hover { transform: none; }

  .llm-stage { padding: var(--md); }

  .llm-grid--2,
  .llm-grid--3,
  .llm-grid--4 { grid-template-columns: 1fr 1fr; }

  .llm-turing { flex-direction: column; }
}

@media (max-width: 640px) {
  .llm-grid--2,
  .llm-grid--3,
  .llm-grid--4 { grid-template-columns: 1fr; }

  .llm-nav__label { display: none; }

  .llm-nav__item { padding: calc(var(--sm) / 1.6); }

  .llm-bar__label { width: 76px; font-size: calc(var(--md) / 1.2); }

  .llm-cells--weights { grid-template-columns: repeat(16, minmax(0, 18px)); }

  .llm-embed { flex: 1 1 40%; }

  .llm-foot__inner .llm-dots { display: none; }

  .llm-formula { font-size: calc(var(--md) / 1.02); }
}
