/* ============================================================
   Sentinel Docs — shared UX components: Home, signals, owner
   pickers, sheets, notifications, playbook, palette, not-found.
============================================================ */
.dx .sd-item .sd-n.is-alert { color: var(--red); font-weight: 500; }
.dx .sd-item .sd-n.is-blue { color: var(--blue); font-weight: 500; }
.dx.dx .green-t { color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.dx .nx-k { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--k); }

/* ---------------- Home ---------------- */
.dx .pg-home { max-width: 1120px; }
.dx .hm-head { margin-bottom: 40px; }
.dx .hm-head h1 { margin: 0; font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -.022em; }
.dx .hm-sum { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }
.dx .hm { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.dx .hm-h { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-3); }
.dx .hm-hr { display: flex; align-items: baseline; justify-content: space-between; margin: 48px 0 10px; }
.dx .hm-hr .hm-h { margin: 0; }
.dx .todo { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dx .td { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.dx .td-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--ink-2); }
.dx .td-amber .td-i { background: color-mix(in srgb, var(--amber) 14%, var(--canvas)); color: var(--amber); }
.dx .td-b { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dx .td-b b { font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .td-b span { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .td-due { min-width: 84px; text-align: right; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dx .td-due.red { color: var(--red); font-weight: 500; } .dx .td-due.amber { color: var(--amber); }
.dx .td-a { justify-self: end; }
.dx .nx { border-top: 1px solid var(--line); }
.dx .nx-r { width: 100%; display: grid; grid-template-columns: 56px 10px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-family: var(--font-ui); cursor: pointer; border-radius: 0; }
.dx .nx-r:hover { background: var(--hover); }
.dx .nx-d { display: flex; flex-direction: column; line-height: 1.25; }
.dx .nx-d b { font-size: 13px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.dx .nx-d span { font-size: 11.5px; color: var(--ink-3); }
.dx .nx-t { min-width: 0; display: flex; flex-direction: column; }
.dx .nx-t b { font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .nx-t span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .hm-side { position: sticky; top: 24px; }
.dx .hm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: 36px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); }
.dx .hm-stats a { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--canvas); transition: background .1s; }
.dx .hm-stats a:hover { background: var(--hover); }
.dx .hm-stats span { font-size: 12px; color: var(--ink-3); }
.dx .hm-stats b { font-size: 22px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.dx .rc { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.dx .rc a { display: flex; flex-direction: column; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.dx .rc a:hover b { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.dx .rc b { font-size: 13.5px; }
.dx .rc span { font-size: 12.5px; color: var(--ink-3); }
.dx .rc em { font-style: normal; }
.dx .rc small { font-size: 11.5px; color: var(--ink-4); }

/* ---------------- Contracts: signals, owners, selection ---------------- */
.dx .sigs { display: flex; flex-wrap: wrap; gap: 4px; }
.dx .sig { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--hover-2); font-size: 11.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.dx .sig-red { background: color-mix(in srgb, var(--red) 10%, transparent); color: var(--red); }
.dx .sig-amber { background: color-mix(in srgb, var(--amber) 13%, transparent); color: var(--amber); }
.dx a.sig:hover { filter: brightness(.95); }
.dx .own { display: inline-flex; align-items: center; gap: 7px; padding: 2px 8px 2px 2px; border: 0; border-radius: 20px; background: none; font: 13px var(--font-ui); color: var(--ink-2); cursor: pointer; }
.dx .own:hover { background: var(--hover-2); color: var(--ink); }
.dx .own-sm { padding: 1px 6px 1px 1px; font-size: 13px; }
.dx .facts dd .own-sm { padding: 0 4px; margin-right: -4px; }
.dx .tbl tr.is-sel td { background: color-mix(in srgb, var(--blue) 6%, var(--canvas)); }
.dx .tbl .ra { white-space: nowrap; }
.dx .tbl .ra .btn { opacity: 0; transition: opacity .12s; }
.dx .tbl tr:hover .ra .btn, .dx .tbl tr.is-urgent .ra .btn, .dx .tbl .ra .btn:focus-visible { opacity: 1; }
.dx .tbl .ra .btn + .btn { margin-left: 6px; }
.dx .sec-tight { margin-top: 36px; }

/* ---------------- banner (newer version waiting) ---------------- */
.dx .banner { display: flex; align-items: center; gap: 12px; margin: -8px 0 24px; padding: 12px 14px 12px 16px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--amber) 28%, var(--line)); background: color-mix(in srgb, var(--amber) 8%, var(--canvas)); font-size: 13.5px; color: var(--ink-2); }
.dx .banner > .ic { color: var(--amber); }
.dx .banner > div { flex: 1; min-width: 0; }
.dx .banner b { color: var(--ink); font-weight: 600; }
/* the reader's own contract, analysed in Sentinel: a draft until they mark it signed (clm.js liveBanner) - said calmly, it is every document's
   first state; and the Calendar's and Obligations' word on where a draft's dates are (draftsNote) */
.dx .banner-live { border-color: var(--line); background: var(--canvas); }
.dx .banner-live > .ic { color: var(--ink-3); }
.dx .live-note { margin: -4px 0 14px; }
.dx .live-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------------- sheet: the one place workflows happen ---------------- */
.dx .sheet-wrap { position: fixed; inset: 0; background: rgba(15, 18, 22, .28); animation: dx-fade .15s both; }
.dx .sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); display: flex; flex-direction: column; background: var(--canvas); box-shadow: var(--shadow); animation: sh-in .25s var(--ease) both; }
@keyframes sh-in { from { transform: translateX(24px); opacity: 0; } }
.dx .sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 16px 24px; border-bottom: 1px solid var(--line); }
.dx .sheet-h h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.dx .sheet-b { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.dx .sheet-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); }
.dx .sh-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.dx .sh-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dx .sh-facts > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--hover); }
.dx .sh-facts span { font-size: 12px; color: var(--ink-3); }
.dx .sh-facts b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; }
.dx .sh-facts b.red { color: var(--red); } .dx .sh-facts b.amber { color: var(--amber); }
.dx .fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dx .fld > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.dx .fld input, .dx .fld select { height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--canvas); font: 14px var(--font-ui); color: var(--ink); outline: 0; min-width: 0; }
.dx .fld input:focus, .dx .fld select:focus { border-color: var(--ink-4); box-shadow: 0 0 0 3px var(--hover); }
.dx .fld.is-err input { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 12%, transparent); }
.dx .fld-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dx .fld-opts { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; }
.dx .fld-opts legend { margin-bottom: 8px; padding: 0; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.dx .fld-opts label { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .12s, background .12s; }
.dx .fld-opts label:has(input:checked) { border-color: var(--ink-4); background: var(--hover); }
.dx .fld-opts input { margin: 3px 0 0; accent-color: var(--ink); }
.dx .fld-opts span { display: flex; flex-direction: column; gap: 1px; }
.dx .fld-opts b { font-size: 13.5px; font-weight: 500; }
.dx .fld-opts small { font-size: 12px; color: var(--ink-3); }
.dx .letter { padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); font: 15px/1.7 var(--serif); color: var(--ink-2); outline: 0; }
.dx .letter:focus { border-color: var(--ink-4); }
.dx .letter p { margin: 0 0 12px; }
.dx .letter p:last-child { margin: 0; }
.dx .letter-re { font-weight: 600; color: var(--ink); }

