/* =====================================================================
   Tema Recreio (docs/design/TEMA-PARA-IA.md). Este arquivo tem 2 partes:
   1) ordem das camadas e Bootstrap dentro da camada "bootstrap";
   2) tokens, base, components, screens e motion do Recreio.
   Por que camadas: CSS sem camada vence qualquer regra em @layer; por isso
   o Bootstrap entra por @import ... layer(bootstrap) (o <link> saiu dos
   layouts) e fica abaixo de tokens/base. O tema antigo (camada "legado") foi
   removido na Issue #195.
   ===================================================================== */
@layer bootstrap;
@layer tokens, base, components, screens, motion;
@import url("../lib/bootstrap/bootstrap.min.css") layer(bootstrap);

/* Fontes do Recreio (autohospedadas; origem e licença em /fonts/LICENSE.md). */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 500 900; font-display: swap; src: url("../fonts/nunito-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700 800; font-display: swap; src: url("../fonts/baloo-2-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---- Recreio: tokens e base (de recreio.css e telas.css) ---- */
@layer tokens {
  :root {
    color-scheme: light;
    /* marca */
    --fundhas-blue: oklch(0.44 0.13 250);   /* #005497 */
    --fundhas-yellow: oklch(0.87 0.175 90); /* #FFCD06 */

    /* palco */
    --stage: oklch(1 0 0);
    --canvas: oklch(0.985 0.004 240);
    --sky: oklch(0.955 0.035 232);          /* céu claro do ícone do jogo */
    --sky-deep: oklch(0.8 0.115 232);
    --sunny: oklch(0.97 0.06 92);
    --hill: oklch(0.9 0.09 145);
    --rule: oklch(0.92 0.012 245);          /* réguas de 2px */
    --rule-strong: oklch(0.86 0.016 245);
    --control: oklch(0.62 0.02 250);

    /* texto */
    --ink: oklch(0.29 0.045 255);
    --ink-2: oklch(0.5 0.025 255);
    --ink-3: oklch(0.54 0.02 255);

    /* ação: azul FUNDHAS com lábio */
    --action: var(--fundhas-blue);
    --action-lip: oklch(0.34 0.11 252);
    --action-hover: oklch(0.48 0.135 250);
    --on-action: oklch(1 0 0);
    --select-bg: oklch(0.95 0.04 235);
    --select-line: oklch(0.72 0.12 240);
    --select-ink: oklch(0.4 0.13 250);
    --star: var(--fundhas-yellow);
    --focus: oklch(0.55 0.16 250);

    /* estados */
    --ok: oklch(0.52 0.15 145);   --ok-bg: oklch(0.95 0.06 145);  --ok-ink: oklch(0.4 0.11 145);
    --bad: oklch(0.6 0.2 25);    --bad-bg: oklch(0.955 0.035 25); --bad-ink: oklch(0.45 0.16 25);
    --warn-bg: oklch(0.96 0.07 90); --warn-ink: oklch(0.45 0.1 70);
    --neutral-bg: oklch(0.95 0.01 250); --neutral-ink: oklch(0.42 0.03 255);

    /* tipos de quiz = personagens */
    --q-amb: oklch(0.62 0.16 145);  --q-amb-bg: oklch(0.955 0.05 145); --q-amb-ink: oklch(0.4 0.11 145);  /* Flora */
    --q-con: oklch(0.6 0.14 240);   --q-con-bg: oklch(0.95 0.04 240);  --q-con-ink: oklch(0.4 0.12 250);  /* Byte */
    --q-cul: oklch(0.58 0.17 310);  --q-cul-bg: oklch(0.955 0.04 310); --q-cul-ink: oklch(0.42 0.15 310); /* Luna */
    --q-esp: oklch(0.7 0.17 50);    --q-esp-bg: oklch(0.96 0.05 60);   --q-esp-ink: oklch(0.47 0.13 45);  /* Max */
    --q-div: oklch(0.65 0.11 190);  --q-div-bg: oklch(0.955 0.04 190); --q-div-ink: oklch(0.42 0.08 195); /* Lia */

    /* cores dos ladrilhos do menu (leque da FUNDHAS + jogo) */
    --tile-1: oklch(0.6 0.15 245); --tile-2: oklch(0.65 0.17 145); --tile-3: oklch(0.72 0.17 55);
    --tile-4: oklch(0.56 0.17 310); --tile-5: oklch(0.6 0.15 65); --tile-6: oklch(0.65 0.11 195);
    --tile-7: oklch(0.47 0.15 355); --tile-8: oklch(0.55 0.04 255); --tile-9: oklch(0.52 0.15 280);

    /* fonte */
    --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Baloo 2", "Nunito", system-ui, sans-serif;
    --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .9375rem; --fs-lg: 1.0625rem; --fs-xl: 1.375rem;
    --fs-title: clamp(1.75rem, 1.3rem + 1.3vw, 2.375rem);
    --fs-hero: clamp(2.6rem, 1.8rem + 3vw, 4.25rem);

    /* espaço, forma */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
    --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
    --h-control-sm: 36px; --h-control: 40px; --h-control-lg: 48px; --lip: 3px;
    --rail-width: 244px;

    --shadow-float: 0 2px 0 var(--rule), 0 16px 40px oklch(0.29 0.045 255 / .1);
    --ease: cubic-bezier(.2,.8,.2,1); --ease-out: cubic-bezier(.19,1,.22,1); --ease-pop: cubic-bezier(.34,1.56,.64,1);
    --dur-fast: 100ms; --dur: 160ms; --dur-slow: 320ms; --dur-enter: 640ms; --stagger: 55ms;
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --stage: oklch(0.215 0.045 270);
    --canvas: oklch(0.18 0.045 272);
    --sky: oklch(0.27 0.07 268);
    --sky-deep: oklch(0.45 0.12 262);
    --sunny: oklch(0.3 0.05 90);
    --hill: oklch(0.32 0.07 160);
    --rule: oklch(0.3 0.045 270);
    --rule-strong: oklch(0.38 0.05 270);
    --control: oklch(0.55 0.04 265);
    --ink: oklch(0.96 0.01 260);
    --ink-2: oklch(0.78 0.03 260);
    --ink-3: oklch(0.66 0.03 260);
    --action: oklch(0.87 0.165 90);
    --action-lip: oklch(0.68 0.14 75);
    --action-hover: oklch(0.91 0.16 92);
    --on-action: oklch(0.24 0.06 270);
    --select-bg: oklch(0.3 0.07 262);
    --select-line: oklch(0.55 0.13 255);
    --select-ink: oklch(0.9 0.05 245);
    --focus: oklch(0.87 0.165 90);
    --ok-bg: oklch(0.32 0.07 145); --ok-ink: oklch(0.88 0.11 145);
    --bad-bg: oklch(0.32 0.08 25);  --bad-ink: oklch(0.88 0.08 25);
    --warn-bg: oklch(0.33 0.06 85); --warn-ink: oklch(0.9 0.1 85);
    --neutral-bg: oklch(0.3 0.04 268); --neutral-ink: oklch(0.88 0.02 260);
    --q-amb: oklch(0.74 0.15 145); --q-amb-bg: oklch(0.3 0.06 150); --q-amb-ink: oklch(0.9 0.09 145);
    --q-con: oklch(0.74 0.12 240); --q-con-bg: oklch(0.3 0.06 245); --q-con-ink: oklch(0.9 0.06 240);
    --q-cul: oklch(0.74 0.13 310); --q-cul-bg: oklch(0.31 0.07 310); --q-cul-ink: oklch(0.9 0.06 310);
    --q-esp: oklch(0.79 0.14 55);  --q-esp-bg: oklch(0.32 0.06 50);  --q-esp-ink: oklch(0.91 0.07 60);
    --q-div: oklch(0.76 0.1 190);  --q-div-bg: oklch(0.3 0.05 195);  --q-div-ink: oklch(0.9 0.06 190);
    --shadow-float: 0 2px 0 var(--rule), 0 20px 48px oklch(0 0 0 / .45);
  }
  @media (prefers-reduced-motion: reduce) { :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; --dur-enter: 0ms; --stagger: 0ms; } }
}

@layer base {
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; font: 500 var(--fs-md)/1.5 var(--font); color: var(--ink); background: var(--canvas); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
  ::selection { background: var(--star); color: oklch(0.25 0.05 255); }
  a { color: inherit; }
  :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
  h1, h2, h3, p { margin: 0; }
  h1, h2 { text-wrap: balance; }
  h1 { font-family: var(--font-display); font-size: var(--fs-title); font-weight: 800; line-height: 1.05; letter-spacing: -0.01em; }
  h2 { font-size: var(--fs-lg); font-weight: 800; letter-spacing: -0.005em; }
  p { text-wrap: pretty; }
  img { display: block; max-width: 100%; height: auto; }
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  [hidden] { display: none !important; }
}

@layer base {
  .only-dark { display: none !important; }
  :root[data-theme="dark"] .only-dark { display: block !important; }
  :root[data-theme="dark"] .only-light { display: none !important; }
}

@layer tokens {
  :root {
    --data: oklch(0.55 0.15 250);
    --data-ref: oklch(0.64 0.02 255);
    --data-wash: oklch(from var(--data) l c h / .12);
    --grid: var(--rule);
  }
  :root[data-theme="dark"] {
    --data: oklch(0.78 0.11 240);
    --data-ref: oklch(0.6 0.03 265);
    --data-wash: oklch(from var(--data) l c h / .14);
  }
}

@layer tokens {
  :root { --ai: oklch(0.55 0.17 295); --ai-bg: oklch(0.955 0.04 295); --ai-ink: oklch(0.42 0.16 295); }
  :root[data-theme="dark"] { --ai: oklch(0.75 0.13 295); --ai-bg: oklch(0.31 0.07 295); --ai-ink: oklch(0.9 0.07 295); }
}

