/* ============================================================
   CLIENT DETAIL - the Client-only surfaces inside the app-wide DetailShell.

   Everything the shell already owns (rail, tab pill, footer, overflow menu,
   cards, the .field / .icf kit, dropdowns, dates, the required / error design)
   lives in detail-view.css and is NOT repeated here. This sheet is only what is
   genuinely Client's: the rail furniture the shell hands back through
   RailExtras, the expiry KPI cards, the document grid and its modal, the case
   notes, the movement table.

   EVERY selector is scoped `#mhDetail` AND prefixed `.cl-`, so it can neither
   leak out of the shell nor collide with Student Detail's `.sd-` vocabulary
   inside it. The two hosts share one id.

   Tokens are the shell's (--ink-*, --brand*, --line, --f-*, --danger*, --r-*,
   --t). Nothing hard-codes a colour that dark mode needs to change.
   ============================================================ */

/* ============================================================
   RAIL EXTRAS - drawn ON the pine rail gradient, so these are the only
   rules in the sheet that use white-alpha rather than the ink tokens.
   ============================================================ */
#mhDetail .cl-railrow{display:grid;grid-template-columns:1fr 1fr;gap:9px}
#mhDetail .cl-railbtn{display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 12px;
  border:1px solid rgba(255,255,255,.18);border-radius:var(--r-md);background:rgba(255,255,255,.08);
  font-family:var(--font-sans);font-size:12.5px;font-weight:700;color:rgba(255,255,255,.92);cursor:pointer;
  transition:background var(--t),border-color var(--t),transform var(--t)}
#mhDetail .cl-railbtn:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.3)}
#mhDetail .cl-railbtn:active{transform:translateY(1px)}
#mhDetail .cl-railbtn .rb-ico{width:17px;height:17px;flex:none;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
#mhDetail .cl-railbtn span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* documents-collected ring */
#mhDetail .cl-health{display:flex;align-items:center;gap:14px}
#mhDetail .cl-ring2{position:relative;width:64px;height:64px;flex:none}
#mhDetail .cl-ring2 svg{width:100%;height:100%;display:block}
#mhDetail .cl-ring2 b{position:absolute;inset:0;display:grid;place-items:center;font-size:14.5px;font-weight:800;color:#fff}
#mhDetail .cl-health .tx{min-width:0}
#mhDetail .cl-health .t{font-size:12.5px;font-weight:700;color:rgba(255,255,255,.92);line-height:1.3}
#mhDetail .cl-health .s{margin-top:3px;font-size:11.5px;font-weight:600;color:rgba(255,255,255,.6)}
#mhDetail .cl-health .s b{color:rgba(255,255,255,.9)}

/* DOCUMENT STATUS - collapsible, the heading is the toggle */
#mhDetail .cl-dswrap{display:flex;flex-direction:column;gap:9px}
#mhDetail .cl-seclab{display:flex;align-items:center;gap:8px;margin:0;font-size:10.5px;font-weight:700;
  letter-spacing:.1em;text-transform:uppercase;color:rgba(255,255,255,.6)}
#mhDetail .cl-secclk{cursor:pointer;user-select:none;transition:color var(--t)}
#mhDetail .cl-secclk:hover{color:rgba(255,255,255,.9)}
#mhDetail .cl-secclk:focus-visible{outline:2px solid rgba(255,255,255,.5);outline-offset:3px;border-radius:4px}
#mhDetail .cl-secword{margin-left:auto;font-size:10.5px;font-weight:800;letter-spacing:.04em;text-transform:none;
  padding:3px 9px;border-radius:999px;white-space:nowrap}
#mhDetail .cl-secword.ok{background:rgba(143,211,180,.18);color:#8FD3B4}
#mhDetail .cl-secword.attn{background:rgba(216,155,61,.2);color:#E9B769}
#mhDetail .cl-secarr{width:14px;height:14px;flex:none;transition:transform var(--t)}
#mhDetail .cl-secarr.open{transform:rotate(90deg)}

#mhDetail .cl-dslist{display:flex;flex-direction:column;gap:8px}
#mhDetail .cl-alert{display:flex;align-items:flex-start;gap:10px;padding:10px 11px;border-radius:var(--r-md);
  background:rgba(255,255,255,.07);box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
