/* Shared workspace surfaces. Chat, tasks, memories and routines use the same action color. */
:root {
  --bg: #fffefa;
  --surface: #ffffff;
  --text: #232520;
  --muted: #65645e;
  --border: #dfdfd5;
  --accent: #a93d20;
  --on-accent: #fff;
  --accent-soft: #f9e6dc;
  --loop: #9a4917;
  --loop-soft: #fbeddc;
  --ok: #366247;
  --on-ok: #fff;
  --well: #f5f4ed;
  --rail-start: #f3dfd1;
  --rail-mid: #eae8db;
  --rail-end: #dbe7de;
  --rail-selected: #fffaf3;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #242622;
    --surface: #2c2e29;
    --text: #f1efe9;
    --muted: #b7b7ad;
    --border: #46483f;
    --accent: #ff9676;
    --on-accent: #29170f;
    --accent-soft: #493027;
    --loop: #ffab75;
    --loop-soft: #413325;
    --ok: #9ac6a4;
    --on-ok: #16271c;
    --well: #292b26;
    --rail-start: #3f322d;
    --rail-mid: #33362d;
    --rail-end: #293932;
    --rail-selected: #48483e;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-all; background: var(--accent-soft); padding: 8px 10px; border-radius: 8px; }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -0.01em; }
nav { display: flex; gap: 4px; flex: 1; }
nav button, .segmented button { background: none; border: 0; padding: 6px 10px; border-radius: 8px; color: var(--muted); font: inherit; cursor: pointer; }
nav button.active, .segmented button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
#admin-link { padding: 6px 10px; color: var(--accent); text-decoration: none; border-radius: 8px; }
#admin-link:hover { background: var(--accent-soft); }
.upload { cursor: pointer; color: var(--accent); font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.privacy-policy { padding-block: 32px 56px; line-height: 1.6; }
.privacy-policy a { color: var(--accent); }
.privacy-policy .doc-head p { color: var(--muted); }
.privacy-policy .toc { display: block; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.privacy-policy h3 { margin-top: 20px; }
.privacy-policy .table-wrap { overflow-x: auto; }
.privacy-policy :is(th, td) { padding: 8px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--border); }
h2 { font-size: 17px; margin: 28px 0 6px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 140px; }
.mention-field { flex: 1 1 180px; position: relative; min-width: 0; }
.mention-field input { width: 100%; }
.mention-menu { position: absolute; inset: calc(100% + 4px) 0 auto; z-index: 3; max-height: 14rem; overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 18px #0002; }
.mention-menu [role=option] { display: block; width: 100%; text-align: start; border: 0; border-radius: 6px; overflow-wrap: anywhere; }
.mention-menu [role=option] span { display: block; }
.mention-menu [aria-selected=true], .mention-menu [role=option]:hover { background: var(--accent-soft); }
.mention-status:not(:empty) { padding: 6px 8px; color: var(--muted); }
#note-mentions { flex-basis: 100%; margin: 0; }
#note-mentions:empty { display: none; }
.note-mention-link { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; }
input[type=text], input[type=email], input[type=search], input:not([type]), input[type=password] { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
form > button, .primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.group-label { margin: 18px 0 6px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.item { display: flex; gap: 12px; padding: 10px; border-radius: var(--radius); cursor: pointer; align-items: flex-start; }
.item:hover { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--accent-soft); flex: none; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.item .body { min-width: 0; flex: 1; }
.item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.item .row-select { display: none; flex: none; width: 18px; height: 18px; margin-top: 17px; accent-color: var(--accent); }
#inbox-list.selecting .row-select { display: block; }
#inbox-list.selecting .row-delete { display: none; }
.item.selected { background: var(--accent-soft); }
.item .row-delete { flex: none; align-self: center; padding: 6px 10px; font-size: 13px; opacity: 0; }
.item:hover .row-delete, .item:focus-within .row-delete { opacity: 1; }
@media (hover: none) { .item .row-delete { opacity: 1; } }
.danger, .item .row-delete:hover { color: var(--loop); border-color: var(--loop); }
#inbox-select-bar { align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.item .agent-question { margin-top: 6px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.chip.loop { background: var(--loop-soft); color: var(--loop); }
.chip.done { background: transparent; color: var(--ok); border: 1px solid currentColor; }
.chip.warn { background: transparent; color: var(--loop); border: 1px solid currentColor; }
.chip.priority.p0 { background: transparent; color: #b91c1c; border: 1px solid currentColor; font-weight: 600; }
.chip.priority.p1 { background: var(--loop-soft); color: var(--loop); }
.chip.priority.p3 { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chips label { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.card label { font-size: 14px; }
.card.issue { border-color: var(--loop); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.headline { font-size: 18px; font-weight: 600; margin: 8px 0 4px; }
.segmented { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; }
dialog {
  --dialog-inset: clamp(10px, 3vmin, 26px);
  --dialog-padding: clamp(18px, 4vw, 32px);
  --dialog-gap: clamp(14px, 2vw, 20px);
  --dialog-width: 760px;
  width: min(var(--dialog-width), calc(100% - 2 * var(--dialog-inset)));
  max-width: none;
  max-height: calc(100vh - 2 * var(--dialog-inset));
  max-height: calc(100dvh - 2 * var(--dialog-inset));
  min-width: 0;
  margin: auto;
  padding: var(--dialog-padding);
  border: 1px solid var(--border);
  border-radius: clamp(16px, 3vw, 24px);
  background: var(--surface);
  color: var(--text);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: var(--dialog-padding);
  overflow-wrap: anywhere;
}
dialog::backdrop { background: rgb(0 0 0 / 0.35); }
dialog :is(input, textarea, select, img, video, audio) { max-width: 100%; }
dialog :is(.actions, .row) { gap: 10px; }
dialog :is(.actions, .row) > button { flex-shrink: 0; }
dialog :is(.actions, .row) :is(h2, h3) { min-width: 0; }
#detail-body { display: flex; flex-direction: column; gap: var(--dialog-gap); }
#detail-body > :is(p, .card, .row) { margin-block: 0; }
#detail-body > .row:first-child { align-items: center; }
#detail-body > .row:first-child h3 { flex: 1; margin: 0; }
#detail-body p:empty:not([role]) { display: none; }
#detail-body :is([role="status"], [role="alert"]):empty { position: absolute; }
#detail-body img.original { max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); align-self: flex-start; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.history { font-size: 13px; color: var(--muted); border-left: 2px solid var(--border); padding-left: 10px; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.agent { display: flex; flex-direction: column; gap: 6px; }
.agent header { display: flex; justify-content: space-between; align-items: baseline; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; } }
.consent h3 { margin: 0; }
.consent p { margin: 0; }
.login-phone { align-items: center; text-align: center; }
.login-phone p { margin: 0; }
.qr { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.user-code { font: 600 24px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.connect details summary, #token-section > summary { cursor: pointer; }

.inbox-filters { flex-wrap: wrap; align-items: center; }
.inbox-filters select, #task-assignee { max-width: min(100%, 24rem); padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.inbox-filters label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.inbox-filters input[type=checkbox] { flex: none; min-width: 0; margin: 0; }

/* Month tiles show events and due tasks; the agenda exposes their full source context. */
.inbox-view-switch { display: flex; gap: 4px; }
.inbox-view-switch [aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.calendar-heading { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.calendar-heading h2 { flex: 1; margin: 0; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; text-align: center; }
.calendar-day { min-width: 0; min-height: 144px; padding: 3px; border: 1px solid var(--border); background: var(--surface); }
.calendar-day.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-grid button { min-width: 0; width: 100%; border: 0; border-radius: 3px; }
.calendar-day-number { display: block; text-align: right; padding: 5px; margin-bottom: 4px; }
.calendar-day-number[aria-current="date"] { color: var(--accent); font-weight: 800; }
.calendar-tile-entry { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: left; font-size: 11px; line-height: 15px; padding: 3px 4px; margin-bottom: 3px; height: 36px; overflow: hidden; overflow-wrap: anywhere; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); border-left: 2px solid var(--accent) !important; }
.calendar-tile-entry.due { color: var(--text); background: color-mix(in srgb, orange 12%, var(--surface)); border-left-color: #c77800 !important; }
.calendar-overflow { padding: 2px; font-size: 10px; text-align: left; }
@media (max-width: 520px) {
  .calendar-day { padding: 1px; }
  .calendar-tile-entry { font-size: 10px; padding: 2px; }
}
.calendar-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin: 18px 0 4px; }
.calendar-condition { font-weight: 600; }
.calendar-entry .item { margin-top: 4px; }

/* Tasks: a board and a list over the same cards. The board needs more room than the reading column. */
main:has(#view-tasks:not([hidden])) { max-width: 1180px; }
.task-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.task-toolbar h2 { margin: 0 6px 0 0; font-size: 22px; letter-spacing: -0.01em; }
.task-toolbar #task-search { flex: 1; min-width: 160px; }
.task-toolbar select, .task-fields select, .task-fields input, .task-panel input, .task-panel textarea, #task-editor input, #task-editor textarea, #task-editor select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.task-toolbar select { max-width: 16rem; }
.task-attention { width: max-content; max-width: 100%; margin: 10px 0 14px; }
.task-chat-link { padding: 2px 6px; background: transparent; border: 0; color: var(--text); }
#task-project-picker { width: min(440px, 92vw); }
#task-project-picker input, #task-project-picker [data-project-options] { width: 100%; margin: 6px 0; }
#task-project-picker [data-project-options] { max-height: 45vh; overflow: auto; }
#task-error:empty { display: none; }
#task-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--loop-soft); color: var(--loop); }
.task-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.task-column, .task-group { min-width: 0; padding: 10px; border-radius: 14px; background: var(--well); border: 1px solid transparent; transition: border-color .12s, background .12s; }
.task-column { min-height: 220px; }
.task-column header, .task-group header, .memory-tasks header { display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; }
.task-column h3, .task-group h3, .memory-tasks h4 { margin: 0; font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.task-column[data-column="in_progress"] h3::before, .task-group[data-column="in_progress"] h3::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); }
.task-column[data-column="done"] h3::before, .task-group[data-column="done"] h3::before { content: "✓ "; color: var(--ok); }
.task-count { font-size: 12px; font-weight: 600; color: var(--muted); padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); font-variant-numeric: tabular-nums; }
.task-column.drop-target, .task-group.drop-target { border-color: var(--accent); background: var(--accent-soft); }
.task-cards { display: flex; flex-direction: column; gap: 8px; }
.task-rows { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.task-empty { margin: 0; padding: 22px 12px; text-align: center; font-size: 13px; color: var(--muted); border: 1px dashed var(--border); border-radius: 10px; }
.task-card { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgb(0 0 0 / .04); cursor: pointer; transition: box-shadow .12s, transform .12s, border-color .12s, opacity .12s; }
.task-card:hover { box-shadow: 0 3px 10px rgb(0 0 0 / .08); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.task-card:focus-visible, .task-check:focus-visible, .task-source:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: .45; transform: rotate(1.5deg) scale(.98); }
.task-card.needs-you { border-color: var(--loop); box-shadow: inset 3px 0 0 var(--loop); }
.task-card.is-done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.task-card.is-done { box-shadow: none; }
.task-check { flex: none; width: 20px; height: 20px; margin-top: 1px; padding: 0; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent); background: transparent; display: grid; place-items: center; font-size: 12px; line-height: 1; color: transparent; transition: background .12s, border-color .12s, color .12s; }
.task-check::after { content: "✓"; }
.task-check:not(:disabled):hover { border-color: var(--ok); color: var(--ok); }
.task-check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.task-check:disabled { opacity: .5; cursor: default; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.task-details { margin-top: 2px; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.task-question { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--loop-soft); font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.task-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.chip.due { background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text); }
.chip.due.soon { background: var(--loop-soft); color: var(--loop); }
.chip.due.overdue { background: transparent; color: #b91c1c; border: 1px solid currentColor; font-weight: 600; }
.chip.agent { background: var(--accent-soft); color: var(--accent); }
.chip.person::before { content: "@"; opacity: .6; }
.chip.file { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.chip.tasks { background: var(--loop-soft); color: var(--loop); }
.chip.source { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font: inherit; font-size: 12px; cursor: pointer; }
button.chip.source:hover { background: var(--accent-soft); }
/* The same choice as dragging, for touch screens and keyboards: quiet until the card has attention. */
.task-move { flex: none; max-width: 7.5rem; padding: 3px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; opacity: 0; transition: opacity .12s; }
.task-card:hover .task-move, .task-card:focus-within .task-move, .task-move:focus { opacity: 1; }
@media (hover: none) { .task-move { opacity: 1; } }
.task-quick-add { display: flex; gap: 6px; margin-bottom: 10px; }
.task-quick-add input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.task-quick-add input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.task-quick-add button { padding: 8px 12px; }
.task-quick-add .primary { width: 38px; padding: 0; font-size: 18px; line-height: 1; }
.task-done-filter { margin-left: auto; width: auto; min-width: 0; font-size: 13px; padding: 4px 6px; }
#task-suggestions { margin-top: 22px; max-width: 820px; }
#task-suggestions details { padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
#task-suggestions summary { cursor: pointer; font-weight: 600; }
.task-suggestion { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.task-suggestion-title { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 4px 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-suggestion button:not(.task-suggestion-title) { flex: none; padding: 5px 10px; font-size: 13px; }

/* Task details and a memory's tasks, inside the detail dialog. */
.task-panel { display: flex; flex-direction: column; gap: var(--dialog-gap); }
.task-panel form, #task-editor form { display: flex; flex-direction: column; gap: var(--dialog-gap); }
.task-panel label, #task-editor label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--muted); }
.task-panel label input, .task-panel label textarea, .task-panel label select, #task-editor label input:not([type=checkbox]), #task-editor label textarea, #task-editor label select { color: var(--text); font-size: 15px; }
.task-panel input[name="title"] { font-weight: 600; font-size: 17px; }
.task-panel textarea, #task-editor textarea { resize: vertical; min-height: 96px; }
.task-fields { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.task-fields label { flex: 1; min-width: 130px; }
.task-fields button { flex: none; }
.task-status { align-self: flex-start; }
.task-status button.active[data-task-status="done"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.task-panel-details { margin: 0; white-space: pre-wrap; }
.task-source { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); border-color: transparent; }
.task-source b { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-source .muted { grid-column: 1; }
.task-source-open { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.memory-tasks { padding: 12px; border-radius: 14px; background: var(--well); }
.memory-tasks .task-quick-add { margin: 10px 0 0; }
.memory-tasks .chip.source { display: none; }
.task-quick-add button:not(.primary) { background: var(--surface); border-color: var(--border); color: var(--text); }
.task-eyebrow { font-size: 13px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); align-self: center; }
.memory-tasks p { margin: 0 4px 8px; }
[data-memory-task-error]:empty, [data-task-error]:empty, [data-task-control-error]:empty { display: none; }
.task-more { margin-top: 6px; }
.task-more > summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.task-assign h4, .task-assign p { margin: 0; }
.task-assign .row { margin: 0; align-items: center; }
.task-assign label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-assign p:empty { display: none; }
#task-editor { --dialog-width: 680px; }
#task-editor h2 { margin: 0 0 var(--dialog-gap); }
#task-editor form > p { margin: 0; }
#task-editor .task-save-error:empty { position: absolute; }
#task-editor :is(input:not([type=checkbox]), select) { min-height: 42px; }
#task-editor fieldset { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
#task-editor fieldset label, #task-editor [data-agent-choices] label, .task-panel + .card label { flex-direction: row; align-items: center; color: var(--text); font-size: 14px; }
.task-access-new summary { cursor: pointer; color: var(--muted); font-size: 14px; }
@media (max-width: 860px) {
  .task-board { grid-template-columns: minmax(0, 1fr); }
  .task-column { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .task-card, .task-check, .task-column, .task-move { transition: none; } .task-card.dragging { transform: none; } }

/* A separate destination row for each project, with room for shared-project names. */
#account-google-calendar .calendar-route { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 1fr); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
#account-google-calendar .calendar-route span { overflow-wrap: anywhere; }
#account-google-calendar select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
#account-google-calendar details { margin: 14px 0; }
@media (max-width: 520px) { #account-google-calendar .calendar-route { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

.documents-dialog { --dialog-width: 920px; background: var(--bg); }
.documents-dialog h2 { overflow-wrap: anywhere; min-width: 0; flex: 1; }
.documents-dialog label { display: block; margin: 12px 0; }
.documents-dialog input:not([type=checkbox]), .documents-dialog textarea, .documents-dialog select { display: block; width: 100%; box-sizing: border-box; }
.documents-dialog .row:first-child { align-items: center; }
.documents-dialog .row:first-child h2 { margin: 0; font-size: 20px; }
.document-page {
  margin: 16px 0; padding: clamp(18px, 4vw, 44px); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.documents-dialog .document-page input[name=title] {
  margin: 0; padding: 0 0 14px; border: 0; border-radius: 0;
  font-size: clamp(24px, 4vw, 34px); font-weight: 650; letter-spacing: -.025em;
}
.document-format { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 0; border-block: 1px solid var(--border); }
.document-format button { min-width: 36px; min-height: 36px; padding: 5px 8px; border-color: transparent; }
.document-format button:hover, .document-format button:focus-visible { background: var(--well); }
.document-format [data-preview] { margin-left: auto; color: var(--accent); }
.documents-dialog textarea, .document-prose { font-family: inherit; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
.documents-dialog textarea { resize: vertical; min-height: 200px; padding: 15px 0; background: var(--surface); color: var(--text); border: 0; }
.document-prose { min-height: 10rem; }
.document-prose > :first-child { margin-top: 0; }
.document-prose > :last-child { margin-bottom: 0; }
.document-prose h1, .document-prose h2, .document-prose h3 { margin: 1em 0 .4em; line-height: 1.25; }
.document-prose h1 { font-size: 1.65em; }
.document-prose h2 { font-size: 1.4em; }
.document-prose h3 { font-size: 1.18em; }
.document-prose pre { background: var(--well); }
.document-prose ul, .document-prose ol { padding-left: 1.5em; }
.document-prose[data-preview-body] { padding-top: 15px; }
.documents-dialog details { margin: 14px 0; }
.documents-dialog summary { cursor: pointer; }
.document-byline { color: var(--muted); font-size: 14px; }
.document-actions { margin-top: 14px; }
.documents-dialog button:disabled { opacity: .55; cursor: default; }
@media (max-width: 520px) {
  .document-format button { min-height: 44px; }
}
@media (pointer: coarse) {
  dialog :is(button, input:not([type=checkbox], [type=radio]), select) { min-height: 44px; }
  dialog :is(input:not([type=checkbox], [type=radio]), select, textarea) { font-size: 16px; }
}
.document-row { display: block; width: 100%; text-align: left; margin: 8px 0; overflow-wrap: anywhere; }
.documents-dialog [data-error] { color: var(--danger, #b42318); }

[data-task-photo-section] { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
[data-task-photo-list] > .row { align-items: center; }
.task-photo-link { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-align: left; }
.task-photo-link span { overflow-wrap: anywhere; }
.task-photo-link img { width: 56px; height: 56px; border-radius: 7px; object-fit: cover; }
.task-photo-drop { padding: 12px; border: 1px dashed currentColor; border-radius: 7px; }
.staged-task-photo { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; margin-top: 8px; }
.staged-task-photo img { height: 72px; width: 96px; object-fit: contain; }

.task-plan-field { margin-block: 8px; }
.task-plan-field > summary { cursor: pointer; overflow-wrap: anywhere; }
.task-plan-field[open] > summary { margin-bottom: 8px; }
