:root {
  color-scheme: dark;
  --bg: #0f1115;
  --text: #f5f7fa;
  --muted: #9ca3af;
  --card: #181b22;
  --border: #2a2f3a;
  --accent: #6366f1;
  --accent-hover: #777af5;
  --accent-tint: #6366f11a;
  --green: #22c55e;
  --amber: #f59e0b;
  --danger: #fda4af;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --card: #fff;
  --border: #e5e7eb;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-tint: #4f46e50d;
  --green: #15803d;
  --amber: #a16207;
  --danger: #be123c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, a, input { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button { transition: background-color 180ms, border-color 180ms, color 180ms, opacity 180ms; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
button svg, .brand svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 25px 40px; }
.brand { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; font-size: 20px; font-weight: 650; letter-spacing: -.6px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: #a5a7ff; background: var(--accent-tint); border: 1px solid var(--border); border-radius: 10px; margin-right: 10px; }
[data-theme="light"] .brand-mark { color: var(--accent); }
.brand-dot { color: var(--accent); }
.utilities { display: flex; align-items: center; gap: 6px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--text); background: var(--card); border-color: var(--border); }
.utility-divider { width: 1px; height: 18px; background: var(--border); margin: 0 5px; }
.main { width: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px 20px 42px; }
.mode-control { display: flex; padding: 5px; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; }
.mode-control button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; font-size: 14px; }
.mode-control button small { margin-left: 6px; font-size: 12px; }
.mode-control button[aria-pressed="true"] { background: var(--bg); color: var(--text); border-color: var(--border); box-shadow: 0 2px 4px #0000000a; }
.mode-control button:hover { color: var(--text); }
.timer-stage { text-align: center; margin-top: 43px; width: 100%; }
.eyebrow { font-size: 12px; letter-spacing: 3px; color: var(--muted); margin: 0 0 14px; }
.timer-display { display: block; margin: 0 auto; padding: 0; width: min(100%, 1000px); border: 0; background: none; font-size: clamp(48px, 11vw, 140px); line-height: 1.2; font-weight: 500; letter-spacing: -.055em; font-variant-numeric: tabular-nums; user-select: none; white-space: nowrap; }
.timer-display.long-time { font-size: clamp(36px, 8vw, 110px); }
.status { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 24px; margin: 19px 0 0; color: var(--muted); font-size: 14px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status[data-state="running"] { color: var(--green); }
.status[data-state="completed"] { color: var(--amber); }
.interaction-hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
.actions { display: flex; max-width: 100%; gap: 12px; margin-top: 28px; }
.button { border: 1px solid var(--border); border-radius: 12px; height: 52px; padding: 0 26px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; font-weight: 550; }
.button > span { white-space: nowrap; flex-shrink: 0; }
.button.primary { width: 170px; color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { width: 112px; flex-shrink: 0; padding-inline: 18px; background: var(--card); color: var(--muted); }
.button.secondary:hover { color: var(--text); border-color: var(--muted); }
.settings { width: min(100%, 496px); margin-top: 39px; border-top: 1px solid var(--border); padding-top: 23px; }
/* Keep the same responsive footprint in both modes so shared controls never jump. */
.settings[aria-hidden="true"] { visibility: hidden; pointer-events: none; }
.settings-heading { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.settings-heading > span:first-child { color: var(--text); }
.time-fields { display: flex; align-items: flex-end; justify-content: center; gap: 15px; }
.time-field { display: flex; flex: 0 1 80px; min-width: 0; flex-direction: column; align-items: center; gap: 8px; width: 80px; }
.time-field label { color: var(--muted); font-size: 12px; }
.time-field input { width: 100%; min-width: 0; height: 46px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); text-align: center; font-size: 19px; font-variant-numeric: tabular-nums; }
.time-field input:disabled { opacity: .45; }
.time-field input[aria-invalid="true"] { border-color: var(--danger); }
.field-colon { color: var(--muted); line-height: 46px; }
.error { color: var(--danger); font-size: 12px; line-height: 1.5; min-height: 18px; margin: 7px 0; text-align: center; }
.presets { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; }
.presets button { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; min-height: 44px; flex: 1 0 56px; padding: 0 7px; font-size: 13px; font-variant-numeric: tabular-nums; }
.presets button span { font-size: 11px; margin-left: 3px; }
.presets button[aria-pressed="true"] { color: var(--text); background: var(--accent-tint); border-color: var(--accent); }
.presets button:hover { color: var(--text); border-color: var(--accent); }
.footer { text-align: center; color: var(--muted); padding: 12px 20px 25px; font-size: 11px; }
.shortcuts { display: flex; justify-content: center; flex-wrap: wrap; gap: 23px; margin-bottom: 23px; font-size: 12px; }
kbd { display: inline-block; padding: 3px 6px; border: 1px solid var(--border); background: var(--card); border-radius: 5px; margin-right: 5px; font-family: inherit; font-size: 11px; min-width: 22px; }
.footer p { margin: 0; letter-spacing: .3px; }
.footer p span { margin: 0 7px; }
.notice { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px; width: max-content; max-width: calc(100% - 32px); font-size: 13px; box-shadow: 0 4px 20px #0002; }
:root:fullscreen .footer, :root:fullscreen .eyebrow, :root:fullscreen .interaction-hint, :root:fullscreen .settings { display: none; }
:root:fullscreen .timer-display { font-size: clamp(48px, 15vw, 220px); }
:root:fullscreen .timer-display.long-time { font-size: clamp(36px, 10vw, 160px); }
:root:fullscreen .main { padding-bottom: 80px; }
@media (min-width: 1600px) and (min-height: 900px) { .timer-stage { margin-top: 60px; } .settings { margin-top: 48px; } }
@media (max-width: 600px) {
  .header { padding: 15px 17px; }
  .brand { font-size: 18px; }
  .brand-mark { margin-right: 7px; width: 29px; height: 29px; }
  .utilities { gap: 0; }
  .utility-divider { margin: 0 2px; }
  .icon-button { width: 44px; }
  .main { padding: 25px 20px 30px; }
  .mode-control { width: min(100%, 370px); }
  .mode-control button { flex: 1; padding: 0 9px; gap: 6px; font-size: 13px; }
  .mode-control button small { font-size: 10px; margin-left: 3px; }
  .mode-control button svg { width: 17px; }
  .timer-stage { margin-top: 39px; }
  .timer-display { font-size: clamp(48px, 16.8vw, 90px); }
  .timer-display.long-time { font-size: clamp(32px, 12vw, 65px); }
  .settings { margin-top: 30px; }
  .settings-heading { font-size: 11px; }
  .shortcuts { gap: 14px; font-size: 11px; margin-bottom: 18px; }
  .presets { gap: 6px; }
  .presets button { flex-basis: 62px; }
  .footer { padding-bottom: 18px; }
}
@media (max-width: 350px) {
  .header { padding-inline: 12px; }
  .brand-mark { display: none; }
  .main { padding-inline: 16px; }
  .mode-control button small { display: block; margin: 2px 0 0; }
  .time-fields { gap: 11px; }
}
@media (max-height: 750px) and (min-width: 601px) {
  .header { padding-block: 15px; }
  .main { padding-top: 12px; padding-bottom: 20px; }
  .timer-stage { margin-top: 22px; }
  .eyebrow { margin-bottom: 7px; }
  .timer-display { font-size: clamp(70px, 10vw, 112px); }
  .actions { margin-top: 20px; }
  .settings { margin-top: 24px; padding-top: 16px; }
  .settings-heading { margin-bottom: 12px; }
  .shortcuts { margin-bottom: 15px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .header { padding: 8px 20px; }
  .main { padding: 8px 20px 20px; }
  .timer-stage { margin-top: 16px; }
  .eyebrow, .interaction-hint, .footer { display: none; }
  .timer-display { font-size: clamp(48px, 11vw, 90px); }
  .status { margin-top: 7px; }
  .actions { margin-top: 15px; }
  .settings { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
