/* v2 surfaces — ported 1:1 from Noa's hyperfocus_v2_surfaces_mock.html.
   Sub-tasks reuse .sub (app.css); composer reuses app.css. Tokens from tokens.css. */

/* comments thread */
.thread { display: flex; flex-direction: column; gap: var(--space-4); }
.cmt { display: flex; gap: var(--space-3); }
.cmt .cbody { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.cmt-head b { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.cmt-head .when { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
/* pre-wrap lives on .cmt-body (the user's text), NOT on .bubble: the bubble now
   holds markup (file chip templates), and pre-wrap on the container renders the
   markup's own indentation as blank lines. */
.bubble { font-size: 13px; line-height: 1.55; color: var(--text-primary); background: var(--bg-surface); border-radius: var(--radius-md); border-top-left-radius: 3px; padding: 9px var(--space-3); word-break: break-word; }
.cmt-body { white-space: pre-wrap; }
.cmt-actions { display: flex; gap: 14px; margin-top: 6px; padding-left: 2px; }
.cmt-actions a { font-size: 11px; color: var(--text-tertiary); cursor: pointer; }
.cmt-actions a:hover { color: var(--text-secondary); }
.mention { color: var(--accent); background: var(--accent-tint); border-radius: var(--radius-sm); padding: 0 4px; font-weight: 500; white-space: nowrap; }
.replies { margin-top: var(--space-3); padding-left: 34px; display: flex; flex-direction: column; gap: var(--space-3); position: relative; }
.replies::before { content: ''; position: absolute; left: 10px; top: 2px; bottom: 8px; width: 1.5px; background: var(--border-subtle); border-radius: 2px; }
.reply-add { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-left: 34px; font-size: 11.5px; color: var(--text-tertiary); cursor: pointer; }
.reply-add:hover { color: var(--text-secondary); }

/* labels */
.label-chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; line-height: 1; }
.label-chip .x { width: 13px; height: 13px; display: grid; place-items: center; border-radius: 3px; cursor: pointer; opacity: 0.55; }
.label-chip .x:hover { opacity: 1; background: rgba(0,0,0,0.25); }
.label-add { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); color: var(--text-tertiary); font-size: 11px; font-weight: 500; cursor: pointer; background: transparent; }
.label-add:hover { color: var(--text-secondary); border-color: var(--text-tertiary); }
.chip-set { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.manage-pop { position: absolute; z-index: 60; width: 280px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--elev-3); padding: var(--space-3); }
.manage-pop .mp-title { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 10px; }
.lbl-create { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
.field-input { background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-md); height: 34px; padding: 0 10px; font-family: inherit; font-size: 13px; color: var(--text-primary); width: 100%; }
.field-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.swatch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch { width: 24px; height: 24px; border-radius: var(--radius-sm); cursor: pointer; position: relative; transition: transform var(--dur-fast) var(--ease-out); }
.swatch:hover { transform: scale(1.12); }
.swatch.sel::after { content: ''; position: absolute; inset: -3px; border-radius: 6px; border: 2px solid var(--text-primary); }
.lbl-list-row { display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 6px; margin: 0 -6px; border-radius: var(--radius-md); cursor: pointer; }
.lbl-list-row:hover { background: var(--bg-surface); }
.lbl-list-row .dot6 { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lbl-list-row .lname { font-size: 12.5px; color: var(--text-primary); flex: 1; }

/* dependencies */
.dep-group + .dep-group { margin-top: var(--space-4); }
.dep-glabel { font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.dep-row { display: flex; align-items: center; gap: var(--space-3); min-height: 36px; padding: var(--space-1) var(--space-2); margin: 0 calc(-1 * var(--space-2)); border-radius: var(--radius-md); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.dep-row:hover { background: var(--bg-surface); }
.dep-row:hover .dep-unlink { opacity: 1; }
.dep-row .sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dep-row .dtext { font-size: 13px; color: var(--text-primary); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-row .dstatus { font-family: var(--font-mono); font-size: 10px; padding: 2px 7px; border-radius: var(--radius-sm); flex: none; }
.dep-row .dep-unlink { opacity: 0; color: var(--text-tertiary); transition: opacity var(--dur-fast); display: flex; background: none; border: none; cursor: pointer; }
.dep-add { display: flex; align-items: center; gap: var(--space-2); min-height: 34px; color: var(--text-tertiary); font-size: 12.5px; cursor: pointer; }
.dep-add:hover { color: var(--text-secondary); }
.sdot.done { background: var(--success); } .sdot.doing { background: var(--accent); } .sdot.todo { background: var(--text-tertiary); }
.dstatus.done { background: var(--success-tint); color: var(--success); } .dstatus.doing { background: var(--accent-tint); color: var(--accent); } .dstatus.todo { background: var(--bg-pressed); color: var(--text-tertiary); }

/* card blocked badge + label chips on card */
.blocked-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--danger-tint); color: var(--danger); }
.blocked-badge svg { width: 11px; height: 11px; }
.card .chip-set { margin-top: 2px; }

/* custom fields manage */
.type-chip { font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--bg-pressed); color: var(--text-tertiary); }
.cf-mrow { display: flex; align-items: center; gap: var(--space-3); height: 42px; padding: 0 var(--space-2); margin: 0 calc(-1 * var(--space-2)); border-radius: var(--radius-md); }
.cf-mrow:hover { background: var(--bg-surface); }
.cf-mrow .cf-name { font-size: 13px; color: var(--text-primary); flex: 1; }
.cf-mrow .cf-rm { color: var(--text-tertiary); cursor: pointer; background: none; border: none; }
.cf-addform { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 10px; }
.cf-formrow { display: flex; gap: 8px; }

/* attachments */
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md); min-height: 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-tertiary); cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast); }
.dropzone:hover, .dropzone.dz-over { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }
.dropzone.dz-over { border-style: solid; }
.dropzone svg { width: 22px; height: 22px; }
.dropzone .dz-main { font-size: 12.5px; font-weight: 500; }
.file-row { display: flex; align-items: center; gap: var(--space-3); height: 48px; padding: 0 var(--space-2); margin: 0 calc(-1 * var(--space-2)); border-radius: var(--radius-md); }
.file-row:hover { background: var(--bg-surface); }
.file-ico { width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; background: var(--accent-tint); color: var(--accent); }
.file-ico svg { width: 17px; height: 17px; }
.file-name-btn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 2px; transition: color var(--dur-fast) var(--ease-out); }
.file-name-btn:hover { color: var(--accent); }
.file-name-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-name-link { color: inherit; text-decoration: none; cursor: pointer; border-radius: 2px; transition: color var(--dur-fast) var(--ease-out); }
.file-name-link:hover { color: var(--accent); }
.file-name-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-actions { display: flex; align-items: center; gap: var(--space-1); flex: none; }
.file-act { position: relative; width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--text-tertiary); cursor: pointer; border-radius: var(--radius-sm); text-decoration: none; transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.file-act svg { width: 16px; height: 16px; }
.file-act::after { content: ''; position: absolute; inset: -10px; }   /* 44px touch target */
.file-dl { opacity: 1; }
.file-row:hover .file-dl { color: var(--text-secondary); }
.file-dl:hover { color: var(--accent); background: var(--accent-tint); }
.file-dl:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
.file-meta { flex: 1; min-width: 0; }
.file-name { font-size: 13px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }
.file-rm { opacity: 0; }
.file-row:hover .file-rm { opacity: 1; }
.file-rm:hover { color: var(--danger); background: var(--danger-tint); }
.file-rm:focus-visible { outline: 2px solid var(--danger); outline-offset: 1px; opacity: 1; }
@media (hover: none) { .file-rm { opacity: 1; color: var(--text-tertiary); } }

/* inline attachment delete confirm — row morphs in place (no overlay, no z-index layer) */
.file-confirm { display: inline-flex; align-items: center; gap: var(--space-2); flex: none; margin-left: auto; animation: fcIn var(--dur-fast) var(--ease-out); }
.fc-q { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.fc-btn { flex: none; height: 28px; padding: 0 12px; border-radius: var(--radius-sm); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; position: relative; border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); display: inline-grid; place-items: center; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.fc-btn::after { content: ''; position: absolute; inset: -8px; }   /* 44px touch target */
.fc-cancel:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }
.fc-cancel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fc-delete { background: var(--danger-tint); border-color: transparent; color: var(--danger-text); }
.fc-delete:hover { background: var(--danger); color: #fff; }
.fc-delete:focus-visible { outline: 2px solid var(--danger); outline-offset: 1px; }
.fc-delete[disabled] { opacity: 0.7; cursor: default; }
.file-row.is-deleting { opacity: 0.5; pointer-events: none; }
.fc-spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--danger); border-right-color: transparent; border-radius: 50%; animation: fcSpin 600ms linear infinite; }
@keyframes fcIn { from { opacity: 0; transform: translateX(4px); } to { opacity: 1; transform: none; } }
@keyframes fcSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .file-confirm { animation: none; } }

/* AI panel: matched tasks (search results) — clickable cards */
.ai-found { display: flex; flex-direction: column; gap: 6px; margin-top: var(--space-2); }
.ai-found-card { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px 10px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); cursor: pointer; text-align: left; font-family: inherit; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.ai-found-card:hover { border-color: var(--accent); background: var(--accent-tint); }
.ai-found-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.afc-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.35; }
.afc-meta { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.afc-board { white-space: nowrap; }
.afc-status { padding: 1px 6px; border-radius: var(--radius-full); background: var(--bg-pressed); }
.afc-status.st-done { color: var(--success, #4ade80); background: rgba(74,222,128,0.12); }

/* Image lightbox (mounted at body level; covers drawer + AI panel) */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: rgba(13,15,20,0.86); backdrop-filter: blur(2px); cursor: zoom-out; animation: lightboxIn var(--dur-normal) var(--ease-out); }
@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img { max-width: 90vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius-md); box-shadow: var(--elev-3); cursor: default; animation: lightboxImgIn 280ms var(--ease-out); }
@keyframes lightboxImgIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.lightbox-close { position: absolute; top: var(--space-6); right: var(--space-6); width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: rgba(255,255,255,0.06); color: #fff; border-radius: var(--radius-full); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-close:hover { background: rgba(255,255,255,0.14); }
.lightbox-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lightbox-caption { position: absolute; bottom: var(--space-6); left: 50%; transform: translateX(-50%); display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: rgba(13,15,20,0.72); border: 1px solid var(--border-subtle); border-radius: var(--radius-full); backdrop-filter: blur(8px); max-width: 80vw; cursor: default; }
.lightbox-cap-name { font-size: 13px; font-weight: 500; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.lightbox-cap-sep { color: rgba(255,255,255,0.55); }
.lightbox-cap-size { font-family: var(--font-mono); font-size: 10px; color: rgba(255,255,255,0.65); }
@media (max-width: 768px) {
  .lightbox { padding: var(--space-4); }
  .lightbox-img { max-height: 80vh; }
  .lightbox-close { top: var(--space-4); right: var(--space-4); }
  .lightbox-caption { bottom: var(--space-4); }
}
  .lightbox-close { top: var(--space-4); right: var(--space-4); }
  .lightbox-caption { bottom: var(--space-4); }
}

/* rule engine */
.rule-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; }
.rule-card + .rule-card { margin-top: 10px; }
.toggle { width: 34px; height: 20px; border-radius: var(--radius-full); background: var(--bg-pressed); position: relative; cursor: pointer; flex: none; margin-top: 2px; transition: background var(--dur-normal) var(--ease-out); }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-secondary); transition: transform var(--dur-normal) var(--ease-out), background var(--dur-normal); }
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(14px); background: #fff; }
.rule-body { flex: 1; min-width: 0; }
.rule-summary { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.rule-summary .kw { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px; color: var(--text-tertiary); }
.rule-summary .val { color: var(--text-primary); font-weight: 500; }
.builder { background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 16px; margin-top: 14px; }
.builder-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.builder-line + .builder-line { margin-top: 12px; }
.bkw { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.5px; color: var(--text-tertiary); width: 50px; flex: none; }
.bconn { font-size: 12.5px; color: var(--text-tertiary); }

/* command palette */
.cmdk-scrim { position: fixed; inset: 0; background: var(--bg-overlay); z-index: 80; }
.palette { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); width: 640px; max-width: calc(100vw - 48px); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-lg); box-shadow: var(--elev-3); overflow: hidden; z-index: 81; animation: palpop var(--dur-normal) var(--ease-out); }
@keyframes palpop { from { transform: translateX(-50%) scale(0.97); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
.pal-search { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px; border-bottom: 1px solid var(--border-subtle); }
.pal-search > svg { width: 18px; height: 18px; color: var(--text-tertiary); flex: none; }
.pal-search input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-family: inherit; font-size: 15px; }
.pal-search input:focus { outline: none; }
.pal-results { max-height: 360px; overflow-y: auto; padding: 6px; }
.pal-group { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-tertiary); height: 28px; display: flex; align-items: center; padding: 0 12px; }
.pal-row { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: var(--radius-md); cursor: pointer; border-left: 2px solid transparent; }
.pal-row:hover, .pal-row.sel { background: var(--accent-tint); border-left-color: var(--accent); }
.pal-ico { width: 18px; height: 18px; color: var(--text-secondary); flex: none; display: grid; place-items: center; }
.pal-label { font-size: 13px; color: var(--text-primary); flex: none; }
.pal-ctx { font-size: 12px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* share / permissions */
.share-add { display: flex; gap: 8px; margin-bottom: 18px; }
.share-add .field-input { flex: 1; }
.member-row { display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 var(--space-2); margin: 0 calc(-1 * var(--space-2)); border-radius: var(--radius-md); }
.member-row .m-meta { flex: 1; min-width: 0; }
.member-row .m-name { font-size: 13px; color: var(--text-primary); }
.member-row .m-mail { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin-top: 1px; }
.access-locked { font-size: 11px; color: var(--text-secondary); padding: 0 10px; flex: none; }

/* =====================================================================
   PROJECT-ROW MENU + ADD-LIST / COLUMN-HEADER MENU  (Noa spec)
   ===================================================================== */
/* shared popover menu DNA */
.popover { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--elev-3); padding: 4px; min-width: 180px; }
.pop-fixed { position: fixed; z-index: 60; animation: popIn var(--dur-fast) var(--ease-out); }
.pop-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.pop-item:hover { background: var(--bg-surface); color: var(--text-primary); }
.pop-item svg { width: 15px; height: 15px; flex: none; color: var(--text-tertiary); }
.pop-item:hover svg { color: var(--text-secondary); }
.pop-item.danger { color: var(--danger); }
.pop-item.danger svg { color: var(--danger); opacity: 0.85; }
.pop-item.danger:hover { background: var(--danger-tint); color: var(--danger); }
.pop-item.danger:hover svg { opacity: 1; }
.pop-divider { height: 1px; background: var(--border-subtle); margin: 4px 0; }
.pop-scrim { position: fixed; inset: 0; z-index: 59; background: transparent; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* sidebar project row: ⋯ trigger + inline rename + inline archive confirm */
.nav-item .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-more { flex: none; width: 24px; height: 24px; margin-right: -4px; border: none; background: transparent; color: var(--text-tertiary); border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.nav-more svg { width: 16px; height: 16px; }
.nav-item:hover .nav-more, .nav-item.menu-open .nav-more { opacity: 1; }
.nav-item:hover .count.has-more { opacity: 0; width: 0; margin: 0; overflow: hidden; }
.nav-more:hover { background: var(--bg-pressed); color: var(--text-primary); }
.nav-item.menu-open { background: var(--bg-surface); color: var(--text-primary); }
.nav-item.menu-open .nav-more { background: var(--bg-pressed); color: var(--text-primary); }
.nav-rename { flex: 1; min-width: 0; height: 24px; background: var(--bg-input); border: 1px solid var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); border-radius: var(--radius-sm); padding: 0 6px; font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary); outline: none; }
.nav-item.renaming, .nav-item.confirming { background: var(--bg-surface); }
.nav-confirm { flex: 1; display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.nav-confirm .q { flex: 1; min-width: 0; font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbtn { flex: none; height: 24px; padding: 0 10px; border-radius: var(--radius-sm); font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.cbtn.confirm { background: var(--danger-tint); border-color: transparent; color: var(--danger); }
.cbtn.confirm:hover { background: var(--danger); color: #fff; }
.cbtn.cancel:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }

/* column-head: ⋯ trigger + inline rename + WIP count */
.col-more { flex: none; width: 24px; height: 24px; margin-left: 2px; border: none; background: transparent; color: var(--text-tertiary); border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.col-more svg { width: 16px; height: 16px; }
.column-head:hover .col-more, .column-head.menu-open .col-more { opacity: 1; }
.col-more:hover { background: var(--bg-pressed); color: var(--text-primary); }
.column-head.menu-open .col-more { background: var(--bg-pressed); color: var(--text-primary); }
.column-head .count .lim { color: var(--text-tertiary); }
.column-head .count.over { color: var(--warning); }
.col-rename { flex: 1; min-width: 0; height: 26px; background: var(--bg-input); border: 1px solid var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); border-radius: var(--radius-sm); padding: 0 7px; font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-primary); outline: none; }

/* add-list affordance */
.add-list-rest { width: 280px; flex: none; min-height: 44px; align-self: flex-start; border: 1px dashed var(--border-default); border-radius: var(--radius-lg); background: transparent; color: var(--text-tertiary); display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); font-size: 13px; cursor: pointer; transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.add-list-rest svg { width: 15px; height: 15px; }
.add-list-rest:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-tint); }
.add-list-active { width: 280px; flex: none; align-self: flex-start; background: var(--bg-base); border: 1px solid var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong), var(--elev-2); border-radius: var(--radius-lg); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-3); }
.add-list-active .nameinput { width: 100%; height: 36px; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 var(--space-3); font-family: inherit; font-size: 13px; color: var(--text-primary); outline: none; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.add-list-active .nameinput::placeholder { color: var(--text-tertiary); }
.add-list-active .nameinput:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.kind-pick { display: flex; gap: var(--space-1); }
.kind-opt { flex: 1; height: 32px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: transparent; display: flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; font-size: 11px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.kind-opt .kd { width: 6px; height: 6px; border-radius: var(--radius-full); flex: none; }
.kind-opt .kd.todo { background: var(--text-tertiary); }
.kind-opt .kd.doing { background: var(--accent); }
.kind-opt .kd.done { background: var(--success); }
.kind-opt:hover { background: var(--bg-surface); color: var(--text-primary); }
.kind-opt.sel { background: var(--accent-tint); border-color: var(--accent); color: var(--text-primary); }
.add-list-actions { display: flex; align-items: center; gap: var(--space-2); }

/* WIP-limit stepper (no native spinner) */
.wip-pop { min-width: 232px; padding: var(--space-3); }
.wip-pop .wl { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: 10px; }
.stepper { display: flex; align-items: center; gap: var(--space-2); }
.stepper .sbtn { width: 32px; height: 32px; flex: none; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--bg-input); color: var(--text-secondary); display: grid; place-items: center; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.stepper .sbtn svg { width: 14px; height: 14px; }
.stepper .sbtn:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-strong); }
.stepper .sbtn:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .sval { flex: 1; height: 32px; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 13px; color: var(--text-primary); }
.stepper .sval.off { color: var(--text-tertiary); }
.wip-pop .wnote { font-size: 11px; color: var(--text-tertiary); margin-top: 10px; line-height: 1.5; }
.wip-pop .wactions { display: flex; gap: var(--space-2); margin-top: 12px; }
.wip-pop .wactions .btn { flex: 1; justify-content: center; }

