/* Meu Treino — layout baseado no Monochrome Banking App UI Kit (fonte Geist, paleta monocromática) */
:root {
  --black: #000000;
  --grey-950: #09090B;
  --grey-900: #161618;
  --grey-850: #252528;
  --grey-800: #38383E;
  --grey-700: #505057;
  --grey-500: #838387;
  --grey-450: #9B9BA0;
  --grey-400: #B4B4B8;
  --grey-150: #E6E6E8;
  --grey-100: #EFEFF0;
  --grey-50: #F6F6F7;
  --grey-0: #FCFCFC;
  --white: #FFFFFF;
  --success: #16A34A;
  --success-400: #4ADE80;
  --success-100: #DCFCE7;
  --success-50: #F0FDF4;

  --text-primary: var(--grey-950);
  --text-secondary: var(--grey-700);
  --text-tertiary: var(--grey-500);
  --surface-bg: var(--grey-50);
  --surface: var(--white);
  --border: var(--grey-100);

  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--surface);
  color: var(--text-primary);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior-y: none;
}
em, i, cite, address, dfn, var { font-style: normal; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { display: block; }
.tnum { font-variant-numeric: tabular-nums; }

.press { transition: transform 0.35s var(--spring), opacity 0.2s ease, background-color 0.2s ease; will-change: transform; }
.press:active { transform: scale(0.96); }
.press-soft:active { transform: scale(0.985); opacity: 0.7; }

/* ---------- Botões do kit ---------- */
.btn {
  height: 52px; border-radius: var(--btn-radius); padding: 0 20px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16px; font-weight: 500; letter-spacing: -0.005em;
}
.btn svg { width: 20px; height: 20px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-shadow); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary { background: var(--secondary-bg); color: var(--text-primary); }
.btn-secondary:active { background: var(--grey-150); }
.btn-block { width: 100%; }

.circle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--surface); color: var(--text-primary);
}
.circle svg { width: 20px; height: 20px; }
.circle.grey { background: var(--grey-50); width: 36px; height: 36px; }
.circle.grey svg { width: 18px; height: 18px; }

