.tab-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--text);
  background: var(--bg-elevated);
  border-color: var(--accent);
}

.timer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.stopwatch-display {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1rem 0;
}

.lap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 420px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.lap-list li {
  display: flex;
  justify-content: space-between;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 0.9rem;
}

.countdown-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ring-wrap {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 1 / 1;
}

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

.ring-bg {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 12;
}

.ring-progress {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke 0.3s ease;
}

.ring-progress.warning {
  stroke: #fbbf24;
}

.ring-progress.danger {
  stroke: var(--danger);
  animation: pulse-ring 1s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.countdown-display {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
}

.countdown-status {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.countdown-status.done {
  color: var(--danger);
  font-weight: 700;
}

.countdown-controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 260px;
}

.duration-inputs {
  display: flex;
  gap: 0.75rem;
}

.duration-inputs label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
}

.duration-inputs input {
  width: 4.5rem;
  text-align: center;
  font-size: 1.1rem;
}

.preset-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

@keyframes flash-bg {
  0%, 100% { background-color: var(--bg-card); }
  50% { background-color: rgba(248, 113, 113, 0.25); }
}

.timer-panel.time-up {
  animation: flash-bg 0.6s ease-in-out 4;
}
