/* SPDX-License-Identifier: LicenseRef-Proprietary
   Copyright (c) 2026 Griffith Software — https://griffith.software */

@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url('/fonts/nunito-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url('/fonts/nunito-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url('/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url('/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 900; font-display: swap; src: url('/fonts/nunito-latin-900-normal.woff2') format('woff2'); }

:root {
  --bg: #f3f3fb;
  --panel: #ffffff;
  --ink: #161a33;
  --ink-2: #4a4f6a;
  --ink-3: #7b8098;
  --line: #e6e6f2;
  --navy: #0f2c64;
  --orange: #f0661c;
  --sun: #ffc21a;
  --pink: #e5306c;
  --pink-2: #ff5a8a;
  --violet: #6a5ae0;
  --lav: #e3e2fb;
  --lav-2: #efeefd;
  --green: #2fa84f;
  --amber-bg: #fff3d6;
  --amber: #9a6400;
  --red: #d63a3a;
  --t-green: #e4f6e2;
  --t-blue: #e3eefc;
  --t-yellow: #fff1d9;
  --t-peach: #fde7dd;
  --t-purple: #efe9fd;
  --t-pink: #fde5ee;
  --b-green: #b9e3b3;
  --b-blue: #bcd5f6;
  --b-yellow: #f6d9a6;
  --b-peach: #f6c9b6;
  --b-purple: #d8cdf8;
  --b-pink: #f5c2d5;
  --shadow: 0 1px 2px rgba(22, 26, 51, 0.04), 0 4px 16px rgba(22, 26, 51, 0.06);
  --radius: 18px;
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color-scheme: light;
  --bg-top: #f1f1fb;
  --bg-bottom: #f6f5fc;
  --fill-hover: #e8e8f6;
  --btn-bg: #ececf7;
  --seg-bg: #efeff8;
  --chip-bg: #f1f1f8;
  --fill: #f4f4fa;
  --bg-2: #f6f6fc;
  --border: #d8d8ea;
  --border-2: #cfcfe3;
  --border-violet: #cfcdf3;
  --border-strong: #b9bbcf;
  --chip-border: #e3e3ef;
  --card-border: #ececf6;
  --border-soft: #dddcee;
  --line-soft: #f0f0f7;
  --pink-wash: #fff7fa;
  --pink-bg: #fde7ec;
  --pink-border: #f8c8d6;
  --red-bg: #fde8e8;
  --red-border: #f5c4c4;
  --amber-border: #f3dc9f;
  --amber-border-2: #e6d6a8;
  --amber-border-on: #f0c766;
  --note-bg: #fff6e2;
  --note-ink: #6b4a00;
  --info-bg: #eef1fe;
  --info-border: #d5dcfa;
  --info-ink: #2c3a7a;
  --green-bg: #e8f7ec;
  --quick-1: #eef6fe;
  --quick-2: #f4effd;
  --quick-3: #eefaf0;
  --agenda-1: #e6e9fb;
  --agenda-2: #eef0fd;
  --ink-4: #b8bacb;
  --header-bg: rgba(243, 243, 251, 0.88);
  --ghost-fill: rgba(255, 255, 255, 0.5);
  --toast-bg: #161a33;
}

/* Dark mode: follows the device unless Settings > Appearance picks Light or Dark (js/theme.js sets data-theme). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14162a;
    --panel: #1e2138;
    --ink: #eceefa;
    --ink-2: #b9bdd6;
    --ink-3: #8a8fab;
    --line: #2e3250;
    --navy: #a9c0ff;
    --violet: #9d92ff;
    --lav: #2c2a52;
    --lav-2: #24234a;
    --green: #4cc26c;
    --amber-bg: #3a2f12;
    --amber: #f0c060;
    --red: #ff7b7b;
    --t-green: #1f3527;
    --t-blue: #1d2c45;
    --t-yellow: #3a3018;
    --t-peach: #3d2a22;
    --t-purple: #2c2647;
    --t-pink: #3d2232;
    --b-green: #2f5a3a;
    --b-blue: #2f4a72;
    --b-yellow: #6a5426;
    --b-peach: #6a4232;
    --b-purple: #4a3f80;
    --b-pink: #6a3450;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
    --bg-top: #16182c;
    --bg-bottom: #121426;
    --fill-hover: #2a2d4a;
    --btn-bg: #2a2d4a;
    --seg-bg: #252843;
    --chip-bg: #272a45;
    --fill: #242742;
    --bg-2: #1a1c32;
    --border: #3a3e60;
    --border-2: #3e4266;
    --border-violet: #4a4590;
    --border-strong: #5a5f82;
    --chip-border: #363a5a;
    --card-border: #2b2e4b;
    --border-soft: #33375a;
    --line-soft: #282b47;
    --pink-wash: #2a1f33;
    --pink-bg: #42213a;
    --pink-border: #6b3555;
    --red-bg: #44222a;
    --red-border: #6b3038;
    --amber-border: #6a5426;
    --amber-border-2: #5c4a24;
    --amber-border-on: #8a6a2a;
    --note-bg: #33290f;
    --note-ink: #f3d38a;
    --info-bg: #222a4d;
    --info-border: #384578;
    --info-ink: #b7c4ff;
    --green-bg: #1d3526;
    --quick-1: #1f2b40;
    --quick-2: #2a2444;
    --quick-3: #1f3328;
    --agenda-1: #262a4c;
    --agenda-2: #22264a;
    --ink-4: #5c6080;
    --header-bg: rgba(22, 24, 44, 0.9);
    --ghost-fill: rgba(255, 255, 255, 0.04);
    --toast-bg: #2e3256;
  }
}
:root[data-theme='dark'] {
  --bg: #14162a;
  --panel: #1e2138;
  --ink: #eceefa;
  --ink-2: #b9bdd6;
  --ink-3: #8a8fab;
  --line: #2e3250;
  --navy: #a9c0ff;
  --violet: #9d92ff;
  --lav: #2c2a52;
  --lav-2: #24234a;
  --green: #4cc26c;
  --amber-bg: #3a2f12;
  --amber: #f0c060;
  --red: #ff7b7b;
  --t-green: #1f3527;
  --t-blue: #1d2c45;
  --t-yellow: #3a3018;
  --t-peach: #3d2a22;
  --t-purple: #2c2647;
  --t-pink: #3d2232;
  --b-green: #2f5a3a;
  --b-blue: #2f4a72;
  --b-yellow: #6a5426;
  --b-peach: #6a4232;
  --b-purple: #4a3f80;
  --b-pink: #6a3450;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
  --bg-top: #16182c;
  --bg-bottom: #121426;
  --fill-hover: #2a2d4a;
  --btn-bg: #2a2d4a;
  --seg-bg: #252843;
  --chip-bg: #272a45;
  --fill: #242742;
  --bg-2: #1a1c32;
  --border: #3a3e60;
  --border-2: #3e4266;
  --border-violet: #4a4590;
  --border-strong: #5a5f82;
  --chip-border: #363a5a;
  --card-border: #2b2e4b;
  --border-soft: #33375a;
  --line-soft: #282b47;
  --pink-wash: #2a1f33;
  --pink-bg: #42213a;
  --pink-border: #6b3555;
  --red-bg: #44222a;
  --red-border: #6b3038;
  --amber-border: #6a5426;
  --amber-border-2: #5c4a24;
  --amber-border-on: #8a6a2a;
  --note-bg: #33290f;
  --note-ink: #f3d38a;
  --info-bg: #222a4d;
  --info-border: #384578;
  --info-ink: #b7c4ff;
  --green-bg: #1d3526;
  --quick-1: #1f2b40;
  --quick-2: #2a2444;
  --quick-3: #1f3328;
  --agenda-1: #262a4c;
  --agenda-2: #22264a;
  --ink-4: #5c6080;
  --header-bg: rgba(22, 24, 44, 0.9);
  --ghost-fill: rgba(255, 255, 255, 0.04);
  --toast-bg: #2e3256;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--violet); }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid #8f84f0; outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { display: grid; place-items: center; height: 100vh; }
.boot img { border-radius: 22px; }
[hidden] { display: none !important; }

/* ---------- Wordmark ---------- */
.wordmark { display: inline-flex; align-items: flex-start; font-weight: 900; font-size: 34px; line-height: 1; text-decoration: none; letter-spacing: -0.02em; }
.wordmark .ugh { color: var(--navy); }
.wordmark .fine { color: var(--orange); margin-left: 0.18em; }
.wordmark .sparks { width: 0.6em; height: 0.6em; margin-left: 0.02em; margin-top: -0.18em; }
.wordmark.small { font-size: 26px; }
.byline { color: var(--ink-3); font-weight: 700; font-size: 13px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 12px 22px;
  position: sticky; top: 0; z-index: 20; background: var(--header-bg); backdrop-filter: blur(10px);
}
.topbar .menu-btn { display: none; }
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 210px; text-decoration: none; }
.family-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 14px; background: var(--fill-hover);
  font-weight: 800; border: 0; color: var(--ink);
}
.search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.search input {
  width: 100%; padding: 11px 16px 11px 42px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--panel);
}
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line); max-height: 60vh; overflow: auto; padding: 6px; z-index: 30;
}
.search-results button { display: flex; width: 100%; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 10px; }
.search-results button:hover, .search-results button:focus-visible { background: var(--lav-2); }
.search-results .muted { padding: 10px 12px; }
.icon-btn { border: 0; background: none; padding: 8px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--ink); position: relative; }
.icon-btn:hover { background: var(--fill-hover); }
.dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); border: 2px solid var(--bg); }
.me-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px; border-radius: 999px; }

