/* ================= tokens ================= */

:root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --sidebar: #efede8;
  --hover: rgba(60, 50, 40, .06);
  --text: #1c1b19;
  --muted: #5e5950;
  --faint: #6e695f;
  --line: #e7e4dd;
  --line-strong: #d8d4cb;
  --accent: #e0612a;
  --accent-hover: #e8723d;
  --accent-ink: #1b0f08;
  --accent-soft: #fcebe2;
  --accent-text: #b4481a;     /* orange for text: 5:1 on the page; --accent stays for fills, rings and icons */
  --toast-accent: #f07a43;    /* on the dark toast: 6.2:1 */
  --success: #2f9e5b;
  --success-soft: #e3f4ea;
  --success-text: #247a46;
  --warn: #b26b12;
  --warn-soft: #fbf0dc;
  --warn-text: #9d5e10;
  --danger: #c93a31;
  --danger-soft: #fbe5e3;
  --shadow-sm: 0 1px 2px rgba(30, 25, 20, .05);
  --shadow: 0 1px 2px rgba(30, 25, 20, .04), 0 6px 20px -6px rgba(30, 25, 20, .10);
  --shadow-lg: 0 12px 40px -8px rgba(30, 25, 20, .25);
  --radius: 14px;
  --radius-sm: 9px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --series-1: #3987e5;
    --series-2: #d95926;
    --bg: #141312;
    --surface: #1d1c1a;
    --surface-2: #191817;
    --sidebar: #181716;
    --hover: rgba(255, 245, 230, .06);
    --text: #eeebe5;
    --muted: #aaa49a;
    --faint: #969188;
    --line: #2b2926;
    --line-strong: #3a3733;
    --accent: #f07a43;
    --accent-hover: #f58c5a;
    --accent-ink: #1b0f08;
    --accent-soft: rgba(240, 122, 67, .14);
    --accent-text: #f07a43;
    --toast-accent: #a8421a;  /* on the light toast: 5.1:1 */
    --success: #4cc27c;
    --success-soft: rgba(76, 194, 124, .14);
    --success-text: #4cc27c;
    --warn: #e3a24d;
    --warn-soft: rgba(227, 162, 77, .13);
    --warn-text: #e3a24d;
    --danger: #f06b62;
    --danger-soft: rgba(240, 107, 98, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 16px 48px -8px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --series-1: #3987e5;
  --series-2: #d95926;
  --bg: #141312;
  --surface: #1d1c1a;
  --surface-2: #191817;
  --sidebar: #181716;
  --hover: rgba(255, 245, 230, .06);
  --text: #eeebe5;
  --muted: #aaa49a;
  --faint: #969188;
  --line: #2b2926;
  --line-strong: #3a3733;
  --accent: #f07a43;
  --accent-hover: #f58c5a;
  --accent-ink: #1b0f08;
  --accent-soft: rgba(240, 122, 67, .14);
  --accent-text: #f07a43;
  --toast-accent: #a8421a;
  --success: #4cc27c;
  --success-soft: rgba(76, 194, 124, .14);
  --success-text: #4cc27c;
  --warn: #e3a24d;
  --warn-soft: rgba(227, 162, 77, .13);
  --warn-text: #e3a24d;
  --danger: #f06b62;
  --danger-soft: rgba(240, 107, 98, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 48px -8px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ================= base ================= */

::placeholder { color: var(--faint); opacity: 1; } /* browser default grey is below 4.5:1 */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

kbd {
  font: 600 11px/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 5px;
  background: var(--surface-2);
}

.app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

/* ================= sidebar ================= */

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 22px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}


.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  /* glossy bubble, matching the app icon */
  background:
    radial-gradient(ellipse 60% 38% at 50% 22%, rgba(255, 255, 255, .45), transparent 70%),
    linear-gradient(160deg, #f58f52, #cc4c1c);
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff; box-shadow: 0 2px 6px rgba(207, 79, 29, .35);
}
.brand-mark .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.brand-mark.small { width: 26px; height: 26px; }
.brand-mark.small .icon { width: 14px; height: 14px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0 8px 0 10px; height: 38px;
  color: var(--faint); box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search .icon { width: 16px; height: 16px; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text);
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--faint); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item, .day-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
  text-align: left; color: var(--muted); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav-item > span:nth-child(2) { flex: 1; }
.nav-item:hover, .day-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active, .day-item.active {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}
.nav-item.active .icon { color: var(--accent-text); }

.count {
  min-width: 22px; padding: 0 7px; border-radius: 99px;
  font-size: 12px; line-height: 20px; text-align: center; font-weight: 650;
  background: var(--accent-soft); color: var(--accent-text);
  font-variant-numeric: tabular-nums;
}
.count:empty { display: none; }
.count.quiet { background: transparent; color: var(--faint); }

.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 2px 10px 0; color: var(--faint);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.jump {
  position: relative; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 7px; color: var(--muted); cursor: pointer;
}
.jump:hover { background: var(--hover); color: var(--text); }
.jump .icon { width: 16px; height: 16px; pointer-events: none; }
/* invisible native date input stretched over the icon, so clicking opens the picker */
.jump input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.jump input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }

.days {
  list-style: none; margin: -8px 0 0; padding: 0;
  overflow-y: auto; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.day-item { justify-content: space-between; padding: 7px 10px; }
.day-item .day-label { display: flex; flex-direction: column; line-height: 1.25; }
.day-item .day-label b { font-weight: 600; color: var(--text); font-size: 14px; }
.day-item .day-label small { color: var(--faint); font-size: 12px; font-weight: 450; }
.day-item .all-done { color: var(--success-text); }
.day-item .all-done .icon { width: 16px; height: 16px; stroke-width: 2.5; }
.days-empty { color: var(--faint); font-size: 13px; padding: 6px 10px; }

.theme-switch {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  background: var(--hover); border-radius: var(--radius-sm); padding: 3px;
}
.theme-switch button {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; border-radius: 7px; color: var(--muted); font-size: 12px; font-weight: 600;
}
.theme-switch button .icon { width: 14px; height: 14px; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ================= main ================= */

.main { overflow-y: auto; min-width: 0; }
.content { max-width: 780px; margin: 0 auto; padding: 40px clamp(16px, 4vw, 48px) 120px; }

.mobile-bar { display: none; }

.main-header {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 2px; color: var(--accent-text); font-size: 13px; font-weight: 650;
  letter-spacing: .01em;
}
h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; }

.day-nav {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 99px; padding: 3px; box-shadow: var(--shadow-sm);
}
.pill {
  padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.pill:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.pill:disabled { color: var(--faint); cursor: default; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px; color: var(--muted);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.day-nav .icon-btn { border-radius: 99px; width: 28px; height: 28px; }

.progress { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; }
.progress-track { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress-fill {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f2a04a);
  transition: width .4s cubic-bezier(.2, .8, .2, 1);
}
.progress.complete .progress-fill { background: var(--success); }
.progress-text { font-size: 13px; color: var(--muted); font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }

.composer {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0 12px 0 16px; min-height: 54px;
  box-shadow: var(--shadow); margin-bottom: 30px;
  transition: border-color .15s, box-shadow .15s;
}
.composer > .icon { color: var(--accent-text); stroke-width: 2.4; }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.composer input, .composer textarea { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; }
.composer textarea { resize: none; line-height: 1.45; padding: 15px 0; max-height: 220px; display: block; }
.composer input::placeholder, .composer textarea::placeholder { color: var(--faint); }
.composer kbd { opacity: 0; transition: opacity .15s; }
.composer:focus-within kbd { opacity: 1; }

/* ================= lists ================= */

.list { display: flex; flex-direction: column; gap: 28px; }

.group-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px; padding: 0 4px;
}
.group-title {
  margin: 0; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 8px;
}
.group-title .n { color: var(--faint); font-weight: 600; }
.group-actions { display: flex; gap: 2px; margin-left: auto; }
.tag {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 99px;
}
.tag.overdue { background: var(--warn-soft); color: var(--warn-text); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 5px 10px; border-radius: 8px;
}
.ghost-btn .icon { width: 15px; height: 15px; }
.ghost-btn:hover { background: var(--hover); color: var(--text); }
.ghost-btn.accent { color: var(--accent-text); }
.ghost-btn.accent:hover { background: var(--accent-soft); color: var(--accent-text); }

.collapse-btn { display: inline-flex; align-items: center; gap: 6px; }
.collapse-btn .icon { width: 15px; height: 15px; transition: transform .2s; }
.collapse-btn[aria-expanded="false"] .icon { transform: rotate(-90deg); }

.notes {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}

.note {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 14px 12px 14px 24px; border-top: 1px solid var(--line);
  transition: background .12s;
  animation: note-in .25s ease-out;
}
.note:first-child { border-top: 0; }
.note:focus { outline: none; }
.note.selected { background: var(--hover); box-shadow: inset 3px 0 0 var(--accent); }
.note.selected .chip.person { background: none; } /* orange text stays >= 4.5:1 on the selected tint */
.note.selected:focus-visible { box-shadow: inset 3px 0 0 var(--accent), inset 0 0 0 2px var(--accent); }
.note:hover { background: var(--surface-2); }
@keyframes note-in { from { opacity: 0; transform: translateY(-3px); } }

/* drag to set priority */
.notes { position: relative; }
.note { position: relative; }
.drag-handle {
  position: absolute; left: 0; top: 0; bottom: 0; width: 24px;
  display: grid; place-items: center; color: var(--faint);
  cursor: grab; touch-action: none; opacity: 0; transition: opacity .12s;
}
.drag-handle .icon { width: 14px; height: 14px; stroke-width: 3; }
.note:hover .drag-handle, .drag-handle:focus-visible { opacity: 1; }
.drag-handle:hover { color: var(--text); }
.note.dragging {
  z-index: 3; background: var(--surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); outline: 1.5px solid var(--accent-soft); transition: none; animation: none;
}
.note.dragging .drag-handle { opacity: 1; color: var(--accent-text); cursor: grabbing; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

.check {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; margin: -5px -5px -5px 0; border-radius: 50%; color: transparent; /* tap area, clear of the drag handle */
}
.check .ring {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1.8px solid var(--line-strong);
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.check .icon { width: 13px; height: 13px; stroke-width: 3.2; }
.check:hover .ring { border-color: var(--success); color: var(--success-text); }
.check[aria-checked="true"] .ring { background: var(--success); border-color: var(--success); color: #fff; animation: pop .25s ease-out; }
@keyframes pop { 50% { transform: scale(1.18); } }

.note-text { white-space: pre-wrap; word-break: break-word; cursor: text; font-size: 15.5px; line-height: 1.45; }
.note-link {
  color: var(--accent-text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent-text) 40%, transparent);
  text-underline-offset: 2px; overflow-wrap: anywhere; cursor: pointer;
}
.note-link:hover { text-decoration-color: currentColor; }
.note.done .note-link { color: inherit; }
.note.done .note-text { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--faint); font-weight: 500;
}
.chip .icon { width: 12px; height: 12px; }
.chip.moved, .chip.edited, .chip.donechip { padding: 1px 7px; border-radius: 99px; }
.chip.moved { background: var(--warn-soft); color: var(--warn-text); }
.chip.edited { background: var(--hover); color: var(--muted); }
.chip.donechip { background: var(--success-soft); color: var(--success-text); }

.note-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.more-btn { display: none; }
.note-menu .menu-item { display: flex; width: 100%; padding: 10px 10px; border-radius: 8px; font-size: 15px; font-weight: 500; text-align: left; min-height: 44px; }
.note-menu .menu-item > span { display: inline-flex; align-items: center; gap: 10px; }
.note-menu .menu-item .icon { width: 17px; height: 17px; color: var(--muted); }
.note-menu .menu-item:hover, .note-menu .menu-item:focus-visible { background: var(--accent-soft); color: var(--accent-text); outline: none; }
.note-menu .menu-item.danger { color: var(--danger); }
.note-menu .menu-item.danger .icon { color: var(--danger); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 8px 0 0; font-size: 14.5px; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--muted); }
.keys kbd { display: inline-block; min-width: 24px; padding: 2px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; font: 600 13px/1.3 inherit; text-align: center; color: var(--text); }
.note:hover .note-actions, .note:focus-within .note-actions { opacity: 1; }
.note-actions .icon-btn .icon { width: 16px; height: 16px; }
.note-actions .icon-btn.go:hover { color: var(--accent-text); background: var(--accent-soft); }
.note-actions .icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- checklists ---------- */
.checklist { margin-top: 8px; }
.checklist ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checklist li { display: flex; align-items: flex-start; gap: 9px; padding: 3px 4px 3px 0; border-radius: 6px; font-size: 14.5px; }
.checklist li:hover { background: var(--hover); }
.checklist li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.checklist li.done > span { color: var(--faint); text-decoration: line-through; }
.cl-check {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin: -3px -2px -3px -5px; color: transparent; /* tap area */
}
.cl-check .ring {
  display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; border: 1.6px solid var(--line-strong);
}
.cl-check .icon { width: 11px; height: 11px; stroke-width: 3.2; }
.cl-check:hover .ring { border-color: var(--success); color: var(--success-text); }
.cl-check[aria-checked="true"] .ring { background: var(--success); border-color: var(--success); color: #fff; }
.cl-remove { opacity: 0; color: var(--faint); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; }
.cl-remove .icon { width: 13px; height: 13px; }
.checklist li:hover .cl-remove, .cl-remove:focus-visible { opacity: 1; }
.cl-remove:hover { color: var(--danger); background: var(--danger-soft); }
.cl-add-btn { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 6px 2px 2px; border-radius: 6px; }
.cl-add-btn .icon { width: 14px; height: 14px; }
.cl-add-btn:hover { color: var(--accent-text); background: var(--accent-soft); }
.cl-add input {
  width: 100%; margin-top: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--bg); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); font-size: 14px;
}

/* ---------- "Move to…" menu ---------- */
.move-menu {
  position: fixed; z-index: 40; width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  animation: toast-in .12s ease-out;
}
.move-title { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); padding: 6px 8px 4px; }
.move-menu > button {
  display: flex; justify-content: space-between; align-items: baseline; width: 100%;
  padding: 7px 8px; border-radius: 8px; font-size: 14px; font-weight: 500; text-align: left;
}
.move-menu > button small { color: var(--faint); font-size: 12px; }
.move-menu > button:hover, .move-menu > button:focus-visible { background: var(--accent-soft); color: var(--accent-text); outline: none; }
.move-pick { border-top: 1px solid var(--line); margin-top: 4px; padding: 8px 8px 4px; }
.move-pick label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.move-pick label .icon { width: 14px; height: 14px; }
.move-pick-row { display: flex; gap: 6px; }
.move-pick input {
  flex: 1; min-width: 0; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); outline: none;
}
.move-pick input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary.small { height: 32px; padding: 0 12px; font-size: 13px; }

