/* Timer & Stopwatch — tool-specific styles */

.ts-mode {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.mode-btn {
  padding: 0.55rem 1.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-btn.active {
  background: var(--primary);
  color: #fff;
}

.ts-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.ts-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
}

.preset-btn {
  flex: 1;
  min-width: 70px;
  padding: 0.5rem 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-alt);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.preset-btn:hover { border-color: var(--primary); color: var(--primary); }

.preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ts-display {
  text-align: center;
  font-size: 4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: 0.03em;
  padding: 0.75rem 0 0.5rem;
  line-height: 1;
}

.ts-display.finished {
  color: #dc2626;
  animation: ts-flash 0.6s ease-in-out infinite alternate;
}

@keyframes ts-flash {
  from { opacity: 1; }
  to { opacity: 0.35; }
}

.ts-progress {
  height: 8px;
  border-radius: 4px;
  background: var(--bg-alt);
  overflow: hidden;
  margin-bottom: 1.1rem;
}

.ts-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.4s linear;
}

.ts-controls {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.ts-done {
  text-align: center;
  font-weight: 700;
  color: #dc2626;
  min-height: 1.6rem;
  margin-top: 0.8rem;
}

.sw-laps {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  max-height: 240px;
  overflow-y: auto;
}

.sw-laps li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.sw-laps li:first-child {
  font-weight: 700;
  color: var(--primary);
}

.lap-label { color: var(--text-muted); }

@media (max-width: 480px) {
  .ts-display { font-size: 2.7rem; }
  .ts-controls { flex-wrap: wrap; }
  .ts-controls .btn { flex: 1; min-width: 44%; }
}
