/* ── 1ptodo — global styles ───────────────────────────── */

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --card:      #222632;
  --text:      #e2e4ea;
  --muted:     #8a8fa8;
  --accent:    #6c8cff;
  --danger:    #ff6b6b;
  --success:   #51cf66;
  --gold:      #ffd43b;

  /* area colours */
  --c-work:      #a78bfa;
  --c-personal:  #5b8def;
  --c-health:    #34d399;
  --c-relationship: #f472b6;
}

/* ── light theme ── */
[data-theme="light"] {
  --bg:        #cfd4db;
  --surface:   #dfe4eb;
  --card:      #d8dde4;
  --text:      #141828;
  --muted:     #3a4056;
  --accent:    #3b5bdb;
  --danger:    #c62828;
  --success:   #2e7d32;
  --gold:      #c67100;

  --c-work:      #6a2cd8;
  --c-personal:  #3b5bdb;
  --c-health:    #2e7d32;
  --c-relationship: #c2185b;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── hidden utility ── */
.hidden { display: none !important; }

/* ── auth card (login / register) ── */
body.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
}
.auth-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  border: 1px solid rgba(255,255,255,.06);
}
.auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: .3rem;
}
.auth-card .subtitle {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 1.5rem;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .5rem .8rem;
  font-size: .9rem;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
}
.auth-card .btn-primary {
  width: 100%;
  padding: .5rem;
  font-size: .9rem;
  margin-top: .3rem;
}
.auth-error {
  color: var(--danger);
  font-size: .82rem;
  text-align: center;
  margin-top: .3rem;
}
.auth-success {
  color: var(--success);
  font-size: .82rem;
  text-align: center;
  margin-top: .3rem;
}
.auth-info {
  color: var(--accent);
  font-size: .82rem;
  text-align: center;
  margin-top: .3rem;
  line-height: 1.4;
}
.auth-link {
  text-align: center;
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--muted);
}
.auth-link a {
  color: var(--accent);
  text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }

html {
  height: 100%;
  /* The only intentional horizontal scroll is INSIDE #canvas-wrapper
     (the mobile chart).  Clipping document-level overflow keeps a
     landscape-overflowing nav row from creating a page-wide scroll
     offset that survives a rotation into portrait — the hamburger
     then rendered shifted off the right edge until a refresh
     (Android, 2026-09-26).  On html (the root scroller), not body:
     a hidden axis on body would force overflow-y to auto and make
     the body its own scroll container. */
  overflow-x: hidden;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  min-height: 100dvh;
  height: 100%;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
}

main {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
}

#chart-area {
  flex: 1 1 0;
  min-height: 200px;
  width: 100%;
}

/* ── header ── */
header {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem 0 .5rem;
  position: relative;
}
header h1 {
  font-size: 1.5rem;
  letter-spacing: -.02em;
  margin: 0;
}

/* ── brand logo (theme-aware SVG variants, see brand/BRAND.md) ── */
.brand { display: inline-flex; align-items: center; margin: 0; }
.brand img { display: none; height: 1.75rem; width: auto; }
:root:not([data-theme="light"]) .brand img.logo-on-dark { display: block; }
:root[data-theme="light"] .brand img.logo-on-light { display: block; }
.brand--lg img { height: 2.4rem; }

/* ── hamburger button ── */
#btn-hamburger {
  display: none;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--accent);
  padding: .35rem .9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all .15s;
  line-height: 1;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
#btn-hamburger:hover {
  background: var(--accent);
  color: #fff;
}

