/* TATAME — estilos base (mobile-first, 360–430 px) */
:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #232733;
  --border: #2e3340;
  --text: #e8eaed;
  --muted: #a3a9b6;
  --primary: #1e5bd8;
  --primary-text: #ffffff;
  --link: #7aa5ff;
  --accent: #f5a623;
  --success: #3cb96f;
  --danger: #f06a6a;
  --belt-branca: #f2f2f2;
  --belt-azul: #1e5bd8;
  --belt-roxa: #6a3fb5;
  --belt-marrom: #6b4226;
  --belt-preta: #111111;
  --radius: 14px;
  --tabbar-h: 64px;
  --topbar-h: 56px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --border: #d5d9e0;
  --text: #15171c;
  --muted: #555c69;
  --link: #1a4fbf;
  --primary: #1e5bd8;
  --accent: #8a5700;
  --success: #217a45;
  --danger: #b83232;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: var(--link); }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 1.15rem; margin: 0; letter-spacing: .02em; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; color: var(--text); background: transparent; border: 0;
}
.icon-btn:hover, .icon-btn[aria-current="page"] { background: var(--surface-2); }

/* ---------- Barra inferior ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 44px; color: var(--muted); text-decoration: none; font-size: .75rem;
}
.tabbar a[aria-current="page"] { color: var(--text); }
.tabbar a[aria-current="page"] svg { stroke: var(--link); }

/* ---------- Conteúdo ---------- */
main { max-width: 640px; margin: 0 auto; padding: 16px; outline: none; }
h2 { font-size: 1.25rem; margin: 8px 0 12px; }
h3 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card > :last-child { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.kicker { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }
.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); font-size: .8rem; color: var(--muted);
}
.pill.accent { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.1); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

/* ---------- Formulários ---------- */
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.error { font-size: .85rem; color: var(--danger); margin-top: 4px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-check span {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; justify-content: center;
  padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); cursor: pointer;
}
.chip-check input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-check input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.seg .chip-check span { width: 100%; }

/* ---------- Faixa ---------- */
.belt { display: inline-flex; align-items: center; gap: 10px; }
.belt-bar {
  position: relative; width: 120px; height: 22px; border-radius: 4px;
  border: 1px solid rgba(127,127,127,.5); overflow: hidden;
}
.belt-tip {
  position: absolute; top: 0; bottom: 0; right: 12px; width: 40px;
  display: flex; gap: 3px; align-items: stretch; justify-content: center; padding: 0 4px;
}
.belt-tip i { width: 4px; background: #f2f2f2; }
.belt-label { font-weight: 700; }

/* ---------- Progresso / armazenamento ---------- */
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--primary); }
.meter.warn > span { background: var(--danger); }

