body.timer-focus {
  background: #173F3A;
  color: #F4F7F5;
}
body.timer-focus :is(.app-footer, #install-card, #mobile-primary-navigation, #preferences-heading),
body.timer-focus #app-shell > :is(.topbar, .global-save-row) {
  display: none;
}
#app-shell:has(> #screen-pomodoro.active) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
body.timer-focus #app-shell {
  padding-block: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-bottom));
}
#screen-pomodoro {
  --pomodoro-accent: var(--teal);
  --pomodoro-surface: #F4F8F5;
  --pomodoro-track: #DDE6E0;
  --pomodoro-remaining: 1;
}
#screen-pomodoro.active {
  flex: 1;
  display: flex;
  flex-direction: column;
}
body.timer-focus #screen-pomodoro {
  --pomodoro-accent: #AEDDD0;
  --pomodoro-surface: #214C46;
  --pomodoro-track: #47726B;
}
body.timer-focus #screen-pomodoro[data-pomodoro-phase="short"] { --pomodoro-accent: #B7D9F0; }
body.timer-focus #screen-pomodoro[data-pomodoro-phase="long"] { --pomodoro-accent: #F0D5AE; }

.pomodoro-timer {
  display: grid;
  justify-items: center;
  gap: clamp(14px, 2.8vh, 24px);
  padding: clamp(12px, 3vh, 28px) 0 16px;
}
body.timer-focus .pomodoro-timer {
  flex: 1;
  align-content: center;
  gap: clamp(27px, 4vh, 38px);
  padding-top: max(24px, 3vh);
}
#pomodoro-sound-slot { margin-top: auto; }
.pomodoro-dial {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  width: min(calc(100% - 44px), clamp(205px, 37vh, 350px));
  aspect-ratio: 1;
  text-align: center;
  isolation: isolate;
}
.pomodoro-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}
.pomodoro-ring-track {
  fill: var(--pomodoro-surface);
  stroke: var(--pomodoro-track);
  stroke-width: 3;
}
.pomodoro-ring-progress {
  stroke: var(--pomodoro-accent);
  stroke-width: 3;
  stroke-dasharray: calc(var(--pomodoro-remaining) * 100) 100;
}
.pomodoro-spiral,
.pomodoro-orbit {
  display: none;
  stroke: var(--pomodoro-accent);
  stroke-width: 2.4;
  opacity: .65;
}
.pomodoro-spiral {
  /* The last 23.42 of the 100 normalized units follow the outer orbit. */
  --pomodoro-spiral-arc: 23.42px;
  stroke-dasharray: var(--pomodoro-spiral-arc) 100px;
}
.pomodoro-orbit {
  visibility: hidden;
  /* Each arc and its following gap take up half of the circumference. */
  stroke-dasharray: 17 33;
  transform-box: view-box;
  transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
  body.timer-focus { transition: background-color 420ms cubic-bezier(.22, 1, .36, 1); }
  body.timer-focus #screen-pomodoro {
    --pomodoro-spiral-time: 1500ms;
    --pomodoro-spiral-easing: cubic-bezier(.32, .15, .25, .94);
  }
  body.timer-focus .pomodoro-spiral {
    display: inline;
    animation: pomodoro-spiral-entry var(--pomodoro-spiral-time) var(--pomodoro-spiral-easing) both;
  }
  body.timer-focus .pomodoro-orbit {
    display: inline;
    animation: pomodoro-orbit 18s linear var(--pomodoro-spiral-time) infinite;
  }
  body.timer-focus #pomodoro-clock {
    animation: pomodoro-clock-reveal var(--pomodoro-spiral-time) var(--pomodoro-spiral-easing) both;
  }
}
@keyframes pomodoro-spiral-entry {
  from { opacity: 0; stroke-dashoffset: var(--pomodoro-spiral-arc); }
  22% { opacity: .65; }
  to { visibility: hidden; stroke-dashoffset: calc(var(--pomodoro-spiral-arc) - 100px); }
}
@keyframes pomodoro-orbit {
  from { visibility: visible; transform: rotate(0turn); }
  to { visibility: visible; transform: rotate(1turn); }
}
@keyframes pomodoro-clock-reveal {
  from { clip-path: circle(0% at 50% 68%); }
  to { clip-path: circle(86% at 50% 68%); }
}
#pomodoro-clock {
  font-size: clamp(2.75rem, 8vw, 5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: 1;
}
.pomodoro-phase-status { display: grid; gap: 3px; margin-top: 10px; }
#screen-pomodoro[data-pomodoro-ready] #pomodoro-clock { display: none; }
#screen-pomodoro[data-pomodoro-ready] .pomodoro-phase-status { margin-top: 0; }
#pomodoro-phase { color: var(--pomodoro-accent); font-weight: 650; }
#pomodoro-round { font-size: var(--ui-type-meta); }
.pomodoro-actions { display: grid; justify-items: center; gap: 4px; }
#pomodoro-toggle { min-width: 140px; min-height: 48px; }
body.timer-focus #app-shell #pomodoro-toggle {
  background: #C6DBCF;
  border-color: #C6DBCF;
  color: #173F3A;
}
#pomodoro-reset { min-height: 44px; }
.pomodoro-settings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 22px;
  width: min(100%, 760px);
  margin-inline: auto;
  padding: 16px;
}
.pomodoro-setting { display: grid; grid-template-rows: 1fr auto; gap: 6px; min-width: 0; text-align: center; }
.pomodoro-setting > label { align-self: center; }
#screen-pomodoro .pomodoro-setting input {
  min-height: 44px;
  min-width: 0;
  width: 100%;
  margin: 0;
  text-align: center;
}
body:not(.timer-focus) #screen-pomodoro .study-sound {
  border-color: var(--line);
  color: var(--ink);
}
body:not(.timer-focus) #screen-pomodoro :is([data-sound-status], [data-sound-headphones]) {
  color: var(--muted);
}
body:not(.timer-focus) #screen-pomodoro .study-sound-icon { stroke: var(--teal); }
body:not(.timer-focus) #screen-pomodoro .study-sound :is(select, option, .btn-outline) {
  background: var(--paper);
  border-color: var(--control-line);
  color: var(--ink);
}
body:not(.timer-focus) #screen-pomodoro .study-sound :is(select, input, button):focus-visible {
  outline-color: var(--teal);
}
@media (max-width: 720px) {
  .pomodoro-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .pomodoro-settings { gap: 12px; padding: 12px; }
}