/* ---------- HOME ---------- */
.home { max-width: 520px; margin: 0 auto; min-height: 100%; background: var(--surface); position: relative; }

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--hero-bg); color: var(--hero-fg);
  padding: calc(var(--safe-t) + 20px) 20px 52px;
}
.grain::before {
  /* textura granulada do kit */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: var(--grain-op); mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-orbs { display: var(--orbs); position: absolute; right: -60px; bottom: -10px; width: 230px; height: 230px; z-index: -1; pointer-events: none; }
.hero-orbs span { position: absolute; border-radius: 50%; }
.hero-orbs span:nth-child(1) { width: 150px; height: 150px; left: 0; top: 0; background: linear-gradient(200deg, #6b6b70 0%, #1d1d20 55%, #000 100%); }
.hero-orbs span:nth-child(2) { width: 120px; height: 120px; right: 0; top: 70px; background: linear-gradient(160deg, #8e8e94 0%, #2a2a2e 60%, #0c0c0d 100%); }
.hero-orbs span:nth-child(3) { width: 140px; height: 140px; left: 20px; top: 130px; background: linear-gradient(20deg, #5a5a60 0%, #121214 70%); }

.hero-top { display: flex; align-items: center; justify-content: space-between; }
.hero-date { font-size: 14px; color: var(--hero-muted); }
.hero-app { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.hero-badge {
  height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,0.1);
  font-size: 12px; font-weight: 500; color: var(--white); display: inline-flex; align-items: center; gap: 6px;
}
.hero-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--success-400); }
.hero-label { font-size: 18px; font-weight: 500; margin-top: 24px; }
.hero-sub { font-size: 15px; color: var(--hero-muted); margin-top: 26px; }
.hero-title { font-size: 30px; font-weight: 500; line-height: 1.2; letter-spacing: -0.02em; margin-top: 8px; max-width: 300px; text-wrap: balance; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 12px; font-size: 14px; color: var(--hero-meta); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta svg { width: 16px; height: 16px; }

.sheet-main {
  position: relative; margin-top: -26px; background: var(--sheet-bg); -webkit-backdrop-filter: var(--sheet-blur); backdrop-filter: var(--sheet-blur);
  border-radius: 24px 24px 0 0; padding: 24px 20px calc(var(--safe-b) + 120px);
}

/* Chips (Category Chips do kit) */
.chips { display: flex; gap: 8px; margin-bottom: 24px; }
.chip {
  height: 36px; padding: 0 8px 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--grey-150); background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text-primary);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.35s var(--spring);
}
.chip b {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--grey-100);
  font-size: 11px; font-weight: 500; display: grid; place-items: center; color: var(--text-secondary);
  transition: background-color 0.25s ease, color 0.25s ease;
}
.chip[aria-selected="true"] { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.chip[aria-selected="true"] b { background: rgba(255,255,255,0.22); color: var(--accent-ink); }

/* Blocos de resumo */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px; }
.tile {
  height: 72px; border-radius: var(--tile-radius); background: var(--tile-bg); box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.tile svg { width: 20px; height: 20px; color: var(--accent-icon); }

/* Lista */
.block { margin-bottom: 24px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.block-title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.block-meta { font-size: 14px; color: var(--text-tertiary); white-space: nowrap; }
.block-desc { font-size: 14px; color: var(--text-tertiary); margin: 2px 0 6px; }

.row {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.thumb {
  width: 56px; height: 56px; flex: none; border-radius: 14px; overflow: hidden;
  background: var(--white); border: 1px solid var(--border);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-text { flex: 1; min-width: 0; }
.row-name { display: block; font-size: 16px; font-weight: 500; letter-spacing: -0.005em; }
.row-sub { display: block; font-size: 14px; color: var(--text-tertiary); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-caret { width: 20px; height: 20px; color: var(--grey-500); flex: none; }

.method { font-size: 14px; line-height: 1.5; color: var(--text-secondary); background: var(--tile-bg); box-shadow: var(--card-shadow); border-radius: 16px; padding: 14px 16px; margin-bottom: 28px; }

.reminders h3, .section-label { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 12px; }
.reminders li { list-style: none; position: relative; padding-left: 18px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); margin-bottom: 8px; }
.reminders li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.credit { margin-top: 20px; font-size: 12px; color: var(--text-tertiary); line-height: 1.5; }
.credit a { color: var(--text-secondary); text-decoration: none; }

.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 40px 20px calc(var(--safe-b) + 16px);
  background: var(--dock-fade);
  max-width: 520px; margin: 0 auto; pointer-events: none;
}
.dock .btn { pointer-events: auto; }

.reveal { opacity: 0; transform: translateY(12px); animation: rise 0.7s var(--ease-out) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.fade-swap { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- SHEET ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.4s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 520px;
  max-height: calc(100% - var(--safe-t) - 40px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 10px 20px calc(var(--safe-b) + 28px);
  transform: translateY(105%); transition: transform 0.5s var(--spring);
}
.sheet.open { pointer-events: auto; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: translateY(0); }
.sheet-grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--grey-150); margin: 0 auto 16px; }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sheet-head > div { flex: 1; min-width: 0; }
.sheet-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.sheet-sub { font-size: 14px; color: var(--text-tertiary); margin-top: 2px; }
.sheet-media { background: var(--grey-50); border-radius: 20px; height: 230px; display: grid; place-items: center; overflow: hidden; }
.sheet-media img { height: 206px; width: auto; border-radius: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.tag { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--grey-50); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; }
.note { padding: 12px 14px; border-radius: 14px; background: var(--grey-50); border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.45; color: var(--text-secondary); margin-bottom: 20px; }
.steps ol { counter-reset: s; }
.steps li { list-style: none; counter-increment: s; display: flex; gap: 12px; font-size: 16px; line-height: 1.45; color: var(--text-secondary); padding: 6px 0; }
.steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--grey-100); color: var(--text-primary); font-size: 12px; font-weight: 500;
  display: grid; place-items: center; margin-top: -1px;
}

/* ---------- PLAYER ---------- */
.player {
  position: fixed; inset: 0; z-index: 20; background: var(--player-bg);
  overflow-y: auto; transform: translateY(100%); transition: transform 0.55s var(--spring); visibility: hidden;
}
.player.open { transform: none; visibility: visible; }
.player-inner {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  padding: calc(var(--safe-t) + 14px) 20px calc(var(--safe-b) + 20px);
  display: flex; flex-direction: column; gap: 12px;
}
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.topbar-text { flex: 1; min-width: 0; }
.topbar-sub { font-size: 14px; color: var(--text-tertiary); }
.topbar-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.view-ex, .view-rest { display: flex; flex-direction: column; gap: 12px; }
.view-rest { display: none; }
.player.resting .view-ex { display: none; }
.player.resting .view-rest { display: flex; animation: fadeIn 0.35s ease; }

.media-card { position: relative; background: var(--surface); border-radius: 24px; height: min(262px, 34vh); display: grid; place-items: center; overflow: hidden; }
.media-card img { height: 82%; width: auto; transition: opacity 0.25s ease, transform 0.45s var(--spring); }
.media-card img.swap { opacity: 0; transform: scale(0.96); }
.media-credit { position: absolute; right: 16px; bottom: 12px; font-size: 11px; color: var(--text-tertiary); }

.timer-card {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--timer-bg); color: var(--white); border-radius: 24px; padding: 20px;
}
.timer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timer-reps { font-size: 16px; font-weight: 500; }
.timer-mode { font-size: 14px; color: var(--timer-muted); white-space: nowrap; }
.timer-value { font-size: 60px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; margin: 14px 0; }
.bar { height: 4px; border-radius: 2px; background: var(--timer-track); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--white); border-radius: 2px; transition: width 0.5s var(--spring); }
.timer-foot { display: flex; justify-content: space-between; margin-top: 14px; }
.timer-foot b { display: block; font-size: 18px; font-weight: 500; }
.timer-foot small { font-size: 12px; color: var(--timer-muted); }
.timer-foot .r { text-align: right; }

.card-white { background: var(--surface); border-radius: 20px; padding: 0 16px; }
.card-white .row { border-bottom: 0; }

.controls { display: flex; align-items: center; justify-content: center; gap: 36px; margin-top: auto; padding-top: 12px; }
.ctrl { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; }
.ctrl svg { width: 22px; height: 22px; }
.ctrl:disabled { opacity: 0.35; }
.ctrl-main { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-shadow); display: grid; place-items: center; }
.ctrl-main:active { background: var(--accent-press); }
.ctrl-main svg { width: 28px; height: 28px; }

/* Relógio do descanso */
.clock-card { background: var(--surface); border-radius: 24px; padding: 32px 0; display: grid; place-items: center; }
.clock { position: relative; width: min(250px, 64vw); aspect-ratio: 1; }
.clock svg { width: 100%; height: 100%; overflow: visible; }
.clock .track { fill: none; stroke: var(--grey-100); stroke-width: 10; }
.clock .arc { fill: none; stroke: var(--ring); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.clock .knob { fill: var(--white); stroke: var(--ring); stroke-width: 3; transition: cx 0.25s linear, cy 0.25s linear; }
.clock-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.clock-center strong { font-size: 48px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.clock-center small { font-size: 14px; color: var(--text-tertiary); }
.rest-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 12px; }
.rest-tip { font-size: 14px; line-height: 1.5; color: var(--text-tertiary); margin-top: 4px; }
.view-rest .section-label { margin: 12px 0 0; }

/* Concluído */
.done {
  position: fixed; inset: 0; z-index: 25; background: var(--player-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 48px) 20px calc(var(--safe-b) + 20px);
  opacity: 0; pointer-events: none; transition: opacity 0.45s ease; overflow-y: auto;
}
.player.finished .done { opacity: 1; pointer-events: auto; }
.done-inner { width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; flex: 1; }
.done-badge { position: relative; width: 88px; height: 88px; border-radius: 50%; background: var(--success-50); display: grid; place-items: center; transform: scale(0.5); transition: transform 0.7s var(--spring) 0.1s; }
.done-badge::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--success-100); }
.done-badge span { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--success); color: var(--white); display: grid; place-items: center; }
.done-badge svg { width: 26px; height: 26px; }
.player.finished .done-badge { transform: scale(1); }
.done h2 { font-size: 20px; font-weight: 600; margin-top: 20px; }
.done p { font-size: 14px; color: var(--text-tertiary); margin-top: 6px; text-align: center; }
.done-card { width: 100%; background: var(--surface); border-radius: 24px; padding: 28px 24px 8px; margin-top: 28px; text-align: center; }
.done-card strong { display: block; font-size: 48px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.done-card > small { display: block; font-size: 14px; color: var(--text-tertiary); margin: 8px 0 14px; }
.done-row { display: flex; justify-content: space-between; padding: 16px 0; border-top: 1px solid var(--border); font-size: 16px; }
.done-row span { color: var(--text-secondary); }
.done-row b { font-weight: 500; }
.done .btn { margin-top: auto; }
.done-inner > .btn { margin-top: 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================= TEMAS ================= */
/* Monocromático (padrão, kit Axion) */
:root {
  --hero-bg: var(--black);
  --hero-fg: var(--white);
  --hero-muted: var(--grey-400);
  --hero-meta: var(--success-400);
  --grain-op: 0.22;
  --orbs: block;
  --sheet-bg: var(--surface);
  --sheet-blur: none;
  --accent: var(--black);
  --accent-press: var(--grey-850);
  --accent-ink: var(--white);
  --accent-icon: var(--grey-950);
  --accent-shadow: none;
  --secondary-bg: var(--grey-100);
  --btn-radius: 12px;
  --tile-bg: var(--grey-50);
  --tile-radius: 12px;
  --card-shadow: none;
  --dock-fade: linear-gradient(to bottom, rgba(255,255,255,0), #fff 45%);
  --player-bg: var(--grey-50);
  --timer-bg: var(--black);
  --timer-muted: var(--grey-400);
  --timer-track: var(--grey-800);
  --ring: var(--black);
  --theme-btn-bg: rgba(255,255,255,0.12);
}

/* Lilás — gradiente suave rosa/lilás, cartões brancos, botões em pílula */
[data-theme="lilas"] {
  --hero-bg: transparent;
  --hero-fg: #26222B;
  --hero-muted: #6F6577;
  --hero-meta: #A23DB8;
  --grain-op: 0;
  --orbs: none;
  --sheet-bg: rgba(255,255,255,0.55);
  --sheet-blur: blur(18px);
  --accent: linear-gradient(135deg, #E27BEF 0%, #B57CF2 100%);
  --accent-press: linear-gradient(135deg, #D46AE2 0%, #A46BE6 100%);
  --accent-ink: #FFFFFF;
  --accent-icon: #B44FCB;
  --accent-shadow: 0 8px 20px -8px rgba(190, 90, 220, 0.6);
  --secondary-bg: #FFFFFF;
  --btn-radius: 999px;
  --tile-bg: #FFFFFF;
  --tile-radius: 20px;
  --card-shadow: 0 6px 20px -12px rgba(120, 60, 150, 0.25);
  --dock-fade: linear-gradient(to bottom, rgba(248,238,251,0), #F8EEFB 45%);
  --player-bg: linear-gradient(180deg, #F6E3F8 0%, #F3EEFA 45%, #F7F5FA 100%);
  --timer-bg: linear-gradient(140deg, #C65BDB 0%, #8B5BE8 100%);
  --timer-muted: rgba(255,255,255,0.75);
  --timer-track: rgba(255,255,255,0.28);
  --ring: #C06BE8;
  --theme-btn-bg: rgba(255,255,255,0.75);
  --surface-bg: #F7F2FA;
}
[data-theme="lilas"] body {
  background:
    radial-gradient(120% 60% at 85% 0%, #EBC8F2 0%, rgba(235,200,242,0) 60%),
    radial-gradient(90% 50% at 0% 30%, #F4DDF6 0%, rgba(244,221,246,0) 70%),
    linear-gradient(180deg, #F9EFFA 0%, #F7F3FA 60%, #F8F6FA 100%) fixed;
}
[data-theme="lilas"] .home { background: transparent; }
[data-theme="lilas"] .chip:not([aria-selected="true"]) { border-color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.7); }
[data-theme="lilas"] .block, [data-theme="lilas"] .card-white { background: #FFFFFF; border-radius: 22px; box-shadow: var(--card-shadow); }
[data-theme="lilas"] .block { padding: 16px 16px 4px; }
[data-theme="lilas"] .thumb { border-radius: 16px; }
[data-theme="lilas"] .circle { background: rgba(255,255,255,0.85); }
[data-theme="lilas"] .media-card, [data-theme="lilas"] .clock-card, [data-theme="lilas"] .done-card { box-shadow: var(--card-shadow); }

/* Índigo — header azul-violeta, folha branca, detalhes índigo */
[data-theme="indigo"] {
  --hero-bg: linear-gradient(180deg, #8087F2 0%, #5D5FE8 100%);
  --hero-fg: #FFFFFF;
  --hero-muted: rgba(255,255,255,0.78);
  --hero-meta: #FFFFFF;
  --grain-op: 0;
  --orbs: none;
  --sheet-bg: var(--surface);
  --sheet-blur: none;
  --accent: #5B5CE6;
  --accent-press: #4A4BD4;
  --accent-ink: #FFFFFF;
  --accent-icon: #5B5CE6;
  --accent-shadow: 0 8px 20px -10px rgba(91, 92, 230, 0.7);
  --secondary-bg: #EEEEFD;
  --btn-radius: 16px;
  --tile-bg: #F4F4FE;
  --tile-radius: 18px;
  --card-shadow: none;
  --player-bg: #F2F2FB;
  --timer-bg: linear-gradient(160deg, #7C82F0 0%, #5658E2 100%);
  --timer-muted: rgba(255,255,255,0.78);
  --timer-track: rgba(255,255,255,0.3);
  --ring: #5B5CE6;
  --theme-btn-bg: rgba(255,255,255,0.18);
  --surface-bg: #F2F2FB;
}
[data-theme="indigo"] .chip b { background: #EEEEFD; color: #5B5CE6; }
[data-theme="indigo"] .chip[aria-selected="true"] b { background: rgba(255,255,255,0.22); color: #fff; }
[data-theme="indigo"] .reminders li::before { background: #5B5CE6; }

/* Troca de tema suave */
body, .hero, .sheet-main, .tile, .chip, .btn, .timer-card, .player { transition-property: background, background-color, color, border-color, box-shadow; transition-duration: 0.45s; transition-timing-function: ease; }
.press { transition: transform 0.35s var(--spring), opacity 0.2s ease, background 0.45s ease, color 0.45s ease; }

/* Botão de tema no header */
.theme-btn {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--theme-btn-bg); color: var(--hero-fg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.theme-btn svg { width: 20px; height: 20px; }

/* Seletor de tema (no sheet) */
.themes { display: grid; gap: 10px; margin-top: 4px; }
.theme-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px; border-radius: 18px; border: 1.5px solid var(--grey-150); background: var(--white);
}
.theme-opt[aria-checked="true"] { border-color: var(--grey-950); }
.theme-swatch { width: 56px; height: 56px; border-radius: 14px; flex: none; position: relative; overflow: hidden; }
.theme-swatch i { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 10px; border-radius: 6px; }
.sw-mono { background: #000; } .sw-mono i { background: #fff; }
.sw-lilas { background: radial-gradient(90% 90% at 80% 10%, #EBC8F2, #F8F2FA); } .sw-lilas i { background: linear-gradient(135deg, #E27BEF, #B57CF2); }
.sw-indigo { background: linear-gradient(180deg, #8087F2, #5D5FE8); } .sw-indigo i { background: #fff; }
.theme-name { font-size: 16px; font-weight: 500; }
.theme-desc { font-size: 14px; color: var(--text-tertiary); margin-top: 2px; }
.theme-check { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--grey-150); display: grid; place-items: center; color: #fff; flex: none; }
.theme-check svg { width: 14px; height: 14px; opacity: 0; }
.theme-opt[aria-checked="true"] .theme-check { background: var(--grey-950); border-color: var(--grey-950); }
.theme-opt[aria-checked="true"] .theme-check svg { opacity: 1; }

/* ================= CONTAGEM / UX DE TREINO ================= */
.progress-line { height: 3px; border-radius: 2px; background: var(--grey-150); overflow: hidden; margin: -4px 0 4px; }
.progress-line i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.6s var(--spring); }

.set-card {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--timer-bg); color: var(--white); border-radius: 24px; padding: 18px 20px 20px;
}
.set-head { display: flex; align-items: center; justify-content: space-between; }
.set-label { font-size: 15px; font-weight: 500; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--timer-track); transition: background 0.3s ease, transform 0.4s var(--spring); }
.dots i.on { background: var(--white); }
.dots i.now { background: transparent; box-shadow: inset 0 0 0 1.5px var(--white); transform: scale(1.15); }

.set-timer { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 16px; }
.set-time { font-size: 56px; font-weight: 400; letter-spacing: -0.035em; line-height: 1; }
.set-caption { font-size: 13px; color: var(--timer-muted); margin-top: 6px; }
.pause-btn { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.14); color: var(--white); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.pause-btn svg { width: 20px; height: 20px; }
.player.paused .set-time { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.stepper { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; padding-top: 16px; border-top: 1px solid var(--timer-track); }
.step-btn { width: 56px; height: 56px; border-radius: 18px; background: rgba(255,255,255,0.12); color: var(--white); font-size: 28px; font-weight: 300; line-height: 1; display: grid; place-items: center; }
.step-btn:active { background: rgba(255,255,255,0.22); }
.step-val { text-align: center; }
.step-val span { display: block; font-size: 40px; font-weight: 400; letter-spacing: -0.03em; line-height: 1; }
.step-val small { display: block; font-size: 13px; color: var(--timer-muted); margin-top: 6px; }
.bump { animation: bump 0.35s var(--spring); }
@keyframes bump { 40% { transform: scale(1.18); } }

.ex-foot { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; color: var(--text-tertiary); font-size: 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.link-btn svg { width: 14px; height: 14px; }
.link-btn:disabled { opacity: 0.3; }

/* Descanso */
.clock-card { flex-direction: column; gap: 18px; }
.logged { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); padding: 0 20px; text-align: center; }
.logged:empty { display: none; }
.logged svg { width: 16px; height: 16px; color: var(--success); flex: none; }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.preset { height: 40px; border-radius: 999px; background: var(--surface); border: 1px solid var(--grey-150); font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.preset[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

/* Ajuste de descanso na home */
.rest-pref { margin-bottom: 16px; }
.rest-pref-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rest-pref-head span { font-size: 16px; font-weight: 500; }
.rest-pref-head small { font-size: 13px; color: var(--text-tertiary); }
.seg-rest { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--tile-bg); box-shadow: var(--card-shadow); }
.seg-rest button { height: 36px; border-radius: 10px; font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: background 0.3s ease, color 0.3s ease, transform 0.35s var(--spring); }
.seg-rest button[aria-checked="true"] { background: var(--surface); color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04); }
[data-theme="lilas"] .seg-rest button[aria-checked="true"], [data-theme="indigo"] .seg-rest button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }

.last { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; padding: 12px 14px; border-radius: 14px; background: var(--tile-bg); box-shadow: var(--card-shadow); }
.last b { margin-left: auto; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.last-ico { width: 22px; height: 22px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; flex: none; }
.last-ico svg { width: 12px; height: 12px; }

/* Resumo final */
.done-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); margin-top: 4px; }
.done-stats div { padding: 16px 0; }
.done-stats div + div { border-left: 1px solid var(--border); }
.done-stats b { display: block; font-size: 20px; font-weight: 500; }
.done-stats small { font-size: 12px; color: var(--text-tertiary); }
.done-label { align-self: flex-start; margin: 28px 0 8px; }
.log-list { width: 100%; background: var(--surface); border-radius: 20px; padding: 4px 16px; box-shadow: var(--card-shadow); }
.log-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: 0; }
.log-row .thumb { width: 44px; height: 44px; border-radius: 12px; }
.log-text { flex: 1; min-width: 0; }
.log-sets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.log-sets span { font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--grey-50); color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.log-sets span.skipped { color: var(--grey-400); }
.done { justify-content: flex-start; }
.done-inner { padding-bottom: 8px; }
.done-inner > .btn { margin-top: 24px; flex: none; }

/* Animações: mostra no tamanho nativo para não borrar */
.media-card img, .sheet-media img { image-rendering: auto; max-height: 200px; }