#mhDetail .cl-alert.clk{cursor:pointer;transition:background var(--t)}
#mhDetail .cl-alert.clk:hover{background:rgba(255,255,255,.14)}
#mhDetail .cl-alert .ic{width:26px;height:26px;flex:none;display:grid;place-items:center;border-radius:8px;
  background:rgba(255,255,255,.1)}
#mhDetail .cl-alert .ic svg{width:15px;height:15px}
#mhDetail .cl-alert .t{font-size:12.5px;font-weight:700;color:rgba(255,255,255,.94);line-height:1.3}
#mhDetail .cl-alert .s{margin-top:2px;font-size:11px;font-weight:600;color:rgba(255,255,255,.58);line-height:1.35}
/* severity: danger red, warning amber, healthy mint - the SAME three states the
   overview KPI cards use, driven by the one shared classifier. */
#mhDetail .cl-alert.d .ic{background:rgba(192,71,63,.28);color:#F0A9A3}
#mhDetail .cl-alert.w .ic{background:rgba(216,155,61,.26);color:#E9B769}
#mhDetail .cl-alert.ok .ic{background:rgba(143,211,180,.2);color:#8FD3B4}

/* ============================================================
   OVERVIEW - the expiry KPI cards
   ============================================================ */
/* The card is the ORIGINAL vertical KPI tile restored (CEO, Jul 27 2026) - ring on top,
   centred, label / date / status stacked beneath - rebuilt on the detail-shell tokens rather
   than the old #clDetail ones, and scaled UP from the original 70px ring / 14.5px number. */
/* padding-top gives the hover LIFT somewhere to go. `.m-body` is the scroll container, its
   padding-top is 0 and this row is the first thing in it, so the card sits flush on the
   boundary at rest - `transform:translateY(-3px)` on hover pushed the top edge OUT of an
   overflow:auto box and Chrome clipped it, flattening both top corners. 10px clears the lift
   and the upward bleed of the hover shadow. */
#mhDetail .cl-exprow{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;padding-top:10px;margin-bottom:16px}
#mhDetail .cl-exp{position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px;
  padding:22px 16px 19px;background:var(--f-focus-bg);border:1px solid var(--line);border-radius:var(--r-lg);
  cursor:pointer;min-width:0;box-shadow:0 2px 10px rgba(33,58,51,.05);
  transition:border-color var(--t),box-shadow var(--t),transform var(--t),background var(--t)}
#mhDetail .cl-exp:hover{transform:translateY(-3px);border-color:var(--brand-600);box-shadow:0 14px 30px -10px var(--brand-glow)}
#mhDetail .cl-exp:focus-visible{outline:2px solid var(--brand-600);outline-offset:2px}
/* The open-Documents affordance is ALWAYS visible, as in the original - a card you can click
   should say so before you hover it. */
#mhDetail .cl-exp-arrow{position:absolute;top:12px;right:12px;width:28px;height:28px;border-radius:50%;
  border:1.5px solid var(--line);background:var(--f-focus-bg);color:var(--ink-2);display:grid;place-items:center;
  transition:background var(--t),border-color var(--t),color var(--t),transform var(--t)}
#mhDetail .cl-exp-arrow svg{width:14px;height:14px}
#mhDetail .cl-exp:hover .cl-exp-arrow{background:linear-gradient(135deg,var(--dv-rail-a),var(--dv-rail-b));
  border-color:transparent;color:#fff;transform:translate(1px,-1px)}
/* Ring 92px (was 70) and the number 24px (was 14.5) - the CEO asked for the DAYS figure to
   read big, so it is the loudest thing on the card. */
#mhDetail .cl-exp .ring{position:relative;width:92px;height:92px;flex:none}
#mhDetail .cl-exp .ring svg{width:100%;height:100%;display:block}
#mhDetail .cl-exp .rv{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;line-height:1;text-align:center}
#mhDetail .cl-exp .rv b{font-size:24px;font-weight:800;line-height:1;letter-spacing:.2px;color:var(--ink-1);font-variant-numeric:tabular-nums}
#mhDetail .cl-exp .rv span{font-size:9px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-4);line-height:1}
/* the figure itself carries the severity, exactly as the original did */
#mhDetail .cl-exp.x-expired .rv b,#mhDetail .cl-exp.x-danger .rv b{color:var(--danger)}
#mhDetail .cl-exp.x-warn .rv b{color:#A9761F}
#mhDetail .cl-exp.x-none .rv b{font-size:15px;color:var(--ink-4)}
#mhDetail .cl-exp .xm{display:flex;flex-direction:column;align-items:center;min-width:0;width:100%}
#mhDetail .cl-exp .xt{display:flex;align-items:center;justify-content:center;gap:6px;font-size:10.5px;font-weight:800;
  letter-spacing:.075em;text-transform:uppercase;color:var(--ink-3);max-width:100%}
