/* Personal Task App — clean, fast, mobile-first.
   Mobile-first: base rules target a 375px phone (no horizontal scroll, tap-sized
   controls); the media query at 720px adds the roomier desktop layout. */

:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --ink: #1c1d21;
  --muted: #6b6f76;
  --line: #e4e5e9;
  --accent: #3b6ef5;
  --danger: #d64545;
  --p-high: #d64545;
  --urgent-bg: #fdecec;       /* light red card for urgent (high-priority) tasks */
  --urgent-line: #f0b4b4;
  --p-medium: #e08a1e;
  --p-low: #3b8f6a;
  --radius: 12px;
  --tap: 44px; /* minimum comfortable touch target */
  --jeremy: #2563eb;          /* shared list: who a task is for */
  --jeremy-bg: #e3ecff;
  --susette: #db2777;
  --susette-bg: #fde4f0;
  --on-accent: #fff;          /* text on an accent-filled button */
  --today: var(--accent);     /* the Today heading and the edge of today's tasks */
  --done: var(--p-low);       /* a ticked task's checkbox */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a; --card: #212327; --ink: #f2f3f5; --muted: #9aa0a8;
    --line: #34363c; --accent: #6c95ff;
    --urgent-bg: #3a2224; --urgent-line: #7a3a3f;
    --jeremy: #7aa7ff; --jeremy-bg: #1d2a47;
    --susette: #f47bb6; --susette-bg: #431f33;
    --on-accent: #0f1b3a;
  }
}

/* ---- Deep lagoon (the default theme) ----
   A medium-dark teal that rests the eye. Color is spent on meaning only: gold for
   Today, coral for urgent, aqua for actions, sage for done. "Classic" (the theme
   switch in the sidebar) drops this block and falls back to the light/dark pair above.
   Every body-text pair here is at least 4.5:1 (checked by test_theme.py). */
