:root {
  --bg: #F5F6F3;
  --card: #FFFFFF;
  --ink: #111311;
  --ink-2: #3A3F3A;
  --muted: #8B918A;
  --line: #ECEEEA;
  --soft: #F0F2EE;
  --accent: #8FE04A;
  --accent-strong: #6CC428;
  --accent-ink: #3E7D10;
  --accent-soft: #EEF9E3;
  --dark: #141714;
  --dark-2: #1F231F;
  --danger: #F0524C;
  --danger-soft: #FDECEB;
  --blue: #4A9BF0;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(17, 19, 17, .04), 0 6px 20px rgba(17, 19, 17, .05);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: calc(64px + var(--safe-bottom));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, select { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.hidden { display: none !important; }

#app { max-width: 520px; margin: 0 auto; min-height: 100%; position: relative; }
#view {
  padding: calc(var(--safe-top) + 14px) 18px calc(var(--tabbar-h) + 28px);
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Typography ---------- */
h1 { font-size: 30px; letter-spacing: -.6px; margin: 4px 0 2px; font-weight: 700; }
h2 { font-size: 19px; letter-spacing: -.3px; margin: 0; font-weight: 650; }
h3 { font-size: 16px; margin: 0; font-weight: 600; }
.sub { color: var(--muted); font-size: 15px; margin: 0; }
.small { font-size: 13px; color: var(--muted); }
.tiny { font-size: 11.5px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--danger); }
.down { color: var(--accent-ink); }

