:root {
  /* Light theme — warm and low-glare (same approach as Selah): cream ground, white cards,
     beige borders and navy text instead of cold blue-white + near-black, with the pastel mint accent */
  --bg: #fbf9f5;
  --surface: #ffffff;
  --surface-alt: #f3f0ea;
  --text: #26313f;
  --text-muted: #6f7988;
  --text-subtle: #9aa1ab;
  --border: #e7e1d6;
  --border-soft: #f3f0ea;

  --accent: #a7f3d0;        /* emerald 200 — pastel mint button bg */
  --accent-hover: #6ee7b7;  /* emerald 300 */
  --accent-soft: #d1fae5;   /* emerald 100 */
  --accent-text: #065f46;   /* emerald 800 — dark text on pastel bg */
  --accent-strong: #10b981; /* emerald 500 — for icons, active states, dots */

  --danger: #fecaca;         /* red 200 pastel */
  --danger-hover: #fca5a5;   /* red 300 */
  --danger-soft: #fee2e2;
  --danger-text: #991b1b;    /* red 800 */
  --late: #b91c1c;           /* red 700: overdue labels */

  --warn: #fde68a;           /* amber 200 pastel */
  --warn-soft: #fef3c7;
  --warn-text: #92400e;      /* amber 800 */

  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.10);

  --nav-height: 72px;
  --max-w: 640px;

  /* priority dots */
  --p-low: #94a3b8;
  --p-medium: #10b981;
  --p-high: #f59e0b;
  --p-urgent: #ef4444;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* text size preference: everything is rem-based, so scaling the root scales the UI */
/* one step below the browser's 16px: the earlier 14/16/18 scale read oversized, especially with wide fonts like Jakarta */
html.size-small  { font-size: 13px; }
html.size-medium { font-size: 15px; }
html.size-large  { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: .9375rem;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

/* ------- font variants ------- */
body.font-inter    { --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
body.font-jakarta  { --font-ui: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
body.font-geist    { --font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }

/* ------- dark theme ------- */
/* Explicit dark */
body.theme-dark { color-scheme: dark; }
body.theme-light { color-scheme: light; }
@media (prefers-color-scheme: dark) { body.theme-system { color-scheme: dark; } }
body.theme-dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #273449;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --border: #334155;
  --border-soft: #273449;

  --accent: #064e3b;         /* emerald 900 — deep soft button bg */
  --accent-hover: #065f46;   /* emerald 800 */
  --accent-soft: rgba(16, 185, 129, 0.15);
  --accent-text: #a7f3d0;    /* emerald 200 — light text on deep bg */
  --accent-strong: #34d399;  /* emerald 400 — brighter for icons */

  --danger: #7f1d1d;         /* red 900 */
  --danger-hover: #991b1b;   /* red 800 */
  --danger-soft: rgba(239, 68, 68, 0.15);
  --danger-text: #fecaca;    /* red 200 */
  --late: #f87171;           /* red 400: overdue labels read red, not pink, on the dark ground */

  --warn: #78350f;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --warn-text: #fde68a;
}
/* System theme — follow OS */
@media (prefers-color-scheme: dark) {
  body.theme-system {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-alt: #273449;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --border: #334155;
    --border-soft: #273449;

    --accent: #064e3b;
    --accent-hover: #065f46;
    --accent-soft: rgba(16, 185, 129, 0.15);
    --accent-text: #a7f3d0;
    --accent-strong: #34d399;

    --danger: #7f1d1d;
    --danger-hover: #991b1b;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --danger-text: #fecaca;
    --late: #f87171;

    --warn: #78350f;
    --warn-soft: rgba(245, 158, 11, 0.15);
    --warn-text: #fde68a;
  }
}

a { color: inherit; text-decoration: none; }

/* ------- layout ------- */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

.page-header {
  padding: 1rem 0 1.5rem;
}
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  letter-spacing: -0.015em;
}
.page-header .subtitle {
  color: var(--text-muted);
  font-size: .9375rem;
  margin: 0;
}

/* ------- bottom nav (WA-style) ------- */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--nav-height);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  justify-content: center;
  z-index: 100;
}
.nav-item {
  flex: 1 1 0;
  max-width: 140px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  color: var(--text-subtle);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: .5rem 0;
  transition: color 120ms ease;
}
.nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.75;
  transition: transform 120ms ease;
}
.nav-item.active {
  color: var(--accent-strong);
}
.nav-item.active svg {
  stroke-width: 2.25;
}

/* ------- cards & surfaces ------- */

.card {
  background: var(--surface);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-soft);
  margin-bottom: 1rem;
}

.section { margin-bottom: 1.5rem; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 .75rem;
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.section-title .count {
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: .125rem .5rem;
  border-radius: var(--radius-full);
  font-size: .6875rem;
}

/* ------- forms ------- */

.stack { display: flex; flex-direction: column; gap: .875rem; }
label.field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem .875rem;
  width: 100%;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 72px; }

button {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem;
  transition: background 120ms ease, transform 60ms ease;
}
button:hover { background: var(--accent-hover); }
button:active { transform: scale(0.98); }

button.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
button.ghost:hover { background: var(--surface-alt); color: var(--text); }

button.danger {
  background: var(--danger);
  color: var(--danger-text);
}
button.danger:hover { background: var(--danger-hover); }

button.icon {
  padding: .5rem;
  background: transparent;
  color: var(--text-muted);
}
button.icon:hover { background: var(--surface-alt); color: var(--text); }
button.icon svg { width: 20px; height: 20px; display: block; }

form.inline { display: inline-flex; margin: 0; }

/* ------- login screen ------- */

body.auth {
  background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom);
}
.auth-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.5rem;
  max-width: 420px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 2rem;
}
.brand .logo {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--accent-text);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand .logo svg { width: 26px; height: 26px; stroke-width: 2.5; }
.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.error, .info {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.error { background: var(--danger-soft); color: var(--danger-text); }
.info  { background: var(--accent-soft); color: var(--accent-text); }

/* ------- tasks ------- */

.quickadd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.quickadd form { display: flex; flex-direction: column; gap: .75rem; }
.quickadd textarea {
  border: none;
  padding: 0;
  min-height: 24px;
  font-size: 1rem;
  background: transparent;
}
.quickadd textarea:focus { box-shadow: none; }
.quickadd .quickadd-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border-soft);
}
.quickadd .hint {
  font-size: .75rem;
  color: var(--text-subtle);
}
.quickadd button { padding: .5rem 1rem; font-size: .875rem; }

.tasklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.task {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  transition: background 120ms ease, opacity 180ms ease, transform 180ms ease;
}
.task:hover { background: var(--surface-alt); }

/* checkbox custom */
.task-check {
  flex-shrink: 0;
  margin-top: 2px;
}
.task-check button {
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1.75px solid var(--text-subtle);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 180ms ease;
}
.task-check button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
}
.task-check button svg {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.task.done .task-check button {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.task.done .task-title { text-decoration: line-through; color: var(--text-subtle); }

.task-main { flex: 1; min-width: 0; }
.task-title {
  color: var(--text);
  font-weight: 500;
  display: block;
  margin-bottom: .25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .75rem;
  color: var(--text-muted);
  align-items: center;
}
.task-meta .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--p-medium);
}
.task-meta .dot.p-low    { background: var(--p-low); }
.task-meta .dot.p-medium { background: var(--p-medium); }
.task-meta .dot.p-high   { background: var(--p-high); }
.task-meta .dot.p-urgent { background: var(--p-urgent); }

.task-meta .deadline { display: inline-flex; align-items: center; gap: .25rem; }
.task-meta .deadline.overdue { color: var(--late); }
.task-meta svg { width: 12px; height: 12px; stroke-width: 2; }

.task-action-del {
  padding: .25rem;
  color: var(--text-subtle);
  background: transparent;
  opacity: 0;
  transition: opacity 120ms;
}
.task:hover .task-action-del { opacity: 1; }
.task-action-del:hover { color: var(--danger-text); background: var(--danger-soft); }

/* empty states */
.empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}
.empty svg { width: 48px; height: 48px; color: var(--text-subtle); margin-bottom: .5rem; }
.empty p { margin: 0; font-size: .875rem; }

/* ------- projects ------- */

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .0625rem .375rem;
  border-radius: var(--radius-full);
  background: var(--surface-alt);
  font-size: .6875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.project-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

/* list of projects on settings page */
.project-list {
  list-style: none;
  margin: 0 0 .75rem;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.project-list > li + li,
.project-list > li details,
.project-list > li.project-row-static {
  border-top: 1px solid var(--border-soft);
}
.project-list > li:first-child > *,
.project-list > li:first-child {
  border-top: none;
}

.project-row {
  position: relative;
}
.project-row > summary,
.project-row-static {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1rem;
  cursor: pointer;
  user-select: none;
}
.project-row-static { cursor: default; }
.project-row > summary::-webkit-details-marker { display: none; }
.project-row > summary:hover { background: var(--surface-alt); }

.project-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}
.project-name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-chev {
  color: var(--text-subtle);
  flex-shrink: 0;
  transition: transform 180ms ease;
}
.project-row[open] > summary .project-chev { transform: rotate(90deg); }

.project-badge-tag {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  padding: .125rem .5rem;
  border-radius: var(--radius-full);
  background: var(--surface-alt);
}

.project-edit {
  padding: .25rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-soft);
}
.project-edit-form {
  display: flex;
  gap: .5rem;
  margin: 0;
}
.project-edit-form input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  padding: .625rem .75rem;
  font-size: .9375rem;
}
.project-edit-form button {
  padding: .625rem 1rem;
  font-size: .875rem;
  flex-shrink: 0;
}

button.link-danger {
  align-self: flex-start;
  background: transparent;
  color: var(--danger-text);
  padding: .375rem .5rem;
  margin-left: -.5rem;
  font-size: .8125rem;
  font-weight: 500;
}
button.link-danger:hover { background: var(--danger-soft); }

/* add project collapsible */
.project-add {
  margin-top: .5rem;
}
.project-add > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1rem;
  cursor: pointer;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .9375rem;
  transition: background 120ms ease;
}
.project-add > summary::-webkit-details-marker { display: none; }
.project-add > summary:hover { background: var(--accent); }
.project-add[open] > summary { border-radius: var(--radius) var(--radius) 0 0; }

.project-add-form {
  background: var(--surface);
  padding: 1rem;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  flex-direction: column;
  gap: .875rem;
}
.project-add-form input[type="text"] {
  font-size: 1rem;
  padding: .75rem .875rem;
}

/* color swatch palette */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.color-palette input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.color-palette label {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--c, #64748b);
  cursor: pointer;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.color-palette label:hover { transform: scale(1.1); }
.color-palette input[type="radio"]:checked + label {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c, #64748b);
  transform: scale(1.05);
}
.color-palette input[type="radio"]:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------- preference pickers (theme / font) ------- */

.pref-group {
  margin: 0 0 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}
.pref-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: .625rem;
}
.pref-choices {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.pref-choice {
  position: relative;
  cursor: pointer;
}
.pref-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pref-choice span {
  display: inline-flex;
  align-items: center;
  padding: .5rem .875rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 120ms ease;
}
.pref-choice:hover span {
  background: var(--border-soft);
  color: var(--text);
}
.pref-choice input[type="radio"]:checked + span {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-strong);
  font-weight: 600;
}

/* ------- todo page: chips + sections + FAB + dialog ------- */

.chip-row {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  margin: 0 -1.25rem 1.25rem;
  padding: 0 1.25rem;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  flex-shrink: 0;
  padding: .375rem .75rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .8125rem;
  font-weight: 500;
  transition: all 120ms ease;
}
.chip:hover { background: var(--surface-alt); color: var(--text); }
.chip.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: var(--accent-strong);
  font-weight: 600;
}
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

/* collapsible todo section */
.todo-section {
  margin-bottom: .5rem;
}
.todo-section > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 0;
  cursor: pointer;
  user-select: none;
}
.todo-section > summary::-webkit-details-marker { display: none; }

.section-chev {
  display: inline-flex;
  color: var(--text-subtle);
  transition: transform 180ms ease;
}
.todo-section[open] .section-chev { transform: rotate(90deg); }

.section-label {
  font-size: .8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex: 1;
}
.section-label-overdue { color: var(--late); }
.section-label-today { color: var(--accent-text); }

.section-count {
  background: var(--surface-alt);
  color: var(--text-muted);
  padding: .125rem .5rem;
  border-radius: var(--radius-full);
  font-size: .6875rem;
  font-weight: 600;
}