/* ── nav menu dropdown (desktop = always visible, mobile = toggle) ── */
.nav-menu {
  flex: 1 1 auto;
}
.nav-menu-nav {
  display: flex;
  gap: .4rem;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.nav-menu-nav button,
.nav-menu-nav select {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid transparent;
  padding: .35rem .9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  transition: all .15s;
}
.nav-menu-nav button.active,
.nav-menu-nav button:hover {
  background: var(--accent);
  color: #fff;
}
.nav-menu-nav select {
  padding: .35rem .5rem;
}

/* icon-style buttons inside menu */
.nav-menu-nav button.icon-btn,
.nav-menu-nav button.nav-menu-logout {
  font-size: .85rem;
  padding: .35rem .9rem;
  text-decoration: none;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.nav-menu-nav button.icon-btn:hover,
.nav-menu-nav button.nav-menu-logout:hover {
  background: var(--accent);
  color: #fff;
}
.nav-menu-nav button.nav-menu-logout {
  color: var(--danger);
  border-color: var(--danger);
}
.nav-menu-nav button.nav-menu-logout:hover {
  background: var(--danger);
  color: #fff;
}
/* The button lives in a <form> (POST /logout) — display:contents keeps
   it a direct flex child of .nav-menu-nav so the layout is unchanged. */
.nav-logout-form {
  display: contents;
}

/* ── user menu (nav rightmost: name chip → account/logout dropdown) ──
   Chip + items inherit the .nav-menu-nav button base (surface bg,
   muted text, accent hover).  Desktop: the dropdown is an absolute
   panel under the chip; mobile (media query below) it becomes an
   inline block in the column, toggled the same way. */
.user-menu {
  position: relative;
}
.nav-user-chip {
  display: flex;
  align-items: center;
  gap: .35rem;
  max-width: 11rem;
}
.nav-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-user-caret {
  font-size: .65rem;
  transition: transform .15s;
}
.user-menu.open .nav-user-caret {
  transform: rotate(180deg);
}
.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  min-width: 11rem;
  padding: .3rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 30;
}
.user-menu.open .user-menu-dropdown {
  display: block;
}
.user-menu-dropdown .user-menu-item {
  width: 100%;
  text-align: left;
}

.stats {
  display: none;
  font-size: .78rem;
  color: var(--muted);
  width: 100%;
  margin-top: .3rem;
}

/* ── cards ── */
.card {
  background: var(--surface);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,.06);
}
.card h2 { font-size: 1rem; margin-bottom: .7rem; }

/* ── form ── */
#task-form .row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }

/* Shared base style for all form inputs and selects */
.form-input,
#task-form input[type="text"],
#task-form input[type="datetime-local"],
#task-form select {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .4rem .7rem;
  font-size: .88rem;
}
.form-input:focus,
#task-form input:focus,
#task-form select:focus {
  outline: none;
  border-color: var(--accent);
}
#f-desc { flex: 1; min-width: 200px; }
#f-keyword, #f-deadline { min-width: 130px; }
.small { width: 120px; }

/* compact form — all fields in one row */
.compact-form {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  font-size: .82rem;
}
.compact-form input,
.compact-form select {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: .3rem .5rem;
  font-size: .82rem;
}
.compact-form .form-input {
  padding: .3rem .5rem;
  font-size: .82rem;
}
.compact-form .form-input:focus {
  border-color: var(--accent);
}
.compact-form .small { min-width: 100px; }
.compact-form .imp-input {
  width: 55px;
  text-align: center;
}
.btn-compact {
  font-size: .82rem;
  padding: .3rem 1rem;
  white-space: nowrap;
}
.full { flex: 1; min-width: 100px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .4rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.btn-primary:hover { opacity: .85; }

.btn-ai {
  background: linear-gradient(135deg, #7c3aed, #6c8cff);
  color: #fff;
  border: none;
  padding: .4rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: .82rem;
}
.btn-ai:hover { opacity: .85; }

.btn-small {
  font-size: .82rem;
  padding: .25rem .55rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--surface);
  color: var(--text);
}
.btn-small:hover {
  border-color: var(--accent);
}

/* ── pending group invites banner ─────────────────────────────── */
/* Server-rendered (context processor) — one .invite-row per pending
   invite, shown until the user accepts or declines. Mirrors the card
   styling but uses a distinct accent so it reads as an action the
   user owes, not a passive note. */

.invite-banner {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 0 .5rem;
  margin-bottom: .3rem;
}

.invite-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .45rem .7rem;
  border-radius: 8px;
  background: var(--card);
  border-left: 3px solid var(--accent);
  font-size: .8rem;
  line-height: 1.4;
}

.invite-icon {
  flex-shrink: 0;
  font-size: .85rem;
}

