[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.volia-timer {
  margin: 42px 0 64px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

.volia-timer-full {
  width: min(calc(100vw - 40px), 1040px);
  margin: 48px 0 76px 50%;
  transform: translateX(-50%);
}

.timer-setup {
  display: grid;
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) 0;
  grid-template-columns: 1fr;
  gap: 24px;
}

.timer-heading h2,
.timer-heading h3,
.timer-restore h2,
.timer-restore h3,
.timer-complete h2,
.timer-complete h3,
.timer-session h2,
.timer-session h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 760;
  letter-spacing: -.025em;
  line-height: 1.12;
}

.timer-heading p { margin: 0; color: var(--ink-soft); font-family: var(--sans); font-size: 15px; }
.timer-form { min-width: 0; }
.timer-form fieldset { min-width: 0; margin: 0 0 26px; padding: 0; border: 0; }
.timer-form legend {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.duration-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 8px;
}

.volia-timer button,
.volia-timer select,
.volia-timer input {
  font: inherit;
}

.volia-timer button {
  min-height: 46px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 720;
  transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease);
}

.volia-timer button:hover { border-color: var(--blue); color: var(--blue-deep); }
.volia-timer button:active { background: var(--selection); }
.volia-timer button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: var(--on-blue); }
.volia-timer button:disabled { cursor: default; opacity: .5; }
.volia-timer input:focus-visible,
.volia-timer select:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.timer-options { display: flex; flex-wrap: wrap; gap: 8px; }
.timer-options label { position: relative; cursor: pointer; }
.timer-options input { position: absolute; opacity: 0; pointer-events: none; }
.timer-options span {
  display: flex;
  min-height: 44px;
  padding: 8px 13px;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 680;
}
.timer-options input:checked + span { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--yellow); color: var(--ink); }
.timer-options input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 3px; }

.timer-start-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.volia-timer .timer-primary { border-color: var(--blue); background: var(--blue); color: var(--on-blue); }
.volia-timer .timer-primary:hover { border-color: var(--blue-deep); background: var(--blue-deep); color: var(--on-blue); }
.timer-full-link { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; font-weight: 720; }
.timer-error { margin: -8px 0 18px; color: #a22b28; font-size: 14px; font-weight: 650; }
:root[data-theme="dark"] .timer-error { color: #ffaaa5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .timer-error { color: #ffaaa5; } }
.timer-noscript { margin: 18px 0 0; color: var(--ink-soft); font-size: 14px; }
.volia-timer[aria-busy="true"] .timer-form { opacity: .72; }

.timer-restore,
.timer-complete {
  max-width: 680px;
  padding: clamp(32px, 6vw, 64px) 0;
}
.timer-restore p,
.timer-complete p { margin: 0 0 24px; color: var(--ink-soft); font-family: var(--sans); }
.timer-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.timer-session {
  min-height: 480px;
  padding: 28px 0;
}

.timer-session-center {
  display: grid;
  min-height: 390px;
  padding: 32px 0 28px;
  place-items: center;
  align-content: center;
  text-align: center;
}
.timer-session .timer-session-center h2,
.timer-session .timer-session-center h3 { margin-bottom: 18px; font-size: clamp(30px, 5vw, 54px); }
.timer-time {
  display: block;
  min-width: 5ch;
  color: var(--ink);
  font-size: clamp(64px, 12vw, 96px);
  font-variant-numeric: tabular-nums;
  font-weight: 690;
  letter-spacing: -.04em;
  line-height: 1;
}
.timer-guidance { max-width: 38ch; margin: 24px auto 0; color: var(--ink-soft); font-family: var(--serif); font-size: clamp(18px, 2vw, 22px); }
.timer-session-actions { display: flex; flex-wrap: wrap; max-width: 720px; margin: 0 auto; justify-content: center; gap: 8px; }

.timer-complete-mark {
  display: block;
  width: 74px;
  height: 18px;
  margin-bottom: 28px;
  background: var(--yellow);
}

body.timer-is-running { overflow: hidden; }
body.timer-is-running .volia-timer.is-active {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: auto;
  min-height: 100dvh;
  margin: 0;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: auto;
  border: 0;
  background: var(--paper);
  transform: none;
}
body.timer-is-running .volia-timer.is-active .timer-session {
  display: grid;
  min-height: calc(100dvh - max(48px, env(safe-area-inset-top) + env(safe-area-inset-bottom)));
  padding: 0;
  grid-template-rows: 1fr auto;
}

@media (max-width: 760px) {
  .volia-timer-full { width: calc(100vw - 28px); }
  .duration-presets { grid-template-columns: repeat(4, 1fr); }
  .timer-session-center { min-height: 300px; padding-top: 34px; }
  .timer-session-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .timer-session-actions button { width: 100%; }
}

@media (max-width: 410px) {
  .duration-presets { grid-template-columns: repeat(2, 1fr); }
  .timer-options { display: grid; grid-template-columns: 1fr; }
  .timer-options span { width: 100%; }
  .timer-start-row { display: grid; }
  .timer-primary, .timer-full-link { width: 100%; justify-content: center; }
  .timer-time { font-size: clamp(58px, 24vw, 82px); }
}

@media (prefers-reduced-motion: reduce) {
  .volia-timer button { transition: none; }
}

@media print {
  .volia-timer { display: none; }
}
