/* Layout: one centered column — header, progress + streak flame, Checklist | Reminders tabs, tab content. Dark navy glass, after the reference. */
:root {
  --bg: #05081a;
  --bg-glow: #1a3aa8;
  --card: rgba(255,255,255,0.045);
  --card-hi: rgba(255,255,255,0.075);
  --line: rgba(255,255,255,0.08);
  --fg: #eef1fb;
  --muted: #8a93b3;
  --faint: #545c7a;
  --accent: #2f6bff;
  --accent-soft: rgba(47,107,255,0.18);
  --good: #3ddc84;
  --warn: #ff6b6b;
  --font: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-lg: 22px;
  --r-md: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); margin: 0; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100%;
  background:
    radial-gradient(max(120vw, 900px) 560px at 50% -90px, color-mix(in srgb, var(--bg-glow) 75%, transparent) 0%, transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 24px;
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hello { font-size: 20px; font-weight: 600; }
.hello small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.icons { display: flex; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center;
  backdrop-filter: blur(10px);
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--card-hi); }
.icon-btn:active { transform: scale(.96); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }

.hero { display: flex; flex-direction: column; gap: 6px; }
.hero .label { color: var(--muted); font-size: 15px; font-weight: 500; margin-bottom: 6px; }
.big { font-size: clamp(48px, 13vw, 68px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.big span { color: var(--faint); }
.meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; flex-wrap: wrap; margin-top: 4px; }
.meta b { color: var(--fg); font-weight: 600; }
.bar { height: 6px; border-radius: 6px; background: var(--card-hi); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; width: 0; transition: width .35s cubic-bezier(.2,.8,.2,1); }

/* Streak flame */
.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.flame-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 12px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(12px);
}
.flame { width: 38px; height: 38px; transform-origin: 50% 90%; filter: drop-shadow(0 0 10px rgba(255,120,40,.55)); }
.flame .fo { fill: url(#fo); }
.flame .fi { fill: url(#fi); }
.flame-card.live .flame { animation: flicker 2.4s ease-in-out infinite; }
.flame-card.cold .flame { filter: none; opacity: .55; }
.flame-card.cold .flame .fo { fill: #3a4166; }
.flame-card.cold .flame .fi { fill: #555e88; }
.flame-card.bump .flame { animation: bump .6s cubic-bezier(.2,.9,.3,1.4); }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.04,.97) rotate(-2deg); } 60% { transform: scale(.98,1.04) rotate(1.5deg); } }
@keyframes bump { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
.flame-txt { display: flex; flex-direction: column; line-height: 1.1; }
.flame-txt b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flame-txt span { font-size: 12px; color: var(--muted); font-weight: 500; }

/* Tabs */
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--line); backdrop-filter: blur(12px);
}
.tab {
  height: 46px; border: 0; border-radius: 15px; background: transparent; color: var(--muted);
  font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, color .2s;
}
.tab:hover { color: var(--fg); }
.tab[aria-selected="true"] { background: var(--card-hi); color: var(--fg); }
.tab .n { font-size: 12px; font-weight: 700; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgba(255,255,255,.12); display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.panel { display: flex; flex-direction: column; gap: 28px; }

/* Sections */
.section { display: flex; flex-direction: column; gap: 10px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-inline: 2px; min-height: 32px; }
.sec-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.sec-head .count { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.sec-head input.rename {
  font-size: 18px; font-weight: 600; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px 10px; min-width: 0; flex: 1;
}
.list { display: flex; flex-direction: column; gap: 8px; }

.row {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 14px 10px 12px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  transition: background .15s, opacity .2s;
}
.row.tap { cursor: pointer; user-select: none; -webkit-user-select: none; }
.row.tap:hover { background: var(--card-hi); }
.check {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.03);
  display: grid; place-items: center;
  transition: background .18s, border-color .18s, transform .12s;
}
.check svg { width: 18px; height: 18px; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s cubic-bezier(.2,.9,.3,1.4); }
.row.done .check { background: var(--accent); border-color: var(--accent); }
.row.done .check svg { opacity: 1; transform: none; }
.row.tap:active .check { transform: scale(.92); }
.ico { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--card-hi); display: grid; place-items: center; color: #9fb6ff; }
.ico svg { width: 18px; height: 18px; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.txt .t { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.txt .s { font-size: 13px; color: var(--muted); }
.row.done .txt .t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.row input.edit { flex: 1; min-width: 0; background: transparent; border: 0; border-bottom: 1px dashed var(--faint); padding: 4px 0; font-size: 16px; }
.del {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center;
}
.del:hover { color: var(--warn); background: rgba(255,107,107,0.1); }
.del.armed { color: #fff; background: var(--warn); width: auto; padding: 0 12px; border-radius: 18px; font-size: 13px; font-weight: 600; }
.del svg { width: 18px; height: 18px; }

/* Edit rows with repeat days */
.row.editing { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
.row.editing .line { display: flex; align-items: center; gap: 10px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.day {
  min-width: 40px; height: 32px; padding: 0 8px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 13px; font-weight: 600;
}
.day[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: #cfdcff; }
.day.all { padding: 0 12px; }
.row input.tt { flex: none; background: var(--card-hi); border: 0; border-radius: 10px; padding: 6px 8px; color: var(--muted); font-size: 14px; }
.later { color: var(--faint); font-size: 13px; padding-inline: 4px; }

.add {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: var(--r-md); border: 1px dashed var(--line);
  padding: 6px 6px 6px 16px; min-height: 52px;
}
.add input:not([type]), .add input[type="text"] { flex: 1 1 160px; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 16px; }
.add input::placeholder { color: var(--faint); }
.add input[type="date"], .add input[type="time"] { flex: none; background: var(--card-hi); border: 0; border-radius: 10px; padding: 8px 10px; color: var(--muted); font-size: 14px; }
.pill {
  flex: none; border: 1px solid var(--line); border-radius: 14px; background: var(--card-hi); color: var(--fg);
  font-weight: 600; font-size: 14px; padding: 10px 16px; transition: background .15s;
}
.pill:hover { background: rgba(255,255,255,0.11); }
.pill.ghost { background: var(--card-hi); color: var(--fg); }
.rem-form { flex-direction: column; align-items: stretch; padding: 10px; gap: 8px; }
.rem-form .r1 { display: flex; gap: 8px; align-items: center; padding-left: 6px; }
.rem-form .r2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rem-form .r2 .pill { margin-left: auto; }

/* Reminders */
.due { font-weight: 600; }
.due.over { color: var(--warn); }
.due.today { color: #7ea3ff; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 4px; }
.link-btn:hover { color: var(--fg); }
.empty { color: var(--muted); font-size: 14px; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-md); line-height: 1.5; }
.note { color: var(--muted); font-size: 13px; text-align: center; margin: 0; }
.note.err { color: var(--warn); }

/* Settings sheet */
dialog {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: #0d1230; color: var(--fg);
  width: min(440px, calc(100% - 32px)); padding: 22px;
}
dialog::backdrop { background: rgba(2,4,14,0.7); backdrop-filter: blur(4px); }
dialog h3 { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.field select {
  background: var(--card-hi); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; font-size: 16px; width: 100%;
}
.field .hint { font-size: 13px; color: var(--muted); }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.dlg-actions .grow { margin-right: auto; }

/* Field buttons that open the wheel picker */
.fbtn {
  flex: none; background: var(--card-hi); border: 0; border-radius: 10px;
  padding: 8px 12px; color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.fbtn.set { color: var(--fg); }
.fbtn:hover { background: rgba(255,255,255,0.11); }

/* Wheel picker: an iOS-style 3D drum (approach after kokonutui's MIT Wheel Picker) */
@media (max-width: 520px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
}
.wheel {
  position: relative; display: flex; justify-content: center; gap: 2px;
  user-select: none; -webkit-user-select: none;
  border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  padding: 0 12px; margin-bottom: 18px;
}
.wband { position: absolute; left: 8px; right: 8px; top: 50%; height: 36px; transform: translateY(-50%); border-radius: 10px; background: rgba(255,255,255,0.07); pointer-events: none; }
.wtick { position: absolute; top: 50%; width: 4px; height: 1px; background: var(--faint); pointer-events: none; }
.wtick.l { left: 2px; } .wtick.r { right: 2px; }
.wcol { position: relative; cursor: grab; touch-action: none; outline: none; border-radius: 10px; }
.wcol:active { cursor: grabbing; }
.wcol:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.wmask { position: absolute; inset: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 34%, #000 66%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 34%, #000 66%, transparent); }
.wlayer { position: absolute; inset: 0; pointer-events: none; perspective: 1000px; }
.wlayer.hi { clip-path: inset(calc(50% - 18px) 0 calc(50% - 18px) 0); }
.wdrum { position: absolute; left: 0; right: 0; top: 50%; transform-style: preserve-3d; }
.wrow { position: absolute; left: 0; right: 0; top: -18px; height: 36px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-variant-numeric: tabular-nums; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.lo .wrow { color: var(--faint); }
.hi .wrow { color: var(--fg); font-weight: 600; }

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

/* Settings: notifications block */
.sep { height: 1px; background: var(--line); margin: 4px 0 16px; }
.notif { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.notif .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.notif p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.notif p.ok { color: var(--good); }
.notif p.err { color: var(--warn); }
.danger { color: var(--warn) !important; }

/* Sign-in page */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.login form { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.login p { margin: 0; color: var(--muted); font-size: 15px; }
.login input {
  background: var(--card-hi); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font-size: 16px; width: 100%;
}
.login .pill { padding: 14px; font-size: 16px; }
.login .note { text-align: left; min-height: 1.4em; }
