.aevoran-pomodoro {
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  color: var(--aev-text);
  border: none;
  box-shadow: none;
  text-align: center;
  container-type: inline-size;
}

.aevoran-pomodoro *,
.aevoran-pomodoro *::before,
.aevoran-pomodoro *::after {
  box-sizing: border-box;
}

.aevoran-pomodoro.is-flashing {
  animation: aevoran-pomodoro-flash 0.35s ease 3;
}

@keyframes aevoran-pomodoro-flash {
  0%,
  100% {
    background-color: var(--aev-bg);
  }
  50% {
    background-color: var(--aev-accent-soft);
  }
}

.aevoran-pomodoro__presets {
  display: flex;
  flex-wrap: nowrap;
  justify-content: safe center;
  gap: clamp(0.2rem, 1.2cqi, 0.5rem);
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.aevoran-pomodoro__preset {
  appearance: none;
  flex: 1 0 auto;
  white-space: nowrap;
  min-height: 44px;
  padding: 0.4rem clamp(0.22rem, 1.6cqi, 0.7rem);
  border: 1px solid var(--aev-border);
  border-radius: 999px;
  background: transparent;
  color: var(--aev-text-secondary);
  font: inherit;
  font-size: clamp(0.68rem, 3.2cqi, 0.8125rem);
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}

.aevoran-pomodoro__preset:hover:not(:disabled) {
  border-color: var(--aev-accent);
  color: var(--aev-text);
}

.aevoran-pomodoro__preset.is-active {
  border-color: var(--aev-accent);
  background: var(--aev-accent);
  color: #fff;
}

.aevoran-pomodoro__preset:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.aevoran-pomodoro__preset:focus-visible,
.aevoran-pomodoro__btn:focus-visible {
  outline: 2px solid var(--aev-accent);
  outline-offset: 2px;
}

.aevoran-pomodoro__ring-wrap {
  position: relative;
  width: 220px;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 0 auto 1rem;
}

.aevoran-pomodoro__ring {
  display: block;
  width: 100%;
  height: 100%;
}

.aevoran-pomodoro__ring-track,
.aevoran-pomodoro__ring-progress {
  fill: none;
  stroke-width: 6;
}

.aevoran-pomodoro__ring-track {
  stroke: var(--aev-border);
}

.aevoran-pomodoro__ring-progress {
  stroke: var(--aev-accent);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s linear;
}

.aevoran-pomodoro.is-snapping .aevoran-pomodoro__ring-progress {
  transition: none;
}

.aevoran-pomodoro__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}

.aevoran-pomodoro__time {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--aev-text);
  font-variant-numeric: tabular-nums;
}

.aevoran-pomodoro__phase {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: var(--aev-text-secondary);
}

.aevoran-pomodoro__sessions {
  margin-bottom: 0.75rem;
}

.aevoran-pomodoro__dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.aevoran-pomodoro__dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 1px solid var(--aev-border);
  background: transparent;
}

.aevoran-pomodoro__dot.is-filled {
  border-color: var(--aev-accent);
  background: var(--aev-accent);
}

.aevoran-pomodoro__session-label {
  margin: 0;
  font-size: 0.875rem;
  color: var(--aev-text-secondary);
}

.aevoran-pomodoro__notice {
  min-height: 1.35em;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--aev-text);
}

.aevoran-pomodoro__notice:empty {
  margin-bottom: 0.5rem;
}

.aevoran-pomodoro__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.aevoran-pomodoro__btn {
  appearance: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
}

.aevoran-pomodoro__btn--primary {
  flex: 1 1 100%;
  min-height: 52px;
  border: 1px solid var(--aev-accent);
  background: var(--aev-accent);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}

.aevoran-pomodoro__btn--primary:hover {
  filter: brightness(0.96);
}

.aevoran-pomodoro__btn--secondary {
  flex: 1 1 100%;
  border: 1px solid var(--aev-border);
  background: transparent;
  color: var(--aev-text-secondary);
}

.aevoran-pomodoro__btn--secondary:hover {
  color: var(--aev-text);
  border-color: var(--aev-text-secondary);
}

@media (min-width: 600px) {
  .aevoran-pomodoro__ring-wrap {
    width: 260px;
  }

  .aevoran-pomodoro__time {
    font-size: 2.35rem;
  }

  .aevoran-pomodoro__btn--secondary {
    flex: 1 1 calc(50% - 0.25rem);
  }
}

@media (min-width: 960px) {
  .aevoran-pomodoro__ring-wrap {
    width: 300px;
  }

  .aevoran-pomodoro__time {
    font-size: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aevoran-pomodoro.is-flashing {
    animation: none;
    background-color: var(--aev-accent-soft);
  }

  .aevoran-pomodoro__ring-progress {
    transition: none;
  }
}
