/* =====================================================================
   Legal Desk — portfolio board of every open legal / contract-paper
   request across the portfolio. Visual system ported verbatim from the
   approved mock-up (its OWN light design language — Newsreader / Public
   Sans / IBM Plex Mono, teal accent) and is deliberately independent of
   the main dashboard's zoom:0.8 / #2B5FD9 / Inter chrome.

   EVERY selector is scoped under #legalDeskView, every class is ld-*, and
   every custom property is --ld-* declared on the view root (never :root)
   so nothing — not even --accent — leaks into or out of the shared
   dashboard. Shared components rendered inside the view (.btn,
   .loading-spinner) intentionally keep the dashboard's own tokens.
   ===================================================================== */
/* Fonts (Newsreader / Public Sans / IBM Plex Mono) load via a <link> in index.html's
   <head> — a render-blocking @import here delayed first paint. Keep them in sync. */

#legalDeskView {
    /* The dashboard body renders at zoom:0.8 (styles.css) for density; the Legal Desk
       was designed at 100% (standalone mockup). Counter-scale 1.25 → net 0.8×1.25 = 1.0
       so this tab matches the mockup's true size instead of appearing 20% shrunk. */
    zoom: 1.25;

    --ld-paper: #F7F7F4;
    --ld-surface: #FFFFFF;
    --ld-surface-2: #FBFBF9;
    --ld-ink: #16181C;
    --ld-ink-2: #4A5059;
    --ld-ink-3: #7E848E;
    --ld-rule: #E2E3DE;
    --ld-rule-2: #EFEFEB;
    --ld-accent: #1D4E5F;
    --ld-accent-soft: #E6EFF1;
    --ld-legal: #2C5FA8;  --ld-legal-soft: #E9EFF9;
    --ld-ours: #A05610;   --ld-ours-soft: #FBF0E1;
    --ld-cust-ink: #5D636D; --ld-cust-soft: #EEEFF1;
    --ld-done: #2A6E4B;   --ld-done-soft: #E5F1EA;
    --ld-alert: #A62A20;  --ld-alert-soft: #FAEBE9;
    --ld-font-display: "Newsreader", Georgia, "Times New Roman", serif;
    --ld-font-ui: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --ld-font-data: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    background: var(--ld-paper);
    color: var(--ld-ink);
    font-family: var(--ld-font-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    min-height: 100%;
}
#legalDeskView * { box-sizing: border-box; }

/* Full-screen: the board fills the viewport width instead of floating in a
   1360px column with large empty gutters on wide monitors. The sticky
   .ld-filters bleed (margin-inline:-24px / padding-inline:24px) stays in step
   with this gutter, and the table's own overflow-x keeps it scrollable. */
.ld-wrap { max-width: none; margin: 0 auto; padding-inline: 24px; padding-block: 0 56px; }

/* ---------- masthead ---------- */
#legalDeskView .ld-masthead { padding-block: 22px 16px; display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; justify-content: space-between; }
#legalDeskView .ld-brand { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
#legalDeskView .ld-eyebrow { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; }
#legalDeskView .ld-h1 { font-family: var(--ld-font-display); font-weight: 500; font-size: 34px; line-height: 1.05; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
#legalDeskView .ld-sub { color: var(--ld-ink-2); font-size: 13px; max-width: 64ch; margin: 0; }
#legalDeskView .ld-stamp { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-family: var(--ld-font-data); font-size: 11px; color: var(--ld-ink-3); border: 1px solid var(--ld-rule); border-radius: 999px; padding: 6px 12px; background: var(--ld-surface); }
#legalDeskView .ld-stamp b { color: var(--ld-done); font-weight: 500; letter-spacing: .04em; }
#legalDeskView .ld-refresh { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; border: 1px solid var(--ld-rule); background: var(--ld-surface); color: var(--ld-accent); border-radius: 8px; padding: 7px 13px; }
#legalDeskView .ld-refresh:hover { background: var(--ld-accent-soft); }
#legalDeskView .ld-refresh:disabled { opacity: .5; cursor: default; }