/* ---------- week view ---------- */
.content.wide { max-width: 1400px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: start; }
.week-col {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 8px; min-height: 220px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.week-col.is-past { background: var(--surface-2); }
.week-col.is-today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.week-col.drop { border-color: var(--accent); background: var(--accent-soft); }
.week-head { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px 6px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.week-head b { font-size: 20px; color: var(--text); letter-spacing: 0; }
.week-head .count { margin-left: auto; }
.week-head:hover { background: var(--hover); }
.is-today .week-head b { color: var(--accent-text); }
.week-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.week-card {
  display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 9px; background: var(--bg);
  border: 1px solid var(--line); font-size: 13.5px; line-height: 1.35; cursor: grab;
}
.week-card:hover { border-color: var(--line-strong); }
.week-card.dragging { opacity: .45; }
.week-card.done .week-text > span:first-child { color: var(--faint); text-decoration: line-through; }
.week-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.week-meta { font-size: 11.5px; color: var(--faint); }
.check.small { width: 26px; height: 26px; margin: -4px -5px -4px -4px; } /* takes no more text width than the old 17px tick */
.check.small .ring { width: 17px; height: 17px; }
.check.small .icon { width: 10px; height: 10px; }
.week-add input {
  width: 100%; border: 1px dashed var(--line-strong); background: transparent; border-radius: 8px; padding: 6px 8px;
  font-size: 13px; outline: none;
}
.week-add input:focus { border-style: solid; border-color: var(--accent); background: var(--bg); }
.hint { color: var(--faint); font-size: 13px; margin: 12px 4px 0; }
.hint.inline { margin: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }

/* ---------- weekly summary ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 30px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--faint); }
.stat.warn .stat-value { color: var(--warn-text); }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 18px 12px;
}
.panel .group-title { margin-bottom: 8px; }

/* charts (charts.js) */
.viz { position: relative; margin: 0; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--line); stroke-width: 1; }
.viz-base { stroke: var(--line-strong); stroke-width: 1; }
.viz-tick { fill: var(--faint); font-size: 11px; font-family: inherit; }
.viz-hit { fill: transparent; cursor: default; }
.viz-group path { transition: opacity .12s; }
.viz-svg:hover .viz-group:not(.on) path { opacity: .45; }
.viz-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.viz-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; z-index: 2;
  background: var(--text); color: var(--bg); border-radius: 8px; padding: 7px 10px; font-size: 12.5px;
  box-shadow: var(--shadow-lg); min-width: 110px;
}
.viz-tip b { display: block; margin-bottom: 3px; }
.viz-tip div { display: flex; align-items: center; gap: 6px; }
.viz-table { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.viz-table summary { cursor: pointer; width: max-content; }
.viz-table table { border-collapse: collapse; margin-top: 6px; }
.viz-table th, .viz-table td { text-align: left; padding: 3px 14px 3px 0; font-variant-numeric: tabular-nums; }

/* ---------- users dashboard (admin.html) ---------- */
.admin-page { height: auto; overflow: auto; }
.admin { display: block; }
.admin #admin-body { display: flex; flex-direction: column; gap: 16px; }
.pill.back { text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
.admin-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.admin-table-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.admin-table-head .group-title { margin: 0; flex: 1; }
.admin-table-head input {
  height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); outline: none; min-width: 220px;
}
.admin-table-head input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.table-scroll { overflow-x: auto; }
.admin-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 10px 12px 10px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.admin-table thead th { border-top: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.admin-table td.num { font-variant-numeric: tabular-nums; }
.admin-table .sort { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.admin-table .sort.on, .admin-table .sort:hover { color: var(--text); }
.who { display: flex; align-items: center; gap: 10px; }
.who > div { display: flex; flex-direction: column; line-height: 1.25; }
.who small { color: var(--faint); }
.app-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--hover); color: var(--muted); margin-right: 4px; }
@media (max-width: 900px) { .admin-charts { grid-template-columns: 1fr; } }

/* ---------- trash ---------- */
.note.trashed { grid-template-columns: auto minmax(0, 1fr) auto; }
.trash-icon { color: var(--faint); margin-top: 2px; }
.note-actions.always { opacity: 1; align-items: center; }
.ghost-btn.danger { color: var(--danger); }
.ghost-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
a.nav-item { text-decoration: none; }

/* screenshot notes */
.shot {
  display: block; margin-top: 10px; padding: 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in;
  max-width: min(360px, 100%); box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s;
}
.shot:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.shot img { display: block; width: 100%; max-height: 220px; object-fit: cover; object-position: top; }
.note.done .shot { opacity: .55; }

.shot-dialog {
  width: min(1200px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
  border: 0; border-radius: 16px; background: var(--surface); color: var(--text); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.shot-dialog::backdrop { background: rgba(10, 8, 6, .72); }
.shot-frame { position: relative; background: #111; display: grid; place-items: center; }
.shot-frame img { display: block; max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.shot-loading {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); margin: 0;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 99px;
}
.shot-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; }
.shot-bar p { flex: 1; margin: 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-bar a[href] { cursor: pointer; }
.shot-bar a:not([href]) { opacity: .4; pointer-events: none; }

.edit-box {
  width: 100%; min-height: 70px; resize: vertical; display: block;
  border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 9px 11px;
  background: var(--bg); outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
  line-height: 1.45;
}
.edit-hint { font-size: 12px; color: var(--faint); margin-top: 6px; }

.caught-up {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--success-soft); color: var(--success-text); font-weight: 600; font-size: 14px;
}

.empty {
  text-align: center; color: var(--muted); padding: 56px 20px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
}
.empty-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px;
  border-radius: 16px; background: var(--accent-soft); color: var(--accent-text);
}
.empty-icon .icon { width: 24px; height: 24px; }
.empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.empty kbd { margin: 0 2px; }

.offline {
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--warn-text); font-size: 14px; font-weight: 500;
}

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; gap: 16px; align-items: center; font-size: 14px; font-weight: 500; z-index: 30;
  max-width: calc(100vw - 32px); animation: toast-in .2s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast-action { color: var(--toast-accent); font-weight: 700; }

/* ================= loading ================= */

/* boot screen: shown until we know whether someone is signed in */
.boot { display: none; }
body.booting .boot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  min-height: 100vh; min-height: 100dvh;
}
.boot-mark { animation: boot-pulse 1.4s ease-in-out infinite; }
.boot-text { color: var(--muted); font-size: 14px; font-weight: 500; }
@keyframes boot-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 22px rgba(207, 79, 29, .35), 0 0 0 0 rgba(224, 97, 42, .35); }
  50% { transform: scale(1.06); box-shadow: 0 8px 22px rgba(207, 79, 29, .35), 0 0 0 14px rgba(224, 97, 42, 0); }
}