/* =====================================================================
   CUSTOM DROPDOWN / SELECT  (Noa spec — replaces native <select>)
   ===================================================================== */
.dd { position: relative; display: inline-flex; max-width: 100%; }
.dd.full { display: flex; width: 100%; }
.dd-trigger { display: inline-flex; align-items: center; gap: var(--space-2); height: 28px; padding: 0 8px; border-radius: var(--radius-md); background: transparent; border: 1px solid transparent; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text-primary); max-width: 100%; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.dd-trigger:hover { background: var(--bg-surface); border-color: var(--border-subtle); }
.dd-trigger:focus-visible { outline: none; background: var(--bg-surface); box-shadow: 0 0 0 2px var(--accent); }
.dd-trigger .chev { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; margin-left: 2px; transition: transform var(--dur-fast) var(--ease-out); }
.dd.open > .dd-trigger { background: var(--bg-elevated); border-color: var(--border-strong); }
.dd.open > .dd-trigger .chev { transform: rotate(180deg); }
.dd-trigger.boxed { height: 34px; width: 100%; justify-content: space-between; background: var(--bg-input); border-color: var(--border-default); padding: 0 var(--space-3); }
.dd-trigger.boxed:hover { background: var(--bg-input); border-color: var(--border-strong); }
.dd-trigger.boxed .chev { margin-left: 0; }
.dd-trigger .tlabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-trigger .val-empty { color: var(--text-tertiary); }

/* the shared floating menu (fixed-positioned by JS so it never clips) */
.dd-menu { position: fixed; z-index: 62; min-width: 200px; max-width: 320px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); box-shadow: var(--elev-3); padding: 4px; transform-origin: top left; animation: popIn var(--dur-fast) var(--ease-out); }
.dd-search { display: flex; align-items: center; gap: var(--space-2); height: 32px; margin: 2px; padding: 0 var(--space-2); background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-sm); }
.dd-search svg { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.dd-search input { flex: 1; background: transparent; border: none; outline: none; font-family: inherit; font-size: 12.5px; color: var(--text-primary); }
.dd-search input::placeholder { color: var(--text-tertiary); }
.dd-scroll { max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.dd-scroll::-webkit-scrollbar { width: 8px; }
.dd-scroll::-webkit-scrollbar-thumb { background: var(--bg-pressed); border-radius: 4px; border: 2px solid var(--bg-elevated); }
.opt { display: flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); font-size: 13px; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); position: relative; }
.opt:hover, .opt.cursor { background: var(--bg-surface); color: var(--text-primary); }
.opt.cursor::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--accent); }
.opt.selected { color: var(--text-primary); }
.opt .opt-check { margin-left: auto; width: 15px; height: 15px; color: var(--accent); flex-shrink: 0; opacity: 0; }
.opt.selected .opt-check { opacity: 1; }
.opt .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.opt .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-noresult { padding: 14px var(--space-2); text-align: center; font-size: 12px; color: var(--text-tertiary); }
/* option leading pill/tag reuse app's pri/cat colors via .pri-*/.cat-* on these */
.opt .opt-pill { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 500; }
.opt .opt-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; padding: 2px 7px; border-radius: var(--radius-sm); }
.dd-scrim { position: fixed; inset: 0; z-index: 61; background: transparent; }

/* =====================================================================
   QUICK TIMER  ·  global top-bar widget + card start/pause  (Noa spec)
   ===================================================================== */
.tw { display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 6px 0 10px; border-radius: var(--radius-full); background: var(--success-tint); border: 1px solid transparent; cursor: pointer; max-width: 248px; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.tw:hover { background: rgba(46,190,126,0.18); }
.tw.open { background: rgba(46,190,126,0.18); border-color: rgba(46,190,126,0.30); }
.tw .pulse { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--timer-running); box-shadow: 0 0 0 0 rgba(46,190,126,0.5); animation: pulse 1600ms var(--ease-out) infinite; flex: none; }
.tw .tw-time { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--timer-running); flex: none; letter-spacing: 0.2px; }
.tw .tw-sep { width: 1px; height: 14px; background: rgba(46,190,126,0.28); flex: none; }
.tw .tw-title { font-size: 12px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tw .tw-pause { width: 26px; height: 26px; flex: none; border: none; background: transparent; color: var(--timer-running); border-radius: var(--radius-full); display: grid; place-items: center; cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.tw .tw-pause:hover { background: rgba(46,190,126,0.22); }
.tw .tw-pause svg { width: 13px; height: 13px; }
.tw.warn { background: var(--warning-tint); }
.tw.warn .pulse { background: var(--timer-warn); box-shadow: 0 0 0 0 rgba(240,180,41,0.5); }
.tw.warn .tw-time, .tw.warn .tw-pause { color: var(--timer-warn); }
.tw.warn .tw-sep { background: rgba(240,180,41,0.28); }
.tw.over { background: var(--danger-tint); }
.tw.over .pulse { background: var(--timer-over); box-shadow: 0 0 0 0 rgba(224,85,107,0.5); }
.tw.over .tw-time, .tw.over .tw-pause { color: var(--timer-over); }
.tw.over .tw-sep { background: rgba(224,85,107,0.28); }
/* pull-down popover (reuses .popover + .pop-fixed) */
.tw-pop { min-width: 300px; padding: var(--space-3); }
.tw-pop .tp-kicker { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--timer-running); margin-bottom: 10px; }
.tw-pop .tp-kicker .pulse { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--timer-running); box-shadow: 0 0 0 0 rgba(46,190,126,0.5); animation: pulse 1600ms var(--ease-out) infinite; }
.tw-pop .tp-title { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.4; margin-bottom: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tw-pop .tp-crumb { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-tertiary); margin-bottom: 14px; }
.tw-pop .tp-crumb .cdot { width: 6px; height: 6px; border-radius: var(--radius-full); flex: none; }
.tw-pop .tp-time { font-family: var(--font-mono); font-size: 30px; font-weight: 500; letter-spacing: -0.5px; color: var(--timer-running); line-height: 1; margin-bottom: 4px; }
.tw-pop.warn .tp-time, .tw-pop.warn .tp-kicker { color: var(--timer-warn); }
.tw-pop.over .tp-time, .tw-pop.over .tp-kicker { color: var(--timer-over); }
.tp-budget { height: 6px; border-radius: 3px; background: var(--bg-pressed); overflow: hidden; margin-bottom: 6px; }
.tp-budget > i { display: block; height: 100%; border-radius: 3px; background: var(--timer-running); }
.tp-budget > i.warn { background: var(--timer-warn); }
.tp-budget > i.over { background: var(--timer-over); }
.tp-budget-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); margin: 0 0 14px; }
.tp-actions { display: flex; gap: var(--space-2); }
.tp-btn { flex: 1; height: 36px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: transparent; color: var(--text-primary); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.tp-btn svg { width: 14px; height: 14px; }
.tp-btn.pause { background: var(--success-tint); border-color: transparent; color: var(--timer-running); }
.tp-btn.pause:hover { background: rgba(46,190,126,0.20); }
.tp-open { display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; margin-top: 10px; border-radius: var(--radius-md); color: var(--text-tertiary); font-size: 11px; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.tp-open:hover { background: var(--bg-surface); color: var(--text-secondary); }
.tp-open svg { width: 13px; height: 13px; }

/* card quick start/pause button — lives in .card-head > .card-actions, always visible */
.qt {
  width: 20px; height: 20px; flex: none; padding: 0; position: relative;
  border-radius: var(--radius-full); border: 1px solid var(--border-default);
  background: transparent; color: var(--text-secondary);
  display: grid; place-items: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
/* 34x34 pointer target without changing the 26px visual box (no layout impact) */
.qt::before { content: ''; position: absolute; inset: -6px -4px; border-radius: inherit; }
.qt svg { width: 10px; height: 10px; }
.qt:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-tint); }
.qt:active { background: var(--accent-tint-strong); }
.qt:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.qt:disabled { opacity: .4; cursor: default; }
.card.running .qt { background: var(--success-tint); border-color: transparent; color: var(--timer-running); }
.card.running .qt:hover { background: rgba(46,190,126,0.20); }

/* card done chip — top-right, always visible, replaces the old .card-check circle */
.done-chip {
  display: inline-flex; align-items: center; gap: 3px;
  height: 20px; padding: 0 8px 0 6px; flex: none; position: relative;
  border-radius: var(--radius-full); border: 1px solid var(--border-default);
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
  line-height: 1; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.done-chip::before { content: ''; position: absolute; inset: -6px -4px; border-radius: inherit; }
.done-chip svg { width: 10px; height: 10px; flex: none; }
.done-chip:hover { border-color: var(--success); color: var(--success); background: var(--success-tint); }
.done-chip:active { background: rgba(46,190,126,0.20); }
.done-chip:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.done-chip.is-done { background: var(--success-tint); border-color: transparent; color: var(--success-text); }
.done-chip.is-done:hover { background: rgba(46,190,126,0.20); border-color: transparent; }

/* inline card expansion — checklist / subtask preview (click the count chip) */
.metachip.ce-toggle { cursor: pointer; }
.metachip.ce-toggle:hover { color: var(--text-secondary); }
.ce-chev { width: 11px; height: 11px; margin-left: 1px; transition: transform var(--dur-fast) var(--ease-out); }
.ce-chev.open { transform: rotate(180deg); }
.card-expand { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 2px; }
.ce-group-label { font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-tertiary); margin: 4px 0 2px; }
.ce-row { display: flex; align-items: center; gap: 8px; padding: 4px; margin: 0 -4px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; color: var(--text-secondary); transition: background var(--dur-fast) var(--ease-out); }
.ce-row:hover { background: var(--bg-elevated); }
.ce-box { width: 15px; height: 15px; flex: none; border: 1.5px solid var(--border-strong); border-radius: 4px; display: grid; place-items: center; color: transparent; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.ce-row.done .ce-box { background: var(--accent); border-color: var(--accent); color: #fff; }
.ce-box svg { width: 11px; height: 11px; }
.ce-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ce-row.done .ce-text { text-decoration: line-through; color: var(--text-tertiary); }
.ce-row .ce-arrow { margin-left: auto; width: 13px; height: 13px; color: var(--text-tertiary); flex: none; }

/* =====================================================================
   INVITE A TEAMMATE  (Noa spec) — modal (owner) + accept screen (invitee)
   ===================================================================== */
/* role picker — 2-option segmented */
.role-seg { display: flex; gap: 6px; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 4px; }
.role-opt { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; height: 44px; justify-content: center; padding: 0 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); }
.role-opt:hover { background: var(--bg-surface); }
.role-opt .ro-name { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.role-opt .ro-desc { font-size: 10px; color: var(--text-tertiary); }
.role-opt.sel { background: var(--accent-tint); }
.role-opt.sel .ro-name { color: var(--accent); }
.role-opt.sel .ro-desc { color: var(--accent); opacity: 0.8; }
/* created state */
.invite-created-banner { display: flex; align-items: center; gap: var(--space-2); background: var(--success-tint); border: 1px solid rgba(46,190,126,0.28); border-radius: var(--radius-md); padding: 9px var(--space-3); font-size: 12px; color: var(--success); margin-bottom: var(--space-4); }
.invite-created-banner svg { width: 15px; height: 15px; flex-shrink: 0; }
.link-field { position: relative; display: flex; align-items: center; }
.link-field input { width: 100%; height: 40px; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0 84px 0 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); text-overflow: ellipsis; }
.link-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.copy-btn { position: absolute; right: 5px; height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--accent); font-family: inherit; font-size: 12px; font-weight: 500; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.copy-btn::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--border-subtle); }
.copy-btn:hover { background: var(--accent-tint); }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.copied { color: var(--success); }
.copy-btn.copied:hover { background: var(--success-tint); }
.expiry-hint { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-tertiary); margin-top: 8px; }
.expiry-hint svg { width: 13px; height: 13px; flex-shrink: 0; }
.role-recap { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-secondary); }
.role-recap .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.created-actions { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-6); }
.created-actions .spacer { flex: 1; }
/* pending invites */
.pending-section { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }
.pending-label { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-tertiary); margin-bottom: var(--space-2); display: flex; align-items: center; gap: 8px; }
.pending-label .cnt { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); letter-spacing: 0; }
.member-row:hover .revoke { opacity: 1; }
.member-row .m-name { display: flex; align-items: center; gap: 7px; }
.role-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-tertiary); background: var(--bg-pressed); padding: 1px 6px; border-radius: var(--radius-sm); }
.m-status { font-size: 11px; color: var(--text-tertiary); flex-shrink: 0; display: flex; align-items: center; gap: 5px; }
.m-status.copied { color: var(--success); }
.m-status svg { width: 12px; height: 12px; }
.revoke { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); flex-shrink: 0; }
.revoke:hover { color: var(--danger); background: var(--danger-tint); }
.revoke svg { width: 15px; height: 15px; }
.pending-empty { padding: 20px 8px; text-align: center; font-size: 12px; color: var(--text-tertiary); }
.av.pending { background: var(--bg-pressed); color: var(--text-tertiary); }
/* accept-invite screen */
.invite-kicker { text-align: center; margin-bottom: var(--space-6); }
.invite-kicker .kick { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.invite-kicker .org { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: var(--text-primary); }
.invite-kicker .org-line { display: inline-flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 6px; }
.invite-kicker .as { font-size: 12px; color: var(--text-tertiary); margin-bottom: var(--space-4); }
.invite-kicker .as b { color: var(--text-secondary); font-weight: 600; }
.invited-email { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: var(--radius-full); background: var(--bg-input); border: 1px solid var(--border-subtle); font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.invited-email svg { width: 14px; height: 14px; color: var(--text-tertiary); flex-shrink: 0; }
.org-mark { width: 28px; height: 28px; border-radius: var(--radius-md); background: var(--accent-tint); border: 1px solid var(--accent-tint-strong); display: inline-flex; align-items: center; justify-content: center; }
.org-mark svg { width: 16px; height: 16px; }
.invite-error { text-align: center; }
.invite-error .err-tile { width: 52px; height: 52px; border-radius: var(--radius-lg); background: var(--danger-tint); border: 1px solid rgba(224,85,107,0.28); display: inline-flex; align-items: center; justify-content: center; color: var(--danger); margin-bottom: var(--space-4); }
.invite-error .err-tile svg { width: 24px; height: 24px; }
.invite-error h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; color: var(--text-primary); margin-bottom: 6px; }
.invite-error p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; margin-bottom: var(--space-6); }
.invite-error .btn { width: 100%; }

/* ============================================================
   Static card  (Noa spec 2026-08-10)
   The card NEVER changes geometry. No hover gutter, no reveal.
   Done + timer live in .card-head > .card-actions (top-right).
   Selection is still Shift+click on the card.
   HARD RULE: nothing in a .card:hover / .card.done / .card.running
   rule may touch padding, margin, width, height, gap or transform.
   ============================================================ */
.card { transition: background var(--dur-fast) var(--ease-out),
                    box-shadow var(--dur-fast) var(--ease-out),
                    border-color var(--dur-fast) var(--ease-out); }
.card.done .title { text-decoration: line-through; color: var(--text-secondary); }

/* ---- member modal: danger zone (admin remove) ---- */
.member-danger { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.member-danger-row { display: flex; align-items: center; gap: var(--space-4); }
.member-danger .md-text { flex: 1; min-width: 0; }
.member-danger .md-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.member-danger .md-note { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; line-height: 1.4; }
.member-danger .btn-danger { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.member-danger .btn-danger svg { width: 14px; height: 14px; }

/* ============================================================
   Automation rules builder — Asana-style When / If / Then
   ============================================================ */
.rule-wrap { display: flex; flex-direction: column; gap: var(--space-3); }
.rule-recipes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-2); }
.rule-recipe { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); background: var(--bg-input);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-full); padding: 5px 11px; cursor: pointer;
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast); }
.rule-recipe:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.rule-section { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); background: var(--bg-surface); }
.rule-section + .rule-section { margin-top: var(--space-3); }
.rule-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; margin-bottom: var(--space-3); }
.rule-kicker .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.rk-when { color: var(--accent); } .rk-when .dot { background: var(--accent); }
.rk-if   { color: var(--cat-ops, #3DA6E0); } .rk-if .dot { background: var(--cat-ops, #3DA6E0); }
.rk-then { color: var(--success); } .rk-then .dot { background: var(--success); }
.rule-grid { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px 10px; }
.rule-grid > label { font-size: 12px; color: var(--text-secondary); margin: 0; }
.rule-grid .dd, .rule-grid .field-input { width: 100%; }
.rule-hint { font-size: 11px; color: var(--text-tertiary); margin-top: var(--space-2); line-height: 1.45; }
.rule-check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-primary); cursor: pointer; user-select: none; }
.rule-check input { width: 15px; height: 15px; accent-color: var(--success); cursor: pointer; }
.rule-summary .kw { font-size: 9.5px; font-weight: 700; letter-spacing: .4px; color: var(--text-tertiary); }
.rule-summary .val { color: var(--text-secondary); font-weight: 500; }
.rule-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); margin-bottom: 8px; }
.rule-card .rule-body { flex: 1; min-width: 0; }
.rule-card .rule-summary { font-size: 11.5px; line-height: 1.5; }

/* ---- card: clickable assignee avatar + empty "assign" circle ---- */
.av.pick { cursor: pointer; transition: box-shadow .12s var(--ease-out), transform .12s var(--ease-out); }
.av.pick:hover { box-shadow: 0 0 0 2px var(--accent); transform: translateY(-1px); }
.av.assign-empty {
  background: transparent; border: 1.5px dashed var(--border-strong);
  color: var(--text-tertiary); cursor: pointer; padding: 0;
  transition: border-color .12s var(--ease-out), color .12s var(--ease-out), background .12s var(--ease-out);
}
.av.assign-empty:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.av.assign-empty svg { width: 13px; height: 13px; }

/* ---- Restart (reset) timer button — quieter than Start/Stop ---- */
.timer-btn.ghost { color: var(--text-tertiary); border-color: var(--border-subtle); }
.timer-btn.ghost:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-tint); }

/* ---- note hover preview (card comment/note icon) ---- */
.notes-chip { cursor: default; }
.note-tip {
  position: fixed; z-index: 1400; min-width: 160px;
  background: var(--bg-elevated, #1b1b22); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); box-shadow: var(--elev-3, 0 12px 32px rgba(0,0,0,.5));
  padding: 8px 10px; display: flex; flex-direction: column; gap: 8px;
  max-height: 280px; overflow-y: auto;
}
.note-tip-row { display: flex; flex-direction: column; gap: 2px; }
.note-tip-row + .note-tip-row { border-top: 1px solid var(--border-subtle); padding-top: 8px; }
.note-tip-text { font-size: 12px; line-height: 1.5; color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.note-tip-meta { font-size: 10px; color: var(--text-tertiary); text-transform: capitalize; }

/* ============================================================ per-task Repeat
   Drawer-header "Repeat" trigger + recurrence popover (Noa spec 2026-06-08).
   Reuses the shipped .popover / .pop-fixed DNA + iris tokens. */
.repeat-trigger {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid var(--border-default);
  color: var(--text-secondary); font-family: var(--font-sans);
  font-size: 12px; font-weight: 500; cursor: pointer; white-space: nowrap; flex: none;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.repeat-trigger:not(.active) { min-width: 44px; justify-content: center; }
.repeat-trigger:hover { background: var(--bg-elevated); border-color: var(--border-strong); color: var(--text-primary); }
.repeat-trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.repeat-trigger:active { background: var(--bg-pressed); }
.repeat-trigger.active { background: var(--accent-tint); border-color: var(--accent-tint-strong); color: var(--accent); }
.repeat-trigger.active:hover { background: var(--accent-tint-strong); border-color: var(--accent); }
.repeat-trigger .repeat-icon { flex: none; display: block; }
.repeat-trigger .repeat-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

.repeat-pop { width: 256px; padding: var(--space-3); }
.rp-segments {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; width: 100%;
  height: 32px; padding: 2px; background: var(--bg-input);
  border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  box-sizing: border-box; margin-bottom: var(--space-3);
}
.rp-seg {
  display: inline-flex; align-items: center; justify-content: center; height: 28px;
  background: transparent; border: none; border-radius: 3px; cursor: pointer;
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 500;
  color: var(--text-secondary); white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.rp-seg:not(.is-active):hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.rp-seg:not(.is-active):active { background: var(--bg-pressed); }
.rp-seg.is-active { background: var(--accent); color: #fff; font-weight: 600; cursor: default; }
.rp-seg:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-tint-strong); position: relative; z-index: 1; }

.rp-panel { margin-bottom: var(--space-3); animation: rpPanelIn 160ms var(--ease-out); }
@keyframes rpPanelIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .rp-panel { animation: none; } }
.rp-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-secondary); display: block; margin-bottom: var(--space-1); }

