:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --sidebar: #f7f8fb;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-soft: #dbeafe;
  --danger: #e11d48;
  --ok: #059669;
  --p1: #e11d48;
  --p2: #ea580c;
  --p3: #ca8a04;
  --shadow: 0 10px 40px rgba(15, 23, 42, .08);
  --radius: 14px;
  --sidebar-w: 268px;
  --detail-w: 380px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #111827;
  --sidebar: #0d1524;
  --text: #e5eefb;
  --muted: #94a3b8;
  --line: #1e293b;
  --accent: #60a5fa;
  --accent-2: #3b82f6;
  --accent-soft: #1e3a5f;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}
[data-theme="midnight"] {
  --bg: #07070c; --surface: #12121a; --sidebar: #0c0c14; --text: #f4f4f8;
  --muted: #9aa0b5; --line: #232336; --accent: #a78bfa; --accent-2: #8b5cf6; --accent-soft: #2e2150;
}
[data-theme="sand"] {
  --bg: #f3ead9; --surface: #fffaf1; --sidebar: #f7f0e3; --text: #3f2f1e;
  --muted: #8a7358; --line: #e6d8c2; --accent: #c2410c; --accent-2: #9a3412; --accent-soft: #ffedd5;
}
[data-theme="ocean"] {
  --bg: #dbeafe; --surface: #f8fbff; --sidebar: #e8f1ff; --text: #0c4a6e;
  --muted: #0369a1; --line: #bae6fd; --accent: #0284c7; --accent-2: #0369a1; --accent-soft: #e0f2fe;
}
[data-theme="forest"] {
  --bg: #dcfce7; --surface: #f7fff9; --sidebar: #ecfdf3; --text: #14532d;
  --muted: #3f7d57; --line: #bbf7d0; --accent: #059669; --accent-2: #047857; --accent-soft: #d1fae5;
}
[data-theme="rose"] {
  --bg: #ffe4e6; --surface: #fff7f8; --sidebar: #fff1f2; --text: #881337;
  --muted: #be123c; --line: #fecdd3; --accent: #e11d48; --accent-2: #be123c; --accent-soft: #ffe4e6;
}
[data-theme="slate"] {
  --bg: #cbd5e1; --surface: #f8fafc; --sidebar: #e2e8f0; --text: #0f172a;
  --muted: #475569; --line: #94a3b8; --accent: #334155; --accent-2: #1e293b; --accent-soft: #e2e8f0;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.01em;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
p { margin: 0; }

/* Login */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 400px at 10% -10%, #93c5fd 0%, transparent 50%),
    radial-gradient(700px 400px at 110% 110%, #c4b5fd 0%, transparent 45%),
    #eef2ff;
}
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 22px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
}
.login-mark { margin-bottom: 16px; }
.login h1 { font-size: 28px; }
.login-sub { color: #64748b; margin: 8px 0 22px; }
.login label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 14px; color: #334155; }
.login input {
  width: 100%; margin-top: 6px; padding: 12px 12px;
  border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc;
}
.login input:focus { outline: 2px solid #93c5fd; border-color: #2563eb; background: #fff; }
.login-error { color: #e11d48; font-size: 13px; margin-top: 12px; }

.btn {
  border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 650;
  background: #e2e8f0;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.block { width: 100%; padding: 12px; margin-top: 8px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.danger { background: #fff1f2; color: var(--danger); }

/* App shell */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--detail-w);
  height: 100%;
  min-height: 100dvh;
}
#app.no-detail { grid-template-columns: var(--sidebar-w) 1fr; }
#sidebar, #detail {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  overflow: auto;
}
#detail { border-right: 0; border-left: 1px solid var(--line); background: var(--surface); }
#main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

.side-top, .main-bar, .detail-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 10px; position: sticky; top: 0; z-index: 4;
  background: inherit;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px; background: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.15);
  position: relative;
}
.brand-mark:after {
  content: ""; position: absolute; inset: 5px 4px 6px 5px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(40deg); border-radius: 0 0 1px 0;
}
.side-search { padding: 0 12px 10px; }
.side-search input, .quick-add input, #palette-input, #detail input, #detail textarea, #detail select, .modal input, .modal textarea, .modal select {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 10px; padding: 9px 11px;
}
.side-search input:focus, .quick-add input:focus, #palette-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