/* skeleton placeholders while notes download */
.sk {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, var(--line) 0%, var(--surface-2) 45%, var(--line) 90%);
  background-size: 300% 100%; animation: sk-shimmer 1.3s ease-in-out infinite;
}
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-note { grid-template-columns: auto minmax(0, 1fr); cursor: default; }
.sk-note:hover { background: none; }
.sk-check { width: 22px; height: 22px; border-radius: 50%; }
.sk-line { height: 13px; margin: 4px 0 9px; }
.sk-line.short { width: 22%; height: 10px; margin-bottom: 2px; }
.sk-day { padding: 9px 10px; }
.sk-day .sk-line { width: 58%; margin: 0 0 6px; }
.sk-day .sk-line.short { width: 34%; }
.skeleton .stat .sk-line { width: 50%; height: 24px; }
.skeleton .stat .sk-line.short { width: 40%; height: 10px; }
.sk-panel { margin-top: 16px; }
.sk-panel .sk { height: 220px; }

@media (prefers-reduced-motion: reduce) {
  .sk, .boot-mark { animation: none; }
}

/* ================= sign-in ================= */

body.booting .app, body.booting .auth { display: none !important; }

.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(60rem 30rem at 50% -10%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 40px 32px 32px;
}
.auth-card h1 { font-size: 30px; margin: 18px 0 8px; }
.auth-card p { color: var(--muted); margin: 0 0 28px; }
.brand-mark.big { width: 72px; height: 72px; margin: 0 auto; box-shadow: 0 8px 22px rgba(207, 79, 29, .35); }
.brand-mark.big .icon { width: 30px; height: 30px; }
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
  height: 48px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); font-weight: 600; font-size: 15px; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s;
}
.google-btn:hover { background: var(--surface-2); border-color: var(--faint); }
.google-btn:disabled { opacity: .6; cursor: progress; }
.auth-error { color: var(--danger) !important; font-size: 13px; margin: 14px 0 0 !important; }