.rp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: 100%; }
.rp-day {
  display: inline-flex; align-items: center; justify-content: center; height: 32px;
  background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  cursor: pointer; font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.rp-day:hover { background: rgba(255,255,255,0.04); border-color: var(--border-strong); color: var(--text-primary); }
.rp-day:active { background: var(--bg-pressed); }
.rp-day.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.rp-day:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent-tint-strong); }

.rp-select {
  width: 100%; height: 36px; appearance: none; -webkit-appearance: none;
  background-color: var(--bg-input);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23646A77' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  border: 1px solid var(--border-default); border-radius: var(--radius-md);
  padding: 0 32px 0 12px; font-family: var(--font-sans); font-size: 13px; font-weight: 450;
  color: var(--text-primary); cursor: pointer; color-scheme: dark;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.rp-select:hover { border-color: var(--border-strong); }
.rp-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }

.rp-preview {
  padding: 8px 12px; background: var(--accent-tint); border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; color: var(--text-primary);
  line-height: 1.4; margin-bottom: var(--space-3);
}
.rp-footer { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); }
.rp-footer .spacer { flex: 1; }

/* board card recurrence chip — quiet secondary signal */
.card-foot .recur-chip { color: var(--text-tertiary); }

/* @mention autocomplete in the comment composer (opens above the input) */
.composer { position: relative; }
.mention-pop {
  position: absolute; left: 14px; bottom: calc(100% + 6px); z-index: 70;
  min-width: 220px; max-width: 300px; max-height: 240px; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); box-shadow: var(--elev-3); padding: 4px;
}
.mention-row {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text-secondary);
}
.mention-row:hover, .mention-row.active { background: var(--bg-surface); color: var(--text-primary); }
.mention-row .mention-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- light theme: component overrides (white-alpha hovers + native select) ---- */
[data-theme="light"] .rp-seg:not(.is-active):hover { background: rgba(30,34,50,0.06); }
[data-theme="light"] .rp-day:hover { background: rgba(30,34,50,0.06); }
[data-theme="light"] .rp-select {
  color-scheme: light;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234A4F5E' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

/* ============================================================ notification toast
   Noa spec 2026-06-08 — live in-app notification (mention/assigned/due…). Top-right
   stack, distinct from the bottom-centre status .toast. Token-only → themes itself. */
.notif-stack {
  position: fixed; top: 68px; right: 16px; z-index: 62;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: 360px; max-width: calc(100vw - 32px);
}
.notif-toast {
  pointer-events: all; background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--elev-3); padding: 12px 12px 12px 14px;
  display: grid; grid-template-columns: 28px 1fr 20px; grid-template-rows: auto auto; column-gap: 10px;
  cursor: pointer; animation: notif-enter 220ms var(--ease-out) forwards;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.notif-toast:hover { background: var(--bg-pressed); transform: translateY(-1px); }
.notif-toast.leaving { animation: notif-leave 200ms var(--ease-in) forwards; pointer-events: none; overflow: hidden; }
.nt-icon { grid-column: 1; grid-row: 1 / 3; width: 28px; height: 28px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; }
.nt-icon svg { width: 15px; height: 15px; }
.nt-msg { grid-column: 2; grid-row: 1; font-size: var(--fs-body); font-weight: 500; color: var(--text-primary); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nt-sub { grid-column: 2; grid-row: 2; font-size: var(--fs-small); color: var(--text-secondary); margin-top: 2px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.nt-sub .task-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.nt-sub .ts { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-tertiary); flex: none; }
.nt-dismiss { grid-column: 3; grid-row: 1; align-self: center; width: 20px; height: 20px; border-radius: var(--radius-sm); background: transparent; border: none; color: var(--text-tertiary); cursor: pointer; display: grid; place-items: center; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.nt-dismiss:hover { background: var(--bg-pressed); color: var(--text-primary); }
.nt-dismiss svg { width: 12px; height: 12px; }
.notif-more { pointer-events: all; height: 28px; padding: 0 12px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-full); font-size: var(--fs-small); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; align-self: flex-end; font-family: var(--font-sans); }
@keyframes notif-enter { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes notif-leave { from { opacity: 1; transform: translateX(0); max-height: 120px; } to { opacity: 0; transform: translateX(16px); max-height: 0; margin-bottom: -8px; padding-top: 0; padding-bottom: 0; } }

/* per-kind icon chips — shared by inbox .ntype and toast .nt-icon (v2 loads after auth.css so this wins) */
.ntype.mentioned, .nt-icon.mentioned { background: var(--accent-tint); color: var(--accent); }
.ntype.assigned, .nt-icon.assigned { background: var(--bg-pressed); color: var(--text-secondary); }
.ntype.due, .nt-icon.due { background: var(--warning-tint); color: var(--warning); }
.ntype.budget_breach, .nt-icon.budget_breach { background: var(--danger-tint); color: var(--danger); }
.ntype.rule, .nt-icon.rule { background: var(--bg-pressed); color: var(--text-secondary); }

/* bell badge one-shot pulse when the unread count rises */
@keyframes badge-pulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0   var(--badge-ring); }
  40%  { transform: scale(1.25); box-shadow: 0 0 0 6px transparent; }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0   transparent; }
}
.badge.pulse { animation: badge-pulse 400ms var(--ease-out) forwards; }

/* inbox row: archive (soft-clear) button — appears on row hover */
.nrow-archive {
  flex: none; width: 26px; height: 26px; border: none; background: transparent;
  color: var(--text-tertiary); border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer; opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.nrow:hover .nrow-archive { opacity: 1; }
.nrow-archive:hover { background: var(--bg-pressed); color: var(--text-primary); }
.nrow-archive svg { width: 14px; height: 14px; }

/* ============================================================ sub-task row timer (Noa spec 2026-06-08)
   Reuses the card quick-timer DNA; hidden at rest, present when running or has time. */
.sub .stext { flex: 1; min-width: 0; }
.sub-timer-val { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); display: none; align-items: center; gap: 4px; flex: none; line-height: 1; white-space: nowrap; }
.sub.sub-has-time .sub-timer-val, .sub.sub-running .sub-timer-val { display: inline-flex; }
.sub.sub-running .sub-timer-val { color: var(--timer-running); }
.sub.sub-running-warn .sub-timer-val { color: var(--timer-warn); }
.sub.sub-running-over .sub-timer-val { color: var(--timer-over); }
.sub.sub-over .sub-timer-val { color: var(--timer-over); }
.sub-timer-val .pulse { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--timer-running); animation: pulse 1600ms var(--ease-out) infinite; flex: none; }
.sub.sub-running-warn .sub-timer-val .pulse { background: var(--timer-warn); }
.sub.sub-running-over .sub-timer-val .pulse { background: var(--timer-over); }
.sub-qt { width: 26px; height: 26px; flex: none; border-radius: var(--radius-full); border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); display: grid; place-items: center; cursor: pointer; opacity: 0; margin-left: var(--space-2); transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.sub-qt svg { width: 12px; height: 12px; }
.sub:hover .sub-qt { opacity: 1; }
.sub.sub-running .sub-qt { opacity: 1; background: var(--success-tint); border-color: transparent; color: var(--timer-running); }
.sub.sub-running-warn .sub-qt { opacity: 1; background: var(--warning-tint); border-color: transparent; color: var(--timer-warn); }
.sub.sub-running-over .sub-qt { opacity: 1; background: var(--danger-tint); border-color: transparent; color: var(--timer-over); }
.sub-qt:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-tint); }
.sub.done .sub-qt, .sub.done .sub-timer-val { opacity: 0.35; pointer-events: none; }

/* ============================================================ Journal: master + sub-task time tree (Noa spec 2026-06-08) */
.rchev { width: 12px; height: 12px; flex: none; color: var(--text-tertiary); transition: transform var(--dur-fast) var(--ease-out); margin-right: 4px; }
.rstrow.open .rchev { transform: rotate(90deg); }
.rstrow.expandable { cursor: pointer; }
.rstrow.expandable:hover td { background: var(--bg-surface); }
.rtotal-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.rtotal-combined { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.2; }
.rtotal-own { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); line-height: 1.2; }
.rsub-row td { height: 36px; }
.rsub-row:hover td { background: var(--bg-surface); }
.entity-sub { padding-left: 28px !important; }
.sub-edot { width: 4px; height: 4px; border-radius: 50%; flex: none; margin-right: 6px; }
.ename-sub { font-size: 12px; font-weight: 450; color: var(--text-secondary); }
.rsub-row.done .ename-sub { color: var(--text-tertiary); text-decoration: line-through; }
.rsub-row { animation: rsub-enter 160ms var(--ease-out) forwards; }
@keyframes rsub-enter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rsub-row { animation: none; } }

/* ============================================================ card-expand sub-task timer + clickable checkbox (board inline) */
.ce-row .ce-text { flex: 1; min-width: 0; }
.ce-row .ce-box { cursor: pointer; }
.ce-timer-val { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); display: none; align-items: center; gap: 4px; flex: none; line-height: 1; white-space: nowrap; }
.ce-row.ce-has-time .ce-timer-val, .ce-row.ce-running .ce-timer-val { display: inline-flex; }
.ce-row.ce-running .ce-timer-val { color: var(--timer-running); }
.ce-row.ce-over .ce-timer-val { color: var(--timer-over); }
.ce-timer-val .pulse { width: 5px; height: 5px; border-radius: var(--radius-full); background: var(--timer-running); animation: pulse 1600ms var(--ease-out) infinite; flex: none; }
.ce-row.ce-over .ce-timer-val .pulse { background: var(--timer-over); }
.ce-qt { width: 24px; height: 24px; flex: none; border-radius: var(--radius-full); border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); display: grid; place-items: center; cursor: pointer; opacity: 0; margin-left: 4px; transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.ce-qt svg { width: 11px; height: 11px; }
.ce-row:hover .ce-qt { opacity: 1; }
.ce-row.ce-running .ce-qt { opacity: 1; background: var(--success-tint); border-color: transparent; color: var(--timer-running); }
.ce-row.ce-over .ce-qt { opacity: 1; background: var(--danger-tint); border-color: transparent; color: var(--timer-over); }
.ce-qt:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-tint); }

/* ============================ My Tasks (per-user cross-board feed) ========= */
.mytasks { width: 100%; overflow-y: auto; }
.mytasks .view-inner { max-width: 880px; margin: 0 auto; padding: 32px 24px 80px; }
.mytasks .view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }

.mt-empty { text-align: center; padding: 80px 20px; color: var(--text-tertiary); }
.mt-empty-glyph {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent); font-size: 26px; font-weight: 700;
}
.mt-empty-title { font-size: 16px; font-weight: 650; color: var(--text-secondary); margin-bottom: 4px; }
.mt-empty-sub { font-size: 13px; max-width: 360px; margin: 0 auto; line-height: 1.5; }

.mt-group { margin-top: 26px; }
.mt-group-head { display: flex; align-items: center; gap: 8px; padding: 0 4px 8px; }
.mt-group-dot { width: 7px; height: 7px; border-radius: var(--radius-full); background: var(--text-tertiary); flex: none; }
.mt-group-overdue  .mt-group-dot { background: var(--danger); }
.mt-group-today    .mt-group-dot { background: var(--accent); }
.mt-group-upcoming .mt-group-dot { background: var(--cat-growth); }
.mt-group-label { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-secondary); }
.mt-group-overdue .mt-group-label { color: var(--danger); }
.mt-group-count { font-size: 11px; font-weight: 600; color: var(--text-tertiary); background: var(--bg-surface); border-radius: var(--radius-full); padding: 1px 7px; }

.mt-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 7px 12px; cursor: pointer;
  border-radius: var(--radius-md);
  border: 1px solid transparent; background: var(--bg-elevated);
  margin-bottom: 6px;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.mt-row:hover { border-color: var(--border-default); transform: translateX(2px); }

.mt-check {
  width: 20px; height: 20px; flex: none; border-radius: var(--radius-full);
  border: 1.6px solid var(--border-default); background: transparent;
  color: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.mt-check svg { width: 12px; height: 12px; }
.mt-check:hover { border-color: var(--cat-growth); color: var(--cat-growth); background: var(--success-tint, rgba(52,199,123,0.14)); }

.mt-title { font-size: 13.5px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-subs { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 11px; color: var(--text-tertiary); }
.mt-subs svg { width: 13px; height: 13px; }
.mt-spacer { flex: 1; }

.mt-board {
  flex: none; font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 2px 8px; max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-cat {
  flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; letter-spacing: 0.2px; white-space: nowrap;
}
.mt-pri { flex: none; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--text-tertiary); }
.mt-pri.pri-high { background: var(--cat-bug); }
.mt-pri.pri-med  { background: var(--cat-creative); }
.mt-pri.pri-low  { background: var(--text-tertiary); }

.mt-due { flex: none; font-size: 11.5px; font-weight: 600; color: var(--text-tertiary); min-width: 48px; text-align: right; }
.mt-due-overdue { color: var(--danger); }
.mt-due-today { color: var(--accent); }

.mt-timer {
  flex: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-subtle);
  background: transparent; color: var(--text-tertiary); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.mt-timer svg { width: 12px; height: 12px; }
.mt-timer:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-tint); }
.mt-timer-val { font-family: var(--font-mono); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mt-timer.running { border-color: transparent; background: var(--success-tint, rgba(52,199,123,0.14)); color: var(--timer-running); }
.mt-timer.warn { border-color: transparent; background: var(--warn-tint, rgba(224,136,61,0.16)); color: var(--timer-warn); }
.mt-timer.over { border-color: transparent; background: var(--danger-tint); color: var(--timer-over); }

@media (max-width: 640px) {
  .mt-board, .mt-subs { display: none; }
  .mytasks .view-inner { padding: 20px 14px 64px; }
}

/* ============================ Account menu (avatar dropdown) =============== */
.tb-user { user-select: none; }
.tb-user.open { background: var(--bg-elevated); }
.tb-user.open .uname { color: var(--text-primary); }
.tb-user:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.um-caret {
  width: 12px; height: 12px; color: var(--text-tertiary); flex: none;
  transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.tb-user:hover .um-caret, .tb-user.open .um-caret { color: var(--text-secondary); }
.tb-user.open .um-caret { transform: rotate(180deg); }

.user-menu {
  position: fixed; z-index: 50; min-width: 224px;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--elev-3);
  padding: var(--space-2) 0; outline: none;
  transform-origin: top right;
  /* CSS-only entrance — replays each time x-show flips display none->block.
     Deliberately NOT using Alpine x-transition: it was clobbering x-show's
     display toggle and leaving the menu stuck open. */
  animation: um-pop 130ms var(--ease-out);
}
@keyframes um-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.um-account { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4) var(--space-2); }
.um-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.um-name { font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-email { font-size: var(--fs-micro); color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-divider { height: 1px; background: var(--border-subtle); margin: var(--space-2) 0; }

.um-item {
  width: 100%; display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4); height: 38px;
  background: transparent; border: none; color: var(--text-secondary);
  font-size: var(--fs-body); font-weight: 450; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.um-item svg { width: 16px; height: 16px; flex: none; color: var(--text-tertiary); transition: color var(--dur-fast) var(--ease-out); }
.um-item:hover { background: var(--bg-pressed); color: var(--text-primary); }
.um-item:hover svg { color: var(--text-secondary); }
.um-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.um-item span:first-of-type { flex: 1; }
.um-mode-badge {
  font-size: var(--fs-micro); font-weight: 600; color: var(--text-tertiary);
  background: var(--bg-pressed); border: 1px solid var(--border-subtle);
  padding: 2px 8px; border-radius: var(--radius-full); flex: none;
}
.um-kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); flex: none; }
.um-item.um-danger { color: var(--danger); }
.um-item.um-danger svg { color: var(--danger); opacity: 0.7; }
.um-item.um-danger:hover { background: var(--danger-tint); color: var(--danger); }
.um-item.um-danger:hover svg { opacity: 1; }

[data-theme="light"] .user-menu { background: #FFFFFF; }
[data-theme="light"] .um-item:hover { background: var(--bg-base); }
[data-theme="light"] .um-mode-badge { background: var(--bg-elevated); }

/* ============================ DM drawer (1-on-1 teammate chat) ============= */
.dm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw;
  background: var(--bg-base); border-left: 1px solid var(--border-default);
  box-shadow: var(--elev-drawer); z-index: 56;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--dur-normal) var(--ease-out);
}
.dm-drawer.open { transform: translateX(0); }
.dm-shell { display: flex; flex-direction: column; height: 100%; }

.dm-header {
  flex: none; height: 56px; display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4); border-bottom: 1px solid var(--border-subtle);
}
.dm-hdr-meta { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.dm-hdr-name { font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-hdr-sub { font-size: var(--fs-micro); color: var(--text-tertiary); }
.dm-close { margin-left: auto; }

.dm-list { flex: 1; overflow-y: auto; padding: var(--space-4) var(--space-4) var(--space-3); display: flex; flex-direction: column; gap: 4px; }
.dm-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px var(--space-6); gap: var(--space-3); }
.dm-empty-icon { width: 48px; height: 48px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); }
.dm-empty-icon svg { width: 22px; height: 22px; }
.dm-empty-title { font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); line-height: 1.4; max-width: 240px; margin: 0; }
.dm-empty-sub { font-size: var(--fs-micro); color: var(--text-tertiary); margin: 0; }

.dm-date-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0 var(--space-2); }
.dm-date-divider::before, .dm-date-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }
.dm-date-divider span { font-size: var(--fs-micro); color: var(--text-tertiary); white-space: nowrap; font-weight: 500; }

.dm-bubble-row { display: flex; align-items: flex-end; gap: var(--space-2); margin-bottom: 2px; }
.dm-bubble-row.own { flex-direction: row-reverse; }
.dm-bubble {
  max-width: 74%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); border-bottom-left-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 3px;
}
.dm-bubble.own { background: var(--accent-tint); border-color: var(--accent-tint-strong); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-sm); }
.dm-body { font-size: var(--fs-body); color: var(--text-primary); line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.dm-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); align-self: flex-end; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.dm-bubble:hover .dm-time { opacity: 1; }

