:root {
  color-scheme: light;
  --bg: #f4f4f0;
  --bg-elevated: rgba(255,255,255,.58);
  --sheet-surface: #fbfbf8;
  --glass: rgba(255,255,255,.52);
  --glass-strong: rgba(255,255,255,.72);
  --text: #111214;
  --muted: #62666b;
  --soft: #6b7078;
  --line: rgba(18,20,24,.09);
  --line-strong: rgba(18,20,24,.14);
  --chip: rgba(17,18,20,.055);
  --accent: #002fa7;
  --accent-ink: var(--accent);
  --accent-soft: rgba(0,47,167,.10);
  --good: #28763e;
  --warning: #8c5d1c;
  --danger: #a94a4a;
  --shadow: 0 18px 50px rgba(16,20,29,.09);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --button-radius: 999px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090a;
  --bg-elevated: rgba(24,25,28,.62);
  --sheet-surface: #17181b;
  --glass: rgba(26,28,32,.52);
  --glass-strong: rgba(31,33,38,.72);
  --text: #f5f6f7;
  --muted: #afb3bc;
  --soft: #9298a3;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.14);
  --chip: rgba(255,255,255,.065);
  --accent: #2452ff;
    --accent-ink: #7899ff;
  --accent-soft: rgba(36,82,255,.16);
  --good: #6fb67e;
  --warning: #d6a14c;
  --danger: #d46b6b;
  --shadow: 0 20px 60px rgba(0,0,0,.32);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #08090a;
    --bg-elevated: rgba(24,25,28,.62);
    --sheet-surface: #17181b;
    --glass: rgba(26,28,32,.52);
    --glass-strong: rgba(31,33,38,.72);
    --text: #f5f6f7;
    --muted: #afb3bc;
    --soft: #9298a3;
    --line: rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.14);
    --chip: rgba(255,255,255,.065);
    --accent: #2452ff;
    --accent-ink: #7899ff;
    --accent-soft: rgba(36,82,255,.16);
    --good: #6fb67e;
    --warning: #d6a14c;
    --danger: #d46b6b;
    --shadow: 0 20px 60px rgba(0,0,0,.32);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 92% 2%, rgba(0,47,167,.07), transparent 26rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}
button, .tap { -webkit-tap-highlight-color: transparent; }
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

/* A interface é tátil, não um documento: evita seleção acidental no Android. */
body, body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, select, [contenteditable="true"], [data-selectable],
.selectable, .notes, .exercise-instructions, .summary-note {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

.auth-shell { position:relative; isolation:isolate; min-height:100vh; display:grid; align-items:center; justify-items:start; padding:clamp(28px,7vw,108px); overflow:hidden; }
.auth-shell::before { content:""; position:absolute; z-index:-2; inset:0; background:url('./assets/auth-runner.webp') 56% center / cover no-repeat; }
.auth-shell::after { content:""; position:absolute; z-index:-1; inset:0; background:linear-gradient(90deg,rgba(244,244,240,.94) 0%,rgba(244,244,240,.82) 30%,rgba(244,244,240,.24) 58%,rgba(8,9,10,.08) 100%); }
.auth-card { width:min(100%,440px); padding:clamp(24px,4vw,42px); border-radius:32px; background:rgba(248,248,245,.78); border-color:rgba(255,255,255,.7); box-shadow:0 28px 80px rgba(8,11,16,.18); }
.auth-logo { display:block; width:120px; height:30px; margin-bottom:34px; overflow:hidden; }
.auth-logo img { width:100%; height:100%; display:block; object-fit:contain; object-position:left center; }
.auth-card h1 { margin:8px 0 0; font-size:clamp(32px,4vw,46px); line-height:.98; letter-spacing:-.055em; }
.auth-form { margin-top:18px; }
.auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin-top:26px; padding:4px; border:1px solid var(--line); border-radius:15px; background:var(--chip); }
.auth-tabs button { min-height:40px; border:0; border-radius:11px; background:transparent; color:var(--muted); cursor:pointer; font-size:13px; font-weight:600; }
.auth-tabs button.active { color:var(--text); background:var(--glass-strong); box-shadow:0 1px 4px rgba(0,0,0,.08); }
.auth-recover { justify-self:start; margin-top:-4px; }
.auth-note,.auth-loading { color:var(--muted); font-size:13px; }
.auth-loading { display:grid; justify-items:center; gap:20px; }
.auth-loading .auth-logo { margin:0; }
.auth-signup-only { color:var(--muted); font-weight:400; }
.password-control { position:relative; display:block; }
.password-control input { padding-right:82px!important; }
.password-control button { position:absolute; right:8px; top:50%; transform:translateY(-50%); border:0; background:var(--chip); color:var(--text); border-radius:999px; min-height:34px; padding:0 12px; cursor:pointer; font-size:12px; font-weight:600; }
.account-hint { color:var(--muted); display:block; margin-top:4px; }
.code-chip { border:1px solid var(--line-strong); background:var(--accent-soft); color:var(--accent-ink); border-radius:999px; padding:9px 13px; font-weight:700; letter-spacing:.08em; cursor:pointer; }
.empty-program { border-radius:32px; padding:28px; margin-top:18px; }
.empty-program h2 { font-size:32px; letter-spacing:-.04em; margin:8px 0; }
.empty-program p { color:var(--muted); line-height:1.5; }
.empty-program-actions { display:grid; gap:10px; margin-top:24px; }
.consent-row { display:flex!important; flex-direction:row!important; align-items:flex-start; gap:10px; line-height:1.4; }
.consent-row input { width:20px!important; height:20px; min-height:0!important; flex:0 0 auto; margin-top:1px; }

:root[data-theme="dark"] .auth-shell::after { background:linear-gradient(90deg,rgba(8,9,10,.93) 0%,rgba(8,9,10,.78) 34%,rgba(8,9,10,.2) 61%,rgba(8,9,10,.08) 100%); }
:root[data-theme="dark"] .auth-card { background:rgba(19,20,23,.78); border-color:rgba(255,255,255,.13); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .auth-shell::after { background:linear-gradient(90deg,rgba(8,9,10,.93) 0%,rgba(8,9,10,.78) 34%,rgba(8,9,10,.2) 61%,rgba(8,9,10,.08) 100%); }
  :root[data-theme="system"] .auth-card { background:rgba(19,20,23,.78); border-color:rgba(255,255,255,.13); }
}