/* ---- Recreio: components (recreio.css 130-194 e telas.css 13-75, sem os componentes de IA) ---- */
@layer components {
  /* botão = tecla de brinquedo: face + lábio inferior */
  .btn { --face: var(--stage); --lip-c: var(--rule-strong); --txt: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    height: var(--h-control); padding: 0 var(--sp-5) var(--lip); border-radius: var(--r-md);
    font: 800 var(--fs-md)/1 var(--font); color: var(--txt); text-decoration: none; white-space: nowrap; cursor: pointer;
    background: var(--face); border: 2px solid var(--lip-c); border-bottom-width: calc(2px + var(--lip));
    transition: transform var(--dur-fast) var(--ease), filter var(--dur) var(--ease), background var(--dur); }
  .btn:hover { filter: brightness(1.04); }
  .btn:active { transform: translateY(var(--lip)); border-bottom-width: 2px; margin-bottom: var(--lip); }
  .btn-primary { --face: var(--action); --lip-c: var(--action-lip); --txt: var(--on-action); border-color: var(--action-lip); border-top-color: var(--action); border-left-color: var(--action); border-right-color: var(--action); }
  .btn-primary:hover { --face: var(--action-hover); }
  .btn-lg { height: var(--h-control-lg); padding-inline: var(--sp-6); font-size: var(--fs-lg); }
  .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

  /* chip de filtro (faixa etária) */
  .chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .chip { height: var(--h-control); display: inline-flex; align-items: center; padding: 0 14px; border-radius: var(--r-md); border: 2px solid var(--rule); background: var(--stage); color: var(--ink-2); font-weight: 800; text-decoration: none; transition: border-color var(--dur), background var(--dur), color var(--dur); }
  .chip:hover { border-color: var(--rule-strong); color: var(--ink); }
  .chip[aria-current="true"] { background: var(--select-bg); border-color: var(--select-line); color: var(--select-ink); }

  .select { font: 700 var(--fs-md) var(--font); color: var(--ink); height: var(--h-control); padding: 0 34px 0 12px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--stage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237b8494' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; cursor: pointer; }
  .select:hover { border-color: var(--rule-strong); }
  /* estados de todos os campos: foco, hover, desabilitado, placeholder */
  .select { transition: border-color var(--dur), box-shadow var(--dur); }
  .select:focus-visible { border-color: var(--select-line); box-shadow: 0 0 0 4px var(--select-bg); }
  .select option { background: var(--stage); color: var(--ink); }
  .input:hover:not(:focus):not([aria-invalid="true"]):not(:disabled) { border-color: oklch(from var(--rule-strong) calc(l - .1) c h); }
  .input::placeholder { color: var(--ink-3); opacity: 1; font-weight: 600; }
  .input:disabled, .select:disabled { background: var(--canvas); color: var(--ink-3); border-style: dashed; cursor: not-allowed; }
  .input[readonly] { background: var(--canvas); }
  input[type="radio"], input[type="checkbox"] { accent-color: var(--action); }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .input { font: 600 var(--fs-md) var(--font); color: var(--ink); width: 100%; height: var(--h-control-lg); padding: 0 14px; border: 2px solid var(--rule-strong); border-radius: var(--r-md); background: var(--stage); transition: border-color var(--dur), box-shadow var(--dur); }
  .input:focus { border-color: var(--select-line); box-shadow: 0 0 0 4px var(--select-bg); }
  /* erro (recreio.css 301-302): depois de :focus para a borda --bad vencer no campo focado */
  .input[aria-invalid="true"] { border-color: var(--bad); }
  .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--bad-bg); }
  .field { display: grid; align-content: start; gap: 6px; }
  .field label { font-weight: 800; }
  .field small { color: var(--ink-3); font-weight: 600; }

  /* superfície */
  .panel { background: var(--stage); border: 2px solid var(--rule); border-radius: var(--r-lg); box-shadow: 0 2px 0 var(--rule), 0 12px 32px oklch(0.29 0.045 255 / .05); }
  .panel-pad { padding: var(--sp-6); }
  .panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
  .panel-head p { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 700; }

  /* selos */
  .tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 800; white-space: nowrap; }
  .tag-ok { background: var(--ok-bg); color: var(--ok-ink); }
  .tag-bad { background: var(--bad-bg); color: var(--bad-ink); }
  .tag-warn { background: var(--warn-bg); color: var(--warn-ink); }
  .tag-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
  .tag-type { background: var(--qb); color: var(--qi); }
  .tag-type img { width: 20px; height: 20px; border-radius: 6px; margin-left: -6px; object-fit: cover; object-position: top; background: oklch(1 0 0 / .6); }

  .phone { --q: var(--action); --qb: var(--select-bg); --qi: var(--select-ink); }
  .amb { --q: var(--q-amb); --qb: var(--q-amb-bg); --qi: var(--q-amb-ink); }
  .con { --q: var(--q-con); --qb: var(--q-con-bg); --qi: var(--q-con-ink); }
  .cul { --q: var(--q-cul); --qb: var(--q-cul-bg); --qi: var(--q-cul-ink); }
  .esp { --q: var(--q-esp); --qb: var(--q-esp-bg); --qi: var(--q-esp-ink); }
  .div { --q: var(--q-div); --qb: var(--q-div-bg); --qi: var(--q-div-ink); }

  /* estrela (destaque, vem do logo do jogo) */
  .star { width: 1em; height: 1em; color: var(--star); flex: none; filter: drop-shadow(0 1px 0 oklch(0.6 0.12 75)); }

  /* barra */
  .meter { height: 12px; border-radius: var(--r-pill); background: oklch(from var(--q, var(--action)) l c h / .18); overflow: hidden; }
  .meter-inline { display: inline-block; width: 120px; vertical-align: middle; }
  .meter > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--q, var(--action)); box-shadow: inset 0 -3px 0 oklch(0 0 0 / .12); }

  .page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--sp-4); }
  .page-head .sub { color: var(--ink-2); font-weight: 600; margin-top: 6px; max-width: 62ch; }
  .page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--sp-2); font-weight: 800; font-size: var(--fs-sm); color: var(--select-ink); text-decoration: none; }
  .back:hover { text-decoration: underline; text-underline-offset: 3px; }
  .btn-sm { height: var(--h-control-sm); padding-inline: 12px; font-size: var(--fs-sm); }
  .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .btn svg.fill { fill: currentColor; stroke: none; }

  /* tabela */
  /* sombras de rolagem: aparecem só no lado em que ainda há tabela escondida (a 375 px as colunas de ação ficam fora da tela) */
  .table-wrap { position: relative; overflow-x: auto;
    background: linear-gradient(to right, var(--stage) 30%, transparent) left / 28px 100% no-repeat local,
      linear-gradient(to left, var(--stage) 30%, transparent) right / 28px 100% no-repeat local,
      linear-gradient(to right, oklch(from var(--ink) l c h / .16), transparent) left / var(--sp-3) 100% no-repeat scroll,
      linear-gradient(to left, oklch(from var(--ink) l c h / .16), transparent) right / var(--sp-3) 100% no-repeat scroll; }
  /* O Bootstrap pinta as células com --bs-table-*; o tema fixa os valores nos tokens (vale nos dois temas). */
  .table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: var(--rule); --bs-table-hover-bg: var(--canvas); --bs-table-striped-bg: transparent; width: 100%; border-collapse: separate; border-spacing: 0; }
  .table thead th { background: none; border-bottom: 0; text-align: left; padding: 0 12px 10px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
  .table td, .table tbody th { padding: 12px; border-top: 2px solid var(--rule); border-bottom: 0; font-weight: 600; vertical-align: middle; text-align: left; }
  .table tbody th { font-weight: 800; }
  .table tbody tr { transition: background var(--dur); }
  .table tbody tr:hover { background: var(--canvas); }
  .table .num { text-align: right; }
  .table .actions { text-align: right; white-space: nowrap; }
  .table small { display: block; color: var(--ink-3); font-weight: 700; font-size: var(--fs-xs); }
  .table .clip { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table a.name { font-weight: 800; color: var(--ink); text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
  .table a.name:hover { color: var(--select-ink); }
  .link-btn { font: 800 var(--fs-sm) var(--font); color: var(--select-ink); background: none; border: 0; padding: 6px 8px; border-radius: var(--r-sm); text-decoration: none; cursor: pointer; }
  .link-btn:hover { background: var(--select-bg); }
  .row-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--sp-2); }
  .pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3); padding-top: var(--sp-4); color: var(--ink-2); font-weight: 700; font-size: var(--fs-sm); }
  .pager nav { display: flex; gap: var(--sp-2); }

  /* formulário */
  .form { display: grid; gap: var(--sp-5); }
  .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
  .form-grid .full { grid-column: 1 / -1; }
  .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding-top: var(--sp-2); }
  .form .form-actions .btn, .maker-bar .btn, .bare-card .btn { height: var(--h-control-lg); }
  .field .req { color: var(--ink-3); font-weight: 700; }
  .select-lg { width: 100%; height: var(--h-control-lg); background-position: right 14px center; }
  .textarea { height: auto; min-height: 112px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
  .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; }
  .field .check { font-weight: 700; } /* checkbox com <small> de ajuda: mantém o peso de .check, não o 800 de .field label */
  .check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--action); }
  .count-hint { justify-self: end; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; }

  /* alternativas da questão */
  .alts { display: grid; gap: var(--sp-3); border: 0; padding: 0; margin: 0; min-width: 0; }
  /* O reboot do Bootstrap (que fica) dá à legend fonte grande, float e width 100%; só as três legends do painel precisam do reset. */
  :is(.alts legend, .field-legend, legend.step-h) { font-size: inherit; line-height: inherit; float: none; width: auto; }
  .alts legend, .field-legend { font-weight: 800; margin-bottom: var(--sp-2); padding: 0; }
  .alt { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: 8px 8px 8px 10px; border: 2px solid var(--rule); border-radius: var(--r-md); transition: border-color var(--dur), background var(--dur); }
  .alt:has(input[type="radio"]:checked) { border-color: oklch(from var(--ok) l c h / .6); background: var(--ok-bg); }
  .alt .key { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--neutral-bg); color: var(--neutral-ink); font-weight: 900; }
  .alt:has(input[type="radio"]:checked) .key { background: var(--ok); color: oklch(1 0 0); }
  .alt .input { height: var(--h-control); }
  .alt .correct { display: flex; align-items: center; gap: 6px; min-height: var(--h-control); padding: 0 10px; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 800; cursor: pointer; white-space: nowrap; }
  .alt .correct input { width: 18px; height: 18px; accent-color: var(--ok); }

  /* avisos */
  .note { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); align-items: start; padding: 12px 14px; border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }
  .note.info { background: var(--select-bg); color: var(--select-ink); }
  .note.ok { background: var(--ok-bg); color: var(--ok-ink); }
  .note svg { width: 18px; height: 18px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .tag-draft { background: var(--warn-bg); color: var(--warn-ink); }

  /* IA (ADR-0004; #286 e #294): o lilás --ai só aparece em elemento de IA. Valores de telas.css 19-20, 71-74, 90-109, 163-168 e 390-393 */
  .btn-ai { --face: var(--ai); --lip-c: oklch(from var(--ai) calc(l - .14) c h); --txt: oklch(1 0 0); border-color: var(--lip-c); border-top-color: var(--ai); border-left-color: var(--ai); border-right-color: var(--ai); }
  :root[data-theme="dark"] .btn-ai { --txt: oklch(0.2 0.05 295); }
  .btn-quiet-bad { --txt: var(--bad-ink); }
  .note.ai { background: var(--ai-bg); color: var(--ai-ink); }
  .note.ai svg { fill: currentColor; stroke: none; }
  .tag-ai { background: var(--ai-bg); color: var(--ai-ink); }
  .tag-ai svg { width: 12px; height: 12px; fill: currentColor; }
  .ai-panel { border-radius: var(--r-lg); padding: var(--sp-6); background: linear-gradient(135deg in oklch, var(--ai-bg), var(--stage) 70%); border: 2px solid oklch(from var(--ai) l c h / .3); display: grid; gap: var(--sp-4); }
  .ai-panel h2 { display: flex; align-items: center; gap: var(--sp-2); }
  .ai-panel h2 svg { width: 20px; height: 20px; color: var(--ai); fill: currentColor; }
  .ai-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); counter-reset: s; }
  .ai-steps li { counter-increment: s; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); background: var(--stage); border: 2px solid var(--rule); font-size: var(--fs-sm); font-weight: 800; color: var(--ink-2); }
  .ai-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ai); color: var(--stage); font-size: var(--fs-xs); }
  .ai-steps li[aria-current] { border-color: var(--ai); color: var(--ai-ink); }
  .review { display: grid; gap: var(--sp-4); }
  .rcard { border: 2px solid var(--rule); border-radius: var(--r-lg); background: var(--stage); padding: var(--sp-5); display: grid; gap: var(--sp-3); min-width: 0; }
  .rcard:hover { border-color: oklch(from var(--ai) l c h / .45); }
  .rcard.done { background: var(--canvas); }
  .rcard-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
  .rcard-q { font-size: var(--fs-lg); font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
  .rcard ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .rcard ol li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--r-md); background: var(--canvas); font-weight: 700; overflow-wrap: anywhere; }
  .rcard.done ol li { background: var(--stage); }
  .rcard ol li b { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--neutral-bg); font-size: var(--fs-xs); flex: none; }
  .rcard ol li.right { background: var(--ok-bg); color: var(--ok-ink); }
  .rcard ol li.right b { background: var(--ok); color: oklch(1 0 0); }
  .rcard .why { color: var(--ink-2); font-weight: 600; overflow-wrap: anywhere; }
  .rcard-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 2px solid var(--rule); }
  .rcard-actions .btn { height: var(--h-control-sm); padding-inline: 14px; }
  .ai-flag { justify-self: start; }
  .cell-tags { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
  .ai-help { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: 10px 10px 10px 14px; border-radius: var(--r-md); background: var(--ai-bg); color: var(--ai-ink); font-weight: 700; font-size: var(--fs-sm); }
  .ai-help > svg { width: 18px; height: 18px; fill: currentColor; }
  .ai-help .btn { height: var(--h-control-sm); padding-inline: 14px; font-size: var(--fs-sm); }
  .ai-help .btn[aria-busy="true"] { pointer-events: none; opacity: .75; }
  .ai-help small { display: block; font-weight: 600; }
  .ai-result { display: grid; gap: var(--sp-2); justify-items: start; }
  .ai-result:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--r-md); }
  .ai-result .note { justify-self: stretch; }
  .ai-result .note .btn { margin-top: var(--sp-2); }
  @media (max-width: 767.98px) {
    .ai-panel { padding: var(--sp-4); }
    .rcard ol { grid-template-columns: 1fr; }
    .ai-help { grid-template-columns: auto minmax(0, 1fr); }
    .ai-help .btn { grid-column: 1 / -1; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .ai-filled { animation: ai-fill 1300ms var(--ease-out); }
    @keyframes ai-fill { from { border-color: var(--ai); background: var(--ai-bg); box-shadow: 0 0 0 6px oklch(from var(--ai) l c h / .3); } }
    .ai-result[tabindex] { animation: rise 420ms var(--ease-out) both; }
  }
}

