: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); }
/* "My tasks", your home list: a house before its name (INFIN-00008E). */
.home-icon { flex: none; vertical-align: -0.125em; margin-right: 0.3em; }
.breadcrumbs a .home-icon { width: 1.05em; height: 1.05em; }
.focus-header h2 .home-icon { width: 0.95em; height: 0.95em; color: var(--accent); }

.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; }
/* An item's checkbox and title. On a phone they get a row of their own
   under Back and the tools, so a long title isn't squeezed into a column. */
.focus-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
@media (max-width: 640px) {
  .focus-header { flex-wrap: wrap; row-gap: 8px; }
  .focus-header > .focus-title { order: 1; flex-basis: 100%; align-items: flex-start; }
  .focus-title > input[type="checkbox"] { margin-top: 5px; }
  /* The due date and progress: a line under the title, lined up with it. */
  .focus-header > .due, .focus-header > .progress { order: 2; }
  .focus-header > .focus-title + .due, .focus-header > .focus-title + .progress { margin-left: 26px; }
}
.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; }
/* On the selected row's tinted background, a little darker (lighter in dark
   mode) to keep 4.5:1 contrast. */
.row.selected.done > .title, .row.selected.done > .title-stack > .title { color: color-mix(in srgb, var(--done) 70%, var(--text)); }
/* 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; }
/* An agent's AI plan usage (INFIN-000068): a line and a bar per limit. */
.agent-usage { margin-top: 8px; }
.agent-usage p { margin: 0 0 4px; }
.agent-usage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.agent-usage li { display: grid; gap: 3px; }
.usage-bar { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--done) 35%, transparent); overflow: hidden; max-width: 320px; }
.usage-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.agent-usage li.hit .usage-label { color: var(--danger); font-weight: 600; }
.agent-usage li.hit .usage-bar > span { background: var(--danger); }
.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); }
/* The expand/collapse arrow (INFIN-0000CB): bold and close to the text's
   colour, so items with sub-items stand out. */
.caret { transition: transform 0.12s ease; color: color-mix(in srgb, var(--text) 80%, var(--muted)); }
.caret svg { display: block; }
.caret:hover { color: var(--text); }
.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); }
/* 16px: smaller, and iPhones zoom the page in when you tap the field. */
.auth-form input { font-size: 16px; }
/* An error sits in the form, just above its button. */
.auth-form .error { margin: 0; }
.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); }
/* Touch screens: no keyboard, so no shortcuts hint or keys. What's left
   (Undo after a change, status messages, changes not saved yet) floats at
   the bottom of the screen, above the list tabs if they're there, and only
   while it has something to say. */
@media (hover: none) {
  .shortcuts .help-hint, .shortcuts kbd { display: none; }
  .shortcuts {
    position: fixed; left: 12px; right: 12px; z-index: 6;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: 560px; margin: 0 auto; padding: 8px 14px;
    align-items: center; font-size: 14px; color: var(--text);
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 6px 20px rgb(0 0 0 / 0.18);
  }
  .app.with-list-tabs .shortcuts { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .shortcuts.quiet { display: none; }
  /* A long label wraps rather than pushing Undo off the screen. */
  .shortcuts .undo-offer { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; white-space: normal; }
  .shortcuts .undo-offer .inline-link { flex: none; margin-left: auto; min-height: 44px; padding: 0 12px; }
}

/* 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 minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
/* A long email address wraps rather than running off a phone's screen. */
.facts dd { margin: 0; overflow-wrap: anywhere; }
.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; }
/* The Completed box, on its own row under the title (INFIN-000095); as tall as a row's on phones. */
.task-info-done { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; margin: 6px 0 0; font-size: 14px; cursor: pointer; user-select: none; }
.task-info-done input { width: 18px; height: 18px; margin: 0; cursor: inherit; }
.task-info-done:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
@media (hover: none) { .task-info-done { min-height: 44px; margin: 0; padding-right: 8px; font-size: 16px; } .task-info-done input { width: 22px; height: 22px; } }
.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; }
/* A Copy button just pressed: "Copied ✓" for a moment (copied.gleam). */
.copy-button.copied { color: var(--accent); border-color: var(--accent); }
.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); }
/* Phones: under the whole top bar, the screen's width (from the bell it
   would hang off the left edge). */
