/* Timer, study timer and stopwatch. Builds on style.css. */

.tm-panel { text-align: center; }
.tm-panel .lead { margin: 0 0 4px; }

.tm-display {
  display: block;
  font-size: clamp(56px, 18vw, 112px);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
}
.tm-panel[data-state="done"] .tm-display { color: var(--group-strong); animation: tm-blink 1s steps(2, start) infinite; }
@keyframes tm-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .tm-panel[data-state="done"] .tm-display { animation: none; } }

.tm-phase { margin: 4px 0 0; font-weight: 600; color: var(--group-strong); }
.tm-panel[data-phase="rest"] .tm-phase { color: var(--muted); }
.tm-status { margin: 0; min-height: 1.5em; color: var(--muted); }

.tm-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 4px; }
.tm-controls .primary-button { min-width: 140px; }
.tm-controls .copy { min-height: 44px; }
.tm-controls .copy:disabled { opacity: 0.4; cursor: default; }

.tm-presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.tm-chip {
  font: inherit; font-size: 15px; min-height: 40px; padding: 4px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.tm-chip[aria-pressed="true"] { background: var(--group-strong); border-color: var(--group-strong); color: #fff; }

.tm-custom { margin-top: 14px; text-align: start; }
.tm-custom summary { cursor: pointer; color: var(--muted); text-align: center; }
.tm-custom-form { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: end; }
.tm-custom-form input { width: 100%; text-align: center; font: inherit; font-size: 18px; }
@media (max-width: 420px) { .tm-custom-form { grid-template-columns: repeat(3, 1fr); } .tm-custom-form button { grid-column: 1 / -1; } }

.tm-panel .calendar-choice { margin-top: 14px; text-align: start; }

.tm-laps { margin-top: 12px; font-variant-numeric: tabular-nums; }
.tm-laps td { direction: ltr; }
.tm-panel [data-copy] { margin-top: 10px; min-height: 40px; }

/* Full screen: only the clock and its buttons, centred and large. */
.tm-panel:fullscreen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg, #fff); border-radius: 0; padding: 24px;
}
.tm-panel:fullscreen .tm-display { font-size: min(28vw, 50vh); }
.tm-panel:fullscreen .lead, .tm-panel:fullscreen .tm-presets, .tm-panel:fullscreen .tm-custom,
.tm-panel:fullscreen .calendar-choice, .tm-panel:fullscreen [data-copy] { display: none; }
.tm-panel:fullscreen [data-laps] { max-height: 30vh; overflow: auto; width: min(560px, 100%); }
