:root {
  --bg: #0f1219;
  --bg-elev: #171b26;
  --bg-elev-2: #1f2533;
  --accent: #22d3a7;        /* pause / teal */
  --accent-press: #1bb892;
  --effort: #f59e0b;        /* effort / amber */
  --danger: #ef4444;
  --text: #e9f0f5;
  --text-dim: #93a0b0;
  --track: #2a3142;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}
body { display: flex; min-height: 100%; }

/* ---------- Scrollbars (cohérentes avec le thème sombre) ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--track) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--track);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #3a4358; background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: padding-box; }

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  /* svh = hauteur « petite » STABLE : ne suit pas la barre d'adresse mobile qui
     se rétracte (contrairement à dvh), donc le bouton du bas ne « glisse » plus
     vers le bas au rechargement / après une mise à jour. Fallback vh. */
  min-height: 100vh;
  min-height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  overflow-y: auto;
  padding: calc(var(--safe-top) + 16px) 20px calc(var(--safe-bottom) + 20px);
  transition: padding-top .35s cubic-bezier(.2,.85,.25,1);
}
.screen.is-active { display: flex; }
/* Bandeau de mise à jour visible → on réserve la place en haut. Le contenu (titre,
   en-tête) descend, mais le bouton du bas reste ancré en bas et ne bouge pas. */
.has-update .screen.is-active { padding-top: calc(var(--safe-top) + 16px + 62px); }

/* ---------- Options button (en flux, pas en position fixe) ---------- */
.options-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  font-size: 1.4rem;
  color: var(--text);
  background: var(--bg-elev-2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  cursor: pointer;
  transition: transform .08s ease;
}
.options-btn:active { transform: scale(.9); }

/* En-tête d'écran (accueil) : aligne le bouton Options en haut à droite */
.screen-head { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-height: 48px; margin-bottom: 4px; }

/* Bouton d'installation PWA (visible seulement si installable) */
.install-btn {
  margin-right: auto; /* poussé à gauche, ⚙ reste à droite */
  padding: 0 16px;
  height: 48px;
  font-size: .95rem;
  font-weight: 700;
  color: #04130f;
  background: var(--accent);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.install-btn:active { transform: scale(.95); background: var(--accent-press); }
.install-btn[hidden] { display: none; }

/* ---------- Primary button ---------- */
.btn-primary {
  margin-top: auto;
  width: 100%;
  padding: 20px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #04130f;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.btn-primary:active { transform: scale(.97); background: var(--accent-press); }
.btn-primary:disabled { opacity: .4; cursor: default; }

/* ---------- Home ---------- */
.home-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; text-align: center; align-items: center; }
.brand { font-size: 2.4rem; font-weight: 800; margin: 12px 0 4px; letter-spacing: -.5px; }
.brand span { color: var(--accent); }
.tagline { color: var(--text-dim); margin: 0 0 22px; font-size: 1.05rem; }
.question { font-size: 1.3rem; font-weight: 700; margin: 4px 0 16px; }

.mode-seg {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 360px;
  padding: 6px;
  background: var(--bg-elev);
  border-radius: 16px;
  margin-bottom: 22px;
}
.seg {
  flex: 1;
  padding: 14px 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg.selected { background: var(--bg-elev-2); color: var(--text); }

.series-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 360px;
}
.series-cell {
  aspect-ratio: 1 / 1;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  background: var(--bg-elev);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.series-cell:active { transform: scale(.95); }
.series-cell.selected { border-color: var(--accent); background: var(--bg-elev-2); color: var(--accent); }

/* Écrans courts : on compresse pour que « C'est parti » reste visible sans scroll */
@media (max-height: 720px) {
  .brand { font-size: 2rem; margin: 6px 0 2px; }
  .tagline { margin-bottom: 14px; font-size: 1rem; }
  .question { margin: 2px 0 12px; }
  .mode-seg { margin-bottom: 14px; }
  .series-grid { gap: 10px; }
  .btn-primary { padding: 16px; }
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 10px 12px;
}
/* Sur l'écran de fin, on masque la barre du haut pour un rendu plein écran. */
#screen-main:has(#done-view.is-active) .topbar,
#screen-main:has(#done-view.is-active) .timeline { display: none; }

/* ---------- Timeline des séries ---------- */
.timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 8px 2px 2px;
  padding: 10px 8px; /* de l'air pour le halo / l'agrandissement du rond en cours */
  overflow-x: auto;
  scrollbar-width: none;
}
.timeline::-webkit-scrollbar { display: none; }
.timeline[hidden] { display: none; }
.tl-dot {
  flex: 0 0 auto;
  width: 15px; height: 15px;
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--track);
  border: 2px solid var(--track);
  transition: background .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
.tl-dot.done { background: var(--accent); border-color: var(--accent); }
.tl-dot.current {
  background: var(--bg-elev);
  border-color: var(--accent);
  transform: scale(1.32);
  box-shadow: 0 0 0 4px rgba(34,211,167,.18);
}
.tl-bar {
  flex: 1 1 auto;
  min-width: 10px; max-width: 46px;
  height: 3px;
  border-radius: 2px;
  background: var(--track);
  overflow: hidden;
}
.tl-bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width .25s linear;
}
.icon-btn {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  font-size: 1.5rem;
  color: var(--text);
  background: var(--bg-elev-2);
  border: none; border-radius: 14px;
  cursor: pointer;
  transition: transform .08s ease;
}
.icon-btn:active { transform: scale(.92); }
.series-counter { display: flex; align-items: center; gap: 12px; }
.step-btn {
  width: 48px; height: 48px;
  font-size: 1.7rem; font-weight: 700;
  color: var(--text);
  background: var(--bg-elev-2);
  border: none; border-radius: 14px;
  cursor: pointer;
  transition: transform .08s ease;
}
.step-btn:active { transform: scale(.92); }
.step-btn:disabled { opacity: .35; }
.series-readout { display: flex; flex-direction: column; align-items: center; min-width: 96px; }
.series-num { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--accent); }
.series-label { font-size: .72rem; color: var(--text-dim); margin-top: 3px; }