/* ---------- filters ---------- */
#legalDeskView .ld-filters {
    position: sticky; top: 0; z-index: 40;
    background: color-mix(in srgb, var(--ld-paper) 90%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--ld-rule); border-bottom: 1px solid var(--ld-rule);
    margin-inline: -24px; padding-inline: 24px; padding-block: 12px;
    display: flex; flex-direction: column; gap: 11px;
}
#legalDeskView .ld-frow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-width: 0; }
#legalDeskView .ld-flabel { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; margin-right: 2px; }
#legalDeskView .ld-seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--ld-surface); border: 1px solid var(--ld-rule); border-radius: 9px; padding: 3px; }
#legalDeskView .ld-seg button { font: inherit; font-size: 13px; font-weight: 500; color: var(--ld-ink-2); background: none; border: 0; border-radius: 6px; padding: 6px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: background .12s ease, color .12s ease; }
#legalDeskView .ld-seg button:hover { background: var(--ld-rule-2); color: var(--ld-ink); }
#legalDeskView .ld-seg button[aria-pressed="true"] { background: var(--ld-accent); color: #fff; }
#legalDeskView .ld-seg button .ld-n { font-family: var(--ld-font-data); font-size: 11px; font-variant-numeric: tabular-nums; background: var(--ld-rule-2); color: var(--ld-ink-2); border-radius: 4px; padding: 1px 5px; }
#legalDeskView .ld-seg button[aria-pressed="true"] .ld-n { background: rgba(255,255,255,.22); color: #fff; }

#legalDeskView .ld-select, #legalDeskView .ld-search input {
    font: inherit; font-size: 13px; color: var(--ld-ink); background: var(--ld-surface);
    border: 1px solid var(--ld-rule); border-radius: 8px; padding: 8px 11px; max-width: 100%;
}
#legalDeskView .ld-select { appearance: none; padding-right: 30px; cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%237E848E' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center; }
#legalDeskView .ld-search { position: relative; flex: 1 1 220px; min-width: 0; max-width: 340px; }
#legalDeskView .ld-search input { width: 100%; padding-left: 32px; }
#legalDeskView .ld-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
#legalDeskView .ld-select:focus-visible, #legalDeskView .ld-search input:focus-visible,
#legalDeskView .ld-seg button:focus-visible, #legalDeskView .ld-chip:focus-visible,
#legalDeskView .ld-wl input:focus-visible, #legalDeskView .ld-wl select:focus-visible,
#legalDeskView .ld-cm-compose textarea:focus-visible,
#legalDeskView .ld-tablewrap tr:focus-visible { outline: 2px solid var(--ld-accent); outline-offset: 2px; }

#legalDeskView .ld-chip { font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; border: 1px solid var(--ld-rule); background: var(--ld-surface); color: var(--ld-ink-2); border-radius: 999px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 7px; transition: border-color .12s ease, background .12s ease; white-space: nowrap; }
#legalDeskView .ld-chip:hover { border-color: var(--ld-ink-3); }
#legalDeskView .ld-chip .ld-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
#legalDeskView .ld-chip .ld-n { font-family: var(--ld-font-data); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ld-ink-3); }
#legalDeskView .ld-chip[aria-pressed="true"] { background: var(--ld-ink); border-color: var(--ld-ink); color: #fff; }
#legalDeskView .ld-chip[aria-pressed="true"] .ld-n { color: rgba(255,255,255,.7); }
#legalDeskView .ld-linkbtn { font: inherit; font-size: 12.5px; background: none; border: 0; color: var(--ld-accent); cursor: pointer; padding: 6px 2px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
#legalDeskView .ld-linkbtn[hidden] { display: none !important; }

