/* Treino — estilo inspirado no app de referência: fundo branco, vermelho de destaque, cartões cinza claros e bordas bem arredondadas. */

:root {
  --red: #d6332a;
  --red-dark: #b32922;
  --red-soft: #f7e3e2;
  --ink: #111827;
  --ink-2: #1f2937;
  --muted: #6b7280;
  --line: #e7e9ed;
  --card: #f2f4f7;
  --bg: #ffffff;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow: 0 4px 18px rgba(17, 24, 39, .10);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; background: var(--bg); }
#view { min-height: 100dvh; padding-bottom: calc(36px + var(--safe-b)); }
#view.with-tabs { padding-bottom: calc(120px + var(--safe-b)); }
@media (min-width: 520px) {
  body { background: #e9ecf0; }
  #app { box-shadow: 0 0 0 1px #dfe3e8, 0 20px 60px rgba(17, 24, 39, .12); }
}

.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* ------------------------------------------------------------ botões */
.round-btn {
  width: 48px; height: 48px; border-radius: 50%; background: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; flex: none; color: var(--ink);
}
.round-btn.dark { background: var(--ink); color: #fff; }
.round-btn:active { transform: scale(.96); }

.btn { height: 56px; border-radius: 16px; font-weight: 800; font-size: 18px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:active { background: var(--red-dark); }
.btn.ghost { background: var(--card); }
.btn.danger { background: #fde8e7; color: var(--red); }
.btn.outline { background: #fff; border: 2px solid var(--red); color: var(--red); }
.btn[disabled] { opacity: .55; }
.btn.pill { width: auto; padding: 0 28px; border-radius: 999px; }

.link-btn { color: var(--red); font-weight: 800; font-size: 21px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; }

.field { width: 100%; height: 56px; border: 1.5px solid #dfe3e8; border-radius: 16px; padding: 0 16px; font-size: 18px; outline: none; background: #fff; }
.field:focus { border-color: var(--red); }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }

/* ------------------------------------------------------------ barra superior */
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 14px) 16px 10px; min-height: 76px; }
.topbar .spacer { flex: 1; }
.top-title { flex: 1; text-align: center; font-weight: 700; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-pill { display: flex; align-items: center; gap: 8px; height: 48px; border-radius: 28px; background: #fff; box-shadow: var(--shadow); padding: 0 14px 0 6px; font-weight: 800; font-size: 18px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #d9dde3; color: #374151; display: grid; place-items: center; font-weight: 800; font-size: 16px; }
.user-pill .flame { color: var(--red); display: inline-flex; align-items: center; gap: 2px; }

/* ------------------------------------------------------------ início */
.plan-title { display: flex; align-items: center; gap: 10px; padding: 6px 20px 16px; font-size: 27px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.dot-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 0 10px 16px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 11px 0 8px; border-radius: 16px; border: 2.5px solid transparent; color: var(--muted); }
.day .wd { font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.day .dn { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.day .mark { width: 6px; height: 6px; border-radius: 50%; background: var(--red); opacity: 0; margin-top: 1px; }
.day.has .mark { opacity: 1; }
.day.today .dn { color: var(--red); }
.day.sel { border-color: var(--red); }
.day.sel .wd { color: var(--red); }

.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 12px 12px; width: calc(100% - 24px); text-align: left; background: var(--red); color: #fff; border-radius: 22px; padding: 14px 18px; font-weight: 800; box-shadow: 0 8px 22px rgba(214, 51, 42, .28); }
.resume small { display: block; font-weight: 600; opacity: .85; font-size: 13px; }

.wlist { margin: 4px 12px 0; background: var(--card); border-radius: 32px; border: 1px solid #e9ecf0; overflow: hidden; }
.wrow { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; width: 100%; text-align: left; position: relative; }
.wrow + .wrow { border-top: 1px solid #e3e6ea; }
.wrow .fig { flex: 0 0 84px; height: 94px; display: flex; align-items: center; justify-content: center; }
.wrow .fig .body-wrap, .wrow .fig svg { height: 100%; }
.wrow .info { flex: 1; min-width: 0; }
.wrow .wname { font-size: 23px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; letter-spacing: -.02em; }
.wrow .act { flex: none; color: var(--red); width: 36px; height: 44px; display: grid; place-items: center; }
.wrow.is-done .wname { color: #374151; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--red-soft); color: var(--red); letter-spacing: .03em; text-transform: uppercase; }
.tag.dark { background: #e5e7eb; color: #374151; }
.thumbs { display: flex; gap: 8px; margin-top: 9px; }
.thumb { width: 52px; height: 52px; border-radius: 14px; background: #fff; display: grid; place-items: center; overflow: hidden; font-weight: 800; color: #6b7280; font-size: 17px; flex: none; }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wmeta { color: var(--muted); font-size: 13px; margin-top: 7px; }

/* ------------------------------------------------------------ execução */
.timer { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px 0 14px; border-radius: 28px; background: #fff; box-shadow: var(--shadow); font-weight: 800; font-size: 26px; color: #6b7280; font-variant-numeric: tabular-nums; }
.timer .ico { color: var(--red); }
.timer.date { font-size: 16px; color: var(--ink); }

.strip { display: flex; gap: 12px; overflow-x: auto; padding: 8px 20px 14px; scrollbar-width: none; scroll-snap-type: x proximity; }
.strip::-webkit-scrollbar { display: none; }
.sthumb { flex: 0 0 82px; height: 96px; border-radius: 22px; border: 3px solid transparent; display: grid; place-items: center; background: #fff; position: relative; scroll-snap-align: center; }
.sthumb img { width: 66px; height: 66px; object-fit: contain; }
.sthumb .ph { font-size: 24px; font-weight: 800; color: #9ca3af; }
.sthumb.sel { border-color: var(--red); }
.sthumb .ok { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; display: none; place-items: center; }
.sthumb.alldone .ok { display: grid; }

.ex-head { display: flex; align-items: flex-start; gap: 12px; padding: 4px 20px 0; }
.ex-title { font-size: 31px; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; }
.ex-sub { color: var(--muted); font-size: 20px; margin-top: 4px; }
.info-btn { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; flex: none; margin-top: 8px; }

.notes { display: block; width: calc(100% - 40px); margin: 16px 20px 0; height: 56px; border: 1.5px solid #dfe3e8; border-radius: 16px; padding: 0 16px; font-size: 18px; outline: none; background: #fff; }
.notes:focus { border-color: var(--red); }
.prev { margin: 14px 22px 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.prev b { color: var(--ink-2); font-weight: 700; }

.sets { margin: 18px 14px 0; }
.sets-head, .set-row { display: grid; grid-template-columns: 1fr 1fr 76px; align-items: center; }
.sets-head { font-weight: 800; color: #6b7280; font-size: 20px; text-align: center; padding: 0 0 8px; letter-spacing: .01em; }
.set-row { height: 68px; border-radius: 18px; }
.set-row.current { background: var(--red-soft); }
.set-row .num { width: 100%; height: 60px; text-align: center; font-size: 30px; font-weight: 800; border: 0; background: transparent; outline: none; border-radius: 12px; color: var(--ink); padding: 0; }
.set-row .num::placeholder { color: #9ca3af; }
.set-row .num:focus { background: rgba(214, 51, 42, .09); }
.set-row .num.bad { color: var(--red); background: rgba(214, 51, 42, .12); }
.chk { width: 48px; height: 48px; border-radius: 14px; border: 2.5px solid #4b5563; display: grid; place-items: center; color: #fff; margin: 0 auto; }
.chk svg { opacity: 0; }
.chk.on { background: var(--red); border-color: var(--red); }
.chk.on svg { opacity: 1; }
.set-actions { display: flex; justify-content: center; gap: 12px; margin: 12px 0 0; }

.fab { position: fixed; right: max(20px, calc((100vw - 480px) / 2 + 20px)); bottom: calc(24px + var(--safe-b)); width: 68px; height: 68px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(214, 51, 42, .38); z-index: 15; }
.fab:active { background: var(--red-dark); }

.sync-banner { margin: 4px 20px 6px; padding: 10px 14px; border-radius: 14px; background: #fff4d6; color: #7a5600; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------ barra de abas */
#tabbar { position: fixed; left: 50%; bottom: calc(12px + var(--safe-b)); transform: translateX(-50%); width: min(456px, calc(100% - 24px)); z-index: 20; }
.tabs { display: flex; gap: 6px; background: #fff; border-radius: 34px; padding: 8px; box-shadow: 0 10px 36px rgba(17, 24, 39, .16); border: 1px solid #eef0f3; }
.tab { flex: 1; height: 60px; border-radius: 28px; display: grid; place-items: center; color: var(--ink); }
.tab.on { background: #eceef2; color: var(--red); }

/* ------------------------------------------------------------ calendário */
.cal-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 6px 20px 14px; }
.cal-title { font-size: 40px; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.cal-title small { font-size: 20px; color: #6b7280; font-weight: 700; margin-left: 6px; letter-spacing: 0; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button { width: 40px; height: 40px; display: grid; place-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 12px 14px; }
.stat { background: var(--card); border: 1px solid #e9ecf0; border-radius: 22px; padding: 14px 14px 12px; }
.stat .k { font-size: 12px; font-weight: 800; letter-spacing: .1em; color: #6b7280; text-transform: uppercase; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 4px; display: flex; align-items: baseline; gap: 4px; letter-spacing: -.02em; }
.stat .v small { font-size: 16px; color: #6b7280; font-weight: 700; }
.stat .v .ico { color: var(--red); align-self: center; }
.cal-card { margin: 0 12px; background: var(--card); border: 1px solid #e9ecf0; border-radius: 32px; padding: 18px 8px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; }
.cal-dow { font-size: 14px; font-weight: 700; color: var(--muted); text-align: center; letter-spacing: .08em; padding-bottom: 10px; text-transform: uppercase; }
.cal-day { height: 54px; display: grid; place-items: center; font-size: 22px; font-weight: 800; position: relative; border-radius: 15px; border: 2.5px solid transparent; margin: 0 4px; }
.cal-day.out { color: #c3c8d0; }
.cal-day.today { border-color: var(--red); }
.cal-day.sel { background: var(--red-soft); }
.cal-day .dot { position: absolute; bottom: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.day-panel { padding: 22px 0 0; }
.day-panel .day-label { margin: 0 20px 12px; font-weight: 800; font-size: 18px; }
.day-panel .day-label::first-letter { text-transform: uppercase; }
.sess-card { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid #e9ecf0; border-radius: 22px; padding: 16px 18px; margin: 0 12px 10px; width: calc(100% - 24px); text-align: left; }
.sess-card .st-name { font-weight: 800; font-size: 20px; }
.sess-card .st-meta { color: var(--muted); font-size: 14px; margin-top: 3px; }
.sess-card .chev { margin-left: auto; color: #9ca3af; }
.add-day { display: flex; justify-content: center; padding: 10px 0 6px; }

/* ------------------------------------------------------------ evolução / estatísticas */
.page-title { font-size: 36px; font-weight: 800; letter-spacing: -.03em; padding: 6px 20px 14px; }
.searchrow { margin: 0 16px 10px; position: relative; }
.searchrow .field { padding-left: 46px; background: var(--card); border-color: transparent; }
.searchrow .ico { position: absolute; left: 14px; top: 16px; color: var(--muted); }
.plist .p-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.p-item .pi-name { font-weight: 800; font-size: 18px; }
.p-item .pi-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.p-item .pi-best { margin-left: auto; text-align: right; font-weight: 800; font-size: 20px; white-space: nowrap; }
.p-item .pi-best small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--card); border-radius: 20px; padding: 12px 14px; }
.tile .k { font-size: 11px; font-weight: 800; letter-spacing: .07em; color: var(--muted); text-transform: uppercase; }
.tile .v { font-size: 24px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.tile .v small { font-size: 13px; color: var(--muted); font-weight: 700; }
.chart-card { background: #fff; border: 1.5px solid var(--line); border-radius: 24px; padding: 14px 10px 8px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #e7e9ed; stroke-width: 1; }
.chart .axis { fill: #6b7280; font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--red); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: #fff; stroke: var(--red); stroke-width: 3; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .dot.sel .pt { fill: var(--red); }
.chart .tip-bg { fill: var(--ink); }
.chart .tip-tx { fill: #fff; font-size: 12px; font-weight: 700; font-family: var(--font); }
.hist { margin-top: 18px; }
.hist h4 { margin: 0 0 8px; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hist-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 16px; }
.hist-row.head { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.hist-row span:not(:first-child) { text-align: right; font-weight: 700; }

/* ------------------------------------------------------------ editor de treino */
.editor-count { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px 8px; }
.editor-count h2 { font-size: 24px; font-weight: 800; }
.plus-btn { color: var(--red); width: 44px; height: 44px; display: grid; place-items: center; }
.erow { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.erow .thumb { width: 64px; height: 64px; border-radius: 16px; background: var(--card); }
.erow .ebody { flex: 1; min-width: 0; }
.erow .ename { font-weight: 800; font-size: 18px; line-height: 1.2; }
.erow .esub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.erow .ectl { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; background: var(--card); border-radius: 14px; }
.step button { width: 38px; height: 38px; display: grid; place-items: center; }
.step span { min-width: 30px; text-align: center; font-weight: 800; font-size: 17px; }
.step-label { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-right: 2px; }
.erow .eside { display: flex; flex-direction: column; gap: 2px; }
.eside button { width: 34px; height: 34px; display: grid; place-items: center; color: #6b7280; }
.eside button.del { color: var(--red); }
.eside button[disabled] { opacity: .25; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 28px 24px; gap: 10px; }
.empty-ico { color: #6b7280; margin-bottom: 8px; }
.empty-title { font-size: 25px; font-weight: 800; letter-spacing: -.02em; }
.empty-text { color: var(--muted); font-size: 17px; line-height: 1.4; margin-bottom: 8px; max-width: 320px; }
.empty .btn { width: calc(100% - 32px); margin-top: 8px; }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid #e5e7eb; border-top-color: var(--red); margin: 60px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ folhas, menus, toasts */
.backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .38); z-index: 40; animation: fade .18s; }
.backdrop.closing { opacity: 0; transition: opacity .18s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 480px; background: #fff; border-radius: 30px 30px 0 0; z-index: 41; display: flex; flex-direction: column; max-height: calc(100dvh - 40px); animation: up .22s cubic-bezier(.2, .8, .2, 1); padding-bottom: var(--safe-b); }
.sheet.closing { transform: translateY(100%); transition: transform .18s ease-in; }
.sheet.full { height: calc(100dvh - 56px); max-height: none; }
.sheet.small .sheet-body { padding: 24px 22px 22px; }
.sheet-head { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; padding: 14px 14px 8px; min-height: 76px; flex: none; }
.sheet-head:empty { display: none; }
.sh-title { text-align: center; font-weight: 800; font-size: 18px; }
.sh-side { display: flex; }
.sh-side.right { justify-content: flex-end; }
.sheet-body { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot { flex: none; padding: 10px 16px 14px; }
.choice-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.choice-text { color: var(--muted); font-size: 17px; line-height: 1.45; margin-bottom: 8px; }
.choice-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slideR { from { transform: translateX(-30px); opacity: .3; } }

.menu-backdrop { position: fixed; inset: 0; z-index: 50; }
.menu { position: fixed; top: calc(var(--safe-t) + 70px); z-index: 51; min-width: 290px; max-width: calc(100vw - 32px); background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border-radius: 30px; box-shadow: 0 18px 50px rgba(17, 24, 39, .22), 0 0 0 1px rgba(17, 24, 39, .04); padding: 10px 0; animation: pop .16s ease-out; transform-origin: top right; }
.menu.right { right: max(16px, calc((100vw - 480px) / 2 + 16px)); }
.menu.left { left: max(16px, calc((100vw - 480px) / 2 + 16px)); transform-origin: top left; }
.menu-item { display: flex; align-items: center; gap: 16px; width: 100%; padding: 0 26px; height: 56px; font-size: 20px; text-align: left; }
.menu-item:active { background: rgba(17, 24, 39, .05); }
.menu-item.danger { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 26px; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(110px + var(--safe-b)); z-index: 80; background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 16px; font-weight: 600; font-size: 15px; max-width: min(440px, calc(100vw - 32px)); text-align: center; box-shadow: 0 10px 30px rgba(17, 24, 39, .3); animation: up .2s; }

.drawer { position: fixed; top: 0; bottom: 0; left: max(0px, calc((100vw - 480px) / 2)); width: min(86%, 380px); background: #fff; z-index: 61; padding: calc(var(--safe-t) + 20px) 18px calc(24px + var(--safe-b)); animation: slideR .2s; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; box-shadow: 10px 0 40px rgba(17, 24, 39, .15); }
.drawer-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 900; letter-spacing: -.05em; font-style: italic; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: var(--red); color: #fff; display: grid; place-items: center; font-style: normal; }
.drawer-label { display: flex; justify-content: space-between; color: var(--muted); font-weight: 800; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
.plan-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px 16px; border-radius: 18px; font-weight: 700; font-size: 19px; background: #f6f7f9; width: 100%; text-align: left; }
.plan-item.on { background: var(--red-soft); color: var(--red); }
.drawer-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.drawer-foot .who { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------ seletor de exercícios / detalhe */
.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 16px 28px; }
.gcard { background: var(--card); border-radius: 28px; padding: 16px 8px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; text-align: center; }
.gcard .fig { height: 112px; display: flex; align-items: flex-end; }
.gcard .fig svg { height: 100%; }
.gcard small { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: -4px; }
.gcard-all { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; padding: 14px 22px 14px 18px; text-align: left; font-size: 23px; }
.gcard-all .fig { height: 70px; }
.gcard-all .ico { color: var(--red); }

.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; flex: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 12px 18px; border-radius: 999px; background: var(--card); border: 2px solid transparent; font-weight: 700; font-size: 17px; white-space: nowrap; }
.chip.on { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.chip small { opacity: .6; font-weight: 600; margin-left: 4px; }

.ex-item { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.ex-item .thumb { width: 76px; height: 76px; border-radius: 18px; background: #fff; }
.ex-item .nm { font-weight: 800; font-size: 20px; line-height: 1.2; letter-spacing: -.01em; }
.ex-item .sb { color: var(--muted); font-size: 16px; margin-top: 3px; }
.more { padding: 16px; }
.searchbar { position: relative; }
.searchbar .field { height: 58px; border-radius: 29px; padding-left: 52px; box-shadow: 0 6px 24px rgba(17, 24, 39, .16); border-color: #eceef1; }
.searchbar .ico { position: absolute; left: 18px; top: 17px; color: var(--ink); }

.seg-wrap { display: flex; justify-content: center; padding: 0 0 14px; }
.seg { display: inline-flex; background: #eceef2; border-radius: 28px; padding: 4px; }
.seg button { padding: 10px 26px; border-radius: 24px; font-weight: 700; font-size: 16px; }
.seg button.on { background: #fff; box-shadow: 0 2px 8px rgba(17, 24, 39, .12); }
.media { display: grid; place-items: center; padding: 4px 0 2px; }
.media .frame { width: 196px; height: 196px; background: #fff; border-radius: 22px; display: grid; place-items: center; }
.media img { width: 180px; height: 180px; object-fit: contain; display: block; }
.credit { text-align: center; color: var(--muted); font-size: 11px; margin: 4px 0 14px; }
.cta { margin: 0 20px 20px; width: calc(100% - 40px); }
.dgrid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; padding: 0 20px 20px; }
.dinfo > div { padding: 14px 0; border-bottom: 1.5px solid var(--ink-2); text-align: center; }
.dinfo > div:last-child { border-bottom: 0; }
.dinfo .k { font-size: 18px; }
.dinfo .v { font-weight: 800; font-size: 22px; margin-top: 4px; letter-spacing: -.01em; }
.dside { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dside .fig { height: 190px; }
.dside .fig svg { height: 100%; }
.mchip { display: inline-block; padding: 10px 18px; border-radius: 14px; font-weight: 800; font-size: 16px; background: #d6dae1; color: var(--ink); text-align: center; }
.mchip.main { background: var(--red); color: #fff; }
.howto { padding: 0 22px 28px; }
.howto h3 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.howto ol { margin: 0; padding-left: 22px; color: #374151; line-height: 1.5; font-size: 16px; }
.howto li { margin-bottom: 8px; }
.stats-pane { padding: 0 20px 28px; }
.metric-chips { display: flex; gap: 8px; margin: 14px 0 10px; }
.metric-chips .chip { padding: 9px 14px; font-size: 15px; }

/* ------------------------------------------------------------ login */
.auth { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 26px calc(32px + var(--safe-b)); gap: 6px; }
.auth .brand { font-size: 44px; margin-bottom: 4px; }
.auth .brand .logo { width: 56px; height: 56px; border-radius: 16px; }
.auth .lead { color: var(--muted); font-size: 18px; margin: 4px 0 22px; line-height: 1.4; }
.auth form { display: flex; flex-direction: column; gap: 4px; }
.auth .btn { margin-top: 16px; }
.auth .err { color: var(--red); font-weight: 700; font-size: 15px; min-height: 22px; margin-top: 10px; }
.auth .switch { margin-top: 14px; text-align: center; color: var(--muted); }
.auth .switch button { color: var(--red); font-weight: 800; }
.check-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--ink-2); font-size: 16px; }
.check-row input { width: 22px; height: 22px; accent-color: var(--red); }

/* ------------------------------------------------------------ figura do corpo */
.body-wrap { display: inline-block; height: 100%; }
.body { height: 100%; width: auto; display: block; }
.body .base { fill: #4b5563; }
.body .r { fill: #a5adba; stroke: #4b5563; stroke-width: .7; }
.body .r.on { fill: #e11d1d; }
.body.all .r { fill: #e9a3a3; }
.body .sep { fill: none; stroke: #4b5563; stroke-width: .7; }

/* ------------------------------------------------------------ complementos */
.pick-bottom { position: sticky; bottom: 0; z-index: 3; padding: 10px 16px 16px; background: linear-gradient(rgba(255,255,255,0), #fff 40%); }
.more { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.more .btn.ghost { width: 100%; }
.sheet-foot { border-top: 1px solid var(--line); background: #fff; }

/* fidelidade ao app de referência */
.sthumb { background: transparent; flex-basis: 92px; height: 108px; border-radius: 22px; border-width: 3px; }
.sthumb img { width: 78px; height: 78px; }
.sthumb.add { border: 2.5px dashed #cfd4db; color: var(--muted); }
.sthumb .ok { right: 6px; bottom: 6px; }
.wk-name { padding: 0 22px 2px; color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.set-row .num.empty { color: #9ca3af; }
.set-links { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.set-links .link-btn { font-size: 19px; }
.set-links .link-btn:disabled { opacity: .35; }
.gcard .fig { height: 118px; align-items: center; }
.gcard-all .fig { height: 64px; flex: none; }
.gcard-all .ga-txt { flex: 1; margin-left: 14px; }
.cta { display: flex; }
.wrow .fig { flex-basis: 96px; }
.wrow .act { width: 30px; }
.cta-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); width: min(456px, calc(100% - 24px)); z-index: 18; }
.cal-dow::after { content: '.'; }
.nowrap { white-space: nowrap; }
.sth-img { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; color: #9ca3af; font-size: 24px; }
#view.has-fab { padding-bottom: calc(130px + var(--safe-b)); }
.top-title:is(button) { background: none; }
.sthumb .sth-img { border-radius: 14px; }

.thumbs .thumb { width: 40px; height: 40px; border-radius: 12px; font-size: 14px; }
.thumbs { gap: 6px; }
.wrow .fig { flex-basis: 88px; }
.wrow { gap: 12px; padding: 14px 10px 14px 14px; }
.plan-title { font-size: 24px; }
.set-links .link-btn { font-size: 17px; padding: 10px 8px; }
.gcard-all { font-size: 20px; }
.gcard-all small { font-size: 13px; }
.credit a { text-decoration: none; }
.dinfo .v { font-size: 19px; }
.dinfo .k { font-size: 16px; }
.ex-item .nm { font-size: 18px; }
.ectl-grp { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.ectl-grp .step-label { margin: 0 0 0 4px; }
.erow .ectl { gap: 14px; }
.step button { width: 34px; }

/* seletor: multi-seleção, busca global, ficha sem recarregar */
[hidden] { display: none !important; }
.ex-item { padding: 0; align-items: stretch; gap: 0; }
.ex-item .ex-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 6px 12px 20px; text-align: left; background: none; border: 0; font: inherit; color: inherit; }
.ex-item .ex-txt { flex: 1; min-width: 0; }
.ex-item .ex-info-btn { flex: none; width: 56px; display: grid; place-items: center; color: var(--muted); background: none; border: 0; }
.ex-item:not(:has(.ex-info-btn)) .ex-main { padding-right: 20px; }
.pick-chk { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #c9ced6; display: grid; place-items: center; color: transparent; transition: background .12s, border-color .12s; }
.ex-item.picked { background: #fdf0ef; }
.ex-item.picked .pick-chk { background: var(--red); border-color: var(--red); color: #fff; }
.tag-in { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 10px; background: #eef0f3; color: var(--muted); font-size: 13px; font-weight: 700; }
.scope-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 20px; color: var(--muted); font-size: 15px; }
.scope-row .link-btn { padding: 6px 0; }
.sel-foot { display: flex; gap: 10px; }
.sel-foot .btn { width: auto; }
.sel-foot .sel-go { flex: 1; }
.sel-foot .sel-clear { flex: none; padding-left: 22px; padding-right: 22px; }
.editor-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 16px 6px; padding: 10px 14px; border-radius: 14px; background: #f3f5f8; color: var(--muted); font-size: 14px; line-height: 1.35; }
.editor-note .ico { flex: none; margin-top: 1px; }

/* prévia do treino (lista compacta) */
.pv-head { padding: 4px 22px 10px; }
.pv-date { color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.pv-date::first-letter { text-transform: uppercase; }
.pv-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 2px; }
.pv-meta { color: var(--muted); font-size: 15px; font-weight: 600; margin-top: 4px; }
.pv-list { list-style: none; margin: 6px 0 0; padding: 0 16px; }
.pv-item { display: flex; align-items: center; gap: 12px; padding: 5px 4px; border-bottom: 1px solid var(--line); min-height: 48px; }
.pv-item:last-child { border-bottom: 0; }
.pv-item .pv-thumb { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--card); font-size: 13px; }
.pv-name { flex: 1; min-width: 0; font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.pv-sets { flex: none; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }

/* editor: deslizar para excluir + arrastar para ordenar */
.editor-hint { padding: 0 22px 6px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.erow-wrap { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: #fff; }
.erow-wrap .erow { position: relative; z-index: 1; background: #fff; border-bottom: 0; will-change: transform; }
.erow-del { position: absolute; top: 0; right: 0; bottom: 0; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; font-weight: 800; font-size: 13px; background: var(--red); }
.erow-wrap:not(.revealed) .erow-del { visibility: hidden; }
.erow .grip { flex: none; align-self: center; width: 44px; height: 56px; margin-right: -8px; display: grid; place-items: center; color: #9aa1ad; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; border-radius: 12px; }
.erow .grip:focus-visible { outline: 2px solid var(--red); }
.erow-wrap.dragging { z-index: 6; box-shadow: 0 10px 30px rgba(17, 24, 39, .28); border-radius: 16px; transition: none !important; }
.erow-wrap.dragging .erow { background: #fff; border-radius: 16px; }
.elist.sorting { user-select: none; -webkit-user-select: none; }
.elist.sorting .erow-wrap:not(.dragging) { pointer-events: none; }

/* calendário: navegação de meses */
.cal-nav { align-items: center; gap: 8px; }
.cal-nav .cal-arrow { width: 46px; height: 46px; border-radius: 50%; background: var(--card); }
.cal-nav .cal-today { height: 46px; padding: 0 16px; border-radius: 23px; background: var(--red-soft); color: var(--red); font-weight: 800; font-size: 16px; }
.cal-next { display: flex; align-items: center; gap: 6px; padding: 0 22px 12px; color: var(--muted); font-size: 15px; font-weight: 600; }
.cal-next b { color: var(--ink); }
.cal-next .ico { color: var(--red); }
.cal-day.out .dot { opacity: .45; }
.cal-next { justify-content: space-between; min-height: 40px; padding-bottom: 8px; }
.cal-next .cn-txt { display: flex; align-items: center; gap: 6px; }
.cal-next .cal-today { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 18px; background: var(--red-soft); color: var(--red); font-weight: 800; }
.cal-nav .cal-arrow { width: 44px; height: 44px; }