.sidebar { padding: 8px 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 68px; height: calc(100vh - 68px); }
.nav a {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; text-decoration: none;
  color: var(--ink); font-weight: 800; font-size: 17px;
}
.nav a:hover { background: var(--fill-hover); }
.nav a.active { background: var(--lav); }
.nav a svg { color: var(--navy); }
.sidebar hr { border: 0; border-top: 1px solid var(--border-soft); margin: 10px 4px; }
.plus-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--pink); font-weight: 900; text-decoration: none; font-size: 17px; }
.side-card {
  margin-top: auto; background: linear-gradient(180deg, var(--panel) 0%, var(--pink-wash) 100%); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); text-align: center;
}
.side-card .emoji { font-size: 54px; line-height: 1; }
.side-card h3 { font-size: 22px; margin: 6px 0 4px; }
.side-card p { margin: 0; color: var(--ink-2); font-weight: 600; }
.side-foot { text-align: center; color: var(--ink-3); font-weight: 700; font-size: 13px; padding-top: 10px; }

.main { padding: 6px 22px 40px 8px; min-width: 0; }
.main:focus { outline: none; }
.page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.page.single { grid-template-columns: minmax(0, 1fr); max-width: 980px; }
.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--card-border); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 8px; }
.card-head h2 { font-size: 22px; }
.card-head .spacer { flex: 1; }
.link-btn { border: 0; background: none; color: var(--violet); font-weight: 800; padding: 4px 6px; border-radius: 8px; text-decoration: none; }
.link-btn:hover { background: var(--lav-2); }

