  :root {
    --bg: #0e1013;
    --bg-2: #15181d;
    --card: #1c2027;
    --card-2: #232831;
    --line: rgba(255,255,255,.08);
    --text: #f3f1ec;
    --muted: #9b9da8;
    --muted-2: #6d7080;
    --azul: #3b82f6;
    --azul-dim: #1e4ed8;
    --vermelho: #ef4444;
    --amarelo: #eab308;
    --verde: #22c55e;
    --core: #a78bfa;
    --pernas: #fb923c;
    --neutro: #8b8f9c;
    --good: #34d399;
    --shadow: 0 16px 40px rgba(0,0,0,.35);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --radius: 22px;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; }
  body {
    font-family: Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    line-height: 1.45;
  }
  button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; touch-action: manipulation; }
  button, a { -webkit-tap-highlight-color: transparent; }
  button:focus-visible, a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

  .app { min-height: 100%; min-height: 100dvh; }

  /* ===== HOME ===== */
  .home {
    max-width: 520px;
    margin: 0 auto;
    padding: calc(24px + var(--safe-t)) 20px calc(40px + var(--safe-b));
  }
  @media (min-width: 900px) {
    .home {
      max-width: 980px;
      display: grid;
      grid-template-columns: 1fr 340px;
      gap: 28px 40px;
      padding-top: calc(40px + var(--safe-t));
      align-items: start;
    }
    .home-main { grid-column: 1; }
    .home-side { grid-column: 2; grid-row: 1 / span 8; }
  }

  .kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
  }
  .kicker span {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 600;
  }
  h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.05;
    margin-bottom: 8px;
  }
  .lead { color: var(--muted); font-size: 15.5px; margin-bottom: 22px; max-width: 42ch; }

  .niveis {
    display: flex;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 22px;
    width: fit-content;
    max-width: 100%;
  }
  .niveis button {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
  }
  .niveis button.on {
    background: var(--text);
    color: #111;
  }

  .hoje {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 24px 22px 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 18px;
  }
  .hoje::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--accent, var(--azul));
  }
  .hoje-dia {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent, var(--azul));
    margin-bottom: 6px;
  }
  .hoje h2 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-bottom: 8px;
  }
  .hoje-meta {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 18px;
  }
  .hoje-meta b { color: var(--text); font-weight: 600; }
  .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
  .chip {
    font-size: 12px;
    font-weight: 650;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c, #fff) 16%, transparent);
    color: var(--c);
    letter-spacing: .02em;
  }
  .btn-go {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 54px;
    border-radius: 16px;
    background: var(--text);
    color: #111;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -.02em;
  }
  .btn-go:active { transform: scale(.985); }
  .btn-go.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    margin-top: 8px;
    height: 46px;
    font-weight: 650;
    font-size: 14px;
  }
  .feito-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--good);
    margin-bottom: 12px;
  }

  .semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 28px;
  }
  .dia-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0 8px;
    border-radius: 16px;
    background: var(--bg-2);
    border: 1px solid transparent;
    color: var(--muted);
    min-height: 72px;
  }
  .dia-btn strong { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
  .dia-btn .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: color-mix(in srgb, var(--a, #8b8f9c) 55%, #2a2d35);
  }
  .dia-btn.on {
    background: var(--card);
    border-color: color-mix(in srgb, var(--text) 24%, transparent);
    color: var(--text);
  }
  .dia-btn.done .dot { background: var(--good); }
  .dia-btn.rest .dot { background: var(--muted-2); }

  .bloco-guia h3, .side-title {
    font-size: 13px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 12px;
  }
  .cores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }
  .cor-card {
    background: var(--card);
    border-radius: 16px;
    padding: 14px 14px 12px;
    border-left: 4px solid var(--c);
    text-align: left;
  }
  .cor-card b { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
  .cor-card span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
  .cor-card em { display: block; font-style: normal; color: var(--c); font-size: 11.5px; font-weight: 700; margin-top: 6px; letter-spacing: .04em; text-transform: uppercase; }

  .tips {
    background: var(--card);
    border-radius: 18px;
    padding: 4px 18px;
    margin-bottom: 14px;
  }
  .tips details { border-bottom: 1px solid var(--line); }
  .tips details:last-child { border-bottom: 0; }
  .tips summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 0;
    font-weight: 700;
    font-size: 14.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .tips summary::-webkit-details-marker { display: none; }
  .tips summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 18px; }
  .tips details[open] summary::after { content: "–"; }
  .tips p, .tips li { color: var(--muted); font-size: 14px; padding-bottom: 12px; }
  .tips ul { padding-left: 18px; }
  .tips li { padding-bottom: 6px; }
  .tips li strong { color: var(--text); font-weight: 650; }


  .preview {
    list-style: none;
    margin: 0 0 18px;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
  }
  .preview li {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: baseline;
    gap: 10px;
    padding: 6px 0;
    font-size: 13.5px;
  }
  .preview .pdot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c, var(--muted));
    align-self: center;
  }
  .preview .pnum { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 650; font-size: 12.5px; white-space: nowrap; }

  .board-svg {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 14px;
    border-radius: 16px;
    background: #14171c;
    padding: 14px 16px 10px;
  }

  /* ===== PLAYER ===== */
  .player {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: calc(12px + var(--safe-t)) 20px calc(16px + var(--safe-b));
    background:
      radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--accent, var(--azul)) 22%, transparent), transparent 60%),
      var(--bg);
    transition: background .4s ease;
  }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
  }
  .icon-btn {
    width: 42px; height: 42px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    display: grid; place-items: center;
    font-size: 18px;
    color: var(--text);
  }
  .top-mid { text-align: center; flex: 1; }
  .top-mid .fase {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
  }
  .top-mid .restante { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 1px; }

  .prog {
    height: 4px;
    background: var(--line);
    border-radius: 99px;
    overflow: hidden;
    margin: 10px 0 8px;
  }
  .prog > i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent, var(--azul));
    border-radius: 99px;
    transition: width .2s linear;
  }
  .passos-mini {
    display: flex;
    gap: 3px;
    margin-bottom: 8px;
  }
  .passos-mini i {
    flex: 1;
    height: 3px;
    border-radius: 99px;
    background: var(--line);
  }
  .passos-mini i.done { background: color-mix(in srgb, var(--accent, #fff) 70%, #fff); }
  .passos-mini i.now { background: var(--accent, var(--azul)); }

  .palco {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 2px 0 8px;
    overflow-y: auto;
  }
  .serie-lab {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0;
    min-height: 16px;
  }
  .timer {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    font-size: clamp(60px, 18vw, 80px);
    font-weight: 800;
    letter-spacing: -.05em;
    line-height: .95;
    margin: 0 0 6px;
    user-select: none;
  }
  .player.descanso .timer { color: var(--muted); }
  .ex-nome {
    font-size: clamp(21px, 5.6vw, 28px);
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
    max-width: 22ch;
    margin-bottom: 6px;
  }
  .badge-cor {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: var(--accent);
    font-weight: 750;
    font-size: 12.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-bottom: 8px;
  }
  .badge-cor .bola { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
  .dica, .encaixe {
    max-width: 40ch;
    margin: 0 auto;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
  }
  .encaixe { color: var(--text); font-weight: 650; font-size: 14.5px; margin-bottom: 4px; }
  .reps {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
  }

  .controles {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 8px;
    padding-top: 8px;
  }
  .controles button {
    height: 54px;
    border-radius: 16px;
    font-weight: 750;
    font-size: 15px;
    background: var(--card);
    border: 1px solid var(--line);
  }
  .controles .pri {
    background: var(--text);
    color: #111;
    border-color: transparent;
    font-weight: 800;
  }

  /* ===== FIM ===== */
  .fim {
    min-height: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px calc(40px + var(--safe-b));
  }
  .fim h2 { font-size: 36px; font-weight: 800; letter-spacing: -.04em; margin: 12px 0 8px; }
  .fim p { color: var(--muted); max-width: 32ch; margin-bottom: 28px; }
  .check-grande {
    width: 84px; height: 84px; border-radius: 50%;
    background: color-mix(in srgb, var(--good) 18%, transparent);
    color: var(--good);
    display: grid; place-items: center;
    font-size: 40px; font-weight: 700;
  }

  .aviso {
    font-size: 12px;
    color: var(--muted-2);
    line-height: 1.4;
    margin-top: 8px;
  }


  /* ===== ILUSTRAÇÕES ===== */
  svg.fig { display: block; width: 100%; height: 100%; overflow: hidden; }
  .como-link {
    display: inline-flex; align-items: center; gap: 10px;
    margin: -8px 0 22px; padding: 9px 14px 9px 10px;
    border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line);
    font-size: 13.5px; font-weight: 700; color: var(--text);
  }
  .como-link i {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: color-mix(in srgb, var(--azul) 22%, transparent); color: var(--azul); font-style: normal; font-size: 14px;
  }
  @media (min-width: 900px) { .como-link { display: none; } }
  .como { margin-bottom: 26px; scroll-margin-top: 16px; }
  .passos { list-style: none; display: grid; gap: 10px; }
  .passo {
    display: grid; grid-template-columns: minmax(0, 50%) 1fr; gap: 12px; align-items: center;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 12px 12px;
  }
  .passo .guia-svg { width: 100%; height: auto; display: block; border-radius: 12px; background: #14171c; padding: 6px; }
  .passo b { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
  .passo b span {
    flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    background: var(--text); color: #111; font-size: 12px; font-weight: 800;
  }
  .passo p { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
  .passo p em { font-style: normal; font-weight: 750; }
  .passo p strong { color: var(--text); }
  .passo-big { grid-template-columns: 1fr; border-color: color-mix(in srgb, var(--azul) 35%, transparent); }
  .passo-big .guia-svg { padding: 8px 10px; }
  .certo-errado { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  .certo-errado figure { background: #14171c; border-radius: 12px; padding: 8px 8px 6px; }
  .certo-errado .guia-mini { width: 100%; height: auto; display: block; }
  .certo-errado figcaption { font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; margin-top: 4px; }
  .como-dica { font-size: 12.5px; color: var(--muted-2); margin-top: 10px; }
  @media (min-width: 900px) {
    .passo { grid-template-columns: 1fr; }
  }

  .preview li.prow { grid-template-columns: 76px 1fr auto; align-items: center; padding: 4px 0; cursor: pointer; }
  .pthumb {
    display: block; width: 76px; height: 46px; border-radius: 10px;
    background: #14171c; overflow: hidden;
  }
  .pthumb svg.fig { width: 100%; height: 100%; }
  .pname { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .pname .pdot { flex: none; }

  .galeria-det { background: var(--card); border-radius: 18px; padding: 4px 16px; margin-bottom: 14px; }
  .galeria-det summary {
    list-style: none; cursor: pointer; padding: 14px 0; font-weight: 700; font-size: 14.5px;
    display: flex; justify-content: space-between; align-items: center;
  }
  .galeria-det summary::-webkit-details-marker { display: none; }
  .galeria-det summary::after { content: "+"; color: var(--muted); font-weight: 500; font-size: 18px; }
  .galeria-det[open] summary::after { content: "–"; }
  .galeria { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-bottom: 14px; }
  .gal-item {
    text-align: left; background: #14171c; border-radius: 14px; padding: 6px 6px 8px;
    border: 1px solid transparent;
  }
  .gal-item .gfig { display: block; aspect-ratio: 320 / 190; }
  .gal-item span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 4px 0; line-height: 1.25; }
  .gal-item span i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

  .modal {
    position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
    background: rgba(5,6,8,.72); padding: 16px 12px calc(12px + var(--safe-b));
  }
  @media (min-width: 700px) { .modal { align-items: center; } }
  .modal-card {
    width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--line);
    border-radius: 24px; padding: 14px 16px 18px; box-shadow: var(--shadow); max-height: 92dvh; overflow: auto;
  }
  .modal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
  .modal-top h3 { font-size: 20px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
  .modal .mfig { aspect-ratio: 320 / 190; background: #14171c; border-radius: 16px; margin-bottom: 12px; }
  .modal .encaixe, .modal .dica { text-align: left; max-width: none; font-size: 14.5px; }

  /* player stage */
  .fig-stage {
    position: relative; width: 100%; max-width: 560px;
    flex: 1 1 210px; min-height: 150px; max-height: 300px;
    border-radius: 22px; margin: 0 auto 8px;
    background: radial-gradient(120% 90% at 50% 100%, #1a1e25 0%, #121418 70%);
    border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center; padding: 6px;
  }
  .fig-stage svg.fig { max-height: 100%; }
  .fig-stage .tag {
    position: absolute; left: 12px; top: 10px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em;
    text-transform: uppercase; color: var(--muted); background: rgba(14,16,19,.8); padding: 4px 8px; border-radius: 999px;
  }
  .player.descanso .fig-stage.previa svg.fig { opacity: .6; }
  .fig-stage.pausado::after {
    content: "pausado"; position: absolute; right: 12px; bottom: 10px; font-size: 10.5px; font-weight: 800;
    letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  }
  .dia-btn .hoje-lab { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); line-height: 1; }
  .dia-btn.on .hoje-lab { color: var(--text); }

  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
  }