/* ---------- summary ---------- */
#legalDeskView .ld-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--ld-rule); border: 1px solid var(--ld-rule); border-radius: 12px; overflow: hidden; margin-top: 22px; }
#legalDeskView .ld-tile { background: var(--ld-surface); padding: 15px 16px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#legalDeskView .ld-tile .ld-k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; }
#legalDeskView .ld-tile .ld-v { font-size: 30px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
#legalDeskView .ld-tile .ld-m { font-size: 11.5px; color: var(--ld-ink-3); }
#legalDeskView .ld-tile.is-ours .ld-v { color: var(--ld-ours); }
#legalDeskView .ld-tile.is-alert .ld-v { color: var(--ld-alert); }

/* ---------- breakdown ---------- */
#legalDeskView .ld-panel { background: var(--ld-surface); border: 1px solid var(--ld-rule); border-radius: 12px; margin-top: 16px; }
#legalDeskView .ld-panel-hd { padding: 14px 16px 12px; border-bottom: 1px solid var(--ld-rule-2); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
#legalDeskView .ld-panel-hd h2 { font-size: 13px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
#legalDeskView .ld-panel-hd .ld-note { font-size: 11.5px; color: var(--ld-ink-3); }
#legalDeskView .ld-bars { padding: 13px 16px 16px; display: grid; grid-template-columns: minmax(120px, 210px) 1fr 38px; gap: 7px 12px; align-items: center; }
#legalDeskView .ld-bl { font-size: 12.5px; color: var(--ld-ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#legalDeskView .ld-bt { height: 9px; background: var(--ld-rule-2); border-radius: 3px; overflow: hidden; }
#legalDeskView .ld-bt i { display: block; height: 100%; background: var(--ld-accent); border-radius: 3px; }
#legalDeskView .ld-bn { font-family: var(--ld-font-data); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ld-ink-2); text-align: right; }

/* ---------- table ---------- */
#legalDeskView .ld-tablewrap { overflow-x: auto; border: 1px solid var(--ld-rule); border-radius: 12px; background: var(--ld-surface); margin-top: 16px; }
#legalDeskView .ld-tablewrap table { border-collapse: collapse; width: 100%; min-width: 1020px; }
#legalDeskView .ld-tablewrap thead th { text-align: left; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--ld-rule); background: var(--ld-surface-2); white-space: nowrap; position: sticky; top: 0; z-index: 2; }
#legalDeskView .ld-tablewrap thead th.ld-sortable { cursor: pointer; user-select: none; }
#legalDeskView .ld-tablewrap thead th.ld-sortable:hover { color: var(--ld-ink); }
#legalDeskView .ld-tablewrap thead th .ld-arrow { opacity: 0; font-size: 9px; margin-left: 3px; }
#legalDeskView .ld-tablewrap thead th[data-dir] .ld-arrow { opacity: 1; }
#legalDeskView .ld-tablewrap tbody tr { border-bottom: 1px solid var(--ld-rule-2); cursor: pointer; transition: background .1s ease; }
#legalDeskView .ld-tablewrap tbody tr:last-child { border-bottom: 0; }
#legalDeskView .ld-tablewrap tbody tr:hover { background: var(--ld-surface-2); }
#legalDeskView .ld-tablewrap tbody tr.ld-flagged { box-shadow: inset 3px 0 0 var(--ld-alert); }
#legalDeskView .ld-tablewrap td { padding: 12px 14px; vertical-align: top; }
#legalDeskView .ld-tablewrap td.ld-num { font-family: var(--ld-font-data); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
#legalDeskView .ld-tid { font-family: var(--ld-font-data); font-size: 11.5px; color: var(--ld-ink-3); letter-spacing: -.01em; }
#legalDeskView .ld-cust { font-weight: 600; font-size: 13.5px; letter-spacing: -.005em; display: block; }
#legalDeskView .ld-meta { font-size: 11.5px; color: var(--ld-ink-3); margin-top: 2px; }
#legalDeskView .ld-type { font-size: 12.5px; color: var(--ld-ink-2); }
#legalDeskView .ld-next { font-size: 12.5px; color: var(--ld-ink-2); max-width: 32ch; display: block; }
#legalDeskView .ld-due { font-family: var(--ld-font-data); font-size: 11px; color: var(--ld-ink-3); margin-top: 3px; display: block; }
#legalDeskView .ld-due.late { color: var(--ld-alert); font-weight: 500; }

