/* Command palette (.cp-), bulk actions toolbar (.bk-), notifications popover (.nt-). Tokens only. */

/* ---------- Command palette ---------- */
.modal.cp-modal { width: min(660px, calc(100vw - 24px)); top: 11vh; max-height: 72vh; overflow: hidden; }
.cp-modal .modal-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.cp { display: flex; flex-direction: column; min-height: 0; max-height: 72vh; }
.cp-search { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.cp-search > .ico { color: var(--text-3); }
.cp-input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; color: var(--text); outline: none; }
.cp-input::placeholder { color: var(--text-3); }
.cp-scope:empty { display: none; }
.cp-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 8px; }
.cp-group + .cp-group { margin-top: 4px; }
.cp-group-label { padding: 8px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.cp-item { width: 100%; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 10px; border-radius: var(--r-md); text-align: left; font-size: 14px; color: var(--text); }
.cp-item.is-active { background: var(--brand-soft); }
.cp-item.is-active .cp-title { color: var(--text); }
.cp-ico { width: 22px; display: inline-grid; place-items: center; flex: none; color: var(--text-3); }
.cp-ico .cp-done { color: var(--success); }
.cp-title { flex: 1; min-width: 0; }
.cp-title mark { background: transparent; color: var(--brand-text); font-weight: 700; }
.cp-meta { display: flex; align-items: center; gap: 12px; flex: none; max-width: 45%; font-size: 12px; color: var(--text-3); }
.cp-meta mark { background: transparent; color: var(--brand-text); }
.cp-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; color: var(--text-2); font-size: 13px; }
.cp-empty .ico { color: var(--text-3); margin-bottom: 4px; }
.cp-empty b { color: var(--text); font-size: 14px; font-weight: 600; }
.cp-foot { display: flex; align-items: center; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--text-3); flex: none; }
.cp-foot > span { display: inline-flex; align-items: center; gap: 4px; }
.cp-foot .kbd { min-width: 18px; height: 18px; font-size: 10.5px; }

/* ---------- Bulk actions toolbar ---------- */
.bk-bar { position: fixed; left: 50%; bottom: 24px; z-index: 75; display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-3); transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; transition: transform 220ms var(--ease), opacity 160ms var(--ease); max-width: calc(100vw - 24px); }
.bk-bar.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.bk-count { padding: 0 12px 0 14px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; }
.bk-count b { color: var(--brand-text); font-weight: 700; margin-right: 2px; }
.bk-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.bk-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; transition: background var(--dur); }
.bk-btn .ico { color: var(--text-2); }
.bk-btn:hover { background: var(--hover); }
.bk-btn.is-danger, .bk-btn.is-danger .ico { color: var(--danger); }
.bk-btn.is-danger:hover { background: var(--danger-soft); }
.bk-clear { padding: 0 8px 0 10px; color: var(--text-2); }
.bk-remove { color: var(--danger); }
.bk-fail { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; max-height: 240px; overflow-y: auto; }
.bk-fail li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 13px; }

/* ---------- Notifications ---------- */
.popover.nt-pop { width: min(392px, calc(100vw - 16px)); overflow: hidden; }
.nt { display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 80px)); }
.nt-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 4px 16px; }
.nt-head h2 { font-size: 15px; font-weight: 600; }
.nt-tabs { padding: 0 10px; flex: none; }
.nt-tabs .tab { height: 36px; font-size: 13px; }
.nt-tabs .badge { min-width: 17px; height: 17px; font-size: 10.5px; }
.nt-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; }
.nt-item { position: relative; width: 100%; display: flex; align-items: flex-start; gap: 12px; padding: 10px 28px 10px 12px; border-radius: var(--r-md); text-align: left; font-size: 13px; color: var(--text-2); }
.nt-item:hover, .nt-item:focus-visible { background: var(--hover); }
.nt-item.is-unread { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.nt-item.is-unread:hover { background: var(--brand-soft); }
.nt-lead { flex: none; }
.nt-sys { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.nt-sys.is-warning { background: var(--warning-soft); color: var(--warning); }
.nt-sys.is-danger { background: var(--danger-soft); color: var(--danger); }
.nt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nt-text { line-height: 1.45; }
.nt-text b, .nt-task { color: var(--text); font-weight: 600; }
.nt-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-3); }
.nt-proj { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-proj i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.nt-dot { position: absolute; right: 12px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.nt-empty { padding: 36px 20px; }
.nt-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13px; flex: none; }
.nt-foot a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.nt-foot a:hover { color: var(--text); }

@media (max-width: 860px) {
  .bk-bar { bottom: 72px; border-radius: var(--r-lg); }
  .bk-btn span:not(.kbd), .bk-clear .kbd { display: none; }
  .bk-btn { padding: 0 10px; }
  .cp-meta span + span { display: none; }
  .cp-foot > span:last-child { display: none; }
  .modal.cp-modal { top: 8px; bottom: auto; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: var(--r-xl); }
}
