/* Forja — tema escuro com laranja. Tokens no :root; layout celular primeiro, computador a partir de 960px. */
:root {
  --bg: #121316;
  --app: #16171A;
  --surface: #1D1E22;
  --surface-2: #232428;
  --surface-3: #2A2B30;
  --line: #2A2B30;
  --line-2: #34363C;
  --text: #F4F4F5;
  --text-2: #D4D5D9;
  --muted: #9A9CA4;
  --faint: #7E8089;
  --accent: #FF7A1A;
  --accent-2: #FF8F3D;
  --accent-ink: #1A0D03;
  --accent-soft: rgba(255, 122, 26, .14);
  --accent-line: rgba(255, 122, 26, .55);
  --heat-0: #26272C;
  --heat-1: #5A2E12;
  --heat-2: #A24A12;
  --heat-3: #FF7A1A;
  --red: #FF6B6B;
  --green: #4ADE80;
  --radius: 14px;
  --radius-lg: 18px;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; font-family: var(--display); }
h1 { font-size: 22px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.accent { color: var(--accent); }
.accent-soft { color: #E8925A; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; justify-content: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1 1 auto; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono-num { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.row.gap { gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.icon { flex: none; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 600 13px var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost.danger, .danger { color: var(--red); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { height: 26px; width: 26px; padding: 0; font-size: 12px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-square { width: 40px; height: 40px; border-radius: 10px; }
.btn-dashed { background: transparent; border: 1px dashed var(--line-2); color: var(--text-2); width: 100%; }
.btn-dashed:hover { border-color: var(--accent-line); color: var(--text); background: transparent; }
.btn-google { background: #fff; color: #1F1F1F; border-color: #fff; }
.btn-google:hover { background: #F1F1F1; }
.file-btn { position: relative; }

/* ---------- cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; min-width: 0;
}
button.card { text-align: left; cursor: pointer; width: 100%; color: inherit; font: inherit; }
button.card:hover { border-color: var(--line-2); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card.empty { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.section-title { font-size: 13px; font-weight: 600; margin: 4px 0 8px; font-family: var(--sans); letter-spacing: 0; }
.pill { font-size: 11px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* ---------- marca e avatar ---------- */
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink); font: 800 15px var(--display);
}
.brand-mark-lg { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--surface-3); color: var(--text); font: 700 13px var(--display); border: 1px solid var(--line-2);
}
.avatar-btn { cursor: pointer; }

/* ---------- estrutura ---------- */
.app { min-height: 100vh; min-height: 100dvh; background: var(--app); }
.main { min-width: 0; }
.page { padding: 18px 16px calc(var(--nav-h) + 24px); display: flex; flex-direction: column; gap: 12px; max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }

.sidebar { display: none; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(22, 23, 26, .94); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.bottom-nav .nav-item { display: flex; align-items: center; flex-direction: column; gap: 4px; justify-content: center; font-size: 10.5px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.bottom-nav .nav-item.active { color: var(--accent); font-weight: 600; }

/* só celular / só computador */
@media (max-width: 959.98px) {
  .d-only { display: none !important; }
}
@media (min-width: 960px) {
  .m-only { display: none !important; }
  .bottom-nav { display: none; }
  .app { display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--bg); }
  .main { background: var(--app); }
  .page { padding: 26px 28px 40px; gap: 14px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
    padding: 18px 12px; background: var(--bg); border-right: 1px solid var(--line);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; font: 700 16px var(--display); padding: 4px 8px 18px; }
  .sidebar .nav-item {
    display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
    background: none; border: 0; color: var(--text-2); font-size: 13px; cursor: pointer; text-align: left;
  }
  .sidebar .nav-item:hover { background: var(--surface); }
  .sidebar .nav-item.active { background: rgba(255, 122, 26, .12); color: var(--accent); font-weight: 600; }
  .side-user {
    display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px;
    background: none; border: 0; cursor: pointer; text-align: left; color: var(--text);
  }
  .side-user:hover { background: var(--surface); }
  .side-user-name { font-size: 12px; font-weight: 600; }
  h1 { font-size: 24px; }
}

/* sincronização */
.sync { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.sync.ok .sync-dot { background: var(--green); }
.sync.busy .sync-dot { background: var(--accent); animation: blink 1s ease-in-out infinite; }
.sync.error { color: var(--red); }
.sync.error .sync-dot { background: var(--red); }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- painel / início ---------- */
.today-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.today-title { font-size: 19px; font-weight: 700; margin-top: 4px; }
.today-card .btn { margin-top: 8px; height: 46px; font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }
.kpi-label { font-size: 11px; color: var(--muted); }
.kpi-value { font-size: 12px; color: var(--text-2); }
.kpi-value b { font: 700 22px var(--display); color: var(--text); margin-right: 2px; letter-spacing: -0.02em; }
.dash-grid { display: grid; gap: 12px; }
.last-card { display: flex; align-items: center; gap: 12px; }
.trophy { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); flex: none; }
.last-card b { font-size: 13px; }

/* corrida */
.run-list { display: flex; flex-direction: column; gap: 4px; }
.run-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px; border-radius: 10px;
  background: none; border: 0; color: inherit; text-align: left; cursor: pointer;
}
.run-row:hover { background: var(--line); }
.run-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); flex: none; }
.run-row-pace { flex: none; text-align: right; white-space: nowrap; }
.run-row-pace b { font: 700 16px var(--display); letter-spacing: -0.01em; }
.run-pace { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); }
.run-pace.empty { background: var(--line); }
.run-pace-value { font-size: 13px; color: var(--text-2); }
.run-pace-value b { font: 700 34px var(--display); color: var(--accent); letter-spacing: -0.02em; margin-right: 2px; }
.run-pace.empty .run-pace-value b { color: var(--muted); }
.run-hint { margin-top: -8px; }
.grow-2 { flex: 2 1 auto; min-width: 0; }
.field-date { flex: 0 0 158px; }
.error { color: var(--red); margin: 0; }