/* ---------- Views ---------- */
.view { display: none; flex-direction: column; flex: 1; align-items: center; justify-content: center; }
.view.is-active { display: flex; }
#setup-view.is-active { justify-content: flex-start; padding-top: 14px; }
.view-title { font-size: 1.25rem; font-weight: 700; margin: 8px 0 16px; color: var(--text-dim); }
.view-title--rest { margin-top: 22px; }

/* Indice de raccourci clavier (Espace) — masqué sur écrans tactiles (mobile) */
.kbd-hint {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 16px auto 0;
  font-size: .82rem; color: var(--text-dim); text-align: center;
}
.kbd-hint:empty { display: none; }
.kbd-hint kbd {
  font: inherit; font-weight: 700; color: var(--text);
  padding: 2px 9px;
  background: var(--bg-elev-2);
  border: 1px solid rgba(255,255,255,.14);
  border-bottom-width: 2px;
  border-radius: 6px;
}
/* Indice clavier au doigt / indice « double tap » à la souris : on n'en montre
   qu'un seul, selon le type de pointeur. */
.kbd-hint .hint-touch { display: none; }
@media (pointer: coarse) {
  .kbd-hint .hint-desktop { display: none; }
  .kbd-hint .hint-touch { display: inline; }
}

/* ---------- Écran « Fais ta série » (mode Pause seule) ---------- */
.doset-view { gap: 4px; text-align: center; padding: 0 6px; }