:root[data-theme="lagoon"] {
  color-scheme: dark;
  --bg: #1d3f42; --card: #28565a; --ink: #eaf4f3; --muted: #b3cfcd;
  --line: #3b6b6e; --accent: #7fd8cc; --on-accent: #0f2e30;
  --today: #f2c063; --done: #7cc7a4;
  --danger: #ff8f7a; --p-high: #ff8f7a; --p-medium: #f5a65b; --p-low: #7cc7a4;
  --urgent-bg: #4a3a38; --urgent-line: #b8665a;
  --jeremy: #9cc2ff; --jeremy-bg: #23466a;
  --susette: #f7a6cc; --susette-bg: #5a3048;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* ---- login ---- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem; display: grid; gap: .75rem;
}
.login-card input, .login-card button {
  width: 100%; min-height: var(--tap); padding: 0 .75rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.login-card button { background: var(--accent); color: var(--on-accent); border: none; font-weight: 600; }

/* ---- app shell ---- */
#app { max-width: 760px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin-bottom: 1rem;
}
.topbar h1 { flex: 1 1 auto; }
.views { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.view-btn { min-height: 40px; padding: 0 .9rem; border: none; background: var(--card); color: var(--muted); }
.view-btn[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.show-done { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .9rem; }
.app-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--muted); text-decoration: none; white-space: nowrap;
}
.app-link:hover, .app-link:focus-visible { color: var(--accent); border-color: var(--accent); }
/* Red count: subscriptions due within 5 days (or payment failed) and not marked Good to go. */
.app-link.alert { border-color: #e5484d; color: #ff8a8d; }
.orders-alert { margin-left: .45rem; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px;
  background: #e5484d; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.3rem; text-align: center; }
/* Orders count, same as the Launchpad Orders card: blue, or red when any order is late. */
.orders-count { margin-left: .45rem; min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-size: .75rem; font-weight: 700; line-height: 1.3rem; text-align: center; }
.orders-count.late { background: #e5484d; }
/* Phone: the link points at this PC's Mission Control, which the phone cannot reach. */
@media (max-width: 719px) { .app-link { display: none; } }

/* ---- sidebar (one list per business) ----
   Phone: off-canvas drawer (translateX) + scrim, opened by #sidebar-toggle.
   Desktop (>=720px): a fixed 220px left column beside the content. */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: min(80vw, 280px); z-index: 20;
  background: var(--card); border-right: 1px solid var(--line);
  padding: 1rem .75rem; display: flex; flex-direction: column; gap: .5rem;
  transform: translateX(-100%); transition: transform .2s ease;
}
#app.sidebar-open .sidebar { transform: none; }
.sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 19; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.list-sort { flex: 1 1 auto; min-width: 0; min-height: 32px; padding: 0 .4rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); font-size: .8rem; }
.list-item.dragging { opacity: .5; }
.list-item.drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.list-item.drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.list-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.move-options .danger { color: var(--danger); border-color: var(--danger); }
@media (hover: none) {
  /* A long-press opens our Move chooser; keep the OS text-selection callout out of it. */
  .task { -webkit-touch-callout: none; user-select: none; }
}
.sidebar-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.icon-btn { min-width: var(--tap); min-height: var(--tap); border: none; background: transparent;
  color: var(--muted); font-size: 1.2rem; border-radius: 10px; }
.list-items { display: flex; flex-direction: column; gap: .15rem; overflow-y: auto; flex: 1 1 auto; }
.list-item {
  display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left;
  min-height: 40px; padding: 0 .6rem; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--ink);
}
.list-item .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .count { font-size: .78rem; color: var(--muted); }
.list-item[aria-current="true"] { background: var(--bg); border-color: var(--line); font-weight: 600; }
.list-item.drop-target { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.list-menu { min-width: 32px; min-height: 32px; border: none; background: transparent; color: var(--muted);
  border-radius: 8px; font-size: 1rem; line-height: 1; }
.list-new { min-height: 40px; padding: 0 .7rem; border-radius: 10px; border: 1px dashed var(--line);
  background: transparent; color: var(--muted); }
.task.dragging { opacity: .5; }
.task-move { flex: 0 0 auto; min-width: var(--tap); min-height: var(--tap);
  border: none; background: transparent; color: var(--muted); font-size: 1.1rem; }
.move-options { display: grid; gap: .4rem; }
.move-options button { min-height: var(--tap); padding: 0 .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-align: left; }
.chip.list { color: var(--ink); background: var(--card); }
.chip.hint { color: var(--p-medium); border-color: var(--p-medium); }

/* ---- add form ---- */
.add-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.add-form input[type="text"] { flex: 1 1 100%; min-width: 0; }
.add-form input, .add-form select, .add-form button {
  min-height: var(--tap); padding: 0 .7rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.add-form button { background: var(--accent); color: var(--on-accent); border: none; font-weight: 600; padding: 0 1.1rem; }

/* ---- list ---- */
.group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); margin: 1.25rem .25rem .4rem; }
.task {
  display: flex; align-items: flex-start; gap: .6rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem;
  margin-bottom: .5rem;
}
.task.done .task-desc { text-decoration: line-through; color: var(--muted); }
.task.urgent { background: var(--urgent-bg); border-color: var(--urgent-line); }
.task.urgent .chip { background: transparent; }
.cal-pill.urgent { background: var(--urgent-bg); border-color: var(--p-high); }
.urgent-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 999px; background: var(--p-high);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--p-high) 25%, transparent); }
.task-check { width: 26px; height: 26px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--accent); }
.task-body { flex: 1 1 auto; min-width: 0; }
.task-desc { font-weight: 500; word-break: break-word; }
.task-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; font-size: .82rem; }
.chip { padding: .1rem .5rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.chip.due { color: var(--ink); }
.chip.overdue { color: var(--danger); border-color: var(--danger); }
.chip.prio-high { color: var(--p-high); border-color: var(--p-high); }
.chip.prio-medium { color: var(--p-medium); border-color: var(--p-medium); }
.chip.prio-low { color: var(--p-low); border-color: var(--p-low); }
.chip.tag { color: var(--accent); }
.chip.note { font-style: italic; }
.task-edit { flex: 0 0 auto; min-width: var(--tap); min-height: var(--tap);
  border: none; background: transparent; color: var(--muted); font-size: 1.1rem; }
.empty { text-align: center; margin-top: 2rem; }

/* ---- board ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr);
  gap: .75rem; overflow-x: auto; padding-bottom: .75rem; align-items: start; }
.board-col { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 160px; display: flex; flex-direction: column; }
.board-col-head { display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .8rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); border-bottom: 1px solid var(--line); }
.board-col-body { padding: .5rem; flex: 1 1 auto; }
.board-col-body .task { margin-bottom: .45rem; }
.task.compact { cursor: pointer; }
.task.compact .task-body { cursor: pointer; border-radius: 8px; }
.task.compact .task-body:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task.compact .task-desc { overflow-wrap: anywhere; }
.board-col-body:empty::after { content: "Drop tasks here"; display: block; text-align: center;
  color: var(--muted); font-style: italic; font-size: .85rem; padding: 1.2rem 0; }
.board-col.drop-target { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.board-col.no-drop { opacity: .85; }

/* ---- calendar ---- */
.calendar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; }
.cal-title { margin: 0; }
.cal-nav { display: inline-flex; gap: .3rem; }
.cal-nav button { min-height: 36px; min-width: 36px; padding: 0 .6rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); text-align: center; padding: .3rem 0; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.cal-cell { background: var(--card); min-height: 92px; min-width: 0; padding: .3rem; cursor: pointer; display: flex;
  flex-direction: column; gap: .2rem; }