.invite-text {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
}

.invite-actions {
  display: inline-flex;
  gap: .3rem;
  margin-left: auto;
}

.invite-accept {
  background: var(--accent);
  color: #fff;
  border: none;
}

.invite-accept:hover {
  filter: brightness(1.1);
}

/* ── chart ── */
.chart-card {
  padding: .5rem;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

/* Mobile: position FAB inside chart-area so it stays anchored to the chart,
   not floating near the viewport bottom where the bubbles are. */
@media (max-width: 640px) {
  .chart-card {
    position: relative;
  }
  .fab {
    position: absolute;
    bottom: 0;
    right: 0;
  }
}
#canvas-wrapper {
  flex: 1 1 0;
  width: 100%;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  align-items: center;
  overflow-x: auto;
}

#task-chart {
  max-height: none;
  display: block;
  /* Centered by AUTO MARGINS, not the wrapper's align-items: center.
     When the canvas is wider than the wrapper (many columns),
     align-items:center would center it — pushing its left edge (the
     y-axis gutter + first column) past the wrapper's left border,
     where horizontal scrolling cannot reach it: the y-axis labels and
     title became permanently invisible.  Auto margins resolve to 0 on
     negative free space (flexbox spec §9.3), pinning the canvas to the
     left edge so the gutter is visible at scrollLeft=0; when the
     canvas fits, the margins split the leftover evenly — same centered
     look as before. */
  margin: 0 auto;
}

/* ── chart mobile: scrollable, shorter canvas ── */
@media (max-width: 640px) {
  .chart-card {
    min-height: 160px;
    /* Flat on mobile: the canvas can be wider than the viewport and the
       card doesn't clip it, so a filled/rounded card would end mid-plot
       (bubbles drawn outside the shade).  Strip the card chrome so the
       whole plot sits on the page background.  Desktop keeps the panel;
       summary chips carry their own backgrounds. */
    background: transparent;
    border: none;
    border-radius: 0;
  }
  #canvas-wrapper {
    min-height: 140px;
    -webkit-overflow-scrolling: touch;
  }
}


/* ── task list ── */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .6rem .8rem;
  border-radius: 10px;
  margin-bottom: .35rem;
  background: var(--card);
  border-left: 4px solid var(--area-color, var(--muted));
  transition: box-shadow .15s;
}
.task-item:hover { box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.task-item.completed { opacity: .45; text-decoration: line-through; }
.task-item.urgent { box-shadow: 0 0 8px 2px rgba(255,107,107,.3); }
/* .task-item.overdue: pink-red handled by the .countdown rule below;
   no flash animation. */

.task-item .task-area-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: .35rem;
}

.task-item .task-body {
  flex: 1;
  min-width: 0;
}

.task-item .task-main {
  font-size: .9rem;
  color: var(--text);
  margin-bottom: .15rem;
}

.task-item .task-meta {
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.task-item .task-stars {
  white-space: nowrap;
}

.task-item .task-meta .area-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  color: #fff;
  font-size: .7rem;
  text-transform: capitalize;
}

.task-item .task-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
  margin-top: .1rem;
}

.task-item .task-actions .check {
  width: 16px;
  height: 16px;
  accent-color: var(--success);
  cursor: pointer;
  border: 2px solid var(--muted);
  border-radius: 4px;
}

.task-item .task-actions .check:checked {
  border-color: var(--success);
  background: var(--success);
}

.task-item .task-actions .edit-btn,
.task-item .task-actions .delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  padding: .2rem .35rem;
  border-radius: 4px;
  transition: background .15s;
}

.task-item .task-actions .edit-btn {
  color: var(--accent);
}
.task-item .task-actions .edit-btn:hover {
  background: rgba(108, 140, 255, .15);
}

.task-item .task-actions .delete-btn {
  color: var(--muted);
}
.task-item .task-actions .delete-btn:hover {
  color: var(--danger);
  background: rgba(255, 107, 107, .1);
}

/* urgency countdown */
.countdown {
  font-variant-numeric: tabular-nums;
  font-size: .72rem;
  color: var(--muted);
}
.countdown.urgent { color: var(--danger); font-weight: 600; }
.task-item.overdue .countdown { color: var(--danger) !important; font-weight: 600; }

