/* ===================== Tokens ===================== */
:root {
  --bg: #F7F3F1;
  --surface: #FFFFFF;
  --surface-2: #F1EAE7;
  --surface-3: #E9E0DC;
  --text: #221A1F;
  --muted: #75686F;
  --faint: #A69AA0;
  --line: #E6DCD8;
  --accent: #9E4569;
  --accent-2: #C07A93;
  --accent-soft: #F4E4EB;
  --accent-ink: #FFFFFF;
  --success: #3C7A5F;
  --success-soft: #E2F0E8;
  --warn: #A86B12;
  --warn-soft: #F8EBD6;
  --danger: #B0413C;
  --danger-soft: #F7E1DF;
  --shadow: 0 1px 2px rgba(60, 30, 45, .05), 0 6px 24px rgba(60, 30, 45, .06);
  --shadow-lg: 0 10px 40px rgba(40, 15, 30, .18);
  --radius: 20px;
  --radius-sm: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121013; --surface: #1B171B; --surface-2: #241F24; --surface-3: #2E282E;
  --text: #F3ECEF; --muted: #A99AA2; --faint: #75676E; --line: #2F282E;
  --accent: #E28EAE; --accent-2: #B86A88; --accent-soft: #3A2430; --accent-ink: #1C0F16;
  --success: #74C39C; --success-soft: #1D3229; --warn: #E3B061; --warn-soft: #3A2D18;
  --danger: #EE8A84; --danger-soft: #3D2120;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121013; --surface: #1B171B; --surface-2: #241F24; --surface-3: #2E282E;
    --text: #F3ECEF; --muted: #A99AA2; --faint: #75676E; --line: #2F282E;
    --accent: #E28EAE; --accent-2: #B86A88; --accent-soft: #3A2430; --accent-ink: #1C0F16;
    --success: #74C39C; --success-soft: #1D3229; --warn: #E3B061; --warn-soft: #3A2D18;
    --danger: #EE8A84; --danger-soft: #3D2120;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 10px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}

/* ===================== Base ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.sm { width: 18px; height: 18px; }
.ic.lg { width: 28px; height: 28px; }
.ic.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ===================== Layout ===================== */
.app { min-height: 100dvh; }
.view {
  max-width: 560px; margin: 0 auto;
  padding: calc(var(--safe-t) + 18px) 16px calc(var(--tab-h) + var(--safe-b) + 28px);
  outline: none;
}
.view.full { padding-bottom: calc(150px + var(--safe-b)); }
.view-enter { animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.page-head h1 { font-family: var(--display); font-size: 30px; font-weight: 500; line-height: 1.1; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-weight: 600; font-size: 14px; margin: 0 0 10px -6px; padding: 6px; }

.section { margin-top: 26px; }
.section-title { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 4px 10px; }
.section-title a, .section-title button { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--accent); font-weight: 600; }

.card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px;
  transition: transform .15s var(--ease), background .2s, opacity .2s; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.block { width: 100%; }
.btn.lg { min-height: 58px; font-size: 16.5px; padding: 0 26px; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--text); background: transparent; transition: background .2s, transform .15s; }
.icon-btn:active { transform: scale(.92); background: var(--surface-2); }
.icon-btn.filled { background: var(--surface-2); }
.link-btn { color: var(--accent); font-weight: 700; padding: 8px 4px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 13.5px; white-space: nowrap; color: var(--text);
  transition: background .2s, border-color .2s, color .2s;
}
.chip[aria-pressed="true"], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); letter-spacing: .01em; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.success { background: var(--success-soft); color: var(--success); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }

/* ===================== Forms ===================== */
.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 2px 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1.5px solid transparent; outline: none; font-weight: 600;
  transition: border-color .2s, background .2s; -webkit-appearance: none; appearance: none;
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; font-weight: 500; }
.input:focus { border-color: var(--accent); background: var(--surface); }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.list-item { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 12px 16px; width: 100%; text-align: left; color: var(--text); }
.list-item + .list-item { border-top: 1px solid var(--line); }
.list-item .ic:last-child { color: var(--faint); }
.list-item .li-ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.list-item:active { background: var(--surface-2); }