/* ================= account ================= */

.account {
  display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 8px;
  border-top: 1px solid var(--line); margin: 0 -2px;
}
.avatar {
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 13px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.tiny { width: 16px; height: 16px; font-size: 9px; }
.chip .avatar { background: none; }
.account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-text b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-text small { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= sharing ================= */

.chip.person, .chip.shared { padding: 1px 7px 1px 3px; border-radius: 99px; }
.chip.person { background: var(--accent-soft); color: var(--accent-text); }
.chip.shared { background: var(--hover); color: var(--muted); padding-left: 7px; cursor: pointer; }
.chip.shared:hover { color: var(--text); }
.note-actions .icon-btn.share:hover { color: var(--accent-text); background: var(--accent-soft); }

.share-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 22px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.share-dialog::backdrop { background: rgba(20, 15, 10, .4); backdrop-filter: blur(2px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.share-preview {
  margin: 0 0 16px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--line); color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.share-form { display: flex; gap: 8px; }
.share-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); outline: none;
}
.share-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-primary {
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
}
.btn-primary:hover { background: var(--accent-hover); }
.share-error { color: var(--danger); font-size: 13px; margin: 8px 0 0; }
.share-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.share-list li { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 6px; border-radius: 8px; }
.share-list li:hover { background: var(--hover); }
.share-list li > span:not(.avatar) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.share-list .empty-row { color: var(--faint); font-size: 13px; padding-left: 4px; }
.share-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.45; }

.banner {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--warn-text); font-size: 14px; font-weight: 500;
}
.banner .icon { width: 16px; height: 16px; }
.loading { color: var(--faint); text-align: center; padding: 40px 0; }