#mhDetail .cl-exp .xt svg{width:14px;height:14px;flex:none;stroke:currentColor}
#mhDetail .cl-exp:hover .xt{color:var(--brand-600)}
#mhDetail .cl-exp .xd{margin-top:8px;font-size:15px;font-weight:800;color:var(--ink-1);font-variant-numeric:tabular-nums}
#mhDetail .cl-exp .xs{margin-top:5px;font-size:11px;font-weight:700;color:var(--ink-3);line-height:1.35}
/* "Valid - N days remaining" is green in the original, and stays green: this is a STATUS
   readout on a KPI tile, not a form field, so it is not covered by the no-green field rule. */
#mhDetail .cl-exp .xs.ok{color:var(--brand-600)}
#mhDetail .cl-exp .xs.bad{color:var(--danger)}
#mhDetail .cl-exp .xs.warn{color:#B4802E}
#mhDetail .cl-exp .xs.none{color:var(--ink-4)}
/* Like the original, the CARD stays on the plain surface - the severity is carried by the
   figure in the ring and by the status line, not by washing the whole tile. Only a border
   tint is kept so an expired document is still findable at a glance across four cards. */
#mhDetail .cl-exp.x-expired,#mhDetail .cl-exp.x-danger{border-color:rgba(192,71,63,.45)}
#mhDetail .cl-exp.x-warn{border-color:rgba(216,155,61,.5)}
#mhDetail .cl-exp.x-none{border-style:dashed}
body.dark #mhDetail .cl-exp .xs.warn{color:#E9B769}
body.dark #mhDetail .cl-exp.x-warn .rv b{color:#E9B769}

#mhDetail .cl-exp-empty{display:flex;align-items:center;gap:14px;padding:18px 20px;margin-bottom:16px;
  border:1px dashed var(--line);border-radius:var(--r-lg);background:var(--f-rest-bg)}
#mhDetail .cl-exp-empty .ic{width:42px;height:42px;flex:none;display:grid;place-items:center;border-radius:var(--r-md);
  background:var(--brand-tint);color:var(--brand-600)}
#mhDetail .cl-exp-empty .ic svg{width:21px;height:21px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}
#mhDetail .cl-exp-empty .t{font-size:13.5px;font-weight:700;color:var(--ink-1)}
#mhDetail .cl-exp-empty .s{margin-top:3px;font-size:12px;font-weight:600;color:var(--ink-3);line-height:1.4}

/* ============================================================
   LIST ROW - enrollments, consents. One shape for both.
   ============================================================ */
#mhDetail .cl-prow{display:flex;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
#mhDetail .cl-prow:last-child{border-bottom:none;padding-bottom:0}
#mhDetail .cl-av{width:36px;height:36px;flex:none;border-radius:11px;display:grid;place-items:center;
  font-size:12px;font-weight:800;color:#fff;letter-spacing:.02em}
#mhDetail .cl-prow .pi{min-width:0;flex:1}
#mhDetail .cl-prow .nm{font-size:14px;font-weight:700;color:var(--ink-1);overflow-wrap:anywhere}
#mhDetail .cl-prow .sub{margin-top:2px;font-size:12px;font-weight:600;color:var(--ink-3)}
#mhDetail .cl-consent-ic{width:36px;height:36px;flex:none;border-radius:11px;display:grid;place-items:center}
#mhDetail .cl-consent-ic svg{width:18px;height:18px}
#mhDetail .cl-consent-ic.on{background:var(--brand-tint);color:var(--brand-600)}
#mhDetail .cl-consent-ic.off{background:var(--f-rest-bg);color:var(--ink-4)}

/* ============================================================
   TIMELINE - key dates, journey history
   ============================================================ */
