.timer-page {
  background: var(--bg);
  min-height: 100vh;
  margin: 0;
}

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  gap: 12px;
}

.timer-header h1 {
  margin: 0;
  font-size: 20px;
  flex: 1;
  text-align: center;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.back-link:hover {
  text-decoration: underline;
}

.timer-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 16px;
  text-align: center;
}

.timer-display {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: clamp(80px, 22vw, 220px);
  line-height: 1;
  margin: 24px 0 32px;
  color: var(--text);
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 32px 16px;
  user-select: none;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.timer-display.warn1m {
  color: #b45309;
  background: #fffbeb;
  border-color: #fcd34d;
}

.timer-display.warn30 {
  color: #c2410c;
  background: #fff7ed;
  border-color: #fb923c;
}

.timer-display.done {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
  animation: timer-flash 0.6s ease infinite alternate;
}

@keyframes timer-flash {
  from { opacity: 1; }
  to   { opacity: 0.7; }
}

.preset-row,
.custom-row,
.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-row .preset {
  font-size: 15px;
  padding: 10px 16px;
  min-width: 64px;
}

.custom-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
}

.custom-row input {
  width: 60px;
  border: none;
  outline: none;
  text-align: center;
  font-size: 16px;
  font-family: inherit;
  background: transparent;
}

.custom-row span {
  color: var(--muted);
  font-size: 14px;
}

#set-btn {
  padding: 8px 16px;
}

.controls button {
  font-size: 18px;
  padding: 14px 28px;
  min-width: 120px;
}

.controls button.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.controls button.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
}