/* area dot */
.area-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.search-row {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.search-row input {
  width: 100%;
}

/* ── modal ── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-body {
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  max-width: 640px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: .8rem; right: 1rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer;
}
.demo-section { margin-bottom: 1.2rem; }
.demo-section h3 { font-size: .95rem; margin-bottom: .3rem; }
.demo-section p, .demo-section li { font-size: .85rem; color: var(--muted); }
.demo-section ul { padding-left: 1.2rem; }
.demo-section code {
  background: var(--card);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .8rem;
}
.demo-section pre {
  background: var(--card);
  padding: .8rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: .8rem;
}
/* Help-modal footer: the privacy pledge + legal links (About/Privacy/
   Terms — the in-app link targets for the public legal pages). */
.demo-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
/* The links stay muted (footer-body colour) — the ONLY accent in this
   footer is the pledge line. */
.demo-footer a { color: inherit; text-decoration: none; }
.demo-footer a:hover { text-decoration: underline; }
/* The pledge line is the hook — gold: the brightest token in the
   palette (otherwise unused), and the implicit pun — a to-do list's
   "gold standard".  Slightly larger than the muted footer body; the
   three links below stay muted (only the tagline carries colour).
   Green (--success) was the "trust" candidate but this app already
   owns green for completed checkboxes / success toasts, so it would
   read as "done", not "safe". */
.demo-footer em {
  color: var(--gold);
  font-size: .9rem;
}

/* ── search input ── */
#f-search {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: .45rem .8rem;
  font-size: .88rem;
  flex: 1;
}
#f-search:focus {
  outline: none;
  border-color: var(--accent);
}
#f-search::placeholder { color: var(--muted); }

/* ── summary strip ── */
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .6rem .8rem;
  margin-bottom: .5rem;
  border-radius: 10px;
  background: var(--card);
  font-size: .78rem;
  align-items: center;
}
.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .55rem;
  border-radius: 8px;
  background: var(--surface);
  white-space: nowrap;
}
.summary-chip.urgent { background: rgba(255,107,107,.15); color: var(--danger); }
.summary-area {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .15rem .55rem;
  border-radius: 8px;
  background: var(--surface);
  border-left: 3px solid;
}

/* ── info panel ── */
.info-panel {
  position: fixed;
  top: 0; right: 0;
  width: 360px;
  max-width: 95vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid rgba(255,255,255,.08);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1000;
  transition: transform .2s ease;
}
.info-panel.hidden { transform: translateX(100%); }
.info-panel-close {
  position: absolute; top: .8rem; right: 1rem;
  background: none; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer;
}
.info-panel-close:hover { color: var(--text); }
.info-field {
  margin-bottom: .8rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.info-field .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .15rem;
}
.info-field .value {
  font-size: .92rem;
  color: var(--text);
}
.info-field .value.large {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ── area colour utility ── */
.area-work      { --area-color: var(--c-work);      color: var(--c-work); }
.area-personal  { --area-color: var(--c-personal);  color: var(--c-personal); }
.area-health    { --area-color: var(--c-health);    color: var(--c-health); }
.area-relationship { --area-color: var(--c-relationship); color: var(--c-relationship); }

/* "Custom…" area option — grayed to signal it reveals a free-text field */
option.area-custom-option { color: var(--muted); }

/* Disabled fields — the explicit background/color rules above would
   otherwise override the browser's default disabled look.  Mainly the
   area picker, greyed out while a group is selected (group tasks have
   no area — the group IS the chart column, docs/CHART.md). */
#task-form select:disabled,
.compact-form select:disabled,
.compact-form input:disabled,
#edit-modal .edit-form select:disabled,
#edit-modal .edit-form input:disabled,
.chart-add-panel .edit-form select:disabled,
.chart-add-panel .edit-form input:disabled {
  opacity: .5;
}

/* ── mobile: modal close button ── */
@media (max-width: 480px) {
  .modal-close {
    top: .5rem;
    right: .5rem;
    font-size: 1rem;
  }
}

/* ── edit modal ── */
#edit-modal .edit-form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

#edit-modal .edit-form .edit-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Group row is dead in the edit modal (wip N2): _edit() never sets
   it and group_id ∉ _ALLOWED_COLUMNS, so saving does nothing — a
   visible row would lie about the task's group.  Hidden here only;
   the select stays in the DOM because the FAB clones #edit-form and
   reads it for chart-view adds (that clone is outside #edit-modal). */
#edit-modal .edit-form .edit-row-group {
  display: none;
}

#edit-modal .edit-form .imp-field {
  display: inline-flex;
  gap: .3rem;
  align-items: center;
  flex-shrink: 0;
}