/* FAB — floating action button */
.fab {
  position: fixed;
  right: max(1.25rem, calc(50vw - var(--max-w) / 2 + 1.25rem));
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 1rem);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-strong);
  color: #fff;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
  z-index: 90;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.fab:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.45);
}
.fab:active { transform: scale(0.95); }
body.theme-dark .fab { box-shadow: 0 6px 20px rgba(52, 211, 153, 0.25); }

/* quick-add dialog — iOS sheet, reuses the settings group look */
.quick-dialog {
  border: none;
  border-radius: 20px;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  width: calc(100% - 1.5rem);
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.quick-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}
.quick-dialog-form { display: flex; flex-direction: column; padding: 1rem 1rem 1.25rem; }
.quick-dialog-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 1rem;
}
.quick-dialog-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 600; text-align: center; }
.quick-dialog-head button {
  padding: .25rem 0;
  background: none;
  border: none;
  box-shadow: none;
  font: inherit;
  font-size: 1rem;
  color: var(--accent-text);
  cursor: pointer;
}
.qd-close { justify-self: end; display: inline-flex; color: var(--text-muted) !important; }
.qd-add {
  margin-top: 1rem;
  padding: .75rem;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.qd-add:hover { background: var(--accent-hover); }
.qd-add:disabled { opacity: .5; }
.quick-dialog textarea {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: .875rem 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  resize: none;
}
.quick-dialog textarea:focus { outline: none; border: none; box-shadow: none; }
.qd-hint { margin: .5rem 0 1rem .25rem; font-size: .75rem; color: var(--text-subtle); }
.qd-foot { margin: .5rem 0 0 .25rem; font-size: .6875rem; color: var(--text-subtle); }

/* satu baris: project · urgensi · deadline */
.qd-opts { display: grid; grid-template-columns: 1fr 1fr 1.5fr; gap: .5rem; }
.qd-opt {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  min-width: 0;
  padding: .5rem .625rem;
  background: var(--surface-alt);
  border-radius: 12px;
  cursor: pointer;
}
.qd-opt > span { font-size: .625rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-subtle); }
.qd-opt select, .qd-opt input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: .8125rem;
  text-overflow: ellipsis;
  cursor: pointer;
}
.qd-opt select:focus, .qd-opt input:focus { outline: none; border: none; box-shadow: none; }
.qd-opt select option { background: var(--surface); color: var(--text); }
.qd-opt:focus-within { box-shadow: 0 0 0 2px var(--accent-strong); }

/* ------- task detail: seamless sheet ------- */

.detail-top {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}
.back-link {
  color: var(--text-muted);
  font-size: .875rem;
  display: inline-flex;
  align-items: center;
  gap: .125rem;
  margin-left: -.25rem;
}
.back-link:hover { color: var(--text); }
.save-state { flex: 1; text-align: center; font-size: .75rem; color: var(--text-subtle); }
.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-subtle);
  box-shadow: none;
}
.icon-btn:hover { background: var(--surface-alt); color: var(--danger-text); }

.sheet { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.sheet-title, .sheet-notes {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;
  resize: none;
  overflow: hidden;
  color: var(--text);
  font-family: inherit;
}
.sheet-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  min-height: 0;
  display: block;
}
.sheet-notes { font-size: .9375rem; line-height: 1.6; min-height: 4.5rem; }
.sheet-title::placeholder, .sheet-notes::placeholder, .sub-add input::placeholder { color: var(--text-subtle); }

.dot.p-low    { background: var(--p-low); }
.dot.p-medium { background: var(--p-medium); }
.dot.p-high   { background: var(--p-high); }
.dot.p-urgent { background: var(--p-urgent); }

/* title + round done-checkbox */
.title-row { display: flex; align-items: flex-start; gap: .875rem; }
.title-row .sheet-title { flex: 1; min-width: 0; }
.round-check {
  width: 28px;
  height: 28px;
  margin-top: .25rem;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 2px solid var(--text-subtle);
  background: transparent;
  color: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.round-check:hover { border-color: var(--accent-strong); background: transparent; }
.round-check[aria-checked="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.title-row.is-done .sheet-title { color: var(--text-subtle); text-decoration: line-through; }

/* properties: one grouped list, label left / value right */
.group { background: var(--surface-alt); border-radius: 14px; overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .625rem 1rem;
  min-height: 44px;
  cursor: pointer;
}
.row-inline { flex-wrap: wrap; gap: .5rem 1.25rem; cursor: default; }
.cell { position: relative; display: inline-flex; align-items: center; gap: .5rem; min-width: 0; cursor: pointer; }
.cell .row-label { gap: 0; }
.cell .row-label svg { width: 16px; height: 16px; }
.cell .row-value { flex: 0 1 auto; gap: .375rem; }
.cell .row-value select { field-sizing: content; max-width: 9rem; text-overflow: ellipsis; }
.row + .row { border-top: 1px solid var(--border-soft); }
.row-label { display: inline-flex; align-items: center; gap: .625rem; color: var(--text-muted); font-size: .875rem; flex-shrink: 0; }
.row-label svg { color: var(--text-subtle); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-value { display: inline-flex; align-items: center; justify-content: flex-start; flex: 1; gap: .5rem; min-width: 0; color: var(--text); font-size: .9375rem; }
.row-value .dot { width: 9px; height: 9px; border-radius: var(--radius-full); flex-shrink: 0; }
.row-value input, .row-value select {
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  text-transform: capitalize;
  cursor: pointer;
}
.row { position: relative; }
.row-value input.dl-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.dl-text { white-space: nowrap; }
.dl-text.is-empty { color: var(--text-subtle); }
.dl-text.overdue { color: var(--danger-text); }
.row-value .pill-clear { position: relative; z-index: 1; }
.row-value input.num { width: 2.25rem; field-sizing: content; min-width: 1.5ch; text-transform: none; cursor: text; }
.row-value input.num::placeholder { color: var(--text-subtle); }
.row-value input[type=number]::-webkit-inner-spin-button { display: none; }
.row-value .unit { color: var(--text-subtle); font-size: .875rem; white-space: nowrap; }
.pill-clear {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0 .25rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-subtle);
  cursor: pointer;
}
.pill-clear:hover { color: var(--text); background: none; }

.sheet-section { margin-bottom: 1.75rem; }
.sheet-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sheet-label .count { font-weight: 500; color: var(--text-subtle); letter-spacing: 0; }

.progress { height: 3px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; margin-bottom: .5rem; }
.progress span { display: block; height: 100%; background: var(--accent-strong); border-radius: 999px; transition: width .3s; }

.subs { list-style: none; margin: 0; padding: 0; }
.sub, .sub-add { display: flex; align-items: center; gap: .75rem; padding: .5rem 0; }
.sub-title { flex: 1; min-width: 0; color: var(--text); font-size: .9375rem; word-break: break-word; }
.sub.done .sub-title { color: var(--text-subtle); text-decoration: line-through; }
.sub-check {
  width: 22px;
  height: 22px;
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--text-subtle);
  background: transparent;
  color: transparent;
  box-shadow: none;
}
button.sub-check:hover { border-color: var(--accent-strong); }
.sub.done .sub-check { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.sub-check-ghost { border-style: dashed; opacity: .6; }
.sub-del {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0 .25rem;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-subtle);
  opacity: 0;
  transition: opacity .15s;
}
.sub:hover .sub-del, .sub-del:focus-visible { opacity: 1; }
@media (hover: none) { .sub-del { opacity: .6; } }
.sub-del:hover { color: var(--danger-text); background: none; }
.sub-add { margin: 0; }
.sub-add input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;
  font-size: .9375rem;
  color: var(--text);
}