.dm-composer { display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--border-subtle); flex: none; }
.dm-input {
  flex: 1; min-height: 38px; max-height: 120px;
  background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
  padding: 9px 12px; font-family: var(--font-sans); font-size: var(--fs-body); font-weight: 450;
  color: var(--text-primary); resize: none; overflow-y: auto; line-height: 1.45;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.dm-input::placeholder { color: var(--text-tertiary); }
.dm-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.dm-send {
  width: 38px; height: 38px; flex: none; background: var(--accent); border: none; border-radius: var(--radius-md);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.dm-send svg { width: 16px; height: 16px; }
.dm-send:hover:not(:disabled) { background: var(--accent-hover); }
.dm-send:disabled { opacity: 0.35; cursor: not-allowed; }

/* sidebar team-member row */
.team-member-row { position: relative; }
.team-member-row.dm-active { background: var(--accent-tint); color: var(--text-primary); }
.tmr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmr-unread {
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: auto;
  background: var(--accent); border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.tmr-chat-hint { width: 15px; height: 15px; color: var(--text-tertiary); flex: none; margin-left: auto; }

@media (max-width: 640px) {
  .dm-drawer { width: 100%; border-left: none; }
}

/* ============================ Project sidebar tree ======================== */
.proj-list { display: flex; flex-direction: column; }
.proj-group { display: flex; flex-direction: column; }
/* project row is the drag handle */
.proj-row { cursor: grab; }
.proj-row:active { cursor: grabbing; }
.proj-row.renaming, .proj-row.confirming { cursor: default; }
/* chevron (multi-board only), rotates open */
.proj-chevron { flex: none; width: 16px; height: 16px; margin-right: 2px; margin-left: -2px; color: var(--text-tertiary); transition: transform var(--dur-fast) var(--ease-out); }
.proj-chevron.open { transform: rotate(90deg); }
.proj-row:hover .proj-chevron { color: var(--text-secondary); }
/* board-count pill on a multi-board project */
.proj-board-count { flex: none; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text-tertiary); background: var(--bg-pressed); border-radius: 9px; }
.proj-row:hover .proj-board-count { color: var(--text-secondary); }
.proj-row:hover .proj-board-count, .proj-row.menu-open .proj-board-count { opacity: 0; width: 0; min-width: 0; padding: 0; margin: 0; overflow: hidden; }
/* nested board rows under an expanded project */
.board-rows { display: flex; flex-direction: column; margin: 2px 0 4px 11px; padding-left: 9px; border-left: 1px solid var(--border-subtle); animation: boardRowsIn var(--dur-base, 160ms) var(--ease-out); }
.board-row { font-size: 13px; }
.board-row .pname { font-weight: 450; }
.board-add { display: flex; align-items: center; height: 28px; margin-top: 1px; padding: 0 8px; border: none; background: transparent; color: var(--text-tertiary); font-family: inherit; font-size: 12.5px; font-weight: 500; text-align: left; border-radius: var(--radius-sm); cursor: pointer; transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.board-add:hover { color: var(--accent); background: var(--accent-tint); }
@keyframes boardRowsIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* drag-reorder: project group is the draggable unit */
.proj-group.proj-ghost { opacity: 0.35; background: var(--accent-tint); border-radius: var(--radius-md); }
.proj-group.proj-ghost > * { visibility: hidden; }
/* the clone that follows the cursor (forceFallback) */
.proj-drag-ghost {
  opacity: 0.97 !important; cursor: grabbing !important;
  background: var(--bg-elevated) !important;
  box-shadow: 0 10px 26px rgba(0,0,0,0.5) !important;
  border: 1px solid var(--accent) !important; border-radius: var(--radius-md) !important;
  z-index: 9999 !important; pointer-events: none !important; transition: none !important;
}
[data-theme="light"] .proj-drag-ghost { box-shadow: 0 10px 26px rgba(60,65,85,0.22) !important; background: #fff !important; }

/* modal hint line under the project-name input */
.modal-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-tertiary); }

/* ============================ AI Assistant ================================ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* entry icon */
.ai-entry.active { background: var(--accent-tint); color: var(--accent); }
.ai-entry.active:hover { background: var(--accent-tint-strong); }
@keyframes ai-pulse-center { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.ai-entry:not(.active) .ai-entry-pulse { animation: ai-pulse-center 2800ms ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.ai-entry.active .ai-entry-pulse { animation: none; }

/* panel - always in DOM, slides via .open (no x-show on the slider) */
.ai-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 100vw;
  background: var(--bg-canvas); border-left: 3px solid var(--accent);
  box-shadow: var(--elev-drawer); z-index: 57;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform var(--dur-normal) var(--ease-out);
}
.ai-panel.open { transform: translateX(0); }

.ai-header { flex: none; height: 56px; display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--border-subtle); background: var(--bg-base); }
.ai-mark { width: 32px; height: 32px; flex: none; background: var(--accent-tint-strong); border-radius: var(--radius-md); display: grid; place-items: center; color: var(--accent); }
.ai-mark svg { width: 17px; height: 17px; }
.ai-hdr-meta { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.ai-hdr-name { font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); }
.ai-hdr-sub { font-size: var(--fs-micro); color: var(--text-tertiary); }
.ai-board-chip { display: flex; align-items: center; gap: 6px; padding: 3px var(--space-2); border-radius: var(--radius-full); background: var(--bg-elevated); border: 1px solid var(--border-default); font-size: var(--fs-micro); font-weight: 500; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.ai-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.ai-close { margin-left: var(--space-1); }

.ai-stream { flex: 1; overflow-y: auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); scroll-behavior: smooth; }
/* Messages sit at the BOTTOM, against the composer, the way every chat does.
   Without this the stream stretches to the panel height and a short
   conversation leaves a void beneath it — 1004px measured on a 1740px-tall
   window. An empty first flex item absorbing the slack is used instead of
   justify-content:flex-end, which clips the top of an overflowing column
   in several engines. When content overflows, the auto margin collapses to
   0 and scrolling behaves normally. */
.ai-stream::before { content: ''; margin-top: auto; }
.ai-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px var(--space-6); gap: var(--space-2); }
.ai-empty-mark { color: var(--accent); margin-bottom: var(--space-2); }
.ai-empty-mark svg { width: 30px; height: 30px; }
.ai-empty-title { font-size: var(--fs-lg); font-weight: 600; color: var(--text-primary); margin: 0; }
.ai-empty-sub { font-size: var(--fs-small); color: var(--text-tertiary); margin: 0; }
.ai-chips { display: flex; flex-direction: column; gap: var(--space-2); width: 100%; max-width: 300px; margin-top: var(--space-3); }
.ai-chip-btn { padding: 9px var(--space-4); border-radius: var(--radius-full); background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-secondary); font-size: var(--fs-small); font-weight: 500; text-align: left; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.ai-chip-btn:hover { background: var(--bg-pressed); color: var(--text-primary); border-color: var(--border-strong); }
.ai-chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ai-bubble-row { display: flex; align-items: flex-end; gap: var(--space-2); animation: ai-bubble-in 200ms var(--ease-out) both; }
.ai-bubble-row.user { flex-direction: row-reverse; }
@keyframes ai-bubble-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ai-avatar { width: 24px; height: 24px; flex: none; background: var(--accent-tint-strong); border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--accent); align-self: flex-end; }
.ai-avatar svg { width: 13px; height: 13px; }
.ai-bubble { max-width: 86%; padding: 8px 12px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); border-top-left-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 5px; }
.ai-bubble.user { max-width: 80%; background: var(--accent-tint); border-color: var(--accent-tint-strong); border-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-sm); border-top-left-radius: var(--radius-lg); }
.ai-bubble.error { background: var(--danger-tint); border-color: var(--danger); }
.ai-body { font-size: var(--fs-body); color: var(--text-primary); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.ai-body strong { font-weight: 600; }
.ai-msg-img { max-width: 200px; max-height: 200px; border-radius: var(--radius-md); object-fit: cover; }
.ai-time { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); align-self: flex-end; }
.ai-bubble:hover .ai-time { opacity: 1; }

.ai-typing { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.ai-typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-tertiary); display: inline-block; animation: ai-dot-bounce 1.2s ease-in-out infinite; }
.ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-dot-bounce { 0%,80%,100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }

/* task-plan preview card */
.ai-task-plan { margin-top: var(--space-2); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); }
.ai-plan-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border-subtle); }
.ai-plan-title { font-size: var(--fs-small); font-weight: 600; color: var(--text-primary); }
.ai-plan-count { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-secondary); }
.ai-plan-list { display: flex; flex-direction: column; }
.ai-plan-rowwrap { border-bottom: 1px solid var(--border-subtle); }
.ai-plan-rowwrap:last-child { border-bottom: none; }
.ai-plan-row { display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-3); min-height: 38px; transition: background var(--dur-fast) var(--ease-out); }
.ai-plan-row:hover { background: var(--bg-elevated); }
.ai-plan-remove { position: relative; width: 20px; height: 20px; flex: none; background: transparent; border: none; color: var(--text-tertiary); cursor: pointer; display: grid; place-items: center; border-radius: var(--radius-sm); opacity: 0.55; transition: opacity var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.ai-plan-remove svg { width: 15px; height: 15px; }
.ai-plan-remove.sm svg { width: 13px; height: 13px; }
.ai-plan-row:hover .ai-plan-remove, .ai-plan-sub-row:hover .ai-plan-remove, .ai-move-row:hover .ai-plan-remove { opacity: 1; }
.ai-plan-remove:hover { color: var(--danger); }
.ai-plan-name { flex: 1; min-width: 0; font-size: var(--fs-body); color: var(--text-primary); font-weight: 450; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 3px 6px; outline: none; }
.ai-plan-name:hover { border-color: var(--border-subtle); }
.ai-plan-name:focus { background: var(--bg-base); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.ai-plan-meta { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.ai-plan-board { font-size: var(--fs-micro); color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-sm); padding: 2px var(--space-2); cursor: pointer; max-width: 104px; }
.ai-plan-board:focus { outline: 2px solid var(--accent); }
.ai-plan-subs { padding: 0 var(--space-3) 6px 34px; display: flex; flex-direction: column; gap: 2px; }
.ai-plan-sub-row { display: flex; align-items: center; gap: var(--space-2); min-height: 28px; }
.ai-plan-sub-name { flex: 1; min-width: 0; font-size: var(--fs-small); color: var(--text-secondary); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 6px; outline: none; }
.ai-plan-sub-name:hover { border-color: var(--border-subtle); }
.ai-plan-sub-name:focus { background: var(--bg-base); border-color: var(--accent); }
.ai-plan-footer { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-subtle); }
.ai-plan-cancel { padding: 7px var(--space-3); border-radius: var(--radius-md); border: none; background: transparent; color: var(--text-secondary); font-size: var(--fs-small); cursor: pointer; transition: color var(--dur-fast) var(--ease-out); }
.ai-plan-cancel:hover { color: var(--text-primary); }
.ai-plan-confirm { padding: 7px var(--space-4); border-radius: var(--radius-md); border: none; background: var(--accent); color: #fff; font-size: var(--fs-small); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: var(--space-2); transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.ai-plan-confirm:hover:not(:disabled) { background: var(--accent-hover); }
.ai-plan-confirm:disabled { opacity: 0.45; cursor: not-allowed; }
.ai-plan-spinner { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: ai-spin 600ms linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-plan-success { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); color: var(--success); font-size: var(--fs-small); }
.ai-plan-success svg { width: 16px; height: 16px; flex: none; }
.ai-plan-link { margin-left: auto; color: var(--accent); font-weight: 600; text-decoration: none; cursor: pointer; }
.ai-plan-link:hover { text-decoration: underline; }

/* attachment + composer */
.ai-attachment-row { flex: none; padding: var(--space-2) var(--space-4) 0; }
.ai-attachment-chip { display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-2) 0 var(--space-1); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); max-width: 240px; }
.ai-att-thumb { width: 32px; height: 32px; border-radius: var(--radius-sm); object-fit: cover; flex: none; }
.ai-att-name { font-size: var(--fs-micro); color: var(--text-secondary); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-att-remove { width: 20px; height: 20px; flex: none; background: transparent; border: none; color: var(--text-tertiary); cursor: pointer; display: grid; place-items: center; border-radius: var(--radius-sm); transition: color var(--dur-fast) var(--ease-out); }
.ai-att-remove svg { width: 13px; height: 13px; }
.ai-att-remove:hover { color: var(--danger); }
.ai-composer { flex: none; display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--border-subtle); }
.ai-attach { flex: none; }
.ai-attach:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-textarea { flex: 1; min-height: 40px; max-height: 160px; background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 10px 12px; font-family: var(--font-sans); font-size: var(--fs-body); font-weight: 450; color: var(--text-primary); resize: none; overflow-y: auto; line-height: 1.5; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.ai-textarea::placeholder { color: var(--text-tertiary); }
.ai-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.ai-textarea:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-send { width: 38px; height: 38px; flex: none; background: var(--accent); border: none; border-radius: var(--radius-md); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.ai-send svg { width: 18px; height: 18px; }
.ai-send:hover:not(:disabled) { background: var(--accent-hover); }
.ai-send:active:not(:disabled) { background: var(--accent-pressed); }
.ai-send:disabled { opacity: 0.35; cursor: not-allowed; }

[data-theme="light"] .ai-bubble { background: var(--bg-elevated); border-color: var(--border-subtle); }
@media (max-width: 640px) { .ai-panel { width: 100%; border-left: none; border-top: 3px solid var(--accent); } }

/* AI plan: clickable assignee + user-message avatar */
.ai-plan-assignee { background: none; border: none; padding: 0; cursor: pointer; display: grid; place-items: center; flex: none; line-height: 0; }
.ai-plan-assignee:hover { opacity: 0.85; }
.ai-plan-assignee:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: var(--radius-full); }
.ai-plan-noassignee { width: 20px; height: 20px; border-radius: var(--radius-full); border: 1px dashed var(--border-strong); color: var(--text-tertiary); display: grid; place-items: center; font-size: 13px; line-height: 1; }
.ai-user-av { align-self: flex-end; flex: none; }

/* team (group) channel */
.team-channel-row { display: flex; align-items: center; gap: var(--space-2); }
.team-channel-hash { width: 22px; height: 22px; flex: none; border-radius: var(--radius-sm); background: var(--accent-tint-strong); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.dm-group-mark { width: 36px; height: 36px; flex: none; border-radius: var(--radius-md); background: var(--accent-tint-strong); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.dm-sender { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: 0.2px; }

/* Repeat popover v2: narrower hour select (24 options, all "23:00" width) */
.rp-select--hour { width: 100px; }

/* ============================ Group chats ================================ */
/* shared checkbox (create modal + add-member picker) */
.check-box { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); display: grid; place-items: center; color: #fff; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.check-box svg { width: 11px; height: 11px; }
.check-box.on { background: var(--accent); border-color: var(--accent); }
.check-box.is-locked { opacity: 0.55; }

/* secondary button (Add member) */
.btn-secondary { background: var(--bg-elevated); border-color: var(--border-default); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-surface); border-color: var(--border-strong); }

/* sidebar Groups list */
.group-list { display: flex; flex-direction: column; }
.gr-mark { flex: none; width: 18px; height: 18px; border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-tertiary); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.group-row:hover .gr-mark { color: var(--text-secondary); }
.group-row.default-group .gr-mark { background: var(--accent-tint); color: var(--accent); }
.gr-everyone { flex: none; font-size: 9px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 0.04em; }
.gr-unread { min-width: 16px; height: 16px; padding: 0 5px; margin-left: auto; background: var(--accent); border-radius: var(--radius-full); font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--text-inverse); display: flex; align-items: center; justify-content: center; flex: none; }
.group-row:hover .gr-unread, .group-row.menu-open .gr-unread { opacity: 0; width: 0; min-width: 0; padding: 0; margin: 0; overflow: hidden; }

/* New group modal */
.group-create-modal { width: 440px; max-width: calc(100vw - 32px); }
.gcm-members { margin-top: var(--space-3); }
.gcm-members-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-2); }
.gcm-members-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.gcm-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.gcm-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.gcm-member-row { display: flex; align-items: center; gap: var(--space-3); height: 40px; padding: 0 var(--space-2); border-radius: var(--radius-md); cursor: pointer; user-select: none; }
.gcm-member-row:hover { background: var(--bg-elevated); }
.gcm-member-row.is-self { cursor: default; }
.gcm-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; font-weight: 450; color: var(--text-primary); overflow: hidden; }
.gcm-name > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcm-sub { font-size: 11px; color: var(--text-tertiary); }

/* drawer header extras (group mode) */
.dm-back { margin-right: -2px; }
.dm-group-mark.is-default { background: var(--accent-tint-strong); color: var(--accent); }

/* drawer body swap: chat <-> manage (each x-show ALONE; no :style/x-transition) */
.dm-body-chat { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dm-manage-panel { flex: 1; overflow-y: auto; }
.dmm-scroll { display: flex; flex-direction: column; padding: var(--space-4); gap: var(--space-5); }
.dmm-section { display: flex; flex-direction: column; gap: var(--space-2); }
.dmm-label { font-size: 11px; font-weight: 500; color: var(--text-secondary); }
.dmm-rename { display: flex; align-items: center; gap: var(--space-2); padding: 8px 10px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); font-size: 13px; font-weight: 500; color: var(--text-primary); cursor: text; }
.dmm-rename span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmm-pencil { width: 14px; height: 14px; color: var(--text-tertiary); flex: none; }
.dmm-rename:hover .dmm-pencil { color: var(--text-secondary); }
.dmm-add-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; }
.dmm-add-btn svg { width: 14px; height: 14px; }
.dmm-add-picker { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-2); display: flex; flex-direction: column; gap: 2px; animation: boardRowsIn var(--dur-base,160ms) var(--ease-out); }
.dmm-add-empty { font-size: 12px; color: var(--text-tertiary); padding: 8px 10px; }
.dmm-add-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); }

