:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  --foreground: #eaf0e6;
  --background: #101311;
  color: var(--foreground);
  background: var(--background);
  font-synthesis: none;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100svh;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  --accent: #c3f58b;
}
header,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  flex-shrink: 0;
}
header {
  gap: 20px;
}
.brand {
  color: var(--accent);
  font-size: 30px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand span {
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 750;
}
.top {
  display: flex;
  gap: 8px;
}
button,
input,
select {
  font: inherit;
}
button {
  border: 1px solid #333a33;
  background: transparent;
  color: #c4ccc2;
  border-radius: 9px;
  padding: 11px 16px;
  cursor: pointer;
}
button:hover {
  background: #252e24;
  color: white;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  --main-gutter: 8px;
  min-height: 0;
  padding: 8px var(--main-gutter) 16px;
}
#status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: #bac5b6;
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 750;
  line-height: 1;
  letter-spacing: 1.5px;
}
body.running #status {
  color: var(--accent);
}
body.running #status::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 12px currentColor;
}
body.paused #status {
  color: #ffd085;
}
body.paused #status::before {
  content: "";
  width: 12px;
  height: 16px;
  border: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}
body:not(.running) #clock {
  opacity: 0.45;
}
body:not(.running) #progress {
  opacity: 0.35;
}
#clock-frame {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
}
#clock {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.065em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  padding-right: 0.065em;
}
#subtitle {
  color: #899487;
  font-size: 15px;
  letter-spacing: 0.3px;
}
.track {
  width: calc(100% + var(--main-gutter) + var(--main-gutter));
  height: 80px;
  flex-shrink: 0;
  background: #293127;
  margin: 16px 0;
  border-radius: 0;
  overflow: hidden;
}
#progress {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.12s linear;
}
.controls {
  display: flex;
  align-items: center;
  gap: 18px;
}
.controls > button:not(.primary) {
  border: 0;
  font-size: 14px;
}
.primary {
  background: var(--accent);
  color: #17210e;
  border: 0;
  font-weight: 650;
  padding: 16px 32px;
}
.primary:hover {
  background: #d6ffac;
  color: #17210e;
}
#milestones {
  margin-top: 12px;
  font-size: 12px;
  color: #697766;
  letter-spacing: 0.4px;
}
footer {
  padding: 12px 24px;
  color: #73816e;
  font-size: 10px;
  letter-spacing: 1.5px;
  gap: 20px;
}
footer div {
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}
kbd {
  border: 1px solid #354030;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 10px;
}
i {
  width: 12px;
}
.warning {
  --accent: #ffd085;
}
.overtime {
  --accent: #ff786a;
}
body.flash {
  animation: flash var(--flash-duration) ease-out;
}
@keyframes flash {
  0% {
    background: #b6cb9d;
    color: var(--background);
  }
  100% {
    background: var(--background);
  }
}
body.urgent.flash {
  animation-name: urgent-flash;
}
body.urgent.flash #clock {
  animation: clock-flash var(--flash-duration) ease-out;
}
@keyframes urgent-flash {
  0% {
    background: var(--flash-background);
  }
  100% {
    background: var(--background);
  }
}
@keyframes clock-flash {
  0% {
    color: var(--flash-clock);
    opacity: var(--flash-clock-opacity);
  }
  100% {
    color: var(--foreground);
    opacity: 1;
  }
}
dialog {
  background: #191e19;
  color: var(--foreground);
  border: 1px solid #3b4637;
  border-radius: 20px;
  width: min(680px, calc(100% - 28px));
  padding: 28px;
  max-height: 90svh;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(8px);
}
h1 {
  font-size: 25px;
  margin: 0;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-heading button {
  border: 0;
  font-size: 24px;
  padding: 0 8px;
}
dialog p {
  color: #91a08a;
  font-size: 13px;
  line-height: 1.6;
}
.settings-group {
  border: 0;
  min-width: 0;
  padding: 0;
  margin: 18px 0 0;
}
.settings-group legend {
  padding: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.settings-group > .setting-row:first-of-type {
  margin-top: 12px;
}
.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: start;
  gap: 24px;
  margin-top: 16px;
}
.setting-copy,
.setting-control {
  min-width: 0;
}
.setting-copy label {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 4px;
}
.setting-copy {
  padding-top: 4px;
}
input,
select {
  display: block;
  width: 100%;
  margin: 0;
  background: #101510;
  border: 1px solid #3b4637;
  padding: 10px;
  border-radius: 8px;
  color: #eef6e8;
}
small {
  display: block;
  font-size: 11px;
  color: #8c9986;
  line-height: 1.5;
}
.presets {
  display: flex;
  gap: 7px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.presets button {
  font-size: 12px;
  padding: 6px 8px;
}
.settings-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.settings-actions > button {
  padding: 14px 16px;
  font-size: 13px;
}
.hint {
  text-align: center;
  font-size: 11px !important;
}
#error {
  color: #ff9c90;
}
@media (max-width: 600px) {
  header,
  footer {
    padding: 12px 16px;
  }
  .top button {
    font-size: 11px;
    padding: 9px;
  }
  .brand span {
    display: none;
  }
  footer {
    flex-direction: column;
    font-size: 8px;
  }
  .controls {
    gap: 4px;
  }
  .controls button {
    padding: 12px;
  }
  .controls span {
    display: none;
  }
  #milestones {
    text-align: center;
    line-height: 1.8;
  }
  .primary {
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  dialog {
    padding: 18px;
  }
  .setting-row {
    grid-template-columns: minmax(0, 1fr) minmax(105px, 40%);
    gap: 14px;
    margin-top: 14px;
  }
  .presets {
    gap: 4px;
  }
  .presets button {
    padding: 5px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.flash,
  body.urgent.flash #clock {
    animation-duration: 0.15s;
  }
  #progress {
    transition: none;
  }
}

#preview-sound {
  width: 100%;
  margin: 8px 0 0;
  padding: 8px;
  font-size: 12px;
}

#scrub-hint {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
footer > div {
  flex-wrap: wrap;
  justify-content: center;
}

.range-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
input[type="range"] {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}
.range-control output {
  flex-shrink: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  padding: 0;
  margin-top: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.hint a {
  color: var(--accent);
  text-underline-offset: 3px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
