/* Identidade RXNL: azul #3b8cff sobre quase-preto #04060b, títulos em Space Grotesk */
:root {
  --bg: #f3f6fc;
  --surface: #ffffff;
  --surface-2: #e9eef8;
  --text: #0b1222;
  --muted: #56627a;
  --border: #d5ddeb;
  --accent: #1d5fe0;
  --accent-ink: #ffffff;
  --accent-soft: #e1ebff;
  --ok: #138a4b;
  --bad: #c93838;
  --warn: #b26a00;
  --c1: #1d5fe0;
  --c2: #d98200;
  --c3: #7c88a0;
  --grid: #e2e8f3;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11,18,34,.05), 0 6px 20px rgba(11,18,34,.05);
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #04060b;
    --surface: #0b101b;
    --surface-2: #121a2a;
    --text: #eaf0fb;
    --muted: #8e9ab3;
    --border: #1b2539;
    --accent: #3b8cff;
    --accent-ink: #ffffff;
    --accent-soft: rgba(59,140,255,.14);
    --ok: #3ccf7c;
    --bad: #ff6b6b;
    --warn: #f5a524;
    --c1: #3b8cff;
    --c2: #f5a524;
    --c3: #5d6882;
    --grid: #141c2b;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #04060b; --surface: #0b101b; --surface-2: #121a2a; --text: #eaf0fb; --muted: #8e9ab3;
  --border: #1b2539; --accent: #3b8cff; --accent-ink: #ffffff; --accent-soft: rgba(59,140,255,.14);
  --ok: #3ccf7c; --bad: #ff6b6b; --warn: #f5a524; --c1: #3b8cff; --c2: #f5a524; --c3: #5d6882; --grid: #141c2b;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; font-family: var(--display); letter-spacing: -.02em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- topo e navegação ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; }
.logo { width: 30px; height: 30px; display: block; }
/* marca no estilo do logotipo RXNL: fonte larga e pesada, tudo em maiúsculas */
.wordmark { font-family: Unbounded, var(--display); font-weight: 800; font-size: 1rem; letter-spacing: .01em; white-space: nowrap; }
.wordmark span { color: var(--accent); }
@media (max-width: 520px) { .hide-sm { display: none; } .wordmark { font-size: .86rem; } }

/* ícones de linha */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.btn .ico { width: 18px; height: 18px; }
.big-ico { width: 44px; height: 44px; color: var(--muted); display: block; margin: 0 auto 8px; }
.placeholder .big-ico { color: #cfd4dc; }

.rxnl-footer {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 0 8px; color: var(--muted); font-size: .8rem; letter-spacing: .02em;
}
.rxnl-footer .sig { display: flex; align-items: center; gap: 10px; }
.rxnl-footer .legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.rxnl-footer .legal a, .linklike { color: var(--muted); text-decoration: none; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.rxnl-footer .legal a:hover, .linklike:hover { color: var(--accent); text-decoration: underline; }
.rxnl-footer img { display: block; height: 14px; width: auto; opacity: .9; }
.rxnl-footer .on-light { display: none; }
@media (prefers-color-scheme: light) {
  .rxnl-footer .on-dark { display: none; }
  .rxnl-footer .on-light { display: block; }
}

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  background: none; border: 0; color: var(--muted); font: inherit; font-size: .78rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; cursor: pointer;
}
.tabbar button .ico { width: 22px; height: 22px; opacity: .75; }
.tabbar button.active { color: var(--accent); font-weight: 600; }
.tabbar button.active span { filter: none; opacity: 1; }

main { max-width: 1080px; margin: 0 auto; padding: 16px; }
.view { display: none; }
.view.active { display: block; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

/* ---------- componentes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0;
}
.card.flat { box-shadow: none; background: var(--surface-2); border-color: transparent; }

label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); margin-bottom: 10px; min-width: 0; }
label.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 10px; width: 100%; min-width: 0;
}
label.inline input, label.inline select { width: auto; }
label.inline input[type=number] { width: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: .8rem; }
.btn.icon { padding: 6px 10px; }
.btn.block { width: 100%; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.file-btn { margin: 0; color: var(--text); flex-direction: row; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions.end { justify-content: flex-end; }

.seg { border: 0; padding: 0; margin: 0 0 10px; display: flex; gap: 8px; }
.seg legend { font-size: .82rem; color: var(--muted); margin-bottom: 4px; padding: 0; }
.seg label { flex: 1; margin: 0; }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; padding: 9px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .9rem; font-weight: 600;
}
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- filmar ---------- */
.record-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 900px) { .record-grid { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.stage-card { padding: 10px; }
.stage {
  position: relative; background: #000; border-radius: 10px; overflow: hidden;
  min-height: 260px; display: grid; place-items: center;
}
.stage video { display: block; width: 100%; max-height: 62vh; object-fit: contain; }
.placeholder { color: #cfd4dc; text-align: center; padding: 24px; max-width: 360px; }
.placeholder p { margin: 0 0 14px; }
.rec-badge {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,.6); color: #fff;
  padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .85rem; display: flex; align-items: center; gap: 6px;
}
.rec-badge i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.count-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; color: #fff;
  font-size: 7rem; font-weight: 800; background: rgba(0,0,0,.35); text-shadow: 0 4px 20px rgba(0,0,0,.5);
}
#liveOverlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.live-angles {
  position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.6); color: #fff;
  padding: 6px 10px; border-radius: 10px; font-size: .82rem; line-height: 1.5; font-variant-numeric: tabular-nums;
}
.live-angles b { color: #ffd33d; }
.voice-heard { margin: 8px 2px 0; font-size: .85rem; color: var(--muted); }
.live-results { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.live-results .card-head h3 { margin: 0; }
.live-results .kpis { margin-bottom: 8px; }
.live-status { font-size: .8rem; color: var(--muted); }
.live-status.moving { color: var(--accent); font-weight: 700; }
label.check { cursor: pointer; color: var(--text); font-size: .88rem; }
label.check input { width: auto; accent-color: var(--accent); }
.feedback { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.feedback li { padding: 8px 10px; border-radius: 10px; background: var(--surface); border-left: 4px solid var(--c2); font-size: .88rem; }
.feedback li.warn { border-left-color: var(--accent); }
.feedback li.good { border-left-color: var(--ok); }
.stage-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 2px 2px; }
.btn.rec { background: var(--bad); border-color: var(--bad); color: #fff; min-width: 120px; }
.btn.rec .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.btn.rec.recording .dot { border-radius: 2px; }
.pending-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: .88rem;
}

.set-form h2 { margin-bottom: 12px; }
.today { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }

/* ---------- listas de séries ---------- */
.set-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.set-row:first-child { border-top: 0; }
.set-row .title { font-weight: 600; }
.set-row .sub { color: var(--muted); font-size: .82rem; }
.set-row .tools { display: flex; gap: 4px; }
.thumb {
  width: 56px; height: 42px; border-radius: 8px; border: 1px solid var(--border); padding: 0; overflow: hidden;
  background: var(--surface-2); color: var(--muted); cursor: pointer; position: relative; font-size: 1rem;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* triângulo de "play" desenhado em CSS (sem emoji) */
.thumb::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 16px; transform: translate(-40%, -50%); background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); filter: drop-shadow(0 1px 3px rgba(0,0,0,.8)); }
.thumb.none { cursor: default; }
.thumb.none::after { content: none; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.tag.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tag.fail { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.tag.an { background: color-mix(in srgb, var(--c2) 18%, transparent); color: var(--c2); }

.session header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.session header p { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.chip b { color: var(--accent); }
@media (max-width: 520px) { .session-meta { grid-template-columns: 1fr; } }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .big-ico { margin-bottom: 10px; }

/* ---------- evolução ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.kpi .k { font-size: .78rem; color: var(--muted); }
.kpi .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: .76rem; color: var(--muted); }
.charts { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 900px) { .charts { grid-template-columns: 1fr 1fr; } }
.chart svg { width: 100%; height: auto; display: block; }
.chart svg text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card-head select { width: auto; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.ratio { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.ratio:first-of-type { border-top: 0; }
.ratio .bar { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-2); position: relative; }
.ratio .bar .band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--ok) 30%, transparent); border-radius: 4px; }
.ratio .bar .mark { position: absolute; top: -3px; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); transform: translateX(-2px); }
.ratio .val { font-weight: 700; }

/* ---------- atletas ---------- */
.athletes-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 900px) { .athletes-grid { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- diálogos ---------- */
dialog {
  border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--surface); color: var(--text);
  width: min(980px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto;
}
#setDialog { width: min(460px, calc(100vw - 16px)); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.dlg-head h2 { margin: 0; }

.an-stage-wrap { display: flex; justify-content: center; background: #000; border-radius: 10px; overflow: hidden; }
.an-stage { position: relative; display: inline-block; line-height: 0; }
.an-stage video { display: block; max-width: 100%; max-height: 58vh; width: auto; height: auto; }
.an-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.an-stage canvas.picking { cursor: crosshair; }
#anSeek { padding: 0; margin: 10px 0 6px; accent-color: var(--accent); background: none; border: 0; }
.an-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.an-controls .sep { flex: 1; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; min-width: 64px; text-align: right; }
.an-track { padding: 12px; margin-bottom: 12px; }
.hint { margin: 8px 0 0; font-size: .86rem; color: var(--muted); }
.hint b { color: var(--accent); }

#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100vw - 32px); z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
  .kpi .v { font-size: 1.25rem; }
  .an-controls .sep { display: none; }
}

/* ---------- filmar: como funciona ---------- */
.actions.center { justify-content: center; }
.how .steps { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 8px; color: var(--muted); font-size: .9rem; }
.how .steps b { color: var(--text); }
.stage .placeholder .file-btn { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.2); }

/* ---------- revisão do treino ---------- */
#reviewDialog { width: min(1040px, calc(100vw - 16px)); }
.rv-progress { padding: 24px 8px; text-align: center; }
.rv-progress .bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 12px auto; max-width: 480px; }
.rv-progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.rv-player { background: #000; border-radius: 12px; overflow: hidden; display: flex; justify-content: center; }
.rv-player video { display: block; max-width: 100%; max-height: 42vh; }
.rv-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0; }
.rv-item {
  display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 12px; margin-bottom: 10px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.rv-item.removed { opacity: .45; }
.rv-item .thumb { width: 88px; height: 66px; }
.rv-item .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rv-item .head b { font-family: var(--display); }
.rv-fields { display: grid; grid-template-columns: 1.4fr .8fr 1fr; gap: 8px; }
.rv-fields label { margin: 0; }
.rv-fields .seg { margin: 0; align-self: end; }
.rv-fields .seg span { padding: 8px 6px; font-size: .82rem; }
.rv-src { font-size: .76rem; color: var(--muted); margin-top: 3px; }
.rv-src.alta { color: var(--ok); }
.rv-src.baixa, .rv-src.nenhuma { color: var(--warn); }
.rv-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rv-foot { position: sticky; bottom: -16px; background: var(--surface); padding: 12px 0 4px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .rv-item { grid-template-columns: 1fr; }
  .rv-item .thumb { width: 100%; height: 120px; }
  .rv-fields { grid-template-columns: 1fr 1fr; }
  .rv-fields .seg { grid-column: 1 / -1; }
}

/* ---------- erros apontados ---------- */
.tag.err { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.errors { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.errors li { font-size: .84rem; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 10%, transparent); border-left: 3px solid var(--warn); display: flex; justify-content: space-between; gap: 8px; }
.errors li button { background: none; border: 0; color: var(--muted); cursor: pointer; }

/* ---------- instalar no celular / aceite ---------- */
#installDialog, #consentDialog { width: min(640px, calc(100vw - 16px)); }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.install-grid .card { margin: 0; padding: 14px; }
.install-grid .steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: .9rem; }
@media (max-width: 560px) { .install-grid { grid-template-columns: 1fr; } }
.check-row { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); font-size: .9rem; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 10px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.check-row.highlight { border-color: var(--accent); background: var(--accent-soft); }
.check-row a { color: var(--accent); }
.rv-item .head .btn .ico, .tools .ico { width: 16px; height: 16px; }
/* ---------- páginas de termos e privacidade ---------- */
.doc-page { padding-bottom: 0; }
.doc-page .brand { text-decoration: none; color: var(--text); }
.legal-doc { max-width: 780px; margin: 0 auto; padding: 24px 16px 32px; line-height: 1.6; }
.legal-doc .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--accent); margin: 0 0 6px; font-weight: 600; }
.legal-doc h1 { font-size: 1.9rem; margin-bottom: 4px; }
.legal-doc h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.legal-doc .updated { color: var(--muted); font-size: .85rem; margin-top: 0; }
.legal-doc .callout { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 14px; padding: 14px 16px; margin: 16px 0; }
.legal-doc .toc { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; font-size: .9rem; }
.legal-doc .toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2; }
@media (max-width: 560px) { .legal-doc .toc ol { columns: 1; } }
.legal-doc a { color: var(--accent); }
.legal-doc .btn { color: var(--text); text-decoration: none; }
.doc-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .9rem; }
.doc-table th, .doc-table td { white-space: normal; vertical-align: top; text-align: left; padding: 8px; border-bottom: 1px solid var(--border); }
.legal-doc h2 { scroll-margin-top: 76px; }

/* ---------- marca, convite de conta, configurações ---------- */
.wordmark-img { height: 26px; width: auto; display: block; }
.topbar .on-light { display: none; }
@media (prefers-color-scheme: light) { .topbar .on-dark { display: none; } .topbar .on-light { display: block; } }
@media (max-width: 400px) { .wordmark-img { height: 22px; } }
.stage-title { color: #fff; font-size: 1.35rem; margin: 0 0 8px; }
.stage-controls .btn.block { width: 100%; justify-content: center; padding: 14px; font-size: 1.05rem; }
.legal-note { margin-top: 16px; }
.legal-note a { color: var(--muted); }
.nudge, .import-notice { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-color: var(--accent); background: var(--accent-soft); }
.nudge p, .import-notice p { margin: 4px 0 0; }
.import-notice { display: block; }
.settings h3 { margin: 16px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.settings h3:first-of-type { margin-top: 4px; }
.settings label.inline { margin: 0 0 10px; }
.settings label.check { display: flex; }
.acct-tabs { margin: 10px 0 12px; }
.acct-tabs span { font-size: .8rem; padding: 8px 4px; }
@media (max-width: 640px) { .session-meta { grid-template-columns: 1fr; } }
.rv-meta select { width: auto; max-width: 60vw; }
#rvPlaceText { width: auto; flex: 1; min-width: 160px; }

/* ---------- janelas no celular: cabeçalho (com o botão de fechar) sempre visível ---------- */
dialog { max-height: calc(100dvh - 16px); }
dialog > .dlg-head, dialog form > .dlg-head {
  position: sticky; top: -16px; z-index: 5; margin: -16px -16px 10px; padding: 12px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  dialog {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  }
  dialog > .dlg-head, dialog form > .dlg-head { margin: -16px -12px 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  .an-stage video { max-height: 52dvh; }
  /* janelas curtas (aceite, altura e peso, editar série) continuam como cartão */
  #startDialog, #consentDialog, #setDialog { height: auto; max-height: 100dvh; }
}

/* ---------- recortar vídeo ---------- */
.trim-bar { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent-soft); }
.trim-bar p { margin: 0 0 8px; }
.trim-bar .actions + .actions { margin-top: 8px; }
.trim-bar .time { min-width: 56px; text-align: left; color: var(--text); font-weight: 600; }
.trim-final { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.trim-final p { margin: 0 0 8px; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.danger:disabled { opacity: .4; }

/* Análise errada? */
.fb-form { display: grid; gap: 12px; padding: 4px 0; }
.fb-reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.fb-reasons .check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.fb-reasons .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fb-form textarea, .fb-form select { width: 100%; }
.fb-form label { display: grid; gap: 6px; }
.fb-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-form .actions { justify-content: flex-end; }
.fb-note { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--surface-2); border-radius: 6px; }

/* Guia: como filmar */
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; }
.guide-num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font: 700 1.2rem 'Space Grotesk', Inter, sans-serif; color: var(--accent-ink); background: var(--accent); }
.guide-body h2, .guide-check h2, .guide-errors h2 { font-size: 1.12rem; margin: 6px 0 10px; }
.guide-body p { margin: 0 0 10px; }
.guide-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 12px; }
.guide-fig { margin: 0; }
.guide-fig svg { width: 100%; height: auto; display: block; }
.guide-fig figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.guide-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.guide-list li::marker { color: var(--accent); }
.g-bg { fill: var(--surface-2); stroke: var(--border); }
.g-plat { fill: none; stroke: var(--border); stroke-width: 2; stroke-dasharray: 4 4; }
.g-bar { stroke: var(--text); stroke-width: 4; stroke-linecap: round; }
.g-plate { fill: var(--accent); }
.g-athlete { fill: var(--surface); stroke: var(--text); stroke-width: 3; }
.g-dash { stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 7 6; fill: none; }
.g-face { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.g-right { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.g-cam { fill: var(--accent); stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.g-txt { font: 700 14px 'Space Grotesk', Inter, sans-serif; fill: var(--text); }
.g-cap { font: 500 11px Inter, sans-serif; fill: var(--muted); }
.g-frame { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.g-floor { stroke: var(--muted); stroke-width: 2; }
.g-plate-side { fill: none; stroke: var(--accent); stroke-width: 4; }
.g-body { fill: none; stroke: var(--text); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.g-dim { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.guide-check, .guide-errors { margin-top: 14px; }
.guide-check ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.guide-check li { position: relative; padding: 10px 12px 10px 38px; border: 1px solid var(--border); border-radius: 10px; }
.guide-check li::before { content: ''; position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 5px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5L20 7' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.guide-cta { display: flex; justify-content: center; margin: 20px 0 8px; }
@media (max-width: 640px) {
  .guide-step { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .guide-figs { grid-template-columns: minmax(0, 1fr); }
}

/* Aviso de versão beta */
.beta-note { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); font-size: .9rem; }
.beta-note p { margin: 0; flex: 1; }
.beta-note .btn { flex: none; }
.beta-line { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
@media (max-width: 640px) { .beta-note { flex-direction: column; align-items: stretch; } }

/* Envio de vídeo em segundo plano */
.import-quota { margin: -4px 0 10px; }
.import-job { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; border-left: 3px solid var(--accent); }
.import-job.done { border-left-color: var(--ok); }
.import-job.empty, .import-job.error { border-left-color: var(--warn); }
.import-job .job-status { margin: 4px 0 0; color: var(--muted); }

/* Vídeo do treino e posts das repetições */
.yt-preview { width: 100%; max-height: 60vh; background: #000; border-radius: 12px; margin: 8px 0; }
.yt-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.sticker-preview { border-radius: 12px; padding: 16px; background: repeating-conic-gradient(#3a3f4a 0% 25%, #2a2e37 0% 50%) 50% / 20px 20px; }
.sticker-preview img { display: block; width: 100%; height: auto; }

/* Cortes, recortes no celular */
.job-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.cut-video { width: 100%; max-height: 45vh; background: #000; border-radius: 12px; margin: 8px 0; }
.cut-list, .export-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cut-list li, .export-list li { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.cut-list li.skip { opacity: .5; }
.cut-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cut-nudge { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--muted); }
.export-list li b { word-break: break-all; }
.sticker-steps { margin: 12px 0 6px; padding-left: 20px; display: grid; gap: 4px; font-size: .9rem; }

/* Player simples e "a análise está correta?" */
.an-controls { justify-content: center; }
.an-controls #anPlay { min-width: 72px; }
.an-verify { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.an-verify p { margin: 0 0 6px; }
.chip-btn.active, .seg-btns .btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.an-redo { padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); }
.an-redo .actions { margin-top: 8px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* Perfil recolhido e campo de data dentro da coluna */
.profile-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-summary h2 { margin: 0 0 4px; }
.profile-summary p { margin: 0; }
#athleteForm input[type="date"] { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; text-align: left; }
#athleteForm input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.row2 > label { min-width: 0; }
.profile-sub { font-size: 1rem; margin: 14px 0 6px; }

/* Medidas com histórico */
.measure-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.measure-list li { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 12px; padding: 6px 4px 6px 10px; border-bottom: 1px solid var(--border); font-size: .88rem; }
.measure-list li b { font-weight: 600; text-align: right; min-width: 56px; }

/* Compartilhar: Vídeo + Figurinha | Apenas Figurinha */
.share-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.share-split .btn { padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.share-split .btn { justify-content: center; width: 100%; }

/* Dados da série no fim da tela da série */
.an-setdata { margin-top: 12px; }
.an-setdata h3 { margin: 0 0 10px; }
#editSetForm.embedded .dlg-head, #editSetForm.embedded [value="cancel"] { display: none; }
.set-form-actions { display: flex; align-items: center; gap: 8px; }
.set-form-actions .sep { flex: 1; }
.set-row[data-act="play"] { cursor: pointer; }

/* Linha única: play/pause · linha do tempo · tempo · compartilhar */
.an-controls { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; justify-content: stretch; margin-top: 8px; }
.an-controls #anPlay { min-width: 0; width: 44px; height: 44px; flex: none; }
.an-controls #anSeek { flex: 1; min-width: 0; margin: 0; }
.an-controls .time { flex: none; font-size: .85rem; min-width: 52px; text-align: right; }
.an-controls #anShareMenu { flex: none; width: 44px; height: 44px; }
.an-controls #anShareMenu[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.share-pop { margin-top: 8px; padding: 10px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); }
.an-controls #anWrong { flex: none; width: 44px; height: 44px; }
.an-controls { gap: 8px; }

/* Ícone de informação nos títulos */
.label-row { display: inline-flex; align-items: center; gap: 6px; }
.info-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent); cursor: pointer; }
.info-btn .ico { width: 18px; height: 18px; }
.info-dialog { max-width: 460px; }
.info-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; font-size: .9rem; }
.info-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.info-table td:first-child { font-weight: 700; white-space: nowrap; color: var(--accent); width: 1%; }

/* Formato do vídeo do treino */
.fmt-options { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 8px 0; }
.fmt-btn { display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.fmt-btn:hover, .fmt-btn:focus-visible { border-color: var(--accent); }
.fmt-btn small { color: var(--muted); font-size: .78rem; }
.fmt-shape { display: block; border: 2px solid var(--accent); border-radius: 4px; }
.fmt-shape.h { width: 56px; height: 32px; }
.fmt-shape.v { width: 26px; height: 46px; }
.yt-preview.vertical { max-height: 70vh; width: auto; max-width: 100%; display: block; margin: 8px auto; }

/* Aviso fixo de instalação */
.install-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); font-size: .88rem; }
.install-banner p { margin: 0; flex: 1; }
.install-banner .btn { flex: none; }

/* NPS e indicação */
.nps-dialog { max-width: 520px; }
.nps-scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; margin: 10px 0 4px; }
.nps-btn { padding: 10px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); font: 600 .95rem Inter, sans-serif; cursor: pointer; }
.nps-btn.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.nps-legend { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-bottom: 10px; }
#npsFollow label { display: grid; gap: 6px; margin-bottom: 10px; }

/* Versão no lado direito do cabeçalho */
.topbar .version-tag { margin-left: auto; font: 700 .68rem/1 Inter, sans-serif; letter-spacing: .12em; padding: 6px 10px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); white-space: nowrap; }

/* RXNL fixo abaixo do menu de baixo */
.tabbar { display: flex; flex-wrap: wrap; }
.tabbar > button { flex: 1 1 15%; min-width: 0; }
.tabbar-sig { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 2px 0 6px; font-size: .66rem; color: var(--muted); letter-spacing: .02em; }
.tabbar-sig img { height: 11px; width: auto; display: block; }
.tabbar-sig .on-light { display: none; }
@media (prefers-color-scheme: light) { .tabbar-sig .on-dark { display: none; } .tabbar-sig .on-light { display: block; } }
main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* Filmar: celular empilhado (vídeo, feedback, séries); computador em 3 colunas (feedback | vídeo | séries) */
.record-grid { grid-template-areas: "video" "feedback" "series"; gap: 16px; }
.record-grid .stage-card { grid-area: video; }
.record-grid .feedback-col { grid-area: feedback; }
.record-grid .series-col { grid-area: series; }
.feedback-col h2, .series-col h2 { margin-top: 0; }
.feedback-col .live-results:not([hidden]) ~ .feedback-empty, .feedback-col:has(.live-results:not([hidden])) .feedback-empty { display: none; }
@media (min-width: 1100px) {
  main:has(#view-record.active) { max-width: 1680px; }
  .record-grid { grid-template-columns: minmax(260px, 1fr) minmax(0, 2.4fr) minmax(280px, 1fr); grid-template-areas: "feedback video series"; align-items: start; }
  .record-grid .stage-card .stage { min-height: 62vh; }
  .record-grid .feedback-col, .record-grid .series-col { position: sticky; top: 76px; max-height: calc(100vh - 200px); overflow: auto; }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .record-grid { grid-template-columns: 1.5fr 1fr; grid-template-areas: "video series" "feedback series"; }
}
/* botão de gravar: branco para gravar, vermelho enquanto grava */
.btn.rec { background: #fff; border-color: #fff; color: #0b1222; }
.btn.rec .dot { background: var(--bad); }
.btn.rec.recording { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.rec.recording .dot { background: #fff; }

/* ---------- Modo gravação: tela cheia, borda e sinal ---------- */
.rec-signal, .rec-feed { display: none; }
body.rec-mode { overflow: hidden; }
body.rec-mode .topbar, body.rec-mode .tabbar, body.rec-mode .install-banner, body.rec-mode .beta-note,
body.rec-mode .feedback-col, body.rec-mode .series-col, body.rec-mode #liveAngles { display: none !important; }
body.rec-mode #stage {
  position: fixed; inset: 0; z-index: 60; border-radius: 0; min-height: 0; max-height: none;
  background: #000; touch-action: none;
}
body.rec-mode #stage video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
/* borda em toda a tela: vermelha gravando, verde pronto/registrando */
body.rec-mode #stage::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  border: 8px solid #ff3b30; transition: border-color .2s;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
body.rec-mode #stage[data-signal="ready"]::after, body.rec-mode #stage[data-signal="lift"]::after { border-color: #22c55e; }
body.rec-mode #stage[data-signal="ready"]::after { animation: readyPulse 1s ease-in-out infinite; }
@keyframes readyPulse { 50% { border-color: #86efac; } }
body.rec-mode .rec-badge { top: calc(18px + env(safe-area-inset-top)); left: 18px; z-index: 4; font-size: 1rem; }
body.rec-mode .rec-signal {
  display: flex; align-items: center; gap: 8px; position: absolute; z-index: 4;
  top: calc(16px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  padding: 8px 16px; border-radius: 999px; font: 800 .95rem/1 Inter, sans-serif; letter-spacing: .08em; color: #fff;
  background: #ff3b30; box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
body.rec-mode .rec-signal i { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
body.rec-mode .rec-signal[data-state="ready"], body.rec-mode .rec-signal[data-state="lift"] { background: #16a34a; }
body.rec-mode .rec-signal[data-state="ready"] { font-size: 1.15rem; padding: 10px 20px; }
/* feedback no rodapé: até 3 linhas que somem */
body.rec-mode .rec-feed {
  display: flex; flex-direction: column; gap: 4px; position: absolute; z-index: 4;
  left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); align-items: center; pointer-events: none;
}
.rec-line { max-width: 100%; padding: 6px 12px; border-radius: 10px; background: rgba(0,0,0,.62); color: #fff; font-size: .95rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .9s; }
.rec-line.ok { border-left: 4px solid #22c55e; }
.rec-line.fail { border-left: 4px solid #ff3b30; }
.rec-line.warn { border-left: 4px solid #ffd33d; font-weight: 500; }
.rec-line.fade { opacity: 0; }
/* botão de parar por cima da imagem */
body.rec-mode .stage-controls {
  position: fixed; z-index: 61; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 48px)); margin: 0;
}
body.rec-mode #voiceHeard, body.rec-mode #liveResults { display: none !important; }
body.rec-mode .rec-badge { display: none !important; }
body.rec-mode .rec-signal { white-space: nowrap; max-width: calc(100% - 32px); }
body.rec-mode .rec-signal[data-state="ready"] { font-size: 1.05rem; }
.rec-signal-time { font-variant-numeric: tabular-nums; opacity: .9; }
.rec-signal-time:not(:empty)::before { content: '·'; margin: 0 6px 0 2px; }

/* Topo da gravação: à esquerda (pequeno) GRAVANDO + 3 linhas de feedback; à direita SEGUIR / ESPERAR */
.rec-hud { display: none; }
body.rec-mode .rec-hud {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; position: absolute; z-index: 4;
  top: calc(18px + env(safe-area-inset-top)); left: 18px; max-width: calc(100% - 190px); pointer-events: none;
}
body.rec-mode .rec-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.6);
  color: #fff; font: 800 .74rem/1 Inter, sans-serif; letter-spacing: .08em; }
body.rec-mode .rec-status i { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; animation: blink 1s infinite; }
body.rec-mode .rec-status .rec-signal-time:not(:empty)::before { content: ''; margin: 0; }
body.rec-mode .rec-feed { position: static; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; left: auto; right: auto; bottom: auto; }
body.rec-mode .rec-line { font-size: .74rem; padding: 3px 8px; border-radius: 6px; max-width: 100%; }
body.rec-mode .rec-signal {
  left: auto; right: 18px; transform: none; top: calc(16px + env(safe-area-inset-top));
  padding: 12px 22px; font-size: 1.35rem; letter-spacing: .1em; border-radius: 14px;
}
body.rec-mode .rec-signal[data-state="ready"], body.rec-mode .rec-signal[data-state="lift"] { font-size: 1.35rem; padding: 12px 22px; }
body.rec-mode .rec-signal[data-state="ready"] { animation: readyPulseBg 1s ease-in-out infinite; }
@keyframes readyPulseBg { 50% { background: #22c55e; } }

/* fase amarela: GET READY */
body.rec-mode #stage[data-signal="getready"]::after { border-color: #facc15; }
body.rec-mode .rec-signal[data-state="getready"] { background: #facc15; color: #111; }

/* gravação: vídeo preenchendo a tela inteira (inclusive atrás das barras do navegador) */
body.rec-mode #stage { top: 0; left: 0; right: 0; bottom: auto; width: 100vw; height: 100vh; height: 100lvh; }
body.rec-mode #stage video { object-fit: cover; width: 100%; height: 100%; }
body.rec-mode #stage::after { border-width: 6px; }
body.rec-mode .rec-signal { padding: 9px 16px; font-size: 1.1rem; min-width: 0; }
body.rec-mode .rec-signal[data-state="ready"], body.rec-mode .rec-signal[data-state="lift"], body.rec-mode .rec-signal[data-state="getready"] { padding: 9px 16px; font-size: 1.1rem; }
body.rec-mode .rec-hud { max-width: calc(100% - 200px); }
body.rec-mode .rec-line { max-width: 100%; }
body.rec-mode .stage-controls { bottom: calc(28px + env(safe-area-inset-bottom)); }

/* exercícios da série na conferência dos cortes */
.cut-parts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cut-part { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.cut-part input { width: 46px; padding: 6px; text-align: center; }
.cut-part select { max-width: 170px; padding: 6px 28px 6px 8px; }
.cut-plus { color: var(--muted); font-weight: 700; }

/* Guia em 3 partes */
.guide-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.guide-tabs a { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: .85rem; color: var(--text); text-decoration: none; background: var(--surface-2); }
.guide-h { font-size: 1.2rem; margin: 22px 0 10px; scroll-margin-top: 80px; }
.guide-signals p { margin: 0 0 8px; }
.sig-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 8px; }
.sig-row p { margin: 0; font-size: .9rem; }
.sig { display: inline-grid; place-items: center; padding: 8px 6px; border-radius: 10px; font: 800 .78rem/1 Inter, sans-serif; letter-spacing: .08em; color: #fff; }
.sig.red { background: #ff3b30; } .sig.yellow { background: #facc15; color: #111; } .sig.green { background: #16a34a; }
.guide-flow { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 8px; }
.tag-y { background: #facc15; color: #111; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.tag-g { background: #16a34a; color: #fff; padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.guide-moves { display: grid; gap: 10px; }
.moves-group h3 { margin: 0 0 2px; font-size: .95rem; color: var(--accent); }
.moves-group p { margin: 0; }

/* "Algo errado? Refazer análise" e ID da conta */
.verify-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.redo-btn { border-color: #f59e0b; color: #f59e0b; }
.redo-btn:hover { background: rgba(245,158,11,.1); }
.acct-id { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 10px; color: var(--muted); }
.acct-id b { color: var(--text); font-variant-numeric: tabular-nums; }

/* medidas estimadas e números por repetição */
.reps-table { grid-column: 1 / -1; margin-top: 10px; overflow-x: auto; }
.reps-table h3 { margin: 0 0 8px; }
.reps-table table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.reps-table th, .reps-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.reps-table th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.unreliable-alert { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid #f59e0b; border-left-width: 4px; border-radius: 8px; background: rgba(245,158,11,.08); font-size: .88rem; }
.err-why { display: block; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: .82rem; color: var(--muted); word-break: break-word; }

/* Detalhes do treino e "Como foi o treino?" */
.sess-mood { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-weight: 600; }
.sess-note { font-style: italic; }
.sess-q { margin: 0 0 8px; }
.mood-scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 14px; }
.mood-btn { display: grid; justify-items: center; gap: 4px; padding: 10px 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit; }
.mood-btn small { font-size: .68rem; line-height: 1.1; text-align: center; }
.mood-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.mood-face { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; flex: none; }
.mood-face.m1 { color: #ef4444; } .mood-face.m2 { color: #f97316; } .mood-face.m3 { color: #facc15; } .mood-face.m4 { color: #84cc16; } .mood-face.m5 { color: #22c55e; }
#sessExtra label { display: grid; gap: 6px; margin-bottom: 10px; }

/* Card do treino no estilo de atividade */
.activity { padding: 0; overflow: hidden; }
.act-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px; }
.act-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font: 700 .9rem 'Space Grotesk', Inter, sans-serif; }
.act-who { display: grid; min-width: 0; flex: 1; }
.act-who b { font-size: .95rem; }
.act-who small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-title { margin: 4px 14px 4px; font-size: 1.25rem; line-height: 1.2; }
.act-sub { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0 14px 6px; font-size: .86rem; color: var(--muted); }
.act-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 10px 14px 12px; }
.act-stats small { display: block; color: var(--muted); font-size: .72rem; }
.act-stats b { font: 700 1.15rem 'Space Grotesk', Inter, sans-serif; white-space: nowrap; }
.act-hero { position: relative; display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.act-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .92; }
.act-hero-tag { position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; font-size: .8rem; font-weight: 600; }
.act-sets { padding: 4px 14px 0; }
.act-actions { display: flex; border-top: 1px solid var(--border); margin-top: 8px; }
.act-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; border: 0; background: none; color: var(--text); font: 600 .82rem Inter, sans-serif; cursor: pointer; }
.act-btn + .act-btn { border-left: 1px solid var(--border); }
.act-btn .ico, .act-btn .mood-face { width: 18px; height: 18px; }
.act-btn:hover { background: var(--surface-2); }
.act-note { flex: 2; align-self: center; text-align: center; color: var(--muted); font-size: .8rem; }

/* ---------- Ajustes gerais de layout (celular) ---------- */
.install-banner { padding: 8px 10px; font-size: .82rem; line-height: 1.3; }
.install-banner .btn.small { padding: 6px 12px; }
@media (max-width: 640px) {
  .chart svg text { font-size: 20px; }            /* o gráfico encolhe ~50%: texto continua legível */
  .beta-note { padding: 10px 12px; font-size: .82rem; gap: 8px; }
  .beta-note .btn { align-self: flex-end; }
  .view-head h1 { font-size: 1.6rem; }
  .card { padding: 14px; }
  .card.activity { padding: 0; }
  .card h2 { font-size: 1.05rem; }
}
.act-sets .set-row:last-child, .act-sets > :last-child { border-bottom: 0; }
.act-hero img { aspect-ratio: 16 / 10; }
.act-btn { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: .76rem; white-space: nowrap; }

/* Arranco e Arremesso: os dois movimentos do LPO em destaque */
.set-row.main-lift { box-shadow: inset 3px 0 0 var(--accent); padding-left: 10px; }
.set-row.main-lift .title { font-weight: 700; }

.lift-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 14px 8px; }
.lift-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 700 .74rem Inter, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.lift-tag b { font-family: 'Space Grotesk', Inter, sans-serif; letter-spacing: 0; text-transform: none; font-size: .82rem; }

/* YouTube, feed e aviso dos vídeos */
.sess-tabs { display: flex; gap: 6px; margin: 0 0 12px; border-bottom: 1px solid var(--border); }
.sess-tabs button { flex: 1; padding: 10px 6px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 .9rem Inter, sans-serif; cursor: pointer; }
.sess-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.yt-hero .yt-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; }
.yt-hero .yt-play .ico { width: 28px; height: 28px; }
.keep-note, .yt-note { display: flex; align-items: center; gap: 8px; margin: 8px 14px 0; padding: 8px 10px; border-radius: 10px; font-size: .8rem; line-height: 1.35; }
.keep-note { background: rgba(245, 180, 60, .12); color: #f5c46b; }
.yt-note { background: var(--accent-soft); color: var(--text); }
.keep-note span, .yt-note span { flex: 1; }
.keep-note .ico, .yt-note .ico { flex: none; width: 16px; height: 16px; }
.yt-steps { list-style: none; counter-reset: yt; margin: 6px 0 12px; padding: 0; display: grid; gap: 8px; }
.yt-steps li { counter-increment: yt; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }
.yt-steps li::before { content: counter(yt); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; }
.yt-steps li > div { flex: 1; display: grid; gap: 2px; }
.yt-steps small { color: var(--muted); font-size: .78rem; }
.yt-steps .btn { flex: none; }
.yt-lock-warn { padding: 10px 12px; border-radius: 10px; background: rgba(245, 180, 60, .12); color: #f5c46b; font-size: .85rem; }
.err-text { color: #ff8a80; min-height: 1em; }
.keep-list { padding-left: 18px; display: grid; gap: 6px; }
.guide-keep ol { padding-left: 20px; display: grid; gap: 8px; }
.feed-set { width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; }
.feed-set[disabled] { cursor: default; opacity: .7; }
.thumb.yt { display: grid; place-items: center; background: #1c2333; color: #fff; }
.thumb.yt .ico { width: 18px; height: 18px; }
#editSetForm.locked::before { content: 'Treino no YouTube: dados só para consulta.'; display: block; margin-bottom: 8px; font-size: .8rem; color: var(--muted); }
@media (max-width: 640px) { .yt-steps li { flex-wrap: wrap; } .yt-steps .btn { margin-left: 36px; } }

/* Grupos de movimentos em teste */
.group-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); color: var(--text); font-size: .9rem; cursor: pointer; flex-direction: row; margin: 0; }
.group-toggle input { flex: none; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--accent); }
.group-toggle span { display: grid; gap: 2px; }
.group-toggle small { font-size: .78rem; color: var(--text); opacity: .85; }
.group-toggle small.muted { color: var(--muted); opacity: 1; }

.yt-extra { margin: -4px 0 10px; color: var(--muted); }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 640px) { .yt-steps li > div { flex-basis: calc(100% - 40px); } }

.yt-desc { margin: 4px 0 12px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.yt-desc-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface-2); flex-wrap: wrap; }
.yt-desc-head .btn { margin-left: auto; }
.yt-desc pre { margin: 0; padding: 10px 12px; max-height: 190px; overflow: auto; white-space: pre-wrap; font: .8rem/1.5 ui-monospace, Menlo, monospace; color: var(--text); }
#ytDialog { width: min(640px, calc(100vw - 16px)); } #ytDialog > * { min-width: 0; max-width: 100%; }
.yt-desc pre { overflow-wrap: anywhere; }

/* Análise de vídeo em andamento: bem visível */
@keyframes owlspin { to { transform: rotate(360deg); } }
@keyframes owlpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes owlstripes { to { background-position: 28px 0; } }
.spin { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: owlspin .8s linear infinite; }
.analysis-banner { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 12px; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; text-align: left; font: inherit; cursor: pointer; overflow: hidden; flex-wrap: wrap; }
.analysis-banner .ab-txt { flex: 1; display: grid; gap: 1px; min-width: 0; }
.analysis-banner small { opacity: .9; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.analysis-banner .ab-bar { flex-basis: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.3); overflow: hidden; }
.analysis-banner .ab-bar i { display: block; height: 100%; background: #fff; transition: width .4s; }
.analysis-banner.wait { background: #f5b43c; color: #1b1300; }
body.rec-mode .analysis-banner { display: none; }
.import-job.running { border: 1px solid var(--accent); border-left-width: 4px; background: var(--accent-soft); }
.import-job.confirm { border: 1px solid #f5b43c; border-left-width: 4px; }
.job-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.job-head { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--accent); font-size: .95rem; }
.import-job.running .spin { border-color: rgba(59,140,255,.3); border-top-color: var(--accent); }
.job-pct { margin-left: auto; font: 700 1.05rem 'Space Grotesk', Inter, sans-serif; color: var(--text); }
.job-name { word-break: break-all; }
.job-bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.job-bar i { display: block; height: 100%; border-radius: 8px; transition: width .4s;
  background: repeating-linear-gradient(45deg, var(--accent) 0 10px, #5aa2ff 10px 20px); background-size: 28px 100%; animation: owlstripes .8s linear infinite; }
.import-job.confirm .job-head { color: #f5b43c; }
.tabbar [data-view="sessions"].busy { position: relative; }
.tabbar [data-view="sessions"].busy::after { content: ''; position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: #f5b43c; animation: owlpulse 1.2s ease-in-out infinite; }
.btn.saved { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }
.btn.saved .ico { width: 18px; height: 18px; }

.yt-title { margin: 0; padding: 10px 12px; font-weight: 600; font-size: .9rem; }
.yt-in { display: grid; gap: 8px; margin-top: 8px; }
.yt-in-row { display: flex; gap: 6px; }
.yt-in-row input { flex: 1; min-width: 0; }
.yt-link-step { transition: box-shadow .3s; }
.yt-link-step.flash { box-shadow: 0 0 0 3px var(--accent); }
.yt-steps li.yt-link-step > div { flex-basis: calc(100% - 40px); }
.yt-steps li.yt-link-step { flex-wrap: nowrap; align-items: flex-start; }
.yt-steps li.yt-link-step > div { flex: 1; flex-basis: auto; min-width: 0; }
.yt-steps li.yt-link-step::before { margin-top: 2px; }
#ytDialog { overflow-x: hidden; }

.yt-extra { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }

.yt-api { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.yt-api p { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.yt-api p:last-child { margin: 0; }
.yt-api .ico { width: 16px; height: 16px; color: var(--ok); flex: none; }
.yt-direct { display: grid; gap: 8px; margin: 0 0 12px; padding: 12px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.yt-direct .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; }
.yt-priv { margin: 0; }
.yt-api p span { flex: 1; min-width: 0; }

.yt-birth { display: grid; gap: 4px; font-size: .85rem; color: var(--text); margin: 0; }
.yt-note.published { background: rgba(53,208,127,.14); }
.yt-note.published .ico { color: var(--ok); }

.or-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: .8rem; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; text-decoration: none; }
.google-btn:hover { background: #f7f8f8; }
.g-logo { width: 18px; height: 18px; flex: none; }

.act-hero.yt-embed { cursor: default; aspect-ratio: 16 / 9; background: #000; }
.act-hero.yt-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.act-sub[data-sact] { cursor: pointer; }

.cut-load { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 6px 0; flex-direction: row; color: var(--text); font-size: .85rem; }
.cut-load input { width: 90px; }
.cut-load-why { flex-basis: 100%; color: var(--muted); font-size: .76rem; display: flex; align-items: center; gap: 6px; }
.plate-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); }

.nudge-btns { display: flex; flex-direction: column; gap: 8px; flex: none; }
.center { text-align: center; }

.yt-noload { margin: 0 0 12px; padding: 12px; border: 1px solid #f5b43c; border-radius: 12px; background: rgba(245,180,60,.1); }
.yt-noload ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.yt-noload li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.act-stats b small.u { font: 500 .7rem Inter, sans-serif; color: var(--muted); }