/* member list */
.dm-member-list { display: flex; flex-direction: column; gap: 2px; }
.dm-member-row { display: flex; align-items: center; gap: var(--space-3); height: 40px; padding: 0 var(--space-2); border-radius: var(--radius-md); }
.dm-member-row:hover { background: var(--bg-elevated); }
.dm-member-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.dm-member-name { font-size: 13px; font-weight: 450; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-member-sub { font-size: 11px; color: var(--text-tertiary); }
.dm-member-remove { flex: none; width: 28px; height: 28px; border: none; background: transparent; color: var(--text-tertiary); border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.dm-member-row:hover .dm-member-remove { opacity: 1; }
.dm-member-remove svg { width: 15px; height: 15px; }
.dm-member-remove:hover { background: var(--danger-tint); color: var(--danger); }

/* leave / delete footer */
.dmm-footer { display: flex; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }
.dmm-leave { color: var(--danger); }
.dmm-leave:hover { background: var(--danger-tint); }
.dmm-delete { margin-left: auto; }

/* ============================ Chat attachments =========================== */
/* composer paperclip (extends .tb-icon) */
.dm-attach { flex: none; width: 38px; height: 38px; align-self: flex-end; }
.dm-attach:disabled { opacity: 0.5; cursor: not-allowed; }
.dm-composer.is-uploading .dm-input, .dm-composer.is-uploading .dm-attach { opacity: 0.6; pointer-events: none; }

/* pending-attachment tray (above the composer) */
.dm-attach-row { flex: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-2) var(--space-4) 0; max-height: 96px; overflow-y: auto; }
.dm-att-chip { display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-2) 0 var(--space-1); background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--radius-md); max-width: 200px; animation: attChipIn 200ms var(--ease-out); }
.dm-att-chip.is-error { border-color: var(--danger); }
.dm-att-chip.is-error .dm-att-name { color: var(--danger); }
.dm-att-thumb { width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); object-fit: cover; }
.dm-att-icon { width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); background: var(--bg-surface); display: grid; place-items: center; color: var(--text-tertiary); }
.dm-att-icon svg { width: 16px; height: 16px; }
.dm-att-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-att-name { font-size: var(--fs-micro); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-att-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.dm-att-remove { flex: none; width: 20px; height: 20px; border: none; background: transparent; color: var(--text-tertiary); border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer; transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.dm-att-remove svg { width: 13px; height: 13px; }
.dm-att-remove:hover { color: var(--danger); background: var(--danger-tint); }
@keyframes attChipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* drag-drop overlay */
.dm-body-chat { position: relative; }
.dm-dropzone { position: absolute; inset: var(--space-3); z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); background: var(--accent-tint); border: 1.5px dashed var(--accent-tint-strong); border-radius: var(--radius-lg); color: var(--accent); font-size: var(--fs-body); font-weight: 600; pointer-events: none; animation: attChipIn 160ms var(--ease-out); }
.dm-dropzone svg { width: 26px; height: 26px; }

/* attachments rendered in a bubble */
.dm-attachments { display: flex; flex-direction: column; gap: 4px; margin-top: 2px; }
.dm-att-images { max-width: 240px; overflow: hidden; border-radius: var(--radius-md); }
.dm-att-images.imgs-1 { display: block; }
.dm-att-images.imgs-1 .dm-img-cell { display: inline-block; line-height: 0; }
.dm-att-images.imgs-1 .dm-img { max-width: 240px; max-height: 280px; width: auto; height: auto; border-radius: var(--radius-md); }
.dm-att-images.imgs-2, .dm-att-images.imgs-3, .dm-att-images.imgs-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 240px; }
.dm-att-images:not(.imgs-1) .dm-img-cell { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); line-height: 0; }
.dm-att-images:not(.imgs-1) .dm-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dm-img-cell { cursor: zoom-in; display: block; }
.dm-img-more { position: absolute; inset: 0; background: rgba(13,15,20,0.62); color: #fff; display: grid; place-items: center; font-family: var(--font-mono); font-size: 15px; font-weight: 600; }

.dm-att-files { display: flex; flex-direction: column; gap: 3px; }
.dm-bubble-file { display: flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-2); max-width: 240px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.dm-bubble-file:hover { border-color: var(--border-default); background: var(--bg-elevated); }
.dm-bubble.own .dm-bubble-file { background: rgba(255,255,255,0.06); border-color: transparent; }
.bf-icon { flex: none; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--bg-elevated); display: grid; place-items: center; color: var(--text-secondary); }
.bf-icon svg { width: 16px; height: 16px; }
.bf-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.bf-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.bf-download { flex: none; width: 16px; height: 16px; color: var(--text-tertiary); transition: color var(--dur-fast) var(--ease-out); }
.dm-bubble-file:hover .bf-download { color: var(--text-secondary); }
[data-theme="light"] .dm-bubble.own .dm-bubble-file { background: rgba(124,108,240,0.10); }

@media (max-width: 640px) {
  .dm-attach, .dm-send { width: 44px; height: 44px; }
  .dm-attach-row { max-height: 120px; }
}

/* Recurring modal: human-readable schedule label on each rule row */
.recur-when { font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; flex: none; }

/* ============================ Topbar multi-timer (Noa spec) =============== */
/* count badge appearing inside .tw when runningTimers.length > 1 */
.tw .tw-count { height: 18px; min-width: 22px; padding: 0 6px; margin: 0 4px 0 6px; display: inline-grid; place-items: center; flex: none; background: rgba(124,108,240,0.16); color: var(--accent); font-family: var(--font-mono); font-size: 10px; font-weight: 600; border-radius: var(--radius-full); animation: twCountTick 220ms var(--ease-out); }
.tw.warn .tw-count { background: rgba(240,180,41,0.18); color: var(--timer-warn); }
.tw.over .tw-count { background: rgba(224,85,107,0.18); color: var(--timer-over); }
@keyframes twCountTick { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* dropdown: replaces the single-task tw-pop card with a 1..N row list */
.tw-pop { min-width: 320px; max-width: 360px; padding: 8px; max-height: 480px; overflow-y: auto; animation: twPopIn 200ms var(--ease-out); }
@keyframes twPopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.tw-pop-head { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.twh-label { font-size: 10px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-tertiary); }
.twh-pauseall { font-family: inherit; font-size: 10px; font-weight: 500; color: var(--text-secondary); background: transparent; border: none; padding: 4px 8px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.twh-pauseall:hover { background: var(--bg-surface); color: var(--text-primary); }
.twh-pauseall:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.tw-pop-list { display: flex; flex-direction: column; gap: 2px; }
.tw-row { position: relative; display: grid; grid-template-columns: 4px 1fr auto 28px; grid-template-rows: auto auto auto; column-gap: 8px; padding: 8px 10px 8px 14px; border-radius: var(--radius-md); cursor: pointer; transition: background var(--dur-fast) var(--ease-out); animation: twRowIn 150ms var(--ease-out); }
.tw-row:hover { background: var(--bg-surface); }
.tw-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.tw-row-stripe { grid-row: 1 / -1; grid-column: 1; width: 4px; border-radius: 2px; align-self: stretch; }
.tw-row.primary .tw-row-stripe { background: var(--accent) !important; }
.tw-row.primary { box-shadow: inset 2px 0 0 var(--accent); }
.tw-row-title { grid-column: 2 / 4; grid-row: 1; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tw-row-title .pulse { width: 6px; height: 6px; border-radius: var(--radius-full); flex: none; background: var(--timer-running); box-shadow: 0 0 0 0 rgba(46,190,126,0.5); animation: pulse 1600ms var(--ease-out) infinite; }
.tw-row-title .pulse.warn { background: var(--timer-warn); box-shadow: 0 0 0 0 rgba(240,180,41,0.5); }
.tw-row-title .pulse.over { background: var(--timer-over); box-shadow: 0 0 0 0 rgba(224,85,107,0.5); }
.twr-name { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tw-row-time { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.2px; color: var(--timer-running); }
.tw-row-time.warn { color: var(--timer-warn); }
.tw-row-time.over { color: var(--timer-over); }
.tw-row-pause { position: relative; grid-column: 4; grid-row: 1 / -1; align-self: center; width: 28px; height: 28px; border: none; background: transparent; color: var(--text-tertiary); border-radius: var(--radius-full); display: grid; place-items: center; cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.tw-row-pause svg { width: 14px; height: 14px; }
.tw-row-pause::before { content: ''; position: absolute; inset: -8px; }   /* 44px hit area */
.tw-row:hover .tw-row-pause { color: var(--timer-running); background: var(--bg-pressed); }
.tw-row.warn:hover .tw-row-pause { color: var(--timer-warn); }
.tw-row.over:hover .tw-row-pause { color: var(--timer-over); }
.tw-row-pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tw-row-crumb { grid-column: 2 / 5; grid-row: 2; font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-row-budget { grid-column: 2 / 5; grid-row: 3; margin-top: 4px; }
.tw-row-budget .tp-budget.inline { height: 4px; margin-bottom: 4px; }
.twr-budget-meta { display: flex; gap: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary); }
.tw-row.exiting { animation: twRowOut 180ms var(--ease-out) forwards; pointer-events: none; }
@keyframes twRowIn { from { opacity: 0; transform: translateY(-2px); } to { opacity: 1; transform: translateY(0); } }
@keyframes twRowOut { 0% { opacity: 1; max-height: 96px; } 60% { opacity: 0; max-height: 96px; } 100% { opacity: 0; max-height: 0; margin: 0; padding: 0; } }

@media (prefers-reduced-motion: reduce) {
  .tw-pop, .tw-row, .tw .tw-count { animation: none; }
}
@media (max-width: 640px) {
  .tw-pop { left: 8px !important; right: 8px !important; width: auto; max-width: none; max-height: 70vh; }
  .tw-row { padding: 12px 12px 12px 16px; }
  .tw-row-pause { width: 36px; height: 36px; }
  .tw-row-pause::before { inset: -4px; }
}
/* Hour select: native (let `.modal select` style it — native arrow, no custom chevron
   that tiled under the modal's `background` shorthand); just constrain its width.
   `.modal select.recur-hour` (0,2,1) beats `.modal select` (0,1,1) width:100%. */
.modal select.recur-hour { width: 120px; cursor: pointer; }

/* =====================================================================
   PROJECT SHARING  ·  share modal + sidebar badge + read-only board
   (Noa spec 2026-08-10). Tokens only; new classes are additive.
   ===================================================================== */

/* ---- share modal: grouped access list ---- */
.share-modal { width: 480px; }
.share-modal h3 { margin: 0 0 var(--space-1); }
.share-sub { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin: 0 0 var(--space-6); }

.share-group-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-secondary); margin-bottom: var(--space-1);
}
.share-group-label .cnt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; }
.share-group + .share-group { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border-subtle); }

.access-row { position: relative; transition: background var(--dur-fast) var(--ease-out); }
.access-row:hover { background: var(--bg-surface); }
.access-row .m-sub { font-size: 11px; color: var(--text-secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-row.is-implicit:hover { background: transparent; }   /* no controls -> no hover promise */
.access-row .dd { flex: none; width: 132px; }
.access-row .dd-trigger.boxed { position: relative; }
.access-row .dd-trigger.boxed::after { content: ''; position: absolute; inset: -5px 0; }  /* 44px touch */
.access-row .revoke { opacity: 1; position: relative; }       /* always visible, not hover-revealed */
.access-row .revoke::after { content: ''; position: absolute; inset: -8px; }              /* 44px touch */
.access-row .revoke:focus-visible { outline: 2px solid var(--danger); outline-offset: 1px; }
.access-row .file-confirm .fc-q { font-size: 11px; }          /* hold the 3-size budget */
.access-row.is-deleting { opacity: 0.5; pointer-events: none; }
.access-row.is-removing { opacity: 0; height: 0; overflow: hidden; transition: opacity var(--dur-fast) var(--ease-out), height var(--dur-fast) var(--ease-out); }

/* ---- share modal: add row ---- */
.share-add-row { margin-top: var(--space-4); }
.share-add-row .dd-trigger.boxed svg.lead { width: 15px; height: 15px; color: var(--text-secondary); flex: none; }
.share-add-row .dd-trigger.boxed[disabled] { opacity: 0.6; cursor: default; }
.share-add-row .dd-trigger.boxed[disabled]:hover { border-color: var(--border-default); }

/* ---- share modal: empty state (the post-rollout default — never an error) ---- */
.share-empty { text-align: center; padding: var(--space-8) var(--space-6) var(--space-4); }
.se-tile {
  width: 48px; height: 48px; margin: 0 auto var(--space-4);
  border-radius: var(--radius-lg); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); color: var(--text-secondary);
  display: grid; place-items: center;
}
.se-tile svg { width: 22px; height: 22px; }
.se-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.se-sub { font-size: 13px; color: var(--text-secondary); line-height: 1.5; max-width: 300px; margin: 0 auto; }

/* ---- sidebar: persistent shared badge (NO hover geometry change) ---- */
.proj-shared {
  flex: none; height: 18px; min-width: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-pressed); color: var(--text-secondary);
  border-radius: 9px; font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  transition: color var(--dur-fast) var(--ease-out);
}
.proj-shared svg { width: 12px; height: 12px; flex: none; }
.proj-row:hover .proj-shared { color: var(--text-primary); }   /* colour only — never size */

/* ---- board head: view-only chip ---- */
.ro-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  height: 22px; padding: 0 9px; margin-left: var(--space-2);
  border-radius: var(--radius-full); background: var(--bg-pressed);
  color: var(--text-secondary); font-size: 11px; font-weight: 500;
}
.ro-chip svg { width: 13px; height: 13px; flex: none; }

/* ---- board head: filter the board by assignee (Noa 2026-10-02) --------------
   Faces, not a dropdown: `me` is pinned leftmost so "only my tasks" is one click
   and never moves. State is carried in three places on purpose: the pill border
   says a filter is ON, the expanded cell says WHO, the ratio says how much of the
   board you are not seeing. All contrast computed for both themes. */
.bp {
  display: inline-flex; align-items: center; flex: none;
  height: 32px; padding: 0 var(--space-1); border-radius: var(--radius-full);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  transition: border-color var(--dur-normal) var(--ease-out),
              background-color var(--dur-normal) var(--ease-out);
}
.bp.on { border-color: var(--accent); }

.bp-face {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: stretch; width: 32px; padding: 0;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-full); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.bp-face:hover { background: var(--bg-elevated); }
.bp-face:active { background: var(--bg-pressed); }
.bp-face:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bp-face.on {
  width: auto; gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-1);
  background: var(--accent-tint); border-color: var(--accent);
}
.bp-face.on:hover, .bp-face.on:active { background: var(--accent-tint-strong); }
.bp-name {
  font-size: var(--fs-small); font-weight: 500; letter-spacing: -0.01em;
  color: var(--accent-text); white-space: nowrap;
  max-width: 96px; overflow: hidden; text-overflow: ellipsis;
}

.bp-more, .bp-clear {
  display: inline-flex; align-items: center; justify-content: center;
  align-self: stretch; width: 28px; padding: 0;
  background: transparent; border: none; border-radius: var(--radius-full);
  color: var(--text-secondary); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.bp-more svg { width: 14px; height: 14px; }
.bp-clear svg { width: 13px; height: 13px; }
.bp-more:hover { background: var(--bg-elevated); color: var(--text-primary); }
.bp-more:active { background: var(--bg-pressed); }
.bp-clear:hover { background: var(--danger-tint); color: var(--danger-text); }
.bp-clear:active { background: var(--danger-tint); }
.bp-more:focus-visible, .bp-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* how much of the board is hidden, in the WIP-count idiom the columns already use */
.bp-count {
  display: inline-flex; align-items: center; align-self: stretch;
  margin-left: var(--space-1); padding: 0 var(--space-1) 0 var(--space-2);
  border-left: 1px solid var(--border-default);
  font-size: var(--fs-micro); line-height: 1;
  animation: fade var(--dur-normal) var(--ease-out);
}
.bp-count b { color: var(--text-primary); font-weight: 500; }
.bp-count .lim { color: var(--text-secondary); }

/* a column emptied by the filter states why; it is information, not an error */
.col-filtered {
  padding: var(--space-2) var(--space-1);
  font-size: var(--fs-micro); color: var(--text-secondary);
  animation: fade var(--dur-normal) var(--ease-out);
}

/* compress before the toolbar runs out of room: keep `me`, the active person, the opener */
@media (max-width: 1100px) {
  .bp-face { display: none; }
  .bp-face:first-of-type, .bp-face.on { display: inline-flex; }
  .bp-name { max-width: 72px; }
}
/* touch: every target reaches 44px; the painted discs never change size */
@media (pointer: coarse) {
  .bp { height: 48px; }
  .bp-face, .bp-more, .bp-clear { width: 44px; }
  .bp-face.on { width: auto; padding: 0 var(--space-3) 0 var(--space-2); }
}


/* ---- read-only board + drawer: de-control without breaking ---- */
.board.is-readonly .card { cursor: default; }
.dwr-inner.ro .dd-trigger { pointer-events: none; }
.dwr-inner.ro .dd-trigger:hover { background: transparent; border-color: transparent; }
.dwr-inner.ro .dd-trigger .chev { display: none; }
.dwr-inner.ro .dwr-title { cursor: default; }
.dwr-inner.ro input, .dwr-inner.ro textarea { pointer-events: none; }

/* ---- access-lost pane (403 while open) — grey, never danger ---- */
.access-lost { display: grid; place-items: center; align-content: center; height: 100%; padding: var(--space-12) var(--space-6); text-align: center; }
.al-tile {
  width: 56px; height: 56px; margin-bottom: var(--space-4);
  border-radius: var(--radius-lg); background: var(--bg-surface);
  border: 1px solid var(--border-subtle); color: var(--text-secondary);
  display: grid; place-items: center;
}
.al-tile svg { width: 26px; height: 26px; }
.al-title { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; color: var(--text-primary); margin-bottom: 6px; }
.al-sub { font-size: 13px; color: var(--text-secondary); line-height: 1.55; max-width: 340px; margin: 0 auto var(--space-6); }

@media (prefers-reduced-motion: reduce) {
  .access-row, .access-row.is-removing, .proj-shared { transition: none; }
}

/* ============ AI ACTION PLAN — bulk move (Noa spec 2026-08-19) ============ */

/* 44px hit area for the exclude/remove control, both plan kinds */
.ai-plan-remove::after { content: ''; position: absolute; inset: -12px; }
.ai-plan-remove:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }

/* frame — same DNA as .ai-task-plan */
.ai-move-plan { margin-top: var(--space-2); border: 1px solid var(--border-default); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); }

/* head */
.ai-move-head { padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; }
.ai-move-hrow { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.ai-move-title { font-size: var(--fs-small); font-weight: 600; color: var(--text-primary); }
.ai-move-count { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-secondary); white-space: nowrap; }
.ai-move-filter { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.4; word-break: break-word; }

/* destination band — the one thing that must not be missed */
.ai-move-dest { display: flex; align-items: center; gap: var(--space-2); height: 60px; padding: var(--space-2) var(--space-3); background: var(--accent-tint); border-top: 1px solid var(--border-subtle); }
.ai-move-dest.is-open { background: transparent; }                       /* unresolved / blocked */
.amd-arrow { width: 15px; height: 15px; flex: none; color: var(--accent); }
.ai-move-dest.is-open .amd-arrow { color: var(--text-secondary); }
.amd-label { flex: none; font-size: var(--fs-micro); font-weight: 500; color: var(--text-secondary); }
.amd-select { flex: 1; min-width: 0; height: 44px; padding: 0 var(--space-2); background: var(--bg-input); border: 1px solid var(--border-default); border-radius: var(--radius-sm); font-family: inherit; font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out); }
.ai-move-dest.is-open .amd-select { background: var(--bg-elevated); font-weight: 450; color: var(--text-secondary); }
.amd-select:hover:not(:disabled) { border-color: var(--border-strong); }
.amd-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.amd-select:disabled { cursor: default; }

/* notes — permission, skipped rows, truncation. Grey, no icon, never an alert. */
.ai-move-notes { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border-subtle); }
.ai-move-note { font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.45; }

/* manifest */
.ai-move-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; border-top: 1px solid var(--border-subtle); }
.ai-move-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3) var(--space-1) var(--space-2); min-height: 44px; border-bottom: 1px solid var(--border-subtle); transition: background var(--dur-fast) var(--ease-out); }
.ai-move-row:last-child { border-bottom: none; }
.ai-move-row:hover { background: var(--bg-elevated); }
.amr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.amr-title { font-size: var(--fs-body); font-weight: 450; color: var(--text-primary); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--dur-fast) var(--ease-out); }
.amr-meta { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-secondary); line-height: 1.35; min-width: 0; }
.amr-board { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amr-clip { width: 12px; height: 12px; flex: none; }
.amr-status { flex: none; padding: 0 5px; border-radius: var(--radius-full); background: var(--bg-pressed); }
.ai-move-row .av { cursor: default; }

/* excluded — strikethrough, NOT dimmed: opacity would push the title below AA */
.ai-move-row.is-excluded .amr-title { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--text-tertiary); }
/* exclusion is not deletion — the shipped red hover must not appear on a real task */
.ai-move-row .ai-plan-remove:hover { color: var(--text-primary); }