@media (min-width: 960px) {
  .dash-run { grid-column: 1 / -1; }
  .run-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .run-row { border: 1px solid var(--line); padding: 10px 12px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; }
  .dash-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 14px; }
  .card { padding: 16px; }
}

/* fichas (lista compacta no painel) */
.plan-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; color: inherit;
}
.plan-row:hover { border-color: var(--line-2); }
.plan-row.hot { border-color: var(--accent-line); background: rgba(255, 122, 26, .06); }
.plan-row-name { font-size: 12.5px; font-weight: 600; }
.plan-letter {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--surface-3); color: var(--text); font: 700 16px var(--display);
}
.plan-letter.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
.plan-letter.hot { background: var(--accent); color: var(--accent-ink); }

/* frequência */
.heat {
  display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column;
  grid-template-columns: repeat(var(--weeks), minmax(0, 1fr)); gap: 4px;
}
.heat-cell { display: block; height: 11px; border-radius: 2px; background: var(--heat-0); }
.heat-cell.l1 { background: var(--heat-1); }
.heat-cell.l2 { background: var(--heat-2); }
.heat-cell.l3 { background: var(--heat-3); }
.heat-cell.future { opacity: .35; }
.heat-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.heat-legend .heat-cell { width: 10px; height: 10px; }
@media (min-width: 960px) {
  .heat { gap: 3px; }
  .heat-cell { height: 13px; }
}

/* recordes */
.records { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.records li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500;
}
.records li > span:nth-child(2) { flex: 1 1 auto; }
.records.plain { gap: 10px; margin-top: 12px; }
.records.plain li { padding: 0; background: none; border: 0; font-size: 12px; }
.records.plain li > span:first-child { flex: 1 1 auto; }
.records.plain li > span:nth-child(2) { flex: none; }

/* gráfico */
.chart { position: relative; margin-top: 10px; }
.chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 122, 26, .22);
}
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.chart-axis { display: flex; justify-content: space-between; color: var(--faint); margin-top: 6px; }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); font: 600 12px var(--sans);
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dash-chart .chips { margin: 0; padding: 0; }
.dash-chart .chip { height: 28px; font-size: 11.5px; padding: 0 12px; }
@media (min-width: 960px) {
  .chips { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; }
}