/* ------- custom confirm dialog ------- */

.confirm-dialog {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  width: calc(100% - 2rem);
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}
.confirm-dialog::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
}
.confirm-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.confirm-msg {
  margin: 0;
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--text);
}
.confirm-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}
.confirm-actions button {
  padding: .625rem 1.125rem;
  font-size: .875rem;
}

/* ------- chat ------- */

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}


.chat-thread {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1rem;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-assistant { align-self: flex-start; align-items: flex-start; }

.msg-bubble {
  position: relative;
  padding: .625rem .875rem;
  border-radius: var(--radius-lg);
  font-size: .8125rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.msg-user .msg-bubble {
  background: var(--accent);
  color: var(--accent-text);
  border-bottom-right-radius: var(--radius-sm);
}
.msg-assistant .msg-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: var(--radius-sm);
}
.msg-content { white-space: pre-wrap; word-wrap: break-word; }
.msg-content strong { font-weight: 700; }
.msg-content em { font-style: italic; }
.msg-content code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(15, 23, 42, 0.08);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
body.theme-dark .msg-content code { background: rgba(255, 255, 255, 0.1); }

.msg-del {
  position: absolute;
  top: -8px;
  right: -8px;
  opacity: 0;
  transition: opacity 120ms;
}
.msg-del button {
  width: 26px;
  height: 26px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-subtle);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.msg-del button:hover { color: var(--danger-text); background: var(--danger-soft); }
.msg-bubble:hover .msg-del { opacity: 1; }
/* touch screens have no hover: keep the button visible (softly) so it can be tapped */
@media (hover: none) { .msg-del { opacity: .7; } }
.msg-del button svg { width: 13px; height: 13px; display: block; }

.msg-time {
  font-size: .6875rem;
  color: var(--text-subtle);
  margin-top: .25rem;
  padding: 0 .25rem;
}

/* typing indicator bubble */
.msg-typing .msg-bubble {
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
}
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--text-subtle);
  animation: typing-bounce 1.3s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* optimistic user bubble (before server returns real one) */
.msg-user.msg-pending .msg-bubble { opacity: 0.7; }

/* sticky input bar above bottom nav */
.chat-input {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: .625rem .875rem;
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  z-index: 80;
  max-width: var(--max-w);
  margin: 0 auto;
}
.chat-input textarea {
  flex: 1;
  /* 3 lines by default (rows=3), grows with the text up to ~6 lines, then scrolls */
  min-height: calc(3 * 1.4em + 1.25rem + 2px);
  max-height: calc(6 * 1.4em + 1.25rem + 2px);
  overflow-y: auto;
  resize: none;
  padding: .625rem .875rem;
  font-size: .9375rem;
  line-height: 1.4;
  border-radius: var(--radius-lg);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}
.chat-input button {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--accent-strong);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-input button:hover { background: var(--accent-strong); opacity: 0.9; }

/* ------- stub pages ------- */

.stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}
.stub svg { width: 56px; height: 56px; color: var(--text-subtle); margin-bottom: 1rem; }
.stub h2 { font-size: 1.125rem; color: var(--text); margin: 0 0 .5rem; }
.stub p { margin: 0; font-size: .875rem; max-width: 320px; }

/* Overlay proses LLM */
.busy-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
.busy-overlay[hidden] { display: none; }
.busy-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 24px 28px; max-width: 320px; margin: 16px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.busy-spinner { width: 36px; height: 36px; margin: 0 auto 14px; border: 3px solid var(--accent-soft); border-top-color: var(--accent-strong); border-radius: 50%; animation: busy-spin 0.8s linear infinite; }
.busy-msg { margin: 0 0 6px; font-weight: 600; }
.busy-sub { margin: 0; font-size: 0.85rem; color: var(--text-muted); }
@keyframes busy-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-spinner { animation-duration: 2.4s; } }

/* custom select menu */
.cell select { pointer-events: none; }
.menu {
  position: fixed;
  z-index: 9000;
  padding: .375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), 0 2px 8px rgba(0, 0, 0, .15);
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 60vh;
  overflow-y: auto;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: .625rem;
  width: 100%;
  padding: .625rem .75rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: .9375rem;
  font-weight: 400;
  text-align: left;
  text-transform: capitalize;
  cursor: pointer;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-alt); outline: none; }
.menu-item .dot { width: 9px; height: 9px; border-radius: var(--radius-full); flex-shrink: 0; }
.menu-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-check { color: var(--accent-strong); opacity: 0; flex-shrink: 0; }
.menu-item.on { font-weight: 600; }
.menu-item.on .menu-check { opacity: 1; }

