/* Loom Estate app helpers over MiddleLeap Product + Estate Slate. Every value a token. */
html, body { height: 100%; }
body { margin: 0; background: var(--app-canvas); color: var(--bone-1); font-family: var(--font-body); }
a { color: var(--ember-text); }
a:hover { color: var(--ember-hover); }
#main:focus { outline: none; }
:where(h2, h3) { font-weight: 600; color: var(--bone-0); }
.le-app { min-height: 100vh; }
.le-muted { color: var(--bone-3); }
.le-soft { color: var(--bone-2); }
.le-fs13 { font-size: var(--fs-small-ui); }
.le-fs14 { font-size: var(--fs-small); }
.le-b { font-weight: 600; }
.le-mono, .le-id { font-family: var(--font-mono); }
.le-id { font-size: var(--fs-ui-small); color: var(--bone-3); }
.le-cards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.le-card-link { display: flex; flex-direction: column; gap: var(--s-2); text-decoration: none; color: inherit; }
.le-card-link:hover { border-color: var(--border-interactive); }
.le-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); }
.le-card-name { font: 600 var(--fs-card-title)/1.3 var(--font-body); color: var(--bone-0); }
.le-card-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--fs-small-ui); color: var(--bone-2); }
.le-xrow-body ul { margin: 0; padding-left: 18px; }
.le-ev { display: inline-flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
.le-empty { padding: var(--s-4); border: 1px dashed var(--app-card-border); border-radius: 8px; color: var(--bone-3); font-size: var(--fs-small-ui); }
.le-foot { box-sizing: border-box; max-width: 1320px; margin: 0 auto; padding: 0 var(--s-5) var(--s-6); color: var(--bone-3); font-size: var(--fs-caption); }
.le-clock { font: 700 var(--fs-stat)/1.1 var(--font-body); color: var(--bone-0); }
.le-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.le-filters .ml-btn { min-height: 36px; }
.le-filters .ml-btn[aria-pressed="true"] { background: var(--bone-0); color: #fff; border-color: var(--bone-0); }
.le-sync { font-size: var(--fs-caption); color: var(--bone-3); }
.le-sync b { color: var(--bone-0); font-weight: 600; }
.le-sync .is-stale { color: var(--caution-text); font-weight: 600; }
.le-phase { display: flex; gap: 4px; }
.le-phase span { flex: 1; height: 6px; border-radius: 3px; background: var(--data-track); }
.le-phase span.done { background: var(--bone-2); }
.le-phase span.now { background: var(--accent-mark); }
.mlp-table td a { color: var(--ember-text); }
.le-scroll { overflow-x: auto; }
.mlp-tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--s-2) 0; color: var(--bone-2); text-decoration: none; font-size: var(--fs-ui-small); }
.mlp-tabbar a[aria-current="page"] { color: var(--bone-0); font-weight: 600; }
.mlp-tabbar svg { width: 22px; height: 22px; }
.le-inset { padding: var(--s-4); background: var(--app-canvas); border: 1px solid var(--app-card-border); border-radius: 8px; }
.mlp-seg a { display: inline-flex; align-items: center; min-height: var(--hit); padding: 0 var(--s-4); border-radius: var(--r-ui); color: var(--bone-2); font: 600 var(--fs-small-ui)/1 var(--font-body); text-decoration: none; }
.mlp-seg a:hover { color: var(--bone-0); }
.mlp-seg a[aria-pressed="true"] { background: var(--app-card); color: var(--bone-0); box-shadow: inset 0 0 0 1px var(--bone-0); }
.le-kvgrid { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; font: 400 var(--fs-small-ui)/1.45 var(--font-body); }
@media (max-width: 560px) { .le-kvgrid { grid-template-columns: minmax(0, 1fr); } }
.le-funnel { display: grid; grid-template-columns: minmax(0, 1.3fr) 32px minmax(0, 1fr); gap: var(--s-3); align-items: center; }
@media (max-width: 600px) { .le-funnel { grid-template-columns: minmax(0, 1fr) 32px; } .le-funnel > .mlp-bar { grid-column: 1 / -1; } }
.le-tag { display: inline-block; margin: 2px 0; background: var(--app-tile); font-size: var(--fs-small-ui); }
.mlp-env.le-env--rehearsal { background: var(--caution-dim); color: var(--caution-text); }
#sync .mlp-seg a { min-height: 32px; padding: 0 var(--s-3); }
/* Phone (EST-007): timelines stack the time above the event. Filter chips wrap (MOB-18), so none
   hides off the edge. */