/* ---- CASCA do tema Recreio (Issue #140) ----
   Menu lateral, bloco do usuário, gaveta e topo. Valores de recreio.css 198-222,
   371-413 (só a casca) e 417-421, sem mudança; o que é adaptação está marcado. */
@layer screens {
  /* casca */
  .shell { display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); min-height: 100dvh; }
  .rail { position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-6); padding: var(--sp-6) var(--sp-4) var(--sp-4); background: var(--stage); border-right: 2px solid var(--rule); }
  .rail-logo img { width: 156px; margin: 0 auto 0 6px; }
  .nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  .nav a { display: flex; align-items: center; gap: var(--sp-3); height: 46px; padding: 0 10px; border-radius: var(--r-md); border: 2px solid transparent; color: var(--ink-2); font-weight: 800; text-decoration: none; transition: background var(--dur), border-color var(--dur), color var(--dur); }
  .nav a:hover { background: oklch(from var(--select-bg) l c h / .55); color: var(--ink); }
  .nav a[aria-current="page"] { background: var(--select-bg); border-color: var(--select-line); color: var(--select-ink); }
  .tile { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--t); color: oklch(1 0 0); box-shadow: inset 0 -3px 0 oklch(0 0 0 / .16); flex: none; }
  .nav-sep { height: 2px; background: var(--rule); margin: 6px 8px; border-radius: 2px; }
  .me { margin-top: auto; display: grid; grid-template-columns: 40px 1fr auto; gap: 0 10px; align-items: center; padding: 10px; border: 2px solid var(--rule); border-radius: var(--r-md); }
  .me img { width: 40px; height: 40px; border-radius: 12px; background: var(--sunny); object-fit: cover; object-position: top; grid-row: span 2; }
  .me b { font-weight: 800; font-size: var(--fs-sm); line-height: 1.2; }
  .me small { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; line-height: 1.3; }
  .me small span { display: block; }
  .me > b, .me > small { min-width: 0; }
  .me form { grid-row: 1 / span 2; grid-column: 3; }
  .me button { font: 800 var(--fs-xs) var(--font); color: var(--ink-2); background: none; border: 0; padding: 6px; border-radius: var(--r-sm); cursor: pointer; }
  .me button:hover { color: var(--bad-ink); background: var(--bad-bg); }
  .org { display: flex; align-items: center; justify-content: center; padding-top: var(--sp-2); }
  .org img { width: 112px; }
  .topbar { display: none; }
  .rail-close { display: none; }
  .main { min-width: 0; grid-template-columns: minmax(0, 1fr); padding: var(--sp-6) clamp(16px, 3vw, 40px) var(--sp-12); display: grid; gap: var(--sp-6); align-content: start; }
  .nav-label { padding: 14px 12px 4px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .02em; }
  .nav .tile svg, .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .me .av { width: 40px; height: 40px; border-radius: 12px; grid-row: span 2; display: grid; place-items: center; background: var(--sunny); color: oklch(0.42 0.1 70); font-weight: 900; font-size: var(--fs-sm); }
  :root[data-theme="dark"] .me .av { color: var(--warn-ink); }
  /* ADAPTAÇÃO (casca real): botão do menu com outro nome para o módulo de gaveta do painel.js
     (que espera .menu-btn + .scrim) não agir sobre o offcanvas do Bootstrap. */
  .menu-toggle { width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--stage); color: var(--ink); cursor: pointer; }
  .menu-toggle:hover, .tema-btn:hover { background: oklch(from var(--select-bg) l c h / .55); }
  .rail { color: var(--ink); }
  .rail nav { display: grid; gap: 4px; }
  .rail-foot { margin-top: auto; display: grid; gap: var(--sp-3); }
  .tema-btn { display: flex; align-items: center; gap: var(--sp-3); height: 40px; padding: 0 12px; border: 2px solid var(--rule); border-radius: var(--r-md); background: none; color: var(--ink-2); font: 800 var(--fs-sm) var(--font); cursor: pointer; }
  .tema-btn[aria-pressed="true"] { background: var(--select-bg); border-color: var(--select-line); color: var(--select-ink); }
  @media (scripting: none) { .tema-btn { display: none; } }
  .main > .page-title { margin-bottom: 0; }
  /* a preview põe o subtítulo a 6px do título; o layout renderiza os dois como irmãos do grid de .main.
     Depende de ".main { gap: var(--sp-6) }" (acima): se esse gap mudar, mude este valor junto. */
  .main > .page-title:has(+ .page-head) { margin-bottom: calc(-1 * var(--sp-6)); }
  .skip-link { position: absolute; z-index: 2000; left: var(--sp-2); top: -64px; padding: 10px 16px; border-radius: var(--r-md); background: var(--ink); color: var(--stage); font-weight: 800; text-decoration: none; }
  .skip-link:focus { top: var(--sp-2); }
  .offcanvas-backdrop { --bs-backdrop-bg: oklch(0.2 0.04 260); --bs-backdrop-opacity: .4; }

  /* responsivo */
  @media (max-width: 767.98px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .topbar { display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 0 var(--sp-4); background: var(--stage); border-bottom: 2px solid var(--rule); position: sticky; top: 0; z-index: 10; }
    .topbar img { width: 120px; }
    .rail-logo { padding-right: 52px; }
    .rail-close { display: grid; place-items: center; position: absolute; top: 16px; right: 12px; width: 40px; height: 40px; border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--stage); color: var(--ink); cursor: pointer; }
    /* gaveta: Recreio sobre o offcanvas do Bootstrap (classes .show/.showing/.hiding) em vez de .menu-open/.scrim */
    .rail { display: flex; position: fixed; z-index: var(--bs-offcanvas-zindex, 1045); inset: 0 auto 0 0; width: min(300px, 86vw); translate: -105% 0; transform: none; visibility: hidden; transition: translate var(--dur-slow) var(--ease-out), visibility 0s linear var(--dur-slow); box-shadow: var(--shadow-float); }
    .rail.show, .rail.showing, .rail.hiding { visibility: visible; }
    .rail.show:not(.hiding), .rail.showing { translate: 0; transition: translate var(--dur-slow) var(--ease-out); }
  }
}

@media (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }

@layer motion {
  /* elementos que persistem entre páginas morfam em vez de piscar */
  .rail { view-transition-name: rail; }
  .rail-logo img { view-transition-name: logo-jogo; }
  @media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
  ::view-transition-group(*) { animation-duration: 520ms; animation-timing-function: var(--ease-out); }
  /* o destaque do menu desliza para o item novo; o conteúdo troca suave */
  .nav a[aria-current] { view-transition-name: nav-ativo; }
  .main { view-transition-name: conteudo; }
  ::view-transition-group(nav-ativo) { animation-duration: 440ms; }
  ::view-transition-old(conteudo) { animation: 160ms ease-out both vt-out; }
  ::view-transition-new(conteudo) { animation: 340ms var(--ease-out) both vt-in; }
  ::view-transition-old(root) { animation: 180ms ease-out both vt-out; }
  ::view-transition-new(root) { animation: 360ms var(--ease-out) both vt-in; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; translate: 0 8px; } }
  /* troca de tema: revelação circular feita no JS */
  html.vt-theme * { view-transition-name: none !important; }
  html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  @media (prefers-reduced-motion: no-preference) {
    .main > * { animation: rise var(--dur-enter) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }
    .main > :nth-child(2) { --i: 2; } .main > :nth-child(3) { --i: 4; } .main > :nth-child(4) { --i: 9; } .main > :nth-child(5) { --i: 11; } .main > :nth-child(6) { --i: 12; } .main > :nth-child(7) { --i: 13; }
    @keyframes rise { from { opacity: 0; translate: 0 14px; } }
    .js .main > .reveal { animation: none; transition: opacity 700ms var(--ease-out), translate 800ms var(--ease-out); }
    .js .main > .reveal:not(.vis) { opacity: 0; translate: 0 24px; }
    .nav a .tile { transition: transform 220ms var(--ease-pop); }
    .nav a:hover .tile { transform: rotate(-8deg) scale(1.08); }
  }
}

/* ---- TELAS INTERNAS E DE CONTA do tema Recreio (Issue #144) ----
   Valores copiados da preview sem mudança. recreio.css: 298-303, 309-363, 364-369, 373, 387-392;
   telas.css: 79-87, 128-137, 139-160, 170-195, 235-240, 314-326, 328-336 e responsivo/movimento filtrados.
   Fora (outras Issues): IA, Curiosidades, perguntas do evento, mapa da rede, Painel. */