/* Scène animée : cœur d'énergie + anneaux « sonar » + halo qui tourne */
.doset-stage {
  position: relative;
  width: min(58vw, 230px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
/* Halo lumineux conique qui tourne doucement derrière le cœur */
.doset-glow {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0%, rgba(34,211,167,.45) 18%, transparent 38%,
    rgba(245,158,11,.38) 60%, transparent 82%, rgba(34,211,167,.45) 100%);
  filter: blur(16px);
  animation: doset-spin 7s linear infinite;
}
/* Anneaux d'énergie qui s'étendent vers l'extérieur */
.doset-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  opacity: 0;
  animation: doset-pulse 2.6s cubic-bezier(.22,.61,.36,1) infinite;
}
.doset-ring:nth-of-type(3) { animation-delay: .86s; }
.doset-ring:nth-of-type(4) { animation-delay: 1.72s; }
/* Cœur central qui « respire » */
.doset-core {
  position: relative;
  z-index: 1;
  width: 60%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, var(--bg-elev-2), var(--bg-elev) 70%);
  border: 1px solid rgba(34,211,167,.25);
  box-shadow: 0 0 30px rgba(34,211,167,.45), inset 0 2px 12px rgba(255,255,255,.06);
  animation: doset-breathe 2.6s ease-in-out infinite;
}
.doset-icon {
  width: 50%;
  height: 50%;
  color: var(--accent);
  filter: drop-shadow(0 4px 12px rgba(34,211,167,.45));
  animation: doset-lift 1.3s ease-in-out infinite;
}
@keyframes doset-spin { to { transform: rotate(360deg); } }
@keyframes doset-pulse {
  0%   { opacity: .85; transform: scale(.6); border-width: 3px; }
  100% { opacity: 0;   transform: scale(1.18); border-width: 1px; }
}
@keyframes doset-breathe {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 26px rgba(34,211,167,.4),  inset 0 2px 12px rgba(255,255,255,.06); }
  50%      { transform: scale(1.07); box-shadow: 0 0 46px rgba(34,211,167,.7),  inset 0 2px 12px rgba(255,255,255,.12); }
}
@keyframes doset-lift {
  0%, 100% { transform: translateY(4px)  rotate(-5deg); }
  50%      { transform: translateY(-6px) rotate(5deg); }
}

