/* ============================================
   Shape Brabo — fitness performance theme
   ============================================ */

:root {
  /* Surfaces */
  --bg: #0a0a0a;
  --surface-1: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #242424;
  --surface-4: #2e2e2e;
  --border: #252525;
  --border-strong: #353535;

  /* Brand accent — lime fitness */
  --accent: #C8FF00;
  --accent-bright: #DAFF40;
  --accent-dark: #95C200;
  --accent-glow: rgba(200, 255, 0, 0.25);
  --accent-soft: rgba(200, 255, 0, 0.08);
  --accent-ink: #0A0A0A;

  /* Text */
  --text: #FAFAFA;
  --text-dim: #B3B3B3;
  --text-mute: #757575;
  --text-faint: #4F4F4F;

  /* Semantics */
  --success: var(--accent);
  --warning: #FFB800;
  --danger: #FF4D4D;

  /* Spacing (4px scale) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 48px;
  --s-10: 64px;

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Anton', 'Inter', system-ui, sans-serif;

  --text-xs: 0.75rem;     /* 12 */
  --text-sm: 0.8125rem;   /* 13 */
  --text-md: 0.9375rem;   /* 15 */
  --text-base: 1rem;      /* 16 */
  --text-lg: 1.125rem;    /* 18 */
  --text-xl: 1.375rem;    /* 22 */
  --text-2xl: 1.75rem;    /* 28 */
  --text-3xl: 2.25rem;    /* 36 */
  --text-4xl: 3rem;       /* 48 */
  --text-hero: clamp(3rem, 13vw, 4.5rem); /* 48-72 */

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 150ms var(--ease);
  --t-base: 220ms var(--ease);
  --t-slow: 360ms var(--ease);

  /* Safe area */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  font-weight: 500;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overscroll-behavior-y: none;
  background-image:
    radial-gradient(circle at 15% -5%, rgba(200, 255, 0, 0.06) 0%, transparent 30%),
    radial-gradient(circle at 95% 105%, rgba(200, 255, 0, 0.04) 0%, transparent 35%);
  background-attachment: fixed;
}

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

/* ============================================
   APP / VIEWS
   ============================================ */

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

.view {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bot);
  animation: viewFade var(--t-base);
}
.view.active { display: flex; }

@keyframes viewFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   HEADER
   ============================================ */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) var(--s-5);
  position: sticky;
  top: var(--safe-top);
  z-index: 50;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  box-shadow: 0 0 24px var(--accent-glow);
}

.brand-name {
  font-weight: 800;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  color: var(--text-dim);
  transition: all var(--t-fast);
}
.icon-btn:hover, .icon-btn:active {
  background: var(--surface-2);
  color: var(--text);
}

/* ============================================
   HOME — HERO
   ============================================ */

.home {
  padding: var(--s-3) var(--s-5) var(--s-10);
  display: flex;
  flex-direction: column;
  gap: var(--s-7);
}

.hero {
  padding-top: var(--s-3);
}

.hero-greet {
  font-size: var(--text-md);
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: var(--s-2);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  line-height: 0.95;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--text);
  text-transform: uppercase;
}

.hero-quote {
  font-size: var(--text-md);
  color: var(--text-dim);
  margin-top: var(--s-3);
  max-width: 22ch;
}

/* ============================================
   TODAY CARD
   ============================================ */

.today-label {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: var(--s-3);
  letter-spacing: 0.02em;
}

.today-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.today-card {
  width: 100%;
  text-align: left;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
  border: 1px solid var(--border);
  padding: var(--s-6);
  display: block;
  transition: transform var(--t-base), border-color var(--t-base);
  isolation: isolate;
}

.today-card:hover, .today-card:active {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.today-card-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse at top right, var(--accent-soft) 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
}

.today-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.today-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.today-code {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.today-status {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.today-status.done {
  background: var(--accent);
  color: var(--accent-ink);
}

.today-status.rest {
  background: var(--surface-3);
  color: var(--text-dim);
  border-color: var(--border-strong);
}

.today-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: var(--s-2);
}

.today-focus {
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-bottom: var(--s-5);
  line-height: 1.5;
}

.today-meta {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--text-sm);
  color: var(--text-dim);
  margin-bottom: var(--s-5);
}
.today-meta strong { color: var(--text); font-weight: 700; }
.today-meta .dot-sep { color: var(--text-faint); }

.today-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  width: 100%;
  padding: var(--s-4);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  transition: all var(--t-fast);
}

.today-card:hover .today-cta, .today-card:active .today-cta {
  background: var(--accent-bright);
  box-shadow: 0 0 24px var(--accent-glow);
}

/* ============================================
   WEEK PROGRESS
   ============================================ */

.week {
  margin: 0;
}

.week-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.week-header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.week-count {
  font-size: var(--text-sm);
  color: var(--text-dim);
  font-weight: 500;
}
.week-count strong { color: var(--accent); font-weight: 700; }

.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--s-2);
}

.day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-1);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all var(--t-base);
}

.day-pill.today {
  border-color: var(--text-dim);
}