@media (max-width: 600px) {
  .mlp-event { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mlp-event-when { font-size: var(--fs-ui-small); }
}
/* Stale, never green (EST-019): greens turn grey while Kosli has not been read. */
:root.le-stale:not([data-theme="none"]):not(.x) { --positive: var(--bone-3); --positive-text: var(--bone-2); --positive-dim: var(--app-tile); --data-done: var(--bone-3); }
.mlp-env.le-env--stale { background: var(--caution-dim); color: var(--caution-text); font-weight: 600; }
html.le-stale .mlp-status--positive { background: var(--bone-3); color: #fff; }
/* EST-117: the screens themselves draw stale greens grey (web/ui.js), and every header says so. */
.le-stale-mark { color: var(--caution-text); font-weight: 600; }
.mlp-bar-stale { background: var(--bone-3); }
/* Decisions (EST-040): ask, decide, sign, assess. */
.le-dec { margin-top: var(--s-2); }
.le-dec > summary { cursor: pointer; font-size: var(--fs-small-ui); list-style: none; }
.le-dec > summary::-webkit-details-marker { display: none; }
.le-dec-form { margin-top: var(--s-2); padding: var(--s-3); background: var(--app-tile); border-radius: 8px; max-width: 520px; }
.le-dec-form label { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-small-ui); color: var(--bone-1); }
.le-dec-form label.le-cap { flex-direction: row; align-items: center; gap: var(--s-2); }
.le-dec-form input[type="text"], .le-dec-form input[type="datetime-local"], .le-dec-form select, .le-dec-note { font: inherit; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; color: var(--bone-0); min-width: 0; }
.le-dec-act { margin-top: var(--s-2); flex-wrap: wrap; }
.le-dec-note { flex: 1 1 160px; }
.le-dec-state { margin-top: 4px; }
/* Decisions you can trust (EST-08A): the until day and time, the confirmation in place, the held
   outcome, the decision a link lands on, the sign-off's statements. */
.le-dec-until { margin: 0; padding: 0; border: 0; min-width: 0; }
.le-dec-until legend { padding: 0; margin-bottom: 4px; font-size: var(--fs-small-ui); color: var(--bone-1); }
.le-dec-until .mlp-inline { flex-wrap: wrap; align-items: flex-end; }
.le-dec-until label { flex: 0 1 auto; }
.le-dec-act[hidden] { display: none; }
.le-dec-confirm { margin-top: var(--s-2); padding: var(--s-3); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent-mark); border-radius: 8px; background: var(--app-card); max-width: 620px; }
.le-dec-confirm p { margin: 0; }
.le-dec-confirm .mlp-inline { flex-wrap: wrap; }
.le-dec-err:empty { display: none; }
.le-dec-note[aria-invalid="true"] { border-color: var(--critical, #b42318); box-shadow: 0 0 0 1px var(--critical, #b42318); }
.le-hl, tr.le-hl > td { background: var(--caution-dim); }
.le-hl { box-shadow: inset 3px 0 0 var(--accent-mark); }
tr.le-hl > td:first-child { box-shadow: inset 3px 0 0 var(--accent-mark); }
.le-dec-done { box-shadow: inset 3px 0 0 var(--accent-mark); }
.le-sign-form { max-width: 720px; }
.le-sign-form .le-st { gap: 4px; }
.le-sign-form textarea { box-sizing: border-box; width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 6px; background: #fff; color: var(--bone-0); resize: vertical; }
.le-toast { position: fixed; z-index: 30; left: 50%; bottom: var(--s-5); transform: translateX(-50%); box-sizing: border-box; width: max-content; max-width: min(640px, calc(100vw - 32px)); display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: 8px; background: var(--bone-0); color: #fff; box-shadow: 0 6px 24px rgba(11, 13, 16, .25); font-size: var(--fs-small-ui); }
.le-toast[hidden] { display: none; }
.le-toast--critical { border-left: 4px solid var(--critical, #b42318); }
.le-toast--positive { border-left: 4px solid var(--positive, #1f7a4d); }
.le-toast-t { min-width: 0; overflow-wrap: anywhere; }
.le-toast .le-toast-x { flex: none; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }
.le-me { font-size: var(--fs-caption); color: var(--bone-2); white-space: nowrap; }
.le-me a { color: inherit; }
/* Glossary (EST-081): links from popovers, and the Glossary screen. */
.le-tip-more { display: block; margin-top: 6px; font-weight: 600; }
.le-gl { margin: 0; }
.le-gl-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-2) var(--s-4); padding: var(--s-3) 0; border-top: 1px solid var(--app-card-border); scroll-margin-top: var(--s-6); }
.le-gl-row dt { display: flex; flex-direction: column; gap: 2px; color: var(--bone-0); }
.le-gl-row dd { margin: 0; }
.le-gl-row.is-focus { box-shadow: inset 3px 0 0 #ce451b; padding-left: var(--s-3); background: var(--app-tile); }
.le-gl-group { scroll-margin-top: var(--s-6); }
.le-gl-group > h2 { padding-bottom: var(--s-3); }
.le-gl-q { min-width: 240px; }
@media (max-width: 600px) { .le-gl-row { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); } .le-gl-q { min-width: 0; width: 100%; } }
/* Findings (EST-009): filters by estate, exception state and kind. */
.le-fl { flex: 1 1 200px; min-width: 0; gap: var(--s-1); }

/* Accessibility (EST-082): a skip link for keyboard users, and a visible focus ring on scroll
   regions that take focus because they overflow. */
.le-skip { position: absolute; left: 8px; top: -48px; z-index: 100; padding: 8px 12px; background: var(--surface-card); color: inherit; border: 2px solid currentColor; border-radius: 6px; }
.le-skip:focus { top: 8px; }
.le-scroll:focus-visible, pre:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ---- Phone navigation and header (EST-087) ------------------------------------------------- */
.le-mode, .le-ph-mark, .le-env-short, .le-tab-more, .le-ph-only, .le-sm-only { display: none; }
/* (i): a 44 px hit area around the 24 px icon, without growing it */
.le-tip > summary { position: relative; }
.le-tip > summary::after { content: ""; position: absolute; inset: -10px; }
/* The page heading's (i) stays on the heading's last line (MOB-17): the h1 is inline and keeps
   room for the (i) after its last word; the (i) takes that room back, so it never wraps alone. */
.le-titlerow--h1 { display: block; font: 600 var(--fs-h1)/1.25 var(--font-body); }
.le-titlerow--h1 > .mlp-h1 { display: inline; padding-right: 32px; }
.le-titlerow--h1 > .le-tip { margin-left: -24px; vertical-align: top; top: -1px; }
/* Popovers open upward when there is no room below (MOB-14). */
.le-tip-body.le-tip-body--up { top: auto; bottom: calc(100% + 6px); }
.le-tip-body[style*="max-height"] { overflow-y: auto; }
/* A rail that fits the window stays in view while the page scrolls (MOB-13). */
@media (max-width: 900px) and (min-height: 900px) { .mlp-rail { position: sticky; top: 0; align-self: flex-start; min-height: 100vh; } }

@media (max-width: 600px), (hover: none) and (max-width: 950px) and (max-height: 500px) {
  .mlp-rail { display: none; }
  /* Strip: one line */
  .mlp-env { justify-content: flex-start; padding: 3px var(--s-4); letter-spacing: .04em; }
  .le-env-long { display: none; }
  .le-env-short { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .le-env-reh { font-weight: 700; }
  /* One 48 px bar: the mark, the name, and a Live or Rehearsal pill that explains itself */
  .mlp-topbar { flex-wrap: nowrap; min-height: 48px; padding: 0 var(--s-2) 0 var(--s-4); gap: var(--s-2); }
  .mlp-topbar .mlp-product-by, .mlp-topbar .mlp-product-on, .mlp-topbar .mlp-path, #avail, #sync { display: none; }
  .mlp-product { align-items: center; }
  .le-ph-mark { display: inline-flex; color: var(--bone-0); }
  .le-mode { display: block; margin-left: auto; }
  .le-mode .le-tip > summary { width: auto; height: 44px; padding: 0 var(--s-2); border-radius: 0; background: none; }
  .le-mode .le-tip > summary::after { content: none; }
  .le-ph-only { display: revert; }
  /* Section headings keep their (i) on the last line too */
  .le-titlerow:not(.le-titlerow--h1) { display: block; }
  .le-titlerow:not(.le-titlerow--h1) > :is(h2, h3) { display: inline; padding-right: 32px; }
  .le-titlerow:not(.le-titlerow--h1) > .le-tip { margin-left: -24px; }
  .le-tip-reads { padding-top: 6px; border-top: 1px solid var(--app-card-border); }
  .mlp-page { padding: var(--s-4) var(--s-4) var(--s-6); gap: var(--s-4); }
  .le-paper, .scr-b .le-paper { padding: 0; gap: var(--s-4); }
  .le-foot { padding: 0 var(--s-4) var(--s-5); }
  /* Tab bar: four tabs by role, then More; safe-area padding, not a fixed 24 px */
  .mlp-tabbar.mlp-tabbar--auto { display: grid; position: sticky; bottom: 0; z-index: 5; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 var(--s-1) max(8px, env(safe-area-inset-bottom)); }
  .mlp-tabbar a, .le-tab-more { position: relative; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; padding: 6px 0; color: var(--bone-2); font: 400 var(--fs-ui-small)/1.1 var(--font-body); text-align: center; text-decoration: none; }
  .le-tab-more { width: 100%; border: 0; background: none; cursor: pointer; }
  .le-tab-more svg { width: 22px; height: 22px; }
  .mlp-tabbar a[aria-current="page"], .le-tab-more[aria-current="page"] { color: var(--bone-0); font-weight: 600; }
  .mlp-tabbar a[aria-current="page"]::before, .le-tab-more[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; background: var(--accent-mark); }
  .mlp-tabbar .mlp-count { background: var(--accent-mark); color: #fff; }
  .le-tab-more:focus-visible, .mlp-tabbar a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
  /* 44 px targets (MOB-11) */
  .ml-btn, .le-filters .ml-btn, .mlp-seg a, .mlp-seg button { min-height: var(--hit); }
  /* Phone text (MOB-15): captions at least 13 px, body 15 px */
  :root { --fs-body: 15px; --fs-small: 15px; --fs-small-ui: 14px; --fs-caption: 13px; --fs-ui: 13px; --fs-ui-small: 13px; --fs-ui-micro: 13px; --fs-card-title: 16px; --fs-verdict: 15px; }
  .mlp-status { height: 24px; font-size: 13px; }
  .le-prio { height: 22px; font-size: 13px; }
  .ml-eyebrow, .mlp-note-label, .mlp-option-kicker, .mlp-table th, .mlp-prov, .mlp-prov b, .ml-label, .mlp-sev, .mlp-avail, .le-src > summary, .le-src-ids, .le-notes-btn, .le-demo-k { font-size: 13px; }
  .le-src > summary { height: 28px; }
  .le-tip-body { font-size: 14px; }
}

/* The More sheet: every screen, full height, over the page */
.le-sheet { position: fixed; inset: 0; z-index: 50; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; padding: max(var(--s-3), env(safe-area-inset-top)) var(--s-4) max(var(--s-6), env(safe-area-inset-bottom)); background: var(--app-canvas); color: var(--bone-1); font: 400 15px/1.45 var(--font-body); }
.le-sheet[hidden] { display: none; }
html.le-sheet-on, html.le-sheet-on body { overflow: hidden; }
.le-sheet-head { position: sticky; top: calc(-1 * max(var(--s-3), env(safe-area-inset-top))); z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); margin: 0 calc(-1 * var(--s-4)); padding: var(--s-2) var(--s-4); background: var(--app-canvas); border-bottom: 1px solid var(--app-card-border); }
.le-sheet-x { min-height: var(--hit); }
.le-sheet-h { margin: var(--s-4) 0 var(--s-2); font: 600 13px/1.3 var(--font-body); color: var(--bone-3); }
.le-sheet-list { list-style: none; margin: 0; padding: 0; background: var(--app-card); border: 1px solid var(--app-card-border); border-radius: 8px; }
.le-sheet-list li + li { border-top: 1px solid var(--app-card-border); }
.le-sheet-item { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-3); color: var(--bone-0); font: 500 16px/1.3 var(--font-body); text-decoration: none; }
.le-sheet-item svg { flex: none; color: var(--bone-2); }
.le-sheet-item:hover { color: var(--bone-0); background: var(--app-tile); }
.le-sheet-item[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--accent-mark); background: var(--app-tile); }
.le-sheet-item .mlp-count { margin-left: auto; background: var(--accent-mark); color: #fff; }
.le-sheet-item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.le-sheet-sec { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--app-card); border: 1px solid var(--app-card-border); border-radius: 8px; }
.le-sheet-sec .mlp-seg { align-self: flex-start; }
.le-sheet-sec .mlp-seg a { min-height: var(--hit); }
.le-sheet-sec .le-sheet-item { padding: 0; color: var(--ember-text); }
.le-sheet-who { display: flex; flex-direction: column; gap: 2px; font: 600 16px/1.3 var(--font-body); color: var(--bone-0); }
.le-mode-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--app-card); color: var(--bone-0); font: 600 13px/1 var(--font-body); white-space: nowrap; }
.le-mode-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.le-mode-pill--rehearsal, .le-mode-pill--stale { background: var(--caution-dim); border-color: var(--data-wait-edge); color: var(--caution-text); }
.le-mode .le-tip[open] .le-mode-pill, .le-mode .le-tip > summary:hover .le-mode-pill { border-color: var(--bone-0); }

/* ---- Phone tables and cards (EST-088), portrait and landscape --------------------------------- */
@media (max-width: 600px), (hover: none) and (max-width: 950px) and (max-height: 500px) {
  .le-sm-only { display: revert; }
  .le-sm-hide { display: none !important; }
  /* Rows become stacked cards: the first cell is the title, the status cell sits top right, every
     other cell is a label and its value. A bar, a form or a note takes the card's full width. */
  .le-scroll:has(> table.mlp-table:not(.le-keep)) { overflow: visible; }
  table.mlp-table:not(.le-keep) { display: block; min-width: 0 !important; }
  table.mlp-table:not(.le-keep) > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.mlp-table:not(.le-keep) > tbody { display: flex; flex-direction: column; gap: var(--s-2); }
  table.mlp-table:not(.le-keep) > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-2) var(--s-3); padding: var(--s-3); background: var(--app-card); border: 1px solid var(--app-card-border); border-radius: 8px; }
  table.mlp-table:not(.le-keep) > tbody > tr > * { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(84px, 32%) minmax(0, 1fr); gap: 2px var(--s-3); min-width: 0; padding: 0; border: 0; overflow-wrap: anywhere; white-space: normal; text-align: left; }
  table.mlp-table:not(.le-keep) > tbody > tr > *::before { content: attr(data-label); font: 600 13px/1.45 var(--font-body); color: var(--bone-3); }
  table.mlp-table:not(.le-keep) > tbody > tr > :not([data-label]) { display: block; }
  table.mlp-table:not(.le-keep) > tbody > tr > :not([data-label])::before { content: none; }
  table.mlp-table:not(.le-keep) > tbody > tr > :empty { display: none; }
  table.mlp-table:not(.le-keep) > tbody > tr > :first-child { grid-column: 1; grid-row: 1; display: block; font-size: var(--fs-card-title); }
  table.mlp-table:not(.le-keep) > tbody > tr > :first-child::before { content: none; }
  table.mlp-table:not(.le-keep) > tbody > tr:not(:has(> .le-td-status)) > :first-child { grid-column: 1 / -1; }
  table.mlp-table:not(.le-keep) > tbody > tr > .le-td-status { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; max-width: 46vw; text-align: right; }
  table.mlp-table:not(.le-keep) > tbody > tr > .le-td-status::before { content: none; }
  table.mlp-table:not(.le-keep) > tbody > tr > :is(:has(.mlp-bar), :has(.le-dec-act), :has(.le-dec), :has(form)) { grid-template-columns: minmax(0, 1fr); }
  .le-ph-pill { float: right; margin: 0 0 var(--s-1) var(--s-2); }
  /* A table that stays a table: frozen first column, faded scroll edges */
  .le-scroll--keep { background: linear-gradient(to right, var(--app-card) 30%, transparent) left / 24px 100% no-repeat local, linear-gradient(to left, var(--app-card) 30%, transparent) right / 24px 100% no-repeat local, radial-gradient(farthest-side at 0 50%, rgba(11, 13, 16, .2), transparent) left / 12px 100% no-repeat scroll, radial-gradient(farthest-side at 100% 50%, rgba(11, 13, 16, .2), transparent) right / 12px 100% no-repeat scroll; }
  table.le-keep > * > tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--app-card); box-shadow: inset -1px 0 0 var(--app-card-border); }
  /* Decision forms: phone-sized fields, full width (MOB-10) */
  .le-dec > summary { display: flex; align-items: center; min-height: var(--hit); }
  .le-dec-form { max-width: none; padding: var(--s-3); }
  .le-dec-form label { font-size: 15px; }
  .le-dec-form input[type="text"], .le-dec-form input[type="datetime-local"], .le-dec-form select, .le-dec-note { box-sizing: border-box; width: 100%; min-height: var(--hit); padding: 8px 10px; font-size: 16px; }
  .le-dec-form label.le-cap { min-height: var(--hit); padding: var(--s-1) 0; color: var(--bone-1); cursor: pointer; }
  .le-dec-form input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0; }
  .le-dec-act .le-dec-note { flex: 1 1 100%; }
  .le-dec-act .ml-btn { flex: 1 1 0; min-height: var(--hit); }
  table.mlp-table:not(.le-keep) > tbody > tr.le-hl { background: var(--caution-dim); }
  table.mlp-table:not(.le-keep) > tbody > tr.le-hl > td { background: transparent; box-shadow: none; }
  .le-dec-confirm { max-width: none; }
  .le-dec-confirm .ml-btn { flex: 1 1 auto; min-height: var(--hit); }
  .le-dec-until label { flex: 1 1 140px; }
  .le-sign-form textarea { font-size: 16px; }
  .le-toast { left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); transform: none; width: auto; max-width: none; }
  .le-toast .le-toast-x { min-height: var(--hit); }
}
/* Waiting decisions as cards on the phone (MOB-02) */
.le-dcards { display: flex; flex-direction: column; gap: var(--s-2); }
.le-dcard { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-3); background: var(--app-card); border: 1px solid var(--app-card-border); border-radius: 8px; }
.le-dcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-2); }
.le-dcard-tags { display: inline-flex; flex: none; align-items: center; }
.le-dcard-what { font: 600 var(--fs-card-title)/1.35 var(--font-body); color: var(--bone-0); overflow-wrap: anywhere; }
.le-dcard dl { display: grid; grid-template-columns: minmax(84px, 32%) minmax(0, 1fr); gap: var(--s-1) var(--s-3); margin: 0; }
.le-dcard dt { font: 600 13px/1.45 var(--font-body); color: var(--bone-3); }
.le-dcard dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* One decision from a DEC link, and its Kosli record (EST-060) */
.le-dec-focus { display: grid; grid-template-columns: minmax(84px, max-content) minmax(0, 1fr); gap: var(--s-1) var(--s-3); margin: 0; }
.le-dec-focus dt { font: 600 13px/1.45 var(--font-body); color: var(--bone-3); }
.le-dec-focus dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.le-dec-kosli .le-mono { overflow-wrap: anywhere; }