/* Titre avec un reflet qui balaie le texte */
.doset-title {
  font-size: 1.8rem; font-weight: 800; margin: 20px 0 2px;
  background: linear-gradient(100deg, var(--text) 32%, var(--accent) 50%, var(--text) 68%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: doset-shine 3.2s linear infinite;
}
@keyframes doset-shine { to { background-position: -220% center; } }

.doset-view .btn-primary { margin-top: 30px; width: 100%; max-width: 360px; }

@media (prefers-reduced-motion: reduce) {
  .doset-glow, .doset-ring, .doset-core, .doset-icon, .doset-title { animation: none; }
  .doset-title { color: var(--text); -webkit-text-fill-color: var(--text); }
}

/* ---------- Écran de fin de séance ---------- */
.done-view { gap: 4px; text-align: center; padding: 0 6px; }
.done-emoji {
  font-size: clamp(5rem, 30vw, 8rem);
  line-height: 1;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.45));
  animation: done-pop .6s cubic-bezier(.2,.9,.25,1.2) both;
}
@keyframes done-pop {
  0%   { transform: scale(.2) rotate(-12deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.done-title { font-size: 1.9rem; font-weight: 800; margin: 16px 0 4px; color: var(--text); }
.done-sub { color: var(--text-dim); margin: 0; font-size: 1.05rem; }
.done-actions { width: 100%; max-width: 360px; margin-top: 30px; }
.done-actions .btn-primary { width: 100%; }
.done-actions .link-btn { margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .done-emoji { animation: none; }
}

/* Toggle auto/manuel sur l'écran de réglage Effort+Pause */
.setup-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 420px;
  background: var(--bg-elev); border-radius: 16px;
  padding: 14px 18px; margin-bottom: 8px;
}
.setup-hint { max-width: 420px; text-align: center; margin-top: 0; }
#setup-grids { width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; }
#setup-grids[hidden] { display: none; }
/* Espace au-dessus du bouton Démarrer pour ne pas coller au contenu */
#setup-start { margin-top: 28px; }

/* ---------- Duration grid ---------- */
.duration-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 420px;
}
.duration-cell {
  padding: 22px 10px;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  background: var(--bg-elev);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.duration-cell:active { transform: scale(.95); border-color: var(--accent); background: var(--bg-elev-2); }
.duration-cell.selected { border-color: var(--accent); background: var(--bg-elev-2); color: var(--accent); }
.duration-cell:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- Phase badge ---------- */
.phase-badge {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 6px 18px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.phase-badge.phase-pause { color: var(--accent); background: rgba(34, 211, 167, .12); }
.phase-badge.phase-effort { color: var(--effort); background: rgba(245, 158, 11, .14); }

/* ---------- Ring ---------- */
.ring-wrap { position: relative; width: min(72vw, 300px); aspect-ratio: 1 / 1; display: grid; place-items: center; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--track); stroke-width: 14; }
.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 628.318;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .25s linear, stroke .3s ease;
}
.ring-progress.phase-pause { stroke: var(--accent); }
.ring-progress.phase-effort { stroke: var(--effort); }
.ring-progress.is-ending { stroke: var(--danger); }
.ring-center { position: absolute; display: flex; flex-direction: column; align-items: center; }
.time-display { font-size: 3.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.time-display.is-ending { color: var(--danger); }
.timer-state { color: var(--text-dim); font-size: .95rem; margin-top: 2px; }

/* ---------- Controls ---------- */
.controls { display: flex; gap: 10px; width: 100%; max-width: 440px; margin-top: 34px; }
.ctrl-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 4px;
  color: var(--text);
  background: var(--bg-elev);
  border: none; border-radius: var(--radius);
  cursor: pointer;
  transition: transform .08s ease, background .15s ease;
}
.ctrl-btn:active { transform: scale(.94); background: var(--bg-elev-2); }
.ctrl-main { background: var(--bg-elev-2); }
.ctrl-ico { font-size: 1.5rem; line-height: 1; }
.ctrl-txt { font-size: .76rem; color: var(--text-dim); }

/* ---------- Snackbar ---------- */
.snackbar {
  position: fixed;
  top: calc(var(--safe-top) + 72px);
  right: 16px;
  transform: translateY(-16px);
  z-index: 65;
  max-width: 80vw;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  color: #04130f;
  background: var(--accent);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.snackbar.show { opacity: 1; transform: translateY(0); }

/* ---------- Bandeau de mise à jour ---------- */
.update-banner {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 12px);
  transform: translateX(-50%) translateY(-180%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  max-width: min(92vw, 380px);
  padding: 8px 8px 8px 18px;
  background: rgba(31, 37, 51, .78);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(34, 211, 167, .22);
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .4s cubic-bezier(.2,.85,.25,1);
}
.update-banner[hidden] { display: none; }
.update-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

.update-dot {
  flex: 0 0 auto;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(34,211,167,.7);
  animation: update-pulse 1.8s ease-out infinite;
}
@keyframes update-pulse {
  0%   { box-shadow: 0 0 8px rgba(34,211,167,.7), 0 0 0 0 rgba(34,211,167,.5); }
  70%  { box-shadow: 0 0 8px rgba(34,211,167,.7), 0 0 0 8px rgba(34,211,167,0); }
  100% { box-shadow: 0 0 8px rgba(34,211,167,.7), 0 0 0 0 rgba(34,211,167,0); }
}

.update-text { font-weight: 650; font-size: .9rem; color: var(--text); white-space: nowrap; }
.update-btn {
  flex: 0 0 auto;
  padding: 9px 17px;
  font-weight: 800; font-size: .85rem;
  color: #04130f; background: var(--accent);
  border: none; border-radius: 999px; cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.update-btn:hover { background: var(--accent-press); }
.update-btn:active { transform: scale(.95); }
.update-btn:disabled { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
  .update-dot { animation: none; }
}

/* ---------- Décompte avant le départ (enchaînement auto) ---------- */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 42%, rgba(245,158,11,.16), rgba(15,18,25,.97) 62%), var(--bg);
  opacity: 0;
  transition: opacity .2s ease;
}
.countdown-overlay[hidden] { display: none; }
.countdown-overlay.show { opacity: 1; }
.countdown-label { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--text); letter-spacing: .3px; }
.countdown-hint { margin: 0; color: var(--text-dim); font-size: 1.02rem; }
.countdown-num {
  font-size: clamp(5.5rem, 38vw, 9rem);
  font-weight: 800;
  line-height: 1;
  color: var(--effort);
  text-shadow: 0 0 44px rgba(245,158,11,.45);
}
.countdown-num.go {
  color: var(--accent);
  text-shadow: 0 0 50px rgba(34,211,167,.55);
}
.countdown-num.pop { animation: countdown-pop .5s ease-out; }
@keyframes countdown-pop {
  0%   { transform: scale(.4); opacity: 0; }
  35%  { transform: scale(1.16); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .countdown-num.pop { animation: none; }
}

/* ---------- Pied de la modale (version) ---------- */
.modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 2px 2px; margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.05);
  color: var(--text-dim); font-size: .82rem;
}
.modal-foot .link-btn { width: auto; margin: 0; padding: 6px 0; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
  border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(var(--safe-bottom) + 18px);
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 2px 12px; }
.modal-head h2 { margin: 0; font-size: 1.4rem; }