.day-pill.completed {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.day-pill-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.day-pill-num {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
}

.day-pill-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: all var(--t-base);
}

.day-pill.today .day-pill-mark { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.day-pill.completed .day-pill-mark { background: var(--accent-ink); }

/* ============================================
   STATS GRID
   ============================================ */

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}

.stat-card {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.stat-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-md);
  flex-shrink: 0;
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-dim);
  font-weight: 500;
}

/* ============================================
   SECTION TITLE
   ============================================ */

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

.section-title h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============================================
   TREINO GRID (home — outros treinos)
   ============================================ */

.treino-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.treino-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  width: 100%;
  text-align: left;
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}

.treino-row:hover, .treino-row:active {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.treino-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--border-strong);
  transition: background var(--t-base);
}
.treino-row:hover::before { background: var(--accent); }
.treino-row.done::before { background: var(--accent); }

.treino-row-code {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
  min-width: 48px;
}

.treino-row-info {
  min-width: 0;
}

.treino-row-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.treino-row-focus {
  font-size: var(--text-sm);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treino-row-state {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-dim);
  white-space: nowrap;
}

.treino-row-state.done {
  background: var(--accent-soft);
  color: var(--accent);
}

.treino-row-state.progress {
  background: var(--surface-3);
  color: var(--accent);
}

/* ============================================
   TIPS
   ============================================ */

.tips {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}

.tips-title {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--s-3);
  letter-spacing: -0.01em;
}

.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.tips-list li {
  font-size: var(--text-sm);
  color: var(--text-dim);
  padding-left: var(--s-4);
  position: relative;
  line-height: 1.5;
}

.tips-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============================================
   TREINO VIEW
   ============================================ */

.treino-header-info {
  text-align: center;
  flex: 1;
  min-width: 0;
}

.treino-header-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  line-height: 1;
}

.treino-header-sub {
  font-size: var(--text-xs);
  color: var(--text-dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.treino-main {
  padding: var(--s-4) var(--s-5) 140px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}

.treino-progress {
  background: var(--surface-1);
  border: 1px solid var(--border);
  padding: var(--s-4);
  border-radius: var(--r-lg);
}

.treino-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s-3);
}

.treino-progress-row span:first-child {
  font-size: var(--text-sm);
  color: var(--text-dim);
  font-weight: 500;
}

.treino-percent {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.progress-bar {
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  border-radius: var(--r-full);
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 500ms var(--ease);
}

/* ============================================
   EXERCISE CARDS
   ============================================ */

.exercise-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.exercise-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--t-base);
}

.exercise-card.done {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(200, 255, 0, 0.04) 0%, var(--surface-1) 100%);
}

.exercise-head {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  align-items: stretch;
}

.exercise-thumb {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  background: var(--surface-3);
  border-radius: var(--r-md);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
  transition: transform var(--t-fast);
  border: 0;
  padding: 0;
}
.exercise-thumb:hover { transform: scale(1.04); }
.exercise-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.exercise-thumb-hint {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: rgba(10, 10, 10, 0.7);
  color: var(--accent);
  border-radius: 50%;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.exercise-thumb img + .exercise-thumb-hint,
.exercise-thumb:hover .exercise-thumb-hint { opacity: 1; }

.exercise-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.exercise-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 28px;
}

.exercise-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--s-2);
}

.exercise-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  width: fit-content;
}

.exercise-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.exercise-tag.warmup, .exercise-tag.cardio { color: var(--warning); }
.exercise-tag.warmup::before, .exercise-tag.cardio::before { background: var(--warning); }