#mhDetail .cl-tl{position:relative;padding:0 0 18px 22px;border-left:2px solid var(--line);margin-left:6px}
#mhDetail .cl-tl:last-child{border-left-color:transparent;padding-bottom:0}
#mhDetail .cl-tldot{position:absolute;left:-7px;top:2px;width:12px;height:12px;border-radius:50%;
  background:var(--brand-600);box-shadow:0 0 0 3px var(--f-focus-bg)}
#mhDetail .cl-tldot.warn{background:#C97B5A}
#mhDetail .cl-tldot.muted{background:var(--ink-4)}
#mhDetail .cl-tlwhen{font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-4)}
#mhDetail .cl-tlttl{margin-top:4px;font-size:14px;font-weight:700;color:var(--ink-1);overflow-wrap:anywhere}
#mhDetail .cl-tlsub{margin-top:2px;font-size:12px;font-weight:600;color:var(--ink-3)}

/* ============================================================
   TABLE - the movement / audit trail. Scrolls in its OWN box so the
   pane never scrolls sideways.
   ============================================================ */
#mhDetail .cl-tablewrap{margin-top:16px;overflow-x:auto;border:1px solid var(--line);border-radius:var(--r-md)}
#mhDetail .cl-table{width:100%;border-collapse:collapse;font-size:12.5px;min-width:640px}
#mhDetail .cl-table th{position:sticky;top:0;text-align:left;padding:10px 13px;background:var(--f-rest-bg);
  font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);white-space:nowrap}
#mhDetail .cl-table td{padding:11px 13px;border-top:1px solid var(--line);color:var(--ink-2);font-weight:600;vertical-align:top}
#mhDetail .cl-table td.empty{color:var(--ink-4);font-style:italic}

/* ============================================================
   CASE NOTES
   ============================================================ */
#mhDetail .cl-noteadd{position:relative;display:flex;align-items:flex-end;gap:11px;margin-bottom:18px}
#mhDetail .cl-noteadd .icf{flex:1}
#mhDetail .cl-noteadd .ui-btn{flex:none}
#mhDetail .cl-note{padding:13px 0;border-top:1px solid var(--line)}
#mhDetail .cl-note-h{display:flex;align-items:center;gap:9px;margin-bottom:7px}
#mhDetail .cl-note-av{width:28px;height:28px;flex:none;border-radius:50%;display:grid;place-items:center;color:#fff}
#mhDetail .cl-note-av svg{width:16px;height:16px}
#mhDetail .cl-note-who{font-size:13px;font-weight:800;color:var(--ink-1)}
#mhDetail .cl-note-when{margin-left:auto;font-size:11px;font-weight:650;color:var(--ink-4);white-space:nowrap}
#mhDetail .cl-note-b{font-size:13.5px;line-height:1.6;color:var(--ink-2);white-space:pre-wrap;overflow-wrap:anywhere}

/* @-mention picker */
#mhDetail .cl-mentionpop{position:absolute;left:0;bottom:calc(100% + 6px);z-index:60;width:min(320px,100%);
  background:var(--f-focus-bg);border:1px solid var(--f-focus-bd);border-radius:var(--r-md);box-shadow:var(--f-focus-sh);overflow:hidden}
#mhDetail .cl-mentionpop.mh-pop-below{bottom:auto;top:calc(100% + 6px)}
#mhDetail .cl-mentionscroll{max-height:232px;overflow-y:auto;padding:5px}
#mhDetail .cl-mentionopt{display:flex;align-items:center;gap:9px;width:100%;padding:8px 9px;border:none;border-radius:var(--r-sm);
  background:none;cursor:pointer;text-align:left;font-family:var(--font-sans)}
#mhDetail .cl-mentionopt:hover,#mhDetail .cl-mentionopt.on{background:var(--brand-tint)}
#mhDetail .cl-mentionav{width:26px;height:26px;flex:none;border-radius:50%;display:grid;place-items:center;
  font-size:10.5px;font-weight:800;color:#fff}
#mhDetail .cl-mentionnm{font-size:13px;font-weight:700;color:var(--ink-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ============================================================
   DOCUMENTS
   ============================================================ */
#mhDetail .cl-docgrid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}
#mhDetail .cl-doc{display:flex;flex-direction:column;gap:10px;padding:15px 16px;background:var(--f-rest-bg);
  border:1px solid var(--line);border-radius:var(--r-lg);min-width:0}