/* auth extras, account & admin */
.auth-alt { margin: .75rem 0 0; text-align: center; font-size: .875rem; color: var(--text-muted); }
.auth-alt a { color: var(--accent-strong); font-weight: 600; }
.account-link { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; margin-bottom: .5rem; background: var(--surface-alt); border-radius: 14px; color: var(--text); font-size: .9375rem; }
.badge-count { font-size: .75rem; font-weight: 600; padding: .125rem .5rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn-text); }
.user-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .875rem 0; border-top: 1px solid var(--border-soft); }
.user-row:first-child { border-top: none; }
.user-main { display: flex; flex-direction: column; gap: .125rem; min-width: 0; }
.user-name { font-weight: 600; word-break: break-all; }
.user-meta { font-size: .8125rem; color: var(--text-subtle); }
.user-status { font-weight: 600; }
.user-status.st-pending { color: var(--warn-text); }
.user-status.st-approved { color: var(--accent-text); }
.user-status.st-rejected { color: var(--danger-text); }
.user-status.st-reset { color: var(--warn-text); font-weight: 600; }
.reset-result { margin: .375rem 0; padding: .625rem .75rem; border-radius: .625rem; background: var(--accent-soft, #e8f0fe); color: inherit; font-size: .875rem; }
.reset-result code { font-size: 1rem; font-weight: 600; user-select: all; letter-spacing: .03em; }
.user-actions { display: flex; gap: .5rem; }
.user-actions button { padding: .4rem .875rem; font-size: .8125rem; }

/* inline form validation */
.field-error { display: block; margin-top: .375rem; color: var(--danger-text); font-size: .8125rem; line-height: 1.3; }
input.invalid, textarea.invalid, select.invalid { border-color: var(--danger-text) !important; }

/* flash message */
.flash { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; padding: .75rem 1rem; border-radius: 14px; background: var(--warn-soft); color: var(--warn-text); font-size: .875rem; line-height: 1.45; }
.flash span { flex: 1; }
.flash-close { background: none; border: none; box-shadow: none; padding: 0 .25rem; font-size: 1.25rem; line-height: 1; color: inherit; cursor: pointer; opacity: .7; }

/* password show/hide */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap input { width: 100%; padding-right: 2.75rem; }
.pw-wrap input::-ms-reveal { display: none; }
.pw-toggle {
  position: absolute;
  right: .375rem;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--text-subtle);
  cursor: pointer;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-alt); }
/* keep the vertical centering while pressed: the global button:active scale would drop translateY,
   the button jumps down mid-tap and the release lands outside it, so the click is lost */
.pw-wrap .pw-toggle:active:not(:disabled) { transform: translateY(-50%) scale(.92); }

/* =====================================================================
   Clean redesign: big header + progress ring, flat task rows with round
   checks and tinted project tags, pill filters, tinted project cards.
   (Overrides earlier rules on purpose; keep this block last.)
   ===================================================================== */

/* header */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0 1.5rem; }
.eyebrow { margin: 0 0 .375rem; font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.hero h1 { margin: 0; font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--text); }
.hero h1.hero-date { font-size: 1.875rem; }
.hero-count { flex-shrink: 0; padding: .25rem .75rem; border-radius: var(--radius-full); background: var(--surface-alt); color: var(--text-muted); font-size: .8125rem; font-weight: 600; }
.ring {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent-strong) calc(var(--p) * 1%), var(--surface-alt) 0);
}
.ring::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--bg); }
.ring span { position: relative; font-size: .8125rem; font-weight: 700; color: var(--text); }

/* blocks */
.block { margin-bottom: 1.5rem; }
.block-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .25rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.block-late { color: var(--late); }
.pill-count { padding: .125rem .5rem; border-radius: var(--radius-full); background: var(--surface-alt); color: var(--text-muted); font-size: .6875rem; font-weight: 600; letter-spacing: 0; }