/* ---- Wayfinding (EST-08B) ------------------------------------------------------------------- */
/* System search in the header (IA-20); on the phone it is in the More sheet instead */
.le-find-top { display: flex; align-items: center; }
.le-find { display: flex; flex-direction: column; gap: 2px; }
.le-find .ml-input { min-width: 200px; min-height: 36px; padding: 0 var(--s-3); font: 400 var(--fs-small-ui)/1 var(--font-body); }
.le-find-msg:empty { display: none; }
.le-sheet-find { margin-top: var(--s-3); }
.le-sheet-find .ml-input { width: 100%; box-sizing: border-box; min-height: var(--hit); font-size: 16px; }
/* Estate pickers in a screen's header */
.le-switch .ml-input { min-height: 36px; padding: 0 var(--s-3); font: 600 var(--fs-small-ui)/1 var(--font-body); }
/* Breadcrumb: the current screen is plain, every step above it a link */
.le-crumbs [aria-current="page"] { color: var(--bone-1); }
/* A tile that links to what it counts (IA-21) */
a.le-tile-link { color: inherit; text-decoration: none; }
a.le-tile-link:hover { border-color: var(--border-interactive, var(--bone-2)); }
a.le-tile-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* A place a link points at (obligation, item to decide, reconciliation): marked when arrived at */
[data-focus] { scroll-margin-top: var(--s-6); }
[data-focus].is-focus:not(tr, section) { box-shadow: inset 3px 0 0 var(--accent-mark); background: var(--app-tile); padding-left: var(--s-3); }
tr[data-focus].is-focus > * { background: var(--app-tile); }
tr[data-focus].is-focus > :first-child { box-shadow: inset 3px 0 0 var(--accent-mark); }
section[data-focus].is-focus > .mlp-card { box-shadow: 0 0 0 2px var(--accent-mark); }
/* "All N" and other lists that open in place */
.le-more > summary { cursor: pointer; padding: var(--s-2) 0; font-size: var(--fs-small-ui); list-style: none; }
.le-more > summary::-webkit-details-marker { display: none; }
.le-more > summary::before { content: "+ "; }
.le-more[open] > summary::before { content: "− "; }
.le-plain { margin: var(--s-2) 0 0; padding-left: 18px; }
.le-plain li + li { margin-top: 4px; }
@media (max-width: 600px), (hover: none) and (max-width: 950px) and (max-height: 500px) {
  .le-find-top { display: none; }
  .le-more > summary { display: flex; align-items: center; min-height: var(--hit); }
  .le-switch, .le-switch .ml-input { min-height: var(--hit); width: 100%; box-sizing: border-box; font-size: 16px; }
  .le-hd-act .le-find { flex: 1 1 100%; }
  .le-hd-act .le-find .ml-input { width: 100%; box-sizing: border-box; min-height: var(--hit); font-size: 16px; }
  /* The estate's status tiles in a 2 × 2 grid (MOB-08); a fifth spans the row */
  .le-tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .le-tiles-4 > :nth-child(5) { grid-column: 1 / -1; }
  [data-focus].is-focus:is(tr) { box-shadow: inset 3px 0 0 var(--accent-mark); }
}
@media (max-width: 600px), (hover: none) and (max-width: 950px) and (max-height: 500px) {
  .le-hd-act .le-find-wrap { flex: 1 1 100%; }
}