#mhDetail .cl-doc .dt{display:flex;align-items:center;gap:9px;min-width:0}
#mhDetail .cl-doc .dt .ic{width:30px;height:30px;flex:none;display:grid;place-items:center;border-radius:9px;
  background:var(--brand-tint);color:var(--brand-600)}
#mhDetail .cl-doc .dt .ic svg{width:16px;height:16px}
#mhDetail .cl-doc .dt .nm{font-size:13.5px;font-weight:800;color:var(--ink-1);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mhDetail .cl-doc .dt .exp{margin-left:auto;font-size:8.5px;font-weight:800;letter-spacing:.08em;padding:3px 7px;
  border-radius:999px;background:var(--brand-tint-2);color:var(--brand-600);white-space:nowrap}
#mhDetail .cl-pillst{align-self:flex-start;font-size:11px;font-weight:700;padding:4px 10px;border-radius:999px;white-space:nowrap}
#mhDetail .cl-pillst.ps-ok{background:var(--brand-tint);color:var(--brand-600)}
#mhDetail .cl-pillst.ps-expiring{background:rgba(216,155,61,.2);color:#B4802E}
#mhDetail .cl-pillst.ps-expired{background:var(--danger-bg);color:var(--danger-ink)}
#mhDetail .cl-pillst.ps-missing{background:rgba(40,60,80,.09);color:var(--ink-3)}
#mhDetail .cl-doc .dates{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#mhDetail .cl-doc .dates label{display:block;font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-4)}
#mhDetail .cl-doc .dates b{display:block;margin-top:3px;font-size:12.5px;font-weight:700;color:var(--ink-1)}
#mhDetail .cl-doc .dates b.none{color:var(--ink-4);font-weight:600}
#mhDetail .cl-doc .acts{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:auto;padding-top:4px}
#mhDetail .cl-doc .file{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:700;color:var(--brand-600);
  text-decoration:none;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#mhDetail .cl-doc .file svg{width:13px;height:13px;flex:none;stroke:currentColor;stroke-width:1.8;fill:none}
#mhDetail .cl-doc .file:hover{text-decoration:underline}
#mhDetail .cl-doc .file.none{color:var(--ink-4);font-weight:600}
/* STORED size, beside the file name (CEO, Jul 30 2026). This is what is on disk AFTER the
   browser-side shrink, so it is the number that shows whether compression did its job.
   flex:none so it never squeezes the file name; tabular numerals so a stack of documents
   lines their sizes up. */
#mhDetail .cl-doc .file-size{flex:none;font-size:10.5px;font-weight:800;color:var(--ink-3);
  background:rgba(40,60,80,.07);border-radius:7px;padding:2px 7px;margin-left:8px;
  font-variant-numeric:tabular-nums;white-space:nowrap}
/* Dragging a file OVER the zone - the affordance that was missing entirely, so a drop felt
   like it did nothing before the browser navigated away. */
/* Re-encoding a 1-5 MB scan takes a second or two - the zone says so rather than sitting
   silent, which is how a working feature gets reported as broken. */
#mhDetail .cl-docmodal .drop.busy{border-style:solid;border-color:var(--brand-600);
  background:rgba(46,74,67,.06);color:var(--brand-600)}
#mhDetail .cl-docmodal .drop.busy svg{opacity:.55;animation:docPulse 1s ease-in-out infinite}
@keyframes docPulse{0%,100%{opacity:.35}50%{opacity:.9}}
@media (prefers-reduced-motion:reduce){#mhDetail .cl-docmodal .drop.busy svg{animation:none}}
#mhDetail .cl-docmodal .drop.dragging{border-color:var(--brand-600);border-style:solid;
  background:rgba(46,74,67,.08);color:var(--brand-600)}
/* What the shrink did to the file just picked, under the drop zone in the document modal. */
#mhDetail .cl-docmodal .doc-shrunk{margin:2px 0 8px;font-size:11.5px;font-weight:700;
  color:var(--brand-600);background:rgba(46,74,67,.10);border-radius:8px;padding:7px 10px}
#mhDetail .cl-dbtn{margin-left:auto;height:30px;padding:0 12px;border-radius:var(--r-sm);border:1px solid var(--f-focus-bd);
  background:var(--f-focus-bg);font-family:var(--font-sans);font-size:11.5px;font-weight:700;color:var(--brand-600);cursor:pointer;
  transition:background var(--t),border-color var(--t)}