/* footer — geometry inherited from .ai-plan-footer, one new fill */
.ai-move-confirm { padding: 7px var(--space-4); border-radius: var(--radius-md); border: none; background: var(--accent-solid); color: #FFFFFF; font-size: var(--fs-small); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: var(--space-2); box-shadow: inset 0 0 0 1px transparent; transition: box-shadow var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.ai-move-confirm:hover:not(:disabled) { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.34); }
.ai-move-confirm:active:not(:disabled) { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.34), inset 0 2px 6px rgba(0,0,0,0.28); }
.ai-move-confirm:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-move-confirm:disabled { opacity: 0.45; cursor: not-allowed; }

/* terminal states */
.ai-move-done { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3); animation: ai-bubble-in var(--dur-normal) var(--ease-out) both; }
.ai-move-done svg { width: 16px; height: 16px; flex: none; }
.ai-move-done.is-ok { color: var(--success-text); }
.ai-move-done.is-none { color: var(--text-secondary); }
.amd-done-label { font-size: var(--fs-small); font-weight: 500; }
.ai-move-open { margin-left: auto; flex: none; height: 28px; padding: 0 var(--space-3); border-radius: var(--radius-sm); background: var(--bg-elevated); border: 1px solid var(--border-default); color: var(--text-primary); font-family: inherit; font-size: var(--fs-micro); font-weight: 600; cursor: pointer; max-width: 168px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.ai-move-open:hover { background: var(--bg-pressed); border-color: var(--border-strong); }
.ai-move-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* the rows that did not move */
.ai-move-failed { padding: 0 var(--space-3) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.amf-label { font-size: var(--fs-micro); color: var(--text-secondary); }
.amf-list { display: flex; flex-direction: column; gap: 2px; max-height: 132px; overflow-y: auto; }
.amf-row { display: flex; align-items: center; gap: var(--space-2); min-height: 22px; }
.amf-row svg { width: 14px; height: 14px; flex: none; color: var(--text-tertiary); }
.amf-title { font-size: var(--fs-small); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amf-why { font-size: var(--fs-micro); color: var(--text-secondary); margin-top: var(--space-1); }

/* nothing matched */
.ai-move-empty { padding: var(--space-4) var(--space-3); display: flex; flex-direction: column; gap: var(--space-1); }
.ame-title { font-size: var(--fs-small); font-weight: 600; color: var(--text-primary); }
.ame-sub { font-size: var(--fs-micro); color: var(--text-secondary); }
.ame-sub .mono { font-family: var(--font-mono); }
.ame-hint { font-size: var(--fs-micro); color: var(--text-secondary); }

@media (max-width: 640px) { .ai-move-list { max-height: 200px; } }

/* "+ N wiecej" under a capped search-results list */
.afc-more { font-size: var(--fs-micro); color: var(--text-secondary); padding: 2px 2px 0; }

/* ===== chat reply / quote (Noa spec 2026-08-21) ===== */
   .dm-time { ... opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
   .dm-bubble:hover .dm-time { opacity: 1; }
   
/* ===== */
@media (hover: none) { .dm-reply-btn { opacity: 0.55; pointer-events: auto; } }

/* ===== */
.dm-bubble {
  max-width: 74%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); border-bottom-left-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 3px;
}

/* ===== */
.dm-bubble {
  position: relative;              /* anchor for .dm-reply-btn — inert, no geometry change */
  max-width: 74%; padding: 8px 12px;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); border-bottom-left-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 3px;
}

/* ===== */
/* ==================== Chat: reply to a message (Noa spec 2026-08-21) ======
   Three surfaces: the hover affordance on a bubble, the staged quote above
   the composer, and the quote rendered inside a sent message.
   Hover-geometry invariant: .dm-reply-btn is position:absolute in every
   state, so a bubble's box is identical hovered and unhovered. Only
   opacity / background / color / pointer-events change. */

/* ---- A · the affordance on the bubble ---------------------------------- */
.dm-reply-btn {
  position: absolute; bottom: 2px; right: -36px;
  width: 28px; height: 28px;
  border: none; background: transparent; color: var(--text-secondary);
  border-radius: var(--radius-md); display: grid; place-items: center; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.dm-bubble.own .dm-reply-btn { right: auto; left: -36px; }
.dm-reply-btn svg { width: 16px; height: 16px; }
/* 44x44 hit area from a 28px box, contiguous with the bubble edge so the
   pointer never crosses a dead strip on its way from bubble to button */
.dm-reply-btn::after { content: ''; position: absolute; inset: -8px; }
.dm-reply-btn:hover { background: var(--bg-pressed); color: var(--text-primary); }
.dm-reply-btn:active { background: var(--bg-pressed); opacity: 1; }
.dm-reply-btn:focus-visible {
  opacity: 1; pointer-events: auto;
  outline: 2px solid var(--accent); outline-offset: 1px;
}
@media (hover: hover) {
  .dm-bubble:hover .dm-reply-btn { opacity: 1; pointer-events: auto; }
}
@media (hover: none) {
  /* no hover to reveal it: it simply lives in the gutter */
  .dm-reply-btn { opacity: 0.55; pointer-events: auto; }
}

/* ---- B · the staged quote above the composer --------------------------- */
.dm-reply-bar { flex: none; padding: var(--space-2) var(--space-4) 0; }
.dm-reply-card {
  display: flex; align-items: center; gap: var(--space-2);
  height: 44px; padding: 0 var(--space-1) 0 var(--space-3);
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  animation: attChipIn 200ms var(--ease-out);
}
.dm-reply-kind { flex: none; width: 16px; height: 16px; color: var(--text-secondary); }
.dm-reply-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-reply-to {
  font-size: var(--fs-micro); font-weight: 600; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-reply-text {
  font-size: 13px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-reply-cancel {
  position: relative; flex: none; width: 28px; height: 28px;
  border: none; background: transparent; color: var(--text-secondary);
  border-radius: var(--radius-sm); display: grid; place-items: center; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.dm-reply-cancel svg { width: 14px; height: 14px; }
.dm-reply-cancel::after { content: ''; position: absolute; inset: -8px; }
/* NOT --danger on hover: cancelling a quote discards nothing (contrast with
   .dm-att-remove L1275, which discards an uploaded file) */
.dm-reply-cancel:hover { background: var(--bg-pressed); color: var(--text-primary); }
.dm-reply-cancel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- C · the quote inside a sent message -------------------------------
   Surface treatment mirrors .dm-bubble-file (L1296-1306): the same problem
   (a nested panel legible on both bubble backgrounds) already solved once. */
.dm-quote {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: 44px; margin-bottom: 2px;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-surface); border: none; border-radius: var(--radius-md);
  font-family: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.dm-quote-kind { flex: none; width: 14px; height: 14px; color: var(--text-secondary); }
.dm-quote-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-quote-who {
  font-size: var(--fs-micro); font-weight: 600; color: var(--text-secondary); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-quote-text {
  font-size: 13px; color: var(--text-secondary); line-height: 1.45;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-quote:hover { background: var(--bg-pressed); }
/* the text lift is not decoration: --text-secondary fails AA on the own-bubble
   hover composite (4.35), --text-primary clears it (9.50). See spec §11. */
.dm-quote:hover .dm-quote-who,
.dm-quote:hover .dm-quote-text,
.dm-quote:hover .dm-quote-kind { color: var(--text-primary); }
.dm-quote:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dm-bubble.own .dm-quote { background: rgba(255,255,255,0.06); }
.dm-bubble.own .dm-quote:hover { background: rgba(255,255,255,0.10); }
[data-theme="light"] .dm-bubble.own .dm-quote { background: rgba(124,108,240,0.10); }
[data-theme="light"] .dm-bubble.own .dm-quote:hover { background: rgba(124,108,240,0.16); }

/* deleted original: there is nothing to jump to, so it is not a control.
   pointer-events:none means :hover never matches, which neutralises every
   hover rule above in one property instead of four override rules — and it
   holds for the own-bubble variants too, whose specificity would otherwise
   out-rank an .is-gone override. The element is already `disabled`, so it is
   out of the tab order and loses nothing by being out of the hover path. */
.dm-quote.is-gone { min-height: 32px; cursor: default; pointer-events: none; }

/* ---- jump-to-original beacon -------------------------------------------
   a transition, not an animation: prefers-reduced-motion collapses it to an
   instant on/off (still visible) instead of removing it entirely */
.dm-bubble { transition: box-shadow var(--dur-normal) var(--ease-out); }
.dm-bubble-row.is-flash .dm-bubble { box-shadow: 0 0 0 2px var(--accent); }

/* ---- optional upgrade: a real thumbnail in the quote (needs
   reply_preview.thumb from service.py — see spec §0.2)
.dm-quote-thumb { flex: none; width: 28px; height: 28px; border-radius: var(--radius-sm); object-fit: cover; }
*/

/* ===== */
/* one-shot tick on a column count that changed under the user (§10.2).
   Transform only, so it cannot displace anything. Reuses the shipped
   keyframe from the topbar timer count (L1320). */
.column-head .count.tick { animation: twCountTick 220ms var(--ease-out); }

/* ===== */
.column-head .count.tick { animation: twCountTick 220ms var(--ease-out); }

/* ===== lightbox paging (Noa rev 2026-08-24) ===== */
/* paging: prev/next + position counter + load state (Noa 2026-08-24) */
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,0.32); border-radius: var(--radius-full); background: rgba(13,15,20,0.72); color: rgba(255,255,255,0.86); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,0.35); cursor: pointer; transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform 80ms var(--ease-out); }
.lightbox-nav svg { width: 20px; height: 20px; }
.lightbox-nav.lb-prev { left: var(--space-6); }
.lightbox-nav.lb-next { right: var(--space-6); }
.lightbox-nav:hover { background: rgba(13,15,20,0.88); border-color: rgba(255,255,255,0.48); color: #fff; }
.lightbox-nav:active { transform: translateY(-50%) scale(0.98); }
.lightbox-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lightbox-count { position: absolute; top: var(--space-8); left: var(--space-6); height: 28px; display: grid; place-items: center; padding: 0 var(--space-3); background: rgba(13,15,20,0.72); border: 1px solid rgba(255,255,255,0.10); border-radius: var(--radius-full); backdrop-filter: blur(8px); font-family: var(--font-mono); font-size: var(--fs-micro); font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.86); cursor: default; }

.lightbox-spinner { position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 2px solid rgba(255,255,255,0.22); border-top-color: #fff; border-radius: 50%; animation: fcSpin 600ms linear infinite, lightboxIn var(--dur-fast) var(--ease-out) 160ms both; }
.lightbox-err { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: var(--fs-body); color: rgba(255,255,255,0.72); }

@media (max-width: 768px) {
  .lightbox { padding: var(--space-4); }
  .lightbox-img { max-height: 80vh; }
  .lightbox-close { top: var(--space-4); right: var(--space-4); }
  .lightbox-caption { bottom: var(--space-4); }
  .lightbox-nav.lb-prev { left: var(--space-4); }
  .lightbox-nav.lb-next { right: var(--space-4); }
  .lightbox-count { top: var(--space-6); left: var(--space-4); }
}

/* ===== gallery (Noa spec 2026-08-24) ===== */
grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
gap: var(--space-3);   /* 12px */

/* ===== */
.gal-media { aspect-ratio: 1 / 1; }
.gal-thumb { width: 100%; height: 100%; object-fit: cover; object-position: center; }

/* ===== */
.gal-media.is-wide .gal-thumb,
.gal-media.is-tall .gal-thumb { object-fit: contain; }

/* ===== */
/* ============================================================ GALLERY
   Noa spec 2026-08-24. Every file in the workspace, one grid.
   Reuses .view-inner / .view-title / .view-sub from analytics.css. */

.gallery { flex: 1; min-width: 0; overflow-y: auto; height: calc(100vh - 52px); }
.gallery .view-inner { max-width: 1440px; }        /* scan surface, not a reading surface */
.gallery .view-head { margin-bottom: var(--space-6); }

/* --- sticky filter bar --------------------------------------------------- */
.gal-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  margin: 0 calc(var(--space-8) * -1) var(--space-6);
  padding: var(--space-3) var(--space-8);
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
}

.gal-search {
  display: flex; align-items: center; gap: var(--space-2);
  flex: 1 1 180px; min-width: 180px; max-width: 420px; height: 36px;   /* basis only: still grows to 420 when there is room */
  padding: 0 var(--space-3);
  background: var(--bg-input); border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.gal-search:hover { border-color: var(--border-strong); }
.gal-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint-strong); }
.gal-search > svg { width: 15px; height: 15px; flex: none; color: var(--text-secondary); }
.gal-search input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: 0;
  font-family: inherit; font-size: 13px; font-weight: 450; color: var(--text-primary);
}
.gal-search input::placeholder { color: var(--text-secondary); }
.gal-search-x {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--radius-full);
  color: var(--text-secondary); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.gal-search-x svg { width: 13px; height: 13px; }
.gal-search-x:hover { background: var(--bg-pressed); color: var(--text-primary); }
.gal-search-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* --- type segment: neutral raised pill, NOT iris (see §6.4) -------------- */
.gal-seg {
  display: inline-flex; align-items: center; height: 36px; padding: 3px; gap: 2px;
  background: var(--bg-input); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); flex: none;
}
.gal-seg button {
  height: 28px; padding: 0 12px;
  display: inline-flex; align-items: center;
  border: 0; background: transparent; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.gal-seg button:hover { color: var(--text-primary); }
.gal-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.gal-seg button.on {
  background: var(--bg-elevated); color: var(--text-primary);
  box-shadow: var(--elev-1), inset 0 0 0 1px var(--border-default);
}

/* --- dropdowns on the bar: shipped .dd, boxed trigger, bar height -------- */
.gal-dd .dd-trigger.boxed { height: 36px; width: auto; min-width: 132px; gap: var(--space-2); }
.gal-dd .dd-trigger.boxed .tlabel { color: var(--text-primary); }   /* never .val-empty (fails AA) */

.gal-clear {
  height: 36px; padding: 0 var(--space-3);
  border: 0; background: transparent; border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.gal-clear:hover { background: var(--bg-surface); color: var(--text-primary); }
.gal-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--space-3);
}

.gal-tile {
  display: flex; flex-direction: column; text-align: left;
  padding: 0; overflow: hidden; cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-1);
  font-family: inherit;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
/* colour + shadow only. no transform, no size, no padding change. */
.gal-tile:hover { background: var(--bg-elevated); border-color: var(--border-default); box-shadow: var(--elev-2); }
.gal-tile:active { background: var(--bg-pressed); }
.gal-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- media box ----------------------------------------------------------- */
.gal-media {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: var(--bg-input);
  box-shadow: inset 0 0 0 1px var(--border-subtle);   /* frames white photos in light theme */
  overflow: hidden;
}
.gal-thumb {
  width: 100%; height: 100%; display: block;
  object-fit: cover; object-position: center;
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out);
}
.gal-thumb[data-loaded] { opacity: 1; }
.gal-media.is-wide .gal-thumb,
.gal-media.is-tall .gal-thumb { object-fit: contain; }

/* SVG: fixed white bed in BOTH themes — an SVG's own colours are unknown (§5.3) */
.gal-media.is-vector { background: #FFFFFF; }
.gal-media.is-vector .gal-thumb { object-fit: contain; padding: 14%; }

/* --- glyph face: video / doc / other / failed thumb ---------------------- */
.gal-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2);
}
.gal-face svg { width: 40px; height: 40px; color: var(--text-tertiary); }
.gal-face-ext {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 1px; color: var(--text-secondary);
}

/* --- video: play badge + duration chip ----------------------------------- */
/* Neutral black/white, never iris: iris is the one action accent per view and
   79 iris badges in a grid would retire that meaning. Centered with negative
   margins, not transform, so the hover-geometry invariant is visible in the CSS.
   pointer-events:none — the TILE is the button; the badge must not eat the click. */
.gal-play {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  display: grid; place-items: center;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.55);
  color: #fff;
  pointer-events: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.gal-play svg { width: 22px; height: 22px; }
/* colour only, in lockstep with .gal-tile:hover's own --dur-fast — no transform,
   no size change (hover-geometry invariant) */
.gal-tile:hover .gal-play { background: rgba(0,0,0,0.72); }

.gal-dur {
  position: absolute; right: var(--space-2); bottom: var(--space-2);
  height: 20px; padding: 0 var(--space-2);
  display: inline-flex; align-items: center;
  border-radius: var(--radius-sm);
  background: rgba(13,15,20,0.78);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  font-variant-numeric: tabular-nums; color: #fff;
  pointer-events: none;
}

/* --- caption ------------------------------------------------------------- */
.gal-cap { padding: 8px var(--space-3) 10px; min-width: 0; }
.gal-cap-name {
  display: block; font-size: 13px; font-weight: 500; line-height: 1.35;
  color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gal-cap-sub {
  display: block; margin-top: 2px;
  font-size: 11px; font-weight: 450; line-height: 1.35;
  color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gal-cap-sub .sz { font-family: var(--font-mono); }
.gal-mark { background: var(--accent-tint-strong); color: var(--text-primary); border-radius: 2px; padding: 0 2px; }

/* --- skeleton (reuses the shipped jeShimmer keyframe) -------------------- */
.gal-skel-media,
.gal-skel-line {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-elevated) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: jeShimmer 1100ms linear infinite;
}
.gal-skel-media { width: 100%; aspect-ratio: 1 / 1; }
.gal-skel-line { height: 10px; border-radius: var(--radius-sm); }
.gal-skel-line.w65 { width: 65%; }
.gal-skel-line.w40 { width: 40%; margin-top: 6px; }

/* --- load more / sentinel / error ---------------------------------------- */
.gal-foot { display: flex; align-items: center; justify-content: center; min-height: 64px; margin-top: var(--space-6); }
.gal-more {
  height: 36px; padding: 0 var(--space-4);
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.gal-more:hover { background: var(--bg-elevated); border-color: var(--border-strong); color: var(--text-primary); }
.gal-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gal-spin {
  width: 20px; height: 20px; border-radius: var(--radius-full);
  border: 2px solid var(--border-default); border-top-color: var(--text-secondary);
  animation: ai-spin 700ms linear infinite;          /* shipped keyframe, v2.css L1138 */
}
.gal-error { display: flex; align-items: center; justify-content: center; gap: var(--space-3); min-height: 48px; font-size: 13px; color: var(--text-secondary); }

/* --- empty states -------------------------------------------------------- */
.gal-empty { text-align: center; padding: 80px 20px; }
.gal-empty.filtered { padding: 64px 20px; }
.gal-empty svg { width: 48px; height: 48px; color: var(--text-tertiary); margin-bottom: var(--space-4); }
.gal-empty-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-1); }
.gal-empty-sub { font-size: 13px; font-weight: 450; color: var(--text-secondary); max-width: 380px; margin: 0 auto; line-height: 1.5; }
.gal-empty-cta {
  margin-top: var(--space-4); height: 36px; padding: 0 var(--space-4);
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.gal-empty-cta:hover { background: var(--bg-elevated); border-color: var(--border-strong); }
.gal-empty-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== */
@media (max-width: 768px) {
  .gallery .view-inner { padding: var(--space-6) var(--space-4) 64px; }
  .gal-bar { margin: 0 calc(var(--space-4) * -1) var(--space-4); padding: var(--space-2) var(--space-4); }
  .gal-search { max-width: none; flex: 1 1 100%; order: -1; }   /* search gets its own row */
  .gal-clear { margin-left: 0; }
}
/* touch: every bar control reaches 44px */
@media (hover: none) {
  .gal-search, .gal-seg, .gal-clear, .gal-dd .dd-trigger.boxed { height: 44px; }
  .gal-seg button { height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .gal-skel-media, .gal-skel-line, .gal-spin { animation: none; }
  .gal-thumb { transition: none; opacity: 1; }
}

/* ===== */
/* REPLACE v2.css L141 — 0.72 leaves the mono meta at 5.00:1 over a white photo.
   0.82 takes it to 6.79:1. Benefits the shipped drawer lightbox too. */
.lightbox-caption {
  position: absolute; bottom: var(--space-6); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-2);
  padding: 6px 6px 6px var(--space-4);
  background: rgba(13,15,20,0.82);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-full);
  backdrop-filter: blur(8px); max-width: min(92vw, 720px); cursor: default;
}