.hero { display: flex; align-items: flex-start; gap: 16px; padding: 8px 2px 4px; }
.hero h1 { font-size: 40px; display: flex; align-items: flex-start; gap: 6px; }
.hero h1 svg { width: 30px; height: 30px; margin-top: -4px; }
.hero p { margin: 4px 0 0; color: var(--ink-2); font-size: 18px; font-weight: 600; }
.hero .spacer { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px;
  padding: 11px 18px; font-weight: 800; background: var(--btn-bg); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(0.97); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--pink-2), var(--pink)); color: #fff; box-shadow: 0 4px 12px rgba(229, 48, 108, 0.28); }
.btn.violet { background: #6a5ae0; color: #fff; }
.btn.ghost { background: var(--panel); border: 1.5px solid var(--border); }
.btn.danger { background: var(--red-bg); color: var(--red); }
.btn.big { font-size: 19px; padding: 13px 22px; border-radius: 16px; }
.btn.block { width: 100%; }
.split { display: inline-flex; }
.split .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255, 255, 255, 0.4); padding: 11px 12px; }

/* ---------- List tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 16px 8px 14px; border-radius: 18px; border: 1.5px solid transparent; text-decoration: none; color: var(--ink);
  min-height: 150px; transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile .emoji { font-size: 50px; line-height: 1.1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.12)); }
.tile .name { font-weight: 900; font-size: 18px; margin-top: 8px; line-height: 1.15; }
.tile .count { color: var(--ink-2); font-weight: 600; font-size: 14px; margin-top: 2px; }
.tile .lock { position: absolute; top: 10px; right: 12px; color: var(--amber); }
.tile.add { border: 2px dashed var(--border-2); background: var(--ghost-fill); color: var(--ink-2); }
.tile.add .plus { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--border-2); display: grid; place-items: center; color: var(--violet); margin-bottom: 6px; }
.c-green { background: var(--t-green); border-color: var(--b-green); }
.c-blue { background: var(--t-blue); border-color: var(--b-blue); }
.c-yellow { background: var(--t-yellow); border-color: var(--b-yellow); }
.c-peach { background: var(--t-peach); border-color: var(--b-peach); }
.c-purple { background: var(--t-purple); border-color: var(--b-purple); }
.c-pink { background: var(--t-pink); border-color: var(--b-pink); }
.h-green { background: var(--t-green); }
.h-blue { background: var(--t-blue); }
.h-yellow { background: var(--t-yellow); }
.h-peach { background: var(--t-peach); }
.h-purple { background: var(--t-purple); }
.h-pink { background: var(--t-pink); }

/* ---------- List panel and items ---------- */
.list-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; margin: 10px 10px 4px; }
.list-head .emoji { font-size: 30px; }
.list-head h2 { font-size: 24px; flex: 1; }
.list-head h2 a { color: inherit; text-decoration: none; }
.list-head .count { color: var(--ink-2); font-weight: 700; }
.add-row { display: flex; gap: 8px; padding: 8px 14px 6px; align-items: center; }
.add-input { flex: 1; min-width: 0; position: relative; }
.add-row .btn.ghost { padding: 10px 11px; }
.add-input input {
  width: 100%; border: 1.5px solid var(--border-violet); border-radius: 14px; padding: 11px 14px 11px 40px; background: var(--panel); font-size: 16px;
}
.add-input svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--violet); }
.toggle-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--amber-border-2); border-radius: 999px; padding: 8px 12px;
  background: var(--panel); font-weight: 800; color: var(--amber); font-size: 14px;
}
.toggle-chip[aria-pressed='true'] { background: var(--amber-bg); border-color: var(--amber-border-on); }
.toggle-chip.me { border-color: var(--b-purple); color: var(--violet); }
.toggle-chip.me[aria-pressed='true'] { background: var(--lav); border-color: var(--violet); }
.items { list-style: none; margin: 0; padding: 4px 8px 10px; }
.item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto 34px; align-items: center; gap: 8px; padding: 9px 8px;
  border-bottom: 1px solid var(--line-soft); border-radius: 10px;
}
.item:last-child { border-bottom: 0; }
.item.private { background: linear-gradient(90deg, var(--pink-wash) 0%, var(--panel) 75%); }
.check {
  width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--panel); display: grid; place-items: center; padding: 0; color: #fff;
}
.check[aria-checked='true'] { background: var(--green); border-color: var(--green); }
.item .text { min-width: 0; border: 0; background: none; text-align: left; padding: 2px 0; }
.item .text .t { font-weight: 700; font-size: 16.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .text .sub { color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.item.done .t { text-decoration: line-through; color: var(--ink-3); }
.item .qty { color: var(--ink-2); font-weight: 700; font-size: 14px; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 13px;
  background: var(--chip-bg); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--chip-border);
}
.chip.person { background: var(--panel); }
.chip.adults { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.chip.date { background: var(--panel); }
.chip.today { background: var(--pink-bg); color: var(--pink); border-color: var(--pink-border); }
.chip.over { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.chip.c-green, .chip.c-blue, .chip.c-yellow, .chip.c-peach, .chip.c-purple, .chip.c-pink { border-width: 1px; }
.done-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 10px 18px; color: var(--ink-2); font-weight: 800; }
.empty { padding: 26px 18px; text-align: center; color: var(--ink-3); font-weight: 700; font-size: 16px; }
.empty .emoji { font-size: 40px; display: block; margin-bottom: 6px; }

/* ---------- Agenda (Today / Upcoming) ---------- */
.agenda-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin: 10px; background: linear-gradient(90deg, var(--agenda-1), var(--agenda-2)); }
.agenda-head h2 { font-size: 20px; }
.agenda { list-style: none; margin: 0; padding: 0 10px 10px; }
.agenda li { display: grid; grid-template-columns: 30px 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line-soft); }
.agenda li:last-child { border-bottom: 0; }
.agenda .emoji { font-size: 24px; text-align: center; }
.agenda .t { font-weight: 800; }
.agenda .sub { color: var(--ink-3); font-weight: 600; font-size: 13px; }

