/* Antares V3 — "graphite + glass". Neutral graphite base, translucent frosted-glass surfaces
   (backdrop blur), white/silver accent, system green for "done". Light mode is its own palette:
   pale aluminium with white glass and a graphite accent. */
:root {
  --bg: var(--pa-bg-light, #e9e9ee);
  --bg-glow-1: color-mix(in srgb, var(--pa-light) 10%, #ffffff);
  --bg-glow-2: color-mix(in srgb, var(--pa-light) 8%, #d9d9e0);
  --surface: var(--pa-surface-light, rgba(255, 255, 255, .62));
  --surface-solid: var(--pa-solid-light, #f7f7f9);
  --surface-2: rgba(118, 118, 128, .08);
  --surface-3: rgba(60, 60, 67, .16);
  --fill: rgba(118, 118, 128, .12);
  --card-border: rgba(255, 255, 255, .75);
  --border: rgba(60, 60, 67, .14);
  --glass-blur: blur(22px) saturate(1.6);
  --text: #0b0b0d;
  --muted: #5f5f66;
  --faint: #9a9aa1;
  --accent: var(--pa-light);
  --accent-strong: var(--pa-light);
  --accent-soft: var(--pa-light-soft);
  --accent-text: var(--pa-on-light);
  --success: #34c759;
  --success-strong: #1f7a36;
  --success-soft: rgba(52, 199, 89, .16);
  --warn: #a35f00;
  --warn-soft: rgba(255, 159, 10, .16);
  --danger: #e5352b;
  --danger-soft: rgba(255, 59, 48, .12);
  --info: #0066d6;
  --info-soft: rgba(0, 122, 255, .12);
  --hero-1: var(--pa-hero-1);
  --hero-2: var(--pa-hero-2);
  --hero-3: var(--pa-hero-3);
  --hero-text: #ffffff;
  --hero-muted: rgba(255, 255, 255, .64);
  --lime: var(--pa-dark); /* hero highlight (the hero is always dark) */
  --cta: var(--pa-dark);
  --cta-text: var(--pa-on);
  --bronze: #b0733a;
  --silver: #8e98a4;
  --gold: #c99a16;
  --platinum: #6aa3c4;
  --heat-0: rgba(118, 118, 128, .14);
  --heat-1: #a8dfb6;
  --heat-3: #34c759;
  --heat-cardio: #8fbcf0;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --grid: rgba(60, 60, 67, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 1px rgba(255, 255, 255, .6) inset, 0 8px 24px rgba(20, 20, 30, .07);
  --radius: 20px;
  --radius-sm: 12px;
  --tabbar-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--pa-bg-dark, #0b0b0d); --bg-glow-1: color-mix(in srgb, var(--pa-dark) 20%, #19191d); --bg-glow-2: color-mix(in srgb, var(--pa-dark) 8%, #141417);
    --surface: var(--pa-surface-dark, rgba(255, 255, 255, .065)); --surface-solid: var(--pa-solid-dark, #1c1c20); --surface-2: rgba(255, 255, 255, .06); --surface-3: rgba(255, 255, 255, .14);
    --fill: rgba(255, 255, 255, .09); --card-border: rgba(255, 255, 255, .09); --border: rgba(255, 255, 255, .1);
    --text: #f5f5f7; --muted: #a1a1a8; --faint: #6c6c73;
    --accent: var(--pa-dark); --accent-strong: var(--pa-dark); --accent-soft: var(--pa-dark-soft); --accent-text: var(--pa-on);
    --success: #32d74b; --success-strong: #32d74b; --success-soft: rgba(50, 215, 75, .16);
    --warn: #ffb340; --warn-soft: rgba(255, 159, 10, .16); --danger: #ff453a; --danger-soft: rgba(255, 69, 58, .16);
    --info: #64aaff; --info-soft: rgba(10, 132, 255, .18);
    --heat-0: rgba(255, 255, 255, .07); --heat-1: #1f5f2c; --heat-3: #32d74b; --heat-cardio: #24568f;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --grid: rgba(255, 255, 255, .08);
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--pa-bg-dark, #0b0b0d); --bg-glow-1: color-mix(in srgb, var(--pa-dark) 20%, #19191d); --bg-glow-2: color-mix(in srgb, var(--pa-dark) 8%, #141417);
  --surface: var(--pa-surface-dark, rgba(255, 255, 255, .065)); --surface-solid: var(--pa-solid-dark, #1c1c20); --surface-2: rgba(255, 255, 255, .06); --surface-3: rgba(255, 255, 255, .14);
  --fill: rgba(255, 255, 255, .09); --card-border: rgba(255, 255, 255, .09); --border: rgba(255, 255, 255, .1);
  --text: #f5f5f7; --muted: #a1a1a8; --faint: #6c6c73;
  --accent: var(--pa-dark); --accent-strong: var(--pa-dark); --accent-soft: var(--pa-dark-soft); --accent-text: var(--pa-on);
  --success: #32d74b; --success-strong: #32d74b; --success-soft: rgba(50, 215, 75, .16);
  --warn: #ffb340; --warn-soft: rgba(255, 159, 10, .16); --danger: #ff453a; --danger-soft: rgba(255, 69, 58, .16);
  --info: #64aaff; --info-soft: rgba(10, 132, 255, .18);
  --heat-0: rgba(255, 255, 255, .07); --heat-1: #1f5f2c; --heat-3: #32d74b; --heat-cardio: #24568f;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --grid: rgba(255, 255, 255, .08);
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset;
  color-scheme: dark;
}


/* ---------- color themes (Ajustes → Aparência). Each sets the accent for light and dark mode
   and the hero gradient; glass surfaces stay neutral. ---------- */

/* Blue family: accent plus blue-tinted background and glass. */
:root, :root[data-palette="blue"] {
  --pa-light: #0a5fc2; --pa-light-soft: rgba(10, 95, 194, .12); --pa-on-light: #ffffff;
  --pa-dark: #4da3ff; --pa-dark-soft: rgba(77, 163, 255, .17); --pa-on: #03101f;
  --pa-hero-1: #1b4a8a; --pa-hero-2: #0f2c57; --pa-hero-3: #07152b; --pa-glow: rgba(110, 180, 255, .38);
  --pa-bg-light: #e6edf8; --pa-surface-light: rgba(255, 255, 255, .64); --pa-solid-light: #f3f7fd;
  --pa-bg-dark: #050a15; --pa-surface-dark: rgba(130, 170, 255, .075); --pa-solid-dark: #0f1a2e;
}
:root[data-palette="navy"] {
  --pa-light: #1d3f8f; --pa-light-soft: rgba(29, 63, 143, .12); --pa-on-light: #ffffff;
  --pa-dark: #8fc4ff; --pa-dark-soft: rgba(143, 196, 255, .16); --pa-on: #07142a;
  --pa-hero-1: #22346e; --pa-hero-2: #141f47; --pa-hero-3: #090f26; --pa-glow: rgba(143, 196, 255, .3);
  --pa-bg-light: #e5e9f4; --pa-surface-light: rgba(255, 255, 255, .64); --pa-solid-light: #f2f4fb;
  --pa-bg-dark: #04071a; --pa-surface-dark: rgba(140, 160, 255, .075); --pa-solid-dark: #0d1330;
}
:root[data-palette="emerald"] {
  --pa-light: #0b7a52; --pa-light-soft: rgba(11, 122, 82, .12); --pa-on-light: #ffffff;
  --pa-dark: #3ee0a1; --pa-dark-soft: rgba(62, 224, 161, .15); --pa-on: #04140d;
  --pa-hero-1: #0f4a37; --pa-hero-2: #0a2e22; --pa-hero-3: #051710; --pa-glow: rgba(62, 224, 161, .28);
  --pa-bg-light: #e5f1ec; --pa-surface-light: rgba(255, 255, 255, .64); --pa-solid-light: #f2f8f5;
  --pa-bg-dark: #020d09; --pa-surface-dark: rgba(110, 255, 190, .06); --pa-solid-dark: #0b1d16;
}
/* "Preto +": true-black background, grey cards, one accent (OLED-friendly) */
:root[data-palette="black-lime"] {
  --pa-light: #4d7c0f; --pa-light-soft: color-mix(in srgb, #4d7c0f 13%, transparent); --pa-on-light: #ffffff;
  --pa-dark: #c8f53c; --pa-dark-soft: color-mix(in srgb, #c8f53c 15%, transparent); --pa-on: #0b0d06;
  --pa-hero-1: color-mix(in srgb, #c8f53c 14%, #1c1c1e); --pa-hero-2: #121214; --pa-hero-3: #050505; --pa-glow: rgba(200, 245, 60, .26);
  --pa-bg-light: #ececee; --pa-surface-light: rgba(255, 255, 255, .7); --pa-solid-light: #f7f7f8;
  --pa-bg-dark: #000000; --pa-surface-dark: rgba(255, 255, 255, .07); --pa-solid-dark: #141416;
}
:root[data-palette="black-cyan"] {
  --pa-light: #0e7490; --pa-light-soft: color-mix(in srgb, #0e7490 13%, transparent); --pa-on-light: #ffffff;
  --pa-dark: #22d3ee; --pa-dark-soft: color-mix(in srgb, #22d3ee 15%, transparent); --pa-on: #021418;
  --pa-hero-1: color-mix(in srgb, #22d3ee 14%, #1c1c1e); --pa-hero-2: #121214; --pa-hero-3: #050505; --pa-glow: rgba(34, 211, 238, .28);
  --pa-bg-light: #ececee; --pa-surface-light: rgba(255, 255, 255, .7); --pa-solid-light: #f7f7f8;
  --pa-bg-dark: #000000; --pa-surface-dark: rgba(255, 255, 255, .07); --pa-solid-dark: #141416;
}
:root[data-palette="black-amber"] {
  --pa-light: #b45309; --pa-light-soft: color-mix(in srgb, #b45309 13%, transparent); --pa-on-light: #ffffff;
  --pa-dark: #ffd60a; --pa-dark-soft: color-mix(in srgb, #ffd60a 15%, transparent); --pa-on: #1a1300;
  --pa-hero-1: color-mix(in srgb, #ffd60a 14%, #1c1c1e); --pa-hero-2: #121214; --pa-hero-3: #050505; --pa-glow: rgba(255, 214, 10, .24);
  --pa-bg-light: #ececee; --pa-surface-light: rgba(255, 255, 255, .7); --pa-solid-light: #f7f7f8;
  --pa-bg-dark: #000000; --pa-surface-dark: rgba(255, 255, 255, .07); --pa-solid-dark: #141416;
}
:root[data-palette="black-red"] {
  --pa-light: #c81e1e; --pa-light-soft: color-mix(in srgb, #c81e1e 13%, transparent); --pa-on-light: #ffffff;
  --pa-dark: #ff4d4f; --pa-dark-soft: color-mix(in srgb, #ff4d4f 15%, transparent); --pa-on: #ffffff;
  --pa-hero-1: color-mix(in srgb, #ff4d4f 14%, #1c1c1e); --pa-hero-2: #121214; --pa-hero-3: #050505; --pa-glow: rgba(255, 77, 79, .3);
  --pa-bg-light: #ececee; --pa-surface-light: rgba(255, 255, 255, .7); --pa-solid-light: #f7f7f8;
  --pa-bg-dark: #000000; --pa-surface-dark: rgba(255, 255, 255, .07); --pa-solid-dark: #141416;
}
:root[data-palette="black-violet"] {
  --pa-light: #6d28d9; --pa-light-soft: color-mix(in srgb, #6d28d9 13%, transparent); --pa-on-light: #ffffff;
  --pa-dark: #a78bfa; --pa-dark-soft: color-mix(in srgb, #a78bfa 15%, transparent); --pa-on: #120a26;
  --pa-hero-1: color-mix(in srgb, #a78bfa 14%, #1c1c1e); --pa-hero-2: #121214; --pa-hero-3: #050505; --pa-glow: rgba(167, 139, 250, .3);
  --pa-bg-light: #ececee; --pa-surface-light: rgba(255, 255, 255, .7); --pa-solid-light: #f7f7f8;
  --pa-bg-dark: #000000; --pa-surface-dark: rgba(255, 255, 255, .07); --pa-solid-dark: #141416;
}
:root[data-palette="black-white"] {
  --pa-light: #1c1c1f; --pa-light-soft: color-mix(in srgb, #1c1c1f 13%, transparent); --pa-on-light: #ffffff;
  --pa-dark: #f2f2f4; --pa-dark-soft: color-mix(in srgb, #f2f2f4 15%, transparent); --pa-on: #0b0b0d;
  --pa-hero-1: color-mix(in srgb, #f2f2f4 14%, #1c1c1e); --pa-hero-2: #121214; --pa-hero-3: #050505; --pa-glow: rgba(255, 255, 255, .16);
  --pa-bg-light: #ececee; --pa-surface-light: rgba(255, 255, 255, .7); --pa-solid-light: #f7f7f8;
  --pa-bg-dark: #000000; --pa-surface-dark: rgba(255, 255, 255, .07); --pa-solid-dark: #141416;
}
.palettes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.palette-opt { border: 0; border-radius: 16px; padding: 10px; background: var(--fill); color: var(--text); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.palette-opt .sw { width: 100%; height: 46px; border-radius: 12px; position: relative; overflow: hidden; }
.palette-opt .sw i { position: absolute; right: 8px; bottom: 8px; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.palette-opt[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden;
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b));
  touch-action: manipulation;
}
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(900px 520px at 85% -8%, var(--bg-glow-1) 0%, transparent 60%), radial-gradient(700px 480px at -15% 45%, var(--bg-glow-2) 0%, transparent 62%), var(--bg); }
body.no-tabbar { padding-bottom: 0; }
body.no-tabbar .tabbar { display: none; }
a { color: var(--accent-strong); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .35em; line-height: 1.15; }
h1 { font-size: 2.05rem; font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.06rem; font-weight: 650; letter-spacing: -.015em; }
p { margin: 0 0 .6em; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; }
code { font-size: .85em; background: var(--fill); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .88rem; }
.tiny { font-size: .76rem; }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.rounded { font-family: var(--rounded); }
.ellipsis { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.row { display: flex; align-items: center; min-width: 0; }
.row > * { min-width: 0; }
.row.gap { gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 12px; }
.mt2 { margin-top: 20px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--safe-t) + 8px) 16px 8px; background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.brand .greet { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand .greet small { color: var(--muted); font-size: .76rem; font-weight: 600; }
.brand .greet b { font-size: 1.02rem; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(150deg, #5a5a63, #1c1c21); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; overflow: hidden; font-family: var(--rounded); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.9rem; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .4; }
.sync-badge { height: 28px; padding: 0 10px; border-radius: 99px; border: 0; background: var(--fill); color: var(--muted); font-size: .74rem; font-weight: 600; display: flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit; }
.sync-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.sync-badge[data-status="ok"]::before { background: var(--success); }
.sync-badge[data-status="syncing"]::before { background: var(--info); animation: pulse 1s infinite; }
.sync-badge[data-status="error"]::before, .sync-badge[data-status="offline"]::before { background: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- layout ---------- */
main { padding: 4px 16px 28px; max-width: 720px; margin: 0 auto; outline: none; min-width: 0; overflow-wrap: anywhere; overflow-x: clip; }
/* Nothing may make the page wider than the phone (iOS lets overflowing content widen it). */
#view > *, .section, .card { min-width: 0; max-width: 100%; }
body { max-width: 100%; position: relative; }
.topbar, .backbar, .tabbar { max-width: 100%; overflow-x: clip; }
.topbar-right { flex-shrink: 0; }
main img, main canvas, main svg { max-width: 100%; }
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.card + .card { margin-top: 12px; }
.card.flat { box-shadow: none; }
.section { margin-top: 24px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); margin: 0 16px 7px; font-weight: 500; }
.section-title a, .section-title button { text-transform: none; font-size: .86rem; }
.page-head { margin: 2px 0 14px; }
.page-head p { color: var(--muted); margin: 2px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 650; background: var(--fill); color: var(--muted); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill.success { background: var(--success-soft); color: var(--success-strong); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* ---------- buttons & inputs ---------- */
.btn { appearance: none; border: 0; background: var(--fill); color: var(--accent-strong); border-radius: 14px; padding: 0 16px; min-height: 46px; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, opacity .15s; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.lime { background: var(--cta); color: var(--cta-text); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.glass { background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .86rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 1.06rem; border-radius: 16px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.97); opacity: .85; }
.link-btn { background: none; border: 0; color: var(--accent-strong); font: inherit; font-weight: 600; padding: 6px 0; cursor: pointer; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .8rem; color: var(--muted); margin: 0 4px 5px; font-weight: 500; }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; border-radius: 12px; border: 0; background: var(--fill); color: var(--text); font: inherit; padding: 8px 12px; font-size: 16px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; }
textarea { min-height: 72px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text); font: inherit; font-size: .84rem; font-weight: 550; padding: 6px 12px; border-radius: 8px; cursor: pointer; min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); font-weight: 650; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #636366; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--fill); color: var(--text); border-radius: 99px; padding: 8px 15px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; min-height: 36px; white-space: nowrap; display: inline-flex; align-items: center; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* ---------- hero (night sky with the Antares glow) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 20px; color: var(--hero-text); background: radial-gradient(85% 75% at 100% 0%, var(--pa-glow) 0%, transparent 55%), radial-gradient(60% 60% at 0% 100%, rgba(120, 120, 140, .18) 0%, transparent 70%), linear-gradient(155deg, var(--hero-1) 0%, var(--hero-2) 55%, var(--hero-3) 100%); border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 1px 0 rgba(255, 255, 255, .14) inset, 0 16px 36px rgba(0, 0, 0, .28); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(1px 1px at 18% 22%, rgba(255, 255, 255, .7) 50%, transparent 51%), radial-gradient(1px 1px at 42% 12%, rgba(255, 255, 255, .5) 50%, transparent 51%), radial-gradient(1.2px 1.2px at 64% 34%, rgba(255, 255, 255, .55) 50%, transparent 51%), radial-gradient(1px 1px at 30% 70%, rgba(255, 255, 255, .35) 50%, transparent 51%), radial-gradient(1px 1px at 82% 62%, rgba(255, 255, 255, .4) 50%, transparent 51%); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }
.hero h1 { color: #fff; font-size: 2.1rem; margin: 4px 0 2px; }
.hero .sub { color: var(--hero-muted); font-size: .94rem; }
.hero .meta { display: flex; gap: 18px; margin-top: 14px; color: var(--hero-muted); font-size: .8rem; flex-wrap: wrap; }
.hero .meta b { color: #fff; font-size: 1.12rem; display: block; font-family: var(--rounded); font-variant-numeric: tabular-nums; }
.hero .pill { background: rgba(255, 255, 255, .14); color: #fff; }
.hero .pill.lime { background: var(--lime); color: var(--pa-on); }
.hero-top { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; }
.hero-actions .btn.big { flex: 1; }
.hero-links { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.ring { width: 78px; height: 78px; flex: none; position: relative; }
.ring svg { width: 78px; height: 78px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .bg { stroke: rgba(255, 255, 255, .14); }
.ring .fg { stroke: var(--lime); stroke-linecap: round; transition: stroke-dashoffset .4s; filter: drop-shadow(0 0 6px var(--pa-glow)); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: 1.05rem; line-height: 1; color: #fff; font-family: var(--rounded); }
.ring .label small { display: block; font-size: .62rem; font-weight: 600; color: var(--hero-muted); margin-top: 2px; font-family: -apple-system, system-ui, sans-serif; }

/* week strip */
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 10px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: .7rem; color: var(--muted); font-weight: 600; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.wd .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 750; color: var(--text); background: var(--fill); border: 2px solid transparent; font-family: var(--rounded); }
.wd.today .dot { border-color: var(--accent); }
.wd.done .dot { background: var(--success); color: #fff; }
.wd.planned .dot { background: var(--accent-soft); color: var(--accent-strong); }
.wd.rest .dot { background: transparent; border: 2px dashed var(--surface-3); color: var(--faint); }
.wd.cardio .dot { background: var(--info-soft); color: var(--info); }
.wd.free .dot { color: var(--faint); }

.step { display: flex; gap: 12px; align-items: flex-start; }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .82rem; background: var(--fill); color: var(--muted); flex: none; }
.step.done .step-n { background: var(--success); color: #fff; }

/* ---------- exercises ---------- */
.ex-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.ex-card { padding: 0; overflow: hidden; }
.ex-row { display: flex; gap: 12px; align-items: center; padding: 12px; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ex-thumb { width: 54px; height: 54px; border-radius: 13px; object-fit: cover; background: #fff; flex: none; }
.ex-thumb.placeholder { display: grid; place-items: center; color: var(--muted); font-size: .64rem; text-align: center; background: var(--fill); }
.ex-title { font-weight: 650; line-height: 1.25; }
.ex-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.ex-status { flex: none; text-align: right; font-family: var(--rounded); }
.ex-progress { width: 46px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 5px; }
.ex-progress i { display: block; height: 100%; background: var(--success); }
.ex-card.complete .ex-title::after { content: " ✓"; color: var(--success); }
.ex-card.skipped { opacity: .6; }
.ex-body { padding: 0 12px 12px; border-top: 1px solid var(--border); }
.ex-sugg { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .84rem; }
.ex-actions { display: flex; gap: 6px; margin-top: 10px; }
.ex-actions .btn { flex: 1; padding: 0 6px; }
.chev { width: 18px; height: 18px; color: var(--faint); transition: transform .2s; flex: none; }
.ex-card.open .chev { transform: rotate(180deg); }
.sets { margin-top: 10px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.set-labels, .set-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 54px; gap: 6px; align-items: center; }
.set-labels { font-size: .68rem; color: var(--muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.add-set { width: 100%; min-height: 44px; border-radius: 14px; border: 1.5px dashed var(--surface-3); background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.add-set:active { background: var(--fill); }
.set-swipe { position: relative; border-radius: 14px; overflow: hidden; background: var(--danger); }
.set-del { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: #fff; font-weight: 700; font-size: .86rem; opacity: .7; transition: opacity .15s, transform .15s; }
.set-swipe.armed .set-del { opacity: 1; transform: translateY(-50%) scale(1.08); }
.set-row { padding: 4px; border-radius: 14px; background: var(--surface-solid); position: relative; touch-action: pan-y; transition: transform .22s ease; }
.set-row.swiping { transition: none; }
.set-row > * { position: relative; }
.set-row.next { outline: 2px solid var(--accent); outline-offset: -2px; }
.set-row.logged { background: color-mix(in srgb, var(--success) 16%, var(--surface-solid)); }
.set-n { text-align: center; font-weight: 700; color: var(--muted); font-size: .85rem; font-family: var(--rounded); }
.stepper { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; background: var(--surface); border-radius: 11px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.set-row.logged .stepper { background: transparent; box-shadow: none; }
.stepper button { height: 42px; border: 0; background: transparent; color: var(--accent-strong); font-size: 1.2rem; font-weight: 600; cursor: pointer; padding: 0; }
.stepper input { border: 0; background: transparent; min-height: 42px; padding: 0; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; width: 100%; min-width: 0; -moz-appearance: textfield; border-radius: 0; font-family: var(--rounded); font-size: 17px; }
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-ok { height: 46px; border-radius: 13px; border: 0; background: var(--accent); color: var(--accent-text); font-size: 1.1rem; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.set-ok svg { width: 22px; height: 22px; stroke-width: 2.8; }
.set-row.logged .set-ok { background: transparent; color: var(--success-strong); }

.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--info-soft); color: var(--info); margin-bottom: 12px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.good { background: var(--success-soft); color: var(--success-strong); }
.banner .grow { color: var(--text); }
details > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); margin-right: 4px; transition: transform .2s; flex: none; }
details[open] > summary::after { transform: rotate(-135deg); }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 5; margin-top: 18px; }
.sticky-actions .btn { box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
body.resting main { padding-bottom: 100px; }
body.resting .sticky-actions { bottom: calc(var(--tabbar-h) + var(--safe-b) + 92px); }

/* ---------- rest timer ---------- */
.rest-bar { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 22px; background: rgba(28, 28, 33, .78); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); border: 1px solid rgba(255, 255, 255, .12); color: #fff; box-shadow: 0 12px 34px rgba(0, 0, 0, .32); overflow: hidden; max-width: 700px; margin: 0 auto; }
.rest-bar .muted { color: var(--hero-muted); font-size: .74rem; }
.rest-bar .btn { background: rgba(255, 255, 255, .14); color: #fff; position: relative; }
.rest-main { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; min-width: 0; }
.rest-main .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rest-time { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; font-family: var(--rounded); }
.rest-progress { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--lime); transition: width .25s linear; }
.rest-bar.done { background: var(--success); animation: flash .5s 4 alternate; }
.rest-bar.done .muted { color: #fff; }
@keyframes flash { to { filter: brightness(1.15); transform: scale(1.02); } }

/* ---------- tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); backdrop-filter: blur(22px) saturate(1.8); -webkit-backdrop-filter: blur(22px) saturate(1.8); border-top: .5px solid var(--border); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--faint); font-size: .66rem; font-weight: 550; }
.tabbar a svg { width: 25px; height: 25px; }
.tabbar a[aria-current="page"] { color: var(--accent); }
.tabbar .badge { position: absolute; top: 5px; left: 50%; margin-left: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 800; display: grid; place-items: center; }

/* ---------- toasts & sheets ---------- */
.toasts { position: fixed; top: calc(var(--safe-t) + 60px); left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; max-width: 420px; width: 100%; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--text); padding: 12px 16px; border-radius: 18px; box-shadow: 0 10px 34px rgba(0, 0, 0, .18); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transform: translateY(-14px); opacity: 0; transition: .25s; font-weight: 600; font-size: .94rem; }
.toast.show { transform: none; opacity: 1; }
.toast.trophy { background: linear-gradient(135deg, #2b2410, #6b5216); color: #fff6d8; display: flex; gap: 12px; align-items: center; }
.toast.trophy .trophy-ico { width: 40px; height: 40px; flex: none; }
.toast.pr { background: var(--success); color: #fff; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0); transition: background .2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop.open { background: rgba(0, 0, 0, .4); }
.sheet { background: color-mix(in srgb, var(--surface-solid) 86%, transparent); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--safe-b)); transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.sheet-backdrop.open .sheet { transform: none; }
.sheet-grip { width: 36px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 4px auto 14px; }

/* ---------- lists (inset grouped) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: .5px solid var(--border); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.group { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.group .list-item { padding: 11px 16px; }
.group .list > li + li { border-top: 0; position: relative; }
.group .list > li + li::before { content: ""; position: absolute; top: 0; right: 0; left: 60px; border-top: .5px solid var(--border); }
.li-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: .78rem; }
.li-ico svg { width: 18px; height: 18px; }
.li-sub { font-size: .82rem; color: var(--muted); }
.li-chev { color: var(--faint); flex: none; display: grid; place-items: center; }
.li-chev svg { width: 18px; height: 18px; }
.pl-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--fill); flex: none; }

/* ---------- week page ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.day-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; }
.day-row + .day-row { border-top: .5px solid var(--border); }
.day-row.today { background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.day-date { text-align: center; line-height: 1.1; }
.day-date b { display: block; font-size: 1.35rem; font-family: var(--rounded); }
.day-date small { color: var(--muted); text-transform: uppercase; font-size: .66rem; font-weight: 700; }

/* ---------- exercise page ---------- */
.media { position: relative; border-radius: var(--radius); overflow: hidden; background: #fff; aspect-ratio: 3 / 2; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.media img.f1 { animation: frame 1.6s steps(1) infinite; }
@keyframes frame { 0% { opacity: 0; } 50% { opacity: 1; } }
.media-empty { display: grid; place-items: center; aspect-ratio: 3 / 2; background: var(--fill); border-radius: var(--radius); color: var(--muted); text-align: center; padding: 16px; }
.tips { margin: 0; padding-left: 1.2em; }
.tips li + li { margin-top: 4px; }
table.hist { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.hist th, table.hist td { text-align: left; padding: 8px 4px; border-bottom: .5px solid var(--border); }
table.hist th { color: var(--muted); font-weight: 500; font-size: .74rem; text-transform: uppercase; letter-spacing: .02em; }
table.hist tr:last-child td { border-bottom: 0; }
.chart-box { position: relative; height: 220px; }
.chart-box.tall { height: 290px; }
.chart-box.short { height: 150px; }

/* ---------- stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); }
.tile .v { font-size: 1.75rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; font-family: var(--rounded); }
.tile .v small { font-size: .82rem; font-weight: 600; color: var(--muted); font-family: -apple-system, system-ui, sans-serif; }
.tile .v.sm { font-size: 1.08rem; line-height: 1.3; }
.tile .l { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.tile .d { font-size: .76rem; font-weight: 650; margin-top: 4px; }
.up { color: var(--success-strong); }
.down { color: var(--danger); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.heatmap .c { width: 14px; height: 14px; border-radius: 4px; background: var(--heat-0); }
.heatmap .c.l1 { background: var(--heat-1); }
.heatmap .c.l3 { background: var(--heat-3); }
.heatmap .c.cardio { background: var(--heat-cardio); }
.heatmap .c.rest { background: transparent; box-shadow: inset 0 0 0 1px var(--surface-3); }
.heatmap .c.future { background: transparent; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: .74rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.reco { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.reco + .reco { border-top: .5px solid var(--border); }
.reco .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; background: var(--fill); flex: none; }
.reco.good .ico { background: var(--success-soft); }
.reco.warn .ico { background: var(--warn-soft); }
.reco.info .ico { background: var(--info-soft); }
.bar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; gap: 8px; align-items: center; font-size: .84rem; padding: 4px 0; }
.bar-track { height: 10px; border-radius: 5px; background: var(--fill); position: relative; overflow: hidden; }
.bar-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--series-1); }
.bar-track .mark { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .35; }
.meter { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--success), #7be495); }
.trend { font-weight: 700; font-size: .8rem; }
.trend.up { color: var(--success-strong); }
.trend.down { color: var(--danger); }
.trend.stalled { color: var(--warn); }
.kv { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.kv div { text-align: left; min-width: 0; }
.kv b { display: block; font-family: var(--rounded); font-size: clamp(.95rem, 4.6vw, 1.15rem); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv b small { font-size: .7em; font-weight: 650; color: var(--muted); }
.kv span { font-size: .72rem; color: var(--muted); }
.md h3 { margin-top: 1em; }
.md p, .md li { line-height: 1.55; }
.md ul { padding-left: 1.2em; }

/* ---------- trophies ---------- */
.trophies { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.trophy { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.trophy .ico { width: 48px; height: 48px; flex: none; }
.trophy.locked { opacity: .5; filter: grayscale(1); }
.trophy .bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.trophy .bar > i { display: block; height: 100%; background: var(--accent); }
.tier-bronze { color: var(--bronze); }
.tier-silver { color: var(--silver); }
.tier-gold { color: var(--gold); }
.tier-platinum { color: var(--platinum); }

/* ---------- music ---------- */
.player { text-align: center; }
.player .cover { width: min(72vw, 280px); aspect-ratio: 1; border-radius: 20px; object-fit: cover; background: var(--fill); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); margin: 6px auto 18px; display: block; }
.player .track { font-size: 1.25rem; font-weight: 750; letter-spacing: -.02em; }
.player .artist { color: var(--muted); }
.player .controls { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 16px 0 4px; }
.player .controls .icon-btn { width: 54px; height: 54px; }
.player .controls .icon-btn.main { width: 70px; height: 70px; background: var(--text); color: var(--bg); }
.player .controls svg { width: 24px; height: 24px; }
.progress { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin-top: 14px; }
.progress i { display: block; height: 100%; background: var(--text); }
.spotify-mini { display: flex; gap: 10px; align-items: center; }
.spotify-mini img { width: 48px; height: 48px; border-radius: 10px; background: var(--fill); object-fit: cover; flex: none; }
.spotify-mini .t { min-width: 0; flex: 1; }
.spotify-mini .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spotify-mini > .row { flex: none; gap: 4px; }
.spotify-mini .icon-btn { width: 38px; height: 38px; }
@media (max-width: 400px) { .spotify-mini [data-sp-cmd="playlists"] { display: none; } }
iframe.embed { width: 100%; height: 352px; border: 0; border-radius: 14px; }
iframe.embed.compact { height: 152px; }

/* ---------- profile ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; }
.avatar-emoji { font-size: 1.15em; line-height: 1; }
.avatar.lg .avatar-emoji { font-size: 2.3rem; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.avatar-opt { aspect-ratio: 1; border-radius: 50%; border: 0; display: grid; place-items: center; font-size: 1.45rem; cursor: pointer; box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s, transform .1s; padding: 0; color: #fff; }
.avatar-opt.img { background: transparent; overflow: hidden; }
.avatar-opt.img img { width: 100%; height: 100%; display: block; }
.avatar-opt.photo { background: var(--fill); color: var(--text); }
.avatar-opt.photo svg { width: 22px; height: 22px; }
.avatar-opt[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.avatar-opt:active { transform: scale(.94); }
.photo-pick { position: relative; cursor: pointer; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick .edit { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; border: 3px solid var(--surface); }
.photo-pick .edit svg { width: 14px; height: 14px; }

@media (min-width: 640px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .trophies { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- home (Início) ---------- */
.widgets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.widgets > * { min-width: 0; }
.widget-title { font-size: .8rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.widget .li-chev svg { width: 16px; height: 16px; }
.widget-hero h1 { font-size: 1.8rem; }
.big-num { font-family: var(--rounded); font-size: 2rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big-num small { font-size: .9rem; color: var(--muted); font-weight: 600; }

.cap-first::first-letter { text-transform: uppercase; }
.week-widget > .card { margin-top: 0; }

/* ---------- back button (sub-pages) ---------- */
.backbar { max-width: 720px; margin: 0 auto; padding: 2px 8px 0; }
.back-link { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; padding: 0 8px 0 2px; color: var(--accent-strong); font-size: 1.02rem; font-weight: 500; }
.back-link svg { width: 24px; height: 24px; stroke-width: 2.4; }

/* ---------- help bubble (same pattern as FinanceOS) ---------- */
.help { position: fixed; left: 14px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 40; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; transition: bottom .2s; }
body.has-sticky .help, body.resting .help { bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); }
body.has-sticky.resting .help { bottom: calc(var(--tabbar-h) + var(--safe-b) + 160px); }
body.no-tabbar .help { display: none; }
.help-fab { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); cursor: pointer; }
.help-fab svg { width: 24px; height: 24px; }
.help-fab:active { transform: scale(.94); }
.help-panel { width: min(340px, calc(100vw - 28px)); max-height: 62vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: color-mix(in srgb, var(--surface-solid) 92%, transparent); backdrop-filter: blur(30px) saturate(1.6); -webkit-backdrop-filter: blur(30px) saturate(1.6); border: 1px solid var(--card-border); box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.help-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border-bottom: .5px solid var(--border); font-weight: 650; font-size: .95rem; }
.help-head .icon-btn { width: 30px; height: 30px; }
.help-head .icon-btn svg { width: 16px; height: 16px; }
.help-body { overflow-y: auto; flex: 1; }
.help-list { list-style: none; margin: 0; padding: 6px; }
.help-list button { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; font-size: .92rem; cursor: pointer; }
.help-list button:active { background: var(--fill); }
.help-emoji { font-size: 1.3rem; line-height: 1.2; }
.help-answer { padding: 14px 16px; }
.help-answer h3 { margin: 4px 0 8px; }
.help-answer p.small { line-height: 1.55; }
.help-foot { padding: 8px; text-align: center; font-size: .7rem; color: var(--muted); border-top: .5px solid var(--border); }

.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--card-border); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); color: var(--text); font-size: .8rem; font-weight: 600; text-align: center; }
.app-dot { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.1rem; }

/* Configurar treino: equipment picker by photo */
.equip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.equip { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px 6px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.equip img, .equip .equip-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 11px; background: #fff; }
.equip .equip-ph { display: grid; place-items: center; font-size: 12px; color: var(--muted); background: var(--surface-2); }
.equip-name { font-size: 13px; font-weight: 600; line-height: 1.25; padding: 0 4px; }
.equip.off img { filter: grayscale(1); opacity: .45; }
.equip.off .equip-name { text-decoration: line-through; color: var(--muted); }
.equip-badge { position: absolute; top: 12px; left: 12px; padding: 3px 8px; border-radius: 999px; background: var(--danger, #e5484d); color: #fff; font-size: 11px; font-weight: 700; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; }

/* Workout rating (end of workout) */
.rate { margin: 4px 0 14px; }
.rate-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.rate-row button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 2px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; transition: transform .15s, background .15s; }
.rate-row button span { font-size: 28px; line-height: 1; filter: grayscale(.6); opacity: .75; transition: filter .15s, opacity .15s; }
.rate-row button small { font-size: 11px; font-weight: 600; }
.rate-row button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--text); transform: scale(1.04); }
.rate-row button[aria-pressed="true"] span { filter: none; opacity: 1; }
.session-clock { text-decoration: none; font-variant-numeric: tabular-nums; }
.opt-row { display: flex; flex-direction: column; gap: 8px; }
.opt-row > .seg { display: flex; width: 100%; }
.opt-row > .seg button { flex: 1; }
.opt-row > .btn, .opt-row > .pill { align-self: flex-start; }