@media (max-width: 640px) {
  .top-bar { position: relative; }
  .notifications { position: static; }
  .notifications-panel { left: 0; right: 0; width: auto; }
}
.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; }
/* Resend's answer, by the button (INFIN-0000A4). */
.confirm-resent { font-weight: 600; }
.confirm-resend-error { 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%; }

/* Phones: tabs along the bottom (in reach of a thumb) to switch between my
   list and each group's, one tap each; they scroll sideways if there are
   many. The page leaves room for them. */
.list-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}
.list-tabs::-webkit-scrollbar { display: none; }
.list-tab {
  flex: none; min-height: 44px; max-width: 60vw; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-tab[aria-current="page"] { background: var(--accent-fill); border-color: var(--accent-fill); color: #fff; font-weight: 600; }
.list-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app.with-list-tabs { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

/* Phones: the logo stays on one line next to the header's icons. */
@media (max-width: 640px) {
  .logo { font-size: 19px; white-space: nowrap; }
  .top-bar { gap: 8px; }
  .account { gap: 4px; }
}

/* Dialogs use the height the browser actually shows (dvh): on phones 100vh
   includes the area behind the browser's toolbars, so a dialog's bottom
   could be cut off. */
@supports (height: 100dvh) {
  .modal.help-dialog, .modal.settings-dialog, .modal.audit-dialog, .modal.task-info, .modal.playbook-dialog { max-height: calc(100dvh - 32px); }
  .modal.settings-dialog:has(.settings-layout) { height: min(720px, calc(100dvh - 32px)); }
}

/* Phones: dialogs fill the screen (less a small margin) and scroll inside
   themselves; their header, with the close button, stays at the top; the
   close button is big enough to tap. Dialogs with a search box sit at the
   top, clear of the on-screen keyboard. */
@media (max-width: 640px) {
  .modal-backdrop {
    padding: max(8px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px));
  }
  .modal { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); overflow: auto; padding: 16px; }
  .modal.help-dialog, .modal.settings-dialog, .modal.audit-dialog, .modal.task-info, .modal.playbook-dialog {
    max-width: none; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
  }
  .modal.settings-dialog:has(.settings-layout) { height: calc(100vh - 16px); height: calc(100dvh - 16px); }
  .modal .help-header {
    position: sticky; top: -16px; z-index: 1;
    margin: -16px -16px 8px; padding: 12px 8px 8px 16px;
    background: var(--card); border-bottom: 1px solid var(--line);
  }
  .modal .help-header .icon { width: 44px; height: 44px; font-size: 18px; }
  .modal-backdrop.at-top { align-items: flex-start; }
}
/* Touch screens: the search dialogs' keyboard hints (tab, j/k, enter, esc)
   don't apply. */
@media (hover: none) { .search-dialog .hint { display: none; } }

/* Very narrow phones: the header's six icons and the logo don't fit side by
   side, so the logo is just ∞ (screen readers still hear "infinitodo"). */
@media (max-width: 360px) {
  .logo a { font-size: 0; }
  .logo a::before { content: "∞"; font-size: 24px; }
}

/* Touch screens: rows and their controls big enough for a finger. The
   check box is 24px (the row, 44px tall, takes the tap around it), the
   expand arrow and the actions 44px tall. The selected row's actions get
   a line of their own under the title, with their names (Sub-item, Focus,
   Details); tapping the selected row again opens its details. */
/* Taps on the label are the button's (the row tells its controls apart by
   the tapped element's tag). */
.action-label { display: none; pointer-events: none; }
@media (hover: none) {
  .row { min-height: 44px; padding-top: 0; padding-bottom: 0; flex-wrap: wrap; row-gap: 2px; }
  .row input[type="checkbox"] { width: 24px; height: 24px; margin: 0; flex: none; }
  .row .icon.caret { width: 32px; height: 44px; }
  .row .actions .icon { width: auto; min-width: 44px; height: 44px; padding: 0 8px; gap: 6px; font-size: 17px; }
  .row.selected .actions { flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
  .row.selected .action-label { display: inline; font-size: 14px; color: var(--text); }
  .row.selected .actions .icon { border: 1px solid var(--line); background: var(--card); border-radius: 10px; }
  /* 🗑 needs no word, which keeps the four on one line on most phones. */
  .row.selected .actions .icon.danger .action-label { display: none; }
  .row.selected .actions { padding-bottom: 6px; }
}

/* Touch screens: the log-in and sign-up page's links and button are big
   enough to tap. */
@media (hover: none) {
  .auth-form input { min-height: 44px; }
  .auth-form button.primary { min-height: 48px; font-size: 16px; }
  .auth .switch .link-button { min-height: 44px; padding: 0 6px; }
  .auth .agree a { display: inline-block; padding: 6px 0; }
  .auth-form .error { padding-right: 0; }
  .auth-form .error .icon { width: 44px; height: 44px; }
}

/* Touch screens: text boxes at least 16px (smaller, and iPhones zoom the
   page in when one is tapped), and while one has the cursor the bars pinned
   to the bottom (list tabs, Undo) step aside so they can't cover it. */
@media (hover: none) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select { font-size: 16px; }
  .typing .list-tabs, .typing .shortcuts { display: none; }
  .typing .app.with-list-tabs { padding-bottom: 80px; }
}

/* Settings › Forms (forms.gleam): forms whose responses become items. */
.forms-page .inline-form { flex-wrap: wrap; align-items: flex-end; }
.forms-page .field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; min-width: 0; }
.forms-page .field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.forms-page .field input:not([type=checkbox]):not([type=color]):not([type=file]), .forms-page .field textarea, .forms-page .field select { width: 100%; font: inherit; }
.forms-page .field textarea { resize: vertical; }
.forms-page .grow { flex: 1; }
.forms-page .small { font-size: 13px; }
.forms-page label.check { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.forms-list .link-button { white-space: nowrap; }
.forms-editor-head { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.forms-editor-head h2 { margin: 0; overflow-wrap: anywhere; }
.forms-section { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.forms-section h3 { margin: 0 0 8px; }
.form-share .token-row { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.form-share .token-field { flex: 1; min-width: 12rem; }
.form-share .button { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.form-fields { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.form-field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 4px; }
.form-field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-field-row > .field { flex: 0 1 auto; }
.form-field-row > .field.grow { flex: 1 1 14rem; }
.form-field-tools { align-items: center; padding-bottom: 6px; }
.forms-page .key-input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; width: 14ch; }
.forms-section code { font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.form-preview { margin: 4px 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--line); }
.form-preview p { margin: 4px 0 0; overflow-wrap: anywhere; }
.form-preview-title { font-weight: 600; }
.form-preview-notes { white-space: pre-wrap; color: var(--muted); font-size: 14px; }
.forms-page .color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.forms-page input[type=color] { width: 44px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; }
.form-logo { max-height: 40px; max-width: 120px; border-radius: 4px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; position: sticky; bottom: 0; padding: 10px 0; background: var(--bg); }
.form-actions button.primary { border: 1px solid var(--accent-fill); background: var(--accent-fill); color: white; border-radius: 8px; padding: 8px 18px; }
.forms-page .field select { min-height: 38px; }
.forms-page textarea, .forms-page select, .forms-page input[type="number"] { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.forms-page textarea:focus, .forms-page select:focus, .forms-page input[type="number"]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.forms-page input[type="number"] { width: 7rem; }

/* The form editor (forms.gleam view_designer): a dialog of its own. */
.modal-backdrop.form-designer-backdrop { z-index: 20; }
.modal.form-designer { max-width: 1200px; width: 100%; height: calc(100vh - 32px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.designer-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.designer-name { flex: 1; min-width: 0; font: inherit; font-size: 18px; font-weight: 600; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; }
.designer-name:hover, .designer-name:focus { border-color: var(--line); background: var(--bg); outline: none; }
.designer-status { font-size: 13px; white-space: nowrap; }
.designer-head button.primary { border: 1px solid var(--accent-fill); background: var(--accent-fill); color: white; border-radius: 8px; padding: 7px 16px; }
.designer-head button.primary:disabled { opacity: 0.5; }
.designer-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 14px 0; }
.designer-confirm button.primary { border: 1px solid var(--accent-fill); background: var(--accent-fill); color: white; border-radius: 8px; padding: 5px 14px; }
.form-designer > .error { margin: 10px 14px 0; }
.designer-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.designer-tab { border: 0; background: none; color: var(--muted); padding: 10px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; font: inherit; cursor: pointer; }
.designer-tab.current { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.designer-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.designer-body { flex: 1; min-height: 0; overflow: auto; padding: 16px; }
.designer-build { display: grid; grid-template-columns: 190px minmax(0, 1fr) 300px; gap: 16px; height: 100%; min-height: 0; }
.designer-build > * { min-height: 0; overflow: auto; }
.designer-build h3 { margin: 0 0 6px; font-size: 14px; }
.designer-palette ul { list-style: none; margin: 8px 0 0; padding: 0; }
.palette-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 14px; color: inherit; padding: 8px 10px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: grab; }
.palette-item:hover { border-color: var(--accent); }
.palette-icon { width: 20px; text-align: center; color: var(--muted); }
.designer-canvas { background: var(--bg); border-radius: 12px; padding: 18px; }
.canvas-card { max-width: 560px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-top: 6px solid var(--form-accent); border-radius: 12px; padding: 18px; }
/* As on the form's page (FormPageController): up to 200 × 80. */
.canvas-logo { display: block; max-width: 200px; max-height: 80px; margin: 0 0 14px; }
.canvas-heading { font-size: 22px; margin: 0 0 6px; overflow-wrap: anywhere; }
.canvas-intro { color: var(--muted); margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.canvas-fields { margin: 0 0 12px; }
.canvas-field { position: relative; padding: 10px 12px 10px 30px; margin: 0 0 6px; border: 1px dashed transparent; border-radius: 8px; cursor: grab; }
.form-designer .designer-columns .canvas-field { padding-left: 12px; cursor: default; }
.canvas-field:hover { border-color: var(--line); }
.canvas-field.selected { border: 1px solid var(--form-accent); background: color-mix(in srgb, var(--form-accent) 6%, transparent); }
.canvas-field:focus-visible { outline: 2px solid var(--form-accent); outline-offset: 2px; }
.canvas-field.being-dragged { opacity: 0.4; }
.drag-handle { position: absolute; left: 9px; top: 11px; color: var(--muted); }
.canvas-label { font-weight: 600; margin: 0 0 4px; overflow-wrap: anywhere; }
.canvas-req { color: var(--danger, #c0262d); }
.canvas-help { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.canvas-input { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 36px; color: var(--muted); font-size: 14px; background: var(--bg); }
.canvas-input.tall { min-height: 76px; }
.canvas-input.select::after { content: "▾"; float: right; }
.canvas-option { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; }
.canvas-radio, .canvas-box { width: 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; }
.canvas-box { border-radius: 3px; }
.drop-line { height: 3px; background: var(--form-accent); border-radius: 2px; margin: 2px 0 6px; }
.canvas-end { border: 2px dashed var(--line); border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.canvas-end.active { border-color: var(--form-accent); color: var(--text); }
.canvas-button { background: var(--form-accent); color: white; border: 0; border-radius: 8px; padding: 9px 18px; font: inherit; font-weight: 600; opacity: 1; }
.canvas-badge { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.designer-inspector .form-field { border: 0; padding: 0; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.inspector-actions .danger-text { color: var(--danger, #c0262d); }
.designer-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.key-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.key-chip { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 8%, transparent); color: inherit; border-radius: 6px; padding: 3px 8px; cursor: pointer; }
.key-chip:hover { border-color: var(--accent); }
.designer-share { max-width: 640px; }
@media (max-width: 900px) {
  .designer-build { grid-template-columns: 1fr; height: auto; }
  .designer-columns { grid-template-columns: 1fr; }
  .modal.form-designer { height: calc(100vh - 16px); }
}
.canvas-button:disabled { opacity: 1; cursor: default; }

/* The form editor on a phone (or a narrow window): the form alone, the
   question types and a question's settings in sheets from the bottom. */
.form-designer .phone-only { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h3 { margin: 0 0 6px; }
@media (max-width: 900px) {
  .form-designer .phone-only { display: revert; }
  .form-designer .wide-only { display: none; }
  .modal-backdrop.form-designer-backdrop { padding: 0; }
  .modal.form-designer { max-width: none; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
  .designer-head { padding: 8px 10px; gap: 8px; }
  .designer-name { font-size: 16px; }
  .designer-status { font-size: 12px; white-space: normal; max-width: 5.5em; text-align: right; line-height: 1.2; }
  .designer-tabs { overflow-x: auto; padding: 0 6px; scrollbar-width: none; }
  .designer-tab { padding: 10px 12px; white-space: nowrap; }
  .designer-body { padding: 10px; }
  .designer-build { display: block; height: auto; }
  .designer-build > * { overflow: visible; }
  .designer-canvas { padding: 8px; border-radius: 10px; }
  .canvas-card { padding: 14px; }
  .canvas-field { padding-left: 12px; cursor: pointer; }
  .drag-handle { display: none; }
  .canvas-end { display: none; }
  .add-question { position: sticky; bottom: 0; display: block; width: 100%; margin-top: 10px; padding: 12px; border: 0; border-radius: 10px; background: var(--accent-fill); color: white; font: inherit; font-weight: 600; box-shadow: 0 4px 14px rgb(0 0 0 / 0.2); }
  .sheet-scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.35); z-index: 30; }
  .designer-palette, .designer-inspector { display: none; }
  .designer-palette.open, .designer-inspector.open { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 82vh; max-height: 82dvh; overflow: auto; background: var(--card); border-radius: 16px 16px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgb(0 0 0 / 0.25); }
  .designer-palette ul { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .palette-item { margin: 0; padding: 12px 10px; cursor: pointer; }
  .designer-inspector .sheet-head button.primary { border: 0; border-radius: 8px; padding: 6px 16px; background: var(--accent-fill); color: white; }
  .inspector-actions button { padding: 8px 12px; }
  .designer-columns { gap: 14px; }
}
/* Settings › Forms: Make a form, lined up with the name and the list. */
.forms-page .inline-form { gap: 8px 10px; margin: 10px 0 12px; }
.forms-page .inline-form .field { margin: 0; }
.forms-page .inline-form input, .forms-page .inline-form select, .forms-page .inline-form button { box-sizing: border-box; height: 38px; }
.forms-page .inline-form .field.grow { flex: 1 1 14rem; }
/* Form editor › Item › Where it goes: an item, and rules by answer. */
.form-designer .where { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.form-designer .where-default { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.form-designer .where-default select { flex: 1 1 12rem; }
.form-designer .rules { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.form-designer .rule { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 5%, transparent); font-size: 14px; }
.form-designer .rule select { flex: 1 1 8rem; min-width: 0; min-height: 34px; }
.form-designer .rule-word { color: var(--muted); white-space: nowrap; }
.form-designer .rule-problem { flex-basis: 100%; font-size: 13px; margin: 0; }
.form-designer .rules-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
/* Form editor › Look: the preview works (nothing is sent). */
.designer-canvas .canvas-live { display: block; width: 100%; font: inherit; font-size: 15px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.designer-canvas textarea.canvas-live { resize: vertical; }
.designer-canvas .canvas-live:focus-visible { outline: 2px solid var(--form-accent); outline-offset: 1px; }
.designer-canvas .canvas-option input { accent-color: var(--form-accent); width: 16px; height: 16px; margin: 0; }
.designer-canvas label.canvas-option { cursor: pointer; }
.designer-canvas .canvas-button:not(:disabled) { cursor: pointer; }
.canvas-thanks .canvas-thanks-text { font-size: 18px; margin: 4px 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.canvas-thanks .canvas-note { font-size: 13px; color: var(--muted); margin: 0; }
.form-designer .canvas-thanks .canvas-thanks-text { color: var(--text); }