/* ---------- Layout ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; min-height: 44px; }
.topbar .title { min-width: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.link { color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow);
  display: grid; place-items: center; flex-shrink: 0;
}
.icon-btn svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.accent { background: var(--accent); box-shadow: none; }
.icon-btn.ghost { background: var(--soft); box-shadow: none; }
.icon-btn.sm { width: 36px; height: 36px; }
.icon-btn.sm svg { width: 18px; height: 18px; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.dark { background: var(--dark); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.card.dark .small, .card.dark .tiny { color: #9AA09A; }
.card.tap { transition: transform .15s; }
.card.tap:active { transform: scale(.985); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 999px;
  font-weight: 650; font-size: 16px; transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.dark { background: var(--dark); color: #fff; }
.btn.soft { background: var(--soft); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

.play {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.play svg { width: 16px; height: 16px; fill: var(--ink); margin-left: 2px; }
.play.dark { background: var(--dark); }
.play.dark svg { fill: var(--accent); }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 2px 18px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--card); color: var(--ink-2); font-size: 14px; font-weight: 550;
  box-shadow: var(--shadow); white-space: nowrap;
}
.chip.on { background: var(--accent); color: var(--ink); box-shadow: none; font-weight: 650; }
.seg { display: flex; background: var(--soft); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { flex: 1; height: 32px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 650;
}
.tag.gray { background: var(--soft); color: var(--ink-2); }
.tag.dark { background: rgba(255,255,255,.12); color: #fff; }
.tag.fire { background: #FFF2E2; color: #C46A00; }

/* ---------- Home ---------- */
.overview { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; margin-top: 14px; }
.ring { position: relative; width: 132px; height: 132px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .big { font-size: 30px; font-weight: 700; letter-spacing: -.5px; }
.ov-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.ov-item + .ov-item { border-top: 1px solid rgba(255,255,255,.07); }
.ov-ico { width: 30px; height: 30px; border-radius: 10px; background: rgba(143,224,74,.14); display: grid; place-items: center; flex-shrink: 0; }
.ov-ico svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ov-val { font-size: 16px; font-weight: 650; }
.ov-val small { font-size: 12px; color: #8E948E; font-weight: 500; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px; padding: 4px 18px 10px; scroll-snap-type: x mandatory; }
.hscroll::-webkit-scrollbar { display: none; }
.wcard {
  scroll-snap-align: start; flex-shrink: 0; width: 168px; min-height: 196px; border-radius: var(--radius);
  padding: 16px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden; background: var(--dark);
}
.wcard::before { content: ""; position: absolute; inset: 0; background: var(--g); opacity: 1; }
.wcard > * { position: relative; }
.wcard .wname { font-size: 17px; font-weight: 700; line-height: 1.2; letter-spacing: -.2px; }
.wcard .wmeta { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 4px; }
.wcard .wbottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.wcard.add { background: var(--card); color: var(--ink); box-shadow: var(--shadow); align-items: center; justify-content: center; text-align: center; gap: 10px; }
.wcard.add::before { display: none; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week .d { font-size: 12px; color: var(--muted); font-weight: 600; }
.week .n { width: 36px; height: 36px; margin: 8px auto 0; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; }
.week .n.today { border: 2px solid var(--ink); }
.week .n.done { background: var(--accent); }
.week .n.future { color: #C2C6C0; }

.mini-stat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--card); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat .value { font-size: 21px; font-weight: 700; margin-top: 4px; letter-spacing: -.3px; }
.stat .value small { font-size: 13px; font-weight: 550; color: var(--muted); }
.stat .foot { font-size: 12px; margin-top: 3px; font-weight: 600; }
.stat.span2 { grid-column: span 2; }

/* ---------- Lists ---------- */
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; text-align: left; }
.item + .item { border-top: 1px solid var(--line); }
.item:active { background: var(--soft); }
.item .t { font-weight: 600; font-size: 15.5px; }
.item .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.thumb {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--g, var(--dark)); color: #fff; font-weight: 700; font-size: 17px;
}
.thumb.light { background: var(--accent-soft); color: var(--accent-ink); }
.chev { width: 18px; height: 18px; stroke: #C3C7C1; fill: none; stroke-width: 2.4; stroke-linecap: round; flex-shrink: 0; }

.empty { text-align: center; padding: 34px 18px; }
.empty .em { font-size: 40px; }
.empty p { color: var(--muted); margin: 8px 0 18px; font-size: 15px; line-height: 1.45; }

/* ---------- Weight ---------- */
.hero-weight { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 6px; }
.hero-weight .w { font-size: 46px; font-weight: 750; letter-spacing: -1.4px; line-height: 1; }
.hero-weight .w small { font-size: 18px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.delta { font-size: 14px; font-weight: 650; }
.progress-bar { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .5s; }
.card.dark .progress-bar { background: rgba(255,255,255,.1); }

/* ---------- Charts ---------- */
.chart { position: relative; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: #A4AAA3; font-size: 10.5px; font-family: inherit; }
.chart .tip { pointer-events: none; transition: opacity .15s; }
.chart-empty { height: 160px; display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 0 20px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; max-width: 22px; border-radius: 7px; background: var(--soft); min-height: 6px; }
.bars .b i.on { background: var(--accent); }
.bars .b span { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .h { font-size: 11px; color: var(--muted); font-weight: 650; padding-bottom: 6px; }
.cal .c { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 13.5px; font-weight: 550; }
.cal .c.done { background: var(--accent); font-weight: 700; }
.cal .c.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .c.out { color: #CDD1CB; }

/* ---------- Timer ---------- */
.timer-wrap { display: grid; place-items: center; margin: 10px 0 18px; }
.timer-ring { position: relative; width: min(78vw, 290px); aspect-ratio: 1; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.timer-ring .time { font-size: 64px; font-weight: 300; letter-spacing: -2px; font-variant-numeric: tabular-nums; }
.timer-ring .lbl { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1.2px; }
.timer-ring.done .time { color: var(--accent-ink); font-weight: 500; }
.adjust { display: flex; align-items: center; justify-content: center; gap: 18px; }
.adjust .btn { min-width: 84px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { height: 54px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); font-weight: 650; font-size: 15px; }
.preset.on { background: var(--accent); box-shadow: none; }
.timer-controls { display: grid; grid-template-columns: 64px 1fr 64px; gap: 14px; align-items: center; margin: 18px 0 8px; }
.round-btn { width: 64px; height: 64px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; }
.round-btn svg { width: 24px; height: 24px; stroke: var(--ink); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.big-btn { height: 64px; border-radius: 999px; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; }
.big-btn svg { width: 20px; height: 20px; }

.timer-pill {
  position: fixed; z-index: 80; right: 16px; bottom: calc(var(--tabbar-h) + 14px);
  height: 44px; padding: 0 16px 0 14px; border-radius: 999px; background: var(--dark); color: #fff;
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.timer-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.timer-pill.in-session { bottom: calc(var(--safe-bottom) + 96px); }
.timer-pill.done { background: var(--accent); color: var(--ink); }
.timer-pill.done .dot { background: var(--ink); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px;
  height: var(--tabbar-h); padding: 6px 8px var(--safe-bottom);
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #A3A9A2; font-size: 10.5px; font-weight: 600; }
.tab svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
.tab[data-tab="home"] svg { stroke: none; }
.tab.active { color: var(--ink); }
.tab.active svg { color: var(--accent-strong); }
.tab.active span { color: var(--ink); }

/* ---------- Overlay (full screen) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch;
  max-width: 520px; margin: 0 auto; animation: slideup .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ov-head {
  position: sticky; top: 0; z-index: 5; padding: calc(var(--safe-top) + 10px) 18px 12px;
  background: rgba(245,246,243,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  display: flex; align-items: center; gap: 12px;
}
.ov-body { padding: 4px 18px calc(var(--safe-bottom) + 120px); }
.ov-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-width: 520px; margin: 0 auto;
  padding: 12px 18px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(to top, var(--bg) 70%, rgba(245,246,243,0));
}

/* ---------- Session ---------- */
.session-hero { background: var(--dark); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.session-hero .clock { font-size: 34px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.session-hero .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.session-hero .grid3 b { display: block; font-size: 17px; }
.session-hero .grid3 span { font-size: 11.5px; color: #9AA09A; }
.ex { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 14px 12px; margin-bottom: 12px; }
.ex.complete { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.ex-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.ex-num { width: 28px; height: 28px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ex.complete .ex-num { background: var(--accent); }
.ex-name { font-weight: 700; font-size: 16.5px; letter-spacing: -.2px; }
.ex-last { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.set-head, .set-row { display: grid; grid-template-columns: 26px 1fr 1fr 44px; gap: 8px; align-items: center; }
.set-head { font-size: 11px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .6px; padding: 0 2px 6px; }
.set-head span:nth-child(2), .set-head span:nth-child(3) { text-align: center; }
.set-row { padding: 5px 2px; border-radius: 14px; transition: background .2s; }
.set-row.done { background: var(--accent-soft); }
.set-idx { font-weight: 700; color: var(--muted); text-align: center; font-size: 14px; }
.set-row.done .set-idx { color: var(--accent-ink); }
.stepper { display: flex; align-items: center; background: var(--soft); border-radius: 12px; height: 42px; overflow: hidden; }
.set-row.done .stepper { background: #fff; }
.stepper button { width: 32px; height: 100%; font-size: 20px; font-weight: 500; color: var(--ink-2); flex-shrink: 0; }
.stepper button:active { background: rgba(0,0,0,.06); }
.stepper input {
  width: 100%; min-width: 0; border: 0; background: transparent; text-align: center; font: inherit;
  font-size: 16px; font-weight: 700; color: var(--ink); padding: 0; outline: none; font-variant-numeric: tabular-nums;
}
.check { width: 44px; height: 42px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; }
.check svg { width: 20px; height: 20px; stroke: #B5BAB3; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.set-row.done .check { background: var(--accent); }
.set-row.done .check svg { stroke: var(--ink); }
.set-tools { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px 0; }
.set-tools button { font-size: 13.5px; font-weight: 650; color: var(--accent-ink); padding: 6px 4px; }
.set-tools button.muted { color: var(--muted); }
.pr-badge { font-size: 10px; font-weight: 800; color: #C46A00; background: #FFF2E2; border-radius: 6px; padding: 2px 5px; margin-left: 6px; vertical-align: 2px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.input {
  width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid transparent; background: var(--soft);
  padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--accent-strong); background: #fff; }
textarea.input { height: 80px; padding: 12px 14px; resize: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3f { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.mini-field > span { font-size: 11px; color: var(--muted); font-weight: 650; display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.mini-field .input { height: 44px; font-size: 16px; text-align: center; padding: 0 6px; }

.ed-ex { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px; }
.ed-ex .top { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ed-ex .top .input { height: 46px; font-weight: 600; }

.big-input-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.big-input {
  width: 170px; text-align: center; font-size: 52px; font-weight: 750; letter-spacing: -1.5px; border: 0; outline: none;
  background: transparent; color: var(--ink); font-family: inherit; padding: 0;
}
.big-unit { font-size: 18px; color: var(--muted); font-weight: 650; text-align: center; margin-top: -14px; margin-bottom: 18px; }

/* ---------- Sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(10,12,10,.38); animation: fade2 .2s; }
@keyframes fade2 { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; max-width: 520px; margin: 0 auto;
  background: var(--card); border-radius: 28px 28px 0 0; padding: 10px 20px calc(var(--safe-bottom) + 20px);
  max-height: 90vh; overflow-y: auto; animation: sheetup .3s cubic-bezier(.2,.9,.2,1);
}
@keyframes sheetup { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: #DDE0DB; margin: 0 auto 14px; }
.sheet h2 { margin-bottom: 4px; }
.sheet .sub { margin-bottom: 18px; }

/* ---------- Toast / flash ---------- */
.toast {
  position: fixed; z-index: 120; left: 50%; top: calc(var(--safe-top) + 12px); transform: translateX(-50%);
  background: var(--dark); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); white-space: nowrap; animation: toastin .3s;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, -10px); } }
.flash { position: fixed; inset: 0; z-index: 110; pointer-events: none; background: var(--accent); animation: flash 1s ease 3; }
@keyframes flash { 0%, 100% { opacity: 0; } 50% { opacity: .55; } }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; font-size: 15px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 650; }
.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #E2E5E0; border-radius: 99px; transition: .2s; }
.switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + i { background: var(--accent-strong); }
.switch input:checked + i::after { transform: translateX(20px); }

button, .stepper, .check { touch-action: manipulation; }
.hint {
  display: flex; align-items: center; gap: 10px; background: var(--accent-soft); color: var(--ink-2);
  border-radius: 14px; padding: 10px 12px; font-size: 13px; line-height: 1.35; margin: 0 0 10px;
}
.hint span { flex: 1; }
.hint button { background: var(--accent); color: var(--ink); font-weight: 700; font-size: 13px; height: 32px; padding: 0 14px; border-radius: 999px; flex-shrink: 0; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatch.on { box-shadow: 0 0 0 2.5px var(--ink); }
.item .s.down, .stat .foot.down { color: var(--accent-ink); }
.item .s.up, .stat .foot.up { color: var(--danger); }

/* Ícones SVG próprios (iguais em qualquer sistema, sem emoji) */
.em { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 24px; background: var(--accent-soft); display: grid; place-items: center; }
.em svg { width: 36px; height: 36px; stroke: var(--accent-ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.em-inline svg, .pr-badge svg, .hint > svg, .toast svg, .timer-pill svg, .ex-num svg {
  width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.em-inline { color: #C46A00; display: inline-flex; }
.pr-badge { display: inline-flex; align-items: center; gap: 3px; }
.hint > svg { width: 20px; height: 20px; color: var(--accent-ink); }
.toast { display: flex; align-items: center; gap: 8px; }
.toast svg { width: 17px; height: 17px; color: var(--accent); }
.ex-num svg { width: 15px; height: 15px; stroke-width: 3; }
#timer-pill-text { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Gasto calórico (app Saúde) ---------- */
.ebars { display: flex; align-items: stretch; gap: 8px; }
.ebars.many { gap: 3px; }
.eb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eb .col { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.eb .estack { width: 100%; max-width: 24px; border-radius: 7px; overflow: hidden; display: flex; flex-direction: column; background: var(--soft); }
.eb .estack.today { box-shadow: 0 0 0 2px var(--ink); }
.eb .a { background: var(--accent); }
.eb .r { background: #D3EEBC; }
.eb span { font-size: 10.5px; color: var(--muted); font-weight: 600; height: 13px; line-height: 13px; }
.legend { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }
.legend.a { background: var(--accent); }
.legend.r { background: #D3EEBC; }
.card.dark .ov-val { color: #fff; }
.steps { padding-left: 20px; margin: 0 0 14px; }
.steps li { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); margin-bottom: 10px; }
.steps code { background: var(--soft); border-radius: 6px; padding: 1px 6px; font-size: 13px; font-family: ui-monospace, Menlo, monospace; white-space: nowrap; -webkit-user-select: all; user-select: all; }

/* ---------- Como fazer ---------- */
.how-btn {
  flex-shrink: 0; width: 54px; height: 54px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 9.5px; font-weight: 700; line-height: 1.1;
}
.how-btn svg { width: 15px; height: 15px; fill: currentColor; }
.demo { position: relative; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 3 / 2; }
.demo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.demo img.f2 { animation: demo-swap 2.6s ease-in-out infinite; }
@keyframes demo-swap { 0%, 38% { opacity: 0; } 50%, 88% { opacity: 1; } 100% { opacity: 0; } }
.demo-badge { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 11.5px; font-weight: 650; padding: 4px 10px; border-radius: 99px; }
.demo-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--soft); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { height: 40px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 13px; font-weight: 650; color: var(--ink-2); }
.day.on { background: var(--accent); color: var(--ink); box-shadow: none; }

/* ---------- Bi-set ---------- */
.ex.superset { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.ss-head { display: flex; flex-direction: column; gap: 6px; padding: 0 2px 12px; }
.ss-head .tag { align-self: flex-start; }
.tag svg, .link-toggle svg, .set-tools svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ss-ex + .ss-ex { border-top: 1px dashed var(--line); padding-top: 12px; }
.round { border-radius: 16px; padding: 4px 0 2px; }
.round + .round { margin-top: 6px; }
.round-label { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; padding: 4px 4px 2px; }
.round.done .round-label { color: var(--accent-ink); }
.set-tools { flex-wrap: wrap; gap: 4px; }
.set-tools button { display: inline-flex; align-items: center; gap: 4px; }
.link-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 36px; margin: -4px 0 6px;
  border-radius: 12px; border: 1.5px dashed #D5DAD2; color: var(--muted); font-size: 13px; font-weight: 650;
}
.link-toggle.on { border: 0; background: var(--accent-soft); color: var(--accent-ink); }
.toast { white-space: normal; width: max-content; max-width: calc(100vw - 32px); border-radius: 18px; line-height: 1.35; }

/* ---------- Login ---------- */
.auth { min-height: 100%; padding: calc(var(--safe-top) + 56px) 24px calc(var(--safe-bottom) + 30px); max-width: 420px; margin: 0 auto; }
.auth-logo { width: 76px; height: 76px; border-radius: 22px; display: block; margin: 0 0 18px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.auth h1 { font-size: 34px; }
