.mode-switcher {
  width: min(100%, 360px);
  margin: 0 auto 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-alt);
}
.mode-button {
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-weight: 500;
}
.mode-button.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow);
}
.timer-stage {
  display: grid;
  justify-items: center;
  gap: 18px;
}
.timer-ring-wrap {
  position: relative;
  width: 260px;
  height: 260px;
}
.timer-ring-wrap.is-overrun-active {
  cursor: pointer;
}
.timer-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-track,
.ring-progress {
  fill: none;
  stroke-width: 14;
}
.ring-track { stroke: var(--ring-track); }
.ring-progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 703.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease, stroke 0.2s ease;
}
.timer-readout {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  overflow: hidden;
  text-align: center;
}
.time-display {
  width: 100%;
  max-width: 210px;
  font-family: var(--font-timer);
  font-size: 54px;
  line-height: 1;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.time-display.is-flowtime {
  font-size: 50px;
}
.time-display.is-flowtime-long {
  font-size: 42px;
}
.time-display.is-overrun {
  color: var(--accent);
  font-size: 50px;
}
.phase-label {
  margin-top: 12px;
  color: var(--text-2);
  font-weight: 500;
}
.session-counter {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 14px;
}
.session-dots {
  display: flex;
  gap: 10px;
}
.session-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: transparent;
}
.session-dots span.filled { background: var(--accent); }
.timer-controls {
  width: min(100%, 420px);
  margin: 28px auto 18px;
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 10px;
}
.control-button {
  border-radius: var(--radius);
  font-weight: 500;
}
.control-button.primary {
  background: var(--accent);
  color: var(--surface);
}
.control-button.secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
}
.task-field {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
}
.task-field input {
  width: 100%;
  padding: 0 14px;
  text-align: center;
}
.distraction-panel {
  width: min(100%, 520px);
  margin: 16px auto 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.distraction-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.distraction-heading h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
}
.distraction-heading p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 14px;
}
.distraction-heading strong {
  display: grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--accent);
  font-family: var(--font-timer);
}
.distraction-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.distraction-form input {
  width: 100%;
  padding: 0 12px;
}
.distraction-count {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  min-width: 132px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.distraction-count button {
  background: var(--surface-alt);
}
.distraction-count strong {
  display: grid;
  place-items: center;
  font-weight: 500;
}
.add-distraction-button {
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--surface);
  font-weight: 500;
}
.distraction-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.distraction-item {
  display: grid;
  grid-template-columns: 1fr auto 44px 44px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface-alt);
}
.distraction-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.distraction-item strong {
  color: var(--text-2);
  font-weight: 500;
}
.distraction-item button {
  width: 44px;
  border-radius: var(--radius);
  background: var(--surface);
}
.flow-break-adjuster {
  width: min(100%, 420px);
  margin: 20px auto 0;
  display: grid;
  grid-template-columns: 1fr 52px minmax(80px, auto) 52px;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}
.flow-break-adjuster button {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.flow-break-adjuster strong {
  color: var(--text-1);
  text-align: center;
}
@media (min-width: 768px) {
  .timer-ring-wrap {
    width: 320px;
    height: 320px;
  }
  .time-display {
    max-width: 250px;
    font-size: 64px;
  }
  .time-display.is-flowtime {
    font-size: 60px;
  }
  .time-display.is-flowtime-long {
    font-size: 50px;
  }
  .time-display.is-overrun {
    font-size: 58px;
  }
  .distraction-form {
    grid-template-columns: 1fr 132px 76px;
  }
}