#legalDeskView .ld-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px 4px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
#legalDeskView .ld-pill .ld-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
#legalDeskView .ld-p-legal { background: var(--ld-legal-soft); color: var(--ld-legal); }
#legalDeskView .ld-p-legal .ld-dot { background: var(--ld-legal); }
#legalDeskView .ld-p-ours { background: var(--ld-ours-soft); color: var(--ld-ours); }
#legalDeskView .ld-p-ours .ld-dot { background: var(--ld-ours); }
#legalDeskView .ld-p-cust { background: var(--ld-cust-soft); color: var(--ld-cust-ink); }
#legalDeskView .ld-p-cust .ld-dot { background: var(--ld-cust-ink); }
#legalDeskView .ld-p-done { background: var(--ld-done-soft); color: var(--ld-done); }
#legalDeskView .ld-p-done .ld-dot { background: var(--ld-done); }

#legalDeskView .ld-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: 4px; padding: 2px 6px; margin-top: 5px; }
#legalDeskView .ld-tag-alert { background: var(--ld-alert-soft); color: var(--ld-alert); }
#legalDeskView .ld-tag-quiet { background: var(--ld-rule-2); color: var(--ld-ink-3); }

#legalDeskView .ld-access { font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; border: 0; background: none; color: var(--ld-ink-3); border-radius: 7px; padding: 0; display: inline-flex; align-items: center; gap: 6px; }

#legalDeskView .ld-empty { padding: 52px 20px; text-align: center; color: var(--ld-ink-3); }
#legalDeskView .ld-empty strong { display: block; color: var(--ld-ink); font-size: 15px; font-weight: 600; margin-bottom: 5px; }
#legalDeskView .ld-err { color: var(--ld-alert); }

/* ---------- drawer ---------- */
#legalDeskView .ld-scrim { position: fixed; inset: 0; background: rgba(22,24,28,.34); z-index: 1200; }
#legalDeskView .ld-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(470px, 100%); z-index: 1201;
    background: var(--ld-surface); border-left: 1px solid var(--ld-rule);
    display: flex; flex-direction: column;
}
#legalDeskView .ld-dhd { padding: 18px 20px 14px; border-bottom: 1px solid var(--ld-rule); display: flex; gap: 14px; align-items: flex-start; }
#legalDeskView .ld-dg { min-width: 0; flex: 1; }
#legalDeskView .ld-dhd h3 { font-family: var(--ld-font-display); font-weight: 500; font-size: 22px; margin: 4px 0 0; letter-spacing: -.01em; line-height: 1.15; }
#legalDeskView .ld-x { font: inherit; background: none; border: 1px solid var(--ld-rule); border-radius: 7px; width: 30px; height: 30px; cursor: pointer; color: var(--ld-ink-2); flex-shrink: 0; display: grid; place-items: center; font-size: 16px; line-height: 1; }
#legalDeskView .ld-x:hover { background: var(--ld-rule-2); }
#legalDeskView .ld-dbody { overflow-y: auto; padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 16px; }
#legalDeskView .ld-dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--ld-rule); border: 1px solid var(--ld-rule); border-radius: 10px; overflow: hidden; }
#legalDeskView .ld-dgrid > div { background: var(--ld-surface); padding: 10px 12px; min-width: 0; }
#legalDeskView .ld-dgrid dt { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; margin: 0 0 3px; }
#legalDeskView .ld-dgrid dd { margin: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
#legalDeskView .ld-dgrid dd.n { font-family: var(--ld-font-data); font-variant-numeric: tabular-nums; font-size: 12.5px; }
#legalDeskView .ld-dsec h4 { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; margin: 0 0 6px; }
#legalDeskView .ld-dsec p { margin: 0; font-size: 13px; color: var(--ld-ink-2); line-height: 1.55; }
#legalDeskView .ld-callout { border: 1px solid var(--ld-rule); border-left: 3px solid var(--ld-accent); background: var(--ld-surface-2); border-radius: 0 9px 9px 0; padding: 11px 13px; }
#legalDeskView .ld-callout.warn { border-left-color: var(--ld-alert); background: var(--ld-alert-soft); border-color: #F0D8D5; }
#legalDeskView .ld-callout p { color: var(--ld-ink); margin: 0; font-size: 13px; line-height: 1.5; }