#edit-modal .edit-form .imp-field label {
  min-width: 0;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

#edit-modal .edit-form .imp-field input {
  width: 50px;
  min-width: 0;
}

#edit-modal .edit-form label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  min-width: 60px;
}

#edit-modal .edit-form input,
#edit-modal .edit-form select {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: .35rem .6rem;
  font-size: .85rem;
  flex: 1;
  min-width: 100px;
}

#edit-modal .edit-form .form-input {
  padding: .35rem .6rem;
  font-size: .85rem;
}

#edit-modal .edit-form input:focus,
#edit-modal .edit-form select:focus,
#edit-modal .edit-form .form-input:focus {
  outline: none;
  border-color: var(--accent);
}

#edit-modal .edit-form .desc-input {
  min-width: 200px;
}

#edit-modal .edit-form .imp-input {
  width: 60px;
  text-align: center;
}

#edit-modal .edit-form .dl-input {
  min-width: 150px;
}

#edit-modal .edit-row-actions {
  display: flex;
  gap: .4rem;
  margin-top: .4rem;
}

/* completed tasks toggle button */
.completed-toggle {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,.1);
  padding: .25rem .6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .75rem;
  transition: all .15s;
}

.completed-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.completed-toggle.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.list-controls {
  margin-top: .5rem;
  text-align: right;
  padding-top: .5rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ── skip-to-content link ───────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  font-size: 0.875rem;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

/* ── toast notifications ────────────────────────────────── */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}
#toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: #fff;
  font-size: 0.875rem;
  animation: slideIn 0.3s ease;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast-error { background: var(--danger); }
.toast-success { background: var(--success); }
.toast-info    { background: var(--accent); }

/* ── info panel overlay ─────────────────────────────────── */
/* Visual dim only — pointer-events: none so bubble clicks ALWAYS reach the
   canvas even while the panel is open (previously this overlay swallowed
   the click and just closed the panel, making bubble clicks feel random). */
.info-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 999;
  pointer-events: none;
}
.info-panel-overlay.hidden {
  display: none;
}

/* ── FAB overlay — add task panel on Chart view ──────────── */
.chart-add-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-add-overlay.hidden {
  display: none;
}
.chart-add-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.chart-add-panel {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  max-width: 640px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1;
}
/* Reuse edit-form styles inside the overlay panel */
.chart-add-panel .edit-form {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.chart-add-panel .edit-form .edit-row {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}
.chart-add-panel .edit-form label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  min-width: 60px;
}
.chart-add-panel .edit-form input,
.chart-add-panel .edit-form select {
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  padding: .35rem .6rem;
  font-size: .85rem;
  flex: 1;
  min-width: 100px;
}
.chart-add-panel .edit-form input:focus,
.chart-add-panel .edit-form select:focus {
  outline: none;
  border-color: var(--accent);
}
.chart-add-panel .edit-form .edit-row-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  padding-top: .2rem;
}
.chart-add-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: var(--surface);
  border: 2px solid rgba(255,255,255,.15);
  border-radius: 8px;
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: background .15s, color .15s, transform .15s;
}
.chart-add-close:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(239,68,68,.4);
}

/* ── FAB — floating action button ────────────────────────── */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(108, 140, 255, .35);
  transition: transform .15s, opacity .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fab:hover { opacity: .85; transform: scale(1.06); }
.fab:active { transform: scale(.92); }