.cal-cell.other { background: var(--bg); }
.cal-cell.other .day { color: var(--muted); }
.cal-cell .day { font-size: .8rem; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 999px; }
.cal-cell.today .day { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.drop-target { background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.cal-pill { font-size: .72rem; line-height: 1.3; padding: .1rem .35rem; border-radius: 6px; background: var(--bg);
  border: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab;
  max-width: 100%; }
.cal-pill.done { text-decoration: line-through; color: var(--muted); }
.cal-pill.prio-high { border-color: var(--p-high); }
.cal-pill.prio-medium { border-color: var(--p-medium); }
.cal-more { font-size: .7rem; color: var(--muted); }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); }
.cal-dot.done { background: var(--muted); }
.cal-day-list { padding: .8rem .9rem; border-top: 1px solid var(--line); }
.cal-day-list:empty { display: none; }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.cal-day-head h3 { margin: 0; font-size: 1rem; }
.cal-add-day { min-height: 36px; padding: 0 .7rem; border-radius: 10px; border: 1px dashed var(--line);
  background: transparent; color: var(--muted); }
@media (max-width: 719px) {
  .cal-cell { min-height: 54px; }
  .cal-pill, .cal-more { display: none; }
  .cal-dots { display: flex; }
}

/* ---- ideas ---- */
.idea {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: .4rem .6rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem;
  margin-bottom: .45rem;
}
.idea .idea-tagline { cursor: grab; } /* the drag handle: the rest of the card stays selectable */
.idea.dragging { opacity: .5; }
.idea-body { flex: 1 1 auto; min-width: 0; }
.idea-tagline { font-weight: 600; word-break: break-word; }
.idea-summary { margin-top: .2rem; font-size: .9rem; word-break: break-word; }
.idea-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; font-size: .82rem; }
.idea-meta:empty { display: none; }
.idea-details { margin-top: .45rem; font-size: .9rem; }
.idea-details summary { cursor: pointer; color: var(--accent); width: fit-content; }
.idea-verbatim { margin-top: .4rem; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
/* One compact row under the text instead of a tall stack beside it. */
.idea-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; justify-content: flex-end;
  align-items: center; gap: .4rem; }
.idea-actions button {
  min-height: 36px; padding: 0 .75rem; border-radius: 8px;
  border: 1px solid var(--line); background: transparent; color: var(--ink); font-size: .9rem;
}
.idea-archived .idea-actions { flex: 0 0 auto; }
.idea-actions .primary { background: var(--accent); color: var(--on-accent); border: none; font-weight: 600; }

