@font-face { font-family: 'Discovery'; src: url('/fonts/Discovery_Fs-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Discovery'; src: url('/fonts/Discovery_Fs-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #f4f4f5;
  --card: #ffffff;
  --ink: #0a0a0a;
  --ink-2: #52525b;
  --ink-3: #a1a1aa;
  --line: #e4e4e7;
  --soft: #f4f4f5;
  --accent: #0a0a0a;
  --on-accent: #ffffff;
  --danger: #dc2626;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --font: 'Discovery', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Arial, sans-serif;
  --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: #141414; --ink: #fafafa; --ink-2: #a1a1aa; --ink-3: #52525b;
    --line: #262626; --soft: #1c1c1c; --accent: #fafafa; --on-accent: #0a0a0a;
    --shadow: 0 0 0 1px #1f1f1f; color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-wrap: pretty; overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea, select { background: var(--soft); border: 1px solid transparent; border-radius: 14px; padding: 12px 14px; width: 100%; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--ink); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
a { color: inherit; }
svg { display: block; flex: none; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100%; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: calc(var(--safe-t) + 18px) 18px calc(var(--safe-b) + 120px); max-width: 780px; margin: 0 auto; width: 100%; }

@media (min-width: 900px) {
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; width: 260px; flex: none; position: sticky; top: 0; height: 100vh;
    padding: 28px 16px; border-inline-end: 1px solid var(--line); background: var(--card);
  }
  .main { padding: 40px 40px 80px; }
  .tabbar, .fab { display: none !important; }
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; letter-spacing: -.02em; padding: 0 10px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-size: 15px; width: 100%; text-align: start; }
.nav-btn:hover { background: var(--soft); color: var(--ink); }
.nav-btn.on { background: var(--ink); color: var(--bg); }
.nav-btn .count { margin-inline-start: auto; font-size: 12px; opacity: .7; }
.nav-label { font-size: 12px; color: var(--ink-3); padding: 18px 12px 6px; letter-spacing: .04em; }
.side-capture { margin-top: 10px; background: var(--ink); color: var(--bg); justify-content: center; font-weight: 700; }
.side-capture:hover { background: var(--ink); color: var(--bg); opacity: .9; }

/* bottom tab bar (phones) */
.tabbar {
  position: fixed; bottom: calc(var(--safe-b) + 14px); inset-inline: 0; margin: 0 auto; width: min(380px, calc(100% - 28px));
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 10px 30px rgba(0,0,0,.12), 0 0 0 1px var(--line); z-index: 20;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); padding: 7px 0; border-radius: 999px; }
.tab.on { color: var(--ink); background: var(--soft); }
.tab-mic { justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; margin: -2px 0; box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* ---------- headings ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 18px; }
.page-title { font-size: 36px; line-height: 1.05; font-weight: 700; letter-spacing: -.03em; margin: 0; }
.page-sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); flex: none; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 26px 6px 10px; }
.section-title .n { color: var(--ink-3); font-weight: 400; }
.section-title.alert { color: var(--danger); }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.progress-card { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; gap: 16px; }
.progress-card h3 { margin: 0; font-size: 19px; }
.progress-card p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.ring { width: 64px; height: 64px; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.stat { padding: 14px 16px; text-align: start; }
.stat b { display: block; font-size: 24px; letter-spacing: -.02em; }
.stat small { color: var(--ink-2); font-size: 13px; }

.quick-add { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; margin-top: 14px; }
.quick-add input { background: transparent; padding: 10px 4px; }
.quick-add input:focus { border-color: transparent; }
.quick-add .go { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.hint { color: var(--ink-3); font-size: 12px; margin: 6px 10px 0; }

/* ---------- task rows ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); cursor: pointer; position: relative; transition: transform .12s, opacity .3s; }
.row:active { transform: scale(.99); }
.row.done .row-title { text-decoration: line-through; color: var(--ink-3); }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 3px; color: var(--ink-2); font-size: 12.5px; }
.row-meta .late { color: var(--danger); }
.row-meta span { display: inline-flex; align-items: center; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--soft); font-size: 11.5px; color: var(--ink); }
.pill.dark { background: var(--ink); color: var(--bg); }
.pri { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.kind-ico { width: 34px; height: 34px; border-radius: 11px; background: var(--soft); display: grid; place-items: center; flex: none; }

.check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; flex: none; transition: all .2s; color: transparent; }
.check:hover { border-color: var(--ink); }
.check.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.check.doing { border-color: var(--ink); background: conic-gradient(var(--ink) 0 50%, transparent 50% 100%); }
.check.pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.burst { position: absolute; width: 4px; height: 10px; border-radius: 2px; background: var(--ink); pointer-events: none; animation: burst .6s ease-out forwards; }
@keyframes burst { from { opacity: 1; transform: rotate(var(--r)) translateY(0); } to { opacity: 0; transform: rotate(var(--r)) translateY(-30px); } }

.empty { text-align: center; color: var(--ink-3); padding: 34px 20px; font-size: 15px; }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

/* segmented + chips */
.seg { display: flex; background: var(--card); box-shadow: var(--shadow); border-radius: 14px; padding: 4px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; padding: 8px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--ink); color: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { padding: 7px 13px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); font-size: 13.5px; white-space: nowrap; color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); }
.toggle-line { display: flex; justify-content: center; margin-top: 18px; }
.link-btn { color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

/* projects */
.proj { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.proj-emoji { width: 42px; height: 42px; border-radius: 13px; background: var(--soft); display: grid; place-items: center; font-size: 20px; flex: none; }
.proj b { font-size: 16px; }
.proj small { display: block; color: var(--ink-2); font-size: 13px; }
.bar { height: 4px; border-radius: 4px; background: var(--soft); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41; background: var(--card); border-radius: 26px 26px 0 0;
  max-height: 92vh; overflow-y: auto; padding: 10px 20px calc(var(--safe-b) + 24px); animation: up .28s cubic-bezier(.2,.9,.3,1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
@media (min-width: 700px) {
  .sheet { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 560px; border-radius: 26px; max-height: 88vh; padding: 22px 26px 26px; animation: fade .2s; }
  .grab { display: none; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.title-input { font-size: 22px; font-weight: 700; background: transparent; padding: 6px 2px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); }
.title-input:focus { border-color: transparent; border-bottom-color: var(--ink); }
.field { margin-top: 14px; }
.field > label { display: block; font-size: 12px; color: var(--ink-2); margin: 0 4px 6px; letter-spacing: .03em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; }
.btn.ghost { background: var(--soft); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; }

.history { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.ev { display: flex; gap: 10px; padding: 7px 0; font-size: 14px; }
.ev-who { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--soft); }
.ev-who.ai { background: var(--ink); color: var(--bg); }
.ev small { display: block; color: var(--ink-3); font-size: 11.5px; }
.ev p { margin: 0; white-space: pre-wrap; }
.note-add { display: flex; gap: 8px; margin-top: 8px; }
.note-add input { flex: 1; }

/* capture */
.cap-center { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 8px; }
.mic-big { width: 96px; height: 96px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; position: relative; }
.mic-big.rec::before { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--ink); animation: pulse 1.4s infinite; }
@keyframes pulse { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.timer { font-variant-numeric: tabular-nums; font-size: 15px; color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; margin: 10px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.transcript { background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.item { border: 1px solid var(--line); border-radius: 18px; padding: 12px; margin-top: 10px; }
.item.off { opacity: .45; }
.item-top { display: flex; align-items: center; gap: 10px; }
.item-top input[type=text] { font-weight: 700; background: transparent; padding: 6px 4px; }
.item-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.item-opts select, .item-opts input { width: auto; padding: 7px 10px; font-size: 13px; border-radius: 10px; }
.mini-seg { display: inline-flex; background: var(--soft); border-radius: 10px; padding: 3px; }
.mini-seg button { padding: 4px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.mini-seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--ink); display: grid; place-items: center; flex: none; color: transparent; }
.box.on { background: var(--ink); color: var(--bg); }

/* auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 32px 26px; }
.auth h1 { font-size: 44px; line-height: 1; letter-spacing: -.04em; margin: 18px 0 8px; }
.auth p { color: var(--ink-2); margin: 0 0 22px; }
.auth form { display: flex; flex-direction: column; gap: 10px; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* settings */
.set-card { padding: 18px 20px; margin-top: 12px; }
.set-card h3 { margin: 0 0 6px; font-size: 17px; }
.set-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; }
.code { direction: ltr; text-align: left; font-family: ui-monospace, 'JetBrains Mono', Menlo, monospace; font-size: 12.5px; background: var(--soft); border-radius: 12px; padding: 12px; word-break: break-all; white-space: pre-wrap; }
.tok { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }

/* toast */
.toast { position: fixed; top: calc(var(--safe-t) + 16px); inset-inline: 0; margin: 0 auto; width: max-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 700; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: drop .3s cubic-bezier(.2,.9,.3,1); display: flex; align-items: center; gap: 8px; }
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }

/* wall screen (always dark, big type, readable from across the room) */
.wall { position: fixed; inset: 0; background: #000; color: #fafafa; padding: 3.2vw 3.6vw; display: flex; flex-direction: column; gap: 2.4vw; overflow: hidden; --ink: #fafafa; --bg: #000; --ink-3: #52525b; }
.w-head { display: flex; justify-content: space-between; align-items: flex-end; }
.w-clock { font-size: clamp(48px, 7vw, 140px); font-weight: 700; line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
.w-date { font-size: clamp(16px, 1.6vw, 30px); color: #a1a1aa; margin-top: .4vw; }
.w-done { text-align: center; color: #a1a1aa; font-size: clamp(13px, 1.1vw, 20px); }
.w-done b { display: block; color: #fafafa; font-size: clamp(36px, 4vw, 80px); line-height: 1; }
.w-grid { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 3vw; min-height: 0; }
.w-side { display: flex; flex-direction: column; gap: 2.4vw; min-height: 0; }
.wall h2 { font-size: clamp(16px, 1.4vw, 26px); color: #a1a1aa; font-weight: 400; margin: 0 0 1vw; letter-spacing: .02em; }
.wall h2 span { color: #52525b; }
.w-row { display: flex; align-items: center; gap: 1.1vw; padding: .9vw 0; border-bottom: 1px solid #1c1c1c; }
.w-row .check { border-color: #52525b; }
.w-row.big .check { width: 2.2vw; height: 2.2vw; min-width: 28px; min-height: 28px; }
.w-body { min-width: 0; }
.w-title { font-size: clamp(15px, 1.4vw, 28px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-row.big .w-title { font-size: clamp(18px, 2vw, 40px); font-weight: 700; letter-spacing: -.01em; }
.w-pri { display: inline-block; background: #fafafa; color: #000; border-radius: 6px; padding: 0 .45em; margin-inline-end: .5em; font-size: .8em; }
.w-meta { color: #71717a; font-size: clamp(12px, 1vw, 20px); margin-top: .2vw; }
.w-meta .late { color: #f87171; }
.w-empty { color: #52525b; font-size: clamp(15px, 1.3vw, 26px); padding: 1vw 0; }
.w-more { color: #71717a; padding-top: .8vw; font-size: clamp(13px, 1vw, 20px); }
.w-exit { position: fixed; bottom: 10px; left: 14px; color: #27272a; font-size: 12px; }
.w-exit:hover { color: #71717a; }
@media (max-aspect-ratio: 1/1) { .w-grid { grid-template-columns: 1fr; } }
@media (min-width: 900px) { .settings-btn { display: none; } }

/* iOS Safari gives date/time inputs an intrinsic min width, so they spill out of grid cells */
.grid2 > * { min-width: 0; }
input[type=date], input[type=time] { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; display: block; min-height: 48px; text-align: start; }
input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: start; }
.item-opts input[type=date] { width: auto; min-height: 0; }