/* ---------- Members ---------- */
.people { list-style: none; margin: 0; padding: 4px 12px 12px; }
.people li { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 1px solid var(--line-soft); }
.people li:last-child { border-bottom: 0; }
.people .who { flex: 1; min-width: 0; }
.people .name { font-weight: 900; font-size: 17px; }
.people .role { color: var(--ink-3); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 4px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 16px; flex: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.av-0 { background: #8a7cf0; } .av-1 { background: #7d8aa8; } .av-2 { background: #f5a524; } .av-3 { background: #f06292; }
.av-4 { background: #33b6a6; } .av-5 { background: #4b8fe2; } .av-6 { background: #e36d4f; } .av-7 { background: #5cb85c; }
.role-chip { padding: 3px 10px; border-radius: 999px; background: var(--lav-2); color: var(--violet); font-weight: 800; font-size: 13px; }

/* ---------- Activity ---------- */
.activity { list-style: none; margin: 0; padding: 4px 16px 14px; }
.activity li { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.activity li:last-child { border-bottom: 0; }
.activity .badge { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; }
.activity .b-add { background: var(--green-bg); color: var(--green); }
.activity .b-done { background: var(--green-bg); color: var(--green); }
.activity .b-cal { background: var(--pink-bg); color: var(--pink); }
.activity .what { font-weight: 700; }
.activity .what b { font-weight: 900; }
.activity .when { color: var(--ink-3); font-weight: 600; font-size: 13px; }

/* ---------- Calendar ---------- */
.month-nav { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 4px 16px 6px; font-weight: 900; font-size: 19px; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 4px 12px 14px; text-align: center; }
.month .dow { color: var(--ink-2); font-weight: 800; font-size: 13px; padding: 4px 0; }
.month button { border: 0; background: none; border-radius: 50%; aspect-ratio: 1; font-weight: 800; position: relative; max-width: 44px; margin: auto; width: 100%; }
.month button.other { color: var(--ink-4); }
.month button.today { background: var(--pink); color: #fff; }
.month button.sel { box-shadow: 0 0 0 2px var(--violet) inset; }
.month button .ev { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--pink); }
.month button.today .ev { background: #fff; }
.month.big button { border-radius: 14px; aspect-ratio: auto; height: 64px; max-width: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 8px; }
.month.big button.today { background: var(--pink-bg); color: var(--pink); }
.month.big button.today .ev { background: var(--pink); }
.datebox { width: 52px; border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 4px 0; background: var(--panel); flex: none; }
.datebox .m { color: var(--pink); font-weight: 900; font-size: 12px; }
.datebox .d { font-weight: 900; font-size: 22px; line-height: 1.05; }
.upcoming { list-style: none; margin: 0; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.upcoming li { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.upcoming .t { font-weight: 900; }
.upcoming .sub { color: var(--ink-3); font-weight: 600; font-size: 13.5px; }
.upcoming .right { margin-left: auto; color: var(--ink-2); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ---------- Quick cards ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick a {
  display: grid; grid-template-columns: 36px 1fr 16px; gap: 6px 12px; align-items: center; padding: 14px 16px; border-radius: 16px;
  text-decoration: none; color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.quick a b { font-weight: 900; font-size: 16px; }
.quick a span { grid-column: 2 / 4; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.quick a:nth-child(1) { background: var(--quick-1); }
.quick a:nth-child(2) { background: var(--quick-2); }
.quick a:nth-child(3) { background: var(--quick-3); }

/* ---------- Forms & dialogs ---------- */
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 20px 60px rgba(22, 26, 51, 0.25); color: var(--ink); background: var(--panel);
}
dialog::backdrop { background: rgba(22, 26, 51, 0.35); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.dlg-head h2 { font-size: 22px; flex: 1; }
.dlg-body { padding: 8px 20px 12px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { display: flex; gap: 10px; padding: 12px 20px 18px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line-soft); }
.dlg-foot .left { margin-right: auto; }
div.field { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
div.field > .row { align-self: stretch; }
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.field input, .field select, .field textarea, .input {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--panel); font-size: 16px; color: var(--ink); font-weight: 600;
}
.field textarea { min-height: 76px; resize: vertical; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }
.seg { display: inline-flex; background: var(--seg-bg); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 10px; font-weight: 800; color: var(--ink-2); }
.seg button[aria-pressed='true'] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--fill); font-weight: 700; }
.note { background: var(--note-bg); border: 1px solid var(--amber-border); color: var(--note-ink); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.note.info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-ink); }
.muted { color: var(--ink-3); font-weight: 600; }
.small { font-size: 13px; }
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink-2); }
.switch input { width: 44px; height: 26px; accent-color: var(--violet); }
.code-box { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 30px; font-weight: 800; letter-spacing: 0.06em; text-align: center; background: var(--fill); border-radius: 14px; padding: 14px; user-select: all; }
.qr { display: grid; place-items: center; }
.qr canvas { width: 200px; height: 200px; image-rendering: pixelated; border-radius: 10px; }
.menu { position: fixed; z-index: 60; background: var(--panel); border-radius: 14px; box-shadow: 0 10px 30px rgba(22, 26, 51, 0.18); border: 1px solid var(--line); padding: 6px; min-width: 200px; }
.menu button { display: flex; width: 100%; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; font-weight: 700; }
.menu button:hover, .menu button:focus-visible { background: var(--lav-2); }
.menu button.danger { color: var(--red); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 4px; }

.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--toast-bg); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2); display: flex; gap: 12px; align-items: center; }
.toast button { background: none; border: 0; color: #ffd36b; font-weight: 900; }
.offline-bar { background: var(--amber-bg); color: var(--note-ink); font-weight: 800; text-align: center; padding: 6px; font-size: 14px; }

/* ---------- Sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(460px, 100%); background: var(--panel); border-radius: 26px; box-shadow: var(--shadow); padding: 28px 26px; display: flex; flex-direction: column; gap: 16px; text-align: center; }
.auth-card img { margin: 0 auto; border-radius: 26px; }
.auth-card .wordmark { justify-content: center; font-size: 40px; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-card .tagline { font-size: 18px; font-weight: 700; color: var(--ink-2); margin: 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-weight: 800; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.error { color: var(--red); font-weight: 800; font-size: 14px; }

/* ---------- Prose pages ---------- */
.prose { padding: 22px 26px; line-height: 1.55; font-size: 16px; }
.prose h1 { font-size: 30px; margin-bottom: 8px; }
.prose h2 { font-size: 20px; margin: 20px 0 6px; }
.prose ol, .prose ul { padding-left: 22px; margin: 6px 0; }
.prose li { margin: 4px 0; }
.stamp { font-weight: 800; color: var(--ink-2); }
.feature-list { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.feature-list li { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.feature-list svg { color: var(--green); flex: none; }
.settings-section { display: flex; flex-direction: column; gap: 12px; }
.settings-section h2 { font-size: 20px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line-soft); }

/* ---------- Dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.linkish, .agenda .text, .upcoming .text { border: 0; background: none; text-align: left; padding: 0; min-width: 0; }
.section-title { font-size: 22px; margin-top: 8px; }
.about-icon { border-radius: 22px; }
.spacer { flex: 1; }
.history-item .spacer { flex: 1; }
.field > b, .field-label b { font-weight: 800; font-size: 14px; color: var(--ink-2); }
.note svg { vertical-align: -3px; }

/* ---------- Narrow screens ---------- */
@media (max-width: 1180px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .quick { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar .brand { min-width: 0; }
  .topbar .wordmark.small { font-size: 22px; }
  .topbar .family-pill { display: none; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .topbar { flex-wrap: wrap; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; height: 100vh; top: 0; background: var(--bg-2); z-index: 50; padding-top: 18px;
    transform: translateX(-105%); transition: transform 0.2s ease; box-shadow: 10px 0 40px rgba(0, 0, 0, 0.15);
  }
  .shell.nav-open .sidebar { transform: none; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(22, 26, 51, 0.3); z-index: 45; }
  .shell.nav-open .scrim { display: block; }
  .main { padding: 4px 12px 90px; }
  .hero { flex-wrap: wrap; }
  .hero > div:first-child { flex: 1 1 100%; }
  .hero .spacer { display: none; }
  .hero h1 { font-size: 30px; }
  .add-row { flex-wrap: wrap; }
  .add-input { flex-basis: 100%; }
  .list-head h2 { font-size: 21px; }
  .hero p { font-size: 16px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
  .tile { min-height: 124px; }
  .tile .emoji { font-size: 40px; }
  .tile .name { font-size: 16px; }
  .item { grid-template-columns: 32px minmax(0, 1fr) auto 30px; }
  .item .assignee-cell { display: none; }
  .bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--ink-2); font-weight: 800; font-size: 12px; padding: 4px; border-radius: 12px; }
  .bottom-nav a.active { color: var(--violet); background: var(--lav-2); }
}
@media (min-width: 861px) { .bottom-nav, .scrim { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.guide-links { padding-left: 20px; margin: 4px 0 14px; }
.guide-links a { font-weight: 800; color: var(--violet); }
.auth-foot { margin: 0; font-size: 13px; color: var(--ink-3); }
.auth-foot a { color: var(--ink-2); font-weight: 700; }
.doc-page { background: var(--bg); }
.doc-page .page { margin: 0 auto; padding: 24px 16px; }