/* ================= phones & small windows ================= */

@media (max-width: 1100px) {
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .week { grid-template-columns: 1fr; }
  .week-col { min-height: 0; }
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20;
    padding-top: calc(18px + env(safe-area-inset-top));
    transform: translateX(-102%); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
    box-shadow: var(--shadow-lg);
  }
  .nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 15; }

  .mobile-bar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 10;
    padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-bar .brand-name { font-size: 16px; }
  .mobile-bar .icon-btn { width: 36px; height: 36px; margin-left: -6px; }

  .content { padding: 22px 16px 120px; }
  h1 { font-size: 28px; }
  .main-header { align-items: center; }
  /* one row per note: tick, text, and a "more" menu instead of a row of icons */
  .note { grid-template-columns: auto minmax(0, 1fr) auto; padding: 6px 0 6px 24px; gap: 0 4px; align-items: start; }
  .note > div:not(.note-actions) { padding: 11px 0 6px; }
  .note-actions { display: none; }
  .note-actions.always { display: flex; grid-column: 2 / -1; padding-bottom: 6px; }
  .more-btn { display: inline-grid; width: 44px; height: 44px; border-radius: 12px; }
  .drag-handle { opacity: .55; }
  .check { width: 44px; height: 44px; margin: 0; }
  .check .ring { width: 24px; height: 24px; }
  .checklist li { align-items: center; min-height: 44px; padding: 0; }
  .cl-check { width: 44px; height: 44px; margin: 0 -10px 0 -14px; }
  .cl-check .ring { width: 20px; height: 20px; }
  .cl-remove { opacity: 1; width: 32px; height: 32px; }
  .cl-add-btn { display: none; } /* on phones it's "Add checklist item" in the note's ⋯ menu */
  .meta { margin-top: 2px; }
  .note > div:not(.note-actions) { padding: 10px 0 4px; }
  .composer kbd { display: none; }
  .nav-item, .day-item { min-height: 44px; }
  .mobile-bar .icon-btn { width: 44px; height: 44px; margin-left: -10px; }
  .day-nav .icon-btn { width: 44px; height: 44px; }
  .day-nav .pill { min-height: 44px; }
  /* header: the date gets the full width; title and day switcher share the next row */
  .content { padding: 12px 12px 120px; }
  .composer textarea { padding: 12px 0; }
  .main-header { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "eyebrow eyebrow" "title nav"; align-items: center; gap: 0 8px; margin-bottom: 10px; }
  .main-header .heading { display: contents; }
  .main-header .eyebrow { grid-area: eyebrow; }
  .main-header h1 { grid-area: title; }
  .main-header .day-nav { grid-area: nav; padding: 0; }
  .progress { margin-bottom: 8px; }
  .composer { margin-bottom: 14px; min-height: 48px; }
  .group-head { margin-bottom: 0; }
  .collapse-btn { min-height: 32px; }
  .group-actions .icon-btn, .ghost-btn { min-height: 32px; min-width: 32px; }
}