@media (max-width: 640px) {
  .fab {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
}

@media (max-width: 640px) {
  .modal-body { width: 96%; max-width: none; }
}

/* ── Group members ─────────────────────────────────────────────── */

#group-members-list {
  margin: .4rem 0 0 0;
  padding: 0;
  list-style: none;
}

#group-members-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .5rem;
  border-radius: 4px;
  margin-bottom: .2rem;
  background: rgba(255,255,255,.03);
}

#group-members-list li .member-info {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
}

#group-members-list li .member-name {
  color: var(--text);
  font-size: .9rem;
}

#group-members-list li .member-role {
  font-size: .72rem;
  padding: .1rem .4rem;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
}

#group-members-list li .member-role.owner { background: rgba(255,165,0,.2); color: #ffa500; }
#group-members-list li .member-role.member { background: rgba(150,150,150,.2); color: #aaa; }

#group-members-list li .member-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  padding: .1rem .3rem;
  border-radius: 3px;
}

#group-members-list li .member-remove:hover { color: var(--danger); }

#group-members-list li .member-make-owner {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  padding: .1rem .3rem;
  border-radius: 3px;
}

#group-members-list li .member-make-owner:hover { color: #ffa500; }

#pending-invites-list {
  margin: .4rem 0 0 0;
  padding: 0;
  list-style: none;
}

#pending-invites-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem .5rem;
  border-radius: 4px;
  margin-bottom: .2rem;
  background: rgba(255,255,255,.03);
}

#pending-invites-list li .pending-invite-email {
  color: var(--text);
  font-size: .85rem;
}

#pending-invites-list li .pending-invite-revoke {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .85rem;
  padding: .1rem .3rem;
  border-radius: 3px;
}

#pending-invites-list li .pending-invite-revoke:hover { color: var(--danger); }

#group-info-actions button {
  cursor: pointer;
}


/* ── mobile nav (hamburger + dropdown) ── */
@media (max-width: 640px) {
  header {
    gap: .4rem;
    padding: .35rem .4rem;
  }
  header h1 {
    font-size: .95rem;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  header .brand img { height: 1.15rem; }
  #btn-hamburger {
    display: block !important;
    font-size: 1.4rem;
    padding: .3rem .7rem;
    min-width: 40px;
    min-height: 40px;
    border: 2px solid var(--accent) !important;
    background: var(--accent) !important;
    color: #fff !important;
    pointer-events: auto !important;
    width: auto;
    border-radius: 8px;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: .5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  /* Opened by a CLASS toggle (app.js), never an inline style.display:
     an inline style would outrank this display:none and pin the panel
     open across an orientation change. */
  .nav-menu.open {
    display: block;
  }
  .nav-menu-nav {
    flex-direction: column;
    gap: .25rem;
    justify-content: flex-start;
  }
  .nav-menu-nav button,
  .nav-menu-nav select,
  .nav-menu-nav button.nav-menu-logout {
    width: 100%;
    text-align: left;
    font-size: .88rem;
    padding: .55rem .75rem;
    border-radius: 6px;
    min-height: 44px;
  }
  .nav-menu-nav select {
    font-size: .85rem;
  }
  .nav-menu-nav button.nav-menu-logout {
    color: var(--danger);
    border-color: var(--danger);
    text-align: center;
    margin-top: .25rem;
  }
  .nav-menu-nav button.nav-menu-logout:hover {
    background: var(--danger);
    color: #fff;
  }
  /* User menu in the column: the dropdown loses its floating panel and
     becomes inline rows (same toggle, no absolute positioning). */
  .user-menu {
    position: static;
  }
  .nav-user-chip {
    max-width: none;
  }
  .user-menu-dropdown {
    position: static;
    min-width: 0;
    width: 100%;
    padding: 0 .25rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .stats {
    display: none;
  }
}

/* ── landing page (anonymous view of /) ─────────────────────── */
/* The promo page frontend.py index() renders for visitors without a
   session.  It is pure content + links — no scripts at all for
   visitors (TestNoInlineEventHandlers scans the template), no
   third-party assets.  The .landing-hero* rules serve the ?rec=1
   recording variant only: the demo GIF's opening scene is recorded
   from that block with landing-hero.js driving it (scripts/
   record_demo_gif.py).  Every colour comes from the theme tokens, so
   it follows the light/dark switch like the rest of the app. */

.landing-body {
  display: flex;
  justify-content: center;
}

.landing {
  width: 100%;
  max-width: 46rem;
  padding: 1.5rem 1.25rem 3rem;
  margin: 0 auto;
}

/* nav: logo left, the signup / sign-in actions right */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 0 1.5rem;
}
.landing-nav .brand { margin: 0; }
.landing-nav-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}
/* the buttons are <a> here, not <button> — kill the link underline and
   give them block layout so padding renders like the button classes */
