:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #646b78;
  --line: #e5e7eb;
  --accent: #4f46e5;
  /* Filled buttons and chips (white text): darker than --accent in dark mode, for contrast. */
  --accent-fill: #4f46e5;
  --danger: #b91c1c;
  --done: #6b7280;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214;
    --card: #1a1b1e;
    --text: #e6e6e6;
    --muted: #9aa0a6;
    --line: #2c2e33;
    --accent: #8b85ff;
    --accent-fill: #635bf0;
    --danger: #f87171;
    --done: #858b94;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
.app { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; }

.app-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.logo { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.logo a { color: inherit; text-decoration: none; font-weight: 700; }
.logo a::before { content: "∞ "; color: var(--accent); }

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; }
.breadcrumbs a { text-decoration: none; display: inline-block; background: none; border: 0; padding: 0; color: var(--muted); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs li:last-child a { color: var(--text); }

.focus { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.focus-header { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.focus-header h2 { margin: 0; font-size: 19px; flex: 1; overflow-wrap: anywhere; }
.focus-header .edit { flex: 1; }
.back { color: inherit; text-decoration: none; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px 10px; white-space: nowrap; }
.back:hover { border-color: var(--accent); color: var(--accent); }

.items { list-style: none; margin: 0; padding: 0; }
.children { margin-left: 22px; padding-left: 10px; border-left: 1px dashed var(--line); }
.row { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 8px; min-height: 36px; }
.row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.row .title { flex: 1; overflow-wrap: anywhere; cursor: text; }
.row.done > .title, .row.done > .title-stack > .title { color: var(--done); text-decoration: line-through; }
/* Title with the assignee's name as a subheading underneath. */
.title-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* As wide as its text: double-clicking it renames, the rest of the row opens the info. */
.title-stack > .title { flex: none; align-self: flex-start; max-width: 100%; }
.title-stack > .edit { flex: none; }
.assignee { font-size: 12px; line-height: 1.3; color: var(--muted); }
.assignee::before { content: "👤 "; }
/* An AI agent working on the item now (agent runners). */
.agent-work { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 12px; line-height: 1.3; color: var(--accent); }
.agent-work.waiting { color: var(--muted); }
.agent-work-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.agent-work.working .agent-work-dot { animation: agent-pulse 1.4s ease-in-out infinite; }
@keyframes agent-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.75); } }
@media (prefers-reduced-motion: reduce) { .agent-work.working .agent-work-dot { animation: none; } }
/* Settings › AI agents: whether an agent's runner is online. */
.runner-status { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13.5px; }
.runner-status li { display: flex; align-items: center; gap: 8px; }
p.runner-status { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; }
.runner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--done); flex: none; }
.runner-dot.online { background: #16a34a; box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 20%, transparent); }
.row .edit { flex: 1; }

input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; flex: none; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.45; }

.icon { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; background: none; border: 0; border-radius: 6px; width: 28px; height: 28px; padding: 0; color: var(--muted); flex: none; }
.icon:hover { background: var(--line); color: var(--text); }
.icon.danger:hover { color: var(--danger); }
.caret { transition: transform 0.12s ease; }
.caret.open { transform: rotate(90deg); }
.caret.hidden { visibility: hidden; }

.actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.1s; }
.row:hover .actions, .row:focus-within .actions { opacity: 1; }
@media (hover: none) { .actions { opacity: 1; } }

.progress { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }

form.add { display: flex; gap: 8px; margin-top: 10px; }
form.add.inline { margin: 4px 0 6px; }
input:not([type]), input[type="email"], input[type="password"] { flex: 1; min-width: 0; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
input:not([type]):focus, input[type="email"]:focus, input[type="password"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.edit input { width: 100%; padding: 3px 8px; }
form.add button { border: 0; border-radius: 8px; padding: 7px 14px; background: var(--accent-fill); color: white; }

.error { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 12px; border-radius: 8px; color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 24px 0 8px; margin: 0; }

.top-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; min-width: 0; }
.account .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); }
.link-button:hover { text-decoration: underline; }

