/* Temporizador de práctica */
.timer-stage { gap: 18px; padding-top: var(--space-3); padding-bottom: var(--space-3); }

.timer-modes { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; }
.timer-modes .seg { flex: 1 1 auto; }

.timer-dial {
  position: relative;
  width: min(290px, 66vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.timer-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.timer-ring__track { fill: none; stroke: var(--color-surface-3); stroke-width: 7; }
.timer-ring__bar {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 1000;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(0, 205, 156, .35));
  transition: stroke .3s ease;
}
.timer-stage.is-rest .timer-ring__bar { stroke: var(--color-warn); filter: drop-shadow(0 0 6px rgba(242, 181, 68, .35)); }
.timer-dial__inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 80%; }
.timer-block {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer-stage.is-rest .timer-block { color: var(--color-warn); }
.timer-time { font-size: clamp(3.2rem, 15vw, 4.8rem); }
.timer-time.is-long { font-size: clamp(2.4rem, 11vw, 3.5rem); }
.timer-time > span { width: .6em; }
.timer-time > span.sep { width: .28em; }
.timer-next { margin-top: 8px; font-size: .8rem; color: var(--color-gray); min-height: 1.3em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-stage.is-done .timer-time { color: var(--color-accent); }

/* Cambio de bloque y final: pequeñas celebraciones */
.timer-dial.is-change { animation: timer-pop .5s var(--ease); }
.timer-dial.is-celebrate { animation: timer-pop .6s var(--ease) 3; }
.timer-dial.is-celebrate .timer-ring__bar { animation: timer-glow .6s ease 3; }
@keyframes timer-pop { 0% { transform: scale(1); } 35% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes timer-glow { 50% { filter: drop-shadow(0 0 16px rgba(0, 205, 156, .8)); } }
.play.is-on { animation: none; }

.timer-progress { display: grid; gap: 8px; width: 100%; max-width: 420px; }
.timer-segments { display: flex; gap: 4px; min-height: 6px; }
.timer-seg { position: relative; height: 6px; border-radius: 999px; background: var(--color-surface-3); overflow: hidden; min-width: 6px; }
.timer-seg__fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--color-accent); border-radius: inherit; }
.timer-seg.is-rest .timer-seg__fill { background: var(--color-warn); }
.timer-seg.is-done .timer-seg__fill { width: 100%; }
.timer-status { margin: 0; min-height: 1.3em; font-size: .82rem; font-weight: 700; color: var(--color-ink-soft); text-align: center; }

/* Chips rápidos: en una fila deslizable para no ocupar altura */
.timer-quick {
  display: flex;
  gap: 6px;
  width: 100%;
  max-width: 460px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 2px 4px;
  justify-content: center;
  flex-wrap: wrap;
}
.timer-quick::-webkit-scrollbar { display: none; }
.timer-quick .chip { flex: 0 0 auto; white-space: nowrap; }

.timer-actions { display: flex; align-items: center; justify-content: center; gap: var(--space-4); }

.timer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.timer-grid .field + .field { margin-top: 0; }
.timer-grid .stepper { grid-template-columns: 32px minmax(0, 1fr) 32px; gap: 3px; }
.timer-grid .icon-btn { width: 32px; height: 32px; }
.timer-grid .stepper__value { height: 34px; font-size: .95rem; padding: 0 2px; }
.timer-grid .field__label { font-size: .8rem; }

.timer-toggles { display: grid; gap: 4px; }
.timer-save { flex-wrap: nowrap; }
.timer-routines:empty { display: none; }

/* Bloques de rutina: número + nombre + borrar / minutos + mover */
.routine .list__item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas: "n name del" ". min move";
  align-items: center;
  gap: 8px 10px;
  padding: 10px 8px;
  margin: 0 -8px;
}
.routine__n { grid-area: n; }
.routine__name { grid-area: name; width: 100%; }
.routine__min { grid-area: min; justify-self: start; }
.routine__tools { grid-area: move; }
.routine__del { grid-area: del; }
.routine__n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--color-accent-dim);
  color: var(--color-accent);
  font-size: .78rem;
  font-weight: 700;
}
.routine__item.is-rest .routine__n { background: rgba(242, 181, 68, .15); color: var(--color-warn); }
.routine__name { height: 38px !important; }
.routine__min { display: grid; grid-template-columns: 34px 52px 34px; align-items: center; gap: 4px; }
.routine__min .stepper__value { height: 34px; font-size: .95rem; }
.routine__tools { display: flex; gap: 4px; }
.routine__item.is-current { background: linear-gradient(90deg, var(--color-accent-dim), transparent 70%); border-radius: var(--radius); }
.routine__item.is-current .routine__n { background: var(--color-accent); color: var(--color-bg); }

/* En escritorio, todo el escenario sobre la línea de flotación */
@media (min-width: 960px) {
  .timer-dial { width: 270px; }
}

@media (max-width: 600px) {
  .timer-stage { gap: 14px; padding-top: 14px; padding-bottom: 16px; }
  .timer-dial { width: min(244px, 64vw); }
  .timer-actions { gap: var(--space-3); }
  .timer-grid { gap: 6px; }
  .timer-grid .stepper { grid-template-columns: 30px minmax(0, 1fr) 30px; }
  .timer-grid .icon-btn { width: 30px; height: 30px; }
  .timer-quick { justify-content: flex-start; flex-wrap: nowrap; }
}
@media (max-height: 700px) and (max-width: 600px) {
  .timer-dial { width: min(204px, 56vw); }
  .timer-time { font-size: 3rem; }
}