.landing a.btn-primary,
.landing a.btn-small {
  display: inline-block;
  text-decoration: none;
}

/* hero — Face 1, the hook (RECORDING-VARIANT ONLY — see the comment
   in templates/landing.html).  It is the GIF's grand opening, so it
   is styled for the 1024×640 frame, not the page: bigger, bolder
   type.  The min-height fills the frame below the column's top
   padding (no navbar in this variant): the intro plays against the
   whole frame, and the demo card sits below the fold */
.landing-hero {
  text-align: center;
  padding: 2.5rem 0 2rem;
  min-height: 616px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.landing-tagline {
  display: inline-block;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--card);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: .25rem .9rem;
  margin-bottom: 1.25rem;
}
.landing-line {
  font-size: clamp(1.8rem, 5.5vw, 2.8rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 auto 1rem;
  max-width: 30ch;
}
/* the empathy kicker — the "until today..." that opens the icebreak.
   The grand opening's lead: the biggest, boldest type on the frame.
   The badge follows it BELOW (the kicker sets up the tagline, the
   tagline flips into the new world).  The min-height is its full
   3-line height, so the typewriter (landing-hero.js) never shifts
   the layout below it */
.landing-kicker {
  color: var(--text);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 600;
  max-width: 40ch;
  min-height: 4.8em;
  margin: 0 auto 1rem;
}
/* the typewriter caret while the kicker is being typed */
@keyframes landing-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.landing-kicker.typing::after {
  content: "▍";
  margin-left: 2px;
  animation: landing-caret .9s steps(1) infinite;
}
/* the hero intro's reveal targets: hidden until landing-hero.js
   fades them in.  The icebreak (kicker + badge) is faded OUT again
   before the new world (welcome + core line) fades in, then the
   subline.  Without JS the class is never added and everything is
   statically visible. */
.landing-pre { opacity: 0; }
.landing-kicker,
.landing-tagline,
.landing-welcome,
.landing-line,
.landing-subline { transition: opacity .4s ease; }
.landing-welcome {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0 0 .4rem;
}
.landing-subline {
  color: var(--muted);
  font-size: 1.2rem;
  max-width: 40ch;
  margin: 0 auto;
}

/* the demo GIF — the hook proof.  The recorded frames are 1024 px
   wide, so the card breaks out of the 46rem text column (centred on
   the page) and shows at full width — the detail has to stay
   legible */
.landing-demo {
  display: flex;
  justify-content: center;
  margin: .5rem 0 3rem;
  width: min(1024px, calc(100vw - 2.5rem));
  margin-left: 50%;
  transform: translateX(-50%);
}
.landing-gif {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--card);
  display: block;
}

/* the two prose faces (engine, then foundation) */
.landing-face {
  margin: 0 0 2.75rem;
  padding: 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
}
.landing-face h2 {
  font-size: 1.25rem;
  margin: 0 0 .75rem;
}
.landing-face p {
  color: var(--muted);
  margin: 0 0 .5rem;
}
.landing-face p:last-child { margin-bottom: 0; }
.landing-face a { color: var(--accent); }
.landing-face ul {
  margin: 0 0 .5rem;
  padding-left: 1.2rem;
  color: var(--muted);
}
.landing-face li { margin-bottom: .45rem; }
.landing-face li:last-child { margin-bottom: 0; }

/* footer — same legal trio as the in-app Help modal footer */
.landing-footer {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.landing-footer a { color: var(--muted); }
.landing-footer a:hover { color: var(--text); }
