/* todo.nicksomers.com — app styles. Dark by default, light via [data-theme=light] or system. */

:root {
  --bg: #101215; --bg-2: #15181C; --card: #181B20; --card-2: #1C1F24; --line: #23272D; --line-2: #2E333A;
  --text: #E8E6E1; --muted: #9A978F; --muted-2: #B5B2AA; --faint: #5B6270;
  --accent: #F2A33A; --accent-text: #101215; --accent-soft: #2A2213; --accent-soft-text: #F2C27A;
  --high: #FF8A7A; --high-soft: #3A1E1A; --med: #F2A33A; --low: #5B6270;
  --ok: #7FD6A8; --ok-soft: #1E2A24; --info: #8FD3FF; --info-soft: #17283A;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --radius: 14px; --font: 'IBM Plex Sans', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --nav-h: 64px;
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) {
  --bg: #F6F4EE; --bg-2: #FFFFFF; --card: #FFFFFF; --card-2: #F1EEE6; --line: #E4E0D6; --line-2: #D3CEC2;
  --text: #1C1B18; --muted: #6F6C65; --muted-2: #55534D; --faint: #A8A49B;
  --accent: #D9821A; --accent-text: #FFFFFF; --accent-soft: #FBEBD2; --accent-soft-text: #8A4F06;
  --high: #C8382A; --high-soft: #FADFDB; --med: #D9821A; --low: #A8A49B;
  --ok: #1F8A5B; --ok-soft: #DDF2E6; --info: #1F6FB2; --info-soft: #DCEBF8;
  --shadow: 0 10px 30px rgba(40,30,10,.15);
}}
:root[data-theme="light"] {
  --bg: #F6F4EE; --bg-2: #FFFFFF; --card: #FFFFFF; --card-2: #F1EEE6; --line: #E4E0D6; --line-2: #D3CEC2;
  --text: #1C1B18; --muted: #6F6C65; --muted-2: #55534D; --faint: #A8A49B;
  --accent: #D9821A; --accent-text: #FFFFFF; --accent-soft: #FBEBD2; --accent-soft-text: #8A4F06;
  --high: #C8382A; --high-soft: #FADFDB; --med: #D9821A; --low: #A8A49B;
  --ok: #1F8A5B; --ok-soft: #DDF2E6; --info: #1F6FB2; --info-soft: #DCEBF8;
  --shadow: 0 10px 30px rgba(40,30,10,.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.35; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.boot { padding: 40px; color: var(--muted); text-align: center; }
.sr { position: absolute; left: -9999px; }

/* ---------- layout ---------- */
#app { min-height: 100%; display: flex; flex-direction: column; }
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; padding: 16px 16px calc(var(--nav-h) + 28px); }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.topbar .eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.topbar h1 { font-size: 26px; }

/* bottom nav (phone) */
.bottomnav { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); height: var(--nav-h); border-radius: 20px; background: var(--card-2); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-around; box-shadow: var(--shadow); z-index: 20; }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; min-width: 52px; }
.bottomnav a.active { color: var(--accent); }
.bottomnav a.fab { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--accent-text); justify-content: center; }
.bottomnav svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .bottomnav { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 22px; width: 250px; flex: none; padding: 22px 16px; border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .main { padding: 24px 28px 40px; }
  .topbar h1 { font-size: 30px; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-family: var(--mono); display: flex; align-items: center; justify-content: center; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a, .sidenav button { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; color: var(--muted-2); text-decoration: none; background: none; border: 0; text-align: left; width: 100%; }
.sidenav a.active { background: var(--card-2); color: var(--text); font-weight: 600; }
.sidenav .dot { width: 8px; height: 8px; border-radius: 4px; flex: none; }
.sidenav .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.side-h { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); margin: 0 12px 6px; display: flex; justify-content: space-between; align-items: center; }
.side-h button { background: none; border: 0; color: var(--accent); font-size: 16px; line-height: 1; padding: 0 2px; }

/* ---------- buttons / inputs ---------- */
.btn { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted-2); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 12px; font-family: var(--mono); }
.btn.icon { width: 40px; padding: 0; justify-content: center; }
.btn.danger { color: var(--high); }
.input, textarea.input, select.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); outline: none; }
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
label.field > * { font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 15px; }

/* ---------- quick add ---------- */
.quickadd { display: flex; gap: 8px; margin-bottom: 14px; }
.quickadd .input { flex: 1; }
.qa-hint { font-size: 12px; color: var(--muted); margin: -8px 0 12px 4px; }
.qa-hint code { font-family: var(--mono); color: var(--muted-2); }

