* {
  box-sizing: border-box;
}

body {
  --background: #17211f;
  --surface: #263631;
  --field: #1c2925;
  --text: #f5f2e9;
  --muted: #aebfb2;
  --accent: #c8dfa8;
  --accent-text: #17211f;
  --border: #61766c;

  min-height: 100vh;
  margin: 0;
  padding: 24px;
  background: var(--background);
  color: var(--text);
  font-family: Arial, sans-serif;
}

body.day {
  --background: #f0eee5;
  --surface: #fffaf0;
  --field: #ffffff;
  --text: #24332d;
  --muted: #5e7064;
  --accent: #44654d;
  --accent-text: #ffffff;
  --border: #a4b2a5;
}

body.sky {
  --background: #7eb6ff;
  --surface: #263631;
  --field: #1c2f40;
  --text: #ffffff;
  --muted: #8dc4ff;
  --accent: #61a5ff;
  --accent-text: #112638;
  --border: #61766c;

  background-image:
    linear-gradient(rgba(12, 30, 49, 0.65), rgba(12, 30, 49, 0.65)),
    url("./images/sky.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.winter {
  --background: #7eb6ff;
  --surface: #263b53;
  --field: #1c2f40;
  --text: #ffffff;
  --muted: #8dc4ff;
  --accent: #61a5ff;
  --accent-text: #112638;
  --border: #61766c;

  background-image:
    linear-gradient(rgba(12, 30, 49, 0.65), rgba(12, 30, 49, 0.65)),
    url("./images/winter.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

button:hover {
  filter: brightness(1.12);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.app {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 30px 0 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--accent);
  font-size: 19px;
  font-weight: bold;
  letter-spacing: -1px;
}

.theme-button {
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.intro {
  margin: 76px 0 38px;
}

h1 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(52px, 10vw, 82px);
  font-weight: normal;
  letter-spacing: -3px;
  line-height: 1.05;
}

h1 em {
  color: var(--accent);
  font-weight: normal;
}

.intro p {
  margin-top: 20px;
  color: var(--muted);
}

.timer-card {
  padding: 36px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

.mode-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.mode-controls button {
  padding: 10px 17px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.mode-controls button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.mode-label {
  margin: 45px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 3px;
}

#timer {
  margin: 8px 0 35px;
  font-family: Georgia, serif;
  font-size: clamp(70px, 15vw, 108px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -4px;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.timer-controls button {
  min-width: 100px;
  padding: 13px 20px;
}

#reset-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.checklist {
  margin-top: 40px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.checklist-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.checklist h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: normal;
}

#step-progress {
  color: var(--muted);
  font-size: 13px;
}

#step-form {
  display: flex;
  gap: 9px;
  margin-top: 22px;
}

#step-input {
  flex: 1;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--field);
  color: var(--text);
}

#step-input::placeholder {
  color: var(--muted);
}

#step-form button {
  padding: 0 20px;
}

#step-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.step-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--field);
}

.step-item:hover {
  border-color: var(--accent);
}

.step-item label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
}

.step-item input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 2px solid var(--border);
  border-radius: 3px;
  background: var(--field);
  cursor: pointer;
}

.step-item input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.step-text {
  overflow-wrap: anywhere;
}

.step-item.done {
  opacity: 0.72;
}

.step-item.done .step-text {
  text-decoration: line-through;
}

.remove-step {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.empty-state {
  padding: 15px 0;
  color: var(--muted);
  font-size: 14px;
}

#session-count {
  margin-top: 32px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

#alarm-dialog {
  width: min(90%, 370px);
  padding: 35px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: center;
}

#alarm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.alarm-icon {
  color: var(--accent);
  font-size: 38px;
}

#alarm-dialog h2 {
  margin: 15px 0 8px;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: normal;
}

#alarm-dialog p {
  color: var(--muted);
}

#dismiss-alarm {
  margin-top: 12px;
  padding: 12px 22px;
}

.site-footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 480px) {
  body {
    padding: 18px;
  }

  .app {
    padding-top: 12px;
  }

  .intro {
    margin-top: 58px;
  }

  .timer-card {
    padding: 30px 16px;
  }

  .mode-label {
    margin-top: 35px;
  }

  .checklist {
    padding: 20px 16px;
  }
}