.exercise-name {
  font-weight: 700;
  font-size: var(--text-base);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.exercise-subtitle {
  font-size: var(--text-xs);
  color: var(--text-dim);
  line-height: 1.4;
}

.exercise-meta {
  display: flex;
  gap: var(--s-3);
  font-size: var(--text-xs);
  color: var(--text-dim);
  margin-top: var(--s-1);
  flex-wrap: wrap;
}
.exercise-meta strong {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* exercise body */
.exercise-body {
  border-top: 1px solid var(--border);
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.set-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: background var(--t-fast), border-color var(--t-fast);
  width: 100%;
}

.set-row.done {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.set-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex: 1;
  min-width: 0;
  padding: var(--s-2) 0;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.set-toggle:hover .set-checkbox {
  border-color: var(--text-dim);
}
.set-row.done .set-toggle:hover .set-checkbox {
  border-color: var(--accent);
}

.set-checkbox {
  width: 26px;
  height: 26px;
  border: 2px solid var(--border-strong);
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all var(--t-fast);
  background: transparent;
}

.set-row.done .set-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.set-checkbox svg {
  opacity: 0;
  transition: opacity var(--t-fast);
}
.set-row.done .set-checkbox svg { opacity: 1; }

.set-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.set-row.done .set-label { color: var(--text); }

.set-spec {
  font-size: var(--text-sm);
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Inputs de peso e reps */
.set-fields {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

.set-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: var(--surface-1);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 6px 8px;
  transition: border-color var(--t-fast);
}
.set-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.set-row.done .set-field {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(200, 255, 0, 0.4);
}

.set-input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-md);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  width: 36px;
  text-align: right;
  padding: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.set-input::-webkit-outer-spin-button,
.set-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.set-input::placeholder {
  color: var(--text-mute);
  font-weight: 500;
}
.set-input.set-weight { width: 42px; }
.set-input.set-reps { width: 28px; }

.set-unit {
  font-size: var(--text-xs);
  color: var(--text-dim);
  font-weight: 600;
  text-transform: lowercase;
}

.set-x {
  font-size: var(--text-sm);
  color: var(--text-mute);
  font-weight: 500;
}

.set-target {
  font-size: var(--text-xs);
  color: var(--text-mute);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* duration row */
.duration-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  background: var(--surface-2);
  border-radius: var(--r-md);
}

.duration-info {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-dim);
}
.duration-info strong { color: var(--text); font-weight: 700; }

.btn-start-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.btn-start-timer:hover {
  background: var(--accent-bright);
  box-shadow: 0 0 16px var(--accent-glow);
}

.btn-mark-done {
  padding: 10px 16px;
  background: transparent;
  color: var(--text-dim);
  border: 1.5px solid var(--border-strong);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.btn-mark-done.done {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-mark-done:hover { border-color: var(--accent); color: var(--accent); }
.btn-mark-done.done:hover { color: var(--accent-ink); }

/* ============================================
   FINISH BUTTON
   ============================================ */

.finish-area {
  position: fixed;
  bottom: var(--safe-bot);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: var(--s-4) var(--s-5);
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  pointer-events: none;
  z-index: 40;
}

.btn-finish {
  pointer-events: auto;
  width: 100%;
  padding: var(--s-5);
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 8px 32px rgba(200, 255, 0, 0.15);
  transition: all var(--t-base);
}

.btn-finish:not(:disabled):hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px var(--accent-glow);
}

.btn-finish:disabled {
  background: var(--surface-2);
  color: var(--text-mute);
  box-shadow: none;
  border: 1px solid var(--border);
  cursor: not-allowed;
}

.btn-finish-label {
  font-weight: 700;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
}

.btn-finish-meta {
  font-size: var(--text-xs);
  opacity: 0.7;
  font-weight: 500;
}

/* ============================================
   LIGHTBOX
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: var(--s-6);
  padding-top: calc(var(--s-6) + var(--safe-top));
  padding-bottom: calc(var(--s-6) + var(--safe-bot));
}
.lightbox.active { display: flex; animation: modalFade var(--t-base); }

.lightbox-close {
  position: absolute;
  top: calc(var(--s-4) + var(--safe-top));
  right: var(--s-4);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  transition: all var(--t-fast);
  z-index: 2;
}
.lightbox-close:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}

.lightbox-figure {
  width: 100%;
  max-width: 720px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-4);
  margin: 0;
  animation: zoomIn var(--t-base);
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.lightbox-figure img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

.lightbox-caption {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.01em;
  max-width: 32ch;
  line-height: 1.4;
}

/* ============================================
   TIMER MODAL
   ============================================ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: var(--s-6);
  animation: modalFade var(--t-base);
}
.modal.active { display: flex; }

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.timer {
  text-align: center;
  width: 100%;
  max-width: 360px;
}

.timer-label {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: var(--s-7);
}

.timer-ring-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto var(--s-8);
}

.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: var(--surface-3);
  stroke-width: 6;
}

.timer-ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  stroke-dasharray: 578.05;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 200ms ease;
}

.timer-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 76px;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.timer-display.warn { color: var(--warning); }
.timer-display.danger { color: var(--danger); animation: pulseDanger 0.6s ease-in-out infinite; }
.timer-ring-fg.warn { stroke: var(--warning); filter: drop-shadow(0 0 8px rgba(255, 184, 0, 0.4)); }
.timer-ring-fg.danger { stroke: var(--danger); filter: drop-shadow(0 0 8px rgba(255, 77, 77, 0.4)); }

@keyframes pulseDanger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.timer-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
  margin-bottom: var(--s-3);
}

.preset {
  padding: var(--s-3) var(--s-1);
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  color: var(--text-dim);
  font-weight: 700;
  font-size: var(--text-sm);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.preset:hover {
  border-color: var(--accent);
  color: var(--text);
}
.preset.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 16px var(--accent-glow);
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--s-2);
}

.btn-secondary {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--t-fast);
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-primary {
  padding: var(--s-4);
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--text-base);
  box-shadow: 0 0 24px var(--accent-glow);
  transition: all var(--t-fast);
}
.btn-primary:hover { background: var(--accent-bright); }

/* ============================================
   TOAST
   ============================================ */

.toast {
  position: fixed;
  top: calc(80px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: var(--text-sm);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-full);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: all var(--t-base);
  box-shadow: 0 8px 32px var(--accent-glow);
  white-space: nowrap;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 640px) {
  .home { padding-left: var(--s-6); padding-right: var(--s-6); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