/* ---- shopping ---- */
.shop {
  display: flex; align-items: flex-start; gap: .6rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem;
  margin-bottom: .5rem;
}
.shop-new { border-color: var(--accent); }
.shop-check { margin-top: .3rem; width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.shop-body { flex: 1 1 auto; min-width: 0; }
.shop-name { font-weight: 600; word-break: break-word; }
.shop-name a { color: inherit; text-decoration: none; }
.shop-name a:hover { text-decoration: underline; }
.shop-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; font-size: .82rem; }
.shop-meta:empty { display: none; }
.shop-price { font-weight: 600; }
.shop-chip-new { border-color: var(--accent); color: var(--accent); }
.shop-notes { margin-top: .3rem; font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.shop-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: .4rem; }
.shop-actions button {
  min-height: var(--tap); padding: 0 .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.shop-add-form input { min-width: 0; }

/* ---- edit dialog ---- */
dialog.edit { width: min(92vw, 440px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; background: var(--card); color: var(--ink); }
dialog.edit::backdrop { background: rgba(0,0,0,.4); }
.edit label { display: grid; gap: .25rem; margin-bottom: .7rem; font-size: .85rem; color: var(--muted); }
.edit input, .edit select, .edit textarea {
  min-height: var(--tap); padding: .4rem .6rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); width: 100%;
}
.edit textarea { min-height: 5rem; resize: vertical; }
.edit-actions { display: flex; align-items: center; gap: .5rem; padding: 0; margin: .5rem 0 0; }
.edit-actions .spacer { flex: 1; }
.edit-actions button { min-height: var(--tap); padding: 0 1rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.edit-actions .primary { background: var(--accent); color: var(--on-accent); border: none; font-weight: 600; }
.edit-actions .danger { color: var(--danger); border-color: var(--danger); }

/* ---- desktop ---- */
@media (min-width: 720px) {
  .add-form input[type="text"] { flex: 1 1 auto; }
  #app { max-width: 1040px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; }
  .sidebar { position: sticky; top: 1rem; align-self: start; width: auto; transform: none; transition: none;
    border: 1px solid var(--line); border-radius: var(--radius); max-height: calc(100dvh - 2rem); }
  .sidebar-scrim, #sidebar-close, .sidebar-toggle { display: none !important; }
}

/* The hidden attribute must always win: .login/.app set their own display,
   which otherwise overrides the UA's [hidden] display:none — so the login card
   stayed on screen after every successful sign-in. */
[hidden] { display: none !important; }

/* ---- shopping: research picks ---- */
.research-form button { background: transparent; color: var(--p-medium); border: 1px solid var(--p-medium); }
.research-note { flex: 1 1 100%; margin: 0; font-size: .9rem; }
.research-runs { margin: 0 0 1rem; }
.research-run { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin-bottom: .4rem; }
.research-run .q { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.research-run .st { flex: 0 0 auto; font-size: .8rem; color: var(--muted); }
.research-run .st.failed { color: var(--danger); }
.research-run .st.done { color: var(--p-low); }

/* Product picture (Amazon image by ASIN), inline edit forms, run buttons. */
.shop-img { width: 64px; height: 64px; flex: 0 0 auto; object-fit: contain; border-radius: 8px;
  background: #fff; border: 1px solid var(--line); }
@media (max-width: 719px) { .shop-img { width: 52px; height: 52px; } }
.shop-actions button.danger, .run-btn.danger { color: var(--danger); }
.shop-edit { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .5rem; }
.shop-edit input { flex: 1 1 12rem; min-width: 0; min-height: 40px; padding: 0 .6rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.shop-edit-actions { flex: 1 1 100%; display: flex; justify-content: flex-end; gap: .5rem; }
.shop-edit-actions button, .run-edit button { min-height: 40px; padding: 0 .9rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.shop-edit-actions button.primary, .run-edit button.primary { background: var(--accent); color: var(--on-accent); border: none; }
.run-btn { flex: 0 0 auto; min-width: 36px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--muted); }
.run-edit { flex: 1 1 auto; display: flex; flex-wrap: wrap; gap: .5rem; }
.run-edit input { flex: 1 1 12rem; min-width: 0; min-height: 40px; padding: 0 .6rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); }

/* Archived (N): a collapsed section at the bottom of Ideas and Shopping. */
details.archived { margin-top: 1rem; }
details.archived > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: .5rem 0;
  min-height: var(--tap); display: flex; align-items: center; }
details.archived .idea, details.archived .shop { opacity: .85; }
.idea-date { font-size: .8rem; margin-top: .25rem; }
.idea-actions .idea-list { min-height: 36px; max-width: 11rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }

/* Today stands out in gold; done tasks recede. */
.group-title.today { color: var(--today); font-weight: 700; }
.task.is-today { box-shadow: inset 3px 0 0 var(--today); }
.task.is-today.urgent { box-shadow: inset 3px 0 0 var(--p-high); }
:root[data-theme="lagoon"] .task.done { opacity: .72; }
:root[data-theme="lagoon"] .task.done .task-check { accent-color: var(--done); }
.theme-toggle { margin-top: .25rem; min-height: 36px; padding: 0 .7rem; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .85rem; }

/* ---- shared with Susette ----
   The mode switch sits at the top of the sidebar. Who a task is for shows as a filled
   pill (blue Jeremy, pink Susette) plus a matching left edge on the card. */
.mode-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mode-btn { flex: 1 1 0; min-height: 36px; border: none; background: var(--card); color: var(--muted); font-weight: 600; }
.mode-btn[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
#mode-shared[aria-selected="true"] { background: linear-gradient(90deg, var(--jeremy), var(--susette)); }
:root[data-theme="lagoon"] #mode-shared[aria-selected="true"] { color: #1b1f2a; }
.chip.who { font-weight: 600; }
.chip.who-jeremy { color: var(--jeremy); background: var(--jeremy-bg); border-color: var(--jeremy); }
.chip.who-susette { color: var(--susette); background: var(--susette-bg); border-color: var(--susette); }
.task.urgent .chip.who-jeremy { background: var(--jeremy-bg); }
.task.urgent .chip.who-susette { background: var(--susette-bg); }
.task.for-jeremy { box-shadow: inset 4px 0 0 var(--jeremy); }
.task.for-susette { box-shadow: inset 4px 0 0 var(--susette); }
.cal-pill.for-jeremy { box-shadow: inset 3px 0 0 var(--jeremy); }
.cal-pill.for-susette { box-shadow: inset 3px 0 0 var(--susette); }
.assignee-filter { min-height: 36px; padding: 0 .4rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); }

/* ---- quick capture ----
   A round mic button on every screen (bottom right, clear of the phone's gesture bar),
   and a sheet to say or type the thought and file it with one tap. */
.capture-fab {
  position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: 60px; height: 60px; border-radius: 999px; border: none; z-index: 30;
  background: var(--accent); color: var(--on-accent); font-size: 1.6rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.content { padding-bottom: 88px; } /* the last card scrolls clear of the mic button */
.capture h2 { margin-top: 0; }
.capture-mode { font-size: .9rem; font-weight: 400; }
.capture-mic {
  display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  min-height: 72px; margin-bottom: .8rem; border-radius: var(--radius);
  border: 2px solid var(--accent); background: transparent; color: var(--ink); font-size: 1.05rem; font-weight: 600;
}
.capture-mic-icon { font-size: 1.6rem; }
.capture-mic[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); animation: capture-pulse 1.2s ease-in-out infinite; }
@keyframes capture-pulse { 50% { box-shadow: 0 0 0 8px rgba(127,216,204,.25); } }
@media (prefers-reduced-motion: reduce) { .capture-mic[aria-pressed="true"] { animation: none; } }
.capture-hint { margin: 0 0 .6rem; font-size: .9rem; }
.capture-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.capture-kinds button {
  min-height: 52px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; font-size: 1rem;
}
.capture-kinds button.guess { background: var(--accent); color: var(--on-accent); border: none; }
.capture-kinds button:disabled { opacity: .5; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(max(1rem, env(safe-area-inset-bottom)) + 72px);
  margin: 0; padding: .6rem 1rem; border-radius: 999px; z-index: 31; max-width: calc(100vw - 32px);
  background: var(--ink); color: var(--bg); font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
/* Phone: the 6 view tabs did not fit one row (Shopping was cut off and could not be
   tapped). Two rows of 3, full width, every tab reachable. */
@media (max-width: 719px) {
  .views { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .view-btn { padding: 0 .4rem; min-height: var(--tap); }
}
/* Touch: the Shopping check box was 18px, too small to hit with a thumb. */
@media (hover: none) { .shop-check { width: 1.6rem; height: 1.6rem; margin-top: .1rem; } }
/* My tasks / Shared in the top bar: phone only (the sidebar holds it on desktop). */
.mode-switch-top { width: 100%; }
.mode-switch-top .mode-btn { min-height: var(--tap); }
.mode-btn-shared[aria-selected="true"] { background: linear-gradient(90deg, var(--jeremy), var(--susette)); }
:root[data-theme="lagoon"] .mode-btn-shared[aria-selected="true"] { color: #1b1f2a; }
@media (min-width: 720px) { .mode-switch-top { display: none !important; } }