@media (max-width: 680px) {
  .auth-shell { align-items:end; justify-items:stretch; min-height:100svh; padding:18px; }
  .auth-shell::before { background-position:62% center; transform:scale(1.03); }
  .auth-shell::after { background:linear-gradient(180deg,rgba(8,9,10,.04) 0%,rgba(8,9,10,.2) 32%,rgba(244,244,240,.92) 63%,rgba(244,244,240,.98) 100%); }
  .auth-card { width:100%; max-height:88svh; overflow:auto; }
  :root[data-theme="dark"] .auth-shell::after { background:linear-gradient(180deg,rgba(8,9,10,.04) 0%,rgba(8,9,10,.3) 32%,rgba(8,9,10,.91) 63%,rgba(8,9,10,.98) 100%); }
  @media (prefers-color-scheme: dark) { :root[data-theme="system"] .auth-shell::after { background:linear-gradient(180deg,rgba(8,9,10,.04) 0%,rgba(8,9,10,.3) 32%,rgba(8,9,10,.91) 63%,rgba(8,9,10,.98) 100%); } }
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 22px 18px calc(116px + var(--safe-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 2px 28px;
}
.brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .18em;
}
.brand-logo, .onboarding-logo { display:block; overflow:hidden; }
.brand-logo { width:88px; height:22px; }
.brand-logo img, .onboarding-logo img { width:100%; height:100%; object-fit:contain; object-position:left center; display:block; }
.onboarding-logo { width:220px; height:54px; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--glass-strong), var(--chip));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px rgba(255,255,255,.28);
  position: relative;
  font-weight: 700;
}
.avatar img, .profile-photo-large img { width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.avatar::after {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  position: absolute; right: -3px; bottom: -1px; z-index:2;
}

.eyebrow { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.dot-h1 {
  font-family: Doto, "Courier New", monospace;
  font-size: clamp(1.875rem, 7vw, 2.5rem);
  line-height: .96;
  letter-spacing: -.055em;
  margin: 0;
  font-weight: 700;
}
.page-title { font-size: 1.75rem; line-height: 1.15; letter-spacing: -.03em; margin: 0; }
.subcopy { color: var(--muted); margin: 10px 0 0; line-height: 1.45; }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  margin: 26px 0 18px;
}
.day { text-align: center; min-width: 0; }
.day-label { font-size: 11px; color: var(--muted); text-transform: uppercase; margin-bottom: 7px; }
.day-dot {
  width: 100%; max-width: 44px; aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
  border: 1px solid transparent;
  background: var(--chip);
  position: relative;
}
.day.complete .day-dot::after {
  content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%;
  bottom: -8px; background: var(--accent);
}
.day.today .day-dot { background: var(--accent); color: white; }
.day.rest .day-dot { background: transparent; border-color: var(--line-strong); color: var(--muted); }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px rgba(255,255,255,.2), var(--shadow);
  backdrop-filter: blur(24px) saturate(130%);
  -webkit-backdrop-filter: blur(24px) saturate(130%);
}
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 24px;
  min-height: 258px;
}
.hero-card::before, .hero-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(1px);
}
.hero-card::before {
  width: 230px; height: 230px; right: -70px; top: -86px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.38), rgba(0,47,167,.09) 35%, rgba(20,22,25,.12) 65%, transparent 70%);
  border: 1px solid rgba(255,255,255,.16);
}
.hero-card::after {
  width: 180px; height: 180px; right: -46px; bottom: -95px;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.23), rgba(0,47,167,.08) 35%, rgba(20,22,25,.18) 64%, transparent 70%);
}
.hero-content { position: relative; z-index: 1; }
.hero-label { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.hero-title { font-size: 38px; letter-spacing: -.05em; margin: 12px 0 5px; }
.hero-meta { color: var(--muted); font-size: 15px; }
.hero-stats { display: flex; gap: 18px; margin: 25px 0 20px; flex-wrap: wrap; font-size: 14px; }
.hero-stat { display:flex; align-items:center; gap:8px; }
.hero-actions { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:9px; }
.hero-actions .hero-start-btn { min-height:58px; background:var(--accent); color:#fff; font-size:17px; box-shadow:0 12px 30px color-mix(in srgb,var(--accent) 30%,transparent); }
.hero-actions .hero-change-btn { width:54px; min-width:54px; height:54px; min-height:54px; align-self:center; padding:0; display:grid; place-items:center; border-radius:50%; background:#fff; color:#111214; border-color:rgba(17,18,20,.12); box-shadow:0 8px 24px rgba(0,0,0,.18); }
.hero-actions .hero-change-btn .icon { width:23px; height:23px; }
.hero-day-badge { float:right; display:inline-flex; align-items:center; min-height:34px; padding:0 13px; border-radius:999px; background:#fff; color:#002fa7; border:1px solid rgba(17,18,20,.09); box-shadow:0 7px 22px rgba(0,0,0,.18); font-size:11px; font-weight:700; letter-spacing:.04em; }
:root[data-theme="dark"] .hero-actions .hero-change-btn, :root[data-theme="dark"] .hero-day-badge { background:#f5f6f7; color:#111214; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .hero-actions .hero-change-btn, :root[data-theme="system"] .hero-day-badge { background:#f5f6f7; color:#111214; } }
.icon { width:20px; height:20px; display:inline-grid; place-items:center; }
.icon svg { width:100%; height:100%; stroke: currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.primary-btn, .secondary-btn, .icon-btn {
  border: 0;
  cursor: pointer;
  min-height: 48px;
}
.primary-btn {
  width: 100%; border-radius: var(--button-radius);
  background: var(--text); color: var(--bg);
  font-weight: 600; font-size: .9375rem; padding: 10px 18px;
  display:flex; align-items:center; justify-content:center; gap:10px;
}
:root[data-theme="dark"] .primary-btn:not(.hero-start-btn,.session-primary) { background:#f2f3f5; color:#111214; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .primary-btn:not(.hero-start-btn,.session-primary) { background:#f2f3f5; color:#111214; } }
.secondary-btn {
  min-height:44px; font-size:.875rem;
  border-radius: var(--button-radius);
  background: var(--chip);
  border: 1px solid var(--line);
  padding: 0 18px;
}
.icon-btn {
  width:48px; border-radius:50%; background:var(--chip); border:1px solid var(--line);
  display:grid; place-items:center;
}

.stat-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:10px; margin:14px 0 30px; }
.stat-card { border-radius: 22px; padding: 16px; min-height: 110px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.045em; display:flex; align-items:center; gap:7px; }
.stat-card:nth-child(-n + 2) .stat-value .metric-icon { color:var(--accent-ink); }
.stat-label { color: var(--muted); font-size: 12px; margin-top: 5px; line-height: 1.3; }
.metric-icon { width:21px; height:21px; display:inline-grid; place-items:center; color:var(--accent-ink); }
.metric-icon svg { width:100%; height:100%; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.stat-card:first-child .metric-icon svg { fill:currentColor; }

.request-section { display:grid; gap:13px; padding-top:8px; border-top:1px solid var(--line); }
.request-gym { display:grid; gap:7px; padding:15px; border-radius:18px; }
.request-gym b { font-size:14px; }
.request-gym small { color:var(--muted); line-height:1.45; }
.ai-request-details { margin:14px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.ai-request-details summary { cursor:pointer; padding:12px 0; color:var(--text); font-size:13px; font-weight:600; }
.ai-request-details pre { max-height:330px; overflow:auto; margin:0 0 12px; padding:13px; white-space:pre-wrap; border-radius:14px; background:var(--chip); color:var(--muted); font:12px/1.45 Inter,ui-sans-serif,sans-serif; }
.ai-request-details .secondary-btn { margin-bottom:13px; }

.section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:12px; margin: 30px 2px 14px; }
.section-head h2 { margin:0; font-size:19px; letter-spacing:-.025em; }
.text-btn { background:none; border:0; padding:8px 0; color:var(--muted); cursor:pointer; }

.recovery-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap:8px; }
.recovery { border-radius:18px; padding:13px 11px; min-width:0; }
.recovery-name { font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.recovery-value { font-size:20px; font-weight:700; margin:4px 0 10px; }
.mini-track { height:7px; border-radius:999px; background:var(--chip); overflow:hidden; }
.mini-fill { height:100%; border-radius:inherit; background:var(--accent); }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; margin-inline: auto;
  bottom: calc(12px + var(--safe-bottom));
  width: min(calc(100% - 26px), 720px);
  display:grid; grid-template-columns:repeat(5,1fr);
  padding: 8px;
  border-radius: 27px;
  z-index:20;
}
.bottom-nav,.nav-btn { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
.nav-btn {
  border:0; background:transparent; cursor:pointer; min-height:58px; border-radius:21px;
  color:var(--muted); font-size:10px; text-decoration:none; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px;
}
.nav-btn .icon { width:21px; height:21px; }
.nav-btn.active { color:var(--text); background:var(--chip); }
.nav-btn.active::after { content:""; width:5px; height:5px; border-radius:50%; background:var(--accent); position:absolute; margin-top:48px; }

.list { display:flex; flex-direction:column; gap:10px; }
.workout-row, .exercise-row {
  border-radius:var(--radius-lg); padding:16px; display:flex; align-items:center; gap:14px;
}
.workout-card { padding:9px 11px 9px 9px; gap:7px; }
.workout-card-main { min-width:0; flex:1; display:flex; align-items:center; gap:14px; padding:7px; border:0; border-radius:17px; color:inherit; background:transparent; text-align:left; cursor:pointer; }
.workout-card-main:hover { background:var(--chip); }
.workout-card-main:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.workout-card-main .row-title, .workout-card-main .row-sub { display:block; }
.exercise-thumb {
  width:58px; height:58px; border-radius:17px; flex:0 0 58px;
  background:
    radial-gradient(circle at 62% 35%, rgba(0,47,167,.24), transparent 26%),
    linear-gradient(145deg, var(--glass-strong), var(--chip));
  border:1px solid var(--line);
  display:grid; place-items:center; font-weight:700; color:var(--muted);
}
.row-body { min-width:0; flex:1; }
.row-body > .row-title, .row-body > .row-sub { display:block; }
.row-title { font-weight:600; letter-spacing:-.02em; }
.row-sub { color:var(--muted); font-size:13px; margin-top:5px; }
.row-actions { display:flex; align-items:center; gap:5px; }
.mini-btn { border:0; background:var(--chip); border-radius:14px; min-width:40px; height:40px; cursor:pointer; }
.mini-btn .icon { width:18px; height:18px; }
.badge { display:inline-flex; align-items:center; gap:6px; background:var(--accent-soft); color:var(--accent-ink); border-radius:999px; padding:7px 10px; font-size:11px; font-weight:600; }
.shared-workout-card { border-radius:24px; padding:16px; display:flex; align-items:center; gap:14px; }
.shared-workout-card .secondary-btn { white-space:nowrap; }
.inline-mode { display:inline-flex; margin-left:6px; padding:4px 7px; border-radius:999px; background:var(--accent-soft); color:var(--accent-ink); font-size:10px; vertical-align:middle; }
.shared-people { display:flex; min-width:62px; }
.avatar-mini { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; background:var(--text); color:var(--bg); border:2px solid var(--sheet-surface); font-size:11px; font-weight:700; }
.avatar-mini.partner { margin-left:-12px; background:var(--accent); color:#fff; }
.shared-sheet-mark { width:48px; height:48px; margin-bottom:16px; display:grid; place-items:center; border-radius:16px; background:var(--accent); color:#fff; }
.contact-picker { border:0; padding:0; margin:0; display:flex; flex-direction:column; gap:8px; }
.contact-picker legend { padding:0; margin-bottom:2px; font-size:13px; color:var(--muted); }
.contact-option { position:relative; cursor:pointer; }
.contact-option input { position:absolute; opacity:0; pointer-events:none; }
.contact-card { min-height:64px; padding:9px 11px; display:flex; align-items:center; gap:11px; border:1px solid var(--line); border-radius:18px; background:var(--chip); }
.contact-card > span:nth-child(2) { min-width:0; flex:1; }
.contact-card b, .contact-card small { display:block; }
.contact-card small { margin-top:3px; color:var(--muted); }
.contact-avatar { width:44px; height:44px; flex:0 0 44px; display:grid; place-items:center; border-radius:15px; background:var(--glass-strong); font-size:12px; font-weight:700; }
.contact-card i { width:26px; height:26px; display:grid; place-items:center; border-radius:50%; color:transparent; border:1px solid var(--line-strong); font-style:normal; }
.contact-card i .icon { width:15px; height:15px; }
.contact-option input:checked + .contact-card { border-color:var(--accent-ink); box-shadow:inset 0 0 0 1px var(--accent-soft); }
.contact-option input:checked + .contact-card .contact-avatar, .contact-option input:checked + .contact-card i { background:var(--accent); color:#fff; border-color:transparent; }
.add-contact-btn { align-self:flex-start; min-height:38px; padding:0; display:flex; align-items:center; gap:7px; border:0; background:transparent; color:var(--muted); cursor:pointer; }
.add-contact-btn .icon { width:17px; height:17px; }
.contact-empty { padding:18px; display:grid; gap:8px; border:1px dashed var(--line-strong); border-radius:20px; background:var(--chip); }
.contact-empty b { color:var(--text); font-size:15px; }
.contact-empty span { color:var(--muted); font-size:12px; line-height:1.45; }
button:disabled { opacity:.45; cursor:not-allowed; }
.share-mode { border:0; padding:0; margin:0; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.share-mode legend { padding:0; margin-bottom:8px; font-size:13px; color:var(--muted); }
.share-mode label { position:relative; cursor:pointer; }
.share-mode input { position:absolute; opacity:0; pointer-events:none; }
.share-mode span { min-height:78px; padding:13px; display:flex; flex-direction:column; justify-content:center; border:1px solid var(--line); border-radius:18px; background:var(--chip); }
.share-mode small { display:block; margin-top:5px; color:var(--muted); line-height:1.3; }
.share-mode input:checked + span { border-color:var(--accent-ink); box-shadow:inset 0 0 0 1px var(--accent-soft); }
.sync-preview { padding:12px 14px; border-radius:16px; background:var(--accent-soft); color:var(--accent-ink); font-size:12px; line-height:1.4; }
.shared-workout-form { margin-top:22px; }
.shared-workout-form { display:grid; gap:18px; }
.shared-workout-form fieldset { min-width:0; }
.shared-workout-form .sheet-actions { margin-top:4px; }
[hidden] { display:none!important; }

.segmented { display:grid; grid-template-columns:repeat(3,1fr); background:var(--chip); border:1px solid var(--line); border-radius:999px; padding:4px; margin:20px 0; }
.segmented button { border:0; background:transparent; min-height:42px; border-radius:999px; color:var(--muted); cursor:pointer; }
.segmented button.active { background:var(--glass-strong); color:var(--text); box-shadow:0 5px 18px rgba(0,0,0,.07); }
.segmented { grid-template-columns:repeat(3,1fr); }
.library-nav { grid-template-columns:repeat(3,1fr); }
.library-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:14px 0 2px; }
.filter-field { display:grid; gap:6px; color:var(--muted); font-size:12px; }
.filter-select { min-height:44px; padding:0 14px; border:1px solid var(--line); border-radius:14px; background:var(--glass); color:var(--text); font:inherit; }
.filter-select:focus { outline:2px solid color-mix(in srgb,var(--accent) 45%,transparent); outline-offset:2px; }
.favorite-toggle { display:grid; place-items:center; width:34px; height:34px; flex:0 0 34px; border-radius:11px; color:var(--muted); font-size:21px; line-height:1; background:transparent; cursor:pointer; }
.favorite-toggle:hover, .favorite-toggle.is-favorite { color:var(--accent-ink); background:color-mix(in srgb,var(--accent) 10%,transparent); }
.folder-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:18px 0; }
.exercise-folder { display:flex; align-items:center; gap:12px; min-height:86px; padding:16px; border:1px solid var(--line); border-radius:20px; background:var(--glass); color:var(--text); text-align:left; cursor:pointer; box-shadow:0 8px 24px rgba(20,24,35,.05); }
.exercise-folder:hover { border-color:var(--accent-ink); transform:translateY(-1px); }
.exercise-folder .icon { width:28px; height:28px; color:var(--accent-ink); flex:0 0 auto; }
.exercise-folder b, .exercise-folder small { display:block; }
.exercise-folder small { margin-top:5px; color:var(--muted); font-size:12px; }
.exercise-folder > .icon:last-child { margin-left:auto; width:17px; color:var(--muted); }
.folder-back { display:inline-flex; align-items:center; gap:7px; margin:10px 0 0; }
.folder-back .icon { width:16px; height:16px; }
@media (max-width:620px){ .folder-grid { grid-template-columns:1fr; } .library-filters { grid-template-columns:1fr; } .segmented { grid-template-columns:repeat(3,1fr); border-radius:20px; } }
.search { width:100%; border:1px solid var(--line); background:var(--glass); border-radius:18px; min-height:52px; padding:0 16px; color:var(--text); }

.progress-big {
  border-radius:30px; padding:24px; margin-top:20px;
  display:grid; grid-template-columns:1.15fr .85fr; gap:22px; align-items:end;
}
.big-number { font-family:Doto,"Courier New",monospace; font-size:58px; line-height:.9; letter-spacing:-.07em; }
.big-caption { color:var(--muted); margin-top:10px; font-size:13px; }
.bar-chart { display:flex; align-items:end; gap:8px; height:120px; }
.bar { flex:1; background:var(--chip); border-radius:999px 999px 5px 5px; min-height:8px; position:relative; }
.bar.active { background:var(--accent); }
.bar-label { position:absolute; bottom:-21px; left:50%; transform:translateX(-50%); font-size:10px; color:var(--muted); }

.form-card { border-radius:24px; padding:18px; margin-top:12px; }
.form-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:54px; border-bottom:1px solid var(--line); }
.form-row:last-child { border-bottom:0; }
.form-label { font-size:14px; }
.form-value { color:var(--muted); font-size:14px; }
.profile-select { max-width:190px; min-height:42px; border:1px solid var(--line); border-radius:14px; padding:0 36px 0 13px; background:var(--chip); color:var(--text); }
.invite-app-card { border-radius:24px; padding:18px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:18px; }
.invite-app-card .primary-btn { width:auto; white-space:nowrap; }
.profile-identity { border-radius:26px; padding:16px; display:flex; align-items:center; gap:14px; }
.profile-photo-large { width:76px; height:76px; flex:0 0 76px; border-radius:24px; display:grid; place-items:center; overflow:hidden; background:var(--accent); color:#fff; font-weight:700; font-size:20px; }
.profile-name { font-size:23px; font-weight:700; letter-spacing:-.04em; }
.photo-uploader { min-height:94px; padding:10px; display:flex!important; flex-direction:row!important; align-items:center; gap:14px; border:1px dashed var(--line-strong); border-radius:22px; background:var(--chip); cursor:pointer; }
.photo-uploader input { position:absolute; opacity:0; pointer-events:none; }
.photo-uploader b, .photo-uploader small { display:block; }
.photo-uploader small { margin-top:4px; color:var(--muted); }
.onboarding-shell { min-height:100vh; width:min(100%,920px); margin:0 auto; padding:26px; display:flex; flex-direction:column; }
.onboarding-brand { font-size:13px; font-weight:700; letter-spacing:.18em; }
.onboarding-panel { flex:1; display:grid; align-content:center; gap:26px; padding:40px 0; }
.onboarding-copy { max-width:650px; }
.onboarding-copy .dot-h1 { font-size:clamp(48px,10vw,86px); }
.onboarding-copy p { max-width:500px; color:var(--muted); font-size:18px; line-height:1.5; }
.onboarding-index { display:block; margin-bottom:22px; color:var(--accent-ink); font-size:12px; font-weight:700; letter-spacing:.08em; }
.onboarding-visual { position:relative; height:180px; display:grid; place-items:center; overflow:hidden; border-radius:32px; background:#0d0f12; color:#fff; font-family:Doto,monospace; font-size:34px; }
.onboarding-visual picture { position:relative; z-index:2; width:56px; height:56px; }
.onboarding-visual img { width:100%; height:100%; border-radius:28px; box-shadow:0 20px 45px rgba(0,0,0,.28); }
.pulse-ring { position:absolute; width:60px; height:60px; border:1px solid #2452ff; border-radius:50%; box-shadow:0 0 0 24px rgba(36,82,255,.1),0 0 0 48px rgba(36,82,255,.05); }
.onboarding-form {
  width:min(100%,680px); margin:auto; padding:30px;
  display:flex; flex-direction:column; gap:0;
  border-radius:32px;
}
.onboarding-form h1 { margin:0; font-size:42px; letter-spacing:-.05em; }
.onboarding-form > .subcopy { margin-top:9px; }
.onboarding-form .onboarding-index { margin-bottom:18px; }
.onboarding-fields { display:grid; gap:14px; margin-top:26px; }
.onboarding-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.gym-location-grid { grid-template-columns:minmax(0,1fr) 112px; }
.onboarding-field { display:grid; gap:8px; min-width:0; }
.onboarding-field > span:first-child {
  color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.01em;
}
.onboarding-field input,
.onboarding-field select {
  width:100%; min-width:0; min-height:58px;
  border:1px solid var(--line-strong); border-radius:19px;
  background:color-mix(in srgb, var(--glass-strong) 64%, transparent);
  box-shadow:inset 0 1px rgba(255,255,255,.22);
  color:var(--text); padding:0 17px; font-size:16px;
  transition:border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.onboarding-field input::placeholder { color:var(--soft); opacity:1; }
.onboarding-field input:hover,
.onboarding-field select:hover { border-color:color-mix(in srgb, var(--text) 20%, transparent); }
.onboarding-field input:focus,
.onboarding-field select:focus {
  outline:0; border-color:color-mix(in srgb, var(--accent) 62%, transparent);
  background:var(--glass-strong);
  box-shadow:0 0 0 4px var(--accent-soft), inset 0 1px rgba(255,255,255,.3);
}
.select-control { position:relative; display:block; }
.select-control::after {
  content:"⌄"; position:absolute; right:17px; top:50%; transform:translateY(-58%);
  color:var(--muted); font-size:18px; line-height:1; pointer-events:none;
}
.select-control select { appearance:none; -webkit-appearance:none; padding-right:44px; cursor:pointer; }
.onboarding-form .photo-uploader {
  min-height:112px; padding:16px; border-radius:22px;
  border-color:color-mix(in srgb, var(--accent) 22%, var(--line-strong));
  background:color-mix(in srgb, var(--accent-soft) 34%, var(--glass));
}
.onboarding-form .photo-uploader:hover { border-color:color-mix(in srgb, var(--accent) 48%, transparent); }
.onboarding-form .photo-uploader b { color:var(--text); font-size:15px; }
.onboarding-actions { display:grid; grid-template-columns:auto 1fr; gap:10px; margin-top:22px; }
.onboarding-actions .primary-btn, .onboarding-actions .secondary-btn { min-height:56px; }
.onboarding-chat-shell { min-height:100dvh; width:min(100%,760px); margin:0 auto; padding:24px; display:flex; flex-direction:column; gap:22px; }
.onboarding-chat-card { flex:1; min-height:0; padding:24px; border-radius:32px; display:flex; flex-direction:column; }
.onboarding-chat-card header { display:grid; grid-template-columns:1fr auto; align-items:end; gap:4px 16px; padding-bottom:18px; border-bottom:1px solid var(--line); }
.onboarding-chat-card header .eyebrow { grid-column:1/-1; }
.onboarding-chat-card header h1 { margin:0; font-size:clamp(25px,6vw,36px); letter-spacing:-.045em; }
.onboarding-chat-card header h1 i { color:var(--accent-ink); font-style:normal; }
.onboarding-chat-card header p { margin:0; color:var(--muted); font-size:12px; }
.onboarding-transcript { flex:1; min-height:220px; overflow:auto; display:flex; flex-direction:column; justify-content:flex-end; gap:12px; padding:24px 0 18px; }
.onboarding-bubble { max-width:88%; padding:14px 16px; border-radius:20px; line-height:1.5; }
.onboarding-bubble p { margin:0; }
.onboarding-bubble.is-pb { align-self:flex-start; background:var(--chip); border:1px solid var(--line); border-bottom-left-radius:7px; }
.onboarding-bubble.is-pb>span { display:block; margin-bottom:6px; color:var(--accent-ink); }
.onboarding-bubble.is-user { align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:7px; }
.onboarding-quick-replies { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.onboarding-quick-replies button { min-height:40px; padding:0 13px; border:1px solid var(--line); border-radius:999px; background:var(--chip); color:var(--text); cursor:pointer; }
.onboarding-chat-compose { display:grid; grid-template-columns:1fr 48px; gap:8px; padding:8px; border:1px solid var(--line-strong); border-radius:22px; background:var(--glass-strong); }
.onboarding-chat-compose input { min-width:0; border:0; outline:0; padding:0 10px; background:transparent; color:var(--text); font-size:16px; }
.toggle { width:48px; height:28px; border-radius:999px; background:var(--chip); border:1px solid var(--line); padding:3px; cursor:pointer; }
.toggle span { display:block; width:20px; height:20px; border-radius:50%; background:var(--muted); transition:.2s ease; }
.toggle.on { background:var(--accent-soft); }
.toggle.on span { transform:translateX(19px); background:var(--accent); }

.session-shell { padding-bottom: 135px; }
.session-top { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:20px; }
.session-time { font-family:Doto,"Courier New",monospace; font-size:26px; }
.progress-pill { font-size:12px; color:var(--muted); }
.session-card { border-radius:30px; padding:22px; }
.session-actions { display:flex; gap:7px; flex-wrap:wrap; margin:14px 0 4px; }
.session-actions .secondary-btn { display:flex; align-items:center; gap:7px; }
.defer-btn { margin-left:auto; background:var(--accent-soft); color:var(--accent-ink); border-color:color-mix(in srgb, var(--accent) 20%, transparent); }
.defer-symbol { width:48px; height:48px; margin-bottom:16px; display:grid; place-items:center; border-radius:16px; background:var(--accent-soft); color:var(--accent-ink); transform:rotate(90deg); }
.sync-impact { margin-top:18px; padding:14px; display:flex; flex-direction:column; gap:5px; border-radius:18px; background:var(--accent-soft); color:var(--accent-ink); }
.sync-impact.warning { background:color-mix(in srgb, var(--warning) 12%, transparent); color:var(--warning); }
.sync-impact span { font-size:12px; line-height:1.45; }
.defer-sheet .sheet-actions .primary-btn { flex:1; width:auto; }
.shared-session-bar { border-radius:24px; padding:12px 12px 12px 16px; margin-bottom:12px; display:flex; align-items:center; gap:12px; }
.live-dot { width:9px; height:9px; border-radius:50%; flex:0 0 9px; background:var(--accent); box-shadow:0 0 0 6px var(--accent-soft); }
.wave-btn { min-height:54px; border:0; border-radius:18px; padding:0 15px; display:flex; align-items:center; gap:7px; background:var(--accent); color:#fff; cursor:pointer; font-weight:600; }
.wave-btn .icon { width:22px; height:22px; }
.wave-btn.waving .icon { animation:wave .55s ease-in-out; transform-origin:70% 80%; }
@keyframes wave { 0%,100%{transform:rotate(0)} 30%{transform:rotate(22deg)} 65%{transform:rotate(-14deg)} }
.exercise-kicker { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; text-transform:uppercase; }
.session-title { font-family:Doto,"Courier New",monospace; font-size:42px; line-height:.95; letter-spacing:-.055em; margin:13px 0 8px; }
.previous-box { display:flex; gap:16px; flex-wrap:wrap; padding:14px 0 16px; color:var(--muted); font-size:13px; }
.set-table { margin-top:8px; }
.set-head, .set-row { display:grid; grid-template-columns:44px 1fr 1fr 54px; gap:8px; align-items:center; }
.set-head { color:var(--muted); font-size:11px; text-transform:uppercase; padding:0 5px 8px; }
.set-row { margin-bottom:8px; }
.set-no { text-align:center; font-weight:600; }
.set-input { width:100%; min-width:0; border:1px solid var(--line); background:var(--chip); color:var(--text); border-radius:16px; min-height:50px; padding:0 12px; text-align:center; font-size:16px; }
.complete-btn { width:50px; height:50px; border-radius:16px; border:1px solid var(--line); background:var(--chip); cursor:pointer; display:grid; place-items:center; }
.set-row.done { opacity:.72; }
.set-row.done .complete-btn { background:var(--accent); color:white; border-color:transparent; }

.rest-panel { margin:0 0 16px; padding:13px 14px 11px; border-radius:24px; }
.rest-panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.rest-edit { min-width:0; padding:0; border:0; background:transparent; color:inherit; text-align:left; cursor:pointer; display:grid; justify-items:start; }
.rest-label { font-size:10px; color:var(--muted); text-transform:uppercase; }
.rest-time { font-family:Inter,ui-sans-serif,system-ui,sans-serif; font-variant-numeric:tabular-nums; font-size:32px; line-height:1.05; letter-spacing:-.04em; }
.rest-edit-hint { color:var(--muted); font-size:11px; margin-top:2px; }
.rest-edit-hint b { color:var(--accent-ink); font-size:15px; margin-left:2px; }
.rest-controls { display:flex; gap:6px; flex:0 0 auto; }
.rest-controls .secondary-btn { min-width:44px; min-height:44px; padding:0 8px; font-size:.75rem; }
.rest-progress { height:7px; margin-top:11px; overflow:hidden; border-radius:999px; background:color-mix(in srgb,var(--text) 10%,transparent); }
.rest-progress i { display:block; height:100%; border-radius:inherit; background:var(--accent); transition:width .5s linear; }

.sheet-backdrop { position:fixed; inset:0; z-index:60; display:flex; align-items:flex-end; justify-content:center; padding:16px; isolation:isolate; pointer-events:auto; }
body:has(.sheet-backdrop) { overflow:hidden; overscroll-behavior:none; }
.sheet-backdrop::before { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; background:rgba(0,0,0,.48); }
.sheet { position:relative; z-index:1; pointer-events:auto; width:min(100%,720px); max-height:min(82vh,calc(100dvh - 32px)); overflow:auto; border-radius:30px; padding:22px; background:var(--sheet-surface); border:1px solid var(--line-strong); box-shadow:0 24px 80px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.24); }
.sheet-handle { width:44px; height:5px; border-radius:999px; background:var(--soft); margin:0 auto 20px; }
.sheet-drag-zone { margin:-12px -8px 0; padding:12px 8px 4px; cursor:grab; touch-action:none; }
.sheet-drag-zone .sheet-handle { margin-bottom:12px; }
.sheet h2 { margin:0 0 8px; font-size:1.375rem; line-height:1.2; }
.sheet-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; }

/* PB Companion — conversa efêmera, sem persistência ou ações sobre treinos. */
.companion-fab {
  position:fixed; z-index:52; right:max(18px,calc((100vw - 760px)/2 + 18px)); bottom:calc(96px + var(--safe-bottom));
  width:58px; height:58px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.24); border-radius:21px;
  color:#fff; background:linear-gradient(145deg,#123fd0,#002fa7 70%); box-shadow:0 18px 42px rgba(0,47,167,.34),inset 0 1px rgba(255,255,255,.28); cursor:pointer;
}
.companion-fab>span { font-size:25px; line-height:1; transform:translateY(2px); }
.companion-fab>small { font-size:8px; font-weight:700; letter-spacing:.12em; opacity:.76; }
.companion-sheet { height:min(82dvh,720px); max-height:calc(100dvh - 32px); overflow:hidden; display:flex; flex-direction:column; padding-bottom:calc(16px + var(--safe-bottom)); }
.companion-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.companion-head h2 { display:flex; align-items:center; gap:9px; font-size:28px; letter-spacing:-.04em; }
.companion-head h2 i { color:var(--accent-ink); font-style:normal; }
.companion-head .mini-btn { flex:0 0 auto; }
.companion-empty { flex:1; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; padding:26px 2px 18px; }
.companion-mark { width:52px; height:52px; display:grid; place-items:center; margin-bottom:18px; border-radius:18px; background:var(--accent); color:#fff; font-size:24px; box-shadow:0 14px 34px var(--accent-soft); }
.companion-empty h2 { max-width:440px; font-size:clamp(28px,7vw,40px); line-height:1.02; letter-spacing:-.055em; }
.companion-empty>p { max-width:500px; color:var(--muted); line-height:1.5; }
.companion-suggestions { width:100%; display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.companion-suggestions button { min-height:42px; padding:0 14px; border:1px solid var(--line); border-radius:999px; background:var(--chip); color:var(--text); cursor:pointer; font-size:12px; }
.companion-conversation { flex:1; min-height:0; overflow:auto; margin:14px -4px 12px; padding:2px 4px 18px; display:flex; flex-direction:column; gap:12px; }
.companion-message { max-width:88%; padding:14px 16px; border:1px solid var(--line); border-radius:20px; background:var(--chip); }
.companion-message>span { display:block; margin-bottom:7px; color:var(--muted); font-size:9px; font-weight:700; letter-spacing:.1em; }
.companion-message p { margin:0; line-height:1.5; user-select:text; -webkit-user-select:text; }
.companion-message h4 { margin:16px 0 8px; font-size:15px; letter-spacing:-.02em; }
.companion-message h4:first-child { margin-top:0; }
.companion-message p + p { margin-top:9px; }
.training-table { margin:10px -6px 4px; overflow:hidden; border:1px solid var(--line); border-radius:14px; }
.training-table-row { display:grid; grid-template-columns:24px minmax(0,1fr) auto; gap:8px; align-items:start; padding:10px; border-bottom:1px solid var(--line); }
.training-table-row:last-child { border-bottom:0; }
.training-table-row>b { color:var(--accent-ink); font-size:11px; }
.training-table-row>span { min-width:0; font-size:13px; font-weight:600; }
.training-table-row>small { color:var(--muted); font-size:11px; text-align:right; }
.form-help { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.companion-message.is-user { align-self:flex-end; background:var(--accent); border-color:transparent; color:#fff; border-bottom-right-radius:7px; }
.companion-message.is-user>span { color:rgba(255,255,255,.7); }
.companion-message.is-assistant { align-self:flex-start; border-bottom-left-radius:7px; }
.companion-message.is-error { border-color:color-mix(in srgb,var(--warning) 34%,var(--line)); }
.companion-message.is-error button { margin-top:11px; padding:0; border:0; background:transparent; color:var(--accent-ink); cursor:pointer; font-weight:650; font-size:12px; }
.thinking-dots { display:inline-block; margin-left:5px; letter-spacing:.14em; animation:companion-pulse 1.1s ease-in-out infinite; }
.companion-compose { display:grid; grid-template-columns:1fr 48px; align-items:end; gap:8px; padding:8px; border:1px solid var(--line-strong); border-radius:22px; background:var(--glass-strong); }
.companion-compose label { display:block; }
.companion-compose textarea { width:100%; min-height:48px; max-height:120px; resize:none; padding:13px 10px; border:0; outline:0; background:transparent; color:var(--text); line-height:1.4; }
.companion-send { width:48px; height:48px; display:grid; place-items:center; border:0; border-radius:16px; background:var(--accent); color:#fff; cursor:pointer; }
.companion-send:disabled { opacity:.42; }
.companion-send .icon { margin:0; }
@keyframes companion-pulse { 0%,100%{opacity:.35} 50%{opacity:1} }
.summary-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; }
.summary-heading h2 { font-size:34px; letter-spacing:-.05em; }
.summary-duration { flex:0 0 auto; color:var(--accent-ink); font-size:32px; font-weight:650; letter-spacing:-.05em; text-align:right; }
.summary-duration small { display:block; color:var(--muted); font-size:10px; font-weight:500; letter-spacing:.08em; text-transform:uppercase; }
.summary-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:20px 0; }
.summary-metrics > div { min-width:0; padding:14px; border-radius:18px; background:var(--chip); }
.summary-metrics b, .summary-metrics span { display:block; }
.summary-metrics b { max-width:100%; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; font-size:24px; line-height:1.2; }
.summary-metrics > .summary-volume { grid-column:1/-1; }
.summary-metrics span { margin-top:3px; color:var(--muted); font-size:10px; line-height:1.25; }
.week-strip.is-interactive .day { width:100%; padding:0; border:0; background:transparent; color:inherit; cursor:pointer; }
.week-strip.is-interactive .day:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:12px; }
.week-strip.is-interactive .day.selected .day-dot { background:var(--text); color:var(--bg); box-shadow:0 0 0 3px var(--accent-soft); }
.week-strip.is-interactive .day:disabled { opacity:.32; cursor:not-allowed; }
.progression-empty { margin-bottom:16px; }
.progression-overview { margin-bottom:16px; }
.progression-heading { align-items:flex-end; margin:0 2px 12px; }
.progression-heading h2 { margin:3px 0 0; font-size:25px; letter-spacing:-.04em; }
.progression-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.progression-stats>div { min-width:0; padding:14px 12px; border-radius:20px; }
.progression-stats b,.progression-stats span { display:block; }
.progression-stats b { font-size:24px; line-height:1; font-variant-numeric:tabular-nums; }
.progression-stats span { margin-top:7px; color:var(--muted); font-size:10px; line-height:1.25; }
.progression-list-head { margin:22px 2px 10px; }
.progression-list-head h3 { margin:0; font-size:17px; }
.progression-list { display:flex; flex-direction:column; gap:8px; }
.progression-row { width:100%; min-height:76px; padding:12px 11px 12px 14px; display:grid; grid-template-columns:minmax(0,1fr) 88px auto 18px; align-items:center; gap:10px; border-radius:20px; color:var(--text); text-align:left; cursor:pointer; }
.progression-row:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.progression-copy { min-width:0; }
.progression-copy b,.progression-copy small,.progression-value b,.progression-value small { display:block; }
.progression-copy b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.progression-copy small { margin-top:4px; color:var(--muted); font-size:10px; }
.progression-spark { width:88px; height:32px; color:var(--accent-ink); overflow:visible; }
.progression-value { min-width:70px; text-align:right; font-variant-numeric:tabular-nums; }
.progression-value b { font-size:14px; white-space:nowrap; }
.progression-value small { margin-top:4px; color:var(--muted); font-size:10px; white-space:nowrap; }
.progression-value .is-up,.progression-detail-summary .is-up { color:var(--accent-ink); }
.progression-value .is-down,.progression-detail-summary .is-down { color:var(--danger,#e34d59); }
.progression-chevron { color:var(--muted); font-size:24px; }
.progression-detail-summary { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:20px 0 8px; }
.progression-detail-summary>div { padding:15px; border-radius:18px; background:var(--chip); }
.progression-detail-summary b,.progression-detail-summary span { display:block; }
.progression-detail-summary b { font-size:21px; font-variant-numeric:tabular-nums; }
.progression-detail-summary span { margin-top:5px; color:var(--muted); font-size:10px; }
.progression-chart { margin:10px 0; padding:8px 0 0; color:var(--accent-ink); border-bottom:1px solid var(--line); }
.progression-chart svg { display:block; width:100%; height:auto; }
.progression-records { margin:6px 0 18px; }
.progression-records>div { min-height:46px; display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:9px; border-bottom:1px solid var(--line); font-size:13px; }
.progression-records span,.progression-records small { color:var(--muted); }
.progression-records small { font-size:9px; text-transform:uppercase; }
.summary-exercises { display:flex; flex-direction:column; gap:8px; }
.summary-exercise { display:flex; align-items:center; gap:11px; padding:10px 0; border-bottom:1px solid var(--line); }
.summary-exercise:last-child { border-bottom:0; }
.summary-exercise .exercise-thumb { width:46px; height:46px; flex-basis:46px; border-radius:14px; }
.summary-order { width:22px; color:var(--muted); font-size:10px; font-variant-numeric:tabular-nums; }
.summary-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:20px; }
.summary-actions .danger-text { grid-column:1/-1; color:var(--danger,#e34d59); justify-self:center; }
.compact-sheet { max-width:520px; }
.workout-action-backdrop { touch-action:none; }
.workout-action-sheet { contain:layout paint; transform-origin:bottom center; }
.workout-choice-list { display:flex; flex-direction:column; gap:9px; margin-top:20px; }
.workout-choice { width:100%; min-height:76px; padding:12px; display:flex; align-items:center; gap:12px; text-align:left; color:var(--text); background:var(--chip); border:1px solid var(--line); border-radius:20px; cursor:pointer; }
.workout-choice.selected { border-color:color-mix(in srgb, var(--accent) 46%, var(--line)); box-shadow:inset 0 0 0 1px var(--accent-soft); }
.workout-choice:disabled { opacity:.52; cursor:not-allowed; }
.workout-choice .icon { flex:0 0 20px; color:var(--muted); }
.workout-choice .row-title, .workout-choice .row-sub { display:block; }
.workout-choice .row-sub { line-height:1.35; }
.choice-order { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:14px; background:var(--glass-strong); color:var(--muted); font-size:12px; font-weight:700; }
.workout-choice.selected .choice-order { background:var(--accent); color:#fff; }

.empty { text-align:center; padding:48px 22px; color:var(--muted); }
.toast { position:fixed; left:50%; bottom:100px; transform:translateX(-50%) translateY(14px); background:var(--text); color:var(--bg); border-radius:999px; padding:11px 16px; font-size:13px; opacity:0; pointer-events:none; transition:.22s ease; z-index:100; }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

@media (max-width: 440px) {
  .app-shell { padding-left:14px; padding-right:14px; }
  .hero-card { padding:20px; }
  .hero-title { font-size:34px; }
  .stat-card { padding:13px 11px; min-height:104px; }
  .stat-value { font-size:22px; }
  .recovery-grid { grid-template-columns: repeat(2,1fr); }
  .progress-big { grid-template-columns:1fr; }
  .set-head, .set-row { grid-template-columns:38px 1fr 1fr 50px; gap:6px; }
  .workout-choice .badge { display:none; }
  .shared-workout-card { align-items:flex-start; flex-wrap:wrap; }
  .shared-workout-card .secondary-btn { width:100%; }
  .wave-btn span { display:none; }
  .defer-btn { width:100%; margin-left:0; justify-content:center; }
  .share-mode { grid-template-columns:1fr; }
  .invite-app-card { grid-template-columns:1fr; }
  .invite-app-card .primary-btn { width:100%; }
  .profile-identity { align-items:flex-start; flex-wrap:wrap; }
  .profile-identity .secondary-btn { width:100%; }
  .onboarding-shell { padding:20px; }
  .onboarding-form { padding:22px 18px; border-radius:26px; }
  .onboarding-form h1 { font-size:36px; }
  .onboarding-field-grid { grid-template-columns:1fr; }
  .gym-location-grid { grid-template-columns:minmax(0,1fr) 94px; }
  .progression-row { grid-template-columns:minmax(0,1fr) 62px auto 14px; gap:7px; }
  .progression-spark { width:62px; }
}

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

/* Imagem editorial, referências de máquinas e academia colaborativa. */
.hero-photo-card { isolation:isolate; background:var(--glass-strong); }
.hero-photo-card::before,
.hero-photo-card::after { display:none; }
.hero-photo-blur {
  position:absolute;
  z-index:0;
  inset:-10px;
  background:
    linear-gradient(90deg, var(--sheet-surface) 2%, color-mix(in srgb, var(--sheet-surface) 92%, transparent) 34%, color-mix(in srgb, var(--sheet-surface) 42%, transparent) 62%, rgba(0,0,0,.08) 100%),
    url('./assets/workout-editorial-v2.jpg') 66% center/cover no-repeat;
  filter: blur(5px) saturate(.78) contrast(1.08);
  opacity:.92;
  transform:scale(1.035);
}
.program-photo-card { isolation:isolate; color:#f7f8fb; background:#121418; }
.program-photo-card::before, .program-photo-card::after { display:none; }
.program-photo-blur {
  position:absolute; z-index:0; inset:-12px;
  background:linear-gradient(90deg,rgba(7,9,12,.93) 0%,rgba(7,9,12,.76) 42%,rgba(7,9,12,.28) 100%),var(--program-image) 62% center/cover no-repeat;
  filter:blur(4px) saturate(.76) contrast(1.05); transform:scale(1.035);
}
.program-photo-card .hero-label, .program-photo-card .hero-meta { color:rgba(245,247,250,.72); }
.program-photo-card .hero-title { color:#fff; }
.program-workout-card { position:relative; isolation:isolate; overflow:hidden; background:var(--glass); }
.program-workout-card::before { content:""; position:absolute; z-index:-1; inset:0; opacity:.72; background:radial-gradient(circle at 8% 0%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 42%),radial-gradient(circle at 100% 100%,color-mix(in srgb,var(--text) 7%,transparent),transparent 48%),linear-gradient(132deg,transparent 20%,color-mix(in srgb,var(--chip) 74%,transparent)); }
.program-workout-card::after { content:""; position:absolute; z-index:-1; inset:0; opacity:.22; background-image:radial-gradient(var(--text) .6px,transparent .7px); background-size:5px 5px; mask-image:linear-gradient(120deg,transparent,black 35%,transparent 80%); }
.training-entry-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0 0 18px; }
.training-entry-actions .text-btn { grid-column:1/-1; justify-self:center; }
.reorder-grip { display:inline-flex; flex:0 0 44px; align-items:center; justify-content:center; width:44px; height:44px; border:1px solid var(--line); border-radius:11px; color:var(--muted); background:color-mix(in srgb,var(--chip) 72%,transparent); font-size:20px; cursor:grab; user-select:none; touch-action:none; transition:color .16s ease,background .16s ease,border-color .16s ease,transform .16s ease; }
.reorder-grip:hover { color:var(--accent-ink); border-color:color-mix(in srgb,var(--accent) 45%,var(--line)); background:color-mix(in srgb,var(--accent) 10%,var(--chip)); }
.reorder-grip:active { cursor:grabbing; transform:scale(.94); }
.program-workout-card { transition:opacity .16s ease,transform .16s ease,box-shadow .16s ease,border-color .16s ease; }
.workout-action-list { margin-top:18px; }
.danger-choice b,.danger-choice small { color:var(--muted); }

/* Execução: uma série por vez, com quadro de movimento discreto. */
.exercise-detail-meta { margin:8px 0 18px; }
.exercise-detail-backdrop { --drag-progress:0; }
.exercise-detail-backdrop::before { opacity:calc(1 - var(--drag-progress)); }
.exercise-detail-sheet { will-change:transform; overscroll-behavior:contain; }
.exercise-detail-sheet.is-dragging { animation:none; transition:none; cursor:grabbing; user-select:none; }
.exercise-detail-backdrop.is-drag-dismiss .exercise-detail-sheet { animation:none; }
.exercise-detail-sheet .summary-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
.exercise-detail-sheet .summary-metrics b { max-width:100%; overflow-wrap:anywhere; font-size:clamp(17px,5vw,22px); line-height:1.08; }
.exercise-motion-frame { width:100%; height:auto; aspect-ratio:16/9; position:relative; overflow:hidden; border-radius:20px; margin:0 0 22px; background:var(--chip); border:1px solid var(--line); contain:layout paint; }
.exercise-motion-frame.has-video { aspect-ratio:16/9; background:#000; }
.exercise-motion-embed { position:relative; z-index:1; display:block; width:100%; height:100%; border:0; background:transparent; pointer-events:none; }
.exercise-motion-embed.is-interactive { pointer-events:auto; }
.exercise-motion-video { position:relative; z-index:1; display:block; width:100%; height:100%; object-fit:contain; background:#000; }
.exercise-motion-loading { position:absolute; inset:0; display:grid; place-content:center; justify-items:center; gap:9px; color:var(--muted); }
.exercise-motion-loading span { width:24px; height:24px; border:2px solid var(--line-strong); border-top-color:var(--accent-ink); border-radius:50%; animation:pb-spin .8s linear infinite; }
.exercise-motion-loading small { font-size:11px; }
.current-set-card { margin-top:14px; padding:15px; border-radius:var(--radius-lg); background:color-mix(in srgb,var(--chip) 80%,transparent); border:1px solid var(--line); }
.set-progress { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; font-size:12px; color:var(--muted); }
.set-progress b { color:var(--text); font-size:19px; }.set-progress small { color:var(--soft); font-size:12px; }
.current-set-inputs { display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:end; }
.current-set-inputs label { position:relative; display:block; }.current-set-inputs label>span { display:block; margin:0 0 5px 4px; color:var(--muted); font-size:10px; text-transform:uppercase; }.current-set-inputs label small { position:absolute; right:12px; bottom:16px; color:var(--soft); font-size:11px; pointer-events:none; }
.current-set-inputs .set-input { padding-right:32px; }
.completed-sets-note { margin-top:10px; color:var(--muted); font-size:12px; text-align:center; }

/* Perfil: linhas calmas, ações com uma única escala. */
.form-card .form-row { padding:12px 0; min-height:62px; }
.form-card .form-row > :last-child:not(.form-value) { flex:0 0 auto; min-width:116px; min-height:42px; display:inline-flex; align-items:center; justify-content:center; text-align:center; white-space:nowrap; }
.form-card .form-row .code-chip { min-width:128px; letter-spacing:.07em; }
.form-card .account-hint { display:block; max-width:190px; margin-top:3px; line-height:1.3; }
.form-card .text-btn { min-width:auto !important; padding:0 8px; }
.gym-list { display:grid; gap:8px; margin:10px 0 20px; }
.gym-search { margin:12px 0 14px; }
.gym-search-results { display:grid; gap:8px; max-height:42vh; overflow:auto; margin-bottom:14px; }
.gym-option { width:100%; display:flex; align-items:center; gap:10px; padding:13px 14px; border:1px solid var(--line); border-radius:18px; background:var(--glass); color:var(--text); text-align:left; cursor:pointer; }
.gym-option.selected { border-color:color-mix(in srgb,var(--accent) 46%,var(--line)); background:color-mix(in srgb,var(--accent) 9%,var(--glass)); }
.gym-option .row-body { display:grid; gap:3px; }
.gym-option small { color:var(--muted); }
.gym-option .badge, .gym-option .icon { margin-left:auto; flex:0 0 auto; }
@media (max-width:390px){.form-card .form-row > :last-child:not(.form-value){min-width:102px;font-size:12px}.form-card .account-hint{max-width:150px}}
:root[data-theme="dark"] .hero-photo-blur {
  background:
    linear-gradient(90deg, #111316 2%, rgba(17,19,22,.94) 34%, rgba(17,19,22,.48) 62%, rgba(0,0,0,.1) 100%),
    url('./assets/workout-editorial-v2.jpg') 66% center/cover no-repeat;
  opacity:.9;
  filter:blur(5px) saturate(.7) brightness(.72) contrast(1.1);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .hero-photo-blur {
    background:
      linear-gradient(90deg, #111316 2%, rgba(17,19,22,.94) 34%, rgba(17,19,22,.48) 62%, rgba(0,0,0,.1) 100%),
      url('./assets/workout-editorial-v2.jpg') 66% center/cover no-repeat;
    opacity:.9;
    filter:blur(5px) saturate(.7) brightness(.72) contrast(1.1);
  }
}

.machine-thumb { position:relative; overflow:visible; }
.machine-ref {
  display:inline-grid;
  place-items:center;
  min-width:31px;
  height:31px;
  padding:0 7px;
  border-radius:11px;
  background:var(--accent);
  color:#fff;
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
  box-shadow:0 7px 18px rgba(0,47,167,.22);
  line-height:1;
  flex:0 0 auto;
}
.machine-thumb .machine-ref {
  position:absolute;
  right:-9px;
  top:-10px;
  min-width:27px;
  height:27px;
  border-radius:9px;
  border:2px solid var(--bg);
  box-shadow:0 7px 16px rgba(0,47,167,.22);
}
.exercise-kicker .machine-ref { margin-right:2px; }

.gym-card {
  border-radius:26px;
  padding:20px;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:end;
  gap:18px;
}
.gym-title { font-size:26px; letter-spacing:-.04em; font-weight:650; margin:7px 0 3px; }
.gym-ref-count { text-align:right; color:var(--muted); font-size:11px; line-height:1.3; }
.big-ref-number { font-family:Doto,"Courier New",monospace; display:block; color:var(--text); font-size:34px; line-height:.95; margin-bottom:4px; }
.contribution-card { border-radius:26px; padding:20px; display:grid; gap:18px; }
.contribution-copy { max-width:580px; }
.contribution-icon {
  width:48px;height:48px;border-radius:15px;display:grid;place-items:center;
  background:var(--accent-soft); color:var(--accent-ink); font-family:Doto,"Courier New",monospace;font-size:22px;font-weight:700;
}

.stack-form { display:grid; gap:15px; margin-top:20px; }
.stack-form label { display:grid; gap:7px; font-size:12px; color:var(--muted); }
.stack-form input,
.stack-form textarea,
.stack-form select {
  width:100%;
  min-height:50px;
  border:1px solid var(--line);
  border-radius:var(--radius-md);
  background:var(--chip);
  color:var(--text);
  padding:12px 14px;
  font-size:16px;
  resize:vertical;
}
.stack-form textarea { min-height:92px; }
.stack-form input[type="checkbox"], .stack-form input[type="radio"] { width:18px; min-width:18px; height:18px; min-height:18px; padding:0; border-radius:4px; accent-color:var(--accent-ink); }
.stack-form .check-row { display:flex; align-items:flex-start; gap:10px; line-height:1.4; }
.stack-form .check-row input { flex:0 0 18px; margin-top:1px; }
.form-columns { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.library-create-row { display:flex; justify-content:flex-end; margin:10px 0 4px; }
.library-create-btn { display:inline-flex; align-items:center; gap:6px; padding:6px 2px; color:var(--muted); font-size:13px; }
.library-create-btn:hover { color:var(--text); }
.library-create-btn .icon { width:15px; height:15px; }
.editor-add-btn { margin-top:18px; width:100%; }
.editor-list { margin-top:14px; }
.editor-empty { margin-top:14px; border:1px dashed var(--line-strong); border-radius:20px; }
.editor-row { align-items:center; }
.editor-row .row-actions { flex-wrap:wrap; justify-content:flex-end; max-width:180px; }
.danger-mini { color:var(--danger, #e34d59); }
.exercise-picker { display:grid; gap:9px; margin-top:16px; max-height:48vh; overflow:auto; padding:2px; }
.picker-row { background:var(--glass); backdrop-filter:none; -webkit-backdrop-filter:none; width:100%; display:flex; align-items:center; gap:12px; border:0; border-radius:20px; padding:11px; color:inherit; text-align:left; cursor:pointer; }
.picker-row > .icon { color:var(--accent-ink); flex:0 0 auto; }
.prescription-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.prescription-grid label:last-child { grid-column:1/-1; }
.file-drop {
  position:relative;
  min-height:112px;
  border:1px dashed var(--line-strong);
  border-radius:20px;
  background:var(--chip);
  align-content:center;
  justify-items:center;
  text-align:center;
  padding:18px;
  cursor:pointer;
}
.file-drop input { position:absolute; inset:0; opacity:0; cursor:pointer; min-height:0; padding:0; }
.file-drop b { color:var(--text); font-size:15px; }
.file-drop small { color:var(--muted); font-size:12px; }

@media (max-width:430px) {
  .onboarding-chat-shell { padding:16px; }
  .onboarding-chat-card { padding:18px; border-radius:26px; }
  .onboarding-chat-card header { align-items:start; }
  .onboarding-transcript { padding-top:18px; }
  .onboarding-quick-replies { flex-wrap:nowrap; overflow-x:auto; padding-bottom:3px; }
  .onboarding-quick-replies button { flex:0 0 auto; }
  .shared-workout-sheet { padding:20px 18px; }
  .shared-workout-form .form-columns { grid-template-columns:1fr; }
  .shared-workout-form .sheet-actions { display:grid; grid-template-columns:1fr; }
  .shared-workout-form .sheet-actions .primary-btn, .shared-workout-form .sheet-actions .secondary-btn { width:100%; }
  .gym-card { grid-template-columns:1fr; }
  .gym-ref-count { text-align:left; display:flex; align-items:baseline; gap:8px; }
  .big-ref-number { display:inline; }
  .form-columns { grid-template-columns:1fr; }
  .editor-row { align-items:flex-start; }
  .editor-row .row-actions { max-width:96px; }
  .workout-card { align-items:flex-start; }
  .workout-card .row-actions { flex-direction:column; }
  .summary-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .summary-metrics > div { padding:11px 9px; }
}

@media (max-width:600px) {
  .companion-backdrop { padding:0; }
  .companion-sheet { width:100%; height:100dvh; max-height:100dvh; border-radius:0; border-left:0; border-right:0; padding:calc(18px + env(safe-area-inset-top,0px)) 20px max(28px,calc(18px + env(safe-area-inset-bottom,0px))); }
  .companion-sheet>.sheet-handle { display:none; }
  .companion-empty { justify-content:flex-start; padding-top:22px; }
  .companion-conversation { margin-top:10px; }
  .companion-compose { flex:0 0 auto; margin-bottom:0; }
}

/* Dot-matrix fica restrita aos H1s; métricas e timers usam sans com numerais tabulares. */
.big-number,
.session-time,
.rest-time,
.big-ref-number,
.contribution-icon {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing:-.04em;
}

/* Movimento, hierarquia de ações, estados de exercício e resumo de sessão. */

/* --- Seleção de texto: UI não é conteúdo copiável ------------------------ */
body,
button, .primary-btn, .secondary-btn, .tertiary-btn, .icon-btn, .mini-btn, .text-btn,
.brand, .dot-h1, .page-title, .hero-title, .session-title, .big-number, .summary-duration,
.row-title, .row-sub, .stat-value, .stat-label, .eyebrow, .hero-label, .hero-meta, .hero-stat,
.segmented, .segmented button, .badge, .chip, .day, .day-dot, .day-label,
.session-time, .rest-time, .rest-label, .progress-pill, .queue-status, .exercise-kicker,
.bottom-nav, .nav-btn, .sheet-handle, .toast, .machine-ref, .summary-metrics,
.form-label, .form-value, .stack-form label, .share-mode span, .contact-card {
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, select, [contenteditable="true"],
.selectable, .notes, .exercise-instructions, .summary-note {
  -webkit-user-select: text;
  user-select: text;
}

/* --- Movimento: entrada de baixo para cima com fade e blur ---------------- */
@keyframes pb-backdrop-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pb-backdrop-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@keyframes pb-sheet-in {
  from { opacity: 0; transform: translateY(26px) scale(.985);  }

  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes pb-sheet-out {
  from { opacity: 1; transform: none; filter: none; }
  to   { opacity: 0; transform: translateY(22px) scale(.99);  }
}
@keyframes pb-rise-in {
  from { opacity: 0; transform: translateY(14px);  }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes pb-rest-in {
  from { opacity: 0; transform: translateY(22px);  }
  to   { opacity: 1; transform: translateY(0); filter: none; }
}
@keyframes pb-spin { to { transform:rotate(360deg); } }
@keyframes pb-check-pop {
  0%   { transform: scale(1); }
  42%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
@keyframes pb-queue-settle {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.sheet-backdrop::before { animation: pb-backdrop-in .26s ease both; }
.sheet { animation: pb-sheet-in .38s cubic-bezier(.22,1,.36,1) both; }
.sheet-backdrop.is-closing::before { animation: pb-backdrop-out .2s ease both; }
.sheet-backdrop.is-closing .sheet { animation: pb-sheet-out .2s cubic-bezier(.4,0,1,1) both; }

.view-rise { animation: pb-rise-in .34s cubic-bezier(.22,1,.36,1) both; }
.view-rise-late { animation: pb-rise-in .34s cubic-bezier(.22,1,.36,1) .06s both; }
.rest-panel { animation: pb-rest-in .32s cubic-bezier(.22,1,.36,1) both; }
.set-row { transition: opacity .24s ease, background-color .24s ease; }
.complete-btn { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.complete-btn.just-done { animation: pb-check-pop .34s cubic-bezier(.22,1,.36,1); }
.queue-item.just-moved { animation: pb-queue-settle .34s cubic-bezier(.22,1,.36,1) both; }
.session-card.exercise-cleared { animation: pb-sheet-out .18s ease both; }

/* --- Sessão: hierarquia de ações ---------------------------------------- */
.session-utilities { display:flex; gap:7px; flex-wrap:wrap; margin:14px 0 2px; }
.session-utilities .secondary-btn { display:flex; align-items:center; gap:7px; min-height:42px; font-size:14px; }
.action-stack { display:flex; flex-direction:column; align-items:stretch; gap:10px; margin-top:20px; }
.action-stack .primary-btn { min-height:48px; font-size:.9375rem; }
.action-skip {
  width:100%; display:flex; align-items:center; justify-content:center; gap:8px;
  min-height:48px; background:transparent; border:1px solid var(--line-strong); color:var(--text);
}
.tertiary-btn {
  align-self:center; border:0; background:transparent; cursor:pointer;
  min-height:38px; padding:0 10px; font-size:13px; color:var(--muted);
  text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--line-strong);
}
.tertiary-btn:hover { color:var(--text); }
.action-hint { margin:2px 0 0; text-align:center; color:var(--soft); font-size:12px; line-height:1.35; }

/* --- Altura estável dos cards de exercício ------------------------------- */
.session-title {
  font-size:clamp(1.5rem,6vw,2rem);
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  overflow:hidden; line-height:1.02; min-height:calc(2 * 1.02em);
}

/* Compact, readable AI review and factual load history. */
.ai-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:.8125rem; margin-bottom:12px; }
.ai-toolbar select,.load-progression select { min-height:44px; max-width:100%; padding:8px; border:1px solid var(--line); border-radius:12px; background:var(--sheet-surface); color:var(--text); font-size:1rem; }
.ai-photos { font-size:.8125rem; margin:8px 0; }
.ai-photos summary { cursor:pointer; padding:12px 0; min-height:44px; }
.ai-photos input { max-width:100%; }
.ai-photos p { line-height:1.5; color:var(--muted); }
.ai-review-list { padding-left:20px; }
.ai-review-list li { margin-bottom:12px; line-height:1.4; }
.ai-review-list span { display:block; color:var(--muted); font-size:.875rem; }
.ai-equipment-choice { display:flex; align-items:center; gap:8px; min-height:44px; }
.ai-equipment-choice input { width:18px; height:18px; }
.load-progression { padding:18px; border-radius:24px; margin:16px 0; }
.load-progression h2 { font-size:1.125rem; margin:0 0 12px; }
.load-progression label { display:grid; gap:8px; font-size:.8125rem; }
.load-progression svg { display:block; width:100%; max-height:180px; color:var(--accent-ink); }
.load-points { display:grid; grid-template-columns:repeat(auto-fit,minmax(72px,1fr)); gap:12px; }
.load-points span { display:grid; gap:4px; font-size:.8125rem; }
.load-points small { color:var(--muted); }
.analysis-button { margin-bottom:18px; }
.rest-panel-head { flex-wrap:wrap; gap:8px; }
.companion-sheet .companion-head h2 { font-size:1.5rem; }
.companion-message .training-table-row { display:block; line-height:1.5; }
.companion-message .training-table-row > b { margin-right:8px; }
.companion-message .training-table-row small { display:block; padding-left:16px; }
.queue-item, .exercise-row, .workout-row { min-height:86px; }
.queue-item .row-title, .exercise-row .row-title, .picker-row .row-title {
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2;
  overflow:hidden; line-height:1.3; min-height:2.6em;
}
.queue-item .row-sub, .exercise-row .row-sub {
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}

/* --- Estados do exercício na fila ---------------------------------------- */
.queue-list { margin-top:2px; }
.queue-item { width:100%; border-radius:22px; padding:14px 16px; display:flex; align-items:center; gap:14px; color:var(--text); text-align:left; cursor:pointer; }
.queue-item:disabled { cursor:default; }
.queue-status {
  flex:0 0 auto; padding:5px 10px; border-radius:999px;
  background:var(--chip); color:var(--muted); font-size:11px; font-weight:600; letter-spacing:.01em;
}
.queue-item.is-active { border-color:color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow:inset 0 0 0 1px var(--accent-soft), var(--shadow); }
.queue-item.is-active .queue-status { background:var(--accent-soft); color:var(--accent-ink); }
.queue-item.is-completed .queue-status { background:color-mix(in srgb, var(--good) 14%, transparent); color:var(--good); }
.queue-item.is-completed .row-title { text-decoration:line-through; text-decoration-color:var(--soft); }
.queue-item.is-deferred .queue-status { background:color-mix(in srgb, var(--warning) 14%, transparent); color:var(--warning); }
.queue-item.is-not-performed { opacity:.46; }
.queue-item.is-not-performed .queue-status { background:var(--chip); color:var(--muted); }

/* --- Finalizar treino: manual, discreto, no fim de tudo ------------------- */
.session-finish-zone { margin:34px 2px calc(24px + var(--safe-bottom)); display:flex; flex-direction:column; align-items:center; gap:8px; }
.session-finish-btn {
  width:100%; max-width:340px; min-height:48px; border-radius:999px; cursor:pointer;
  background:transparent; border:1px solid var(--line-strong); color:var(--muted);
}
.session-finish-btn:hover { color:var(--text); }
.session-finish-note { color:var(--soft); font-size:12px; text-align:center; line-height:1.4; }
.session-shell { padding-bottom: calc(170px + var(--safe-bottom)); }

/* --- Resumo da sessão ---------------------------------------------------- */
.summary-shell { padding-bottom: calc(60px + var(--safe-bottom)); }
.summary-card { border-radius:30px; padding:24px; margin-top:8px; }
.summary-shell .summary-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
.summary-shell .summary-metrics b { max-width:100%; overflow-wrap:anywhere; font-variant-numeric:tabular-nums; font-size:clamp(20px,5.5vw,28px); line-height:1.2; }
.summary-shell .topbar>div:first-child { min-width:0; }
.summary-shell .avatar { flex-shrink:0; aspect-ratio:1; }
.summary-shell .summary-record { flex-wrap:wrap; }
.summary-shell .summary-record>span:not(.icon):not(.badge) { min-width:0; flex:1; overflow-wrap:anywhere; }
.summary-shell .summary-record .badge { flex-shrink:0; }
@media(min-width:600px){ .summary-shell .summary-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.summary-sub { color:var(--muted); font-size:14px; margin:6px 0 0; }
.summary-block { margin-top:22px; }
.summary-block h3 { margin:0 0 10px; font-size:14px; letter-spacing:.02em; color:var(--muted); font-weight:600; }
.summary-line { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--line); }
.summary-line:last-child { border-bottom:0; }
.summary-line b { font-weight:600; }
.summary-line .queue-status { flex:0 0 auto; }
.summary-record { display:flex; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--line); }
.summary-record:last-child { border-bottom:0; }
.summary-record .icon { color:var(--accent-ink); flex:0 0 20px; }
.feedback-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.feedback-btn {
  min-height:70px; padding:10px; border-radius:18px; cursor:pointer;
  background:var(--chip); border:1px solid var(--line); color:var(--text);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size:13px;
}
.feedback-btn small { color:var(--muted); font-size:11px; }
.feedback-btn.selected { border-color:var(--accent-ink); box-shadow:inset 0 0 0 1px var(--accent-soft); }
.feedback-btn.selected small { color:var(--accent-ink); }
.summary-progress-bar { height:8px; border-radius:999px; background:var(--chip); overflow:hidden; margin-top:10px; }
.summary-progress-bar i { display:block; height:100%; border-radius:inherit; background:var(--accent); transition:width .5s cubic-bezier(.22,1,.36,1); }

/* --- Avatares sempre circulares, nunca deformados ------------------------ */
.avatar-mini, .contact-avatar, .profile-photo-large {
  flex-shrink: 0;
  overflow: hidden;
}
.exercise-thumb { flex-shrink:0; }
.exercise-thumb.machine-thumb { overflow:visible; }
.avatar, .avatar-mini, .contact-avatar, .profile-photo-large {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
}
.avatar { width:46px; height:46px; flex:0 0 46px; }
.avatar-mini { width:38px; height:38px; flex:0 0 38px; }
.contact-avatar { width:44px; height:44px; flex:0 0 44px; }
.profile-photo-large { width:76px; height:76px; flex:0 0 76px; }
.avatar img, .avatar-mini img, .contact-avatar img, .profile-photo-large img {
  width:100%; height:100%; object-fit:cover; object-position:center; border-radius:50%; display:block;
}

/* --- Operação, avisos e primeiro acesso -------------------------------- */
.header-actions { display:flex; align-items:center; gap:10px; }
.notification-btn { position:relative; width:42px; height:42px; display:grid; place-items:center; border-radius:50%; border:1px solid var(--line); background:var(--glass); color:var(--text); cursor:pointer; }
.notification-btn .icon { width:19px; height:19px; }
.notification-btn i { position:absolute; top:-4px; right:-6px; min-width:17px; height:17px; padding:0 4px; display:grid; place-items:center; border-radius:999px; background:var(--accent); border:2px solid var(--bg); color:#fff; font-style:normal; font-size:9px; font-weight:700; }
.install-guide .onboarding-panel { max-width:620px; }
.install-card { padding:18px; border-radius:24px; display:grid; grid-template-columns:auto 1fr; gap:17px; align-items:start; }
.install-icon { width:42px; height:42px; border-radius:16px; display:grid; place-items:center; background:var(--accent); color:#fff; }
.install-card ol { margin:0; padding-left:20px; display:grid; gap:9px; color:var(--muted); line-height:1.35; }
.notifications-sheet .section-head { margin-top:0; }
.notification-row { display:flex; gap:12px; padding:15px 4px; border-bottom:1px solid var(--line); }
.notification-row.unread { background:color-mix(in srgb, var(--accent) 7%, transparent); margin:0 -6px; padding:15px 10px; border-radius:16px; border-bottom:0; }
.notification-mark { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border-radius:14px; background:var(--chip); color:var(--accent-ink); }
.notification-row small { display:block; color:var(--muted); margin-top:3px; line-height:1.35; }
.choice-stack { display:grid; gap:10px; margin:22px 0; }
.choice-card { text-align:left; border:1px solid var(--line); color:var(--text); padding:17px; border-radius:20px; cursor:pointer; }
.choice-card b,.choice-card small { display:block; }
.choice-card small { margin-top:4px; color:var(--muted); line-height:1.35; }
.equipment-choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.equipment-choice { position:relative; }
.equipment-choice input { position:absolute; opacity:0; }
.equipment-choice span { display:block; padding:13px; border:1px solid var(--line); border-radius:14px; color:var(--muted); }
.equipment-choice input:checked + span { border-color:var(--accent-ink); color:var(--text); background:var(--accent-soft); }
.admin-shell { padding-bottom:calc(40px + var(--safe-bottom)); }
.admin-hero { padding:22px; border-radius:26px; margin:22px 0; }
.admin-hero h2 { margin:6px 0; font-size:30px; letter-spacing:-.04em; }
.admin-hero p,.admin-request p { margin:0; color:var(--muted); line-height:1.4; }
.admin-request { padding:17px; border-radius:22px; }
.admin-request h3 { margin:12px 0 4px; }
.admin-request-head { display:flex; align-items:center; justify-content:space-between; color:var(--muted); font-size:12px; }
.admin-note { margin:14px 0; padding:12px; border-left:2px solid var(--accent); color:var(--muted); background:var(--chip); border-radius:0 12px 12px 0; white-space:pre-wrap; }
.admin-request .primary-btn { margin-top:16px; width:100%; }
.admin-tabs { display:flex; gap:7px; overflow-x:auto; padding:3px 0 12px; scrollbar-width:none; }
.admin-tabs button { flex:0 0 auto; min-height:38px; padding:0 14px; border:1px solid var(--line); border-radius:999px; background:var(--chip); color:var(--muted); cursor:pointer; }
.admin-tabs button.active { background:var(--text); color:var(--bg); border-color:var(--text); }
.admin-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; }
.admin-toolbar .search { flex:1; min-width:0; }
.admin-toolbar .primary-btn { width:auto; flex:0 0 auto; }
.admin-catalog-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:12px 0 18px; }
.admin-catalog-summary span { padding:13px; border-radius:18px; background:var(--chip); color:var(--muted); font-size:11px; }
.admin-catalog-summary b { display:block; color:var(--text); font-size:20px; margin-bottom:2px; }
.admin-table { display:grid; gap:8px; }
.admin-table-row { width:100%; display:grid; grid-template-columns:42px minmax(0,1fr) auto auto; align-items:center; gap:11px; padding:12px; border:1px solid var(--line); border-radius:18px; background:var(--glass); color:var(--text); text-align:left; cursor:pointer; }
.admin-table-row b,.admin-table-row small { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.admin-table-row small { color:var(--muted); margin-top:3px; }
.admin-media-dot { width:40px; height:40px; display:grid; place-items:center; border-radius:14px; background:var(--chip); color:var(--muted); }
.admin-media-dot.has-media { background:var(--accent-soft); color:var(--accent-ink); }
.admin-video-empty { min-height:150px; margin:14px 0; display:grid; place-items:center; padding:20px; border-radius:20px; background:var(--chip); color:var(--muted); text-align:center; }
.admin-contribution-photos { display:flex; gap:8px; flex-wrap:wrap; margin:14px 0; }
.cardio-inputs { grid-template-columns:repeat(3,minmax(0,1fr)); }
.cardio-inputs label small { max-width:44%; overflow:hidden; text-overflow:ellipsis; }

@media (max-width: 440px) {
  .feedback-grid { grid-template-columns:1fr; }
  .queue-item { padding:12px 13px; gap:11px; }
  .session-utilities .secondary-btn { flex:1; justify-content:center; }
  .equipment-choice-grid { grid-template-columns:1fr; }
  .cardio-inputs { grid-template-columns:1fr 1fr; }
  .admin-catalog-summary { grid-template-columns:1fr 1fr 1fr; }
  .admin-table-row { grid-template-columns:40px minmax(0,1fr) auto; }
  .admin-table-row .badge { display:none; }
}

/* Sheets share the same handle gesture on touch devices. */
.sheet{position:relative;overscroll-behavior:contain}
.sheet-handle,.sheet-drag-zone{touch-action:none;cursor:grab;min-height:24px}
.sheet-close{position:sticky;top:0;float:right;z-index:3;background:var(--bg,#f4f4f0)}
.sheet.is-dragging{transition:none!important}
.workout-edit-top{margin:0 0 18px}
.workout-editor-sheet{max-height:calc(100dvh - 24px);-webkit-overflow-scrolling:touch}
.exercise-motion-frame{position:relative;background:var(--surface,#ecece8)}
.exercise-motion-video{object-fit:contain;pointer-events:none}
.media-status{position:absolute;inset:0;display:grid;place-items:center;padding:24px;text-align:center}
.media-retry{position:absolute;bottom:12px;left:12px;z-index:1}
.is-ready .media-status,.is-ready .media-retry{display:none}
.media-missing{display:grid;place-items:center;text-align:center;padding:24px}
.info-card p{white-space:pre-line}

.workout-tabs{display:flex;gap:4px;margin:22px 0;padding:4px;border-radius:20px;background:var(--chip)}
.workout-tabs button{flex:1;min-height:44px;border:0;border-radius:16px;background:none;color:var(--muted);font:inherit;font-size:13px}
.workout-tabs [aria-selected="true"]{background:var(--text);color:var(--bg)}
.discovery-grid{display:grid;gap:18px;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
.discovery-card{padding:0;overflow:hidden;border-radius:26px;color:inherit;text-align:left;border:1px solid var(--line)}
.discovery-card img{width:100%;aspect-ratio:16/9;object-fit:cover;display:block}
.discovery-card-body{display:grid;gap:8px;padding:20px}.discovery-card-body b{font-size:26px;line-height:1.1}.discovery-card-body small,.discovery-card-body>span{color:var(--muted)}
.discovery-backdrop{padding:0}.discovery-detail{width:100%;max-width:900px;height:100dvh;max-height:100dvh;border-radius:0;padding:max(24px,env(safe-area-inset-top)) 24px max(28px,env(safe-area-inset-bottom))}
.discovery-cover{width:100%;aspect-ratio:16/9;max-height:40dvh;object-fit:contain;background:#16231f;border-radius:22px;margin-bottom:24px}.discovery-detail h1{font-size:40px;line-height:1.05}.discovery-detail p{line-height:1.6}
.challenge-weeks{padding:0;list-style:none}.challenge-weeks li{display:flex;justify-content:space-between;padding:16px;border-bottom:1px solid var(--line)}
.session-permanent-choice{display:flex;gap:10px;align-items:center;margin:18px 0;line-height:1.5}.session-permanent-choice input{width:20px;height:20px;flex:none}

.exercise-family{border:1px solid var(--line);border-radius:20px;overflow:hidden;margin:8px 0}.exercise-family summary{cursor:pointer;min-height:52px;padding:16px;font-weight:600}.exercise-family summary span{float:right;color:var(--muted);font-size:12px}.exercise-family .exercise-row{border-radius:0;border-left:0;border-right:0}.instruction-review{display:block;font-size:12px;color:var(--muted);margin:8px 0}

.sheet-handle{height:28px;min-height:28px;background:transparent;position:relative}.sheet-handle::before{content:"";position:absolute;left:0;right:0;top:10px;height:5px;border-radius:99px;background:var(--soft)}
.discovery-card{border-top:3px solid var(--collection-accent,var(--accent))}

.workout-cover-thumb{width:72px;height:64px;object-fit:cover;border-radius:12px;flex-shrink:0}.workout-identity{position:relative;overflow:hidden;border-radius:22px;margin:12px 0 20px;background:#16231f;color:#fff}.workout-identity img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover}.workout-identity>div{padding:16px 20px;background:linear-gradient(135deg,#16231f,#2c453b)}.workout-identity h2{margin:6px 0;font-size:24px}.workout-identity .eyebrow{color:#bbf34c}.session-shell>.workout-identity{margin-top:8px}

/* Sessão: uma ação principal próxima da série, sem confirmação duplicada. */
.session-primary{margin-top:12px;background:var(--accent);color:#fff;min-height:52px}
.session-primary-hint{margin:8px 0 16px;color:var(--muted);font-size:12px;text-align:center;line-height:1.4}
.session-series-options{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.session-add-set,.session-add-exercise,.session-rest-setting{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:12px 18px;line-height:1.2}
.session-add-set .icon,.session-add-exercise .icon,.session-rest-setting .icon{flex:0 0 20px}
.session-add-exercise{margin:20px 0 8px}

.number-pad-backdrop { z-index:150; }
.number-pad-sheet { max-width:420px; padding-bottom:max(20px,env(safe-area-inset-bottom)); }
.number-pad-sheet h2 { font-size:20px; margin-bottom:12px; }
.number-pad-sheet output { display:block; text-align:right; font-size:40px; font-variant-numeric:tabular-nums; padding:12px 18px; border-radius:18px; background:var(--chip); }
.number-pad-sheet [data-number-error] { min-height:18px; font-size:13px; margin:4px 0; }
.number-pad-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.number-pad-grid button { min-height:56px; border:1px solid var(--line); border-radius:16px; color:var(--text); background:var(--chip); font-family:inherit; font-weight:600; font-size:24px; touch-action:manipulation; }
.number-pad-grid button:disabled { opacity:.25; }
.number-pad-sheet .sheet-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px; }
.number-pad-sheet .session-primary { margin:0; }

.session-picker-sheet .exercise-picker { max-height:32vh; }
.session-picker-filters { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.session-picker-sheet > label { display:grid; gap:8px; margin:16px 0 12px; }
.session-picker-sheet input[type=search] { min-height:48px; border:1px solid var(--line); border-radius:16px; padding:12px 14px; color:var(--text); background:var(--chip); font:inherit; width:100%; }
.session-persistence, .schedule-days { border:0; padding:0; margin:16px 0; display:flex; flex-wrap:wrap; gap:8px; }
.session-persistence legend, .schedule-days legend { padding:0; margin-bottom:8px; font-size:13px; color:var(--muted); }
.session-persistence label { flex:1; }
.session-persistence input, .schedule-days input { position:absolute; width:1px; height:1px; opacity:0; }
.session-persistence span, .schedule-days span { display:block; text-align:center; padding:12px; border:1px solid var(--line); border-radius:14px; background:var(--chip); }
.session-persistence input:checked + span, .schedule-days input:checked + span { background:var(--accent); color:white; }
.session-persistence input:focus-visible + span, .schedule-days input:focus-visible + span { outline:2px solid var(--accent); outline-offset:3px; }
.session-permanent-choice { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid var(--line); border-radius:16px; }
.session-permanent-choice input[type=checkbox] { appearance:none; width:42px; height:26px; flex:0 0 42px; border:0; border-radius:20px; background:var(--line); position:relative; }
.session-permanent-choice input[type=checkbox]:before { content:''; position:absolute; width:20px; height:20px; top:3px; left:3px; border-radius:50%; background:white; }
.session-permanent-choice input[type=checkbox]:checked { background:var(--accent); }
.session-permanent-choice input[type=checkbox]:checked:before { left:19px; }
.sheet-actions { gap:12px; }
.sheet-actions > button { min-height:46px; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.sheet > .secondary-btn, .sheet > .text-btn { margin:12px 0; min-height:44px; }
.row-actions { gap:8px; }
.row-actions .mini-btn { min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; }
@media(max-width:600px){ .session-picker-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }  .editor-row { flex-wrap:wrap; } .editor-row .row-actions { max-width:none; width:100%; justify-content:flex-end; } }

.mini-btn { min-width:44px; min-height:44px; height:44px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.text-btn { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.workout-summary-sheet > .workout-edit-top { display:flex; width:100%; margin:16px 0 12px; }
.workout-summary-sheet .sheet-close { position:absolute; top:16px; right:16px; float:none; }
.workout-summary-sheet .summary-heading { padding-right:0; margin-top:0; }
.workout-summary-sheet .summary-actions { margin-top:0; margin-bottom:20px; }
.workout-summary-sheet .summary-actions button { width:100%; }
.workout-summary-sheet .summary-delete { margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
.workout-summary-sheet > [data-edit-cover], .workout-editor-sheet > [data-edit-cover] { display:flex; margin-left:auto; }

.session-picker-sheet .row-body { display:grid; gap:4px; }


.program-carousel { display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; margin-top:20px; position:relative; }
.program-carousel + .section-head { margin-top:18px; }
.program-carousel::-webkit-scrollbar { display:none; }
.program-slide { flex:0 0 92%; min-width:0; scroll-snap-align:start; min-height:220px; margin:0; position:relative; }
.program-slide .hero-content { padding-top:58px; }
.program-edit { position:absolute; right:16px; top:16px; z-index:2; color:white; background:rgba(0,0,0,.3); }
.program-edit svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; }
.program-add-card { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; background:var(--chip); color:var(--muted); border:1px dashed var(--line); border-radius:32px; font:inherit; }

.program-list-enter > * { animation:program-entry 240ms ease-out both; animation-delay:var(--entry-delay,0ms); }
@keyframes program-entry { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@media(prefers-reduced-motion:reduce) { .program-list-enter > * { animation:none; } }
.progress-days { display:flex; overflow-x:auto; gap:8px; position:relative; padding:4px 0 8px; scrollbar-width:none; }
.week-strip.progress-days .day { flex:0 0 calc((100% - 48px)/7); width:auto; min-width:42px; }
.day-month { display:block; font-size:10px; color:var(--muted); margin-top:4px; }
.progress-calendar-actions { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:20px; }
.progress-calendar-actions label { margin-left:auto; display:grid; gap:4px; color:var(--muted); font-size:11px; }
.progress-calendar-actions input { font:inherit; color:var(--text); background:var(--chip); border:1px solid var(--line); border-radius:12px; padding:8px; min-height:44px; }

.program-cover-options { border:0; padding:0; margin:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.program-cover-options legend { margin-bottom:12px; }
.program-cover-options label { position:relative; }
.program-cover-options input { position:absolute; opacity:0; }
.program-cover-options span { min-height:64px; display:grid; place-items:center; border-radius:14px; padding:8px; text-align:center; color:white; font-size:12px; }
.program-cover-options input:checked + span { outline:3px solid var(--accent); outline-offset:2px; }
.program-cover-options input:focus-visible + span { outline:3px solid var(--text); outline-offset:2px; }

.paused-session { border-radius:20px; padding:16px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; }
.paused-session span { flex:1 1 180px; }.paused-session small { display:block; color:var(--muted); margin-top:6px; }

.home-workout-carousel { display:flex; gap:12px; position:relative; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; }
.home-workout-carousel::-webkit-scrollbar { display:none; }
.home-day-slide { flex:0 0 92%; min-width:0; scroll-snap-align:start; margin:0; }
.home-workout-carousel.single-card .home-day-slide { flex-basis:100%; }

.workout-agenda-form { padding:16px; border:1px solid var(--line); border-radius:20px; margin:16px 0; }
.workout-agenda-form h3 { margin:8px 0 0; }

.schedule-days label { position:relative; }
.stack-form .schedule-days input { inset:0; width:100%; height:100%; min-width:0; min-height:0; margin:0; cursor:pointer; }

.workout-editor-fullscreen { padding:0; align-items:stretch; }
.workout-editor-fullscreen .workout-editor-sheet { width:100%; height:100dvh; max-height:100dvh; border:0; border-radius:0; box-shadow:none; padding:calc(16px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }
.workout-editor-header { position:sticky; top:calc(-16px - env(safe-area-inset-top)); z-index:4; background:var(--sheet-surface); display:flex; align-items:center; gap:12px; margin:-16px -20px 16px; padding:16px 20px; }
.workout-editor-header h2 { margin:4px 0 0; font-size:22px; }
.workout-editor-header .sheet-close { position:static; float:none; flex:none; }

button { text-align:center; }
.secondary-btn, .text-btn, .mini-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; line-height:1.2; }
.editor-add-btn, .workout-editor-sheet > [data-edit-cover] { justify-content:center; text-align:center; }
.sheet-actions:has(.cancel-action) { display:flex; flex-direction:column; align-items:stretch; }
.cancel-action { cursor:pointer; display:flex; justify-content:center; align-items:center; align-self:center; width:auto; min-height:44px; padding:8px 16px; margin:0 auto; border:0; border-radius:0; background:transparent; box-shadow:none; color:var(--muted); text-decoration:underline; text-underline-offset:3px; font:inherit; }
.workout-editor-fullscreen .workout-editor-sheet { animation:none; }

.danger-btn, .program-delete-action { display:flex; align-items:center; justify-content:center; gap:10px; width:100%; min-height:48px; margin-top:18px; padding:12px 16px; border:1px solid var(--danger); border-radius:16px; background:transparent; color:var(--danger); font:inherit; font-size:14px; }
.danger-btn:hover, .program-delete-action:hover { background:color-mix(in srgb,var(--danger) 8%,transparent); }
.danger-btn:focus-visible, .program-delete-action:focus-visible { outline:2px solid var(--danger); outline-offset:3px; }
.delete-action-icon { font-size:24px; line-height:1; }

.sheet-actions .danger-btn, .program-delete-action { margin:0; }

/* Controles comuns: mesma geometria, foco e estados em todos os fluxos. */
.primary-btn, .secondary-btn, .text-btn, .mini-btn, .icon-btn, .danger-btn, .program-delete-action { text-align:center; line-height:1.25; gap:8px; }
.primary-btn > .icon, .secondary-btn > .icon, .text-btn > .icon { flex:0 0 20px; }
.primary-btn:disabled, .secondary-btn:disabled, .text-btn:disabled, .mini-btn:disabled, .icon-btn:disabled, .danger-btn:disabled { opacity:.45; cursor:not-allowed; }
.primary-btn:not(:disabled):active, .secondary-btn:not(:disabled):active, .mini-btn:not(:disabled):active, .icon-btn:not(:disabled):active { filter:brightness(.93); }
.stack-form .check-row { align-items:center; min-height:44px; font-size:14px; }
.stack-form .check-row input { margin:0; }
.stack-form input[aria-invalid=true], .stack-form textarea[aria-invalid=true], .stack-form select[aria-invalid=true] { border-color:var(--danger); }
.field-error { color:var(--danger)!important; margin:0; font-size:13px; }
.stack-form input:disabled, .stack-form select:disabled { opacity:.55; cursor:not-allowed; }
.section-head { align-items:center; }
.secondary-btn { text-decoration:none; }
.danger-btn { margin:0; cursor:pointer; }
:root[data-design-accent=teal] { --accent:#00645e; --accent-soft:rgba(0,100,94,.12); }
:root[data-design-accent=violet] { --accent:#6736bf; --accent-soft:rgba(103,54,191,.12); }
:root[data-theme=dark][data-design-accent=teal] { --accent:#008579; --accent-ink:#68c6bc; --accent-soft:rgba(0,133,121,.18); }
:root[data-theme=dark][data-design-accent=violet] { --accent:#8754df; --accent-ink:#b294ee; --accent-soft:rgba(135,84,223,.18); }
@media(prefers-color-scheme:dark) {
 :root[data-theme=system][data-design-accent=teal] { --accent:#008579; --accent-ink:#68c6bc; --accent-soft:rgba(0,133,121,.18); }
 :root[data-theme=system][data-design-accent=violet] { --accent:#8754df; --accent-ink:#b294ee; --accent-soft:rgba(135,84,223,.18); }
}
:root[data-design-shape=precise] { --radius-xl:24px; --radius-lg:18px; --radius-md:12px; --button-radius:14px; }
:root[data-design-surface=solid] { --glass:var(--sheet-surface); --glass-strong:var(--sheet-surface); }
:root[data-design-surface=solid] .glass { backdrop-filter:none; -webkit-backdrop-filter:none; }

.workout-summary-sheet .summary-actions { grid-template-columns:1fr; }
.workout-summary-sheet [data-rename-inline] { border-bottom:1px dashed var(--soft); cursor:text; }
.workout-summary-sheet [data-rename-inline]:focus { outline:2px solid var(--accent); outline-offset:4px; }

.avatar { border:1px solid var(--line); color:inherit; cursor:pointer; padding:0; }
button.summary-exercise { width:100%; background:transparent; border:0; border-bottom:1px solid var(--line); color:inherit; text-align:left; cursor:pointer; touch-action:manipulation; }
[data-exercise-drag] { touch-action:none; cursor:grab; flex-shrink:0; }

.editor-row .row-title, .editor-row .row-sub { white-space:normal; overflow:visible; text-overflow:clip; }

.editor-row .row-title { display:block; min-height:0; -webkit-line-clamp:unset; }

/* Ordering uses the same handle and gesture in programs and workout editing. */
.sort-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 12px; }
.sort-toolbar>span { font-size:13px; color:var(--muted); }
.sort-toolbar button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; width:auto; padding:10px 16px; }
.sort-help { margin:0 0 14px; font-size:13px; color:var(--muted); line-height:1.5; }
.is-ordering .reorder-grip, .reorder-grip.is-pressed { color:var(--accent-ink); border-color:color-mix(in srgb,var(--accent) 50%,var(--line)); background:color-mix(in srgb,var(--accent) 10%,var(--chip)); }
.reorder-grip { -webkit-touch-callout:none; }
.reorder-grip:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.reorder-grip .icon { width:24px; height:24px; pointer-events:none; }
.is-ordering .workout-card-main { cursor:default; }
.sort-placeholder { flex-shrink:0; box-sizing:border-box; border:1.5px dashed var(--accent); border-radius:24px; background:color-mix(in srgb,var(--accent) 7%,transparent); display:flex; align-items:center; justify-content:center; color:var(--accent-ink); font-size:13px; font-weight:600; }
.sort-ghost { position:fixed!important; z-index:1500!important; margin:0!important; box-sizing:border-box; pointer-events:none!important; transition:none!important; animation:none!important; box-shadow:0 18px 40px #0003; border-color:var(--accent)!important; background:var(--sheet-surface)!important; opacity:.96; will-change:transform; }
.sort-move-sheet .sheet-actions { margin-top:20px; }
.sort-move-sheet .sheet-actions>button { width:100%; }
@media(prefers-reduced-motion:reduce) { .reorder-grip { transition:none; } .sort-move-sheet { animation:none; } }

/* Bi-set: the pair reads as one block in the workout editor. */
.editor-row.biset-row { box-shadow:inset 3px 0 0 var(--accent); }
.editor-row.biset-first { border-bottom-left-radius:6px; border-bottom-right-radius:6px; margin-bottom:-6px; }
.editor-row.biset-second { border-top-left-radius:6px; border-top-right-radius:6px; }
.biset-tag { font-size:12px; color:var(--muted); margin-top:4px; }
.biset-tag b { color:var(--accent-ink); font-weight:600; letter-spacing:.02em; }
.biset-undo { font-size:12px; padding:0; min-height:0; vertical-align:baseline; }

/* Companion: chat first. Header is one line; photos live in the composer. */
.companion-head { align-items:center; gap:12px; padding-bottom:8px; border-bottom:1px solid var(--line); }
.companion-head h2 { margin:0; font-size:20px; letter-spacing:-.02em; }
.companion-head .sheet-close { position:static; float:none; flex:none; }
.companion-empty { justify-content:flex-end; padding:18px 2px 12px; }
.companion-mark { width:40px; height:40px; border-radius:14px; font-size:19px; margin-bottom:14px; }
.companion-empty h2 { font-size:clamp(24px,6vw,32px); margin:0 0 8px; }
.companion-empty>p { font-size:14px; margin:0; }
.companion-sheet:focus-within .companion-empty>p, .companion-sheet:focus-within .companion-mark { display:none; }
.companion-compose { grid-template-columns:40px 1fr 48px; }
.companion-compose .companion-attach { width:40px; height:48px; display:grid; place-items:center; color:var(--muted); cursor:pointer; border-radius:14px; }
.companion-attach:hover { color:var(--text); background:var(--chip); }
.companion-attach input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.companion-attach .icon { margin:0; }
.companion-photo-chip { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 8px; padding:8px 12px; border-radius:14px; background:var(--accent-soft); font-size:12px; color:var(--text); }
.companion-photo-chip .text-btn { font-size:12px; flex:0 0 auto; }
@media (max-width:600px){
  .companion-sheet { padding-top:calc(10px + env(safe-area-inset-top,0px)); }
  .companion-empty { padding-top:12px; }
}

/* Workout editor rows stay on one line on phones: actions stack at the right. */
@media (max-width:600px){
  .editor-row { flex-wrap:nowrap; align-items:center; gap:10px; }
  .editor-row .row-actions { width:auto; max-width:none; flex-direction:column; gap:6px; flex:0 0 auto; }
  .editor-row .row-actions .mini-btn { width:38px; height:38px; }
  .editor-row .row-body { min-width:0; flex:1; }
}

/* Exercise demonstrations (PB.fit motion). Scoped to .pb-motion so the short class names never leak. */
:root { --exercise-bg:#F7F7F8; --exercise-character:#3A3F47; --exercise-joint:#9CA3AF; --exercise-equipment:#C4C8CE; --exercise-equipment-soft:#E3E5E8; --exercise-far:#B9BDC4; --exercise-motion:var(--accent); --exercise-ghost:rgba(58,63,71,.16); }
:root[data-theme="dark"] { --exercise-bg:#0C0E12; --exercise-character:#F4F4F5; --exercise-joint:#9CA3AF; --exercise-equipment:#2A3342; --exercise-equipment-soft:#1A212C; --exercise-far:#5A616C; --exercise-motion:var(--accent-ink); --exercise-ghost:rgba(244,244,245,.14); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { --exercise-bg:#0C0E12; --exercise-character:#F4F4F5; --exercise-joint:#9CA3AF; --exercise-equipment:#2A3342; --exercise-equipment-soft:#1A212C; --exercise-far:#5A616C; --exercise-motion:var(--accent-ink); --exercise-ghost:rgba(244,244,245,.14); } }
.exercise-motion-frame.has-animation { background:var(--exercise-bg); display:flex; justify-content:center; }
.pb-motion svg { height:100%; width:auto; max-width:100%; display:block; }
.pb-motion-toggle { position:absolute; inset:0; width:100%; height:100%; border:0; background:transparent; cursor:pointer; }
.pb-motion-toggle:focus-visible { outline:2px solid var(--accent); outline-offset:-4px; border-radius:inherit; }
.pb-motion.is-paused::after { content:'Toque para reproduzir'; position:absolute; right:10px; bottom:8px; font-size:11px; color:var(--muted); pointer-events:none; }
.pb-motion .c{stroke:var(--exercise-character);fill:none;stroke-linecap:round;stroke-linejoin:round}
.pb-motion .cf{fill:var(--exercise-character)}
.pb-motion .g{stroke:var(--exercise-ghost);fill:none;stroke-linecap:round;stroke-linejoin:round}
.pb-motion .gf{fill:var(--exercise-ghost)}
.pb-motion .f{stroke:var(--exercise-far);fill:none;stroke-linecap:round;stroke-linejoin:round}
.pb-motion .e{stroke:var(--exercise-equipment);stroke-width:3.5;fill:none;stroke-linecap:round;stroke-linejoin:round}
.pb-motion .ec{stroke:var(--exercise-equipment);stroke-width:3;fill:var(--exercise-bg)}
.pb-motion .p{stroke:var(--exercise-equipment);stroke-width:9;fill:none;stroke-linecap:round}
.pb-motion .pf{fill:var(--exercise-equipment-soft)}
.pb-motion .h{stroke:var(--exercise-character);stroke-width:3;fill:none;stroke-linecap:round}
.pb-motion .hb{stroke:var(--exercise-character);stroke-width:5;fill:none;stroke-linecap:round}
.pb-motion .hd{fill:var(--exercise-bg);stroke:var(--exercise-character);stroke-width:2.5}
.pb-motion .j{fill:var(--exercise-joint)}
.pb-motion .mu{stroke:var(--exercise-motion);fill:none;stroke-linecap:round}
.pb-motion .jr{fill:none;stroke:var(--exercise-motion);stroke-width:1.5}
.pb-motion .ja{fill:var(--exercise-motion)}
.pb-motion .m{stroke:var(--exercise-motion);stroke-width:2.2;fill:none;stroke-linecap:round;stroke-dasharray:0 5}
.pb-motion .md{fill:var(--exercise-motion)}

/* Sheet actions: one column, equal width, centered labels (text links included). */
.sheet:not(.number-pad-sheet) .sheet-actions { display:flex; flex-direction:column; align-items:stretch; gap:10px; }
.sheet:not(.number-pad-sheet) .sheet-actions > button, .sheet:not(.number-pad-sheet) .sheet-actions > a { width:100%; flex:none; margin:0; justify-content:center; text-align:center; }
.sheet:not(.number-pad-sheet) .sheet-actions > .text-btn { min-height:44px; }
/* Loose buttons placed right after a sheet's action group follow the same column. */
.sheet > .sheet-actions ~ button, .sheet > .sheet-actions ~ a.text-btn { display:flex; width:100%; justify-content:center; text-align:center; margin:10px 0 0; min-height:44px; }