.phase-track { display: grid; grid-template-columns: 2fr 6fr 8fr 8fr; gap: 4px; margin: 10px 0 6px; }
.phase-track div { height: 8px; border-radius: 4px; background: var(--surface-2); }
.phase-track div.done { background: var(--success); }
.phase-track div.now { background: var(--accent); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

/* ---------- Toast e modal ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-weight: 600; max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30;
}
.toast.show { opacity: 1; }
.modal {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 48px);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); padding: 20px;
}
.modal::backdrop { background: rgba(0,0,0,.6); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }

@media print {
  .topbar, .tabbar, .btn { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
}

/* ===== Etapa 2 — Diário, Jogo A, Hoje ===== */
.subtabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.subtabs a { display: grid; place-items: center; min-height: 44px; border-radius: 9px; color: var(--muted);
  text-decoration: none; font-weight: 600; font-size: .9rem; }
.subtabs a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.row-link { display: block; color: inherit; text-decoration: none; padding: 2px 0; }
.list.card { padding-top: 4px; padding-bottom: 4px; }
.back { display: inline-block; margin-bottom: 10px; min-height: 44px; line-height: 44px; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--success); }
.pill.ok { background: color-mix(in srgb, var(--success) 22%, transparent); color: var(--success); }
.nowrap { flex-wrap: nowrap; }
.nowrap input { flex: 1; min-width: 0; }
.w-num { width: 90px; flex: 0 0 auto; }
.small-btn { min-height: 44px; padding: 6px 12px; font-size: .85rem; }
.tag { min-height: 36px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.roll { border-left: 4px solid var(--primary); }
.roll h3 { margin: 0; }
.lines-title { margin: 6px 0 4px; font-size: .95rem; }
.line { margin-bottom: 12px; }
.line input + input { margin-top: 6px; }
.line-title { font-weight: 600; font-size: .9rem; margin: 0 0 4px; }
.label-like { display: block; font-weight: 600; font-size: .9rem; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 5; margin-top: 12px; }
.sticky-actions .btn { box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.filters .chip-check span { width: 100%; }

.hbars { list-style: none; padding: 0; margin: 0; }
.hbars li { margin-bottom: 10px; }
.hbars .meter { height: 8px; margin-top: 3px; }

.heatmap { width: 100%; height: auto; display: block; margin: 8px 0; }
.hm-label { font-size: 9px; fill: var(--muted); }
.hm-0 { fill: var(--surface-2); background: var(--surface-2); }
.hm-1 { fill: color-mix(in srgb, var(--primary) 35%, var(--surface-2)); background: color-mix(in srgb, var(--primary) 35%, var(--surface-2)); }
.hm-2 { fill: color-mix(in srgb, var(--primary) 60%, var(--surface-2)); background: color-mix(in srgb, var(--primary) 60%, var(--surface-2)); }
.hm-3 { fill: color-mix(in srgb, var(--primary) 82%, var(--surface-2)); background: color-mix(in srgb, var(--primary) 82%, var(--surface-2)); }
.hm-4 { fill: var(--primary); background: var(--primary); }
.hm-legend { gap: 4px; }
.hm-sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }

.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; font-weight: 600; border: 1px solid; }
.alert.info { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.alert.warn { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.alert.danger { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.focus { border-left: 4px solid var(--accent); }
.focus-goal { font-size: 1.1rem; font-weight: 700; }
.quick .btn:first-child { grid-column: 1 / -1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.stats strong { display: block; font-size: 1.2rem; }
.stats span { font-size: .75rem; color: var(--muted); }
.mini-chart { width: 100%; height: auto; display: block; }
.mini-chart .bar { fill: var(--primary); }
.mini-chart .axis { stroke: var(--border); stroke-width: 1; }
.mini-chart .bar-label { font-size: 10px; fill: var(--text); }
.mini-chart .axis-label { font-size: 9px; fill: var(--muted); }

.slot details > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; min-height: 44px; }
.slot details > summary::-webkit-details-marker { display: none; }
.slot details > summary::after { content: '▾'; justify-self: end; margin-top: -24px; color: var(--muted); }
.slot details[open] > summary::after { content: '▴'; }
.slot-name { font-size: 1.1rem; font-weight: 700; }
.slot-form { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.branch { display: grid; gap: 6px; margin-bottom: 10px; }
.q-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 1rem; }
.q-check input { width: 22px; min-height: 22px; height: 22px; margin-top: 2px; flex: 0 0 auto; }
.q-check input:checked + span { color: var(--muted); text-decoration: line-through; }
.q-answer { margin: 6px 0 0 32px; color: var(--muted); }
.q-actions { margin: 6px 0 0 32px; gap: 8px; }
.mini-chart, .heatmap { stroke: none; stroke-width: 0; }
.mini-chart .axis { stroke: var(--border); stroke-width: 1; }

/* ===== Presença ===== */
.presence-stats { grid-template-columns: repeat(4, 1fr); }
.presence-stats:nth-of-type(2) { grid-template-columns: 1fr 1fr; }
.hbars li.planned strong { color: var(--text); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 10px; text-align: center; }
.cal-head { font-size: .75rem; color: var(--muted); padding: 4px 0; }
.cal-cell { display: grid; place-items: center; min-height: 44px; border-radius: 10px; color: var(--text);
  text-decoration: none; background: var(--surface-2); font-size: .9rem; }
.cal-cell.empty { background: transparent; }
.cal-cell.present { background: var(--primary); color: #fff; font-weight: 700; }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell.future { opacity: .35; }
.icon-btn { font-size: 1.6rem; text-decoration: none; }
.cal-title { text-align: center; line-height: 1.2; }
.cal-title h3 { margin: 0; text-transform: capitalize; }

/* ===== Etapa 3 — Estudo ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.subtabs.four { grid-template-columns: repeat(4, 1fr); }
.subtabs.four a { font-size: .8rem; }
.subtabs.scroll { display: flex; overflow-x: auto; scrollbar-width: none; }
.subtabs.scroll a { flex: 0 0 auto; padding: 0 12px; }
.banner { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin-bottom: 12px; }
.banner.warn { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); border: 1px solid var(--accent); }
.accent-text { color: var(--accent); }

.trail { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 8px; scroll-snap-type: x proximity; }
.trail-step { flex: 0 0 auto; scroll-snap-align: center; display: grid; justify-items: center; gap: 4px; min-width: 84px; min-height: 44px;
  padding: 10px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.trail-step .belt-bar { width: 64px; height: 14px; }
.trail-step .belt-tip { width: 24px; right: 6px; gap: 2px; padding: 0 2px; }
.trail-step .belt-tip i { width: 3px; }
.trail-step.sel { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.trail-step.cur .trail-pct { color: var(--accent); font-weight: 700; }
.trail-step.locked { opacity: .5; }
.trail-label { font-weight: 700; font-size: .85rem; }
.trail-pct { font-size: .75rem; color: var(--muted); }
.big-pct { font-size: 1.6rem; color: var(--link); }

.cur-item { display: grid; gap: 8px; }
.cur-item.is-hidden { opacity: .55; }
.cur-main { display: grid; gap: 2px; }
.cur-name { font-weight: 700; color: var(--text); text-decoration: none; }
.cur-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.status-select { font-weight: 600; }
.status-select.st-aprendi, .pill.st-aprendi { border-color: #7aa5ff; color: #7aa5ff; }
.status-select.st-treinando, .pill.st-treinando { border-color: var(--accent); color: var(--accent); }
.status-select.st-funciona, .pill.st-funciona, .status-select.st-domino, .pill.st-domino { border-color: var(--success); color: var(--success); }
:root[data-theme="light"] .status-select.st-aprendi, :root[data-theme="light"] .pill.st-aprendi { border-color: var(--link); color: var(--link); }
.bulk-list { display: grid; gap: 10px; max-height: 45vh; overflow: auto; padding: 4px; }

.link-list { list-style: none; padding: 0; margin: 0 0 10px; }
.link-list li { padding: 6px 0; }
.link-list a { display: inline-block; min-height: 32px; }
.links-grid h3 { font-size: .95rem; }
.errors li::marker { content: '✕  '; color: var(--danger); }
.tree { list-style: none; padding-left: 14px; margin: 6px 0; border-left: 2px solid var(--border); }
.tree li { padding: 6px 0; }
.tree summary { cursor: pointer; min-height: 32px; }
.map-center { border: 2px solid var(--primary); text-align: center; }
.map-center h3 { margin: 0; }

.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; flex: 0 0 auto; letter-spacing: .02em; }
.athlete-row { display: flex; gap: 12px; align-items: center; }
.athlete-info { display: grid; gap: 2px; }
.athlete-info .pill { justify-self: start; }
.athlete-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.fav { font-size: 1.6rem; color: var(--muted); }
.fav.on { color: var(--accent); }
.highlights li { margin-bottom: 8px; }

.review-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.review-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.review-actions .btn { padding: 8px 6px; font-size: .9rem; }

.report-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.report-table td { padding: 6px 4px; border-bottom: 1px solid var(--border); }
.report-table td:last-child { text-align: right; font-weight: 700; }
@media print {
  .no-print { display: none !important; }
  .report { border: 0; }
  .report, .report * { color: #000 !important; background: #fff !important; }
}

/* ---------- Etapa 4: Videoteca ---------- */
.group-title { font-size: 1rem; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.group-title .count { font-size: .75rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.vcard { display: grid; gap: 4px; color: var(--text); text-decoration: none; min-width: 0; }
.vthumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb-ph { display: grid; place-items: center; height: 100%; font-size: 1.6rem; color: var(--muted); }
.vbadge { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.75); color: #fff; font-size: .72rem;
  padding: 1px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.vbadge.vlink { left: 6px; right: auto; }
.vtitle { font-weight: 600; font-size: .9rem; line-height: 1.25; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vmeta { font-size: .78rem; color: var(--muted); }
.vcard:focus-visible .vthumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.video-of-day .vgrid, .video-of-day .vcard { max-width: 260px; }

.player { padding: 12px; }
.player-wrap { background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.player-wrap video { display: block; width: 100%; max-height: 60vh; background: #000; }
.player-wrap.mirrored video { transform: scaleX(-1); }
.player-wrap:fullscreen { display: grid; place-items: center; border-radius: 0; }
.player-wrap:fullscreen video { max-height: 100vh; height: 100%; }
#pl-seek { width: 100%; min-height: 32px; accent-color: var(--primary); padding: 0; border: 0; background: none; }
.pl-controls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.pl-controls .btn, .pl-loop .btn { padding: 8px 4px; font-variant-numeric: tabular-nums; }
.speeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.speeds .chip-check span { justify-content: center; width: 100%; }
.pl-loop { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.embed-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 8px; }
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.markers .marker { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.marker-note { overflow-wrap: anywhere; }
.markers .icon-btn { font-size: 1.3rem; min-width: 44px; min-height: 44px; }

.picked { list-style: none; padding: 0; margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; }
.chip-tag button { border: 0; background: none; color: var(--muted); font-size: 1.15rem; min-width: 32px; min-height: 32px; cursor: pointer; }
.video-pick summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; }

/* ---------- Etapa 5: Físico ---------- */
.warn-text { color: var(--accent); font-weight: 600; }
.pill.warn { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.center { text-align: center; }
.set-head, .set-row { display: grid; grid-template-columns: 22px 1fr 1fr 1fr 48px; gap: 6px; align-items: center; }
.set-head { margin-bottom: 4px; }
.set-head span:last-child { text-align: center; }
.set-row { margin-bottom: 6px; }
.set-row input, .set-row select { min-width: 0; width: 100%; padding: 8px 6px; text-align: center; }
.set-n { color: var(--muted); font-weight: 700; text-align: center; }
.set-done { position: relative; display: block; }
.set-done input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.set-done span { display: grid; place-items: center; min-height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--muted); font-weight: 800; cursor: pointer; }
.set-done input:checked + span { background: var(--success); border-color: var(--success); color: var(--bg); }
.set-done input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.set-row:has(input[name=done]:checked) input, .set-row:has(input[name=done]:checked) select { opacity: .75; }
.rest-bar { position: fixed; left: 50%; transform: translateX(-50%); z-index: 20;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); width: min(608px, calc(100% - 24px));
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--primary); border-radius: 12px; padding: 8px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.rest-bar[hidden] { display: none; }
.rest-bar strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.rest-bar.over { border-color: var(--success); }
.rest-bar.over strong { color: var(--success); }
.rest-bar select { width: auto; padding: 6px; }
#f-str { padding-bottom: 72px; }

.timer-card { text-align: center; }
.timer-phase { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 2px; }
.timer-phase.prep { color: var(--accent); }
.timer-phase.hold { color: var(--success); }
.timer-name { font-size: 1.3rem; font-weight: 800; margin: 0 0 4px; min-height: 2.6em; display: grid; place-items: center; }
.timer-clock { font-size: 4.5rem; font-weight: 800; line-height: 1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.timer-cue { min-height: 2.6em; }
.timer-controls { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 8px; margin-top: 12px; }
.timer-controls[hidden], #tm-start[hidden], #tm-stop[hidden] { display: none; }
.step-list li { padding: 3px 0; }
.step-list li.now { font-weight: 800; color: var(--text); }
.line-chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 1.5; }
.line-chart .goal { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }

/* Acessibilidade */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--primary); color: var(--primary-text);
  padding: 10px 14px; border-radius: 10px; text-decoration: none; font-weight: 700; }
.skip-link:focus { top: 8px; }
#view:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Trilha de graus da faixa (Hoje e introdução) */
.belt-trail { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.bt-step { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; padding: 8px 1px; border-radius: 10px; min-width: 0; }
.bt-step .belt-bar { width: 100%; max-width: 48px; min-width: 36px; height: 12px; border-radius: 3px; }
.bt-step .belt { display: flex; width: 100%; justify-content: center; }
.bt-step .belt-tip { width: 18px; right: 3px; gap: 2px; padding: 0 2px; }
.bt-step .belt-tip i { width: 2px; }
.bt-name { font-size: .78rem; font-weight: 700; line-height: 1.15; }
.bt-sub { font-size: .68rem; color: var(--muted); min-height: 1em; line-height: 1.15; }
.bt-step.current { background: color-mix(in srgb, var(--accent) 16%, transparent); outline: 2px solid var(--accent); }
.bt-step.current .bt-sub { color: var(--accent); font-weight: 700; }
.bt-step.next .bt-sub { color: var(--link); font-weight: 600; }
.bt-step.future .belt, .bt-step.next .belt { opacity: .45; }
.bt-step.future .bt-name { color: var(--muted); font-weight: 500; }

/* Introdução ao abrir */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--primary) 28%, var(--bg)), var(--bg) 70%);
  animation: intro-in .35s ease-out; cursor: pointer; }
.intro.out { opacity: 0; transition: opacity .35s; pointer-events: none; }
.intro-inner { width: 100%; max-width: 420px; text-align: center; }
.intro-brand { letter-spacing: .3em; font-weight: 800; font-size: .85rem; color: var(--muted); margin: 0 0 18px; }
.intro-hello { font-size: 1.1rem; margin: 0 0 18px; }
.intro-belt { display: grid; place-items: center; margin: 0 0 14px; }
.intro-belt .belt-bar { width: min(300px, 80vw); height: 44px; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.intro-belt .belt-tip { width: 90px; right: 26px; gap: 7px; padding: 0 9px; }
.intro-belt .belt-tip i { width: 8px; transform: scaleY(0); transform-origin: top; animation: stripe-in .3s ease-out forwards; }
.intro-belt .belt-tip i:nth-child(1) { animation-delay: .45s; }
.intro-belt .belt-tip i:nth-child(2) { animation-delay: .7s; }
.intro-belt .belt-tip i:nth-child(3) { animation-delay: .95s; }
.intro-belt .belt-tip i:nth-child(4) { animation-delay: 1.2s; }
.intro-title { font-size: 1.5rem; margin: 0 0 4px; }
.intro-next { color: var(--muted); margin: 0 0 6px; }
.intro .belt-trail { background: color-mix(in srgb, var(--surface) 80%, transparent); border-radius: var(--radius); padding: 6px; }
.intro-skip { font-size: .8rem; color: var(--muted); margin-top: 22px; }
@keyframes intro-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes stripe-in { to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .intro-belt .belt-tip i { transform: none; animation: none; } }

/* Alongamento pela dor */
.pain-card { border-left: 4px solid var(--accent); }
.pain-row + .pain-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.card.pain-match { outline: 2px solid var(--accent); }

/* Tela cheia "por CSS" (iPhone): o player cobre a tela com todos os controles */
.player.pseudo-full { position: fixed; inset: 0; z-index: 150; margin: 0; display: flex; flex-direction: column; justify-content: center; border-radius: 0; border: 0; overflow-y: auto;
  background: #000; padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 8px)
  calc(env(safe-area-inset-bottom) + 8px) calc(env(safe-area-inset-left) + 8px); }
.player.pseudo-full .player-wrap { border-radius: 0; }
.player.pseudo-full .player-wrap video { max-height: calc(100dvh - 190px); height: auto; }
@media (orientation: landscape) { .player.pseudo-full .player-wrap video { max-height: calc(100dvh - 120px); } }
body.no-scroll { overflow: hidden; }