/* REPLACE v2.css L144 — 0.65 was below AA on a white photo */
.lightbox-cap-size { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.72); }

/* REPLACE v2.css L135 — the bar is taller now; keep the media clear of it */
.lightbox-img { max-width: 90vw; max-height: 82vh; }

/* --- ADD: gallery-only actions inside the pill -------------------------- */
.lightbox-bar-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.16); flex: none; margin: 0 2px; }
.lightbox-act {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 14px;
  border: 0; background: transparent; border-radius: var(--radius-full);
  font-family: inherit; font-size: 13px; font-weight: 500; color: #fff;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
.lightbox-act svg { width: 16px; height: 16px; flex: none; }
.lightbox-act:hover { background: rgba(255,255,255,0.14); }
.lightbox-act:active { background: rgba(255,255,255,0.22); }
/* white, not iris: --accent on the worst-case pill face is 2.85:1 (§15) */
.lightbox-act:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- ADD: video + doc + no-preview -------------------------------------- */
.lightbox-media {
  max-width: 90vw; max-height: 82vh; width: auto; height: auto;
  border-radius: var(--radius-md); box-shadow: var(--elev-3); background: #000;
  animation: lightboxImgIn 280ms var(--ease-out);
}
.lightbox-doc {
  width: 90vw; height: 82vh; border: 0;
  border-radius: var(--radius-md); box-shadow: var(--elev-3); background: var(--bg-elevated);
}
/* --- video player -------------------------------------------------------- */
/* Must sit AFTER .lightbox-media — same specificity, source order wins. 82vh (the
   image rule) puts the native scrubber under the caption pill on a 700px-tall
   window; the reserve below is real chrome: 24+44+12 top (close button),
   24+56+16 bottom (pill). The dvh line is progressive — mobile Safari's 100vh
   hides behind the browser control bar. */
.lightbox-video {
  display: block; width: auto; height: auto;
  max-width: 90vw;
  max-height: calc(100vh - 176px);
  max-height: calc(100dvh - 176px);
  background: #000;
  cursor: default;                       /* .lightbox is zoom-out; the player is not */
}
.lightbox-video:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* --- the no-preview floor ------------------------------------------------ */
/* Bed dropped. rgba(255,255,255,0.08) is a LIGHTENING film: it tracks whatever is
   behind it, which breaks the fixed-dark lightbox convention and computes to
   1.21:1 (dark) / 1.28:1 (light) against the scrim — an invisible card. Content
   on the fixed-dark scrim is legible in both themes with no sub-threshold pixel. */
.lightbox-nopreview {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding: var(--space-12) var(--space-8);
  text-align: center; cursor: default;
  animation: lightboxImgIn 280ms var(--ease-out);
}
.lightbox-nopreview svg { width: 48px; height: 48px; color: rgba(255,255,255,0.60); }
.lightbox-nopreview .np-name { font-size: 15px; font-weight: 600; color: #fff; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox-nopreview .np-sub { font-family: var(--font-mono); font-size: 13px; color: rgba(255,255,255,0.72); }

/* The one way out of a dead end. White fill, not iris — the shipped
   .lightbox-act:focus-visible already settled this ("white, not iris"), and
   --accent-solid on the light-theme scrim computes to 2.04:1. */
.np-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 44px; padding: 0 20px; margin-top: var(--space-2);
  border: 0; border-radius: var(--radius-full);
  background: #FFFFFF; color: #0D0F14;
  font-family: inherit; font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
.np-btn svg { width: 16px; height: 16px; flex: none; }
.np-btn:hover  { background: rgba(255,255,255,0.88); }
.np-btn:active { background: rgba(255,255,255,0.76); }
/* white ring, 2px offset — the gap shows the scrim, so ring and fill stay distinct */
.np-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 768px) {
  .lightbox-caption { bottom: var(--space-4); max-width: calc(100vw - 32px); padding-left: var(--space-3); }
  .lightbox-cap-name { max-width: 34vw; }
  .lightbox-act { padding: 0 10px; }
  .lightbox-act .lb-act-label { display: none; }   /* icon-only below 768; labels return above it */
  /* pill drops to bottom:16 here — the reserve shrinks with it */
  .lightbox-video { max-height: calc(100vh - 164px); max-height: calc(100dvh - 164px); }
  .lightbox-nopreview { padding: var(--space-8) var(--space-4); }
}

/* accent as small text (AA on tinted/base surfaces) — token lives in tokens.css */
.view-kicker,
.view-switch button.on,
.seg button.on,
.dm-sender { color: var(--accent-text); }

/* gallery pager — pages instead of endless scroll (Rafal, 2026-08-24) */
.gal-pager { display: flex; align-items: center; justify-content: center; gap: var(--space-3);
             padding: var(--space-6) 0 var(--space-8); }
.gal-page-btn { width: 32px; height: 32px; flex: none; display: grid; place-items: center;
                border: 1px solid var(--border-default); border-radius: var(--radius-md);
                background: var(--bg-surface); color: var(--text-secondary); cursor: pointer;
                transition: background var(--dur-fast) var(--ease-out),
                            border-color var(--dur-fast) var(--ease-out),
                            color var(--dur-fast) var(--ease-out); }
.gal-page-btn svg { width: 15px; height: 15px; }
.gal-page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text-primary); background: var(--accent-tint); }
.gal-page-btn:disabled { opacity: .4; cursor: default; }
.gal-page-now { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-secondary);
                min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
.gal-page-sep { width: 1px; height: 20px; background: var(--border-subtle); }
.gal-page-size { display: inline-flex; align-items: center; gap: var(--space-2);
                 font-size: var(--fs-micro); color: var(--text-secondary); }
.gal-page-size select { height: 32px; padding: 0 var(--space-2); border-radius: var(--radius-md);
                        border: 1px solid var(--border-default); background: var(--bg-surface);
                        color: var(--text-primary); font-family: var(--font-mono); font-size: var(--fs-micro); }

/* ===== gallery: delete confirm in the viewer (Noa rev 2026-08-24) ===== */
/* app.css L392 — was 60, which is below .lightbox (200): a toast fired while the
   viewer is open painted under the scrim and was never seen. */
.toast { z-index: 210; }

/* ===== */
/* ── ADD after .lightbox-act:focus-visible (v2.css L2003) ────────────────────
   Destructive action in the caption pill. Colours are literals: the pill is
   rgba(13,15,20,0.82) in BOTH themes, so var(--danger-text) would resolve to
   #A0203C in light theme and land at 1.50:1. #F08A99 is the DARK value of
   --danger-text, used verbatim — the token's own colour, pinned to a surface
   that does not switch. */
.lightbox-act.is-danger        { color: #F08A99; }                                    /* 4.76 / 7.65 */
.lightbox-act.is-danger:hover  { background: rgba(224,85,107,0.22); color: #fff; }     /* 9.12 / 14.05 */
.lightbox-act.is-danger:active { background: rgba(224,85,107,0.34); color: #fff; }     /* 8.00 / 11.52 */
/* focus ring inherits .lightbox-act:focus-visible — #fff, never iris (§7.2) */

/* ── ADD: the confirm replaces the pill's contents ───────────────────────── */
.lightbox-caption.is-confirming { padding: 6px 6px 6px var(--space-4); }

.lb-confirm {
  display: flex; align-items: center; gap: var(--space-2); min-width: 0;
  animation: fcIn var(--dur-fast) var(--ease-out);        /* shipped keyframe, v2.css L117 */
}
.lb-confirm-q {
  font-size: 13px; font-weight: 450; line-height: 1.35;
  color: rgba(255,255,255,0.92);                          /* 9.89 / 15.47 */
  max-width: 46ch; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.lb-confirm-q b { font-weight: 600; color: #fff; }        /* the parent's name */
.lb-confirm-err { font-size: 13px; font-weight: 500; color: #F08A99; white-space: nowrap; }  /* 4.76 / 7.65 */

/* 44px native — same height as .lightbox-act, so the pill does not change
   height between rest and confirming. Only its width changes. */
.lb-btn {
  flex: none; height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent;                          /* width never changes — only the colour */
  border-radius: var(--radius-full);
  background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500; color: #fff;
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.lb-btn:hover         { background: rgba(255,255,255,0.14); }    /* 7.34 / 12.11 */
.lb-btn:active        { background: rgba(255,255,255,0.22); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* The committing button is the ONLY outlined control anywhere in the lightbox.
   Shape, not colour alone, separates it from Cancel — WCAG 1.4.1 satisfied twice
   over (the words differ too). NOT a solid --danger fill: #fff on #E0556B is
   3.70:1 (R7b) and every darker red loses its edge against the pill face. */
.lb-btn.is-danger            { border-color: #F08A99; color: #F08A99; }               /* border 4.76 / 7.65 */
.lb-btn.is-danger:hover      { background: rgba(224,85,107,0.22); color: #fff; }       /* 9.12 / 14.05 */
.lb-btn.is-danger:active     { background: rgba(224,85,107,0.34); color: #fff; }       /* 8.00 / 11.52 */
.lb-btn.is-danger[disabled]  { cursor: default; }         /* label -> spinner, never a faded label */

.lb-spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #F08A99; border-right-color: transparent;
  animation: fcSpin 600ms linear infinite;                /* shipped keyframe, v2.css L118 */
}

/* ── ADD to the responsive block (after v2.css L2043) ───────────────────────
   Below 768 the pill wraps into a two-row card: the warning is the load-bearing
   half of the copy and must not be truncated away on a phone. */
@media (max-width: 768px) {
  .lightbox-caption.is-confirming { border-radius: var(--radius-lg); padding: var(--space-3); }
  .lb-confirm { flex-wrap: wrap; row-gap: var(--space-2); }
  .lb-confirm-q, .lb-confirm-err { flex: 1 1 100%; max-width: none; white-space: normal; line-height: 1.4; }
  .lb-confirm .lb-btn:first-of-type { margin-left: auto; }
  .lb-btn { padding: 0 12px; }
}

/* ── ADD to the reduced-motion block (v2.css L119 neighbourhood) ─────────── */
@media (prefers-reduced-motion: reduce) {
  .lb-confirm { animation: none; }
  .lb-spin    { animation: none; }
}

/* ── upload (Noa rev 2026-08-25) ─────────────────────────────────────────────
   The view's one primary. --accent-solid under #FFF = 5.10 both themes;
   --accent under #FFF is 3.99 and --accent-hover under #FFF is 3.21, which is
   why hover brightens the inset edge and never the fill (.ai-move-confirm). */
.gal-upload {
  margin-left: auto;                       /* owns the rail; Clear rejoins the filter cluster */
  height: 36px; padding: 0 var(--space-4); flex: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  border: 0; border-radius: var(--radius-md); cursor: pointer;
  background: var(--accent-solid); color: #FFFFFF;
  font-family: inherit; font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
.gal-upload svg { width: 15px; height: 15px; flex: none; }
.gal-upload:hover  { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.34); }
.gal-upload:active { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.34), inset 0 2px 6px rgba(0,0,0,0.28); }
.gal-upload:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── drop overlay: fixed frame (the view starts under the 52px topbar), card
     carries the words because the floor is photographs (U2) ──────────────── */
.gal-dropzone {
  position: fixed; inset: 52px 0 0 0; margin: var(--space-3);
  z-index: 40; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-tint);
  border: 1.5px dashed var(--accent-tint-strong);
  border-radius: var(--radius-lg);
  animation: attChipIn 160ms var(--ease-out);      /* shipped keyframe, v2.css L1279 */
}
.gal-dropzone-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-6) var(--space-8);
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--elev-3);
}
.gal-dropzone-card svg { width: 26px; height: 26px; color: var(--accent-text); }   /* 5.37 / 5.16 */
.gal-dropzone-main { font-size: 13px; font-weight: 600; color: var(--accent-text); }
.gal-dropzone-sub  { font-size: 11px; font-weight: 450; color: var(--text-secondary); }  /* 5.56 / 6.02 */

/* ── optimistic tiles: a .gal-tile that is not (yet) a button ────────────── */
.gal-tile.is-upload { cursor: default; }
.gal-tile.is-upload:hover {                        /* inert: rest values restated */
  background: var(--bg-surface); border-color: var(--border-subtle); box-shadow: var(--elev-1);
}
.gal-up-strip {                                    /* "in flight": 2px accent shimmer */
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent-tint-strong) 25%, var(--accent) 50%, var(--accent-tint-strong) 75%);
  background-size: 200% 100%;
  animation: jeShimmer 1100ms linear infinite;     /* shipped keyframe, analytics.css */
}
.gal-tile.is-upfail { border-color: var(--danger); }        /* 4.42 / 4.45 vs --bg-surface */
.gal-up-reason { color: var(--danger-text); }               /* 6.85 / 4.72 on --bg-surface */

/* ── the pill: toast surface, lightbox-pill posture ──────────────────────── */
.gal-up-pill {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%);
  z-index: 90;                                     /* above content, below .lightbox (200) */
  display: flex; align-items: center; gap: var(--space-3);
  min-height: 52px; padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-full); box-shadow: var(--elev-3);
  max-width: calc(100vw - 32px);
  animation: attChipIn 200ms var(--ease-out);
}
.gal-up-pill .gal-spin { width: 16px; height: 16px; flex: none; }   /* shipped spinner class */
.gal-up-text { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.gal-up-text .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.gal-up-track {
  width: 96px; height: 4px; flex: none; border-radius: var(--radius-full);
  background: var(--bg-input); overflow: hidden;
}
.gal-up-fill {
  height: 100%; border-radius: var(--radius-full);
  background: var(--accent);                       /* vs the track: 4.32 / 3.43 */
  transition: width var(--dur-normal) var(--ease-out);
}
.gal-up-btn {
  height: 44px; padding: 0 var(--space-3); flex: none;
  border: 0; background: transparent; border-radius: var(--radius-full);
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.gal-up-btn:hover { background: var(--bg-input); color: var(--text-primary); }   /* 14.35 / 15.60 */
.gal-up-btn.is-accent { color: var(--accent-text); }                             /* 5.37 / 5.16 */
.gal-up-btn.is-accent:hover { color: var(--accent-text); }                       /* on --bg-input: 6.34 / 6.02 */
/* ring on an elevated pill: --accent computes 2.94 light — the token ring here
   is --accent-text (5.37 / 5.16), the same surface-driven swap R8 made to #fff */
.gal-up-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

@media (max-width: 768px) {
  .gal-upload { margin-left: 0; }          /* wraps with the bar; the rail idiom needs width */
  .gal-up-pill { bottom: var(--space-4); }
}
@media (hover: none) {
  .gal-upload { height: 44px; }            /* joins the shipped 44px list */
}
@media (prefers-reduced-motion: reduce) {
  .gal-up-strip { animation: none; background: var(--accent-tint-strong); }
  .gal-dropzone, .gal-up-pill { animation: none; }
  .gal-up-fill { transition: none; }
}

/* ============================================================ GALLERY: SELECT MODE · BULK DELETE · DELETION LOG
   Noa spec 2026-09-18. Zero new tokens, zero new keyframes (fade: app.css;
   fcSpin, lightboxImgIn: v2.css). Every colour pair computed, both themes. */

/* ── rail: select-mode toggle, left of Upload ─────────────────────────────── */
.gal-select {
  margin-left: auto;                                      /* the rail is [Select][Upload files] */
  height: 36px; padding: 0 var(--space-3); flex: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-md); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary);   /* 13.59 / 14.48 */
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.gal-select svg { width: 15px; height: 15px; flex: none; }
.gal-select:hover  { background: var(--bg-elevated); border-color: var(--border-strong); }   /* 12.15 / 13.33 */
.gal-select:active { background: var(--bg-pressed); }                                      /* 10.42 / 11.38 */
.gal-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gal-select ~ .gal-upload { margin-left: 0; }             /* one auto margin owns the rail; two would split the gap */

/* ── select mode: same bar, same height, contents swapped ─────────────────── */
.gal-filters { display: contents; }                       /* x-show wrapper; children stay flex items of .gal-bar */
.gal-bar.is-selecting {
  background: linear-gradient(var(--accent-tint), var(--accent-tint)), var(--bg-canvas);   /* opaque: tiles scroll under it */
  border-bottom-color: var(--accent-tint-strong);
}
.gal-selgroup {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: var(--space-2);
  animation: fade var(--dur-fast) var(--ease-out);
}
.gal-selgroup .gal-clear { flex: none; white-space: nowrap; }
.gal-selall {
  height: 36px; padding: 0 var(--space-3) 0 var(--space-2); flex: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 0; border-radius: var(--radius-md); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary);    /* 14.16 / 14.96 */
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
.gal-selall .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.gal-selall:hover  { background: var(--accent-tint); }                                     /* 12.28 / 13.48 */
.gal-selall:active { background: var(--accent-tint-strong); }                              /* 10.71 / 12.38 */
.gal-selall:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }       /* 4.26 / 3.30 */
.gal-selall[disabled] { cursor: default; }
/* unchecked edge = --text-secondary; the shipped .check-box --border-strong is 1.77 / 1.61 here */
.gal-cbx {
  width: 16px; height: 16px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--text-secondary); border-radius: var(--radius-sm);             /* 6.48 / 6.76 */
  color: #FFFFFF;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.gal-cbx svg { width: 11px; height: 11px; }
.gal-cbx.on, .gal-cbx.mixed { background: var(--accent-solid); border-color: var(--accent-solid); }  /* 3.34 / 4.22; #FFF glyph 5.10 */
.gal-selstat {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 500; color: var(--text-primary);                          /* 14.16 / 14.96 */
}
.gal-selstat .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.gal-selstat .dim { font-weight: 450; color: var(--text-secondary); }                     /* 6.48 / 6.76 */

/* Delete on the rail: outlined, never filled. The one solid red is inside the dialog (§09). */
.gal-bulk-del {
  height: 36px; padding: 0 var(--space-3); flex: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 1px solid var(--danger-text); border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--danger-text);      /* 7.13 / 6.28 */
  cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out);
}
.gal-bulk-del svg { width: 15px; height: 15px; flex: none; }
.gal-bulk-del:hover  { background: var(--danger-tint); }                                     /* 6.25 / 5.45 */
.gal-bulk-del:active { background: var(--danger-tint); box-shadow: inset 0 0 0 100px var(--danger-tint); }  /* 5.40 / 4.77 */
.gal-bulk-del:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gal-bulk-del:disabled { opacity: 0.4; cursor: default; background: transparent; box-shadow: none; }

/* ── the grid in select mode ──────────────────────────────────────────────── */
.gal-grid.is-selecting { user-select: none; -webkit-user-select: none; }
.gal-grid.is-selecting .gal-play { opacity: 0; }          /* the tile toggles now; duration chip stays */
/* 1px border + 1px ring, zero geometry (.card.selected recipe). --accent-text, not --accent:
   --accent vs a hovered tile face is 2.94 light; --accent-text >= 4.41 on every surface. */