#mhDetail .cl-dbtn+.cl-dbtn{margin-left:0}
#mhDetail .cl-dbtn:hover{background:var(--brand-tint)}
#mhDetail .cl-dbtn.danger{color:var(--danger)}
#mhDetail .cl-dbtn.danger:hover{background:var(--danger-bg);border-color:rgba(192,71,63,.35)}
#mhDetail .cl-docadd{align-items:center;justify-content:center;gap:9px;border-style:dashed;background:none;cursor:pointer;
  font-family:var(--font-sans);font-size:13px;font-weight:700;color:var(--brand-600);min-height:150px;
  transition:background var(--t),border-color var(--t)}
#mhDetail .cl-docadd:hover{background:var(--brand-tint);border-color:var(--brand-600)}
#mhDetail .cl-docadd .plus{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:var(--brand-tint-2)}
#mhDetail .cl-docadd .plus svg{width:19px;height:19px;stroke:var(--brand-600)}

/* ============================================================
   DOCUMENT MODAL - a host overlay INSIDE the shell, so it is scoped
   #mhDetail (the old rules were scoped #clDetail and would not have
   applied here at all).
   ============================================================ */
#mhDetail .cl-docmodal{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:24px;
  background:rgba(20,30,26,.55);backdrop-filter:blur(3px)}
#mhDetail .cl-docmodal .mbox{width:min(560px,100%);max-height:calc(88 * var(--mh-vh,1vh));display:flex;flex-direction:column;
  background:var(--bg-canvas);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:0 30px 70px rgba(0,0,0,.35);overflow:hidden}
#mhDetail .cl-docmodal .mhead{display:flex;align-items:center;gap:12px;padding:17px 20px;border-bottom:1px solid var(--line)}
#mhDetail .cl-docmodal .mhead h3{margin:0;flex:1;font-size:15px;font-weight:800;color:var(--ink-1)}
#mhDetail .cl-docmodal .x{width:32px;height:32px;flex:none;border:none;border-radius:9px;background:none;cursor:pointer;
  font-size:22px;line-height:1;color:var(--ink-3);transition:background var(--t),color var(--t)}
#mhDetail .cl-docmodal .x:hover{background:rgba(40,60,80,.08);color:var(--ink-1)}
#mhDetail .cl-docmodal .mbody{flex:1;min-height:0;overflow-y:auto;padding:18px 20px;display:flex;flex-direction:column;gap:14px}
#mhDetail .cl-docmodal .mfoot{display:flex;justify-content:flex-end;gap:10px;padding:15px 20px;border-top:1px solid var(--line)}
#mhDetail .cl-docmodal .mfoot .ui-btn{height:42px}
#mhDetail .cl-docmodal .mfld{display:flex;flex-direction:column;gap:7px}
#mhDetail .cl-docmodal .mfld>label{font-size:11.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3)}
#mhDetail .cl-docmodal .star{color:var(--danger)}
/* The raw controls reuse the inset cool shell so the modal matches the field kit. */
#mhDetail .cl-docmodal select,
#mhDetail .cl-docmodal input[type=text],
#mhDetail .cl-docmodal textarea{width:100%;min-height:48px;padding:12px 15px;border-radius:var(--r-md);
  background:var(--f-rest-bg);border:1px solid var(--f-rest-bd);box-shadow:var(--f-rest-sh) inset;
  font-family:var(--font-sans);font-size:14.5px;font-weight:500;color:var(--ink-1);outline:none;transition:background var(--t),border-color var(--t),box-shadow var(--t)}
#mhDetail .cl-docmodal textarea{min-height:84px;resize:vertical;line-height:1.5}
#mhDetail .cl-docmodal select:focus,
#mhDetail .cl-docmodal input[type=text]:focus,
#mhDetail .cl-docmodal textarea:focus{background:var(--f-focus-bg);border-color:var(--f-focus-bd);box-shadow:var(--f-focus-sh)}
#mhDetail .cl-docmodal .bad{border-color:var(--danger);background:var(--danger-bg)}
#mhDetail .cl-docmodal .err{padding:10px 13px;border-radius:var(--r-sm);background:var(--danger-bg);
  font-size:12.5px;font-weight:700;color:var(--danger-ink)}