/* task rows: flat, no cards */
.tasklist { gap: 0; }
.task { background: transparent; border: none; border-radius: 0; padding: .875rem 0; gap: 1rem; }
.task:hover { background: transparent; }
.check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 1px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  color: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.check:hover { border-color: var(--accent-strong); background: var(--accent-soft); }
.task.done .check { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.task-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  margin: 0 0 .375rem;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}
.task.done .task-title { color: var(--text-subtle); text-decoration: line-through; }
.task-meta { align-items: center; gap: .625rem; font-size: .8125rem; }
.tag {
  padding: .125rem .625rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  color: color-mix(in srgb, var(--c, #94a3b8) 62%, var(--text));
  background: var(--surface-alt);
  background: color-mix(in srgb, var(--c, #94a3b8) 16%, transparent);
}
.task.done .tag { opacity: .55; }
.when { color: var(--text-muted); }
.when.late { color: var(--danger-text); font-weight: 500; }
.prio { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.prio-urgent { color: var(--p-urgent); }
.prio-high { color: var(--p-high); }
.task-desc { margin: .375rem 0 0; font-size: .875rem; line-height: 1.4; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* filter chips: dark filled when active */
.chip { border: none; background: var(--surface-alt); padding: .5rem 1rem; font-size: .875rem; }
.chip.active { background: var(--text); color: var(--bg); border: none; }
.chip.active .chip-dot { box-shadow: 0 0 0 1.5px var(--bg); }

/* todo sections as agenda headings */
.todo-section { margin-bottom: 1rem; }
.todo-section > summary { padding: .75rem 0 .25rem; }
.section-label { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; text-transform: none; color: var(--text); }
.section-label-today { color: var(--text); }
.section-label-overdue { color: var(--late); }

/* bottom nav + FAB */
.bottom-nav { border-top-color: var(--border-soft); }
.nav-item.active { color: var(--text); font-weight: 700; }
.nav-item.active svg { color: var(--accent-strong); }
.fab { width: 60px; height: 60px; box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35); }

/* settings: projects as tinted cards */
.project-list { background: transparent; border: none; box-shadow: none; overflow: visible; display: flex; flex-direction: column; gap: .625rem; }
.project-list > li + li, .project-list > li details, .project-list > li.project-row-static { border-top: none; }
.project-row, .project-row-static {
  --c: var(--accent-strong);
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-alt);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.project-row > summary, .project-row-static { padding: .875rem 1rem; }
.project-row > summary:hover { background: transparent; }
.project-dot { width: 32px; height: 32px; box-shadow: none; }
.project-name { font-size: 1rem; font-weight: 600; color: var(--text); color: color-mix(in srgb, var(--c) 62%, var(--text)); }
.project-edit { background: transparent; border-top: none; }

/* auth pages: wordmark logo (light/dark variants follow the theme) */
.brand-mark { display: flex; justify-content: center; margin: 0 0 1.75rem; }
.brand-mark img { height: auto; max-width: 100%; }
.brand-mark .logo-light { display: block; }
.brand-mark .logo-dark { display: none; }
body.theme-dark .brand-mark .logo-light { display: none; }
body.theme-dark .brand-mark .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  body.theme-system .brand-mark .logo-light { display: none; }
  body.theme-system .brand-mark .logo-dark { display: block; }
}
.auth-title { margin: 0 0 1.25rem; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; text-align: center; }

.hero-count-warn { background: var(--warn-soft); color: var(--warn-text); }

/* app bar: small wordmark at the top-left (WhatsApp-style) */
.appbar { display: flex; align-items: center; min-height: 40px; padding-top: .25rem; }
.brand-mark.brand-mark-sm { justify-content: flex-start; margin: 0; }
.appbar + .hero { padding-top: .75rem; }

/* whole task row is clickable: the title link stretches over the row; the check sits above it */
.task { position: relative; cursor: pointer; }
.task-title::after { content: ""; position: absolute; inset: 0; }
.task > form.inline { position: relative; z-index: 1; }
.task:hover .task-title { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.task.done .task-title { text-decoration: line-through; }

/* =====================================================================
   Settings redesign: profile card + grouped rows (label left, value right).
   Forms open inline only when a row is tapped.
   ===================================================================== */
.set-profile { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.75rem; }
.set-avatar { width: 56px; height: 56px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-size: 1.5rem; font-weight: 700; text-transform: uppercase; }
.set-who { min-width: 0; }
.set-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; }
.set-mail { margin-top: .125rem; font-size: .875rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; }

.set-section { margin-bottom: 1.75rem; }
.set-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem .25rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.set-count { padding: .0625rem .5rem; border-radius: 999px; background: var(--surface-alt); font-size: .6875rem; letter-spacing: 0; }

.set-group { background: var(--surface-alt); border-radius: 16px; overflow: hidden; }
.set-group > * + * { border-top: 1px solid var(--border-soft); }
.set-item > summary { list-style: none; }
.set-item > summary::-webkit-details-marker { display: none; }

.set-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 52px;
  padding: .75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  text-align: left;
  cursor: pointer;
}
.set-row-static { cursor: default; flex-wrap: wrap; row-gap: .5rem; }
.set-row-static .set-seg { max-width: 100%; }
.set-row-static .set-seg span { padding: .375rem .625rem; }
.set-label { flex-shrink: 0; color: var(--text); }
.set-label-strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.set-value { flex: 1; min-width: 0; text-align: right; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-value.muted { color: var(--text-subtle); }
.set-chev { flex-shrink: 0; color: var(--text-subtle); transition: transform .18s; }
.set-item[open] > summary .set-chev { transform: rotate(90deg); }
.set-dot { width: 12px; height: 12px; flex-shrink: 0; border-radius: 50%; }
.set-badge { padding: .125rem .625rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn-text); font-size: .75rem; font-weight: 600; }
.set-row-add { color: var(--accent-text); font-weight: 500; }
.set-row-add .set-label { color: inherit; }

/* inline forms */
.set-form { display: flex; gap: .5rem; padding: .25rem 1rem 1rem; }
.set-form-stack { flex-direction: column; }
.set-form input[type=text], .set-form input[type=email], .set-form input[type=password], .set-inline input {
  width: 100%;
  min-width: 0;
  padding: .625rem .875rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .9375rem;
  box-shadow: none;
}
.set-form .pw-wrap { width: 100%; }
.set-inline { display: flex; gap: .5rem; }
.set-btn { flex-shrink: 0; padding: .625rem 1.125rem; border-radius: 12px; font-size: .875rem; font-weight: 600; }
.set-form-stack > .set-btn { align-self: flex-end; }
.set-link-danger { align-self: flex-start; padding: .25rem 0; background: none; border: none; box-shadow: none; color: var(--text-subtle); font-size: .8125rem; cursor: pointer; }
.set-link-danger:hover { color: var(--danger-text); background: none; }

/* theme: segmented control inside its row */
.set-seg { display: inline-flex; margin-left: auto; padding: 3px; gap: 2px; background: var(--surface); border-radius: 10px; }
.set-seg label { cursor: pointer; }
.set-seg input { position: absolute; opacity: 0; pointer-events: none; }
.set-seg span { display: block; padding: .375rem .75rem; border-radius: 8px; font-size: .8125rem; color: var(--text-muted); }
.set-seg input:checked + span { background: var(--text); color: var(--bg); font-weight: 600; }
.set-seg input:focus-visible + span { outline: 2px solid var(--accent-strong); }

/* font options */
.set-fonts { display: flex; flex-direction: column; padding: 0 .5rem .5rem; }
.set-font { display: flex; align-items: center; justify-content: space-between; padding: .625rem .5rem; border-radius: 10px; cursor: pointer; font-size: .9375rem; }
.set-font:hover { background: var(--surface); }
.set-font input { position: absolute; opacity: 0; pointer-events: none; }
.set-check { color: var(--accent-strong); opacity: 0; }
.set-font input:checked ~ .set-check { opacity: 1; }
.set-font input:checked + span { font-weight: 600; }

/* logout */
.set-logout { justify-content: center; color: var(--danger-text); font-weight: 600; }
.set-logout:hover { background: transparent; }

/* hidden radios need a positioned ancestor, otherwise they sit at the page edge and cause horizontal scroll */
.color-palette, .set-seg label, .set-font { position: relative; }
.set-seg input, .set-font input, .color-palette input[type="radio"] { left: 0; top: 0; }

/* task notes: soft filled field with real padding (was flush against its edges) */
.sheet-notes {
  padding: .875rem 1rem;
  min-height: 6.5rem;
  background: var(--surface-alt);
  border-radius: 14px;
  line-height: 1.6;
  transition: box-shadow .15s;
}
.sheet-notes:focus { box-shadow: 0 0 0 2px var(--accent-strong); }

/* align the top-bar trash icon's center with the round done-check below it (check is 28px flush right) */
.detail-top .icon-btn { margin-right: -4px; }

/* task detail "..." menu button (rounded square) + danger item */
.kebab {
  width: 36px;
  height: 36px;
  margin-right: -4px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text-muted);
  box-shadow: none;
  cursor: pointer;
}
.kebab:hover, .kebab[aria-expanded="true"] { background: var(--border); color: var(--text); }
.menu-item.danger { color: var(--danger-text); }
.menu-item svg { flex-shrink: 0; color: var(--text-muted); }
.menu-item.danger svg { color: inherit; }
.archived-row .task-title { margin-bottom: .25rem; }
.archived-row .set-btn { padding: .4rem .875rem; font-size: .8125rem; }

/* ---- spacing pass: more side margin and breathing room in task rows ---- */
.container { padding: 1rem 1.5rem; }
.fab { right: max(1.5rem, calc(50vw - var(--max-w) / 2 + 1.5rem)); }

/* project chips: smaller, wrap onto new lines instead of scrolling off to the side */
.chip-row { flex-wrap: wrap; overflow: visible; margin: 0 0 1.5rem; padding: 0; gap: .5rem; }
.chip { padding: .375rem .875rem; font-size: .8125rem; gap: .375rem; }
.chip-dot { width: 7px; height: 7px; }

/* task rows */
.task { padding: 1.125rem 0; gap: 1.125rem; }
.task-main { padding-right: .75rem; }
.task-title { margin-bottom: .5rem; }
.task-meta { gap: .75rem; }
.task-desc { margin-top: .5rem; }
.todo-section { margin-bottom: 1.5rem; }
.todo-section > summary { padding: .75rem 0 .5rem; }
.block { margin-bottom: 1.75rem; }

/* =====================================================================
   Smooth interactions: press feedback, check animation, menu/dialog/details
   entrances, and cross-fade page navigation. All disabled for reduced motion.
   ===================================================================== */
html { -webkit-tap-highlight-color: transparent; }

/* soft transitions on interactive elements (specific ones keep their own) */
button, .chip, .nav-item, .set-row, .menu-item, .set-font span, .set-seg span {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease, opacity .15s ease;
}

/* press feedback */
button:active:not(:disabled), .chip:active, .nav-item:active { transform: scale(.96); }
.fab:active { transform: scale(.9); }
.set-row:active, .menu-item:active { background: var(--border-soft); }

/* task rows: rounded press/hover background without shifting the text alignment */
.task { margin: 0 -.75rem; padding-left: .75rem; padding-right: .75rem; border-radius: 16px; transition: background-color .15s ease, opacity .3s ease; }
.task:active { background: var(--surface-alt); }
@media (hover: hover) { .task:hover { background: color-mix(in srgb, var(--surface-alt) 55%, transparent); } }

/* checking a task: circle pops + fills, title fades to struck-through, row dims */
@keyframes check-pop { 0% { transform: scale(1); } 40% { transform: scale(.78); } 100% { transform: scale(1); } }
.check { transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .12s ease; }
.task.completing .check { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; animation: check-pop .3s ease; }
.task.completing .task-title { color: var(--text-subtle); text-decoration: line-through; transition: color .2s ease; }
.task.completing { opacity: .55; }
.sub.completing .sub-check { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; animation: check-pop .3s ease; }
.sub.completing .sub-title { color: var(--text-subtle); text-decoration: line-through; }

/* popovers, dialogs, expanding sections */
@keyframes pop-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu { transform-origin: top right; animation: pop-in .14s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
dialog[open] { animation: dialog-in .2s ease-out; }
dialog[open]::backdrop { animation: fade-in .2s ease-out; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
details[open] > :not(summary) { animation: slide-down .18s ease-out; }

/* cross-fade between pages (Chrome/Edge; others just navigate normally) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
.bottom-nav { view-transition-name: bottom-nav; }
.fab { view-transition-name: fab; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  @view-transition { navigation: none; }
}

/* no hard rectangular focus box after mouse/touch; keep a rounded ring for keyboard users */
:focus:not(:focus-visible) { outline: none; }
a:focus-visible, button:focus-visible, summary:focus-visible, .task:focus-within:has(:focus-visible) {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: 12px;
}
.check:focus-visible, .sub-check:focus-visible, .round-check:focus-visible, .fab:focus-visible, .icon-btn:focus-visible { border-radius: 50%; }
.kebab:focus-visible { border-radius: 10px; }
.task-title:focus-visible { outline-offset: 4px; }

/* splash: animated logo, shown once per browser session */
.splash { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: var(--bg); transition: opacity .4s ease; }
.splash .brand-mark { margin: 0; }
.splash .brand-mark img { width: 140px; max-width: 60vw; height: auto; }
.splash.splash-out { opacity: 0; pointer-events: none; }
body.splash-on { overflow: hidden; }

/* loading overlay: looping logo replaces the spinner */
.busy-logo { margin: 0 0 10px; }

/* multi-select on the Todo page: bulk delete / archive */
.hero-side { display: flex; align-items: center; gap: .6rem; }
.select-toggle { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: .3rem .85rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.select-toggle[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent; }
.task-sel { display: none; width: 22px; height: 22px; flex-shrink: 0; margin: 0 .6rem 0 0; accent-color: var(--accent-strong); cursor: pointer; }
.select-mode .task-sel { display: block; align-self: center; }
.select-mode .task-check-form { display: none; }
.select-mode .task { cursor: pointer; }
.select-mode .task:has(.task-sel:checked) { background: var(--surface-alt); }
.bulk-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-height) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); padding: .6rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 8px 28px rgba(15, 23, 42, .22); }
.bulk-bar[hidden] { display: none; }
.bulk-count { font-weight: 600; font-size: .9rem; padding: 0 .25rem; }
.bulk-btn { border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); border-radius: 10px; padding: .45rem .8rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.bulk-btn:disabled { opacity: .45; cursor: not-allowed; }
.bulk-delete { background: var(--danger); color: var(--danger-text); border-color: transparent; }
body.bulk-on .fab { display: none; }

/* chat: task changes proposed by the assistant, confirmed by the user */
.msg-actions { margin-top: .6rem; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); }
.msg-actions-head { margin: 0 0 .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.msg-actions ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.msg-actions li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .15rem .75rem; font-size: .9rem; }
.msg-actions li a { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.msg-actions li span { color: var(--text-muted); }
.msg-actions-btns { display: flex; gap: .5rem; margin-top: .6rem; }
.msg-actions-btns button { border: 1px solid var(--border); border-radius: 10px; padding: .45rem .9rem; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; background: var(--surface); color: var(--text); }
.msg-actions-btns .act-apply { background: var(--accent-soft); color: var(--text); border-color: transparent; }
.msg-actions-note { margin: .5rem 0 0; font-size: .8rem; color: var(--text-muted); }
.msg-actions-dismissed li { opacity: .55; text-decoration: line-through; }

/* chat: day separators, like WhatsApp */
.chat-day { align-self: center; margin: .5rem 0 .1rem; }
.chat-day span { display: inline-block; padding: .2rem .7rem; border-radius: 999px; background: var(--surface-alt); color: var(--text-muted); font-size: .72rem; font-weight: 600; }

/* privacy page + settings hint + audit table */
.set-hint { margin: 0; font-size: .8125rem; line-height: 1.5; color: var(--text-muted); }
.prose { max-width: 40rem; line-height: 1.65; }
.prose h2 { font-size: 1.0625rem; margin: 1.5rem 0 .5rem; }
.prose p, .prose li { color: var(--text); font-size: .9375rem; }
.prose ul { padding-left: 1.25rem; }
.audit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.audit-row { padding: .625rem .875rem; background: var(--surface-alt); border-radius: 12px; font-size: .8125rem; display: flex; flex-direction: column; gap: .125rem; }
.audit-row b { font-size: .875rem; }
.audit-meta { color: var(--text-muted); }

.set-seg-wrap { flex-wrap: wrap; justify-content: flex-end; }
.set-hint-pad { padding: .5rem 1rem 0; }

/* todo search + priority filter */
.search-box { position: relative; margin: 0 0 .75rem; }
.search-box svg { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-box input { width: 100%; padding: .625rem .875rem .625rem 2.375rem; border: none; border-radius: 12px; background: var(--surface-alt); color: var(--text); font: inherit; font-size: .9375rem; outline: none; -webkit-appearance: none; appearance: none; }
.search-box input:focus { box-shadow: 0 0 0 2px var(--accent-strong); }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
.chip-row-tight { margin-top: -1rem; }
.chip-clear { color: var(--text-muted); background: transparent; box-shadow: inset 0 0 0 1px var(--border-soft); }

.bulk-done { background: var(--accent-strong); color: #04281c; border-color: transparent; }

/* ---- todo page: sticky header + filter sheet ---- */
.todo-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 40px; margin-bottom: .625rem; } /* same height on Todo and Chat so the titles line up */
.todo-bar h1 { margin: 0; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--text); }
.todo-tools { display: flex; gap: .5rem; align-items: center; }
.todo-tools .search-box { flex: 1; margin: 0; }
.filter-btn { position: relative; flex-shrink: 0; width: 40px; height: 40px; padding: 0; display: flex; align-items: center; justify-content: center; border: none; border-radius: 12px; background: var(--surface-alt); color: var(--text-muted); cursor: pointer; }
.filter-btn svg { display: block; }
.filter-btn:hover { background: var(--surface-alt); }
.filter-btn.on, .filter-btn.on:hover { background: var(--text); color: var(--bg); }
.filter-btn.on svg circle { fill: var(--text); }
.active-filters { display: flex; gap: .375rem; overflow-x: auto; margin-top: .5rem; scrollbar-width: none; }
.active-filters::-webkit-scrollbar { display: none; }
.af { display: inline-flex; align-items: center; gap: .375rem; flex-shrink: 0; padding: .25rem .5rem .25rem .75rem; border-radius: 999px; background: var(--surface-alt); color: var(--text); font-size: .8125rem; font-weight: 500; }
.af-x { color: var(--text-muted); font-size: 1rem; line-height: 1; padding: 0 .25rem; }
.fs { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.fs[hidden] { display: none; }
.fs-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.fs-panel { position: relative; width: 100%; max-width: 520px; max-height: 80vh; overflow-y: auto; padding: .5rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(15, 23, 42, .2); }
.fs-grip { width: 36px; height: 4px; margin: .25rem auto .75rem; border-radius: 999px; background: var(--border); }
.fs-title { margin: .75rem 0 .5rem; font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.fs-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.fs-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.fs-clear { color: var(--danger-text, #dc2626); font-size: .875rem; font-weight: 600; }
.fs-close { margin-left: auto; padding: .5rem 1.25rem; border: none; border-radius: 999px; background: var(--text); color: var(--bg); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
body.fs-on { overflow: hidden; }
body.fs-on .fab { display: none; }
@media (min-width: 640px) { .fs { align-items: center; } .fs-panel { border-radius: 20px; } }

/* ---- about footer (settings) ---- */
.about { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin: 2rem 0 1rem; text-align: center; color: var(--text-muted); font-size: .8125rem; }
.about-icon { width: 56px; height: 56px; border-radius: 14px; }
.about-meta { font-weight: 600; }
.about-maker { display: inline-flex; align-items: center; gap: .375rem; }
.about-logo { height: 14px; width: auto; display: block; }
.about-logo-dark { display: none; }
body.theme-dark .about-logo-light { display: none; }
body.theme-dark .about-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  body.theme-system .about-logo-light { display: none; }
  body.theme-system .about-logo-dark { display: block; }
}
.about-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .375rem .625rem; }
.about-links a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---- app-style layout (Todo, Chat, Setting): the page itself never scrolls (no bounce, no header drift).
   .page-top (header) and the chat input sit in a column above the bottom nav; only .page-scroll moves. ---- */
html:has(.page-top), body:has(.page-top) { height: 100%; overflow: hidden; overscroll-behavior: none; }
body:has(.page-top) { padding-bottom: 0; }
body:has(.page-top) main.container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--nav-height)); /* the nav is border-box: its height already holds the safe-area padding */
  padding-top: 0;
  padding-bottom: 0;
}
.page-top { flex-shrink: 0; margin: 0 -1.5rem; padding: .75rem 1.5rem .5rem; background: var(--bg); }
.page-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -1.5rem; padding: .5rem 1.5rem 1.5rem; }
/* bottom padding keeps the last task clear of the floating + button */
.todo-scroll { padding-bottom: 6rem; }
.chat-thread.page-scroll { padding: .75rem 1.5rem 1rem; margin-bottom: 0; }
body:has(.page-top) .chat-input { position: static; flex-shrink: 0; margin: 0 -1.5rem; max-width: none; }
.chat-top .search-box { margin: 0; }
.msg-content mark { padding: 0 .125rem; border-radius: 4px; background: var(--warn); color: var(--warn-text); }
.chat-hint { align-self: center; flex-shrink: 0; color: var(--text-muted); font-size: .75rem; }
.chat-results .msg-bubble { cursor: pointer; }
.chat-results .msg-bubble:hover { box-shadow: 0 0 0 2px var(--accent); }
/* message opened from a search result */
.msg-found .msg-bubble { animation: msg-found 2.4s ease; }
@keyframes msg-found { 0%, 60% { box-shadow: 0 0 0 3px var(--warn); } 100% { box-shadow: 0 0 0 3px transparent; } }
