/* Home on the phone: one column, big touch targets, light and dark like the system */
:root {
  --bg: #f2f2f7; --card: #ffffff; --fill: #e9e9ee; --fill-2: #f2f2f6; --line: rgba(60, 60, 67, .12);
  --text: #111114; --text-2: #4b4b52; --text-3: #8a8a91;
  --a1: #f2542d; --a2: #ff9a3c; --red: #ff3b30; --green: #28c76f; --blue: #0a84ff; --pp: #0070e0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --fill: #2c2c2e; --fill-2: #232325; --line: rgba(84, 84, 88, .55);
    --text: #f5f5f7; --text-2: #c7c7cc; --text-3: #8e8e93; --pp: #5aa9ff;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Layout */
.wrap { max-width: 560px; margin: 0 auto; padding: calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 104px); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top small { display: block; font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: capitalize; }
.top h1 { margin: 2px 0 0; font-size: 32px; line-height: 1.1; letter-spacing: -.02em; font-weight: 750; }
.me { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; flex: none; }

.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); }
.sec { margin: 22px 4px 8px; font-size: 13px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.sec.late { color: var(--red); }
.sec .n { font-weight: 600; letter-spacing: 0; text-transform: none; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--text-3); }
.stat.hero { background: linear-gradient(150deg, var(--a2), var(--a1)); color: #fff; }
.stat.hero span { color: rgba(255, 255, 255, .85); }

/* Rows */
.list { overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 16px; overflow-wrap: anywhere; }
.row .m { font-size: 13px; color: var(--text-3); margin-top: 1px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row .m .late { color: var(--red); font-weight: 600; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--text-3); display: grid; place-items: center; flex: none; transition: transform .2s, background .2s, border-color .2s; }
.check svg { width: 14px; height: 14px; stroke-width: 3; color: #fff; opacity: 0; }
.check:active { transform: scale(.88); }
.done .check { background: var(--green); border-color: var(--green); }
.done .check svg { opacity: 1; }
.done .t { color: var(--text-3); text-decoration: line-through; }
.prio { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ev-time { width: 26px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; font-variant-numeric: tabular-nums; }
.ev-bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; margin: 4px 0; }
.empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 15px; }

/* Add a task */
.add { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; }
.add input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; padding: 8px 0; }
.add input::placeholder { color: var(--text-3); }
.when { display: flex; gap: 6px; padding: 0 14px 12px; flex-wrap: wrap; }

/* Chips and segmented controls */
.chip { height: 34px; padding: 0 13px; border-radius: 17px; background: var(--fill); font-size: 14px; font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s; }
.chip.on { background: var(--a1); color: #fff; }
.chip b { font-weight: 700; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 12px; padding: 3px; }
.seg button { height: 36px; border-radius: 9px; font-size: 15px; font-weight: 550; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* Forms */
.form { padding: 6px 14px 14px; }
.field { padding: 10px 0; }
.field + .field { border-top: 1px solid var(--line); }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-3); margin-bottom: 6px; }
.inp { width: 100%; border: 0; outline: 0; background: var(--fill-2); border-radius: 12px; padding: 12px 13px; font-size: 16px; }
.inp:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--a1) 28%, transparent); }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a91' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.offers { display: flex; flex-direction: column; gap: 12px; }
.offer-g small { display: block; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin: 0 2px 6px; }
.offer-g div { display: flex; flex-wrap: wrap; gap: 6px; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px 0; font-size: 14px; color: var(--text-3); }
.total b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }

/* Buttons */
.btn { width: 100%; height: 50px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 17px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btn.accent { background: linear-gradient(150deg, var(--a2), var(--a1)); color: #fff; }
.link { color: var(--a1); font-weight: 600; font-size: 15px; padding: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--text-2); flex: none; }
.icon-btn.go { background: var(--a1); color: #fff; }
.icon-btn:disabled { opacity: .4; }

/* Tab bar */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 8px 16px calc(var(--safe-b) + 8px); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6); border-top: 1px solid var(--line); z-index: 5; }
.tabs div { display: flex; width: 100%; max-width: 560px; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 11px; font-weight: 600; color: var(--text-3); }
.tabs button svg { width: 25px; height: 25px; }
.tabs button.on { color: var(--a1); }

/* Sign in */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; max-width: 420px; margin: 0 auto; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px); }
.login .logo { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 18px; }
.login h1 { font-size: 30px; margin: 0 0 6px; letter-spacing: -.02em; }
.login p { margin: 0 0 22px; color: var(--text-3); }
.login .inp { margin-bottom: 10px; }
.login .code { text-align: center; font-size: 26px; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.err { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 2px 10px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 96px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: #1c1c1e; color: #fff; padding: 12px 16px; border-radius: 16px; font-size: 15px; font-weight: 550; display: flex; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: opacity .25s, transform .3s; z-index: 10; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: #ff9a3c; font-weight: 700; }
@media (prefers-color-scheme: dark) { .toast { background: #3a3a3c; } }

.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fade .3s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* Fixes after review */
.login .inp { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.toast { width: max-content; } .toast span { flex: 1; }
.chip { height: auto; min-height: 34px; padding: 7px 13px; text-align: left; line-height: 1.25; }
.top small { text-transform: none; }

/* Passkeys */
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--text-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login #go:not(.accent) { background: var(--card); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 12px; }
.banner > svg { color: var(--a1); width: 24px; height: 24px; }
.banner .grow { flex: 1; min-width: 0; }
.banner b { display: block; font-size: 15px; } .banner span { font-size: 13px; color: var(--text-3); }
.key-ic { width: 26px; display: grid; place-items: center; color: var(--a1); flex: none; }
.hint { font-size: 13px; color: var(--text-3); margin: 10px 4px 16px; line-height: 1.45; }
.btn.ghost { background: var(--card); color: var(--red); box-shadow: inset 0 0 0 1px var(--line); }
.row .me { width: 40px; height: 40px; }