@layer screens {
  /* telas: pilha, filtros, duas colunas */
  .stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-content: start; min-width: 0; }
  .tela { min-width: 0; }
  .split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: var(--sp-6); align-items: start; }
  .filters-bar { display: flex; flex-wrap: wrap; align-items: end; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-lg); background: var(--stage); border: 2px solid var(--rule); }
  .filters-bar .field { gap: 4px; }
  .filters-bar .field label { font-size: var(--fs-xs); color: var(--ink-3); }
  .filters-bar .select { min-width: 150px; }
  .filters-bar .btn { height: var(--h-control); }
  .filters-bar .link { font-weight: 800; font-size: var(--fs-sm); color: var(--select-ink); align-self: center; }
  /* avisos e erro de campo */
  .alert { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3); align-items: start; padding: 14px; border-radius: var(--r-md); background: var(--bad-bg); color: var(--bad-ink); border: 2px solid oklch(from var(--bad) l c h / .35); font-weight: 700; width: 100%; }
  .alert ul { margin: 0; padding-left: var(--sp-5); }
  .alert-title { margin-bottom: var(--sp-1); }
  .alert svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }
  .alert:focus { outline: none; box-shadow: 0 0 0 4px var(--bad-bg); }
  :is(.input, .select)[aria-invalid="true"] { border-color: var(--bad); }
  :is(.input, .select)[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 4px var(--bad-bg); }
  .field-error { color: var(--bad-ink); font-weight: 700; font-size: var(--fs-sm); }
  /* caixa de saída de desenvolvimento (#281): um painel por e-mail, corpo em texto e em HTML */
  .outbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .outbox .panel-head { margin-bottom: 0; overflow-wrap: anywhere; }
  .outbox-text { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--canvas); color: var(--ink); font: 600 var(--fs-sm)/1.5 var(--font); white-space: pre-wrap; overflow-wrap: anywhere; }
  /* e-mail é desenhado para fundo claro: o quadro fica claro nos dois temas (cor de sistema, não valor solto) */
  .outbox-frame { display: block; width: 100%; height: 420px; border: 2px solid var(--rule); border-radius: var(--r-md); color-scheme: light; background: Canvas; resize: vertical; }
  /* entrar */
  .auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(460px, 1fr); background: var(--canvas); }
  /* lado da marca: azul FUNDHAS sólido, sem cenário */
  .auth-scene { position: relative; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; gap: var(--sp-8); padding: var(--sp-10) clamp(32px, 5vw, 72px) var(--sp-8); color: oklch(0.97 0.01 250); isolation: isolate; container-type: inline-size;
    background: radial-gradient(110% 70% at 0% 0%, oklch(0.5 0.13 248), transparent 62%), linear-gradient(160deg in oklch, oklch(0.43 0.13 250), oklch(0.29 0.1 258)); }
  :root[data-theme="dark"] .auth-scene { background: radial-gradient(110% 70% at 0% 0%, oklch(0.36 0.1 255), transparent 62%), linear-gradient(160deg in oklch, oklch(0.28 0.08 262), oklch(0.19 0.05 272)); }
  .auth-scene::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(oklch(1 0 0 / .1) 1px, transparent 1.6px) 0 0 / 22px 22px; mask-image: radial-gradient(90% 70% at 100% 100%, #000, transparent 70%); }
  /* céu de estrelas: cada resposta vira uma estrela */
  .auth-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
  .auth-sky i { position: absolute; left: var(--x); top: var(--y); width: calc(var(--s) * 1.8); aspect-ratio: 1; background: var(--fundhas-yellow); opacity: .55;
    clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); }
  .shoot, .sobe { display: none; }
  /* aurora suave atrás de tudo */
  .auth-scene::after { content: ""; position: absolute; z-index: -2; width: 70%; aspect-ratio: 1; left: 45%; top: -20%; border-radius: 50%; background: radial-gradient(circle, oklch(0.75 0.14 220 / .35), transparent 65%); filter: blur(20px); pointer-events: none; }
  .auth-say .w { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: top; padding-bottom: .06em; }
  .auth-say .w > * { display: inline-flex; align-items: center; gap: .15em; }
  /* valores fixos da cena do Entrar e dos ícones do menu (antes style=; #197) */
  .sobe:nth-of-type(1) { --x: 22%; --d: 0s; }
  .sobe:nth-of-type(2) { --x: 31%; --d: 1.6s; }
  .sobe:nth-of-type(3) { --x: 40%; --d: 3.1s; }
  .sobe:nth-of-type(4) { --x: 27%; --d: 4.4s; }
  .sobe:nth-of-type(5) { --x: 36%; --d: 5.7s; }
  .auth-sky i:nth-of-type(1) { --x: 58%; --y: 9%; --s: 9px; --t: 3.2s; --d: 0s; }
  .auth-sky i:nth-of-type(2) { --x: 86%; --y: 22%; --s: 12px; --t: 4.1s; --d: -1.2s; }
  .auth-sky i:nth-of-type(3) { --x: 93%; --y: 52%; --s: 8px; --t: 3.6s; --d: -2.4s; }
  .auth-sky i:nth-of-type(4) { --x: 70%; --y: 40%; --s: 6px; --t: 2.9s; --d: -0.8s; }
  .auth-sky i:nth-of-type(5) { --x: 8%; --y: 30%; --s: 7px; --t: 3.8s; --d: -1.9s; }
  .auth-sky i:nth-of-type(6) { --x: 47%; --y: 30%; --s: 5px; --t: 3.1s; --d: -2.8s; }
  .auth-sky i:nth-of-type(7) { --x: 80%; --y: 80%; --s: 10px; --t: 4.4s; --d: -0.4s; }
  .auth-sky i:nth-of-type(8) { --x: 38%; --y: 92%; --s: 6px; --t: 3.4s; --d: -1.5s; }
  .auth-say .w:nth-child(1) > * { --w: 0; }
  .auth-say .w:nth-child(2) > * { --w: 1; }
  .auth-say .w:nth-child(3) > * { --w: 2; }
  .auth-say .w:nth-child(4) > * { --w: 3; }
  .auth-say .w:nth-child(5) > * { --w: 4; }
  .auth-say .w:nth-child(6) > * { --w: 5; }
  .auth-say .w:nth-child(7) > * { --w: 6; }
  .auth-say .w:nth-child(8) > * { --w: 7; }
  .auth-say .w:nth-child(9) > * { --w: 8; }
  .tile-1 { --t: var(--tile-1); }
  .tile-2 { --t: var(--tile-2); }
  .tile-3 { --t: var(--tile-3); }
  .tile-4 { --t: var(--tile-4); }
  .tile-5 { --t: var(--tile-5); }
  .tile-6 { --t: var(--tile-6); }
  .tile-7 { --t: var(--tile-7); }
  .tile-8 { --t: var(--tile-8); }
  .tile-9 { --t: var(--tile-9); }
  .faces { translate: calc(var(--mx, 0) * -10px) calc(var(--my, 0) * -6px); }
  .auth-sky { translate: calc(var(--mx, 0) * 12px) calc(var(--my, 0) * 8px); }
  .burst { position: fixed; z-index: 100; left: var(--bx); top: var(--by); width: 14px; height: 14px; pointer-events: none; background: var(--fundhas-yellow); clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); }
  .auth-logos { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
  .auth-logos .jogo { width: 200px; filter: drop-shadow(0 4px 10px oklch(0.15 0.08 260 / .35)); }
  .auth-logos .org { width: 150px; }
  .auth-pitch { align-self: center; display: grid; gap: var(--sp-6); }
  .auth-say { max-width: 16ch; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 0.7rem + 4.3cqi, 3.5rem); line-height: 1.02; letter-spacing: -0.015em; color: oklch(0.99 0.005 250); }
  .auth-say em { font-style: normal; display: inline-flex; align-items: center; gap: .15em; color: var(--fundhas-yellow); }
  .auth-note { max-width: 42ch; color: oklch(0.86 0.04 250); font-weight: 600; font-size: var(--fs-lg); }
  /* elenco em foco: Helinho na frente e nítido; a turma atrás, desfocada como profundidade de campo */
  .faces { --u: clamp(9px, min(2cqi, 1.7vh), 18px); position: relative; list-style: none; margin: var(--sp-2) 0 0; padding: 0; width: calc(var(--u) * 40); max-width: 100%; height: calc(var(--u) * 19); }
  .faces::before { content: ""; position: absolute; left: 50%; top: 52%; width: calc(var(--u) * 22); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, oklch(0.87 0.175 90 / .45), oklch(0.87 0.175 90 / 0) 66%); }
  .face { position: absolute; width: calc(var(--u) * var(--w)); left: calc(var(--u) * var(--x)); top: calc(var(--u) * var(--y)); filter: blur(var(--b)) drop-shadow(0 calc(var(--u) * .8) calc(var(--u) * 1.2) oklch(0.12 0.08 260 / .35)); opacity: var(--o, 1); z-index: var(--z); }
  .face img { display: block; width: 100%; height: auto; }
  .face.f-byte  { --w: 8.4; --x: 5.2;  --y: 1.4; --b: 2.6px; --o: .78; --z: 1; }
  .face.f-luna  { --w: 8.4; --x: 26.6; --y: 1;   --b: 2.6px; --o: .78; --z: 1; }
  .face.f-flora { --w: 9.6; --x: 0;    --y: 8.6; --b: 1.4px; --o: .92; --z: 2; }
  .face.f-max   { --w: 9.2; --x: 30.8; --y: 8.8; --b: 1.4px; --o: .92; --z: 2; }
  .face.f-lia   { --w: 7.2; --x: 33.2; --y: 0;   --b: 3.4px; --o: .62; --z: 0; }
  .face.lead    { --w: 15.5; --x: 12.3; --y: 2.4; --b: 0px; --z: 5; filter: drop-shadow(0 calc(var(--u) * 1.2) calc(var(--u) * 2) oklch(0.12 0.08 260 / .45)); }
  /* passar o mouse traz o personagem para o foco */
  @media (hover: hover) { .face:not(.lead):hover { --b: 0px; --o: 1; scale: 1.06; z-index: 6; } }
  .auth-foot { color: oklch(0.82 0.04 250); font-size: var(--fs-sm); font-weight: 700; display: flex; align-items: center; gap: var(--sp-2); }
  .auth-foot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  /* lado do formulário: céu claro + cartão elevado, nada de vazio branco */
  .auth-form { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center; gap: var(--sp-6); padding: var(--sp-10) clamp(24px, 5vw, 72px) var(--sp-8);
    background: radial-gradient(60% 45% at 100% 0%, var(--select-bg), transparent 70%), radial-gradient(50% 40% at 0% 100%, oklch(from var(--fundhas-yellow) l c h / .14), transparent 70%), var(--canvas); }
  .auth-form::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(oklch(from var(--ink) l c h / .09) 1px, transparent 1.6px) 0 0 / 22px 22px; mask-image: radial-gradient(70% 60% at 100% 0%, #000, transparent 75%); }
  .auth-card { width: 100%; max-width: 460px; display: grid; gap: var(--sp-5); padding: clamp(24px, 3vw, 40px); background: var(--stage); border: 2px solid var(--rule); border-radius: var(--r-xl);
    box-shadow: 0 2px 0 var(--rule), 0 28px 56px -24px oklch(0.3 0.09 260 / .28); }
  .auth-card form { width: 100%; display: grid; gap: var(--sp-4); }
  .auth-card .alert { max-width: none; }
  .auth-badge { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 8px; border-radius: var(--r-pill); background: var(--select-bg); color: var(--select-ink); font-weight: 800; font-size: var(--fs-xs); letter-spacing: .02em; }
  .auth-badge .star { width: 14px; height: 14px; }
  .auth-form .lede { color: var(--ink-2); font-weight: 600; margin-top: -10px; max-width: 36ch; }
  .auth-form .btn { width: 100%; gap: var(--sp-2); }
  .auth-form .link { justify-self: start; font-weight: 800; color: var(--select-ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }
  .auth-help { color: var(--ink-3); font-size: var(--fs-sm); font-weight: 600; text-align: center; }
  .field:focus-within label { color: var(--select-ink); }
  /* botão ocupado: girador + rótulo; sem clique duplo */
  .btn[aria-busy="true"] { pointer-events: none; }
  .btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; flex: none; }
  .btn .ok-mark { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  /* criador: passos, escolha por personagem e pílulas, barra, prévia num celular */
  /* criador: passos à esquerda, prévia do jogo à direita (questão, curiosidade, evento) */
  .maker { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); gap: var(--sp-6); align-items: start; }
  .maker-form { display: grid; gap: var(--sp-5); min-width: 0; }
  .step { margin: 0; min-width: 0; border: 2px solid var(--rule); border-radius: var(--r-lg); background: var(--stage); padding: var(--sp-5) var(--sp-6) var(--sp-6); display: grid; gap: var(--sp-4); }
  .step-h { width: 100%; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 800; line-height: 1.2; color: var(--ink); }
  /* float tira a legenda do recorte da borda do fieldset; no grid ela vira item normal */
  legend.step-h { float: left; }
  .step-h .n { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--select-bg); color: var(--select-ink); font-size: var(--fs-sm); flex: none; }
  .step-h small { margin-left: auto; font: 700 var(--fs-xs) var(--font); color: var(--ink-3); }
  .sub-label { font-weight: 800; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: calc(var(--sp-2) * -1); }
  /* tema = personagem: escolher é tocar no personagem */
  .theme-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-3); }
  .tp { position: relative; display: grid; justify-items: center; gap: 2px; padding: 10px 6px 12px; border-radius: var(--r-lg); border: 2px solid var(--rule); background: var(--canvas); cursor: pointer; text-align: center; }
  .tp input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .tp img { width: 64px; height: 64px; object-fit: contain; filter: saturate(.6); opacity: .8; }
  .tp b { font-size: var(--fs-sm); font-weight: 800; }
  .tp small { font-size: var(--fs-xs); color: var(--ink-3); font-weight: 700; }
  .tp:hover { border-color: oklch(from var(--q) l c h / .5); }
  .tp:has(:checked) { background: var(--qb); border-color: var(--q); box-shadow: 0 0 0 3px oklch(from var(--q) l c h / .18); }
  .tp:has(:checked) img { filter: none; opacity: 1; scale: 1.08; }
  .tp:has(:checked) b, .tp:has(:checked) small { color: var(--qi); }
  .tp:has(:checked)::after { content: ""; position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--q) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
  .tp:has(:focus-visible) { outline: 3px solid var(--select-line); outline-offset: 2px; }

  /* pílulas de escolha (rádio/checkbox com cara de chip) */
  .pill-pick { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .pp { position: relative; }
  .pp input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .pp span { display: inline-flex; align-items: center; height: var(--h-control); padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--rule-strong); background: var(--stage); font-weight: 800; color: var(--ink-2); }
  .pp:hover span { border-color: var(--select-line); }
  .pp:has(:checked) span { background: var(--select-bg); border-color: var(--select-line); color: var(--select-ink); }
  .pp:has(:focus-visible) span { outline: 3px solid var(--select-line); outline-offset: 2px; }
  .maker-bar { position: sticky; bottom: var(--sp-3); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: oklch(from var(--stage) l c h / .92); backdrop-filter: blur(8px); border: 2px solid var(--rule); box-shadow: 0 -10px 30px -18px oklch(0.3 0.08 260 / .35); }
  .maker-bar .link { font-weight: 800; color: var(--select-ink); }
  .maker-bar .hint { margin-left: auto; color: var(--ink-3); font-weight: 800; font-size: var(--fs-sm); }

  /* prévia num celular: o que o aluno vê */
  .maker-preview { position: sticky; top: var(--sp-6); display: grid; gap: var(--sp-4); justify-items: center; }
  .pv-label { justify-self: stretch; display: flex; justify-content: space-between; gap: var(--sp-3); font-weight: 800; color: var(--ink); }
  .pv-label span + span { color: var(--ink-3); font-size: var(--fs-xs); align-self: center; }
  .phone { width: min(320px, 100%); border-radius: 40px; padding: 10px; background: oklch(0.24 0.03 262); box-shadow: 0 30px 60px -28px oklch(0.2 0.08 260 / .6), inset 0 0 0 2px oklch(1 0 0 / .08); }
  .phone .screen { position: relative; min-height: 520px; border-radius: 31px; overflow: hidden; display: grid; align-content: start; gap: var(--sp-3); padding: 40px 14px 18px; background: linear-gradient(180deg in oklch, var(--qb), var(--stage) 80%); }
  .phone .screen::before { content: ""; position: absolute; top: 10px; left: 50%; translate: -50% 0; width: 84px; height: 20px; border-radius: 99px; background: oklch(0.24 0.03 262); }
  /* a alternativa da prévia guarda o texto num span (#160): vazia, o li se pinta como em #154 e o span herda */
  .phone .is-empty, .gq-alts li:has(> .is-empty) { color: var(--ink-3); font-style: italic; font-weight: 600; }
  .gq-alts li > .is-empty { color: inherit; font-style: inherit; font-weight: inherit; }
  .scr-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: var(--qi); text-align: center; }
  .gq-head { display: flex; align-items: center; gap: var(--sp-2); font-weight: 800; font-size: var(--fs-xs); color: var(--qi); }
  .gq-head img { width: 36px; height: 36px; object-fit: contain; }
  .gq-head .lvl { margin-left: auto; padding: 3px 9px; border-radius: 99px; background: var(--stage); color: var(--ink-2); }
  .gq { padding: 14px; border-radius: 18px; background: var(--stage); border: 2px solid oklch(from var(--q) l c h / .3); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.25; min-height: 84px; overflow-wrap: anywhere; }
  .gq-alts { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
  .gq-alts li { display: flex; gap: var(--sp-2); align-items: center; min-height: 42px; padding: var(--sp-2) 10px; border-radius: 14px; background: var(--stage); border: 2px solid var(--rule); border-bottom-width: 4px; font-weight: 800; font-size: var(--fs-sm); overflow-wrap: anywhere; }
  .gq-alts li::before { content: attr(data-k); width: 24px; height: 24px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--neutral-bg); color: var(--neutral-ink); font-size: var(--fs-xs); flex: none; font-style: normal; }
  .gq-alts li.right { border-color: oklch(from var(--ok) l c h / .6); background: var(--ok-bg); color: var(--ok-ink); }
  .gq-alts li.right::before { background: var(--ok); color: oklch(1 0 0); }
  .gq-why { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
  /* prévia ao vivo (#160): o servidor sempre emite a faixa e a explicação; vazias, não aparecem */
  .gq-head .lvl:empty, .gq-why:empty { display: none; }
  /* contador ao lado da ajuda do campo: aparecer não empurra a página */
  .field small:has(> .count-hint) { display: flex; justify-content: space-between; gap: var(--sp-2); }
  .dots { display: flex; justify-content: center; gap: 6px; }
  .dots i { width: 7px; height: 7px; border-radius: 50%; background: oklch(from var(--q) l c h / .3); }
  .dots i.on { width: 20px; border-radius: 99px; background: var(--q); }
  /* lista de checagem ao lado da prévia */
  .ready { justify-self: stretch; list-style: none; margin: 0; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--stage); border: 2px solid var(--rule); display: grid; gap: 8px; font-weight: 700; font-size: var(--fs-sm); color: var(--ink-3); }
  .ready li { display: flex; gap: 10px; align-items: center; }
  .ready li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--rule-strong); flex: none; }
  .ready li.ok { color: var(--ink); }
  .ready li.ok::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
  /* ficha do aluno */
  /* ficha do aluno */
  .profile { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-5); align-items: center; }
  .av-xl { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; background: var(--q-con-bg); color: var(--q-con-ink); }
  .profile .meta { color: var(--ink-2); font-weight: 700; margin-top: 4px; }
  .level { display: grid; gap: 6px; min-width: 280px; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--sunny); border: 2px solid oklch(0.87 0.175 90 / .55); }
  .level b { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 800; line-height: 1; }
  .level small { color: var(--ink-2); font-weight: 700; }
  .level .meter { --q: oklch(0.7 0.16 75); background: oklch(1 0 0 / .7); }
  :root[data-theme="dark"] .level .meter { background: oklch(0 0 0 / .25); }
  .badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
  .badge-card { display: grid; justify-items: center; text-align: center; gap: 6px; padding: var(--sp-4) var(--sp-3); border-radius: var(--r-lg); background: var(--canvas); border: 2px solid var(--rule); font-weight: 800; }
  .badge-card img { width: 64px; height: 64px; object-fit: contain; }
  .badge-card.is-locked { color: var(--ink-3); border-style: dashed; }
  .badge-card.is-locked > .icon { opacity: .55; }
  .badge-card small { color: var(--ink-3); font-weight: 700; font-size: var(--fs-xs); }
  /* telas de conta (sem casca) */
  /* telas de conta (sem casca) */
  .bare { min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-6); background: radial-gradient(80% 60% at 50% 0%, var(--sky), var(--canvas) 70%); }
  .bare-card { width: min(440px, 100%); display: grid; gap: var(--sp-5); padding: var(--sp-8); border-radius: var(--r-xl); background: var(--stage); border: 2px solid var(--rule); box-shadow: var(--shadow-float); }
  .bare-card .face-solo { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; position: relative; background: var(--fundhas-yellow); box-shadow: 0 0 0 3px var(--stage), 0 0 0 5px var(--rule); }
  .bare-card .face-solo.con { background: var(--qb); }
  .bare-card .face-solo img { position: absolute; left: 4%; top: 6%; width: 92%; }
  .bare-card .lede { color: var(--ink-2); font-weight: 600; margin-top: -8px; }
  .bare-card form { display: grid; gap: var(--sp-4); }
  .bare-card .btn-primary { width: 100%; }
  .bare-card .link { font-weight: 800; color: var(--select-ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }
  /* responsivo */
  @media (max-width: 900px) { .auth { grid-template-columns: 1fr; } }
  @media (max-width: 1100px) {
    .split, .maker { grid-template-columns: minmax(0, 1fr); }
    .maker-preview { position: static; }
  }
  @media (max-width: 767.98px) {
    .auth-scene { padding: var(--sp-5); gap: var(--sp-6); }
    .auth-logos .jogo { width: 150px; } .auth-logos .org { width: 112px; }
    .auth-note, .auth-foot { display: none; }
    .faces { --u: 8.4px; margin-inline: auto; }
    .auth-form { padding: var(--sp-6) var(--sp-4) var(--sp-6); align-items: start; }
    .auth-card { padding: var(--sp-5); }
    .form-grid { grid-template-columns: 1fr; }
    .profile { grid-template-columns: auto 1fr; }
    .level { grid-column: 1 / -1; min-width: 0; }
    .filters-bar { display: grid; grid-template-columns: 1fr 1fr; }
    .filters-bar .select { min-width: 0; width: 100%; }
    .panel-pad { padding: var(--sp-4); }
    .step { padding: var(--sp-4); }
    .theme-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .maker-bar { padding: var(--sp-2) var(--sp-3); gap: var(--sp-1) var(--sp-3); }
    .maker-bar .btn { height: var(--h-control); }
    .maker-bar .hint { margin-left: 0; width: 100%; font-size: var(--fs-xs); }
    .step-h small { margin-left: 0; width: 100%; }
  }
}

