*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #121216;
  --surface: #1c1c24;
  --text: #f0f0f5;
  --text-muted: #8b8b9a;
  --accent-focus: #e85d4c;
  --accent-short: #4caf82;
  --accent-long: #5b8def;
  --accent: var(--accent-focus);
  --ring-bg: #2a2a36;
  --radius: 16px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

[data-mode="focus"] {
  --accent: var(--accent-focus);
}

[data-mode="shortBreak"] {
  --accent: var(--accent-short);
}

[data-mode="longBreak"] {
  --accent: var(--accent-long);
}

.app[data-minimal="true"] .time {
  display: none;
}

.app[data-minimal="true"] .timer-display {
  grid-template-rows: 1fr;
  place-content: center;
  gap: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent);
  transition: background-image 0.6s ease;
}

body[data-bg="dusk"] {
  background-image:
    radial-gradient(ellipse 75% 58% at 50% -20%, rgba(194, 131, 255, 0.28), transparent),
    linear-gradient(180deg, #161326 0%, #0f0f17 100%);
}

body[data-bg="forest"] {
  background-image:
    radial-gradient(ellipse 78% 60% at 50% -20%, rgba(93, 196, 129, 0.25), transparent),
    linear-gradient(180deg, #112019 0%, #0e1412 100%);
}

body[data-bg="ocean"] {
  background-image:
    radial-gradient(ellipse 78% 60% at 50% -20%, rgba(104, 171, 255, 0.28), transparent),
    linear-gradient(180deg, #101d2f 0%, #0d1118 100%);
}

.app {
  width: min(420px, 100vw - 2rem);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
  transition: width 0.25s ease;
}

.app[data-ui-hidden="true"] {
  width: 100%;
  min-height: 100dvh;
  justify-content: center;
  gap: 0;
}

.app[data-ui-hidden="true"] .main {
  flex: 1;
  justify-content: center;
  gap: 0;
}

.ui-chrome {
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.app[data-ui-hidden="true"] .ui-chrome {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.header {
  width: 100%;
  text-align: center;
}

.logo {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.mode-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  background: var(--surface);
  padding: 0.35rem;
  border-radius: 999px;
}

.mode-tab {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-tab:hover {
  color: var(--text);
}

.mode-tab.active {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
  color: var(--accent);
}

.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  width: 100%;
}

.timer-ring {
  width: 220px;
  height: 220px;
  position: relative;
}

.timer-ring > .ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--ring-bg);
  stroke-width: 6;
}

.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke 0.4s ease, stroke-dashoffset 0.3s linear;
}

.timer-ring:not([data-effect="ring"]) > .ring-svg {
  display: none;
}

.timer-display > svg,
.timer-display > .prayer-wheel-scene {
  display: none;
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  justify-self: center;
  flex-shrink: 0;
}

.timer-ring[data-effect="hourglass"] .hourglass,
.timer-ring[data-effect="incense"] .incense,
.timer-ring[data-effect="clepsydra"] .clepsydra,
.timer-ring[data-effect="gaiwan"] .gaiwan,
.timer-ring[data-effect="candle"] .candle,
.timer-ring[data-effect="sundial"] .sundial,
.timer-ring[data-effect="prayerwheel"] .prayer-wheel-scene,
.timer-ring[data-effect="woodfish"] .woodfish {
  display: block;
}

.timer-ring[data-effect="ring"] .time {
  font-size: 2.75rem;
}

.timer-ring[data-effect="hourglass"],
.timer-ring[data-effect="incense"],
.timer-ring[data-effect="clepsydra"],
.timer-ring[data-effect="gaiwan"],
.timer-ring[data-effect="candle"],
.timer-ring[data-effect="sundial"],
.timer-ring[data-effect="prayerwheel"],
.timer-ring[data-effect="woodfish"] {
  width: 280px;
  height: 280px;
}

.timer-ring[data-effect="hourglass"] .time,
.timer-ring[data-effect="incense"] .time,
.timer-ring[data-effect="clepsydra"] .time,
.timer-ring[data-effect="gaiwan"] .time,
.timer-ring[data-effect="candle"] .time,
.timer-ring[data-effect="sundial"] .time,
.timer-ring[data-effect="prayerwheel"] .time,
.timer-ring[data-effect="woodfish"] .time {
  font-size: 2rem;
}

.timer-ring[data-effect="hourglass"] .hourglass {
  width: 120px;
  height: 180px;
}

.timer-ring[data-effect="incense"] .incense {
  width: 96px;
  height: 168px;
}

.timer-ring[data-effect="clepsydra"] .clepsydra {
  width: 112px;
  height: 180px;
}

.timer-ring[data-effect="gaiwan"] .gaiwan {
  width: 108px;
  height: 168px;
}

.timer-ring[data-effect="candle"] .candle {
  width: 88px;
  height: 168px;
}

.timer-ring[data-effect="sundial"] .sundial {
  width: 148px;
  height: 148px;
}

.timer-ring[data-effect="prayerwheel"] .prayer-wheel-scene {
  width: 112px;
  height: 172px;
}

.timer-ring[data-effect="woodfish"] .woodfish {
  width: 140px;
  height: 84px;
}

.timer-display {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 180px auto;
  align-content: center;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
  pointer-events: none;
}

.timer-ring[data-effect="ring"] .timer-display {
  grid-template-rows: auto;
  place-content: center;
}

.timer-ring[data-effect="ring"] .time {
  grid-row: 1;
  grid-column: 1;
}

.timer-display > .time {
  grid-row: 2;
  grid-column: 1;
  align-self: start;
}

.hourglass {
  width: 48px;
  height: 72px;
  flex-shrink: 0;
  transform-origin: 50% 50%;
}

.hourglass.is-flipping .sand-flow {
  visibility: hidden !important;
}

.hourglass.is-flipping {
  animation: hourglass-flip 0.65s cubic-bezier(0.45, 0.05, 0.2, 1);
}

.hg-frame {
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0.45;
}

.sand-top,
.sand-bottom {
  fill: var(--accent);
  opacity: 0.92;
}

.sand-flow {
  visibility: hidden;
  pointer-events: none;
}

.sand-stream {
  stroke: var(--accent);
  stroke-width: 0.8;
  stroke-linecap: round;
  opacity: 0;
}

.sand-grain {
  fill: var(--accent);
  opacity: 0;
}

.hourglass.running .sand-stream {
  opacity: 0.75;
  stroke-dasharray: 2 3;
  animation: sand-stream-flow 0.35s linear infinite;
}

@keyframes sand-stream-flow {
  to {
    stroke-dashoffset: -10;
  }
}

@keyframes hourglass-flip {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.incense {
  width: 56px;
  height: 98px;
  flex-shrink: 0;
  overflow: visible;
}

.incense-shadow {
  fill: color-mix(in srgb, #000 35%, transparent);
  opacity: 0.35;
}

.incense-holder {
  fill: #3a3a44;
  stroke: #55556a;
  stroke-width: 0.6;
}

.incense-ash {
  fill: #5a5048;
  opacity: 0.75;
}

.incense-stick {
  filter: drop-shadow(0 0 1px color-mix(in srgb, #000 25%, transparent));
}

.incense-ember {
  transition: cy 0.3s linear, opacity 0.2s ease;
}

.incense-smoke {
  opacity: 0;
  pointer-events: none;
}

.incense.running .incense-smoke {
  opacity: 1;
}

.smoke-wisp {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.smoke-wisp path {
  fill: none;
  stroke: color-mix(in srgb, var(--text-muted) 55%, transparent);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.incense.running .incense-ember {
  animation: incense-ember-pulse 1.4s ease-in-out infinite;
}

@keyframes incense-ember-pulse {
  0%,
  100% {
    opacity: 0.82;
  }
  50% {
    opacity: 1;
  }
}

.incense.running .smoke-wisp-1 {
  animation: incense-smoke 3.2s ease-in-out infinite;
}

.incense.running .smoke-wisp-2 {
  animation: incense-smoke 3.8s ease-in-out 0.8s infinite;
}

.incense.running .smoke-wisp-3 {
  animation: incense-smoke 4.4s ease-in-out 1.5s infinite;
}

@keyframes incense-smoke {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  20% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: translateY(-14px) translateX(3px);
  }
}

.clepsydra {
  width: 72px;
  height: 116px;
  flex-shrink: 0;
  overflow: visible;
}

.clepsydra-stand {
  fill: #3a3530;
  stroke: #524a42;
  stroke-width: 0.5;
}

.clepsydra-jar {
  fill: url(#clepsydra-vessel);
  stroke: #3d3024;
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.clepsydra-spout {
  fill: #5a4838;
  stroke: #3d3024;
  stroke-width: 0.5;
}

.clepsydra-upper-water,
.clepsydra-lower-water {
  transition: y 0.3s linear, height 0.3s linear;
}

.clepsydra-mark {
  stroke: color-mix(in srgb, var(--text-muted) 45%, transparent);
  stroke-width: 0.9;
  stroke-linecap: round;
  transition: stroke 0.25s ease;
}

.clepsydra-mark.filled {
  stroke: var(--accent);
  stroke-width: 1.1;
}

.clepsydra-flow {
  visibility: hidden;
  pointer-events: none;
}

.clepsydra-stream {
  stroke: #6ec4e8;
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.65;
}

.clepsydra-drop {
  fill: #7ec8e8;
  opacity: 0;
}

.clepsydra.running .clepsydra-flow {
  visibility: visible;
}

.clepsydra.running .clepsydra-stream {
  stroke-dasharray: 2 3;
  animation: clepsydra-stream-flow 0.4s linear infinite;
}

@keyframes clepsydra-stream-flow {
  to {
    stroke-dashoffset: -10;
  }
}

.gaiwan {
  width: 68px;
  height: 106px;
  flex-shrink: 0;
  overflow: visible;
}

.gaiwan-shadow {
  fill: color-mix(in srgb, #000 30%, transparent);
  opacity: 0.35;
}

.gaiwan-saucer,
.gaiwan-bowl,
.gaiwan-lid,
.gaiwan-lid-knob {
  fill: url(#gaiwan-porcelain);
  stroke: #c8bfb0;
  stroke-width: 0.7;
  stroke-linejoin: round;
}

.gaiwan-rim {
  fill: none;
  stroke: color-mix(in srgb, #fff 50%, #c8bfb0);
  stroke-width: 1;
  stroke-linecap: round;
}

.gaiwan-lid-knob {
  stroke-width: 0.5;
}

.gaiwan-tea,
.gaiwan-tea-surface {
  transition: y 0.3s linear, height 0.3s linear, fill 0.4s ease;
}

.gaiwan-steam {
  opacity: 0;
  pointer-events: none;
}

.gaiwan.running .gaiwan-steam {
  opacity: 1;
}

.tea-wisp {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center bottom;
}

.tea-wisp path {
  fill: none;
  stroke: color-mix(in srgb, #fff 35%, transparent);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.gaiwan.running .tea-wisp-1 {
  animation: gaiwan-steam 3.6s ease-in-out infinite;
}

.gaiwan.running .tea-wisp-2 {
  animation: gaiwan-steam 4.2s ease-in-out 0.7s infinite;
}

.gaiwan.running .tea-wisp-3 {
  animation: gaiwan-steam 4.8s ease-in-out 1.4s infinite;
}

@keyframes gaiwan-steam {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  25% {
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: translateY(-12px) translateX(2px);
  }
}

.candle {
  width: 56px;
  height: 108px;
  flex-shrink: 0;
  overflow: visible;
}

.candle-shadow {
  fill: color-mix(in srgb, #000 32%, transparent);
  opacity: 0.35;
}

.candle-dish {
  fill: #4a4540;
  stroke: #6a645c;
  stroke-width: 0.6;
}

.candle-body {
  filter: drop-shadow(0 0 1px color-mix(in srgb, #000 15%, transparent));
}

.candle-drip {
  fill: #f0e4d0;
  opacity: 0;
  transform-origin: 31px 52px;
  transition: opacity 0.3s ease;
}

.candle-wick {
  stroke: #2a2420;
  stroke-width: 0.9;
  stroke-linecap: round;
}

.candle-flame-group {
  transition: transform 0.3s linear;
}

.candle.running .candle-flame {
  animation: candle-flicker 1.1s ease-in-out infinite;
}

@keyframes candle-flicker {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  35% {
    transform: scale(1.06, 1.1);
    opacity: 1;
  }
  70% {
    transform: scale(0.96, 0.98);
    opacity: 0.88;
  }
}

.sundial {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  overflow: visible;
}

.sundial-pedestal-shadow {
  fill: color-mix(in srgb, #000 30%, transparent);
  opacity: 0.35;
}

.sundial-pedestal {
  fill: #4a5058;
  stroke: #3a4048;
  stroke-width: 0.6;
}

.sundial-face {
  stroke: #2e343c;
  stroke-width: 1.2;
}

.sundial-tick {
  stroke: color-mix(in srgb, #fff 28%, #8a9098);
  stroke-width: 1.2;
  stroke-linecap: round;
  transition: stroke 0.25s ease;
}

.sundial-tick.passed {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.sundial-shadow-wrap {
  transition: transform 0.3s linear;
}

.sundial-shadow {
  stroke: color-mix(in srgb, #000 55%, transparent);
  stroke-width: 3.5;
  stroke-linecap: round;
  opacity: 0.55;
}

.sundial-gnomon {
  fill: #2a3038;
  stroke: #1a1e24;
  stroke-width: 0.5;
}

.sundial-center {
  fill: #1a1e24;
}

.sundial.running .sundial-face {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 18%, transparent));
}

.prayer-wheel-scene {
  position: relative;
  width: 100px;
  height: 154px;
  flex-shrink: 0;
}

.prayer-wheel-scene.running {
  filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--accent) 12%, transparent));
}

.pw-three-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.woodfish {
  width: 128px;
  height: 76px;
  flex-shrink: 0;
  overflow: visible;
}

.wf-shadow {
  fill: color-mix(in srgb, #000 28%, transparent);
  opacity: 0.4;
}

.wf-body {
  filter: drop-shadow(0 2px 4px color-mix(in srgb, #000 18%, transparent));
}

.wf-grain-line {
  fill: none;
  stroke: color-mix(in srgb, #000 18%, #c87840);
  stroke-width: 0.6;
  stroke-linecap: round;
  opacity: 0.35;
}

.wf-slit-inner {
  opacity: 0.9;
}

.wf-scale {
  fill: color-mix(in srgb, #000 25%, #a85828);
  opacity: 0.55;
  transition: fill 0.3s ease, opacity 0.3s ease;
}

.wf-scale.lit {
  fill: var(--accent);
  opacity: 0.95;
}

.wf-mallet-handle {
  stroke: #b87838;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.wf-mallet-head {
  fill: url(#wf-body-gradient);
  stroke: #8a5020;
  stroke-width: 0.7;
  filter: drop-shadow(0 1px 1px color-mix(in srgb, #000 20%, transparent));
}

.wf-impact {
  fill: color-mix(in srgb, #fff 50%, var(--accent));
  opacity: 0;
}

.wf-ripple {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 70%, #e8a868);
  stroke-width: 1.2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.woodfish.running .wf-mallet {
  animation: wf-mallet-strike 0.9s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  transform-origin: 104px 6px;
}

.woodfish.running .wf-body-group {
  animation: woodfish-knock 0.9s cubic-bezier(0.45, 0, 0.25, 1) infinite;
  transform-origin: 42px 38px;
}

.woodfish.running .wf-impact {
  animation: woodfish-impact 0.9s ease-out infinite;
}

.woodfish.running .wf-ripple-1 {
  animation: woodfish-ripple 0.9s ease-out infinite;
}

.woodfish.running .wf-ripple-2 {
  animation: woodfish-ripple 0.9s ease-out 0.06s infinite;
}

@keyframes wf-mallet-strike {
  0%,
  52%,
  100% {
    transform: rotate(0deg);
  }
  64% {
    transform: rotate(24deg);
  }
  70% {
    transform: rotate(28deg);
  }
  78% {
    transform: rotate(10deg);
  }
}

@keyframes woodfish-knock {
  0%,
  52%,
  100% {
    transform: translateY(0) scale(1);
  }
  64% {
    transform: translateY(1.5px) scale(0.97);
  }
  70% {
    transform: translateY(2px) scale(0.955);
  }
  78% {
    transform: translateY(-0.5px) scale(1.015);
  }
}

@keyframes woodfish-impact {
  0%,
  65%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
  72% {
    opacity: 0.75;
    transform: scale(1.1);
  }
  80% {
    opacity: 0;
    transform: scale(1.6);
  }
}

@keyframes woodfish-ripple {
  0%,
  65%,
  100% {
    opacity: 0;
    transform: scale(1);
  }
  72% {
    opacity: 0.65;
    transform: scale(1.2);
  }
  100% {
    opacity: 0;
    transform: scale(3);
  }
}

.time {
  display: block;
  font-size: 2.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, background 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  min-width: 120px;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
}

.btn-ghost:hover {
  color: var(--text);
  background: #252530;
}

.pomodoro-count {
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  transition: color 0.2s, background 0.2s;
}

.pomodoro-count:hover,
.pomodoro-count:focus-visible {
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  outline: none;
}

.pomodoro-count strong {
  color: var(--accent);
  font-weight: 600;
}

.divider {
  margin: 0 0.35rem;
  opacity: 0.5;
}

.tasks-panel {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid #2a2a36;
}

.tasks-panel[data-collapsed="true"] .tasks-toggle {
  transform: rotate(-90deg);
}

.tasks-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.tasks-heading {
  min-width: 0;
  flex: 1;
}

.tasks-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.tasks-active-hint {
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasks-toggle {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform 0.2s, color 0.2s, background 0.2s;
}

.tasks-toggle:hover {
  color: var(--text);
  background: #252530;
}

.tasks-body {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tasks-add {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.task-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #333;
  background: var(--bg);
  color: var(--text);
}

.task-input::placeholder {
  color: var(--text-muted);
}

.task-estimate {
  width: 3.25rem;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  border: 1px solid #333;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.task-estimate::placeholder {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.tasks-add-btn {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.tasks-add-btn:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.tasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 11rem;
  overflow-y: auto;
}

.task-section-label {
  padding: 0.35rem 0.15rem 0.1rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}

.task-item.is-active {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.task-item.is-done {
  opacity: 0.72;
}

.task-item.is-locked {
  opacity: 0.85;
}

.task-check {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1.5px solid #555;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.task-check:hover {
  border-color: var(--accent);
}

.task-check.is-checked {
  border-color: var(--accent-short);
  background: var(--accent-short);
  box-shadow: inset 0 0 0 2px var(--bg);
}

.task-select {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.task-select.is-static {
  cursor: default;
}

.task-title {
  min-width: 0;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-item.is-done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-progress {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.task-delete {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.task-item:hover .task-delete,
.task-item:focus-within .task-delete {
  opacity: 1;
}

.task-delete:hover {
  color: var(--accent-focus);
  background: color-mix(in srgb, var(--accent-focus) 12%, transparent);
}

.tasks-empty {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.25rem 0;
}

.stats-tasks-section {
  margin-top: 0.25rem;
}

.stats-tasks-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats-task-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid #2a2a36;
}

.stats-task-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.stats-task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.top-actions {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 30;
  display: flex;
  gap: 0.5rem;
}

.menu-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.menu-btn:hover {
  color: var(--text);
  background: #252530;
}

.bg-picker,
.music-picker,
.lang-picker {
  position: relative;
}

.bg-picker.is-open,
.music-picker.is-open,
.lang-picker.is-open {
  z-index: 31;
}

.bg-picker-menu,
.music-picker-menu,
.lang-picker-menu {
  position: absolute;
  top: 100%;
  z-index: 32;
  min-width: 8.5rem;
  padding: 0.85rem 0.35rem 0.35rem;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid #2a2a36;
  box-shadow: 0 8px 24px color-mix(in srgb, #000 35%, transparent);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  pointer-events: none;
}

.bg-picker-menu {
  right: 0;
}

.music-picker-menu {
  left: 0;
  right: auto;
}

.lang-picker-menu {
  right: 0;
}

.bg-picker-menu::before,
.music-picker-menu::before,
.lang-picker-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.5rem;
}

.bg-picker:hover .bg-picker-menu,
.bg-picker:focus-within .bg-picker-menu,
.bg-picker.is-open .bg-picker-menu,
.music-picker:hover .music-picker-menu,
.music-picker:focus-within .music-picker-menu,
.music-picker.is-open .music-picker-menu,
.lang-picker:hover .lang-picker-menu,
.lang-picker:focus-within .lang-picker-menu,
.lang-picker.is-open .lang-picker-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.picker-option,
.bg-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.bg-option:hover,
.picker-option:hover {
  background: #252530;
  color: var(--text);
}

.bg-option.active,
.picker-option.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.bg-swatch {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
}

.bg-swatch-default {
  background: linear-gradient(135deg, #1a1a1f, #2a2a36);
}

.bg-swatch-dusk {
  background: linear-gradient(135deg, #161326, #c283ff);
}

.bg-swatch-forest {
  background: linear-gradient(135deg, #112019, #5dc481);
}

.bg-swatch-ocean {
  background: linear-gradient(135deg, #101d2f, #68abff);
}

.music-icon {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
  position: relative;
}

.music-icon-none {
  background: linear-gradient(135deg, #2a2a36, #3a3a48);
}

.music-icon-none::after {
  content: "";
  position: absolute;
  inset: 0.2rem;
  border-top: 2px solid #888;
  transform: rotate(-45deg);
  transform-origin: center;
}

.music-icon-rain {
  background: linear-gradient(160deg, #3a4a5a, #7ab0d8);
}

.music-icon-forest {
  background: linear-gradient(135deg, #1a3a28, #6ecf8a);
}

.music-icon-ocean {
  background: linear-gradient(135deg, #1a4068, #5eb0ff);
}

.music-icon-white {
  background: repeating-linear-gradient(
    90deg,
    #c8c8d0 0 2px,
    #9898a4 2px 4px
  );
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(340px, 88vw);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid #2a2a36;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -8px 0 32px color-mix(in srgb, #000 25%, transparent);
}

.settings-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
  flex-shrink: 0;
}

.drawer-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.drawer-close {
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close:hover {
  color: var(--text);
  background: #252530;
}

.settings-drawer form {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-drawer label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.settings-drawer input[type="number"],
.settings-drawer select {
  font: inherit;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #333;
  background: var(--bg);
  color: var(--text);
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  cursor: pointer;
}

.checkbox-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.stats-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.stats-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid #2a2a36;
}

.stats-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stats-card-value {
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  line-height: 1.1;
}

.stats-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stats-meta {
  display: flex;
  gap: 0.75rem;
}

.stats-meta-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, #2a2a36);
}

.stats-meta-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stats-meta-value {
  font-size: 0.875rem;
  color: var(--text);
}

.stats-meta-value strong {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent);
}

.stats-section-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.35rem;
  height: 9rem;
  padding: 0.5rem 0.25rem 0;
}

.stats-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  height: 100%;
}

.stats-bar-track {
  flex: 1;
  width: 100%;
  max-width: 2rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 6px 6px 2px 2px;
  background: #252530;
  overflow: hidden;
}

.stats-bar-fill {
  width: 100%;
  min-height: 3px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
  transition: height 0.35s ease;
}

.stats-bar-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.stats-bar-value {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text);
  min-height: 0.9rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 380px) {
  .time {
    font-size: 2.125rem;
  }

  .mode-tab {
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
  }
}