/* matched renewal block + preserved write-back actions */
#legalDeskView .ld-match { border: 1px solid var(--ld-accent-soft); background: var(--ld-accent-soft); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
#legalDeskView .ld-match .ld-mr { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; }
#legalDeskView .ld-match .ld-mr span { color: var(--ld-ink-3); text-transform: uppercase; letter-spacing: .06em; font-size: 10px; font-weight: 600; align-self: center; }
#legalDeskView .ld-match .ld-mr b { font-weight: 600; text-align: right; }
#legalDeskView .ld-flow-btn { margin-top: 4px; width: 100%; }

#legalDeskView .ld-write { padding-top: 14px; border-top: 1px solid var(--ld-rule); display: flex; flex-direction: column; gap: 10px; }
#legalDeskView .ld-write h4 { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ld-ink-3); font-weight: 600; margin: 0; }
#legalDeskView .ld-wl { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--ld-ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
#legalDeskView .ld-wl select, #legalDeskView .ld-wl input { font-family: var(--ld-font-ui); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ld-ink); background: var(--ld-surface); border: 1px solid var(--ld-rule); border-radius: 8px; padding: 8px 10px; }
#legalDeskView .ld-write-hint { font-size: 11.5px; color: var(--ld-ink-3); line-height: 1.45; }
#legalDeskView .ld-write-ro { padding-top: 14px; border-top: 1px solid var(--ld-rule); font-size: 12px; color: var(--ld-ink-3); font-style: italic; }

/* ── AI status summary ("Where we are at") ───────────────────────────── */
#legalDeskView .ld-sumsec { border: 1px solid var(--ld-accent-soft); border-left: 3px solid var(--ld-accent); background: var(--ld-accent-soft); border-radius: 0 10px 10px 0; padding: 12px 14px; }
#legalDeskView .ld-sumhd { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
#legalDeskView .ld-sumhd h4 { margin: 0; }
#legalDeskView .ld-sumsec .ld-refresh { padding: 4px 9px; font-size: 11.5px; }
#legalDeskView .ld-sum-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
#legalDeskView .ld-sum-list li { font-size: 13px; color: var(--ld-ink); line-height: 1.5; }
#legalDeskView .ld-sum-empty { margin: 0; font-size: 12.5px; color: var(--ld-ink-3); font-style: italic; line-height: 1.5; }

/* ── Comment thread + composer (internal legal-intake collaboration) ──── */
#legalDeskView .ld-cm-thread { display: flex; flex-direction: column; gap: 8px; }
#legalDeskView .ld-cm { border: 1px solid var(--ld-rule); background: var(--ld-surface-2); border-radius: 10px; padding: 10px 12px; }
#legalDeskView .ld-cm-ai { border-left: 3px solid var(--ld-accent); border-radius: 0 10px 10px 0; }
#legalDeskView .ld-cm-human { border-left: 3px solid var(--ld-ink-3); border-radius: 0 10px 10px 0; }
#legalDeskView .ld-cm-meta { font-family: var(--ld-font-data); font-size: 11px; color: var(--ld-ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
#legalDeskView .ld-cm-text { font-size: 13px; color: var(--ld-ink); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
#legalDeskView .ld-cm-empty { margin: 0; font-size: 12.5px; color: var(--ld-ink-3); font-style: italic; }
#legalDeskView .ld-cm-compose { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ld-rule); display: flex; flex-direction: column; gap: 10px; }
#legalDeskView .ld-cm-compose textarea { font-family: var(--ld-font-ui); font-size: 13px; color: var(--ld-ink); background: var(--ld-surface); border: 1px solid var(--ld-rule); border-radius: 8px; padding: 8px 10px; resize: vertical; min-height: 64px; width: 100%; box-sizing: border-box; }
#legalDeskView .ld-cm-compose .btn { align-self: flex-start; }