@layer motion {
  @keyframes pop { from { scale: 0; rotate: -90deg; } }
  @keyframes spin { to { rotate: 360deg; } }
  @media (prefers-reduced-motion: no-preference) {
    /* telas: entrada em cascata da pilha */
    .tela:not([hidden]) > .stack > * { animation: rise var(--dur-enter) var(--ease-out) both; }
    .tela:not([hidden]) > .stack > :nth-child(2) { animation-delay: 60ms; }
    .tela:not([hidden]) > .stack > :nth-child(3) { animation-delay: 120ms; }
    .tela:not([hidden]) > .stack > :nth-child(n+4) { animation-delay: 180ms; }
    .tp, .pp span, .ready li { transition: border-color var(--dur), background var(--dur), color var(--dur), box-shadow var(--dur), translate 200ms var(--ease-out); }
    .tp:hover { translate: 0 -2px; }
    .tp img { transition: filter var(--dur), opacity var(--dur), scale 300ms var(--ease-pop); }
    .tp:has(:checked) img { animation: pick 460ms var(--ease-pop); }
    @keyframes pick { 40% { scale: 1.22; rotate: -7deg; } }
    .tp:has(:checked)::after, .ready li.ok::before { animation: pop 380ms var(--ease-pop) both; }
    .phone .screen { transition: background var(--dur-slow); }
    .field label { transition: color var(--dur); }
    .phone [data-face], .phone [data-body] { animation: none; }
    /* entrar: o cartão sobe, o conteúdo entra em cascata, as estrelas piscam */
    .auth-card > *, .auth-card form > *, .auth-help, .auth-say, .auth-note, .auth-logos > * { animation: rise var(--dur-enter) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }
    .auth-say { --i: 2; } .auth-note { --i: 3; } .auth-logos > :nth-child(2) { --i: 1; }
    /* login: o cartão sobe, o conteúdo entra em cascata, as estrelas piscam */
    .auth-card { animation: card-in 760ms var(--ease-out) 80ms both; }
    .auth-card > :nth-child(1) { --i: 2; } .auth-card > :nth-child(2) { --i: 3; } .auth-card > :nth-child(3) { --i: 4; }
    .auth-card form > :nth-child(1) { --i: 5; } .auth-card form > :nth-child(2) { --i: 6; } .auth-card form > :nth-child(3) { --i: 7; }
    .auth-card > .link { --i: 8; } .auth-help { --i: 10; }
    @keyframes card-in { from { opacity: 0; translate: 0 24px; scale: .97; } }
    .auth-sky i { animation: sky var(--t) ease-in-out var(--d) infinite; }
    @keyframes sky { 0%, 100% { opacity: .15; scale: .55; } 50% { opacity: .85; scale: 1; rotate: 45deg; } }
    .auth-say .star { animation: pop 720ms var(--ease-pop) 520ms both, glint 4.5s ease-in-out 2.4s infinite; }
    @keyframes glint { 0%, 84%, 100% { rotate: 0deg; scale: 1; } 90% { rotate: 72deg; scale: 1.3; } }
    .auth-badge .star { animation: pop 620ms var(--ease-pop) 600ms both; }
    /* foco: o anel nasce do campo */
    .auth-card .input:focus { animation: ring 520ms var(--ease-out); }
    @keyframes ring { from { box-shadow: 0 0 0 0 var(--select-bg); } }
    .btn .spin { animation: spin 700ms linear infinite; }
    .btn .ok-mark path { stroke-dasharray: 20; animation: draw 420ms var(--ease-out) both; }
    @keyframes draw { from { stroke-dashoffset: 20; } }
    .auth.ok .face.lead img { animation: yay 640ms var(--ease-pop) both; }
    @keyframes yay { 40% { translate: 0 calc(var(--u) * -2.2); rotate: -6deg; } 70% { rotate: 4deg; } }
    .auth.ok .faces .face:not(.lead) { --b: 0px; --o: 1; }
    /* erro: o cartão balança e o aviso desliza */
    .auth.erro .auth-card { animation: shake 440ms var(--ease-out); }
    .auth.erro .alert { animation: rise 420ms var(--ease-out) both; }
    .auth-say { animation: none; }
    .auth-say .w > * { animation: word-up 900ms var(--ease-out) both; animation-delay: calc(var(--w) * 70ms + 260ms); }
    @keyframes word-up { from { translate: 0 105%; } }
    .auth-say em .star { animation: pop 720ms var(--ease-pop) 980ms both, glint 4.5s ease-in-out 3s infinite; }
    .sobe { display: block; position: absolute; left: var(--x); bottom: 26%; width: 12px; aspect-ratio: 1; background: var(--fundhas-yellow); clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); opacity: 0; animation: sobe 7s ease-in var(--d) infinite; }
    @keyframes sobe { 0% { opacity: 0; translate: 0 0; scale: .4; } 12% { opacity: .95; scale: 1; } 70% { opacity: .7; } 100% { opacity: 0; translate: 6vw -48vh; scale: .5; rotate: 200deg; } }
    /* estrela cadente de vez em quando */
    .shoot { display: block; position: absolute; top: 12%; left: 30%; width: 120px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, oklch(1 0 0 / .9)); rotate: -18deg; opacity: 0; animation: shoot 9s ease-in 3s infinite; }
    .shoot.s2 { top: 34%; left: 55%; animation-delay: 7.5s; animation-duration: 11s; }
    @keyframes shoot { 0% { opacity: 0; translate: 0 0; } 2% { opacity: 1; } 8% { opacity: 0; translate: 260px 85px; } 100% { opacity: 0; translate: 260px 85px; } }
    .auth-scene::after { animation: aurora 16s ease-in-out infinite alternate; }
    @keyframes aurora { 50% { translate: -18% 14%; scale: 1.15; } 100% { translate: -6% 30%; scale: .95; } }
    .faces, .auth-sky { transition: translate 900ms var(--ease-out); }
    .auth-card .btn-primary { position: relative; overflow: hidden; }
    .auth-card .btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, oklch(1 0 0 / .35) 50%, transparent 70%); translate: -120% 0; transition: translate 0s; }
    .auth-card .btn-primary:hover::after { translate: 120% 0; transition: translate 700ms var(--ease-out); }
    /* sucesso: chuva de estrelas saindo do botão */
    .burst { animation: burst 900ms var(--ease-out) forwards; }
    @keyframes burst { from { translate: -50% -50%; scale: .4; opacity: 1; } to { translate: calc(-50% + var(--dx)) calc(-50% + var(--dy)); scale: 1; rotate: var(--r); opacity: 0; } }
    @keyframes shake { 20% { translate: -8px 0; } 40% { translate: 7px 0; } 60% { translate: -4px 0; } 80% { translate: 2px 0; } }
    /* a turma entra desfocada e flutua; o Helinho chega por último, em foco */
    .face img { animation: drift var(--t, 5s) ease-in-out var(--d, 0s) infinite alternate; }
    .face { animation: focus-in 900ms var(--ease-out) both; animation-delay: var(--in, 200ms); transition: filter 400ms var(--ease-out), opacity 400ms var(--ease-out), scale 400ms var(--ease-out); }
    .f-byte { --t: 5.2s; --d: -1s; --in: 150ms; } .f-luna { --t: 4.6s; --d: -2.2s; --in: 220ms; } .f-lia { --t: 5.8s; --d: -.6s; --in: 290ms; }
    .f-flora { --t: 4.4s; --d: -3s; --in: 330ms; } .f-max { --t: 4.9s; --d: -1.7s; --in: 400ms; }
    .face.lead { animation: hero-in 900ms var(--ease-pop) 620ms both; }
    .face.lead img { animation: hero-float 3.6s ease-in-out 1.6s infinite alternate; transform-origin: 50% 90%; }
    .faces::before { animation: halo 3.6s ease-in-out 1.2s infinite alternate; }
    @keyframes focus-in { from { opacity: 0; filter: blur(12px); translate: 0 calc(var(--u) * 1.5); } }
    @keyframes hero-in { 0% { opacity: 0; scale: .7; translate: 0 calc(var(--u) * 3); } 60% { opacity: 1; } }
    @keyframes drift { to { translate: 0 calc(var(--u) * -.7); } }
    @keyframes hero-float { 0% { rotate: -1.5deg; } 100% { rotate: 1.5deg; translate: 0 calc(var(--u) * -.6); } }
    @keyframes halo { to { scale: 1.08; opacity: .7; } }
  }
}