/* ---- Visual consistency (EST-08C) ------------------------------------------------------------- */
/* hidden means hidden, whatever display a class gives (UI-02: the glossary rows are grids) */
[hidden] { display: none !important; }
/* Focus is blue, never ember: ember reads as an error (UI-30). #1e55cd is 6.9:1 on white and 6.5:1
   on the page; on the ink rail, the radar and the toast a light blue (#a8c1ff, 9.6:1 on #16181c). */
html:root:not([data-theme="dark"]) { --focus-ring: #1e55cd; } /* beats tokens.css :root:not([data-theme="dark"]) */
.mlp-rail, .rd-scope, .le-toast, .le-notes-on .le-demo { --focus-ring: #a8c1ff; }
.le-tip > summary:focus-visible, .le-term > summary:focus-visible, .le-src > summary:focus-visible, .le-xrow > summary:focus-visible, .le-notes-btn:focus-visible { outline-color: var(--focus-ring); }
/* Status colours are for control status only (UI-11). Workflow states and data agreement: ink. */
.mlp-status.le-wf { background: var(--app-card); color: var(--bone-0); border: 1px solid var(--bone-2); }
.mlp-status.le-wf--strong { background: var(--bone-0); color: #fff; border-color: var(--bone-0); }
.le-dot { display: inline-block; flex: none; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--bone-3); }
.le-dot--critical { background: var(--critical); }
.le-dot--caution { background: var(--caution); box-shadow: inset 0 0 0 1px var(--data-wait-edge); }
.le-dot--positive { background: var(--positive); }
.le-dot--neutral { background: transparent; border: 1px dashed var(--bone-3); box-sizing: border-box; }
/* A flag is a note, in ink; a thin bar at its edge says how bad (like a tile's bottom bar). */
.le-flag, .le-flag--caution, .le-flag--critical { background: var(--app-tile); color: var(--bone-1); border-left: 3px solid var(--bone-3); }
.le-flag--caution { border-left-color: var(--caution); }
.le-flag--critical { border-left-color: var(--critical); }
/* The highlight a link lands on is the same as data-focus: a tile tint and the ember mark */
.le-hl, tr.le-hl > td { background: var(--app-tile); }
@media (max-width: 600px), (hover: none) and (max-width: 950px) and (max-height: 500px) { table.mlp-table:not(.le-keep) > tbody > tr.le-hl { background: var(--app-tile); } }
.le-gl-row.is-focus { box-shadow: inset 3px 0 0 var(--accent-mark); }
/* "Custom to the bank" is a kind of control, not a status: outlined, not green */
.le-tag--ev { background: var(--app-card); box-shadow: inset 0 0 0 1px var(--bone-3); }
/* The outcome toast: ink, no status colour */
.le-toast--critical, .le-toast--positive { border-left: 0; }
/* Severity of an advisory is not a control status: ink, its bars say how severe */
.mlp-sev--critical, .mlp-sev--high { background: var(--app-tile); color: var(--bone-0); }
/* Where the data comes from: Live is a solid ink tag, Rehearsal a dashed one (shape, not green) */
.mlp-avail--live { background: var(--app-card); color: var(--bone-0); border: 1px solid var(--bone-0); }
.mlp-env.le-env--rehearsal { background: var(--inverse-bg); color: var(--inverse-text); }
.le-mode-pill--rehearsal { background: var(--app-card); border: 1px dashed var(--bone-0); color: var(--bone-0); }
.le-mode-pill--rehearsal::before { background: transparent; border: 1px dashed currentColor; box-sizing: border-box; }
/* Segmented controls: the selected segment is filled (UI-17); a link beside them is a link */
.mlp-seg a[aria-pressed="true"], .mlp-seg button[aria-pressed="true"] { background: var(--bone-0); color: #fff; box-shadow: none; }
.mlp-seg a[aria-pressed="true"]:hover { color: #fff; }
/* The rail stays in view on a long page, with its own scroll (UI-27): the rail itself stretches to
   the page (its ink runs the full height); its contents stick to the top and scroll on their own.
   Below 901 px the icon rail's hover labels sit outside it, so no scroll box there. */
.le-rail-in { display: flex; flex-direction: column; gap: var(--s-1); }
@media (min-width: 601px) {
  .mlp-rail { position: static; align-self: stretch; min-height: 0; }
  .le-rail-in { position: sticky; top: var(--s-4); }
}
@media (min-width: 901px) { .le-rail-in { max-height: calc(100vh - 2 * var(--s-4)); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rail-divider) transparent; margin: -4px calc(-1 * var(--s-2)) -4px -4px; padding: 4px var(--s-2) 4px 4px; } }
/* Text that is not an action looks like text (UI-26) */
.le-options { margin: 0; padding-left: 20px; }
.le-options li + li { margin-top: var(--s-2); }
/* The tags that make the join wrap instead of clipping (UI-28) */
pre.le-wrap-code { white-space: pre-wrap !important; overflow-wrap: anywhere; }
/* A chart with a real axis (UI-21): tick labels on the left, gridlines across, one colour */
.le-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--s-2); margin-top: var(--s-4); }
.le-chart-y { position: relative; min-width: 16px; height: 160px; font: 400 var(--fs-caption)/1 var(--font-body); color: var(--bone-3); }
.le-chart-y span { position: absolute; right: 0; transform: translateY(50%); }
.le-chart-plot { position: relative; height: 160px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-3); align-items: end; border-bottom: 1px solid var(--bone-2); }
.le-chart-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--border-strong); }
.le-chart-bar { position: relative; z-index: 1; background: var(--data-context-2); border-radius: 2px 2px 0 0; min-height: 1px; }
.le-chart-bar > span { position: absolute; bottom: 100%; left: 0; right: 0; padding-bottom: 2px; text-align: center; font: 600 var(--fs-caption)/1.2 var(--font-body); color: var(--bone-0); }
.le-chart-x { grid-column: 2; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-3); padding-top: 4px; text-align: center; font: 400 var(--fs-caption)/1.3 var(--font-body); color: var(--bone-3); }
/* A shared dependency, said once above the table (UI-22) */
.le-callout { padding: var(--s-2) var(--s-3); background: var(--app-tile); border-radius: 6px; font-size: var(--fs-small-ui); color: var(--bone-1); }
/* The phone estate header: compact (EST-08B follow-up) */
@media (max-width: 600px), (hover: none) and (max-width: 950px) and (max-height: 500px) {
  .le-hd-act.le-est-act { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-2); width: 100%; }
  .le-est-act .le-switch { grid-column: 1 / -1; }
  .le-est-act .mlp-seg { grid-column: 1 / -1; box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr; }
  .le-est-act .mlp-seg a { justify-content: center; padding: 0 var(--s-2); }
  .le-est-act .le-est-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0 var(--s-4); }
  .le-est-act .le-est-links a { display: inline-flex; align-items: center; min-height: var(--hit); }
}
.le-est-links { display: contents; }