/* ===================== Tab bar ===================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(18px); -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 11px; font-weight: 700; transition: color .2s; }
.tabbar a .ic { width: 24px; height: 24px; transition: transform .25s var(--ease); }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar a[aria-current="page"] .ic { transform: translateY(-1px); stroke-width: 2.1; }

/* ===================== Boot ===================== */
.boot { min-height: 70dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.boot-mark { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .7; } }

/* ===================== Home ===================== */
.hello { font-family: var(--display); font-size: 28px; font-weight: 500; line-height: 1.15; }
.hello em { font-style: italic; color: var(--accent); }
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 22px;
  background: linear-gradient(150deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #2a0f1d) 100%);
  color: #fff; box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .hero { color: var(--accent-ink); }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.hero h2 { font-family: var(--display); font-weight: 500; font-size: 30px; margin-top: 6px; line-height: 1.1; }
.hero .meta { opacity: .85; margin-top: 6px; font-size: 14px; }
.hero .btn { background: #fff; color: var(--accent); margin-top: 18px; }
:root[data-theme="dark"] .hero .btn { background: var(--accent-ink); color: var(--accent); }
.hero .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.hero .tags .tag { background: rgba(255,255,255,.18); color: inherit; }
.hero.calm { background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero.calm::after { background: var(--accent-soft); opacity: .6; }
.hero.calm .btn { background: var(--accent-soft); color: var(--accent); }

.weeks { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 12px; }
.weeks i { height: 8px; border-radius: 99px; background: var(--surface-3); position: relative; overflow: hidden; }
.weeks i b { position: absolute; inset: 0; background: var(--accent); transform-origin: left; }
.weeks i.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.weekstrip .d { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border-radius: 14px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.weekstrip .d.today { background: var(--accent-soft); color: var(--accent); }
.weekstrip .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.weekstrip .dot.done { background: var(--success); color: #fff; }
.weekstrip .dot.missed, .weekstrip .dot.pending { background: transparent; border: 1.5px dashed var(--faint); }
.weekstrip .dot.rest { background: transparent; color: var(--faint); }
.weekstrip .dot.active { background: var(--warn); color: #fff; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > b { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .6s var(--ease); }
.quote { font-family: var(--display); font-style: italic; color: var(--muted); font-size: 15.5px; text-align: center; padding: 18px 10px 0; }
.ring { --p: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: 14px; }

/* ===================== Agenda ===================== */
.weeksel { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.weeksel::-webkit-scrollbar { display: none; }
.weeksel button { flex: none; min-width: 54px; height: 54px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.weeksel button small { font-size: 10px; font-weight: 700; color: var(--muted); }
.weeksel button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.weeksel button[aria-pressed="true"] small { color: inherit; opacity: .8; }
.slot { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.slot + .slot { border-top: 1px solid var(--line); }
.slot .date { width: 46px; text-align: center; flex: none; }
.slot .date b { display: block; font-size: 20px; font-weight: 800; line-height: 1; }
.slot .date span { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.slot.is-today { background: var(--accent-soft); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--surface-3); }
.status-dot.done { background: var(--success); }
.status-dot.missed, .status-dot.pending { background: var(--danger); }
.status-dot.today, .status-dot.active { background: var(--warn); }

/* ===================== Workout mode ===================== */
.wk-top {
  position: sticky; top: 0; z-index: 20; margin: calc(-18px - var(--safe-t)) -16px 12px; padding: calc(var(--safe-t) + 8px) 8px 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.wk-top .t { font-weight: 800; font-size: 15px; }
.wk-top .s { font-size: 12px; color: var(--muted); font-weight: 600; }
.wk-progress { height: 4px; border-radius: 99px; background: var(--surface-3); margin: 8px 8px 0; overflow: hidden; }
.wk-progress b { display: block; height: 100%; background: var(--accent); transition: width .5s var(--ease); }
.wk-nav { display: flex; align-items: center; justify-content: space-between; margin: 0 -6px 6px; }
.wk-nav .pos { font-size: 13px; font-weight: 700; color: var(--muted); }
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.ex-card + .ex-card { margin-top: 10px; }
.ex-card.inactive { opacity: .7; }
.ex-head { padding: 18px 18px 10px; }
.ex-name { font-family: var(--display); font-size: 25px; font-weight: 500; line-height: 1.12; }
.ex-meta { color: var(--muted); font-size: 13.5px; margin-top: 6px; font-weight: 600; }
.ex-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.biset-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 2px 4px 8px; }
.biset-wrap { border-left: 3px solid var(--accent); padding-left: 10px; margin-left: 2px; }
.sugg { margin: 0 14px 10px; padding: 11px 13px; border-radius: 14px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); width: calc(100% - 28px); text-align: left; color: var(--text); }
.sugg.up { background: var(--success-soft); }
.sugg.down { background: var(--danger-soft); }
.sugg .ic { margin-top: 1px; }
.sugg.up .ic { color: var(--success); } .sugg.down .ic { color: var(--danger); }

.sets { padding: 4px 10px 10px; }
.set { border-radius: 18px; padding: 10px; transition: background .25s; }
.set + .set { margin-top: 4px; }
.set-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.set-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--surface-2); color: var(--muted); flex: none; }
.set.done .set-n { background: var(--success); color: #fff; }
.set.active { background: var(--accent-soft); }
.set.active .set-n { background: var(--accent); color: var(--accent-ink); }
.set-sum { flex: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.set-sum .prev { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.set .drop-tag { font-size: 11px; color: var(--accent); font-weight: 800; }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.stepper { background: var(--surface); border-radius: 16px; padding: 8px 6px 6px; text-align: center; border: 1px solid var(--line); }
.stepper label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stepper .ctl { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.stepper button { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); flex: none; }
.stepper button:active { transform: scale(.92); background: var(--surface-3); }
.stepper input { width: 100%; min-width: 0; border: 0; background: transparent; text-align: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; outline: none; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.steppers.drop { grid-template-columns: 1fr 1fr; }
.drop-box { margin-top: 10px; padding: 10px; border-radius: 16px; border: 1.5px dashed var(--accent-2); }
.drop-box .t { font-size: 12px; font-weight: 800; color: var(--accent); display: flex; align-items: center; gap: 6px; }
.cluster-row { display: flex; gap: 8px; margin-top: 10px; }
.cluster-row .stepper { flex: 1; }
.cluster-row .stepper input { font-size: 22px; }
.effort { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.effort .lbl { font-size: 11.5px; font-weight: 800; color: var(--muted); margin-right: 2px; }
.effort .chip { min-height: 34px; padding: 0 11px; font-size: 13px; }
.ex-foot { display: flex; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }
.ex-foot .chip { min-height: 34px; font-size: 12.5px; }

.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.action-bar .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.action-bar .btn.primary { flex: 1; min-height: 62px; font-size: 17px; box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.action-bar .side { width: 56px; height: 56px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; flex: none; box-shadow: var(--shadow); }
.action-bar .side small { display: block; font-size: 9.5px; font-weight: 800; color: var(--muted); margin-top: -2px; }

/* Descanso */
.rest {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  padding: 14px 18px calc(18px + var(--safe-b)); border-top: 1px solid var(--line);
  animation: sheetUp .35s var(--ease);
}
.rest .inner { max-width: 520px; margin: 0 auto; }
.rest .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 0 auto 10px; }
.rest-clock { display: flex; align-items: center; justify-content: center; gap: 22px; }
.rest-ring { position: relative; width: 150px; height: 150px; flex: none; }
.rest-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rest-ring circle { fill: none; stroke-width: 9; }
.rest-ring .bg { stroke: var(--surface-2); }
.rest-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.rest-ring .t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rest-ring .t b { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1; }
.rest-ring .t span { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.rest.over .rest-ring .fg { stroke: var(--success); }
.rest.over .rest-ring .t b { color: var(--success); }
.rest-adj { display: flex; flex-direction: column; gap: 10px; }
.rest-adj button { width: 64px; height: 48px; border-radius: 15px; background: var(--surface-2); font-weight: 800; font-size: 15px; }
.rest-next { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-size: 13.5px; }
.rest-next b { display: block; font-size: 15.5px; margin-top: 2px; }
.rest-actions { display: flex; gap: 10px; margin-top: 14px; }
.rest-actions .btn { flex: 1; }

/* Resumo */
.summary-hero { text-align: center; padding: 22px 8px 6px; }
.summary-hero .badge { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent); color: #fff; animation: pop .5s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: none; opacity: 1; } }
.summary-hero h1 { font-family: var(--display); font-weight: 500; font-size: 30px; }
.cmp { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; font-size: 14px; }
.cmp + .cmp { border-top: 1px solid var(--line); }
.delta { font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); } .delta.eq { color: var(--muted); }

/* ===================== Sheet / modal ===================== */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(20, 8, 14, .42); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
  animation: sheetUp .32s var(--ease); box-shadow: var(--shadow-lg);
}
.sheet .inner { max-width: 520px; margin: 0 auto; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet h2 { font-family: var(--display); font-weight: 500; font-size: 24px; margin-bottom: 6px; }
.sheet .sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.sheet .sheet-actions .btn { flex: 1; }
.sheet ol, .sheet ul, .prose ol, .prose ul { padding-left: 20px; margin: 6px 0; }
.sheet li, .prose li { margin: 4px 0; }
.prose h3 { font-size: 15px; margin: 16px 0 6px; }
.prose p { margin: 6px 0; color: var(--text); }

/* ===================== Toast ===================== */
.toast-root { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 10px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 520px; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 16px; font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: toastIn .35s var(--ease); }
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-14px); opacity: 0; } }

/* ===================== Charts ===================== */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10px; font-weight: 600; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .line2 { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .area { fill: url(#gArea); }
.chart .pt { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .pt.raw { fill: var(--accent-2); stroke: none; opacity: .45; }
.chart .goal { stroke: var(--success); stroke-dasharray: 3 5; stroke-width: 1.5; }
.chart .goal-t { fill: var(--success); font-size: 10px; font-weight: 700; font-family: var(--font); }
.chart .barr { fill: var(--accent); }
.chart .barr.b2 { fill: var(--accent-soft); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart-tip { font-size: 13px; font-weight: 700; min-height: 20px; margin-top: 6px; color: var(--muted); }
.chart-tip b { color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ===================== Misc ===================== */
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .ic { width: 38px; height: 38px; color: var(--faint); margin-bottom: 10px; }
.ach { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.ach + .ach { border-top: 1px solid var(--line); }
.ach .ai { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--faint); flex: none; }
.ach.on .ai { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.ach:not(.on) .grow { opacity: .6; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos button { aspect-ratio: 3/4; border-radius: 12px; overflow: hidden; background: var(--surface-2); position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos.blur img { filter: blur(14px); }
.photos span { position: absolute; left: 6px; bottom: 6px; font-size: 10.5px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.report { white-space: pre-wrap; font: 500 12.5px/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; background: var(--surface-2); border-radius: 16px; padding: 14px; max-height: 46dvh; overflow: auto; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
.notice .ic { color: var(--warn); }
.notice.info { background: var(--accent-soft); }
.notice.info .ic { color: var(--accent); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 700; text-align: right; }
.reorder-item { display: flex; align-items: center; gap: 8px; padding: 8px 4px; }
.reorder-item + .reorder-item { border-top: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.tbl th { text-align: left; color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }

@media (max-width: 374px) {
  .stepper button { width: 36px; height: 40px; border-radius: 11px; }
  .stepper input { font-size: 22px; }
  .steppers { gap: 8px; }
  .set { padding: 8px; }
  .sets { padding: 4px 6px 8px; }
  .action-bar .btn.primary { font-size: 15.5px; padding: 0 14px; white-space: nowrap; }
  .action-bar .side { width: 50px; height: 50px; }
  .ex-name { font-size: 22px; }
}
@media (min-width: 720px) {
  .view { padding-top: calc(var(--safe-t) + 32px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