/* ---- PAINEL (Dashboard) do tema Recreio (Issue #145) ----
   Valores copiados da preview sem mudança. recreio.css: 224-257 (cena, filtros), 260-271 (turma),
   274-297 (duas colunas, feed, atenção, vazio, carregando), 304 (.cast-hint), 307, 422-427,
   617-626, 628-645, 648-661, 664-682, 685-704, 708-716, 719-732 e o responsivo/movimento do Painel. */
@layer screens {
  /* abertura em cena */
  .scene { position: relative; overflow: hidden; border-radius: var(--r-xl); background: radial-gradient(55% 45% at 88% 118%, var(--hill), transparent 72%), radial-gradient(40% 30% at 62% 120%, oklch(from var(--hill) l c h / .6), transparent 70%), linear-gradient(180deg in oklch, var(--sky) 0%, var(--stage) 100%); border: 2px solid var(--rule); min-height: 280px; padding: var(--sp-8) var(--sp-8) 0; display: grid; grid-template-columns: minmax(0, 1fr) 200px; isolation: isolate; }
  .scene::before { content: ""; position: absolute; z-index: -1; width: 220px; aspect-ratio: 1; right: 22%; top: -70px; border-radius: 50%; background: radial-gradient(circle, oklch(0.93 0.13 92 / .9), oklch(0.93 0.13 92 / 0) 70%); }
  .scene { box-shadow: inset 0 2px 0 oklch(1 0 0 / .7), 0 2px 0 var(--rule); }
  :root[data-theme="dark"] .scene { box-shadow: inset 0 2px 0 oklch(1 0 0 / .06), 0 2px 0 var(--rule); }
  .scene::after, .castcard::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: .1; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  :root[data-theme="dark"] .scene::after, :root[data-theme="dark"] .castcard::after { mix-blend-mode: screen; opacity: .05; }
  .scene-vila { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 120px; width: 100%; object-fit: cover; object-position: center 20%; mask-image: linear-gradient(to top, #000 55%, transparent); }
  .scene-copy { display: grid; align-content: start; gap: var(--sp-2); padding-bottom: 92px; }
  .hello { color: var(--select-ink); font-weight: 800; }
  .scene h1 { font-size: var(--fs-title); }
  .headline { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-hero); line-height: .95; letter-spacing: -0.02em; display: flex; align-items: center; gap: .2em; margin-top: var(--sp-3); }
  .headline .star { width: .55em; height: .55em; }
  /* semana em barras: hoje em amarelo */
  .week { margin-top: var(--sp-5); }
  .week ol { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 10px; height: 78px; }
  .week li:nth-child(1) { --d: 0; }
  .week li:nth-child(2) { --d: 1; }
  .week li:nth-child(3) { --d: 2; }
  .week li:nth-child(4) { --d: 3; }
  .week li:nth-child(5) { --d: 4; }
  .week li:nth-child(6) { --d: 5; }
  .week li:nth-child(7) { --d: 6; }
  .rank li:nth-child(1) { --k: 0; }
  .rank li:nth-child(2) { --k: 1; }
  .rank li:nth-child(3) { --k: 2; }
  .rank li:nth-child(4) { --k: 3; }
  .rank li:nth-child(5) { --k: 4; }
  .week li { height: 100%; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 6px; }
  .week .bar { align-self: end; width: 24px; height: calc(var(--v, 0) * 100%); min-height: 6px; border-radius: 8px 8px 4px 4px; background: oklch(from var(--ink-2) l c h / .22); }
  .week li.today .bar { background: var(--fundhas-yellow); box-shadow: 0 6px 14px -6px oklch(0.75 0.17 85 / .9); }
  .week small { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); }
  .week li.today small { color: var(--ink); }
  .scene-sub { text-wrap: balance; color: var(--ink-2); font-weight: 700; font-size: var(--fs-lg); }
  .scene-sub b { color: var(--ink); }
  .up { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; margin-left: 6px; border-radius: var(--r-sm); background: var(--ok-bg); color: var(--ok-ink); font-weight: 800; font-size: var(--fs-sm); vertical-align: 2px; }
  .scene-hero { align-self: end; justify-self: center; width: 170px; margin-bottom: -6px; filter: drop-shadow(0 10px 14px oklch(0.3 0.06 255 / .22)); }
  .scene-stats { position: absolute; left: var(--sp-8); bottom: var(--sp-5); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
  .stat { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; background: oklch(1 0 0 / .86); border: 2px solid var(--rule); border-radius: var(--r-md); backdrop-filter: blur(6px); font-weight: 700; color: var(--ink-2); }
  :root[data-theme="dark"] .stat { background: oklch(0.22 0.045 270 / .86); }
  .stat b { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1; }
  /* filtros */
  .filters { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3) var(--sp-6); }
  .filters-end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
  .filters label { color: var(--ink-3); font-weight: 800; font-size: var(--fs-sm); }
  /* turma por tipo: cartões de personagem */
  .cast { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-4); padding-top: 34px; }
  .castcard { position: relative; background: var(--qb); border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-4) var(--sp-4); min-height: 196px; display: grid; grid-template-rows: 1fr auto auto auto; gap: 6px; isolation: isolate; border: 2px solid oklch(from var(--q) l c h / .25); box-shadow: inset 0 2px 0 oklch(1 0 0 / .55), 0 3px 0 oklch(from var(--q) l c h / .22); transition: transform var(--dur) var(--ease); }
  .castcard:hover { transform: translateY(-3px); }
  .castcard img { position: absolute; z-index: -1; right: 2px; top: -30px; height: 132px; width: auto; filter: drop-shadow(0 6px 8px oklch(0.3 0.06 255 / .18)); }
  .castcard .pct { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: .9; color: var(--qi); }
  .castcard .pct small { font-size: .5em; }
  .castcard .name { align-self: start; max-width: 62%; font-weight: 800; line-height: 1.2; color: var(--qi); }
  .castcard .name span { display: block; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 700; }
  .castcard .meter { background: oklch(1 0 0 / .7); }
  :root[data-theme="dark"] .castcard .meter { background: oklch(0 0 0 / .25); }
  .castcard .count { color: var(--ink-2); font-size: var(--fs-xs); font-weight: 700; }
  .castcard-top { position: absolute; top: var(--sp-4); left: var(--sp-4); }
  /* duas colunas, feed, atenção, estados */
  .two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-6); align-items: stretch; }
  .feed { list-style: none; margin: 0; padding: 0; }
  .feed li { display: grid; grid-template-columns: 40px 1fr auto auto; gap: var(--sp-3); align-items: center; padding: 12px 0; border-top: 2px solid var(--rule); }
  .feed li:first-child { border-top: 0; padding-top: 0; }
  .feed .av:is(.amb, .con, .cul, .esp, .div) { background: var(--qb); color: var(--qi); }
  .feed .av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm); background: var(--neutral-bg); color: var(--neutral-ink); }
  .feed b { font-weight: 800; display: block; line-height: 1.2; }
  .feed small { color: var(--ink-3); font-weight: 700; font-size: var(--fs-xs); }
  .feed time { color: var(--ink-3); font-weight: 700; font-size: var(--fs-sm); min-width: 44px; text-align: right; }
  .attention { display: grid; gap: var(--sp-3); }
  .attn { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--canvas); border: 2px solid var(--rule); text-decoration: none; transition: border-color var(--dur); }
  .attn:hover { border-color: var(--select-line); }
  .attn .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--select-bg); color: var(--select-ink); }
  .attn .ic-warn { background: var(--warn-bg); color: var(--warn-ink); }
  .attn .ic-neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
  .attn .ic-q { background: var(--qb); color: var(--qi); }
  .attn b { display: block; font-weight: 800; }
  .attn small { color: var(--ink-2); font-weight: 600; }
  .attn .go { color: var(--ink-3); }
  /* estados */
  .empty { display: grid; justify-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4) var(--sp-4); }
  .empty img { height: 120px; width: auto; margin-bottom: var(--sp-2); }
  .empty b { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; }
  .empty p { color: var(--ink-2); font-weight: 600; max-width: 34ch; }
  .empty .btn { margin-top: var(--sp-3); }
  .sk { display: block; border-radius: var(--r-sm); background: linear-gradient(90deg in oklch, var(--neutral-bg) 0 40%, oklch(from var(--neutral-bg) calc(l + .03) c h) 50%, var(--neutral-bg) 60% 100%) 0 0 / 300% 100%; }
  .sk-av { width: 40px; height: 40px; border-radius: 12px; }
  .sk-line { height: 12px; }
  .cast-hint { display: none; }
  .field-inline { display: inline-flex; align-items: center; gap: var(--sp-2); }
  .scene-twinkle { position: absolute; z-index: -1; color: var(--star); width: 18px; height: 18px; }
  .scene-twinkle.t1 { right: 31%; top: 30px; } .scene-twinkle.t2 { right: 6%; top: 46px; width: 12px; height: 12px; } .scene-twinkle.t3 { right: 24%; top: 120px; width: 10px; height: 10px; }
  .feed .tag { justify-self: start; }
  .attn .ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .castcard { text-decoration: none; color: inherit; }
  .castcard:focus-visible { outline-offset: 3px; border-radius: var(--r-lg); }
  /* painéis, indicadores, legenda, dica, gráfico de linha, tabelas de dados, ranking, mapa de calor */
  .txt-good { color: var(--ok-ink); font-weight: 800; }
  .more { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 8px; margin-right: -8px; border-radius: var(--r-sm); color: var(--select-ink); font-weight: 800; font-size: var(--fs-sm); text-decoration: none; }
  .more:hover { background: var(--select-bg); }
  .more .icon { width: 14px; height: 14px; }
  .panel-head > div { display: grid; gap: 2px; }
  .panel-head h2 { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 800; line-height: 1.15; }
  .panel-head p b { font-weight: 800; }
  .foot-note { margin-top: var(--sp-4); color: var(--ink-3); font-size: var(--fs-sm); font-weight: 700; }
  .foot-note b { color: var(--ink-2); }
  .two > * { min-width: 0; }
  /* ---------- indicadores ---------- */
  .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
  .kpi { position: relative; display: grid; gap: var(--sp-1); align-content: start; padding: var(--sp-5) var(--sp-5) 0; overflow: hidden; background: var(--stage); border: 2px solid var(--rule); border-radius: var(--r-lg); box-shadow: 0 2px 0 var(--rule); color: inherit; text-decoration: none; }
  a.kpi { transition: border-color var(--dur); }
  a.kpi:hover { border-color: var(--select-line); }
  .kpi h3 { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); font-weight: 800; color: var(--ink-2); }
  .kpi-ic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--select-bg); color: var(--select-ink); }
  .kpi-v { display: flex; align-items: baseline; gap: 6px; margin-top: var(--sp-1); }
  .kpi-v b { font-family: var(--font-display); font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--ink); }
  .kpi-v small { color: var(--ink-2); font-weight: 800; }
  .delta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: var(--fs-sm); font-weight: 800; }
  .delta .icon { width: 14px; height: 14px; stroke-width: 2.4; }
  .delta span { color: var(--ink-3); font-weight: 700; }
  .delta.good { color: var(--ok-ink); } .delta.bad { color: var(--bad-ink); } .delta.flat { color: var(--ink-2); }
  .spark { display: block; width: calc(100% + 2 * var(--sp-5)); height: 44px; margin: var(--sp-3) calc(-1 * var(--sp-5)) 0; overflow: visible; }
  .spark .s-line { fill: none; stroke: var(--data); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
  .spark .s-area { fill: var(--data-wash); }
  .kpi:has(.delta.bad) .spark { --data: var(--bad); --data-wash: oklch(from var(--bad) l c h / .1); }
  .legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 700; }
  .legend li { display: inline-flex; align-items: center; gap: 6px; }
  .sw { display: inline-block; width: 16px; height: 4px; border-radius: 2px; background: var(--data); flex: none; }
  .sw-ref { background: repeating-linear-gradient(90deg, var(--data-ref) 0 5px, transparent 5px 8px); }
  .tip { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; display: grid; gap: 2px; min-width: 150px; padding: 8px 12px; border-radius: var(--r-md); background: var(--ink); color: var(--stage); font-size: var(--fs-sm); font-weight: 700; box-shadow: var(--shadow-float); opacity: 0; }
  .tip.on { opacity: 1; }
  .tip b { font-weight: 900; }
  .tip span { display: flex; align-items: center; gap: 6px; }
  .tip span b { margin-left: auto; padding-left: var(--sp-3); }
  /* a dica é escura no claro e clara no escuro: as amostras usam o par oposto */
  .tip .sw-data { background: oklch(0.78 0.11 240); }
  .tip .sw-ref { background: repeating-linear-gradient(90deg, oklch(0.75 0.02 255) 0 5px, transparent 5px 8px); }
  :root[data-theme="dark"] .tip .sw-data { background: oklch(0.55 0.15 250); }
  :root[data-theme="dark"] .tip .sw-ref { background: repeating-linear-gradient(90deg, oklch(0.6 0.02 255) 0 5px, transparent 5px 8px); }
  .linechart { position: relative; height: 260px; border-radius: var(--r-md); cursor: crosshair; touch-action: pan-y; }
  .linechart svg { display: block; width: 100%; height: 100%; overflow: visible; }
  .lc-grid line { stroke: var(--grid); stroke-width: 1; }
  .lc-grid line.base { stroke: var(--rule-strong); }
  .lc-axis text { fill: var(--ink-3); font: 700 11px var(--font); }
  .lc-area { fill: var(--data-wash); }
  .lc-line { fill: none; stroke: var(--data); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
  .lc-ref { fill: none; stroke: var(--data-ref); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
  .lc-hair { stroke: var(--ink-3); stroke-width: 1; opacity: 0; }
  .lc-dot { stroke: var(--stage); stroke-width: 2; opacity: 0; }
  .lc-dot.d { fill: var(--data); } .lc-dot.r { fill: var(--data-ref); }
  .lc-today { fill: var(--data); stroke: var(--stage); stroke-width: 2; }
  .linechart.hover .lc-hair, .linechart.hover .lc-dot { opacity: 1; }
  .linechart:focus-visible { outline-offset: 6px; }
  .chart-table { margin-top: var(--sp-3); }
  .chart-table summary { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 8px; margin-left: -8px; border-radius: var(--r-sm); color: var(--select-ink); font-weight: 800; font-size: var(--fs-sm); cursor: pointer; list-style: none; }
  .chart-table summary::-webkit-details-marker { display: none; }
  .chart-table summary:hover { background: var(--select-bg); }
  .chart-table[open] .tscroll { max-height: 240px; margin-top: var(--sp-2); border: 2px solid var(--rule); border-radius: var(--r-md); }
  .tscroll { position: relative; overflow: auto; }
  .dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
  .dtable th, .dtable td { padding: 10px 12px; text-align: left; border-top: 2px solid var(--rule); vertical-align: middle; }
  .dtable thead th { position: sticky; top: 0; z-index: 1; background: var(--stage); border-top: 0; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  .dtable tbody th { font-weight: 700; color: var(--ink-2); }
  .dtable td { font-weight: 700; }
  #tab-resp td { text-align: right; }
  .hard { min-width: 440px; }
  .q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-2); margin-top: 6px; }
  .q-meta .tag { height: 24px; font-size: var(--fs-xs); }
  .hard th:first-child, .hard td:first-child { padding-left: 0; }
  .hard th:last-child, .hard td:last-child { padding-right: 0; text-align: right; }
  .hard td > b { display: block; font-size: var(--fs-md); font-weight: 800; line-height: 1.3; }
  .hard td small { color: var(--ink-3); font-weight: 700; }
  .hard tbody tr { transition: background var(--dur); }
  .hard tbody tr:hover { background: oklch(from var(--select-bg) l c h / .45); }
  .hit { display: grid; grid-template-columns: 4ch 64px; align-items: center; gap: var(--sp-2); }
  .hit b { font-size: var(--fs-md); font-weight: 800; color: var(--bad-ink); }
  .hit-bar { height: 8px; border-radius: var(--r-pill); background: oklch(from var(--bad) l c h / .16); overflow: hidden; }
  .hit-bar i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); border-radius: inherit; background: var(--bad); transform-origin: 0 50%; }
  .rank { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); }
  .rank li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 6px var(--sp-3); align-items: center; }
  .rank .pos { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--neutral-bg); color: var(--neutral-ink); font-weight: 900; font-size: var(--fs-sm); }
  .rank li:first-child .pos { background: var(--fundhas-yellow); color: oklch(0.3 0.06 80); }
  .rk-name { font-weight: 800; line-height: 1.2; min-width: 0; }
  .rk-name small { display: block; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; }
  .rank b { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 800; }
  .rk-bar { grid-column: 2 / -1; height: 10px; border-radius: var(--r-pill); background: var(--neutral-bg); overflow: hidden; }
  .rk-bar i { display: block; height: 100%; width: calc(var(--v, 0) * 100%); border-radius: inherit; background: var(--data); transform-origin: 0 50%; }
  .heat { width: 100%; min-width: 420px; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
  .heat th { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; padding: 0 4px; }
  .heat thead th { text-align: center; }
  .heat thead td { width: 118px; }
  .heat abbr { text-decoration: none; }
  .heat tbody th { text-align: left; white-space: nowrap; color: var(--ink-2); font-size: var(--fs-sm); }
  .heat td { height: 52px; padding: 0; border-radius: 10px; background: color-mix(in oklab, var(--data) calc(6% + var(--v, 0) * 94%), var(--stage)); text-align: center; cursor: default; }
  .heat thead td { background: none; height: auto; }
  /* Número da célula num rótulo --stage/--ink: contraste AA em qualquer intensidade, nos dois temas (B1 da revisão do #187). */
  .heat tbody td > span { font-size: var(--fs-xs); font-weight: 900; padding: 0 var(--sp-1); border-radius: var(--r-sm); background: var(--stage); color: var(--ink); opacity: 0; }
  .heat tbody td:hover { scale: 1.08; box-shadow: 0 0 0 2px var(--stage), 0 0 0 4px var(--data); position: relative; z-index: 1; }
  .heat tbody td:hover > span, .heat tbody td:focus-visible > span { opacity: 1; }
  /* Toque não tem hover: o número fica sempre visível. */
  @media (hover: none) { .heat tbody td > span { opacity: 1; } }
  .heat-scale { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; }
  .heat-scale i { width: 72px; height: 10px; border-radius: var(--r-pill); background: linear-gradient(90deg in oklab, color-mix(in oklab, var(--data) 6%, var(--stage)), var(--data)); }
  /* responsivo */
  @media (max-width: 1240px) { .cast { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 44px; } .two { grid-template-columns: 1fr; } }
  @media (max-width: 1240px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 767.98px) {
    .scene { grid-template-columns: 1fr; padding: var(--sp-6) var(--sp-5) 0; }
    .scene-hero { display: none; }
    .scene-stats { position: static; margin: var(--sp-5) 0 var(--sp-5); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
    .stat { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; font-size: var(--fs-xs); line-height: 1.2; }
    .scene-copy { padding-bottom: 0; }
    .scene-vila { height: 90px; }
    .scene { min-height: 0; }
    .cast { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feed li { grid-template-columns: 40px 1fr auto; row-gap: 6px; }
    .feed li .av { grid-row: span 2; align-self: start; }
    .feed .tag { grid-column: 2; grid-row: 2; }
    .feed time { grid-column: 3; grid-row: 1; }
    .filters-end { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .field-inline { display: grid; gap: 4px; }
    .field-inline .select { width: 100%; }
    .filters-end .btn { grid-column: 1 / -1; }
    .cast { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 64%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: clamp(16px, 3vw, 40px); margin-inline: calc(-1 * clamp(16px, 3vw, 40px)); padding: 34px clamp(16px, 3vw, 40px) 8px; scrollbar-width: none; }
    .cast > * { scroll-snap-align: start; }
    .cast-hint { display: block; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800; }
    .scene::before { right: -40px; top: -90px; }
    .kpis { gap: var(--sp-3); }
    .kpi { padding: var(--sp-4) var(--sp-4) 0; }
    .kpi h3 { font-size: var(--fs-xs); line-height: 1.25; }
    .kpi-ic { display: none; }
    .kpi-v b { font-size: 1.75rem; }
    .delta span { display: none; }
    .spark { width: calc(100% + 2 * var(--sp-4)); margin-inline: calc(-1 * var(--sp-4)); height: 36px; }
    .linechart { height: 220px; }
    .tscroll { margin-inline: calc(-1 * var(--sp-4)); padding-inline: var(--sp-4); }
    .heat tbody th { white-space: normal; }
    .heat thead td { width: 72px; }
  }
}

@layer motion {
  .scene-hero { view-transition-name: helinho; }
  @media (prefers-reduced-motion: no-preference) {
    /* Transições com duração fixa do Painel: ficam aqui para não rodarem com "reduzir movimento". */
    .tip { transition: opacity 120ms; }
    .heat td { transition: scale 160ms var(--ease-pop), box-shadow 160ms; }
    .heat tbody td > span { transition: opacity 120ms; }
    .sk { animation: shimmer 1.4s linear infinite; }
    @keyframes shimmer { to { background-position: -150% 0; } }
    /* entrada em cascata do Painel */
    .cast > *, .feed > li, .attention > * { animation: rise var(--dur-enter) var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger)); }
    .cast > :nth-child(1) { --i: 4; } .cast > :nth-child(2) { --i: 5; } .cast > :nth-child(3) { --i: 6; } .cast > :nth-child(4) { --i: 7; } .cast > :nth-child(5) { --i: 8; }
    .feed > :nth-child(1) { --i: 10; } .feed > :nth-child(2) { --i: 11; } .feed > :nth-child(3) { --i: 12; } .feed > :nth-child(4) { --i: 13; } .feed > :nth-child(5) { --i: 14; }
    .attention > :nth-child(1) { --i: 12; } .attention > :nth-child(2) { --i: 13; } .attention > :nth-child(3) { --i: 14; }
    .castcard img { animation: hop-in 700ms var(--ease-pop) both; animation-delay: calc(var(--i, 0) * var(--stagger) + 160ms); transition: translate 260ms var(--ease-pop), rotate 260ms var(--ease-pop); }
    .castcard:hover img, .castcard:focus-visible img { translate: 0 -8px; rotate: -3deg; }
    .castcard { transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out); }
    .castcard:hover { transform: translateY(-4px); box-shadow: 0 14px 28px oklch(from var(--q) 0.4 c h / .16); }
    @keyframes hop-in { 0% { opacity: 0; translate: 0 36px; } 60% { opacity: 1; } }
    .scene-hero { animation: bob 3.2s ease-in-out 900ms infinite alternate; }
    @keyframes bob { to { translate: 0 -4px; } }
    .week .bar { transform-origin: 50% 100%; animation: grow 820ms var(--ease-out) both; animation-delay: calc(var(--d) * 60ms + 520ms); }
    @keyframes grow { from { scale: 1 0; } }
    .week li.today .bar { animation: grow 820ms var(--ease-out) both 940ms, today 2.4s ease-in-out 2s infinite alternate; }
    @keyframes today { to { box-shadow: 0 6px 22px -4px oklch(0.8 0.17 85 / 1); } }
    /* feed ao vivo: novidade entra no topo e brilha um instante */
    .feed li.novo { animation: feed-in 700ms var(--ease-pop) both; }
    @keyframes feed-in { 0% { opacity: 0; translate: 0 -14px; background: var(--select-bg); } 60% { opacity: 1; background: var(--select-bg); } 100% { background: transparent; } }
    .feed li.sai { animation: out 260ms var(--ease-out) forwards; }
    @keyframes out { to { opacity: 0; translate: 16px 0; } }
    .chip { transition: border-color var(--dur), background var(--dur), color var(--dur), transform 120ms var(--ease), box-shadow var(--dur); }
    .chip[aria-current] { animation: pick-chip 380ms var(--ease-pop); }
    @keyframes pick-chip { 40% { scale: 1.06; } }
    .castcard .pct { transition: translate 260ms var(--ease-pop); }
    .castcard:hover .pct { translate: 0 -2px; }

    /* barras enchem até o valor */
    .meter > i { animation: fill 1100ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * var(--stagger) + 280ms); }
    @keyframes fill { from { clip-path: inset(0 100% 0 0 round 99px); } to { clip-path: inset(0 0 0 0 round 99px); } }
    .headline .star { animation: pop 720ms var(--ease-pop) 420ms both; }
    .scene-twinkle { animation: twinkle 2.8s ease-in-out infinite; }
    .scene-twinkle.t2 { animation-delay: .9s; } .scene-twinkle.t3 { animation-delay: 1.7s; }
    @keyframes twinkle { 50% { scale: .55; opacity: .5; } }
    .attn { transition: border-color var(--dur), transform 220ms var(--ease-out); }
    .attn:hover { transform: translateX(3px); }
    .attn .go { transition: translate 220ms var(--ease-out); }
    .attn:hover .go { translate: 3px 0; }
    .chip { transition: border-color var(--dur), background var(--dur), color var(--dur), transform 120ms var(--ease); }
    .chip:active { transform: scale(.96); }
    .kpi { animation: rise var(--dur-enter) var(--ease-out) both; }
    .kpis > :nth-child(1) { animation-delay: 160ms; } .kpis > :nth-child(2) { animation-delay: 220ms; } .kpis > :nth-child(3) { animation-delay: 280ms; } .kpis > :nth-child(4) { animation-delay: 340ms; }
    .kpi { transition: transform 260ms var(--ease-out), border-color var(--dur), box-shadow 260ms var(--ease-out); }
    .kpi:hover { transform: translateY(-3px); box-shadow: 0 2px 0 var(--rule), 0 14px 28px oklch(0.29 0.045 255 / .08); }
    .kpi-ic { transition: rotate 300ms var(--ease-pop), scale 300ms var(--ease-pop); }
    .kpi:hover .kpi-ic { rotate: -8deg; scale: 1.1; }
    /* linhas se desenham da esquerda para a direita */
    .spark g, .lc-series { animation: wipe 1300ms var(--ease-out) both; }
    .spark g { animation-delay: 520ms; }
    .lc-series { animation-delay: 260ms; }
    .lc-series.ref { animation-delay: 80ms; animation-duration: 1100ms; }
    [data-desenhado] .lc-series, [data-desenhado] .lc-today { animation: none; }
    @keyframes wipe { from { clip-path: inset(-10px 100% -10px -10px); } to { clip-path: inset(-10px -10px -10px -10px); } }
    .lc-today { animation: dot-in 600ms var(--ease-pop) 1.4s both; transform-box: fill-box; transform-origin: center; }
    @keyframes dot-in { from { scale: 0; } }
    .lc-hair, .lc-dot { transition: opacity 120ms; }
    .rk-bar i { animation: grow-x 1000ms var(--ease-out) both; animation-delay: calc(var(--k) * 80ms + 200ms); }
    .hit-bar i { animation: grow-x 900ms var(--ease-out) both 300ms; }
    @keyframes grow-x { from { scale: 0 1; } }
    .heat tbody td { animation: cell-in 520ms var(--ease-pop) both; }
    .heat tr > td:nth-child(2) { animation-delay: 100ms; } .heat tr > td:nth-child(3) { animation-delay: 150ms; } .heat tr > td:nth-child(4) { animation-delay: 200ms; } .heat tr > td:nth-child(5) { animation-delay: 250ms; } .heat tr > td:nth-child(6) { animation-delay: 300ms; } .heat tr > td:nth-child(7) { animation-delay: 350ms; } .heat tr > td:nth-child(8) { animation-delay: 400ms; }
    @keyframes cell-in { from { opacity: 0; scale: .6; } }
    .js .reveal:not(.vis) :is(.lc-series, .lc-today, .rk-bar i, .hit-bar i, .heat tbody td) { animation-play-state: paused; }
    .chart-table[open] .tscroll { animation: rise 360ms var(--ease-out); }
  }
}