/* ---------- day tabs / stage strip ---------- */
.daytabs { display: flex; gap: 6px; margin-bottom: 10px; }
.daytabs button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted-2); font-weight: 600; font-size: 14px; }
.daytabs button.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.daytabs button .n { font-family: var(--mono); font-size: 11px; opacity: .75; margin-left: 5px; font-weight: 500; }
.notice { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-soft-text); font-size: 13px; margin-bottom: 8px; }
.empty { padding: 36px 12px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- task cards ---------- */
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.task:hover { border-color: var(--line-2); }
.task.p3 { border-color: color-mix(in srgb, var(--high) 35%, var(--line)); }
.task.dragging { opacity: .4; }
.task .check { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--low); background: transparent; flex: none; margin-top: 1px; display: flex; align-items: center; justify-content: center; color: transparent; }
.task.p3 .check { border-color: var(--high); } .task.p2 .check { border-color: var(--med); }
.task .check:hover { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.task .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.task .title { font-size: 15px; font-weight: 500; line-height: 1.3; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12px; color: var(--muted-2); }
.task .meta .proj { display: inline-flex; align-items: center; gap: 5px; }
.task .meta .proj .dot { width: 7px; height: 7px; border-radius: 4px; }
.task .meta .tag { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--card-2); border-radius: 6px; padding: 2px 6px; }
.task .meta .rolled { font-family: var(--mono); font-size: 11px; color: var(--accent-soft-text); }
.task .meta .items { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.task .meta .date { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.task .bump { flex: none; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted-2); font-size: 12px; font-family: var(--mono); }
.task .bump:hover { color: var(--text); }
.task.header-row { background: transparent; border: 0; padding: 14px 4px 2px; cursor: default; }
.task.header-row .title { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.task.sub { margin-left: 24px; }

/* ---------- priority / project view ---------- */
.group { margin-bottom: 18px; }
.group-h { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; }
.group-h.high { color: var(--high); } .group-h.med { color: var(--med); } .group-h.none { color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 13px; padding: 6px 10px; border-radius: 20px; border: 1px solid var(--line-2); color: var(--muted-2); background: none; }
.chip.active { background: var(--card-2); color: var(--text); border-color: var(--card-2); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--card-2); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-2); font-weight: 600; font-size: 14px; }
.seg button.active { background: var(--accent); color: var(--accent-text); }

/* ---------- desktop week board ---------- */
.board { display: none; }
@media (min-width: 900px) {
  .daytabs, .mobile-only { display: none; }
  .board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; align-items: start; }
  .col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 200px; }
  .col.today { border-color: var(--accent); }
  .col.later { background: color-mix(in srgb, var(--bg-2) 60%, var(--bg)); }
  .col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
  .col-h { display: flex; justify-content: space-between; align-items: baseline; }
  .col-h h2 { font-size: 16px; }
  .col-h .n { font-family: var(--mono); font-size: 12px; color: var(--muted); }
  .col .task { padding: 10px; }
  .col .task .bump { display: none; }
  .col .drop-hint { border: 1px dashed var(--line-2); border-radius: 10px; min-height: 80px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 13px; }
}
@media (min-width: 1400px) { .board { grid-template-columns: repeat(5, minmax(240px, 1fr)); } }

/* ---------- lists view ---------- */
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.list-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.list-card h3 { font-size: 16px; margin-bottom: 4px; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.list-item .check { width: 22px; height: 22px; border-radius: 11px; border: 2px solid var(--low); background: none; flex: none; color: transparent; display: flex; align-items: center; justify-content: center; }
.list-item .check:hover { border-color: var(--ok); color: var(--ok); }
.list-item span { flex: 1; }
.list-item .x { background: none; border: 0; color: var(--faint); font-size: 18px; }
.list-item .x:hover { color: var(--high); }
.addrow { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- drawer (task editor) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
.drawer { position: fixed; z-index: 31; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow-y: auto;
  left: 0; right: 0; bottom: 0; max-height: 92vh; border-radius: 20px 20px 0 0; }
@media (min-width: 900px) { .drawer { left: auto; top: 0; bottom: 0; right: 0; width: 440px; max-height: none; border-radius: 0; } }
.drawer .row { display: flex; gap: 10px; }
.drawer .row > * { flex: 1; }
.drawer .title-in { font-size: 18px; font-weight: 600; height: 46px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.pri { display: flex; gap: 6px; }
.pri button { flex: 1; height: 38px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted-2); font-size: 13px; }
.pri button.active.p3 { background: var(--high-soft); color: var(--high); border-color: var(--high); }
.pri button.active.p2 { background: var(--accent-soft); color: var(--accent-soft-text); border-color: var(--med); }
.pri button.active.p1, .pri button.active.p0 { background: var(--card-2); color: var(--text); }
.tagpick { display: flex; flex-wrap: wrap; gap: 6px; }
.tagpick .chip.active { background: var(--accent-soft); color: var(--accent-soft-text); border-color: transparent; }
.checklist { display: flex; flex-direction: column; }
.checklist .list-item { padding: 8px 2px; }
.checklist .list-item.done span { text-decoration: line-through; color: var(--muted); }
.checklist .list-item.done .check { background: var(--ok); border-color: var(--ok); color: var(--accent-text); }

/* ---------- settings ---------- */
.settings { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.setting { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.setting h3 { font-size: 15px; }

/* ---------- login ---------- */
body.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line-2); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.login-card input:not([type=checkbox]) { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); }
.login-card label.check { flex-direction: row; align-items: center; gap: 8px; }
.login-card .error { margin: 0; color: var(--high); font-size: 14px; }
.login-card .btn { height: 46px; justify-content: center; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 24px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 40; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 600; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