.tabs { display: flex; gap: 6px; background: var(--bg); padding: 5px; border-radius: 14px; }
.tab {
  flex: 1;
  padding: 11px 6px;
  font-size: .92rem; font-weight: 700;
  color: var(--text-dim);
  background: transparent; border: none; border-radius: 10px;
  cursor: pointer;
}
.tab.is-active { background: var(--bg-elev-2); color: var(--text); }

.modal-body { overflow-y: auto; overflow-x: hidden; margin-top: 12px; -webkit-overflow-scrolling: touch; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; }
.opt-label { font-size: 1.02rem; }
.opt-val { color: var(--accent); font-weight: 700; }
.opt-block { padding: 8px 2px 12px; border-top: 1px solid rgba(255,255,255,.05); }
.opt-block .opt-row { padding: 8px 0; }
.opt-hint { font-size: .82rem; color: var(--text-dim); margin: 4px 2px 10px; line-height: 1.4; }
.opt-sep { border: none; border-top: 1px solid rgba(255,255,255,.07); margin: 14px 0; }

/* Switch */
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 52px; height: 30px; background: var(--track); border-radius: 999px; cursor: pointer; transition: background .2s ease; flex: 0 0 auto; }
.switch:checked { background: var(--accent); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; background: #fff; border-radius: 50%; transition: transform .2s ease; }
.switch:checked::after { transform: translateX(22px); }

/* Slider */
.slider { width: 100%; height: 6px; -webkit-appearance: none; appearance: none; background: var(--track); border-radius: 999px; outline: none; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.slider::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: var(--accent); cursor: pointer; }

/* Select */
.select { width: 100%; padding: 13px 14px; font-size: 1rem; color: var(--text); background: var(--bg-elev-2); border: none; border-radius: 12px; cursor: pointer; }

/* Mini buttons */
.mini-btn { padding: 9px 16px; font-size: .9rem; font-weight: 700; color: var(--accent); background: var(--bg-elev-2); border: none; border-radius: 10px; cursor: pointer; }
.mini-btn:active { transform: scale(.95); }
.mini-btn--wide { display: block; width: 100%; margin: 8px 0; padding: 14px; color: var(--text); }
.link-btn { display: block; width: 100%; margin-top: 4px; padding: 10px; font-size: .86rem; color: var(--text-dim); background: none; border: none; cursor: pointer; text-decoration: underline; }

/* Timers editor */
.timers-list { display: flex; flex-direction: column; gap: 10px; }
.timer-edit-row { display: flex; align-items: center; gap: 10px; background: var(--bg-elev-2); border-radius: 12px; padding: 8px 12px; }
.timer-edit-row .t-fields { display: flex; align-items: center; gap: 6px; flex: 1; }
.t-input { width: 58px; padding: 12px 6px; font-size: 1.2rem; font-weight: 700; text-align: center; color: var(--text); background: var(--bg); border: 1px solid var(--track); border-radius: 10px; font-variant-numeric: tabular-nums; }
.t-sep { font-size: 1.2rem; font-weight: 800; color: var(--text-dim); }
.t-unit { font-size: .8rem; color: var(--text-dim); margin-left: -2px; }
.t-del { width: 44px; height: 44px; font-size: 1.1rem; color: var(--danger); background: var(--bg); border: none; border-radius: 10px; cursor: pointer; flex: 0 0 auto; }
.t-del:active { transform: scale(.92); }

@media (min-width: 560px) {
  .screen { max-width: 520px; margin: 0 auto; }
}
