:root {
  --bg: #ffffff;
  --ink: #14161c;
  --soft: #6d7280;
  --line: #eceef3;
  --card: #fbfbfd;
  --accent: #0fa58f;
  --amber: #f0a43a;
  --indigo: #6c6ff5;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 14px;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(352px, 100%);
  padding: 18px 12px 12px;
  border-radius: 26px;
  isolation: isolate;
}
.card__glow {
  position: absolute;
  inset: 26px 26px -6px;
  border-radius: 40px;
  background: var(--accent);
  filter: blur(30px);
  opacity: 0;
  z-index: -2;
  transition: opacity 0.8s ease;
}
.card.is-done .card__glow { opacity: 0.28; }
.card__face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, var(--card));
  box-shadow:
    inset 0 0 0 1px rgba(20, 22, 28, 0.06),
    0 1px 2px rgba(20, 22, 28, 0.05),
    0 14px 30px -14px rgba(20, 22, 28, 0.18),
    0 36px 60px -36px rgba(20, 22, 28, 0.22);
  z-index: -1;
}
.card__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, color-mix(in srgb, var(--accent) 14%, #ffffff) 48%, color-mix(in srgb, var(--accent) 7%, #ffffff) 53%, transparent 62%);
  opacity: 0;
}

/* ---- the head: the day, the title, what is left, the ring ---- */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 14px 10px;
}
.head__text { min-width: 0; }
.head__day { font-size: 12px; font-weight: 560; color: var(--soft); letter-spacing: 0.01em; }
.head__title { height: 28px; overflow: hidden; font-size: 21px; line-height: 28px; font-weight: 660; font-stretch: 106%; letter-spacing: -0.015em; }
.head__title span, .head__next span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head__next { height: 18px; overflow: hidden; margin-top: 1px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--soft); }

.ring { position: relative; flex: none; width: 52px; height: 52px; }
.ring > svg:first-child { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring__track { stroke: var(--line); }
.ring__arc { stroke: var(--accent); stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.ring__count { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 50%; font-size: 17px; font-weight: 680; }
.ring__count span { display: block; }
.ring__tick { position: absolute; inset: 14px; width: 24px; height: 24px; }
.ring__tick path { fill: none; stroke: var(--accent); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }

/* ---- the doses ---- */
.doses { list-style: none; display: grid; gap: 4px; }
.dose {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 9px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.dose:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dose:active, .dose.is-pressed { transform: scale(0.982); }
.dose.is-hot { background: rgba(20, 22, 28, 0.035); }
@media (hover: hover) {
  .dose:hover { background: rgba(20, 22, 28, 0.035); }
  .dose:hover .check { box-shadow: inset 0 0 0 1.6px color-mix(in srgb, var(--accent) 70%, #ffffff); }
}
.dose.is-hot .check { box-shadow: inset 0 0 0 1.6px color-mix(in srgb, var(--accent) 70%, #ffffff); }

.tile {
  --tint: var(--accent);
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tint) 13%, #ffffff), color-mix(in srgb, var(--tint) 24%, #ffffff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 20%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  transition: filter 0.5s ease, opacity 0.5s ease;
}
.tile--b { --tint: var(--amber); }
.tile--c { --tint: var(--indigo); }
.tile svg { width: 26px; height: 26px; overflow: visible; filter: drop-shadow(0 2px 2px color-mix(in srgb, var(--tint) 40%, transparent)); }
.pill__back { fill: #ffffff; stroke: color-mix(in srgb, var(--tint) 80%, #14161c); stroke-width: 1.5; }
.tile--b .pill__back { fill: color-mix(in srgb, var(--tint) 30%, #ffffff); }
.tile--c .pill__back { fill: color-mix(in srgb, var(--tint) 55%, #ffffff); }
.pill__half { fill: var(--tint); stroke: color-mix(in srgb, var(--tint) 80%, #14161c); stroke-width: 1.5; stroke-linejoin: round; }
.pill__score, .pill__shine { fill: none; stroke-linecap: round; stroke-width: 1.5; }
.pill__score { stroke: color-mix(in srgb, var(--tint) 80%, #14161c); }
.pill__shine { stroke: rgba(255, 255, 255, 0.95); stroke-width: 1.3; }
.dose.is-taken .tile { filter: saturate(0.25); opacity: 0.6; }

.dose__text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.dose__name { position: relative; justify-self: start; max-width: 100%; font-size: 15.5px; line-height: 21px; font-weight: 620; letter-spacing: -0.005em; white-space: nowrap; transition: color 0.4s ease; }
.dose__strike { position: absolute; left: -2px; right: -2px; top: 52%; height: 1.6px; border-radius: 2px; background: currentColor; transform: scaleX(0); transform-origin: 0 50%; }
.dose__meta { font-size: 12.5px; line-height: 17px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.4s ease; }
.dose.is-taken .dose__name { color: #a3a7b3; }
.dose.is-taken .dose__meta { opacity: 0.6; }
.dose__time { flex: none; font-size: 13px; font-weight: 580; color: var(--soft); transition: opacity 0.4s ease; }
.dose.is-taken .dose__time { opacity: 0.45; }

.check {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.6px #d5d8e0;
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.check__fill { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent) 78%, #ffffff), var(--accent) 70%); transform: scale(0); }
.check svg { position: relative; width: 17px; height: 17px; }
.check path { fill: none; stroke: #ffffff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #14151a;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(20, 21, 26, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-width: 360px) {
  .dose { gap: 10px; padding-right: 8px; }
  .dose__meta { font-size: 12px; }
}