/* ---------- evolução ---------- */
.progress-grid { display: grid; gap: 12px; }
.big-num b { font-size: 34px; font-weight: 700; }
.delta { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.delta.up { color: var(--accent); background: var(--accent-soft); }
.delta.down { color: var(--muted); background: var(--surface-2); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; }
.stat b { font: 700 18px var(--display); letter-spacing: -0.02em; }
@media (min-width: 960px) {
  .progress-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: 14px; }
}

/* ---------- fichas ---------- */
.plan-grid { display: grid; gap: 10px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.plan-card.hot { border-color: var(--accent-line); background: linear-gradient(0deg, rgba(255, 122, 26, .05), rgba(255, 122, 26, .05)), var(--surface); }
.plan-main { display: flex; align-items: flex-start; gap: 12px; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.plan-name { font-size: 14px; }
.today-tag { font-size: 10.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 10.5px; font-weight: 600; color: var(--text-2); background: var(--surface-3); padding: 3px 8px; border-radius: 6px; }
.plan-actions { display: flex; gap: 6px; padding-left: 52px; }
.dashed-card {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  background: transparent !important; border: 1px dashed var(--line-2) !important; color: var(--text-2) !important; font-weight: 600 !important; font-size: 13px !important;
}
.dashed-card:hover { border-color: var(--accent-line) !important; color: var(--text) !important; }
@media (min-width: 960px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ---------- histórico ---------- */
.session { padding: 0; overflow: hidden; }
.run-entry .session-head { padding-right: 16px; }
.session-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: none; border: 0; cursor: pointer; text-align: left; color: inherit; }
.session-body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 12px 56px; }
.session-ex { display: flex; flex-direction: column; gap: 2px; }
.session.open { border-color: var(--line-2); }

/* ---------- modo treino ---------- */
.workout { gap: 12px; }
.wk-head { display: flex; align-items: center; gap: 12px; }
.wk-back { flex: none; }
.wk-title { flex: 1 1 auto; }
.wk-clock { font-size: 22px; font-weight: 700; line-height: 1.1; }
.wk-finish { background: var(--surface-2); }
.wk-progress { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 3px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.wk-grid { display: grid; gap: 12px; }
.wk-exercise { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.wk-ex-name { font-size: 17px; font-weight: 700; }
.hint {
  display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2);
}
.hint .icon { margin-top: 1px; color: var(--muted); }

.sets { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin: -6px 0; }
.sets th { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 4px 6px; }
.sets th:last-child { text-align: right; }
.sets td { padding: 6px; font-size: 13px; vertical-align: middle; }
.sets td:first-child { border-radius: 10px 0 0 10px; padding-left: 10px; }
.sets td:last-child { border-radius: 0 10px 10px 0; text-align: right; padding-right: 8px; }
.set-n { font-weight: 700; width: 36px; }
.set-prev { font-size: 11.5px; white-space: nowrap; }
.sets tr.current td { background: var(--surface-2); }
.sets tr.later td { color: var(--faint); }
.set-input {
  width: 100%; max-width: 76px; height: 36px; padding: 0 8px; border-radius: 8px; text-align: center;
  background: transparent; border: 1px solid transparent; color: var(--text); font: 700 14px var(--display);
}
.set-input::placeholder { color: var(--faint); font-weight: 600; }
.sets tr.done .set-input { color: var(--text); }
.sets tr.current .set-input { border-color: var(--line-2); background: var(--app); }
.sets tr.current .set-input:first-child:focus, .set-input:focus { outline: none; border-color: var(--accent); }
.check {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); color: var(--faint);
}
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check:not(.on):hover { border-color: var(--accent-line); color: var(--text); }
.wk-tools { display: flex; gap: 8px; align-items: center; }
.note { display: flex; flex-direction: column; gap: 6px; }
.note input {
  height: 36px; padding: 0 12px; border-radius: 8px; background: var(--app); border: 1px solid var(--line); color: var(--text); font: 12px var(--sans);
}
.next-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wk-actions {
  position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  margin: 4px -16px -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--app) 30%);
}
.in-workout .page { padding-bottom: 16px; }
.rest-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); font: 700 12px var(--display);
}