.gal-tile.is-sel { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text), var(--elev-1); }
.gal-tile.is-sel:hover { border-color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-text), var(--elev-2); }
/* on the photo: literals, photo colours are unknown (lightbox-pill rule). .60 core: ring vs core
   >= 5.03, better of (ring, core) vs any grey photo >= 3.15 (.55 dipped to 2.93). */
.gal-check {
  position: absolute; top: var(--space-2); left: var(--space-2);
  width: 20px; height: 20px; display: none; place-items: center;
  border: 1.5px solid #FFFFFF; border-radius: var(--radius-sm);
  background: rgba(13,15,20,0.60); box-shadow: 0 1px 3px rgba(0,0,0,0.40);
  color: #FFFFFF; pointer-events: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.gal-check svg { width: 12px; height: 12px; opacity: 0; }
.gal-grid.is-selecting .gal-check { display: grid; animation: fade var(--dur-fast) var(--ease-out); }
.gal-tile.is-sel .gal-check { background: var(--accent-solid); }   /* #6A59E0 both themes; #FFF check 5.10 */
.gal-tile.is-sel .gal-check svg { opacity: 1; }

/* ── marquee ──────────────────────────────────────────────────────────────── */
.gal-marquee {
  position: fixed; z-index: 4;                             /* over tiles, under the sticky bar (5) */
  border: 1px solid var(--accent-text);                    /* >= 5.06 vs every tinted surface it crosses */
  background: var(--accent-tint); pointer-events: none;
}

/* ── bulk-delete confirm (shipped .modal-overlay / .modal anatomy) ───────── */
.modal-overlay.gal-modal-overlay { z-index: 95; }          /* over drawers 56-59, dd 62, upload pill 90; under lightbox 200, toast 210 */
.modal.gal-modal { width: 440px; animation: lightboxImgIn var(--dur-slow) var(--ease-out); }   /* fade + scale .97 -> 1 */
.gal-modal h3 { margin: 0 0 var(--space-3); line-height: 1.35; }
.gal-modal .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.gal-modal-body { margin: 0; font-size: 13px; font-weight: 450; line-height: 1.5; color: var(--text-secondary); }  /* 5.56 / 6.02 */
.gal-modal-body b { font-weight: 500; color: var(--text-primary); }                                               /* 12.15 / 13.33 */
.gal-modal-notes { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.gal-modal-note { display: flex; align-items: flex-start; gap: var(--space-2); font-size: 13px; line-height: 20px; color: var(--text-secondary); }
.gal-modal-note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }   /* (20 - 16) / 2: centred on line one */
.gal-modal-err { margin: var(--space-4) 0 0; font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--danger-text); }  /* 6.12 / 5.59 */
.gal-modal .btn { font-size: 13px; }                       /* .btn is 13.5: keeps the dialog at 2 sizes */
.gal-modal .btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }   /* --accent on elevated = 2.94 light */
.gal-modal .btn-ghost:disabled { opacity: 0.4; cursor: default; background: transparent; color: var(--text-secondary); }
/* the one solid red. --text-inverse label 5.19 / 5.14; #FFF on --danger is 3.70 dark (rejected) */
.gal-danger-btn { position: relative; background: var(--danger); border-color: var(--danger); color: var(--text-inverse); font-weight: 500; }
.gal-danger-btn:hover  { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-tint); }   /* halo, instant: friction is intentional */
.gal-danger-btn:active { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-tint), inset 0 2px 6px rgba(0,0,0,0.28); }
.gal-danger-btn[disabled] { cursor: default; }
.gal-danger-btn.is-busy .lbl { visibility: hidden; }       /* hidden label holds the width */
.gal-btn-spin {
  position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: var(--radius-full); border: 2px solid currentColor; border-right-color: transparent;
  animation: fcSpin 600ms linear infinite;
}

/* ── deletion log: header entry ───────────────────────────────────────────── */
.gal-log-btn {
  height: 36px; padding: 0 var(--space-3); flex: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 0; border-radius: var(--radius-md); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-secondary);   /* 7.30 / 7.55 */
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.gal-log-btn svg { width: 15px; height: 15px; flex: none; }
.gal-log-btn:hover  { background: var(--bg-surface); color: var(--text-primary); }         /* 13.59 / 14.48 */
.gal-log-btn:active { background: var(--bg-elevated); }
.gal-log-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── deletion log: panel (task-drawer anatomy, AI-panel width) ────────────── */
.gal-log-scrim { position: fixed; inset: 0; z-index: 58; background: var(--bg-overlay); animation: fade var(--dur-normal) var(--ease-out); }
.gal-log {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 59;
  width: 480px; max-width: 100vw; display: flex; flex-direction: column;
  background: var(--bg-base); border-left: 1px solid var(--border-default); box-shadow: var(--elev-drawer);
  transform: translateX(100%); visibility: hidden;          /* hidden = out of the tab order too */
  transition: transform 160ms var(--ease-in), visibility 0s 160ms;                 /* exit */
}
.gal-log.open { transform: translateX(0); visibility: visible;
  transition: transform var(--dur-normal) var(--ease-out), visibility 0s; }       /* entrance */
.gal-log-head {
  flex: none; display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4) var(--space-3) var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-subtle);
}
.gal-log-titles { flex: 1; min-width: 0; }
.gal-log-title { font-size: 15px; font-weight: 600; line-height: 20px; color: var(--text-primary); }   /* 14.77 / 15.60 */
.gal-log-sub { margin-top: var(--space-1); font-size: 13px; line-height: 18px; color: var(--text-secondary); }  /* 6.76 / 7.04 */
.gal-log-sub .n { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.gal-log-x {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border: 0; background: transparent; border-radius: var(--radius-md); cursor: pointer; color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.gal-log-x svg { width: 18px; height: 18px; }
.gal-log-x:hover  { background: var(--bg-elevated); color: var(--text-primary); }          /* 12.15 / 13.33 */
.gal-log-x:active { background: var(--bg-pressed); }
.gal-log-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }       /* 4.45 / 3.44 */
.gal-log-list { flex: 1; overflow-y: auto; padding-bottom: var(--space-6); }
.gal-log-day {
  position: sticky; top: 0; z-index: 1; background: var(--bg-base);
  padding: var(--space-4) var(--space-6) var(--space-2);
  font-size: 11px; font-weight: 600; line-height: 16px; color: var(--text-secondary);    /* 6.76 / 7.04 */
}
.gal-log-row { display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-2) var(--space-6); }
.gal-log-thumb {
  position: relative; flex: none; width: 48px; height: 48px; padding: 0;
  display: grid; place-items: center; overflow: hidden;
  border: 0; border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text-tertiary);  /* glyph 3.18 / 3.39 */
}
.gal-log-thumb::after { content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--border-subtle); pointer-events: none; }        /* hairline over the photo */
.gal-log-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gal-log-thumb svg { width: 20px; height: 20px; }
button.gal-log-thumb { cursor: zoom-in; transition: box-shadow var(--dur-fast) var(--ease-out); }
button.gal-log-thumb:hover  { box-shadow: 0 0 0 2px var(--border-strong); }
button.gal-log-thumb:active { box-shadow: 0 0 0 2px var(--text-secondary); }
button.gal-log-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }   /* 4.45 / 3.44 */
.gal-log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.gal-log-file { font-size: 13px; font-weight: 500; line-height: 18px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-log-who { display: flex; align-items: center; gap: var(--space-2); min-width: 0;
  font-size: 13px; font-weight: 450; line-height: 18px; color: var(--text-secondary); }
.gal-log-who .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gal-log-who b { font-weight: 500; color: var(--text-primary); }                            /* 14.77 / 15.60 */
.gal-log-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1);
  font-family: var(--font-mono); font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums;
  color: var(--text-secondary); }                            /* NOT tertiary: 3.27 / 3.39 */
.gal-log .gal-empty { padding: var(--space-12) var(--space-6); }
.gal-log-row .gal-skel-media { width: 48px; height: 48px; flex: none; aspect-ratio: auto; border-radius: var(--radius-sm); }
.gal-log-foot { display: flex; justify-content: center; align-items: center; min-height: 64px; padding: var(--space-2) var(--space-6) 0; }

/* ── responsive / touch / reduced motion ──────────────────────────────────── */
@media (max-width: 768px) {
  .gal-select { margin-left: 0; }
  .gal-selgroup { flex: 1 1 100%; }                          /* status on its own row... */
  .gal-bar.is-selecting .gal-select { margin-left: auto; }   /* ...Cancel + Delete right-aligned under it */
}
@media (max-width: 560px) { .gal-log { width: 100vw; border-left: 0; } }
@media (hover: none) {
  .gal-select, .gal-selall, .gal-bulk-del, .gal-log-btn, .gal-modal .btn, .gal-log .gal-more { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .gal-selgroup, .gal-grid.is-selecting .gal-check, .modal.gal-modal, .gal-log-scrim, .gal-btn-spin { animation: none; }
  .gal-log, .gal-log.open { transition: none; }
}

/* ============================ Desktop notifications (switch + chat nudge) == */
/* Switch — reusable binary control. 36x20 track, 16px knob, 1px travel gaps.
   State is carried by the knob (>=3:1 vs track AND canvas in both themes);
   the 1px border is edge definition only. No geometry change on hover. */
.switch {
  position: relative; flex: none; width: 36px; height: 20px; padding: 0;
  background: var(--bg-pressed); border: 1px solid var(--border-strong);
  border-radius: var(--radius-full); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.switch::before { content: ''; position: absolute; inset: -12px; } /* 60x44 hit area */
.switch-knob {
  position: absolute; top: 1px; left: 1px; width: 16px; height: 16px;
  border-radius: var(--radius-full); background: var(--text-secondary);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.switch:not(.on):not(:disabled):hover .switch-knob { background: var(--text-primary); }
.switch:not(.on):not(:disabled):active { background: var(--bg-elevated); }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on .switch-knob { transform: translateX(16px); background: #FFFFFF; }
.switch.on:not(:disabled):hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.switch.on:not(:disabled):active { background: var(--accent-pressed); border-color: var(--accent-pressed); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch:disabled { opacity: 0.55; cursor: not-allowed; }   /* blocked — mirrors .check-box.is-locked */

/* Blocked helper — Settings only, shown when browser permission is denied */
.notif-blocked-note {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin-top: var(--space-1); padding: var(--space-2) var(--space-3);
  background: var(--warning-tint); border-radius: var(--radius-md);
  font-size: var(--fs-small); line-height: 1.5; color: var(--text-primary);
}
.notif-blocked-note svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--text-secondary); }

/* One-time nudge banner — chat drawer, pinned under the header */
.dm-notif-nudge {
  flex: none; display: flex; align-items: center; gap: var(--space-3);
  margin: var(--space-3) var(--space-4) 0; padding: var(--space-3);
  background: var(--accent-tint); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.dnn-icon { width: 18px; height: 18px; flex: none; color: var(--accent); }
.dnn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dnn-title { font-size: var(--fs-body); font-weight: 600; color: var(--text-primary); }
.dnn-sub { font-size: var(--fs-small); color: var(--text-secondary); line-height: 1.4; }
.dnn-x {
  position: relative; flex: none; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center; background: transparent; border: none;
  border-radius: var(--radius-md); color: var(--text-secondary); cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out);
}
.dnn-x::before { content: ''; position: absolute; inset: -8px; } /* 44x44 hit area */
.dnn-x:hover { color: var(--text-primary); }
.dnn-x:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dnn-x svg { width: 14px; height: 14px; }

/* ============================ File rename + comment file ref (Noa spec) ==== */
/* row cluster: comment-ref + rename pencils follow the .file-rm reveal idiom —
   opacity only, geometry static (hover-geometry invariant) */
.file-cref, .file-rn { opacity: 0; }
.file-row:hover .file-cref, .file-row:hover .file-rn { opacity: 1; }
.file-cref:hover, .file-rn:hover { color: var(--accent); background: var(--accent-tint); }   /* icons 3:1: 4.09 / 3.20 */
.file-cref:focus-visible, .file-rn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
@media (hover: none) { .file-cref, .file-rn { opacity: 1; } }

/* inline rename field — .nav-rename recipe, stem editable, ext locked.
   --text-secondary on the ext, NOT tertiary: tertiary on --bg-input is 3.18 / 3.39. */
.rn-field { display: flex; align-items: center; height: 28px; max-width: 100%;
            background: var(--bg-input); border: 1px solid var(--accent);
            box-shadow: 0 0 0 2px var(--accent-tint-strong); border-radius: var(--radius-sm);
            padding: 0 8px 0 6px; }
.rn-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0;
            font-family: inherit; font-size: 13px; font-weight: 500; color: var(--text-primary); outline: none; }
.rn-ext { flex: none; font-size: 13px; font-weight: 500; color: var(--text-secondary);
          user-select: none; cursor: default; }

/* staged chip above the comment composer — .dm-reply-card anatomy,
   thumb identity from .dm-att-thumb/.dm-att-icon */
.cmt-ref-bar { padding-bottom: var(--space-2); }
.cmt-ref-card { display: flex; align-items: center; gap: var(--space-2); height: 44px;
                padding: 0 var(--space-1); background: var(--bg-elevated);
                border: 1px solid var(--border-default); border-radius: var(--radius-md);
                animation: attChipIn 200ms var(--ease-out); }
.cref-thumb { width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); object-fit: cover; }
.cref-icon { width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm);
             background: var(--bg-surface); display: grid; place-items: center; color: var(--text-secondary); }
.cref-icon svg { width: 16px; height: 16px; }
.cref-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cref-kicker { font-size: var(--fs-micro); font-weight: 600; color: var(--text-secondary);
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cref-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cref-cancel { position: relative; flex: none; width: 28px; height: 28px; border: none; background: transparent;
               color: var(--text-secondary); border-radius: var(--radius-sm); display: grid; place-items: center;
               cursor: pointer; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.cref-cancel svg { width: 14px; height: 14px; }
.cref-cancel::after { content: ''; position: absolute; inset: -8px; }   /* 44px touch target */
.cref-cancel:hover { background: var(--bg-pressed); color: var(--text-primary); }   /* un-staging discards nothing -> not danger */
.cref-cancel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* chip inside a posted comment — .dm-bubble-file anatomy, one ladder rung up:
   bubble = surface, chip = elevated, icon cell = pressed.
   Subs at --text-secondary, NOT tertiary: tertiary on elevated is 2.69 / 2.90. */
.cmt-file { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; max-width: 280px;
            padding: var(--space-1) var(--space-2); background: var(--bg-elevated);
            border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
            font-family: inherit; text-align: left; text-decoration: none; cursor: pointer;
            transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.cmt-file:hover { background: var(--bg-pressed); border-color: var(--border-default); }
.cmt-file:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bubble .cmt-file + .cmt-body { margin-top: 6px; }   /* gap only when text follows */
.cf-thumb { width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm); object-fit: cover; }
.cf-icon { flex: none; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--bg-pressed);
           display: grid; place-items: center; color: var(--text-secondary); }
.cf-icon svg { width: 16px; height: 16px; }
.cf-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cf-name { font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-sub { font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary); }
.cf-dl { flex: none; width: 16px; height: 16px; color: var(--text-secondary); }
.cmt-file.is-deleted { cursor: default; background: transparent; border-style: dashed; border-color: var(--border-default); }
.cmt-file.is-deleted .cf-icon { background: transparent; }
.cmt-file.is-deleted .cf-name { color: var(--text-secondary); }

/* lightbox pill rename — mode swap mirrors .lb-confirm. Literals, not tokens:
   the pill face is fixed-dark in BOTH themes (is-danger precedent).
   44px field + 6px pill padding = same pill height as the rest state. */
.lightbox-caption.is-renaming { padding: 6px; }
.lb-rename { display: flex; align-items: center; height: 44px; min-width: min(60vw, 420px);
             padding: 0 var(--space-3); background: rgba(255,255,255,0.10);
             border: 1px solid rgba(255,255,255,0.55);   /* 4.67 vs pill, 3.42 vs field */
             border-radius: var(--radius-full); animation: fcIn var(--dur-fast) var(--ease-out); }
.lb-rename:focus-within { border-color: #fff; }          /* ring stays white, never iris */
.lb-rn-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0;
               font-family: inherit; font-size: 13px; font-weight: 500; color: #fff;
               outline: none; caret-color: #fff; }
.lb-rn-input::selection { background: rgba(255,255,255,0.28); }
.lb-rn-ext { flex: none; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.72);   /* 5.24 on field face */
             user-select: none; cursor: default; }

@media (max-width: 768px) {
  .lb-rename { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cmt-ref-card, .lb-rename { animation: none; }
}

/* ============== Chat: conversation-list drawer mode (Noa spec 2026-09-04) ==
   List = up-level of the thread. Rows reuse .gr-unread badge anatomy, the
   sidebar tile color convention, and the shipped jeShimmer skeleton. Every
   muted string is --text-secondary: --text-tertiary computes 3.27 (dark) /
   3.39 (light) on --bg-base and fails AA at these sizes. */
.conv-list { flex: 1; overflow-y: auto; padding: var(--space-2); display: flex; flex-direction: column; gap: 2px; animation: convListIn var(--dur-normal) var(--ease-out); }
@keyframes convListIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

.conv-row {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 56px; padding: var(--space-2);
  background: transparent; border: none; border-radius: var(--radius-md);
  font-family: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.conv-row:hover { background: var(--bg-elevated); }
.conv-row:active { background: var(--bg-pressed); }
.conv-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.conv-av { width: 36px; height: 36px; font-size: 14px; }   /* pairs with the 36px group tile */
.conv-mark {
  flex: none; width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  color: var(--text-secondary); font-size: 16px; font-weight: 600;
  display: grid; place-items: center;
}
/* default "Whole team": the one iris mark in the list (sidebar convention).
   Glyph is --accent-text, not --accent: 5.72/5.43 on the tint composite vs
   --accent's 3.66 (fails at 16px/600). */
.conv-mark.is-default { background: var(--accent-tint); border-color: transparent; color: var(--accent-text); }

.conv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv-name { font-size: var(--fs-body); font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-row.is-unread .conv-name { font-weight: 600; }
.conv-preview { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: var(--fs-small); color: var(--text-secondary); }
.conv-preview svg { flex: none; width: 12px; height: 12px; }
.conv-preview .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.conv-side { flex: none; align-self: flex-start; margin-top: 2px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.conv-time { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-secondary); }
.conv-unread {
  min-width: 16px; height: 16px; padding: 0 5px;
  background: var(--accent); border-radius: var(--radius-full);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--text-inverse);
  display: flex; align-items: center; justify-content: center;
}
/* light theme: --text-inverse on --accent = 3.69 (fails AA at 10px);
   on --accent-solid = 4.72 (passes) — the token built for exactly this */
[data-theme="light"] .conv-unread { background: var(--accent-solid); }

/* skeleton — shipped jeShimmer keyframe (analytics.css) */
.conv-skel-row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2); }
.conv-skel-av, .conv-skel-line {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-elevated) 50%, var(--bg-input) 75%);
  background-size: 200% 100%; animation: jeShimmer 1100ms linear infinite;
}
.conv-skel-av { flex: none; width: 36px; height: 36px; border-radius: var(--radius-full); }
.conv-skel-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.conv-skel-line { height: 10px; border-radius: var(--radius-sm); }
.conv-skel-line.w40 { width: 40%; } .conv-skel-line.w55 { width: 55%; }
.conv-skel-line.w60 { width: 60%; } .conv-skel-line.w70 { width: 70%; } .conv-skel-line.w80 { width: 80%; }