.side-nav, .side-lists, .side-tags { padding: 0 8px; }
.side-item, .side-tool {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 0; background: transparent; text-align: left;
  padding: 8px 10px; border-radius: 9px; color: var(--text);
}
.side-item:hover, .side-tool:hover, .side-item.on { background: var(--accent-soft); }
.side-item .count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 auto; }
.side-section { margin-top: 12px; }
.side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.side-foot { padding: 12px 8px 24px; display: grid; gap: 2px; }
.side-foot .side-tool { color: var(--muted); font-size: 13px; }

.icon-btn {
  width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.spacer { flex: 1; }

.main-bar { background: var(--bg); }
.main-title { flex: 1; min-width: 0; }
.main-title h2 { font-size: 22px; }
.main-title p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.view-switch, .cal-switch { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.view-switch button, .cal-switch button {
  border: 0; background: transparent; padding: 6px 10px; border-radius: 8px;
  font-size: 12px; font-weight: 650; color: var(--muted);
}
.view-switch button.on, .cal-switch button.on { background: var(--accent-soft); color: var(--accent-2); }

.quick-add { padding: 0 18px 10px; }
.stage { flex: 1; overflow: auto; padding: 0 18px 80px; }

.group { margin: 18px 0 8px; }
.group-title {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin: 0 4px 8px;
}

.task {
  display: grid;
  grid-template-columns: 22px 14px 1fr auto;
  gap: 10px; align-items: start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  cursor: grab;
}
.task-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pin-btn {
  width: 36px; height: 36px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.pin-btn:hover { background: var(--accent-soft); color: var(--text); }
.pin-btn.on { color: var(--accent-2); }
.pin-btn.on svg path { fill: currentColor; }

.date-chips, .filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.date-chips button, .filter-chips button, .list-tools-end button, .list-tools-end select, .bulk-bar button, .btn.sm {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 99px; padding: 6px 10px; font-size: 12px; font-weight: 650;
}
.date-chips button.on, .filter-chips button.on, .list-tools-end button.on { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.list-tools { display: grid; gap: 8px; margin: 4px 0 14px; }
.list-tools-end { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bulk-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 0 18px 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); font-size: 13px; font-weight: 650;
}
.when.tone-overdue, .task.tone-overdue .when { color: var(--danger); font-weight: 750; }
.when.tone-today { color: #d97706; font-weight: 750; }
.when.tone-soon { color: var(--accent-2); }
[data-theme="dark"] .when.tone-today, [data-theme="midnight"] .when.tone-today { color: #fbbf24; }
.pick {
  width: 20px; height: 20px; border: 2px solid #94a3b8; border-radius: 6px;
  background: transparent; margin-top: 2px;
}
.pick.on { background: var(--accent); border-color: var(--accent); }
.task.picked { box-shadow: 0 0 0 2px var(--accent-soft); }
.swipe-row { position: relative; margin-bottom: 8px; overflow: hidden; border-radius: 12px; }
.swipe-row .task { margin-bottom: 0; position: relative; z-index: 1; background: var(--surface); transition: transform .12s ease; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 14px; font-size: 13px; font-weight: 800; }
.swipe-bg.left { justify-content: flex-start; background: #059669; color: #fff; }
.swipe-bg.right { justify-content: flex-end; gap: 8px; background: #9a3412; color: #fff; }
.swipe-bg.right button { border: 0; background: rgba(255,255,255,.16); color: #fff; border-radius: 8px; padding: 8px 10px; font-weight: 750; }
.task:hover { border-color: #cbd5e1; }
.task.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.task.overdue .when { color: var(--danger); }
.task.done { opacity: .55; }
.task.done .title { text-decoration: line-through; }
.task .title { font-weight: 600; line-height: 1.35; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  font-size: 11px; font-weight: 650; padding: 2px 7px; border-radius: 99px;
  background: var(--bg); color: var(--muted);
}
.chip.p1 { background: #ffe4e6; color: var(--p1); }
.chip.p2 { background: #ffedd5; color: var(--p2); }
.chip.p3 { background: #fef9c3; color: var(--p3); }
.chip.pri { background: color-mix(in srgb, currentColor 16%, var(--surface)); }
.when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.check {
  width: 18px; height: 18px; border: 2px solid #94a3b8; border-radius: 99px;
  background: transparent; margin-top: 2px;
}
.check.on { background: var(--ok); border-color: var(--ok); }
.pri-flag { width: 8px; height: 8px; border-radius: 2px; margin-top: 6px; background: transparent; }
.pri-flag.p1 { background: var(--p1); }
.pri-flag.p2 { background: var(--p2); }
.pri-flag.p3 { background: var(--p3); }

.empty {
  text-align: center; color: var(--muted); padding: 48px 12px;
}
.empty h3 { margin-bottom: 6px; color: var(--text); }

/* Detail */
.detail-body { padding: 0 16px 32px; }
.detail-title {
  width: 100%; border: 0 !important; font-size: 20px; font-weight: 750;
  padding: 4px 0 !important; background: transparent !important;
}
.row { display: grid; gap: 8px; margin: 12px 0; }
.row.two { grid-template-columns: 1fr 1fr; }
label.k { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.notes {
  min-height: 140px; resize: vertical; line-height: 1.5;
}
.subtask { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.subtask input[type="text"] { flex: 1; }
.files { display: grid; gap: 8px; }
.file-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  text-decoration: none; color: inherit;
}
.dropzone {
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.dropzone.hot { border-color: var(--accent); background: var(--accent-soft); }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.kanban-col {
  background: color-mix(in srgb, var(--surface) 70%, var(--bg));
  border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-height: 240px;
}
.kanban-col h3 { font-size: 13px; margin-bottom: 10px; color: var(--muted); }

/* Calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); padding: 6px; }
.cal-cell {
  min-height: 92px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; font-size: 12px;
}
.cal-cell.out { opacity: .4; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { font-weight: 700; margin-bottom: 4px; }
.cal-chip {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-2); border-radius: 6px;
  padding: 2px 5px; margin-bottom: 3px; font-weight: 650; font-size: 11px;
}
.week-grid { display: grid; grid-template-columns: 54px repeat(7, 1fr); gap: 4px; }
.week-hour { color: var(--muted); font-size: 11px; }

/* Matrix */
.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quad { min-height: 220px; border-radius: 14px; padding: 14px; border: 1px solid var(--line); background: var(--surface); }
.quad h3 { font-size: 14px; margin-bottom: 10px; }

/* Habits */
.habit { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.habit-days { display: flex; gap: 4px; margin-left: auto; }
.habit-day {
  width: 22px; height: 22px; border-radius: 6px; border: 0; background: var(--bg); color: transparent;
}
.habit-day.on { background: var(--ok); }

/* Timeline */
.timeline { overflow-x: auto; }
.tl-row { display: grid; grid-template-columns: 180px 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.tl-bar { height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 650; display: flex; align-items: center; padding: 0 8px; min-width: 48px; }

/* Focus */
.focus-wrap { display: grid; place-items: center; padding: 40px 12px; }
.timer {
  width: 240px; height: 240px; border-radius: 50%; border: 10px solid var(--accent-soft);
  display: grid; place-items: center; font-size: 48px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--surface);
}
.focus-actions { display: flex; gap: 8px; margin-top: 18px; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat b { font-size: 28px; display: block; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* Modals / palette / toasts */
#overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 20;
}
.modal, .palette {
  position: fixed; z-index: 30; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow);
}
.modal { width: min(520px, calc(100% - 24px)); left: 50%; top: 12vh; transform: translateX(-50%); padding: 18px; }
.palette { width: min(560px, calc(100% - 24px)); left: 50%; top: 14vh; transform: translateX(-50%); padding: 10px; }
.palette-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; border-radius: 8px; }
.palette-item:hover, .palette-item.on { background: var(--accent-soft); }
#toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px;
}
.toast {
  background: var(--text); color: var(--surface); padding: 10px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
}
#context-menu {
  position: fixed; z-index: 40; min-width: 180px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: var(--shadow);
}
#context-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; }
#context-menu button:hover { background: var(--accent-soft); }

#btn-sidebar-close, #btn-sidebar-open { display: none; }
#sidebar-scrim, #dock, .notify-banner { display: none; }

.side-row {
  display: flex; align-items: center; gap: 2px;
}
.side-row .side-item { flex: 1; min-width: 0; }
.side-row .side-item span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edit-btn {
  width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 16px; line-height: 1;
}
.edit-btn:hover, .edit-btn:focus { background: var(--accent-soft); color: var(--text); }
.color-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.color-picks button {
  width: 28px; height: 28px; border-radius: 99px; border: 2px solid transparent;
}
.color-picks button.on { border-color: var(--text); }
.reorder { display: flex; gap: 8px; }

.notify-banner {
  margin: 0 18px 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-soft); color: var(--text);
  display: none; align-items: center; gap: 10px; justify-content: space-between;
  font-size: 13px; font-weight: 600;
}
.notify-banner.show { display: flex; }

.alert-toggles { display: grid; gap: 8px; }
.alert-toggles .switch-row {
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; min-height: 48px;
}
.switch-row > span, .switch-row .switch-label {
  font-size: 15px; font-weight: 650; letter-spacing: 0; text-transform: none;
  color: var(--text); line-height: 1.3;
}
.switch-row .hint { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.switch {
  --sw-w: 51px; --sw-h: 31px;
  width: var(--sw-w); height: var(--sw-h); flex: 0 0 auto;
  border: 0; border-radius: 999px; padding: 0;
  background: #cbd5e1; position: relative;
  transition: background .18s ease;
}
.switch:after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.28);
  transition: transform .18s ease;
}
.switch.on { background: #34c759; }
.switch.on:after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[data-theme="dark"] .switch, [data-theme="midnight"] .switch { background: #334155; }
[data-theme="dark"] .switch.on, [data-theme="midnight"] .switch.on { background: #34c759; }

.settings-stack { display: grid; gap: 4px; margin: 12px 0; }
.settings-account {
  margin: 16px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  display: grid;
  gap: 10px;
}
.settings-account h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.settings-account .k { display: block; margin: 0; }
.settings-account input { min-height: 44px; font-size: 16px; }
#save-account { min-height: 44px; justify-self: start; padding: 12px 16px; }
.reminder-composer { display: grid; gap: 8px; }
.reminder-composer .btn { justify-self: start; min-height: 44px; padding: 12px 16px; }

.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.filters .row.two { margin: 0; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips button {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 99px; padding: 7px 11px; font-size: 12px; font-weight: 650;
}
.filter-chips button.on { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }

#dock {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 18;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
#dock button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 750; padding: 8px 4px; border-radius: 10px;
}
#dock button.on { color: var(--accent-2); background: var(--accent-soft); }

@media (max-width: 1100px) {
  #app, #app.no-detail { grid-template-columns: var(--sidebar-w) 1fr; }
  #detail {
    position: fixed; right: 0; top: 0; bottom: 0; width: min(var(--detail-w), 100%);
    z-index: 22; box-shadow: var(--shadow);
  }
  .kanban, .matrix, .stat-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  #app, #app.no-detail { grid-template-columns: 1fr; }
  #sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); z-index: 24;
    transform: translateX(-105%); transition: transform .2s ease;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    box-shadow: var(--shadow);
  }
  #sidebar.open { transform: none; }
  #sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 23;
    background: rgba(15, 23, 42, .45);
  }
  #sidebar-scrim[hidden] { display: none !important; }
  #btn-sidebar-open, #btn-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }
  #dock { display: grid; }
  .main-bar, .quick-add, .notify-banner, .stage { padding-left: 14px; padding-right: 14px; }
  .stage { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .main-bar { flex-wrap: wrap; }
  .view-switch, .cal-switch { order: 5; width: 100%; justify-content: stretch; }
  .view-switch button, .cal-switch button { flex: 1; padding: 8px 6px; }
  .task { grid-template-columns: 28px 10px 1fr auto; padding: 14px; gap: 8px; }
  .pin-btn { width: 44px; height: 44px; }
  .check { width: 22px; height: 22px; }
  .side-item, .side-tool { min-height: 44px; padding: 10px 12px; }
  .edit-btn { width: 40px; height: 40px; }
  #detail { width: 100%; }
  .row.two { grid-template-columns: 1fr; }
  .alert-toggles { grid-template-columns: 1fr; }
  .switch { --sw-w: 52px; --sw-h: 32px; }
  .reminder-composer .btn, #save-account { width: 100%; }
  #toasts { left: 12px; right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .modal { top: auto; bottom: 0; left: 0; right: 0; width: 100%; transform: none; border-radius: 18px 18px 0 0; max-height: 88dvh; overflow: auto; }
}

.dragging { opacity: .45; }
[hidden] { display: none !important; }