/* ---------------- notifications ---------------- */
.dx .tb-bell { position: relative; }
.dx .bell-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--canvas); }
.dx .notif { position: fixed; width: 380px; max-width: calc(100vw - 24px); padding: 6px; background: var(--canvas); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); animation: dx-pop .15s var(--ease) both; }
.dx .notif-h { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dx .notif-h b { font-size: 14px; font-weight: 600; }
.dx .notif-h span { font-size: 12px; color: var(--ink-3); }
.dx .notif-r { position: relative; display: flex; gap: 12px; padding: 10px 28px 10px 12px; border-radius: 8px; }
.dx .notif-r:hover { background: var(--hover); }
.dx .notif-i { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); color: var(--ink-2); }
.dx .notif-t { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.dx .notif-t small { font-size: 12px; color: var(--ink-3); }
.dx .notif-r.is-new .notif-t { color: var(--ink); }
.dx .notif-r.is-new::after { content: ""; position: absolute; right: 12px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }

/* ---------------- playbook ---------------- */
.dx .plb { display: flex; flex-direction: column; gap: 14px; }
.dx .plb-r { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; }
.dx .plb-h { display: flex; align-items: center; gap: 10px; }
.dx .plb-h b { font-size: 15px; font-weight: 600; }
.dx .plb-v { margin-left: auto; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.dx .plb-v0 { color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.dx .plb-v1, .dx .plb-v2 { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.dx .plb-v3 { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.dx .plb-lad { list-style: none; margin: 18px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dx .plb-lad li { position: relative; padding-top: 20px; font-size: 12px; color: var(--ink-3); cursor: help; }
.dx .plb-lad li::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line-2); }
.dx .plb-lad li:last-child::before { right: 100%; }
.dx .plb-lad li i { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--canvas); border: 2px solid var(--line-2); box-sizing: border-box; }
.dx .plb-lad li.is-past i { border-color: var(--ink-4); }
.dx .plb-lad li.is-past::before { background: var(--ink-4); }
.dx .plb-lad li.is-here i { background: var(--ink); border-color: var(--ink); }
.dx .plb-lad li.is-here.is-walk i { background: var(--red); border-color: var(--red); }
.dx .plb-lad li.is-here span { color: var(--ink); font-weight: 600; }
.dx .plb-lad li.is-walk span { color: color-mix(in srgb, var(--red) 70%, var(--ink-3)); }
.dx .plb-t { margin: 0 0 12px; padding-left: 12px; border-left: 2px solid var(--line-2); font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.dx .plb-ask { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--hover); }
.dx .plb-ask span:first-child { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.dx .plb-ask .serif { font-size: 14px; line-height: 1.6; color: var(--ink); }
.dx .plb-who { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }

/* ---------------- palette ---------------- */
.dx .pal-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .pal-m { margin-left: auto; max-width: 45%; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx .pal-jump { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dx .pal-row .fi { width: 18px; height: 22px; }
.dx .pal-row .fi i { display: none; }

/* ---------------- not found ---------------- */
.dx .nf { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 96px 0; text-align: center; color: var(--ink-3); }
.dx .nf b { font-size: 16px; color: var(--ink); }
.dx .nf .btn { margin-top: 12px; }

@container main (max-width: 980px) {
  .dx .hm { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .dx .hm-side { position: static; }
}
@container main (max-width: 640px) {
  .dx .td { grid-template-columns: 34px minmax(0, 1fr); }
  .dx .td-due { grid-column: 2; text-align: left; min-width: 0; }
  .dx .td-a { grid-column: 2; justify-self: start; }
  .dx .fld-2, .dx .sh-facts { grid-template-columns: minmax(0, 1fr); }
  .dx .plb-lad span { font-size: 11px; }
}
