:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #141715;
  color: #f0f1ed;
  --muted: #9baba1;
  --accent: #c8e6bb;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button, a, input { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--accent); }
button:disabled { cursor: default; }
button { transition: background 160ms, color 160ms, opacity 160ms; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.header { padding: 28px 40px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-size: 21px; font-weight: 600; letter-spacing: -1px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--accent); color: #1c291b; border-radius: 9px; font-family: Georgia, serif; font-size: 26px; font-style: italic; padding-bottom: 3px; }
.tools { display: flex; gap: 12px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; color: var(--muted); border: 1px solid #313932; border-radius: 50%; background: transparent; }
.icon-button:hover { background: #252c26; color: #f0f1ed; }
.icon-button svg { width: 18px; height: 18px; }
.sound-muted, #sound[aria-pressed="false"] .sound-waves { display: none; }
#sound[aria-pressed="false"] .sound-muted { display: block; }
main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 20px 8px; }
.intro { text-align: center; }
.eyebrow { margin: 0 0 14px; color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: 3px; }
h1 { margin: 0; font-size: clamp(22px, 3.8vw, 30px); font-weight: 400; letter-spacing: -.9px; }
.mode-toggle { margin: 20px 0; min-height: 40px; padding: 9px 16px; border: 1px solid #4c5c45; border-radius: 8px; background: #1a1f1b; color: var(--accent); font-size: 13px; }
.mode-toggle:hover { background: #333e31; }
.mode-toggle + .duration-picker { margin-top: 0; }
.duration-picker { border: 0; padding: 0; margin: 32px 0 20px; min-width: 0; max-width: 100%; }
.presets { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; padding: 5px; border: 1px solid #303730; border-radius: 13px; background: #1a1f1b; }
.preset { min-height: 40px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #b4bdb5; font-size: 13px; white-space: nowrap; }
.preset span { font-size: 11px; }
.preset:hover { background: #283029; color: #fff; }
.preset[aria-pressed="true"] { background: #333e31; border-color: #4c5c45; color: #e0f0d7; }
.duration-picker:disabled { opacity: .5; }
.custom-panel { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; font-size: 13px; color: #b4bdb5; }
.custom-panel input { width: 90px; min-height: 40px; border: 1px solid #4c5c45; border-radius: 7px; padding: 8px; background: #1a1f1b; color: #f0f1ed; }
.custom-panel button { min-height: 40px; background: #333e31; color: #e0f0d7; border: 1px solid #4c5c45; border-radius: 7px; padding: 8px 12px; }
.error { flex-basis: 100%; text-align: center; color: #f3baac; }
.error:empty { display: none; }
.timer { width: min(400px, 87vw); aspect-ratio: 1; position: relative; flex-shrink: 0; margin: 8px 0 24px; }
.timer-ring { width: 100%; height: 100%; transform: rotate(-90deg); stroke-width: 2; }
.ring-track { stroke: #303a30; }
.ring-progress { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 100ms linear; }
.timer-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.timer-caption { margin: 0 0 16px; font-size: clamp(8px, 2vw, 9px); letter-spacing: 1.7px; color: var(--muted); }
.time { font-size: clamp(66px, 18vw, 92px); font-weight: 300; letter-spacing: -5px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.time.long { font-size: clamp(44px, 12vw, 66px); letter-spacing: -3px; }
.timer-status { margin: 20px 0 0; font-size: 12px; color: var(--muted); }
.add-minute { margin-top: 16px; min-width: 44px; min-height: 36px; padding: 6px 12px; border: 1px solid #4c5c45; border-radius: 8px; background: #333e31; color: #e0f0d7; font-size: 14px; }
.add-minute:hover:not(:disabled) { background: #46543f; }
.add-minute:disabled { opacity: .35; }
.controls { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lap-button { min-width: 120px; min-height: 40px; padding: 9px 20px; border: 1px solid #4c5c45; border-radius: 8px; background: #333e31; color: #e0f0d7; font-size: 14px; }
.lap-button:hover:not(:disabled) { background: #46543f; }
.lap-button:disabled { opacity: .35; }
.laps { width: min(440px, 100%); margin-top: 24px; }
.laps h2 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
.laps-scroll { max-height: 260px; overflow: auto; border: 1px solid #303730; border-radius: 10px; }
.laps table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.laps th, .laps td { padding: 12px; text-align: right; }
.laps thead th { position: sticky; top: 0; background: #1a1f1b; color: var(--muted); font-weight: 500; }
.laps th:first-child { text-align: left; }
.laps tbody th, .laps td { border-top: 1px solid #303730; }
.laps tbody th { font-weight: 400; color: var(--muted); }
.laps tbody tr:first-child { color: var(--accent); }
.start-button { min-width: 190px; min-height: 49px; padding: 12px 24px; border: 1px solid var(--accent); border-radius: 10px; color: #192517; background: var(--accent); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.start-button:hover { background: #ddf2d3; }
#start-symbol { font-size: 12px; }
.reset-button { min-height: 35px; display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 8px 12px; background: transparent; color: #b4bdb5; font-size: 12px; }
.reset-button svg { width: 14px; height: 14px; }
.reset-button:hover:not(:disabled) { color: #f0f1ed; }
.reset-button:disabled { opacity: .35; }
.tool-message { margin: 8px 0 0; max-width: 420px; color: #b4bdb5; font-size: 12px; text-align: center; }
.tool-message:empty { margin: 0; }
footer { padding: 32px 20px 24px; text-align: center; font-size: 11px; letter-spacing: .2px; color: #9aa59b; }
footer span { padding: 0 10px; color: #52604f; }
.timer.finished .ring-track { stroke: var(--accent); }
.timer.finished .time { color: var(--accent); }
.timer.finished { animation: complete 900ms ease-out; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes complete { from { filter: drop-shadow(0 0 15px #c8e6bb66); } to { filter: drop-shadow(0 0 0 transparent); } }
@media (max-width: 520px) {
  .header { padding: 18px 20px; }
  main { padding-top: 24px; }
  .duration-picker { margin-top: 26px; }
  .presets { gap: 3px; }
  .preset { padding: 9px 10px; }
  .custom-toggle { flex-basis: 100%; }
  .timer { margin-top: 0; margin-bottom: 20px; }
  footer { padding-top: 28px; font-size: 10px; }
}
@media (max-height: 740px) and (min-width: 521px) {
  .header { padding-top: 18px; padding-bottom: 12px; }
  main { padding-top: 10px; }
  .duration-picker { margin-top: 20px; margin-bottom: 8px; }
  .timer { width: 320px; margin-bottom: 12px; }
  .time { font-size: 76px; }
  footer { padding-top: 16px; padding-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