#mhDetail .cl-docmodal .drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;
  min-height:118px;padding:18px;border:1.5px dashed var(--f-rest-bd);border-radius:var(--r-md);
  background:rgba(255,255,255,.2);font-size:13.5px;font-weight:650;color:var(--ink-3);cursor:pointer;text-align:center;
  transition:border-color var(--t),background var(--t),color var(--t)}
#mhDetail .cl-docmodal .drop:hover{border-color:var(--brand-600);background:var(--f-hover-bg);color:var(--ink-2)}
/* "A file is attached" is a VALUE, not a success state. The field standard has rest, hover,
   focus, error and locked - no green - so the filled state reads as a normal settled field
   (solid border, ink text) instead of painting the whole control brand green. The leading
   icon stays brand, which is what an active .icf icon does anyway. */
#mhDetail .cl-docmodal .drop.has{border-style:solid;border-color:var(--f-focus-bd);background:var(--f-focus-bg);color:var(--ink-1)}
#mhDetail .cl-docmodal .drop svg{width:23px;height:23px;stroke:var(--brand-600);stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
#mhDetail .cl-docmodal .cd-hidden-file{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
#mhDetail .cl-docmodal .note{display:flex;align-items:flex-start;gap:9px;padding:11px 13px;border-radius:var(--r-sm);
  background:var(--brand-tint);font-size:12px;font-weight:650;color:var(--ink-2);line-height:1.45}
#mhDetail .cl-docmodal .note svg{width:16px;height:16px;flex:none;margin-top:1px;stroke:var(--brand-600);stroke-width:2;fill:none}

/* ============================================================
   FIELD NOTE - the one-line plain-English reason under a LOCKED field.
   A greyed field with no explanation reads as broken; with one it reads
   as "this value is owned somewhere else".
   ============================================================ */
#mhDetail .fld-note{margin:6px 0 0;font-size:11.5px;font-weight:600;color:var(--ink-4);line-height:1.4}
#mhDetail .field.locked .fld-note{color:var(--ink-3)}

/* ============================================================
   NARROW (<1100px) - the shell turns the rail into a strip and does not
   draw RailExtras, so Overview re-hosts the ring and the status list. On
   the light card the rail's white-alpha would be invisible, so these
   override back to ink tokens.
   ============================================================ */
#mhDetail .cl-narrowrail .cl-ring2 b{color:var(--ink-1)}
#mhDetail .cl-narrowrail .cl-health .t{color:var(--ink-1)}
#mhDetail .cl-narrowrail .cl-health .s{color:var(--ink-3)}
#mhDetail .cl-narrowrail .cl-health .s b{color:var(--ink-1)}
#mhDetail .cl-narrowrail .cl-dslist{margin-top:15px}
#mhDetail .cl-narrowrail .cl-alert{background:var(--f-rest-bg);box-shadow:inset 0 0 0 1px var(--line)}
#mhDetail .cl-narrowrail .cl-alert.clk:hover{background:var(--f-hover-bg)}
#mhDetail .cl-narrowrail .cl-alert .t{color:var(--ink-1)}
#mhDetail .cl-narrowrail .cl-alert .s{color:var(--ink-3)}
#mhDetail .cl-narrowrail .cl-alert.d .ic{background:var(--danger-bg);color:var(--danger)}
#mhDetail .cl-narrowrail .cl-alert.w .ic{background:rgba(216,155,61,.2);color:#B4802E}
#mhDetail .cl-narrowrail .cl-alert.ok .ic{background:var(--brand-tint);color:var(--brand-600)}

/* ============================================================
   RESPONSIVE - container queries, NOT @media: the app-wide zoom makes
   viewport units lie, so everything here keys off the pane's own width.
   ============================================================ */
@container (max-width:1000px){
  #mhDetail .cl-exprow{grid-template-columns:repeat(2,1fr)}
  #mhDetail .cl-docgrid{grid-template-columns:repeat(2,1fr)}
}
@container (max-width:640px){
  #mhDetail .cl-exprow{grid-template-columns:1fr}
  #mhDetail .cl-docgrid{grid-template-columns:1fr}
  #mhDetail .cl-noteadd{flex-direction:column;align-items:stretch}
}