/* anel do descanso */
.ring { position: relative; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--surface-3); stroke-width: 5; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring.idle .ring-fill { stroke: var(--line-2); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.ring-text b { font-size: 2.1em; font-weight: 700; }
.ring[style*="220px"] .ring-text b { font-size: 54px; }
.ring[style*="150px"] .ring-text b { font-size: 36px; }

.rest-overlay {
  position: fixed; inset: 0; z-index: 35; display: flex; flex-direction: column; gap: 18px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); background: var(--app); animation: fade .16s ease-out;
}
.rest-top { display: flex; align-items: center; justify-content: space-between; }
.rest-overlay .eyebrow { display: block; margin-top: 30px; letter-spacing: .2em; }
.rest-overlay .btn-lg { min-width: 64px; }
.rest-overlay p { display: flex; align-items: center; justify-content: center; gap: 6px; }
.next-set { display: flex; flex-direction: column; gap: 4px; }
.next-set b { font-size: 15px; }

@media (min-width: 960px) {
  .wk-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin: 0 -28px; padding: 0 28px 14px; }
  .wk-finish { background: var(--text); color: #111; border-color: var(--text); }
  .wk-finish:hover { background: #fff; }
  .wk-grid { grid-template-columns: 200px minmax(0, 1fr) 210px; align-items: start; gap: 14px; margin-top: 8px; }
  .wk-list { padding: 12px 8px; display: flex; flex-direction: column; gap: 8px; }
  .wk-list .eyebrow { padding: 0 6px; }
  .wk-list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .wk-item {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 9px;
    background: none; border: 1px solid transparent; cursor: pointer; text-align: left; color: inherit;
  }
  .wk-item:hover { background: var(--surface-2); }
  .wk-item.active { border-color: var(--accent-line); background: rgba(255, 122, 26, .08); }
  .wk-item-name { font-size: 12px; font-weight: 600; }
  .wk-num {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
    background: var(--surface-3); font-size: 10.5px; font-weight: 700; color: var(--text-2);
  }
  .wk-item.active .wk-num, .wk-item.done .wk-num { background: var(--accent); color: var(--accent-ink); }
  .wk-exercise { padding: 18px; }
  .wk-ex-name { font-size: 18px; }
  .sets tr.current td { background: rgba(255, 122, 26, .09); }
  .sets td { padding: 8px; }
  .wk-tools .btn-dashed { width: auto; }
  .wk-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 20px; }
  .rest-panel { display: flex; flex-direction: column; gap: 14px; }
  .summary dl { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
  .summary dl div { display: flex; justify-content: space-between; font-size: 12px; }
  .summary dt { color: var(--muted); }
  .summary dd { margin: 0; font-weight: 700; }
}

/* ---------- diálogos e formulários ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 6, 8, .72); backdrop-filter: blur(4px); animation: fade .16s ease-out;
}
.dialog {
  width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, .55); animation: pop .18s ease-out;
}
.dialog:focus { outline: none; }
.dialog-wide { width: min(720px, 100%); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.dialog-head h2 { font-size: 17px; }
.dialog-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.small-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); min-width: 0; }
.field em { font-style: normal; }
.field input, .ex-row input {
  height: 40px; padding: 0 12px; border-radius: 10px; min-width: 0; width: 100%;
  background: var(--app); border: 1px solid var(--line-2); color: var(--text); font: 14px var(--sans);
}
.field input:focus, .ex-row input:focus { outline: none; border-color: var(--accent); }
.form-row { display: flex; gap: 10px; }
.field-letter { width: 64px; flex: none; }
.field-letter input { text-align: center; font: 700 16px var(--display); text-transform: uppercase; }
.ex-head, .ex-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px 104px 64px 60px; gap: 6px; align-items: center; }
.ex-row input.num { text-align: center; padding: 0 4px; }
.reps { display: flex; align-items: center; gap: 2px; }
.ex-btns { display: flex; justify-content: flex-end; }
@media (max-width: 600px) {
  .ex-head { display: none; }
  .ex-row { grid-template-columns: 1fr 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .ex-row > input:first-child { grid-column: 1 / -1; }
  .ex-row .reps { grid-column: span 1; }
  .ex-row .ex-btns { grid-column: 1 / -1; }
}
.import-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.import-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.error-text { color: var(--red); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(600px 300px at 50% 0%, rgba(255, 122, 26, .12), transparent), var(--bg); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; align-items: stretch; text-align: center; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 30px; }
.login-sub { font-size: 14px; }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 6px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .2); border-top-color: currentColor; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px; font-size: 13px;
  background: #24252A; border: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: pop .16s ease-out;
}
.toast.error { border-color: rgba(255, 107, 107, .45); }
.btn-link { background: none; border: 0; color: var(--accent); font-weight: 700; cursor: pointer; padding: 0; height: auto; }
@media (min-width: 960px) { .toasts { bottom: 24px; } }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

/* ---------- Blazor ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); font: 14px var(--sans); background: var(--app); text-align: center; }
.boot-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); margin: 0 auto 14px; animation: boot 1.2s ease-in-out infinite; }
@keyframes boot { 50% { transform: scale(.86); opacity: .7; } }
#blazor-error-ui {
  display: none; position: fixed; inset: auto 16px 16px; z-index: 100; padding: 12px 16px; border-radius: 12px;
  background: #2A1515; border: 1px solid rgba(255, 107, 107, .4); color: var(--text);
}
#blazor-error-ui .reload { color: var(--accent); margin-left: 8px; }
#blazor-error-ui .dismiss { float: right; background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
#update-banner {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 16px; border-radius: 14px;
  background: #24252A; border: 1px solid var(--line-2); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font-size: 13px; white-space: nowrap;
}
#update-banner[hidden] { display: none; }
#update-banner button { height: 36px; padding: 0 14px; border: 0; border-radius: 9px; cursor: pointer; background: var(--accent); color: var(--accent-ink); font: 600 13px var(--sans); }

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

/* ---------- acessos ---------- */
.access-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 0; }
.access-state h1 { font-size: 22px; }
.access-state p { max-width: 320px; }
.access-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
}
.access-state.warn .access-icon { color: var(--accent); background: var(--accent-soft); }
.access-state.bad .access-icon { color: var(--red); background: rgba(255, 107, 107, .12); }
.spinner-light { width: 28px; height: 28px; border-color: rgba(255, 255, 255, .12); border-top-color: var(--accent); }
.access-account {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); min-width: 0;
}
.access-account strong { max-width: 100%; }
.count-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 700;
}
.access-group { margin-bottom: 18px; }
.access-group h3 { margin: 0 0 8px; }
.access-group h3 span { color: var(--faint); margin-left: 4px; }
.access-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.access-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.access-list li:first-child { border-top: 0; }
.access-avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover;
  background: var(--surface-3); border: 1px solid var(--line-2); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--text-2);
}
.access-list .stack { flex: 1; }
.access-actions { display: flex; gap: 6px; flex: none; }
@media (max-width: 520px) {
  .access-list li { flex-wrap: wrap; }
  .access-actions { width: 100%; justify-content: flex-end; }
}

/* ---------- busca ---------- */
kbd { font: 600 10px var(--sans); color: var(--faint); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; }
.dialog-search { width: min(520px, 100%); align-self: start; margin-top: 10vh; }
.search-box {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 12px;
  background: var(--app); border: 1px solid var(--line-2); color: var(--muted);
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; color: var(--text); font: 15px var(--sans); outline: none; }
.search-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.search-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  background: none; border: 1px solid transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 13px;
}
.search-list button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line-2); }
.search-list button:disabled { color: var(--faint); cursor: default; }

/* ---------- fichas arquivadas e edição de treino ---------- */
.plan-card.archived { opacity: .75; }
.plan-card.archived .plan-main { cursor: default; }
.edit-ex { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.edit-sets { display: flex; flex-wrap: wrap; gap: 8px; }
.edit-set { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; border-radius: 10px; background: var(--surface-2); }
.edit-set input {
  width: 58px; height: 32px; padding: 0 6px; border-radius: 8px; text-align: center;
  background: var(--app); border: 1px solid var(--line-2); color: var(--text); font: 600 13px var(--display);
}
.edit-set input:focus { outline: none; border-color: var(--accent); }
.field input[type="date"], .field input[type="time"] { color-scheme: dark; }
