:root {
  --bg-top: #F5F4FA;
  --bg-bot: #E7E9F4;
  --card: #FFFFFF;
  --ink: #221E3D;
  --muted: #6E6A8A;
  --hair: rgba(34, 30, 61, .10);
  --track: rgba(34, 30, 61, .07);
  --shadow: 0 1px 2px rgba(34, 30, 61, .06), 0 8px 24px rgba(34, 30, 61, .07);
  --c-move: #199B8E;
  --c-food: #DE8A26;
  --c-home: #8C6BD0;
  --c-rest: #474689;
  --tint: 12%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #1B1930;
    --bg-bot: #131226;
    --card: #232140;
    --ink: #EEECF9;
    --muted: #9B97BC;
    --hair: rgba(255, 255, 255, .09);
    --track: rgba(255, 255, 255, .06);
    --shadow: none;
    --c-move: #35C2B1;
    --c-food: #F0A84A;
    --c-home: #A98BE6;
    --c-rest: #7B79CE;
    --tint: 18%;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bot)) fixed;
  color: var(--ink);
  font-family: "Onest", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 18px calc(28px + env(safe-area-inset-bottom));
}

/* --- шапка --- */
.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 6px;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.clock {
  margin: 0;
  font-family: "Unbounded", "Onest", sans-serif;
  font-weight: 300;
  font-size: 26px;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}

/* --- круг суток --- */
.dial {
  position: relative;
  margin: 4px 0 18px;
}

.ring { display: block; width: 100%; height: auto; }

.track { fill: none; stroke: var(--track); stroke-width: 20; }

.seg {
  fill: none;
  stroke-width: 20;
  stroke-linecap: butt;
  opacity: .38;
  transition: opacity .4s ease, stroke-width .4s ease;
}

.seg.move { stroke: var(--c-move); }
.seg.food { stroke: var(--c-food); }
.seg.home { stroke: var(--c-home); }
.seg.rest { stroke: var(--c-rest); }
.seg.on { opacity: 1; stroke-width: 26; }

.tick {
  fill: var(--muted);
  font-family: "Onest", sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
}

.needle { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.needle-dot { fill: var(--ink); }

.now {
  position: absolute;
  inset: 26%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
}

.now-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.now-title {
  margin: 0;
  font-family: "Unbounded", "Onest", sans-serif;
  font-weight: 500;
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.now-left {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.next {
  margin: 0 2px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.next b { color: var(--ink); font-weight: 500; }

/* --- список --- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.row {
  display: grid;
  grid-template-columns: 30px 52px 1fr;
  align-items: start;
  gap: 10px;
  padding: 11px 14px 11px 11px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border-left: 3px solid transparent;
  transition: background .3s ease, opacity .3s ease;
}

.row.past { opacity: .5; }

.row.is-now {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) var(--tint), var(--card));
  opacity: 1;
}

.time {
  font-family: "Unbounded", "Onest", sans-serif;
  font-weight: 300;
  font-size: 14px;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.body { display: block; }

.title { display: block; font-weight: 500; }

.note {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 1px;
}

.row.done .title { text-decoration: line-through; text-decoration-thickness: 1px; }
.row.done .title, .row.done .time { color: var(--muted); }

.check {
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 1.5px solid var(--hair);
  border-radius: 9px;
  background: transparent;
  color: transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

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

.check[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.check:focus-visible, .reset:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* --- подвал --- */
.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 4px 0;
  font-size: 13px;
  color: var(--muted);
}

.tally { margin: 0; font-variant-numeric: tabular-nums; }

.reset {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  padding: 6px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  -webkit-tap-highlight-color: transparent;
}

.reset:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