#legalDeskView .ld-dfoot { border-top: 1px solid var(--ld-rule); padding: 14px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--ld-surface-2); }
#legalDeskView .ld-dfoot .ld-access { justify-content: center; }
#legalDeskView .ld-dfoot .ld-hint { font-size: 11.5px; color: var(--ld-ink-3); text-align: center; }
#legalDeskView .ld-dfoot .ld-legal-link { font: inherit; font-size: 12.5px; font-weight: 600; text-align: center; color: var(--ld-accent); text-decoration: underline; text-underline-offset: 3px; }

#legalDeskView .ld-foot { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--ld-rule); font-size: 11.5px; color: var(--ld-ink-3); display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

@media (max-width: 900px) {
    #legalDeskView .ld-summary { grid-template-columns: repeat(2, 1fr); }
    #legalDeskView .ld-summary .ld-tile:nth-child(5) { grid-column: 1 / -1; }
    #legalDeskView .ld-h1 { font-size: 28px; }
}
@media (max-width: 560px) {
    #legalDeskView .ld-bars { grid-template-columns: 1fr 34px; gap: 4px 10px; }
    #legalDeskView .ld-bt { grid-column: 1 / -1; order: 3; margin-bottom: 6px; }
    #legalDeskView .ld-summary { grid-template-columns: 1fr 1fr; }
    #legalDeskView .ld-tile .ld-v { font-size: 26px; }
}

/* ---------- lifecycle timeline bar ("time in each state") ---------- */
/* A color-coded segmented bar under the Next-step cell: one segment per state
   the ticket passed through, width ∝ business-days spent there, so it reads as
   a true duration slider. Colours come from the Legal Desk light palette. */
#legalDeskView .ld-tl { position: relative; display: block; margin-top: 6px; }
#legalDeskView .ld-tl-bar { display: flex; gap: 1.5px; height: 7px; width: 100%; max-width: 32ch; border-radius: 4px; overflow: hidden; background: var(--ld-rule-2); }
#legalDeskView .ld-tl-seg { height: 100%; min-width: 2px; transition: opacity .1s ease; }
#legalDeskView .ld-tl-bar:hover .ld-tl-seg { opacity: .88; }
/* Breakdown card opens UPWARD, over the rows above, so the table's
   overflow-x:auto scroll box doesn't clip it; per-segment native title
   tooltips are the always-visible fallback (e.g. the very first row). */
#legalDeskView .ld-tl-pop { position: absolute; left: 0; bottom: calc(100% + 7px); z-index: 40; display: none; min-width: 220px; max-width: 300px; padding: 11px 13px 9px; background: var(--ld-surface); border: 1px solid var(--ld-rule); border-radius: 10px; box-shadow: 0 8px 26px rgba(22, 24, 28, .17); cursor: default; }
#legalDeskView .ld-tl:hover .ld-tl-pop { display: block; }
#legalDeskView .ld-tl-pop-h { display: block; font-family: var(--ld-font-ui); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ld-ink-3); margin-bottom: 8px; }
#legalDeskView .ld-tl-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
#legalDeskView .ld-tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
#legalDeskView .ld-tl-lbl { flex: 1 1 auto; font-size: 12px; color: var(--ld-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#legalDeskView .ld-tl-cnt { color: var(--ld-ink-3); font-size: 11px; }
#legalDeskView .ld-tl-bd { flex-shrink: 0; font-family: var(--ld-font-data); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ld-ink-2); }
#legalDeskView .ld-tl-foot { display: block; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--ld-rule-2); font-size: 10.5px; color: var(--ld-ink-3); }