.auth { max-width: 380px; margin: 40px auto 0; padding: 24px; }
.auth h2 { margin: 0 0 16px; font-size: 20px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.auth-form input { font-size: 15px; }
.auth .hint { margin: -6px 0 0; font-size: 12px; }
button.primary { border: 0; border-radius: 8px; padding: 9px 14px; background: var(--accent-fill); color: white; font-weight: 600; }
button.primary:disabled { opacity: 0.6; cursor: progress; }
.auth .switch { margin: 16px 0 0; font-size: 14px; text-align: center; }
.auth .switch.forgot { margin-top: 12px; }
.auth .intro { margin: -4px 0 16px; font-size: 14px; line-height: 1.5; }

/* Drag and drop */
.grip { color: var(--muted); opacity: 0; cursor: grab; font-size: 13px; width: 10px; flex: none; user-select: none; }
.row:hover .grip { opacity: 0.7; }
@media (hover: none) { .grip { display: none; } }
.row[draggable="true"] { cursor: grab; }
.row[draggable="true"] .title { cursor: inherit; }
.row.dragging { opacity: 0.4; }
.row.drop-target { background: color-mix(in srgb, var(--accent) 16%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.focus.drop-target { outline: 2px dashed var(--accent); outline-offset: 3px; }
.breadcrumbs a.drop-target { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 4px; padding: 0 4px; }
/* Insertion line for reordering: before / after a row. */
.row { position: relative; }
.row.drop-before::before, .row.drop-after::after {
  content: ""; position: absolute; left: 4px; right: 4px; height: 3px;
  background: var(--accent); border-radius: 2px; pointer-events: none;
}
.row.drop-before::before { top: -2px; }
.row.drop-after::after { bottom: -2px; }

/* Keyboard: the current item, a pending cut, and the shortcut legend. */
.row.selected { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.row.selected .actions { opacity: 1; }
.row.cut { opacity: 0.5; outline: 1px dashed var(--muted); outline-offset: -1px; }
/* Selected together (shift- or ⌘/Ctrl-click, J / K). */
.row.marked { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.row.marked.selected { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.shortcuts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 16px; font-size: 12px; }
.shortcuts .clipboard { color: var(--accent); }
.shortcuts .clipboard:empty { display: none; }
.shortcuts .help-hint { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.shortcuts .help-hint:hover { color: var(--text); }
.modal.help-dialog { max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; }
.help-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.help-header h3 { margin: 0; }
.help-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 24px; }
.help-groups h4 { margin: 12px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.help-groups table { border-collapse: collapse; width: 100%; font-size: 14px; }
.help-groups td { padding: 3px 0; vertical-align: top; }
.help-groups td.keys { width: 72px; white-space: nowrap; padding-right: 10px; }
kbd { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--card); color: var(--text); }
@media (hover: none) { .shortcuts { display: none; } }

/* Trash */
.trash-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 16px; flex: none; }
.trash-link:hover { background: var(--line); color: var(--text); }
.trash-link .count { font-size: 11px; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--line); color: var(--text); text-align: center; font-variant-numeric: tabular-nums; }
.empty-trash { margin-left: auto; flex: none; border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); background: transparent; border-radius: 8px; padding: 4px 10px; }
.empty-trash:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.empty-trash:disabled { opacity: 0.4; cursor: not-allowed; }
.trash .row .title { flex: 1; cursor: default; }
.trash-details { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }

/* Confirmation dialog */
.modal-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 20px; max-width: 400px; width: 100%; box-shadow: 0 20px 50px rgb(0 0 0 / 0.35); }
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 7px 14px; }
.modal-actions .danger-button { background: var(--danger); border-color: var(--danger); color: white; font-weight: 600; }
.modal-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: settings link + list switcher */
/* Settings (gear) and log out (open door) next to the email. */
.header-icon { width: 32px; height: 32px; position: relative; }
.header-icon.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.header-icon .count { position: absolute; top: -2px; right: -4px; }
/* Settings, as a dialog over the lists. */
.modal.settings-dialog { max-width: 760px; max-height: calc(100vh - 32px); overflow: auto; padding: 16px 20px 20px; }
.settings-dialog:focus { outline: none; }
.settings-dialog .help-header { margin-bottom: 12px; }
.settings-dialog .panel { background: var(--bg); }
.settings-dialog p:not(.muted):not(.notice) { color: var(--text); }
.settings-dialog p.notice { color: var(--accent); }
.inline-link { font: inherit; text-align: left; }
.list-facts { margin-bottom: 16px; }
.settings-hint { margin: 0; }
/* The audit log (v). */
.modal.audit-dialog { max-width: 640px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.audit-dialog:focus { outline: none; }
.audit-entries { list-style: none; margin: 4px 0 10px; padding: 0 4px 0 0; overflow: auto; min-height: 0; flex: 1; }
.audit-entries li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.audit-entries li:last-child { border-bottom: 0; }
.audit-line { overflow-wrap: anywhere; }
.audit-title { font-weight: 500; }
.audit-entries time { flex: none; font-size: 12px; white-space: nowrap; }
.audit-more { align-self: flex-start; margin-bottom: 10px; font: inherit; font-size: 14px; }
.settings-link .count { font-size: 11px; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--accent-fill); color: white; text-align: center; }
.switcher { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.switcher .tab { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 14px; max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher .tab:hover { color: var(--text); border-color: var(--muted); }
.switcher .tab.active { background: var(--accent-fill); border-color: var(--accent-fill); color: white; }

/* Settings and join pages */
.settings-sections { display: flex; flex-direction: column; gap: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.panel h3 { margin: 18px 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.panel p { margin: 0 0 10px; }
.panel a { color: var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.inline-form { display: flex; gap: 8px; margin: 8px 0; }
.inline-form button, .new-link button, button.secondary, .danger-outline { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 7px 14px; white-space: nowrap; }
.inline-form button.primary { border-color: var(--accent-fill); background: var(--accent-fill); color: white; }
.inline-form button.primary:disabled { cursor: not-allowed; }
button.primary.small { padding: 4px 12px; }
button:disabled { opacity: 0.6; cursor: progress; }
.seats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 12px 0 4px; }
.seats select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; margin-left: 4px; }
.new-link { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.new-link input { flex: 1; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.new-link p { flex-basis: 100%; font-size: 13px; }
/* An agent's token, shown once, with how to connect it. */
.agent-token { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.agent-token > p { margin: 0 0 6px; }
.agent-token code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 12px; }
/* Which groups an agent is in. */
.agent-groups { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; font-size: 14px; }
.agent-group { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.rows.agents li { align-items: flex-start; }
.connections { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.connections li { display: flex; gap: 12px; align-items: center; padding: 2px 0; border: 0; }
.connections li button { flex: none; white-space: nowrap; }
/* The OAuth approval page (/oauth/authorize). */
.consent { max-width: 560px; margin: 32px auto 0; padding: 20px 24px; }
.consent h2 { margin-top: 0; }
.consent-choices { display: flex; flex-direction: column; gap: 6px; }
.consent-choice { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.consent-choice input[type="text"], .consent-choice input:not([type]) { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: inherit; }
.notice { color: var(--accent); font-size: 14px; }
/* An explanation that stands out without being an error, e.g. a read-only group. */
.notice-box { padding: 8px 12px; margin: 0 0 12px; border-radius: 8px; font-size: 14px; background: color-mix(in srgb, var(--accent) 8%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.danger-link { color: var(--danger); }
.join { max-width: 460px; margin: 40px auto 0; }
.button-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

/* Side-by-side lists */
.app.two-panes { max-width: 1240px; }
.panes { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.two-panes .panes { grid-template-columns: 1fr 1fr; }
@media (max-width: 860px) { .two-panes .panes { grid-template-columns: 1fr; } }
/* On wider screens the lists page fits the window: each list's card grows
   with its items until it reaches the bottom, then its items scroll inside
   it (each pane on its own), with its header and the add box staying put.
   On narrow screens (panes stacked) the page scrolls as before. */
@media (min-width: 861px) {
  .app.lists { height: 100vh; height: 100dvh; box-sizing: border-box; padding-bottom: 12px; display: flex; flex-direction: column; }
  .app.lists > * { flex: none; }
  .app.lists > .panes { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  .app.lists .pane, .app.lists .pane-body, .app.lists .pane-body > .focus,
  .app.lists .focus-body, .app.lists .focus-body > .list { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
  .app.lists .pane-body > *, .app.lists .focus > *, .app.lists .focus-body > *, .app.lists .list > * { flex: none; }
  .app.lists .pane-body > .focus, .app.lists .focus > .focus-body, .app.lists .focus-body > .list { flex: 0 1 auto; }
  /* The part that scrolls: the list's top-level items (or the trash's, the
     archive's). Only that one: a nested sub-list that could scroll would
     catch trackpad scrolling on a Mac (it locks onto the innermost scroll
     area under the pointer) and not pass it on. */
  .app.lists .focus-body > .list > .items, .app.lists .focus > .items { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
}
.pane { min-width: 0; }
.pane .breadcrumbs { margin-bottom: 8px; }
.pane.active > div > .focus { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
/* The cursor only stands out in the pane the keys act on. */
.two-panes .pane:not(.active) .row.selected { background: transparent; box-shadow: inset 3px 0 0 var(--line); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 2px; flex: none; }
.header-tools .trash-link { margin-left: 0; }
.tool { background: none; border: 0; border-radius: 8px; padding: 4px 8px; font-size: 16px; color: var(--muted); }
.tool:hover { background: var(--line); color: var(--text); }
.focus-header .tool:last-child { margin-left: 2px; }

/* Links: group items shown in my list */
.link-badge { flex: none; font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.link-badge.broken { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.checkbox-spacer { display: inline-block; width: 17px; flex: none; }

/* Right-click menu */
.menu-backdrop { position: fixed; inset: 0; z-index: 20; }
.context-menu { position: fixed; min-width: 190px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); display: flex; flex-direction: column; }
.context-menu .menu-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; border: 0; background: none; color: inherit; font: inherit; font-size: 14px; text-align: left; padding: 6px 10px; border-radius: 5px; cursor: pointer; }
.context-menu .menu-item:hover:not(:disabled), .context-menu .menu-item:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.context-menu .menu-item:disabled { opacity: 0.45; cursor: default; }
.context-menu .menu-item.danger { color: var(--danger); }
.context-menu kbd { font: 12px ui-monospace, monospace; color: var(--muted); }
.context-menu .menu-separator { height: 1px; background: var(--line); margin: 4px 6px; }

/* Search dialog */
.search-dialog { max-width: 460px; }
.search-dialog input[type="search"] { width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-bottom: 10px; }
.search-dialog input[type="search"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.search-results { list-style: none; margin: 0 0 10px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; max-height: 300px; overflow: auto; }
.search-results:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.search-results li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.search-results li:hover { background: var(--line); }
.search-results li.selected { background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
.search-results .name { font-weight: 600; }
.search-results .muted { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-results { margin: 4px 0 12px; }
.search-dialog .hint { font-size: 12px; margin: 0; }
.search-dialog .assign-title { overflow-wrap: anywhere; }
.assign-children { display: block; margin: -4px 0 10px; font-size: 14px; cursor: pointer; }
.assign-children input { margin-right: 4px; vertical-align: -2px; }
.assign-children .muted { font-size: 13px; }

/* The search dialog (/ and g). */
.find-dialog { max-width: 600px; }
.find-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.find-head h3 { margin: 0; }
.segmented { margin-left: auto; display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.segmented button { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; border-radius: 6px; padding: 3px 10px; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.find-results { max-height: min(420px, 60vh); }
.find-results.stale { opacity: 0.6; }
.find-results li { display: block; }
.find-line { display: flex; align-items: center; gap: 8px; }
.find-title { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.find-results li.done .find-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.find-results .find-path, .find-results .find-snippet { font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-results .find-snippet { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.find-results mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

.join-hint { max-width: 380px; margin: 32px auto -24px; padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: 14px; }

/* Completed items in a list that hides them: they fade out, then go. The
   duration matches fade_ms in infinitodo_ui.gleam. */
.item.fading { animation: fade-out 0.7s ease-in forwards; pointer-events: none; }
@keyframes fade-out {
  0%, 30% { opacity: 1; }
  100% { opacity: 0; }
}
/* Shown only because "Show hidden" is on. */
.item.revealed > .row { opacity: 0.6; }

.show-hidden-bar { display: flex; justify-content: flex-end; margin: -2px 0 6px; }
.show-hidden {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 5px;
}
.show-hidden:hover { border-color: var(--accent); color: var(--text); }
.show-hidden .switch {
  position: relative; width: 26px; height: 15px; border-radius: 999px; background: var(--line);
  transition: background 0.15s;
}
.show-hidden .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.show-hidden.on { color: var(--text); }
.show-hidden.on .switch { background: var(--accent); }
.show-hidden.on .switch::after { transform: translateX(11px); }
.hidden-count { font-variant-numeric: tabular-nums; }

/* List settings: what happens to completed items. */
.completed-setting { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.completed-setting h2 { margin: 0 0 2px; }
.choice { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.choice > span { display: flex; flex-direction: column; }
.choice strong { font-weight: 600; }
.choice.locked { cursor: default; opacity: .55; }
@media (prefers-reduced-motion: reduce) {
  .item.fading { animation-duration: 0.01s; }
}

/* A group's short ID, after its name. */
.group-code { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); font: 600 11px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; vertical-align: 1px; }
/* Create group: labelled fields, the button lined up with the inputs. */
.new-group-form, .redeem-form, .comp-form, .api-token-form { align-items: flex-end; flex-wrap: wrap; }
.new-group-form .field, .redeem-form .field, .comp-form .field, .api-token-form .field { display: flex; flex-direction: column; gap: 3px; }
.new-group-form .field.grow, .redeem-form .field.grow, .comp-form .field.grow, .api-token-form .field.grow { flex: 1 1 12rem; }
.new-group-form .field-label, .redeem-form .field-label, .comp-form .field-label, .api-token-form .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.redeem-form { margin-top: 14px; }
.delete-account-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 10px; }
.delete-account-form .field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 12rem; }
.delete-account-form .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.delete-account-form .danger-zone { flex-basis: 100%; margin-top: 8px; }
.comp-form .comp-uses { width: 5.5rem; }
/* The admin code form's number, date and Premium fields, like its others. */
.comp-form select, .api-token-form select, .api-token-form input[type="url"], .comp-form input[type="number"], .comp-form input[type="date"] { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.comp-form select:focus, .comp-form input[type="number"]:focus, .comp-form input[type="date"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.comp-codes table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.comp-codes th, .comp-codes td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.comp-codes th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.comp-codes code { font-size: 13px; }
.comp-codes .table-scroll { overflow-x: auto; }
.comp-codes tr.inactive td { color: var(--muted); }
.inline-form .group-code-input { flex: 0 0 auto; width: 8.5ch; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; text-align: center; }

/* The admin dashboard (/app/admin). */
.admin { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.admin-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.admin-header h2 { margin: 0; font-size: 19px; flex: 1; }
.admin-note { font-size: 13px; margin: 0 0 14px; }
.admin-note .back { font-size: 12px; padding: 1px 8px; margin-left: 4px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-details { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; color: var(--muted); }
.admin-chart { margin: 0 0 18px; }
.admin-chart figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.chart-title { font-weight: 600; font-size: 14px; color: var(--text); }
section.admin-chart .chart-title { margin-bottom: 6px; }
.admin-chart svg { display: block; width: 100%; height: 110px; overflow: visible; }
.admin-chart .bar path { fill: var(--accent); }
.admin-chart .bar .hit { fill: transparent; }
.admin-chart .bar:hover .hit { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.admin-chart .bar:hover path { fill: color-mix(in srgb, var(--accent) 80%, var(--text)); }
.admin-chart .axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.admin-chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; margin-top: 2px; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hbars li { display: grid; grid-template-columns: minmax(6rem, 12rem) minmax(3rem, 1fr) 3rem; align-items: center; gap: 8px; font-size: 13px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; }
.hbar { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.admin-table table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.admin-table th, .admin-table td { text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line); }
.admin-table th:first-child, .admin-table td:first-child { text-align: left; }

/* An opened item's ID (LEES1-00002A), under its title; click copies it. */
.item-ref { align-self: flex-start; background: none; border: 0; padding: 0; margin-top: 1px; color: var(--muted); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; cursor: copy; }
.item-ref:hover { color: var(--accent); text-decoration: underline; }

/* A task's info dialog (i). */
.modal.task-info { max-width: 760px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.task-info:focus { outline: none; }
.task-info .help-header { align-items: flex-start; }
.task-info-heading { flex: 1; min-width: 0; }
.task-info-heading h2, .task-info-heading h3 { margin: 0; font-size: 1.17em; overflow-wrap: anywhere; }
.modal .task-info-where { margin: 2px 0 0; font-size: 13px; }
.task-info-ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
/* The item's ID: click to copy. */
button.task-info-ref { border: 0; background: none; padding: 1px 4px; margin: 0 -4px; border-radius: 4px; color: inherit; cursor: copy; }
button.task-info-ref:hover, button.task-info-ref:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.task-info-copied { margin-left: 8px; color: var(--accent); font-size: 12px; }
.task-info-address { margin-left: 10px; font-size: 12px; }
/* The "Send to" dialog (looks like search's). */
.send-to-dialog { max-width: 460px; }
/* Upcoming's calendar feed: the button, and the box with its address. */
.calendar-toggle { margin-left: auto; }
.calendar-toggle.on { border-color: var(--accent); color: var(--accent); }
.calendar-feed { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; }
.calendar-feed > p { margin: 0 0 8px; }
.send-to-results li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; }
.task-info-body { overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.task-info-people { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task-info-people .settings-hint { grid-column: 1 / -1; font-size: 12.5px; margin: 0; }
.task-info .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-info .field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.task-info select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.follow-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.follow-row .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 12px; white-space: nowrap; }
.follow-button.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.task-info-section { padding: 12px 0 0; }
.task-info textarea { display: block; width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.task-info textarea:focus { outline: none; border-color: var(--accent); }
.modal .task-info-section .settings-hint { font-size: 12px; min-height: 1.4em; margin: 2px 0 0; }
.comments { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.comment { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.comment-meta { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.comment-meta time { font-size: 12px; }
.comment-actions { margin-left: auto; display: flex; gap: 10px; }
.comment-action { font-size: 12px; color: var(--muted); }
.comment-action:hover { color: var(--accent); }
.comment-edited { font-size: 12px; }
.comment-edit { margin-top: 4px; }
.comment-edit-buttons { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.comment-delete:hover { color: var(--danger); }
.modal .comment-body { margin: 2px 0 0; color: var(--text); overflow-wrap: anywhere; font-size: 14px; }
.comment-form { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 4px; }
.comment-form note-editor, .comment-edit note-editor, .comment-reply note-editor { width: 100%; }
/* Replies: under the comment that started their thread, indented. */
.comments.replies { margin: 6px 0 0 18px; padding-left: 10px; border-left: 2px solid var(--line); gap: 6px; }
.comment-deleted { background: transparent; border-style: dashed; }
.comment-deleted p { margin: 0; font-size: 13px; }
.comment-reply { margin: 6px 0 0 18px; padding-left: 10px; }
@media (max-width: 520px) { .task-info-people { grid-template-columns: 1fr; } }

/* The notifications bell and its list. */
.notifications { position: relative; }
.notifications-button .count { font-size: 11px; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: var(--danger); color: white; text-align: center; font-variant-numeric: tabular-nums; }
.notifications-panel { position: absolute; right: -60px; top: calc(100% + 8px); z-index: 21; width: min(380px, calc(100vw - 32px)); max-height: min(70vh, 520px); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgb(0 0 0 / 0.25); }
.notifications-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.notifications-header h3 { margin: 0; font-size: 15px; }
.notifications-empty { padding: 14px; margin: 0; font-size: 13.5px; }
.notifications-panel > .muted { padding: 14px; margin: 0; }
.notifications-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
/* The list and Load more under it, scrolling together. */
.notifications-body { min-height: 0; overflow-y: auto; }
.notifications-body > .notifications-list { overflow: visible; }
.notifications-more { display: block; width: 100%; padding: 8px 10px 12px; text-align: center; font-size: 13.5px; }
.notification { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px 8px 20px; position: relative; font-size: 13.5px; }
.notification:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notification.unread::before { content: ""; position: absolute; left: 7px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.notification.gone { opacity: 0.6; cursor: default; }
.notification-text { overflow-wrap: anywhere; }
.notification-meta { font-size: 12px; }
/* The task's title in its info dialog: a heading you can type into. */
.task-info-title { display: block; width: 100%; margin: -4px 0 0 -6px; padding: 3px 6px; font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.35; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 6px; }
.task-info-title:hover { border-color: var(--line); }
.task-info-title:focus { outline: none; border-color: var(--accent); background: var(--bg); }

/* Playbooks: the + next to "Add a task…", its dialog, and settings. */
form.add button.playbook-button { background: transparent; color: var(--accent); border: 1px solid var(--line); padding: 7px 11px; font-weight: 600; line-height: 1; }
form.add button.playbook-button:hover { border-color: var(--accent); }
.modal.playbook-dialog { max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; }
.playbook-dialog h4 { margin: 14px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.playbook-dialog .playbook-section:first-child h4 { margin-top: 4px; }
.playbook-dialog form > p, .playbook-dialog > div > p:not(.muted) { color: var(--text); }
.playbook-dialog .settings-hint { margin-top: 14px; font-size: 13px; }
.playbook-dialog .field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.playbook-dialog .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.playbook-rows .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.playbook-rows .playbook-name { font-weight: 600; color: var(--text); }
.playbook-actions { display: inline-flex; gap: 14px; }
.playbook-new, .playbook-rename { margin: 8px 0 0; }
.playbook-rename { flex: 1; margin: 0; }
.playbook-where { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.playbook-where legend { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; padding: 0; }
.playbook-where .radio { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }
.playbook-banner { font-size: 13.5px; }
.confirm-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.danger-outline.small { padding: 3px 10px; }
.modal-actions button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: white; font-weight: 600; }
.modal-actions button.primary:disabled { opacity: 0.5; }
.settings-dialog .playbooks-panel { margin-top: 16px; }

/* Your settings: a sidebar of pages (a row of tabs on narrow screens). */
/* A steady size while moving between pages; the page scrolls inside it. */
.modal.settings-dialog:has(.settings-layout) { max-width: 920px; height: min(720px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden; }
.settings-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.settings-nav { overflow-y: auto; }
.settings-page { overflow-y: auto; padding-right: 2px; }
.settings-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-nav-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 7px 10px; color: var(--text); font: inherit; font-size: 14.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-nav-item.sub { padding-left: 24px; font-size: 13.5px; color: var(--muted); }
.settings-nav-item:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.settings-nav-item.current { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 600; }
.settings-nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.settings-page { min-width: 0; }
@media (max-width: 640px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
  .settings-nav { overflow-x: auto; overflow-y: hidden; margin: 0 -4px; padding: 0 4px 4px; }
  .settings-nav ul { flex-direction: row; gap: 4px; }
  .settings-nav-item, .settings-nav-item.sub { width: auto; padding: 6px 10px; font-size: 13.5px; }
}

/* Due dates: a pill on the item (red when overdue, accent today), the
   preview under the add box, the info dialog's field, and Upcoming. */
.due { flex: none; font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.due.due-today { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); font-weight: 600; }
.due.due-soon { color: var(--text); }
.due.overdue { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); font-weight: 600; }
.due.done { opacity: 0.6; }
.due-preview { font-size: 13px; margin: 4px 0 0; }
.due-preview strong { color: var(--accent); }
.task-info-due .due-field, .task-info-repeat .due-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-info-due input[type="date"], .task-info-due input[type="time"], .task-info-due input[type="number"] { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.task-info-due input[type="number"] { width: 6rem; }
.task-info-due .muted { font-size: 13px; }
.upcoming { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.upcoming-section h3 { margin: 16px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.upcoming-section.overdue h3 { color: var(--danger); }
.upcoming-section.today h3 { color: var(--accent); }
.upcoming-rows li { gap: 10px; }
/* A repeating item's next copy, not added yet. */
.upcoming-rows li.coming .upcoming-title { color: var(--muted); }
.upcoming-rows li.coming .coming-when { font-size: 12.5px; }
.upcoming-title { text-align: left; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.upcoming-path { font-size: 13px; }
.upcoming-list { font-size: 13px; white-space: nowrap; }
/* Repeating items (🔁), and the Repeating chapter of settings. */
.repeat-mark { margin-left: 4px; font-size: 0.9em; }
.due.repeat-only { background: none; padding: 0; }
.task-info-repeat .repeat-input { flex: 1; min-width: 220px; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.task-info-repeat .repeat-hint { margin: 6px 0 0; font-size: 13px; }
.repeating .focus.panel { margin-bottom: 16px; }
.repeating-rows li { gap: 10px; }
.repeat-rule { font-size: 13px; white-space: nowrap; }
.new-schedule select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 40%; }
.new-schedule .hint { margin: 6px 0 0; font-size: 13px; }

/* Tags: #words in titles, and the Tags page (#). */
.tag { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 5px; padding: 0 4px; text-decoration: none; font-weight: 500; }
a.tag:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); text-decoration: underline; }
.done .tag { color: inherit; background: none; }
.tags-query { width: 100%; font: inherit; font-size: 15px; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-top: 4px; }
.tags-query:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.tags-page .hint { margin: 6px 0 10px; font-size: 13px; }
.tag-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--accent); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 13.5px; cursor: pointer; }
.tag-chip .count { color: var(--muted); font-size: 12px; }
.tag-chip:hover { border-color: var(--accent); }
.tag-chip.on { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }
.tag-chip.on .count { color: color-mix(in srgb, #fff 80%, transparent); }
.saved-filters { margin: 0 0 14px; }
.saved-filter { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 10px; font-size: 13.5px; }
.saved-filter.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.saved-filter .remove { color: var(--muted); padding: 0 4px; }
.saved-filters .inline-form { margin-top: 8px; }
@media (max-width: 640px) { .upcoming-list { display: none; } }

/* Phones: titles get the row's width. A row's actions (+ ⤢ ✎ 🗑) show
   once it's selected (tap it), and the header leaves out the email. */
@media (max-width: 640px) {
  .row .actions { display: none; }
  .row.selected .actions { display: flex; opacity: 1; }
  .account > .muted { display: none; }
}

/* "Moved “Taxes” Undo z" in the footer, after a change. */
.undo-offer { margin-left: auto; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo-offer .inline-link { font-weight: 600; }

/* Offline (see /sw.js): what shows is what was last loaded. */
.offline-notice { margin: 0 0 12px; }
.confirm-notice { margin: 0 0 12px; }
.confirm-notice .inline-link { font-weight: 600; }

/* Changes made offline, not saved yet (see outbox.gleam). */
.row.unsynced .title::after { content: " ⏳"; font-size: 0.8em; opacity: 0.7; }
.shortcuts .outbox-count { color: var(--text); }
.shortcuts .sync-problems-toggle { color: var(--danger, #dc2626); font-size: 12px; }
.sync-problems { margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.sync-problems-head { display: flex; align-items: center; justify-content: space-between; }
.sync-problems-head h3 { margin: 0; font-size: 15px; }
.sync-problem { gap: 10px; font-size: 14px; }
.sync-problem.saved strong { font-weight: 500; }

/* Settings → Notifications (email and push). */
.notify-settings .focus.panel { margin-bottom: 16px; }
.notify-choice { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 14.5px; line-height: 1.45; cursor: pointer; }
.notify-choice input { margin-top: 3px; }
.push-here { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 10px 0 4px; font-size: 14.5px; }
.notify-settings h3 { margin: 18px 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.notify-settings .notice { color: var(--accent); font-size: 14px; }

/* An item's activity, in its info. */
.task-info-activity .activity-toggle { font-size: 13.5px; }
.activity { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13.5px; line-height: 1.45; }
.activity li { padding: 4px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; }
.activity-time { font-size: 12.5px; }

/* Settings → Import & export. */
.import-export .focus.panel { margin-bottom: 16px; }
.export-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.export-row select, .import-export .wrap-title { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.import-export .wrap-title { width: 100%; margin: 0 0 6px; }
.export-row .button { text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
.import-export .paste { margin-top: 12px; }
.import-export .paste textarea { width: 100%; font: 13.5px/1.5 ui-monospace, Menlo, monospace; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 8px 0; }
.import-export .notice { color: var(--accent); }
.import-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }

/* Settings › API: the token just made. */
.api-new-token p { margin: 0 0 8px; }
.api-new-token .token-row { display: flex; gap: 8px; }
.api-new-token .token-field { flex: 1; min-width: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
/* Settings › API: webhooks. */
.webhooks { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.webhooks h3 { margin: 0 0 4px; }
.api-token-form input[type="url"] { min-width: 0; width: 100%; }
.hook-events { border: 0; padding: 0; margin: 2px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.hook-events legend { padding: 0; margin-bottom: 4px; }
.hook-events .inline-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.hooks .hook-url code { font-size: 13px; overflow-wrap: anywhere; }
.hooks .small { font-size: 13px; margin-top: 2px; }
.hooks .row-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }
.hook-secret { display: flex; gap: 8px; margin-top: 6px; }
.hook-secret .token-field { flex: 1; min-width: 0; font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.hook-secret button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 6px 12px; color: inherit; font: inherit; font-size: 14px; }
/* Sign up: agreeing to the terms. */
.agree { font-size: 13px; margin: 10px 0 0; }
/* Settings › Account: sign-in and security. */
.security h3 { margin: 16px 0 6px; font-size: 15px; }
.security .qr { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.security .qr svg { width: 100%; height: 100%; display: block; }
.security .secret { font-size: 13px; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.security .two-factor-setup .inline-form { align-items: flex-end; flex-wrap: wrap; }
.security .two-factor-setup .field { display: flex; flex-direction: column; gap: 3px; }
.security .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.security .inline-form input { max-width: 14rem; }
.security .on-badge { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: #16a34a; border-radius: 999px; padding: 1px 9px; }
.recovery-codes ul { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 4px 12px; }
.recovery-codes code { font-size: 14px; letter-spacing: 0.04em; }
.security .button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.security .button-row button, .security > div > button { border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 7px 14px; color: inherit; font: inherit; }
.security .button-row button.primary, .security button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; }

/* For screen readers only. */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Reduced motion: no transitions or animations anywhere (they still end,
   so anything waiting on them still happens). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* List settings: who new items are assigned to. */
.default-assignee { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.default-assignee select { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; max-width: 100%; }
