/* EPM Agent platform — design system (plan/14).
   Two selected themes. The theme is stamped on <html data-theme> BEFORE first paint
   (inline script in index.html), so only [data-theme=light] overrides live here.
   Category + series colors are the dataviz reference palette, per-mode steps —
   the dark column is not a filter of the light one. */

:root {
  --sidebar-w: 232px;
  --topbar-height: 47px;
  --r: 8px;
  --r-sm: 6px;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* plan/44 § 7 — one family, three voices; a cool slate ground; one cobalt accent for
     interactive elements only; semantic state never reuses the accent; category colours
     appear as dots, rings and legend, never as fills behind text.
     ------------------------------------------------- dark (default) */
  color-scheme: dark;
  --bg:        #0f141a;
  --panel:     #161c24;
  --raised:    #1d252f;
  --sunken:    #0b1015;
  --line:      #263040;
  --line-strong: #33404f;
  --scroll:    #33404f;
  --sidebar-a: #131a22;
  --sidebar-b: #10161d;

  --ink:       #e6ebf1;
  --ink-2:     #9aa5b4;
  --ink-3:     #6f7b8a;
  --ink-sec:   #8d99a8;

  --accent:      #7aa2ff;
  --accent-ink:  #a9c2ff;         /* accent-colored TEXT on soft/dark ground */
  --accent-soft: #1b2a4a;
  --on-accent:   #0b1424;         /* text on an accent fill: white on this light cobalt read as disabled */
  --series-2:    #8b85f5;

  /* status — reserved; *-ink is the readable text step for the mode */
  --good:      #5fbf86;  --good-ink:    #7fd0a0;  --good-soft:    #16301f;
  --warning:   #e0a843;  --warn-ink:    #e8b866;  --warning-soft: #332711;
  --serious:   #ec835a;  --serious-ink: #ec835a;  --serious-soft: rgba(236,131,90,.13);
  --critical:  #f07c74;  --crit-ink:    #f59a94;  --critical-soft: #3a1614;

  /* knowledge categories (dark steps) */
  --cat-record:    #8b9aae;
  --cat-positions: #8b85f5;
  --cat-build:     #3faf9f;
  --cat-people:    #e0913d;
  --cat-master:    #b57be8;
  --cat-other:     #898781;

  --edge:        #33404f;         /* graph edges */
  --edge-strong: #556174;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px -12px rgba(0,0,0,.5);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #f5f7fa;
  --panel:     #ffffff;
  --raised:    #eef2f6;
  --sunken:    #f0f3f7;
  --line:      #dde3ea;
  --line-strong: #cbd3dd;
  --scroll:    #cbd3dd;
  --sidebar-a: #ffffff;
  --sidebar-b: #f7f9fb;

  --ink:       #1a222c;
  --ink-2:     #4a5563;
  --ink-3:     #7b8794;
  --ink-sec:   #5f6b78;

  --accent:      #2456d6;
  --accent-ink:  #1e47b3;
  --accent-soft: #e3eafb;
  --on-accent:   #ffffff;
  --series-2:    #4f46e5;

  --good:      #2e7d4f;  --good-ink:    #2e7d4f;  --good-soft:    #e3f1e8;
  --warning:   #b7791f;  --warn-ink:    #8a5a12;  --warning-soft: #fbf0da;
  --serious:   #ec835a;  --serious-ink: #9c3f14;  --serious-soft: rgba(236,131,90,.14);
  --critical:  #b3261e;  --crit-ink:    #b3261e;  --critical-soft: #f9e3e1;

  --cat-record:    #64748b;
  --cat-positions: #4f46e5;
  --cat-build:     #0f766e;
  --cat-people:    #b45309;
  --cat-master:    #7e22ce;
  --cat-other:     #898781;

  --edge:        #cbd3dd;
  --edge-strong: #8f98a8;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -14px rgba(16,24,40,.14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 13px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
}
::selection { background: color-mix(in srgb, var(--accent) 32%, transparent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; margin: 0; }
[hidden] { display: none !important; }

/* Live pursuit controls. These are projections of kb.tasks, never parallel alerts. */
.pursuit-blocker { display: flex; align-items: center; gap: 13px; margin: 0 0 14px;
  padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--critical) 45%, var(--line));
  border-radius: var(--r); background: var(--critical-soft); box-shadow: var(--shadow); }
.pursuit-blocker-icon { width: 34px; height: 34px; flex: none; display: grid;
  place-items: center; border-radius: 50%; background: var(--critical); color: #fff; }
.pursuit-blocker-kicker { color: var(--crit-ink); font-size: 11px; font-weight: 750;
  letter-spacing: .08em; text-transform: uppercase; }
.pursuit-blocker-title { margin: 1px 0 2px; font-size: 15px; font-weight: 650; }
.pursuit-overdue, .pursuit-missing { color: var(--crit-ink); font-weight: 650; }
.live-task-list tr.click:hover { background: var(--raised); }
.pursuit-drawer-shade { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.42);
  backdrop-filter: blur(2px); }
.pursuit-drawer { position: fixed; z-index: 81; inset: 0 0 0 auto; width: min(470px, 94vw);
  padding: 18px; overflow: auto; border-left: 1px solid var(--line-strong);
  background: var(--panel); box-shadow: -16px 0 50px rgba(0,0,0,.3);
  transform: translateX(102%); transition: transform .18s ease; }
.pursuit-drawer.open { transform: translateX(0); }
.pursuit-drawer-head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.pursuit-drawer article { padding: 18px 0; }
.pursuit-drawer article h3 { margin: 14px 0 5px; font-size: 18px; }
.pursuit-drawer article p { color: var(--ink-2); }
.pursuit-facts { display: grid; gap: 1px; margin: 16px 0; border: 1px solid var(--line);
  border-radius: var(--r-sm); overflow: hidden; background: var(--line); }
.pursuit-facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px;
  padding: 9px 11px; background: var(--raised); }
.pursuit-facts dt { color: var(--ink-3); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; }
.pursuit-facts dd { margin: 0; }
.pursuit-permitted { margin: 16px 0; padding: 12px; border-radius: var(--r-sm);
  background: var(--raised); }
.pursuit-permitted ol { margin: 7px 0 0; padding-left: 20px; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .pursuit-drawer { transition: none; } }
@media (max-width: 700px) {
  .pursuit-blocker { align-items: flex-start; flex-wrap: wrap; }
  .pursuit-blocker button { margin-left: 47px; }
  .live-task-list { overflow-x: auto; }
  .pursuit-facts > div { grid-template-columns: 1fr; gap: 2px; }
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 6px;
  border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------- controls */
button, .btn {
  font: inherit; color: var(--ink); background: var(--raised);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 6px 12px; cursor: pointer; transition: border-color .12s, background .12s;
  display: inline-flex; align-items: center; gap: 6px;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); text-decoration:none; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 86%, #fff); }
button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
button.danger { color: var(--crit-ink); }
button.danger:hover:not(:disabled) { border-color: var(--critical); }
button.sm, .btn.sm { padding: 3px 9px; font-size: 12.5px; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--sunken);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 6px 10px;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 0; border-color: var(--accent);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px;
  color: var(--ink-2); }
label.fld > input, label.fld > select { min-width: 160px; }

/* ------------------------------------------------------------- layout */
#app { display: none; }
#app.ready { display: block; }

#sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar-a) 0%, var(--sidebar-b) 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 14px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font: 600 13px var(--serif);
}
.brand .t { line-height: 1.25; }
.brand .t b { font: 600 14px var(--serif); display: block; }
.brand .t small { color: var(--ink-3); font-size: 11px; }

/* plan/52: Client -> Application -> Project, as one line that opens into the three choices. */
.scope { margin: 0 0 8px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); }
.scope.open { border-color: var(--line-strong); box-shadow: var(--shadow); }
.scope-btn { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 8px;
  background: transparent; border: 0; border-radius: var(--r); text-align: left; }
.scope-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 4%, transparent); }
button.scope-btn:active:not(:disabled) { transform: none; }
.scope-mark { width: 26px; height: 26px; flex: none; border-radius: 6px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12.5px; }
.scope-t { flex: 1; min-width: 0; line-height: 1.25; }
.scope-t b, .scope-t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope-t b { font-size: 13px; font-weight: 600; }
.scope-t small { color: var(--ink-3); font-size: 11.5px; }
.scope-chev { color: var(--ink-3); display: grid; transition: transform .15s; }
.scope.open .scope-chev { transform: rotate(180deg); }
.scope-panel { display: grid; gap: 8px; padding: 4px 8px 10px; border-top: 1px solid var(--line); }
.scope-panel label { display: grid; gap: 3px; font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); padding-top: 4px; }
.scope-panel select { width: 100%; min-width: 0; padding: 5px 8px; font-size: 12.5px; letter-spacing: 0;
  text-transform: none; color: var(--ink); background: var(--raised); }
.scope-panel select:disabled { opacity: .55; }

/* Go to page: the whole menu by name, Ctrl K from anywhere. */
.jump-btn { width: 100%; margin: 0 0 4px; padding: 6px 9px; font-size: 12.5px; color: var(--ink-3);
  background: transparent; border: 1px solid var(--line); }
.jump-btn:hover:not(:disabled) { color: var(--ink-2); }
.jump-btn svg { display: block; }
.jump-btn .grow { flex: 1; text-align: left; }
@media (max-width: 900px) { .jump-btn kbd { display: none; } }
kbd { font: 500 10.5px var(--mono); color: var(--ink-3); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--raised); }
.jump { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.38); backdrop-filter: blur(2px);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.jump-box { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.55); overflow: hidden; }
.jump-box input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 13px 16px; font-size: 15px; background: transparent; }
.jump-box input:focus { outline: none; border-color: var(--line); }
#jumpList { max-height: min(52vh, 420px); overflow-y: auto; padding: 6px; }
#jumpList a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); }
#jumpList a:hover { text-decoration: none; background: color-mix(in srgb, var(--ink) 5%, transparent); }
#jumpList a.on { background: var(--accent-soft); color: var(--accent-ink); }
#jumpList a svg { color: var(--ink-3); flex: none; }
#jumpList a small { color: var(--ink-3); font-size: 11.5px; }
.jump-none { padding: 18px 12px; color: var(--ink-3); text-align: center; }
.jump-sect { padding: 8px 10px 3px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); }
.jump-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 11.5px; }
.jump-foot kbd { margin-right: 3px; }

#nav { flex: 1; overflow-y: auto; margin: 4px -4px 0; padding: 0 4px; }
#nav .grp { width: 100%; display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 6px 8px 4px; background: transparent; border: 0; border-radius: var(--r-sm);
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
#nav .grp:hover:not(:disabled) { color: var(--ink-2); }
button.grp:active:not(:disabled) { transform: none; }
#nav .grp svg { margin-left: auto; transition: transform .15s; }
#nav .grp .cnt { display: none; font: 500 10.5px var(--mono); letter-spacing: 0; color: var(--ink-3);
  background: var(--raised); border-radius: 8px; padding: 0 6px; }
#nav .nav-grp.folded .grp svg { transform: rotate(-90deg); }
#nav .nav-grp.folded .grp .cnt { display: inline-block; }
#nav .nav-grp.folded .grp-items { display: none; }
#nav a {
  display: flex; align-items: center; gap: 9px; padding: 6px 9px; margin: 1px 0;
  border-radius: var(--r-sm); color: var(--ink-2); font-size: 13px; font-weight: 500;
}
#nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: var(--ink); text-decoration: none; }
#nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
#nav a.active svg { color: var(--accent); }
/* plan/56: which applications, of which packs, the implementation group is showing. */
#nav .nav-packs { padding: 0 9px 4px; font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
#nav .nav-packs > div + div { margin-top: 1px; }
#nav .nav-packs span { font: 500 10.5px var(--mono); letter-spacing: .02em; }
#nav .nav-packs button { padding: 0 2px; border: 0; background: none; color: var(--accent-ink); font: inherit;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
#nav .nav-packs button:hover { color: var(--ink); }
.cap-matrix td[data-level] { white-space: nowrap; }
.cap-legend { margin-top: 6px; line-height: 1.9; }
#nav a svg { width: 16px; height: 16px; flex: none; color: var(--ink-3); }
#nav a .n { flex: 1; }

#userbox { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px;
  display: flex; align-items: center; gap: 7px; }
#userbox .avatar { width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--raised); border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700;
  color: var(--ink-2); }
#userbox .who { flex: 1; min-width: 0; line-height: 1.3; }
#userbox .who .n { font-size: 12.5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
#userbox .who .r { color: var(--ink-3); font-size: 11px; }
#userbox button { padding: 5px 7px; }

#main { margin-left: var(--sidebar-w); min-height: calc(100dvh - var(--topbar-height)); }
/* One shell row holds section tabs and notifications; only the tabs scroll horizontally. */
#topbar { position: sticky; top: 0; z-index: 50; margin-left: var(--sidebar-w);
  background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { padding: 0 24px; min-height: 46px;
  display: flex; align-items: center; gap: 8px; }
.hub-tabs { min-width: 0; flex: 1; margin-left: -12px; align-self: stretch; }
.hub-tabs-in { height: 100%; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.hub-tabs-in::-webkit-scrollbar { display: none; }
.hub-tabs a { flex: none; display: flex; align-items: center; padding: 12px 12px 10px;
  border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.hub-tabs a:hover { color: var(--ink); text-decoration: none; }
.hub-tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }
#app:has(.hub-tabs:not([hidden])) #view .page { padding-top: 20px; }
#navShade { position: fixed; inset: 0; z-index: 69; background: rgba(0,0,0,.4); }
@media (min-width: 901px) {
  #navShade, #topbar #navToggle, #topbar #topTitle { display: none; }
  #topbar:has(.hub-tabs[hidden]):has(.notify[hidden]) { display: none; }
}
@media (max-width: 900px) {
  #topbar { margin-left: 0; background: var(--panel); }
  .topbar-in { padding: 0 16px; }
  #navToggle { flex: none; }
  #topTitle { font: 600 15px var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #topbar:has(.hub-tabs:not([hidden])) #topTitle { display: none; }
  .hub-tabs { margin-left: 0; }
  #sidebar { z-index: 70; transform: translateX(-102%); transition: transform .18s ease;
    box-shadow: 16px 0 50px rgba(0,0,0,.25); }
  body.nav-open #sidebar { transform: none; }
  #main { margin-left: 0; }
}
.notify { position: relative; margin-left: auto; flex: none; }
.notify-btn { position: relative; padding: 6px 8px; border-radius: var(--r-sm); color: var(--ink-2); line-height: 0; }
.notify-btn[aria-expanded="true"] { background: var(--raised); color: var(--ink); }
.notify-count { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; background: var(--accent); color: var(--on-accent, #0b1220); font: 600 10px/16px var(--sans);
  text-align: center; }
.notify-panel { position: absolute; right: 0; top: calc(100% + 6px); width: min(400px, calc(100vw - 52px)); max-height: min(70vh, 560px);
  overflow: auto; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r);
  box-shadow: var(--shadow); z-index: 75; text-align: left; line-height: 1.4; }
#topbar .notify-head b { font: 600 13px var(--sans); white-space: normal; }
.notify-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.notify-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; width: 100%;
  text-align: left; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); }
.notify-item:last-child { border-bottom: 0; }
.notify-item:hover { background: var(--raised); }
.notify-item.unread { box-shadow: inset 3px 0 0 var(--accent); }
.notify-item.unread .notify-title { font-weight: 700; }
.notify-ic { color: var(--ink-3); padding-top: 1px; }
.notify-text { min-width: 0; }
.notify-title, .notify-detail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.notify-detail { color: var(--ink-3); margin-top: 2px; }
.notify-when { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.notify-empty { margin: 0; padding: 16px 12px; color: var(--ink-3); font-size: 12.5px; }
.page { padding: 26px 24px 64px; overflow-wrap: break-word; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.page-head h1 { font: 600 24px/1.2 var(--serif); letter-spacing: 0; text-wrap: balance; }
.page-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 3px; max-width: 90ch; }
/* Reading text and single inputs keep a limit on a full-width page (plan/44, 2026-11-04). */
.page p, .page .note { max-width: 90ch; }
/* :where keeps these below every component's own rule. */
.page :where(input, select, textarea, label) { max-width: 100%; }
.page :where(input:not([type=checkbox],[type=radio],[type=file],[type=range],[type=color]), select):where(:not(table *, .toolbar *, .form-grid *, .grid *, [class*="-grid"] *, .row *, .rt-bar *)) { max-width: min(640px, 100%); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }
.page-head .actions button, .page-head .actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .page-head { flex-wrap: wrap; }
  .page-head .actions { margin-left: 0; flex-wrap: wrap; }
}
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--accent); }
/* Narrow screens: after the rules above, or they win (the page kept a 32px gutter on a phone until 2026-10-16). */
@media (max-width: 900px) {
  .page { padding: 18px 16px 48px; }
  #app:has(.hub-tabs:not([hidden])) #view .page { padding-top: 14px; }
}

.sect { font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; margin: 26px 0 10px; display: flex;
  align-items: center; gap: 8px; }
.sect::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ------------------------------------------------------------- cards & grids */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.grid > .card + .card { margin-top: 0; }
.card.pad0 { padding: 0; overflow-x: auto; }
.card.click { cursor: pointer; transition: border-color .12s; }
.card.click:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); }
@media (max-width: 1100px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.c3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid.c2, .grid.c3 { grid-template-columns: minmax(0,1fr); } }

.tile { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.tile .k svg { width: 13px; height: 13px; }
.tile .v { font-size: 26px; font-weight: 500; margin-top: 4px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tile .d { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.tile .d.up { color: var(--good-ink); }
.tile .d.warn { color: var(--warn-ink); }

/* ------------------------------------------------------------- tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
/* Any other table stays inside the page on a phone until its own ticket moves it. */
@media (max-width: 640px) { .page table.tbl { display: block; max-width: 100%; overflow-x: auto; } }
.tbl th { text-align: left; color: var(--ink-sec); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.tbl tr.dim td { color: var(--ink-3); }
.tbl .main { color: var(--ink); font-weight: 500; }
.tbl .sub { color: var(--ink-sec); font-size: 12px; }

/* One record, one line (plan/44, ticket 291). A table scrolls in its own box, sideways only below its minimum width,
   and the header stays visible. Text cut off by a column unfolds on the keyboard-focused row. */
.lt-box { max-width: 100%; max-height: max(320px, calc(100dvh - var(--topbar-height) - 88px)); overflow: auto; }
table.lt { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px;
  font-variant-numeric: tabular-nums; }
.lt th { position: sticky; top: 0; z-index: 2; height: 32px; padding: 0 10px; text-align: left; background: var(--panel);
  color: var(--ink-sec); font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt td { height: 34px; padding: 0 10px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; vertical-align: middle; }
.lt.dense td { height: 32px; }
.lt tbody tr:last-child td { border-bottom: none; }
.lt tr.lt-empty td { color: var(--ink-sec); white-space: normal; height: 48px; }
.lt td.lt-main { color: var(--ink); font-weight: 500; }
.lt td.lt-text { color: var(--ink-2); }
.lt td.lt-id, .lt td.lt-date { font: 12px var(--mono); color: var(--ink-2); }
.lt th.lt-date, .lt td.lt-date { padding-inline: 6px; }
.lt th.lt-number, .lt td.lt-number { text-align: right; }
.lt td.lt-actions-cell { overflow: visible; }
.lt tr.click { cursor: pointer; }
.lt tr[data-row]:hover td { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.lt tr.selected td, .lt tr.selected:hover td { background: var(--accent-soft); }
.lt tr[data-row]:focus { outline: none; }
/* The full text shows over the rows below: unfolding the row would move the others out from under the mouse. An open row's
   is in its detail, which this would cover. :where keeps that out of the rule's weight, so a tree's indent still applies. */
.lt-v { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lt-v .pill:not(:has(svg)) { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.lt tr[data-row]:is(:focus-visible, [data-full]) td { position: relative; overflow: visible; box-shadow: inset 0 2px 0 var(--accent), inset 0 -2px 0 var(--accent); }
.lt tr[data-row]:is(:focus-visible, [data-full]):where(:not(.lt-open)) .lt-v { position: absolute; z-index: 1; top: 2px; left: 0; right: 0; padding: 6px 10px; white-space: normal;
  overflow-wrap: anywhere; text-overflow: clip; background: var(--panel); border-bottom: 2px solid var(--accent); pointer-events: none; }
.lt tr[data-row]:is(:focus-visible, [data-full]):where(:not(.lt-open)) .lt-v :is(a, button, input, select) { pointer-events: auto; }
.lt tr[data-row]:is(:focus-visible, [data-full]):where(:not(.lt-open)) .lt-v .pill { white-space: normal; overflow: visible; border-radius: var(--r-sm); }
.lt-row-actions { display: inline-flex; align-items: center; gap: 4px; }
.lt-more { padding-inline: 7px; }
.lt-menu { position: fixed; z-index: 80; display: flex; flex-direction: column; min-width: 170px; padding: 4px 0;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.lt-menu[hidden] { display: none; }
.lt-item { display: block; width: 100%; padding: 6px 12px; border: 0; border-radius: 0; background: none; color: var(--ink);
  font: 13px var(--sans); text-align: left; white-space: nowrap; }
.lt-item:hover, .lt-item:focus { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.lt-item.danger { color: var(--crit-ink); }
@media (max-width: 640px) {
  .lt td.lt-main, .lt th.lt-main { position: sticky; left: 0; z-index: 1; background: var(--panel); }
  .lt th.lt-main { z-index: 3; }
}

/* Register table filters (plan/44, ticket 293): a bar above the table, the rest in fixed popovers from the header. */
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rt-bar-filter { display: inline-flex; gap: 6px; min-width: 0; }
.rt-bar input[type=search] { flex: 1 1 220px; min-width: 0; }
.rt-bar select { max-width: 170px; }
.rt-status { min-width: 0; color: var(--ink-sec); font-size: 12.5px; }
.rt-th { display: flex; align-items: center; gap: 2px; min-width: 0; }
.lt-number .rt-th { justify-content: flex-end; }
.lt th.lt-number:has(.rt-th) { padding-inline: 6px; }
.rt-sort { display: block; min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  letter-spacing: inherit; text-transform: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-sort:hover:not(:disabled) { color: var(--ink); }
.rt-fbtn { flex: none; padding: 0 3px; border: 0; background: none; color: var(--ink-sec); font-size: 10px; line-height: 1; }
.rt-fbtn.on { color: var(--on-accent); background: var(--accent); border-radius: 3px; }
.rt-pop { position: fixed; z-index: 80; display: flex; flex-direction: column; gap: 7px; width: 240px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.rt-pop[hidden] { display: none; }
.rt-pop input:not([type=checkbox]), .rt-pop select { width: 100%; }
.rt-pop button { align-self: flex-start; }
.rt-pop-title { color: var(--ink-sec); font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.rt-field { display: flex; flex-direction: column; gap: 3px; color: var(--ink-2); font-size: 12px; }
.rt-check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
/* -- end register table */
/* Delivery registers and Status & packs (plan/44, ticket 306). */
.lt tr.lt-group th { position: static; height: 30px; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); font-size: 11.5px;
  letter-spacing: 0; text-transform: none; }
.lt tr.sel td { background: var(--accent-soft); }
/* A row that opens under itself, and groups that open and close (plan/44, ticket 305). Only the open row's detail wraps. */
button.lt-toggle { flex: none; width: 22px; height: 22px; margin-right: 6px; padding: 0; justify-content: center; font-weight: 500; line-height: 1; vertical-align: middle; }
.lt tr.lt-group:has([data-group-toggle]) th { cursor: pointer; }
.lt tr.lt-note td { height: 28px; color: var(--ink-2); font-size: 12px; }
.lt tr.lt-open td { border-bottom-color: transparent; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.lt tr.lt-detail td { height: auto; padding: 2px 10px 10px 36px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; white-space: normal;
  overflow: visible; overflow-wrap: anywhere; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.lt-detail-body > * + * { margin-top: 4px; }
.lt-detail-body p { margin: 4px 0 0; }
/* A table wider than its box scrolls, and these stay in view, within the box (--lt-box-width: line_table.js). */
.lt tr.lt-group th:has(.lt-group-head), .lt tr.lt-note td { overflow: visible; }
.lt-group-head, .lt-note-line { position: sticky; left: 10px; max-width: calc(var(--lt-box-width, 100%) - 20px); }
.lt-group-head { display: flex; align-items: center; white-space: normal; }
.lt-note-line { display: block; overflow: hidden; text-overflow: ellipsis; }
.lt-detail-body { position: sticky; left: 36px; max-width: calc(var(--lt-box-width, 100%) - 46px); }
@media (max-width: 640px) {
  .lt tr.lt-detail td { padding-left: 10px; }
  .lt-detail-body { left: 10px; max-width: calc(var(--lt-box-width, 100vw - 44px) - 20px); }
  /* The main column stays put over the others, so it stays opaque when its row is open or under a finger. */
  .lt tr[data-row]:is(:hover, .lt-open) td.lt-main { background: color-mix(in srgb, var(--ink) 3%, var(--panel)); }
}
.work-tree tr[data-level="2"] .lt-main .lt-v { padding-left: 18px; }
.work-tree tr[data-level="3"] .lt-main .lt-v { padding-left: 36px; }
.work-tree tr[data-row]:not([data-level="1"]) .lt-main .lt-v::before { content: "↳ "; color: var(--ink-sec); }
/* A record table with controls or evidence in its rows keeps one line and scrolls in its box (plan/44, ticket 304). */
.tbl.one-line td { padding-block: 6px; white-space: nowrap; }
.cw-table > .tbl td { white-space: nowrap; }
.build-layout { margin: 12px 0; }
.build-layout > .card + .card { margin-top: 0; }
.outline-pairs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 12px; align-items: start; }
.outline-pairs > .card { margin: 0; min-width: 0; }
/* Forms in the detail panel take one column (plan/44, ticket 303). */
.dp-body .grid.c2 { grid-template-columns: minmax(0, 1fr); }
.operation-outcome { color: var(--ink-2); }
/* Engagement registers (plan/44, ticket 301). */
.rec-lt td.lt-main a { color: var(--ink); }
.lt tr.rec-stripe td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.lt .rec-cov { vertical-align: -2px; }
.rec-closed { padding: 0; }
.rec-closed > summary { padding: 10px 14px; cursor: pointer; }
/* Settings (plan/44, ticket 298): a section menu, one-line summaries that open, two-column provider forms. */
.set-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-nav { position: sticky; top: calc(var(--topbar-height) + 8px); display: flex; flex-direction: column; gap: 1px; }
.set-nav a { padding: 6px 10px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13px; }
.set-nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); text-decoration: none; }
.set-nav a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }
.set-sections { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.set-sections .set-section { margin: 0; padding: 0; }
.set-section > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; cursor: pointer; }
.set-section > summary::before { content: "▸"; color: var(--ink-sec); font-size: 11px; }
.set-section[open] > summary::before { content: "▾"; }
.set-section > summary::-webkit-details-marker { display: none; }
.set-section[open] > summary { border-bottom: 1px solid var(--line); }
.set-summary-note { min-width: 0; color: var(--ink-sec); }
.set-body { padding: 14px; }
.set-section[id="set-openai"] .set-card, .set-section[id="set-anthropic"] .set-card, .set-section[id="set-defaults"] .set-card { margin: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.set-section[id="set-openai"] .set-card > h3, .set-section[id="set-anthropic"] .set-card > h3, .set-section[id="set-defaults"] .set-card > h3 { display: none; }
.set-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.set-form-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.set-form-col p { margin: 0; }
.set-form-foot { grid-column: 1 / -1; }
.md-group-toggle { padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.md-group-toggle::before { content: "▸ "; color: var(--ink-sec); }
tbody.md-open .md-group-toggle::before { content: "▾ "; }
tbody[data-model-group]:not(.md-open) tr:not(.md-group-heading) { display: none; }
@media (max-width: 900px) {
  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 2px 4px; }
  .set-form-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Connections (plan/44, ticket 295). */
.conn-signins { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
@media (min-width: 900px) { .conn-signins { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.conn-signins .conn-signin { margin: 0; }
.conn-signin { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 9px 14px; }
.conn-signin h2 { margin: 0; font: 600 13.5px var(--sans); white-space: nowrap; }
.conn-check { margin-left: auto; }
.conn-message { flex-basis: 100%; min-width: 0; color: var(--ink-2); font-size: 12.5px; }
.conn-help { flex-basis: 100%; }
.conn-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
.conn-wide { grid-column: 1 / -1; }
.conn-form > button { justify-self: start; }
/* Task templates (plan/44, ticket 296). */
.tt-layout { display: grid; gap: 12px; align-items: start; }
@media (min-width: 1280px) { .tt-layout.open { grid-template-columns: minmax(0, 3fr) minmax(0, 5fr); } }
.tt-layout > .card { margin: 0; min-width: 0; }
.tt-title { margin: 0; font: 600 14px var(--sans); overflow-wrap: anywhere; }
.tt-fields-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; margin-top: 10px; }
.tt-fields-grid .tt-wide { grid-column: 1 / -1; }
.tt-rules { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
@media (max-width: 760px) { .tt-fields-grid { grid-template-columns: minmax(0, 1fr); } }
/* A heading and its controls at the top of a table card (plan/44, ticket 294). */
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font: 600 14px var(--sans); }
.card-head .cnt { color: var(--ink-sec); font-size: 12.5px; }
.card-head .grow { flex: 1; }
.card-head select { max-width: 170px; padding-block: 3px; font-size: 12.5px; }
.acc-cols { display: grid; gap: 12px; align-items: start; margin-top: 12px; }
@media (min-width: 1280px) { .acc-cols { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.dp-open .acc-cols { grid-template-columns: minmax(0, 1fr); }
.acc-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.acc-side .card { margin: 0; }
.form-stack { display: flex; flex-direction: column; gap: 8px; }
.form-stack > button { align-self: flex-start; }
.lt tr.dim td { color: var(--ink-sec); }
.lt-plain { font-weight: 400; color: var(--ink-2); }
/* Audit log (plan/44, ticket 297). */
.audit-bar input[type=search] { flex: 1 1 200px; min-width: 0; }
.audit-date { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-size: 12.5px; }
.audit-detail { font: 12px var(--mono); color: var(--ink-2); font-weight: 400; }
/* Stat tiles on one line above a table (plan/44, ticket 299). */
.tiles-line .tile { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 12px; }
.tiles-line .tile .v { order: 2; margin: 0; font-size: 18px; }
.tiles-line .tile .k { order: 1; }
.tiles-line .tile .d { order: 3; margin: 0; }
.doc-new-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.doc-new-form button { align-self: flex-start; }
.doc-locked { color: var(--warn-ink); vertical-align: middle; }

/* A record or form beside its table (plan/44, ticket 292); below 1100 px it overlays the page. */
.dp-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.dp-layout.dp-open { grid-template-columns: minmax(0, 1fr) 380px; }
.dp-list { min-width: 0; }
.dp-panel { position: sticky; top: calc(var(--topbar-height) + 8px); max-height: calc(100dvh - var(--topbar-height) - 16px);
  overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.dp-panel[hidden], .dp-shade[hidden] { display: none; }
.dp-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.dp-title { flex: 1; min-width: 0; margin: 0; font: 600 14px var(--sans); overflow-wrap: anywhere; }
.dp-body { padding: 12px 14px 16px; }
.dp-shade { display: none; }
@media (max-width: 1099px) {
  .dp-layout.dp-open { grid-template-columns: minmax(0, 1fr); }
  .dp-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 75; width: min(420px, 100%); max-height: none;
    border-radius: 0; border-width: 0 0 0 1px; }
  .dp-layout.dp-open .dp-shade { display: block; position: fixed; inset: 0; z-index: 74;
    background: color-mix(in srgb, #000 35%, transparent); }
}

/* Style templates (plan/82 §8): versions in one-line rows, one version beside them on request; wider than a record's panel, for its table of values. */
.st-page .dp-layout.dp-open { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); }
.st-status { margin: 0 0 10px; color: var(--ink-2); font-size: 13px; }
.st-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 10px; }
.st-bar label.fld { flex: 1 1 200px; min-width: 0; }
.st-bar label.fld > input { min-width: 0; width: 100%; }
.st-about { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 14px; margin: 0 0 10px; font-size: 13px; }
.st-about dt { color: var(--ink-sec); font-size: 11px; }
.st-about dd { margin: 0; overflow-wrap: anywhere; }
.st-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px 0 10px; border-bottom: 1px solid var(--line); }
.st-tabs button { padding: 5px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--ink-2); font-size: 12.5px; }
.st-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.st-count { padding: 0 5px; border-radius: 8px; background: var(--warning-soft); color: var(--warn-ink); font-size: 11px; }
.st-values { margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.st-values td:last-child, .st-values td:last-child .lt-v { overflow: visible; }
.st-set { display: flex; align-items: center; gap: 6px; min-width: 0; }
.st-set input[type="text"] { flex: none; width: 92px; height: 24px; padding: 0 5px; font-size: 12px; }
.st-set input[type="number"] { flex: none; width: 70px; height: 24px; padding: 0 4px; font-size: 12px; }
.st-set select { flex: 0 1 auto; min-width: 0; max-width: 170px; height: 24px; padding: 0 4px; font-size: 12px; }
.st-set input[type="color"] { flex: none; width: 24px; height: 24px; padding: 0; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: none; }
.st-set input[aria-invalid="true"], .st-set select[aria-invalid="true"] { border-color: var(--crit-ink); }
.st-upload { flex: none; }
.st-swatch { display: inline-block; width: 12px; height: 12px; margin-right: 5px; border: 1px solid var(--line-strong); border-radius: 2px; vertical-align: -2px; }
.st-thumb { max-width: 40px; height: 22px; object-fit: contain; vertical-align: middle; }
.st-set:has(.st-upload) select { max-width: 112px; }
.st-group-head { gap: 6px; }
.st-strip { display: inline-flex; align-self: center; height: 18px; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.st-strip i { width: 18px; }
.st-note .refused, .st-note.refused { color: var(--crit-ink); }
.st-note .warn, .st-note.warn { color: var(--warn-ink); }
.st-summary .st-note { margin-bottom: 4px; font-size: 12.5px; }
.st-jump { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: underline; white-space: normal; }
.st-fallbacks { margin: 6px 0 10px; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; }
.st-tokens { margin-top: 10px; }
.st-tokens summary { margin-bottom: 8px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.st-compare { margin-bottom: 10px; }
.st-panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.st-panel { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.st-panel-title { display: flex; align-items: center; gap: 6px; margin: 0; font: 600 13px var(--sans); }
.st-panel-state { margin: 6px 0; color: var(--ink-2); font-size: 12.5px; }
.st-frame { display: block; width: 100%; height: 220px; margin: 6px 0; border: 1px solid var(--line); background: #fff; }
@media (max-width: 1099px) {
  .st-page .dp-layout.dp-open { grid-template-columns: minmax(0, 1fr); }
  .st-page .dp-panel { width: min(960px, 100%); }
}

/* Task workflow: actions first, then a compact full-width completion form. */
.task-workflow-layout { display: grid; gap: 12px; }
@media (max-width: 640px) {
  .knowledge-node .page-head { flex-wrap: wrap; }
  .knowledge-node .page-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
  .knowledge-node .page-head .actions { margin-left: 0; flex-wrap: wrap; }
}

.task-action-card .toolbar { max-width: 760px; }
.task-source-picker { margin-top: 9px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--raised); }
.task-field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 9px; margin-top: 12px; }
.task-field-card { min-width: 0; padding: 10px 11px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--panel); }
.task-field-card.wide { grid-column: 1 / -1; }
.task-field-card .pill { margin-left: 8px; }
.task-field-card textarea { min-height: 58px; }
.task-field-match { margin-top: 7px; color: var(--good-ink); }
.task-field-comparison { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.task-source-overrides { margin-top: 12px; }
.task-source-overrides-body { padding: 0 12px 12px; }
.task-source-table { min-width: 640px; table-layout: fixed; }
.task-source-table th:first-child, .task-source-table td:first-child { width: 34%; }
.task-source-table select { width: 100%; min-width: 0; padding: 5px 7px; font-size: 12px; }
.task-form-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 850px) {
  .task-field-grid { grid-template-columns: 1fr; }
  .task-field-card.wide { grid-column: auto; }
}

/* Task-template configuration is deliberately dense: one editable field per row. */
.tt-table-wrap { width: 100%; overflow-x: auto; }
.tt-field-table { min-width: 1000px; table-layout: fixed; }
.tt-field-table th, .tt-field-table td { padding: 6px 5px; }
.tt-field-table th:nth-child(1), .tt-field-table td:nth-child(1) { width: 42px; text-align: center; }
.tt-field-table th:nth-child(2), .tt-field-table td:nth-child(2) { width: 140px; }
.tt-field-table th:nth-child(3), .tt-field-table td:nth-child(3) { width: 150px; }
.tt-field-table th:nth-child(4), .tt-field-table td:nth-child(4) { width: 92px; }
.tt-field-table th:nth-child(5), .tt-field-table td:nth-child(5) { width: 130px; }
.tt-field-table th:nth-child(6), .tt-field-table td:nth-child(6) { width: 115px; }
.tt-field-table th:nth-child(7), .tt-field-table td:nth-child(7) { width: 115px; }
.tt-field-table th:nth-child(8), .tt-field-table td:nth-child(8) { width: 140px; }
.tt-field-table th:nth-child(9), .tt-field-table td:nth-child(9) { width: 70px; text-align: right; }
.tt-field-table input:not([type="checkbox"]), .tt-field-table select {
  width: 100%; min-width: 0; padding: 5px 7px; font-size: 12px;
}
.tt-field-table input:disabled { opacity: .55; cursor: not-allowed; }
.tt-field-table .tt-required input { width: 15px; height: 15px; }

/* ------------------------------------------------------------- pills, badges */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent; }
.pill.long { white-space: normal; overflow-wrap: anywhere; border-radius: var(--r-sm); }
.pill svg { width: 11px; height: 11px; }
.pill.good     { color: var(--good-ink); background: var(--good-soft); }
.pill.warning  { color: var(--warn-ink); background: var(--warning-soft); }
.pill.serious  { color: var(--serious-ink); background: var(--serious-soft); }
.pill.critical { color: var(--crit-ink); background: var(--critical-soft); }
.pill.accent   { color: var(--accent-ink); background: var(--accent-soft); }
.pill.neutral  { color: var(--ink-2); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pill.outline  { border-color: var(--line-strong); color: var(--ink-2); background: none; }

.badge-preview { display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase;
  color: var(--warn-ink); background: var(--warning-soft);
  border: 1px dashed color-mix(in srgb, var(--warning) 45%, transparent);
  border-radius: 4px; padding: 1px 6px; vertical-align: 2px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-3); margin-right: 6px; vertical-align: 1px; flex: none; }
.dot.good { background: var(--good); } .dot.critical { background: var(--critical); }
.dot.warning { background: var(--warning); } .dot.accent { background: var(--accent); }

.slug { font-family: var(--mono); font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--ink-3); } .dim2 { color: var(--ink-2); }
.small { font-size: 12px; }

/* ------------------------------------------------------------- tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line);
  margin: 18px 0 16px; }
@media (max-width: 640px) { .tabs { flex-wrap: wrap; } }
.tabs a { padding: 8px 14px; color: var(--ink-2); font-weight: 500; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------- stepper */
.stepper { display: flex; align-items: flex-start; gap: 0; margin: 6px 0 4px; }
.step { flex: 1; min-width: 0; text-align: center; position: relative; }
.step .node { width: 22px; height: 22px; border-radius: 50%; margin: 0 auto;
  background: var(--raised); border: 2px solid var(--line-strong);
  display: grid; place-items: center; position: relative; z-index: 1; }
.step .node svg { width: 11px; height: 11px; color: #fff; }
.step .bar { position: absolute; top: 11px; left: -50%; width: 100%; height: 2px;
  background: var(--line-strong); }
.step:first-child .bar { display: none; }
.step.done .node { background: var(--accent); border-color: var(--accent); }
.step.done .bar { background: var(--accent); }
.step.current .node { background: var(--panel); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft); }
.step.current .bar { background: var(--accent); }
.step .lb { font-size: 11px; color: var(--ink-3); margin-top: 7px;
  text-transform: capitalize; }
.step.current .lb { color: var(--ink); font-weight: 600; }
.step.done .lb { color: var(--ink-2); }

/* ------------------------------------------------------------- progress */
.prog { height: 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.prog.good > i { background: var(--good); }
.prog.warn > i { background: var(--warning); }

/* ------------------------------------------------------------- timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { position: relative; padding: 0 0 18px 26px; }
.tl li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0;
  width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl .tn { position: absolute; left: 0; top: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--raised); border: 2px solid var(--line-strong); }
.tl li.done .tn { background: var(--accent); border-color: var(--accent); }
.tl li.fail .tn { background: var(--critical); border-color: var(--critical); }
.tl li.run .tn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tl .tt { font-weight: 600; font-size: 13px; }
.tl .td { color: var(--ink-2); font-size: 12.5px; margin-top: 1px; }
.tl .tm { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- lists & rows */
.rowline { display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--line); }
.rowline:last-child { border-bottom: none; }
.rowline .grow { flex: 1; min-width: 0; }
.rowline .ttl { font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.rowline .meta { font-size: 12px; color: var(--ink-3); }

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; font-size: 13px; }
.kv .k { color: var(--ink-3); }
.kv .v { overflow-wrap: anywhere; white-space: pre-wrap; }

/* Settings (2026-10-17): titled cards of label/value rows; a label may carry a one-line hint beneath it. */
.set-card { margin-bottom: 14px; }
.set-card + .set-card { margin-top: 0; }
.set-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.set-card h3 .pill { font-weight: 500; }
.set-lead { margin: -6px 0 10px; }
.set-rows { border-top: 1px solid var(--line); }
.set-row { display: grid; grid-template-columns: minmax(140px, 40%) minmax(0, 1fr); gap: 4px 16px;
  align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.set-row:last-child { border-bottom: 0; }
.set-k { min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.set-k small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.set-v { min-width: 0; }
.set-wrap { overflow-wrap: anywhere; }
.set-me { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.set-me .avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.set-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 12px;
  overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); }
.set-metrics > div { padding: 9px 12px; background: var(--panel); }
.set-metrics b { display: block; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.set-metrics span { color: var(--ink-3); font-size: 12px; }
.set-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.set-foot .ok-line, .set-foot .err-line { margin: 0; }
/* The shared .grid.c2 never collapses; the Settings columns do, and their tiles stack on a phone. */
@media (max-width: 1000px) { .set-cols.grid.c2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .set-row { grid-template-columns: minmax(0, 1fr); }
  .set-tiles.grid.c4 { grid-template-columns: minmax(0, 1fr); } }

.empty { text-align: center; padding: 42px 20px; color: var(--ink-3); }
.empty svg { width: 30px; height: 30px; margin-bottom: 8px; opacity: .6; }
.empty .t { font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.empty .s { font-size: 12.5px; max-width: 420px; margin: 0 auto; }

.note { font-size: 12.5px; color: var(--ink-3); }
.err-line { color: var(--crit-ink); font-size: 13px; margin: 8px 0; white-space: pre-wrap; }
.ok-line { color: var(--good-ink); font-size: 13px; margin: 8px 0; }

details.box { border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); margin: 8px 0; }
details.box > summary { cursor: pointer; padding: 9px 13px; color: var(--ink-2);
  font-size: 13px; list-style: none; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: "▸"; margin-right: 8px; color: var(--ink-3);
  display: inline-block; transition: transform .12s; }
details.box[open] > summary::before { transform: rotate(90deg); }
details.box pre, pre.block { margin: 0; padding: 12px 14px; background: var(--sunken);
  overflow-x: auto; white-space: pre-wrap; font: 12px/1.55 var(--mono);
  border-top: 1px solid var(--line); }
pre.block { border: 1px solid var(--line); border-radius: var(--r-sm); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px; }
.toolbar input[type=text], .toolbar input[type=search] { flex: 1; min-width: 200px; }
.spread { display: flex; align-items: center; gap: 10px; }
@media (max-width: 640px) { .spread { flex-wrap: wrap; } }
.spread .grow { flex: 1; }

/* ------------------------------------------------------------- agent cards */
.agent-card { display: flex; flex-direction: column; gap: 10px; }
.agent-head { display: flex; gap: 12px; align-items: center; }
.agent-ic { width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 16px;
  background: var(--accent-soft); color: var(--accent); }
.agent-ic.worker { background: color-mix(in srgb, var(--series-2) 14%, transparent);
  color: var(--series-2); }
.agent-head .nm { font-weight: 600; font-size: 14.5px; }
.agent-head .rl { color: var(--ink-3); font-size: 12px; }
.agent-stats { display: flex; gap: 18px; border-top: 1px solid var(--line);
  padding-top: 10px; }
.agent-stats .st .v { font-weight: 650; font-size: 15px;
  font-variant-numeric: tabular-nums; }
.agent-stats .st .k { color: var(--ink-3); font-size: 11px; }

/* ------------------------------------------------------------- chat */
.chat { display: flex; flex-direction: column; min-height: 420px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 14px;
  padding: 4px 2px 16px; }
.msg { max-width: 78%; }
.msg.user { align-self: flex-end; }
.msg .bubble { border-radius: 12px; padding: 10px 14px; font-size: 13.5px;
  white-space: pre-wrap; }
.msg.user .bubble { background: var(--accent); color: var(--on-accent);
  border-bottom-right-radius: 4px; }
.msg.agent .bubble { background: var(--raised); border: 1px solid var(--line);
  border-bottom-left-radius: 4px; }
.msg .who { font-size: 11px; color: var(--ink-3); margin: 0 4px 3px; }
.msg.user .who { text-align: right; }
.chat-input { display: flex; gap: 8px; border-top: 1px solid var(--line);
  padding-top: 12px; }
.chat-input textarea { flex: 1; resize: vertical; min-height: 52px; }
.codex-status { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.codex-status-message { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.codex-document-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 7px; color: var(--ink); text-decoration: none; }
.codex-document-row:hover { background: var(--raised); text-decoration: none; }
.codex-document-row .grow { min-width: 0; display: flex; flex-direction: column; }
.codex-document-row b, .codex-document-row .small { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.codex-document-icon { width: 27px; height: 27px; flex: none; display: grid; place-items: center;
  border-radius: 6px; color: var(--accent); background: var(--accent-soft); }
.codex-document-none { padding: 9px 8px; border: 1px dashed var(--line); border-radius: 7px; }
.codex-document-group { padding: 6px 8px 2px; font-weight: 600; }
.codex-governed-row .small { white-space: normal; }
.codex-document-group:not(:first-child) { margin-top: 4px; }
.codex-workspace-grid { display: grid;
  grid-template-columns: minmax(170px,190px) minmax(0,1fr) minmax(230px,250px);
  gap: 10px; align-items: stretch; }
.codex-workspace-grid > .card + .card, .codex-side-rail > .card + .card { margin-top: 0; }
.codex-history, .codex-chat, .codex-side-rail { height: calc(100dvh - var(--topbar-height) - 230px); min-height: 420px;
  max-height: 820px; min-width: 0; overflow: hidden; }
.codex-history { display: flex; flex-direction: column; padding: 0; }
.codex-panel-head { flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); }
.codex-conversations { min-height: 0; overflow-y: auto; padding: 6px; }
.codex-conversation { width: 100%; display: flex; flex-direction: column; align-items: flex-start;
  gap: 3px; border: 0; padding: 10px; text-align: left; background: transparent;
  border-radius: 8px; color: var(--ink); }
.codex-conversation:hover { background: var(--raised); }
.codex-conversation.active { background: var(--accent-soft); color: var(--accent); }
.codex-conversation-title { width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600; }
.codex-no-history { padding: 14px 10px; }
.codex-chat { min-height: 420px; padding: 0; }
.codex-runtime-controls { flex: none; display: flex; align-items: end; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--raised); }
.codex-runtime-controls label { display: flex; flex-direction: column; gap: 2px;
  color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.codex-runtime-controls select { min-width: 128px; height: 31px; padding: 3px 28px 3px 8px;
  font-size: 12px; text-transform: none; letter-spacing: 0; }
.codex-voice-controls { flex: none; min-height: 48px; display: flex; align-items: center;
  gap: 7px; padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.codex-voice-controls label { display: flex; flex-direction: column; gap: 1px; color: var(--ink-3);
  font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.codex-voice-controls select { height: 29px; min-width: 105px; padding: 2px 25px 2px 7px;
  font-size: 11px; text-transform: none; letter-spacing: 0; }
.codex-voice-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2);
  font-size: 11.5px; white-space: nowrap; }
.codex-voice-indicator i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.codex-voice-indicator:has([data-state="listening"]) i,
.codex-voice-indicator:has([data-state="ready"]) i { background: var(--good); }
.codex-voice-indicator:has([data-state="hearing"]) i,
.codex-voice-indicator:has([data-state="speaking"]) i { background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft); animation: voicePulse 1.1s ease-in-out infinite; }
.codex-voice-indicator:has([data-state="error"]) i { background: var(--critical); }
@keyframes voicePulse { 50% { transform: scale(1.25); } }
.codex-chat .chat-log { min-height: 0; max-height: none; overflow-y: auto;
  overscroll-behavior: contain; padding: 16px 18px; }
.codex-chat .msg.agent { max-width: 88%; }
.codex-chat .bubble { white-space: pre-wrap; }
/* An agent's answer in Markdown (markdown.js): paragraphs, lists, code and tables, not the raw marks. */
.codex-chat .bubble.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md h3, .md h4, .md h5, .md h6 { margin: 12px 0 6px; font-size: 14px; }
.md h3 { font-size: 15px; }
.md blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.md code { font-family: var(--mono); font-size: 12.5px; padding: 1px 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); overflow-wrap: anywhere; }
.md pre { margin: 0 0 8px; padding: 8px 10px; border-radius: 6px; overflow-x: auto;
  background: color-mix(in srgb, var(--ink) 6%, transparent); }
.md pre code { padding: 0; background: none; font-size: 12px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.md a { text-decoration: underline; }
.md .md-table { overflow-x: auto; margin: 4px 0 10px; }
.md table { border-collapse: collapse; font-size: 12.5px; min-width: 60%; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.md th { background: color-mix(in srgb, var(--ink) 6%, transparent); font-weight: 600; }
.codex-chat .msg { flex: none; }
.codex-chat .msg.failed .bubble { border-color: var(--critical); background: var(--critical-soft); }
.codex-message-attachments { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 4px 5px; }
.codex-message-attachments a, .codex-message-attachments > span { display: inline-flex;
  align-items: center; gap: 5px; max-width: 260px; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 7px; color: var(--ink-2); background: var(--panel); font-size: 11.5px;
  text-decoration: none; }
.codex-message-attachments a:hover { border-color: var(--accent); color: var(--accent); }
.codex-message-attachments span span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-chat .msg.user .codex-message-attachments { justify-content: flex-end; }
.codex-chat .chat-input { flex: none; margin: 0; padding: 12px;
  background: var(--panel); border-top: 1px solid var(--line); }
.codex-chat .chat-input.codex-composer { display: flex; flex-direction: column; gap: 7px; }
.codex-composer-row { display: flex; gap: 8px; align-items: stretch; }
.codex-composer-row textarea { flex: 1; }
.codex-attach { width: 40px; flex: none; padding: 0; display: grid; place-items: center;
  color: var(--ink-2); }
.codex-pending-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.codex-pending-file { display: inline-flex; align-items: center; gap: 5px; min-width: 0;
  max-width: 280px; padding: 5px 7px; border-radius: 7px; background: var(--accent-soft);
  color: var(--accent); font-size: 11.5px; }
.codex-pending-file > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-pending-file small { color: var(--ink-3); white-space: nowrap; }
.codex-pending-file button { border: 0; padding: 0 2px; min-width: 0; background: transparent;
  color: var(--ink-3); font-size: 17px; line-height: 1; }
.codex-pending-file button:hover { color: var(--critical); background: transparent; }
.codex-pending-file.uploaded { color: var(--good-ink); background: var(--good-soft); }
.codex-chat .chat-input textarea { resize: none; max-height: 140px; }
.codex-side-rail { display: flex; flex-direction: column; gap: 10px; }
.codex-generated-panel { flex: none; min-height: 106px; max-height: 230px; padding: 0;
  overflow: hidden; }
.codex-generated-list { max-height: 176px; overflow-y: auto; padding: 7px; }
/* plan/71 Contract 7: the person's files, what the reading found, and Unlock for a protected one. */
/* Its height follows the window, so Work & agents below keeps room on a short screen. */
.codex-files-panel { flex: 0 1 auto; min-height: 106px; max-height: clamp(150px, calc(100dvh - 680px), 330px);
  padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.codex-files-list { min-height: 0; overflow-y: auto; padding: 7px; }
.codex-file { min-width: 0; }
.codex-file.depth-1, .codex-file.depth-2, .codex-file.depth-3 { border-left: 2px solid var(--line);
  padding-left: 3px; }
.codex-file.depth-1 { margin-left: 13px; }
.codex-file.depth-2 { margin-left: 26px; }
.codex-file.depth-3 { margin-left: 39px; }
.codex-file-row { padding-bottom: 2px; }
.codex-file-row .codex-file-origin { color: var(--ink-3); font-style: italic; }
.codex-file-state { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; padding: 0 8px 6px 43px;
  font-size: 11.5px; min-width: 0; }
.codex-file-status { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); white-space: nowrap; }
.codex-file-status i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--ink-3); }
.codex-file-status.good i { background: var(--good); }
.codex-file-status.pending i { background: var(--accent); animation: voicePulse 1.1s ease-in-out infinite; }
.codex-file-status.warning { color: var(--warn-ink); }
.codex-file-status.warning i { background: var(--warning); }
.codex-file-status.critical { color: var(--crit-ink); }
.codex-file-status.critical i { background: var(--critical); }
.codex-file-tag { padding: 0 6px; border-radius: 9px; color: var(--good-ink); background: var(--good-soft);
  font-size: 10.5px; line-height: 17px; }
.codex-file-reason { flex-basis: 100%; min-width: 0; color: var(--ink-3); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.codex-file-unlock { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 1px 7px;
  font-size: 11px; }
/* The rail is narrow: the field takes the form's width and the buttons go under it; a wider column keeps one row. */
.codex-unlock-form { display: flex; flex-direction: column; gap: 6px; margin: 0 4px 8px 8px; padding: 8px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--raised); }
.codex-unlock-form label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-unlock-row { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.codex-unlock-row input { flex: 1 1 170px; min-width: 0; height: 30px; padding: 4px 8px; font-size: 12.5px; }
.codex-unlock-row button { flex: none; }
.codex-unlock-error { display: flex; align-items: flex-start; gap: 5px; padding: 5px 7px; border-radius: 6px;
  color: var(--crit-ink); background: var(--critical-soft); font-size: 12px; }
.codex-unlock-error svg { flex: none; margin-top: 2px; }
@media (max-width: 1180px) {
  /* Stacked under the chat, the rail grows with its panels (the page's tab bar otherwise fixes its height). */
  #app:has(.hub-tabs:not([hidden])) #view .codex-side-rail { height: auto; }
  .codex-files-panel { flex: none; max-height: min(70vh, 560px); }
}
@media (max-width: 700px) {
  .codex-file.depth-1 { margin-left: 8px; }
  .codex-file.depth-2 { margin-left: 16px; }
  .codex-file.depth-3 { margin-left: 24px; }
  .codex-file-state { padding-left: 8px; }
  .codex-unlock-form { margin-left: 4px; }
}
.codex-work-monitor { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; }
.codex-work-list { min-height: 0; overflow-y: auto; padding: 7px; }
.codex-work-card { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px;
  background: var(--panel); overflow: hidden; }
.codex-work-card > summary { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px;
  align-items: center; padding: 9px; cursor: pointer; list-style: none; }
.codex-work-card > summary::-webkit-details-marker { display: none; }
.codex-work-state { display: inline-flex; align-items: center; gap: 4px; font-size: 10px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.codex-work-state i, .codex-work-event > i { width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-3); flex: none; }
.codex-work-card.running .codex-work-state i { background: var(--accent); animation: voicePulse 1.1s ease-in-out infinite; }
.codex-work-card.queued .codex-work-state i { background: var(--warn); }
.codex-work-card.completed .codex-work-state i { background: var(--good); }
.codex-work-card.failed .codex-work-state i { background: var(--critical); }
.codex-work-objective { min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600; font-size: 12px; }
.codex-work-meta { padding: 0 9px 8px; overflow-wrap: anywhere; }
.codex-work-events { border-top: 1px solid var(--line); padding: 7px 9px; }
.codex-work-event { display: flex; gap: 7px; align-items: flex-start; padding: 5px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent); }
.codex-work-event:last-child { border-bottom: 0; }
.codex-work-event > i { margin-top: 5px; }
.codex-work-event.agent > i { background: var(--accent); }
.codex-work-event.tool > i { background: var(--good); }
.codex-work-event b { display: block; font-size: 11.5px; font-weight: 600; }
.codex-work-event .small { display: block; }
.codex-work-event-detail { margin-top: 3px; white-space: pre-wrap; max-height: 80px; overflow: hidden; }
.codex-work-plan { margin: 5px 0 0; padding-left: 17px; color: var(--ink-2); font-size: 11px; }
.codex-work-plan li { margin: 2px 0; }
.codex-work-plan li.completed { text-decoration: line-through; color: var(--ink-3); }
.codex-work-result, .codex-work-error { margin: 0 9px 9px; padding: 8px; border-radius: 7px;
  font-size: 11.5px; white-space: pre-wrap; background: var(--raised); max-height: 180px; overflow: auto; }
.codex-work-error { color: var(--critical); background: var(--critical-soft); }
.codex-work-empty .empty { padding: 24px 10px; }
.codex-activity, .codex-reasoning { margin: 5px 4px 0; }
.codex-event-list { margin-top: 5px; border-left: 2px solid var(--line); padding-left: 10px; }
.codex-event-list pre { max-height: 240px; overflow: auto; }
.codex-reasoning > div { padding: 7px 10px; color: var(--ink-2); white-space: pre-wrap; }
.codex-meta { margin: 4px 4px 0; }
/* The running turn at the end of the chat: what the agent is doing now and the steps so far (codex_live.js). */
.codex-chat .codex-live .bubble { white-space: normal; min-width: min(380px, 100%); }
.codex-live-title { margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-live-now { display: flex; align-items: center; gap: 8px; padding: 2px 0; min-width: 0; }
.codex-live-now b { font-weight: 600; overflow-wrap: anywhere; }
.codex-live-now .spin { width: 12px; height: 12px; color: var(--accent); }
.codex-live-tag { flex: none; font-size: 10px; line-height: 16px; padding: 0 5px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); }
.codex-live-summary, .codex-live-queued, .codex-live-limits { margin-top: 4px; }
.codex-conversation-working { color: var(--accent); font-weight: 600; }
.codex-live-steps { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); }
.codex-live-steps li { display: flex; align-items: center; gap: 7px; padding: 1px 0; font-size: 12px; min-width: 0; }
.codex-live-steps li > i { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--good); }
.codex-live-steps li > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.codex-live-steps li { align-items: flex-start; padding: 5px 0; }
.codex-live-steps li > i { margin-top: 5px; }
.codex-live-step-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.codex-live-purpose, .codex-live-detail { margin-top: 2px; }
.codex-live-status { flex: none; font-size: 11px; }
.codex-live-steps li.running > i { background: var(--accent); }
.codex-live-steps li.codex-live-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.codex-live-steps li.codex-live-text > span { white-space: normal; }
.codex-live-steps li.failed > i { background: var(--critical); }
.codex-live-steps li.failed > span:first-of-type { color: var(--critical); }
.codex-boundary-note { margin-top: 10px; }

/* Codex Logs — dense forensic information with a stable master/detail frame. */
.codex-log-filters { position: sticky; top: var(--topbar-height); z-index: 3; gap: 8px; }
.codex-log-search { display: flex; align-items: center; gap: 6px; min-width: 260px;
  color: var(--ink-3); }
.codex-log-search input { width: 100%; }
.codex-log-metrics { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px;
  margin: 12px 0; }
.codex-log-layout { display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.8fr);
  gap: 12px; align-items: start; }
/* From 1051 px the page fits the window: the list and the detail each scroll inside their pane (ticket 307). A short
   window keeps a usable pane height and the page scrolls instead. */
.codex-log-list { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.codex-log-list #codexLogRows { overflow-y: auto; flex: 1; min-height: 0; }
@media (min-width: 1051px) {
  .codex-logs-page { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-height));
    min-height: 620px; padding-bottom: 16px; }
  .codex-log-layout { flex: 1; min-height: 0; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  .codex-log-layout > .card { min-height: 0; margin: 0; }
  .codex-log-detail { overflow-y: auto; }
}
.codex-log-row { display: flex; width: 100%; flex-direction: column; align-items: stretch; gap: 5px;
  padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; color: var(--ink); text-align: left; }
.codex-log-row:hover { background: var(--raised); }
.codex-log-row.active { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.codex-log-row > b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.codex-log-row-top, .codex-log-row-meta { display: flex; align-items: center; gap: 7px; }
.codex-log-row-top .pill { margin-left: auto; }
.codex-log-row-meta { color: var(--ink-3); flex-wrap: wrap; }
.codex-log-row-meta span + span::before { content: "·"; margin-right: 7px; }
.codex-log-kind { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.codex-log-kind.turn { color: var(--accent-ink); }
.codex-log-kind.voice { color: var(--series-2); }
.codex-log-kind.work { color: var(--good-ink); }
.codex-log-detail { padding: 0; min-width: 0; overflow-x: hidden; overflow-wrap: anywhere; }
.codex-log-detail-head { padding: 18px 20px 15px; display: flex; justify-content: space-between;
  align-items: flex-start; gap: 16px; border-bottom: 1px solid var(--line); }
.codex-log-detail-head h2 { margin: 5px 0 0; font-size: 18px; max-width: 60ch; overflow-wrap: anywhere; }
.codex-log-eyebrow { color: var(--ink-3); font: 10.5px var(--mono); overflow-wrap: anywhere; }
.codex-log-detail-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.codex-log-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 13px 20px;
  background: var(--raised); border-bottom: 1px solid var(--line); }
.codex-log-kv { font-size: 12px; }
.codex-log-kv .k { color: var(--ink-3); }
.codex-log-kv .v { overflow-wrap: anywhere; }
.codex-log-section { padding: 17px 20px; border-bottom: 1px solid var(--line); }
.codex-log-section:last-child { border-bottom: 0; }
.codex-log-section h3 { margin: 0 0 10px; font-size: 13px; }
.codex-log-copy { display: grid; grid-template-columns: 95px minmax(0,1fr); gap: 12px; padding: 10px 0;
  white-space: pre-wrap; line-height: 1.55; }
.codex-log-copy + .codex-log-copy { border-top: 1px solid var(--line); }
.codex-log-copy label { color: var(--ink-3); font-size: 11px; text-transform: uppercase; }
.codex-log-copy.result > div { color: var(--ink); }
.codex-log-json { margin: 8px 0 0; max-height: 360px; overflow: auto; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--sunken);
  white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 var(--mono); }
.codex-log-timeline { position: relative; margin-left: 4px; }
.codex-log-timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line-strong); }
.codex-log-event { display: flex; gap: 12px; padding: 7px 0; position: relative; }
.codex-log-event > i { width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; z-index: 1;
  flex: none; border: 2px solid var(--panel); background: var(--ink-3); }
.codex-log-event.tool > i { background: var(--good); }
.codex-log-event.agent > i { background: var(--accent); }
.codex-log-event.lifecycle > i, .codex-log-event.turn > i { background: var(--series-2); }
.codex-log-event details { margin-top: 5px; }
.codex-log-event details .codex-log-json { max-height: 230px; }
.codex-agent-tree { display: grid; gap: 6px; }
.codex-agent-node { display: flex; gap: 10px; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--raised); }
.codex-agent-node > i { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--accent); }
.codex-log-audit { border: 1px solid var(--line); border-radius: 7px; margin-top: 6px; overflow: hidden; }
.codex-log-audit.mutation { border-left: 3px solid var(--warning); }
.codex-log-audit > summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  cursor: pointer; }
.codex-log-audit > summary .muted { margin-left: auto; }
.codex-log-audit > .kv, .codex-log-audit > pre { margin: 8px 10px; }
.codex-log-placeholder, .codex-log-empty { min-height: 250px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 8px; text-align: center; color: var(--ink-3); padding: 24px; }
.codex-log-placeholder b, .codex-log-empty b { color: var(--ink); }
@media (max-width: 1350px) {
  .codex-runtime-controls .grow, .codex-runtime-controls > .small,
  .codex-voice-controls .grow { display: none; }
}
@media (max-width: 1050px) {
  .codex-log-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .codex-log-layout { grid-template-columns: minmax(0, 1fr); }
  .codex-log-list { max-height: 330px; }
}
@media (max-width: 1180px) {
  .codex-workspace-grid { grid-template-columns: 1fr; }
  .codex-history { height: auto; min-height: 0; max-height: 160px; }
  .codex-side-rail { height: auto; min-height: 0; max-height: none; }
  .codex-generated-panel { max-height: 220px; }
  .codex-work-monitor { height: 260px; min-height: 0; flex: none; }
  .codex-conversations { display: flex; gap: 6px; overflow-x: auto; }
  .codex-conversation { min-width: 210px; }
}
@media (max-width: 700px) {
  .codex-log-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .codex-log-filters, .codex-log-detail-head { align-items: stretch; flex-direction: column; }
  .codex-log-search { min-width: 100%; }
  .codex-log-facts { grid-template-columns: 1fr; }
  .codex-log-detail-actions { flex-wrap: wrap; }
  .codex-log-copy { grid-template-columns: 1fr; gap: 3px; }
}
@media (max-width: 850px) {
  .codex-runtime-controls { align-items: stretch; flex-wrap: wrap; }
  .codex-runtime-controls .grow, .codex-runtime-controls > .small { display: none; }
  .codex-voice-controls { flex-wrap: wrap; }
  .codex-voice-controls .grow { display: none; }
  .codex-composer-row { flex-wrap: wrap; }
  .codex-composer-row textarea { min-width: calc(100% - 48px); }
}

/* the Loader's package panes */
.panes { display: grid; gap: 12px; grid-template-columns: repeat(var(--n,1),minmax(0,1fr)); }
@media (max-width: 980px) { .panes { grid-template-columns: 1fr; } }
.pane { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.pane-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 9px 13px; border-bottom: 1px solid var(--line); background: var(--raised); }
.pkg-item { border-top: 1px solid var(--line); padding: 11px 14px; }
.pkg-item:first-child { border-top: none; }
.item-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.role { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: .06em;
  padding: 1px 7px; border-radius: 3px; }
.role.binding { color: var(--good-ink); background: var(--good-soft); }
.role.caveat { color: var(--warn-ink); background: var(--warning-soft); }
.role.background { color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 7%, transparent); }
.role.refuting { color: var(--accent-ink); background: var(--accent-soft); }
.why { color: var(--ink-3); font-size: 12px; font-style: italic; margin: 3px 0 6px; }
.nbody { white-space: pre-wrap; font-size: 13px; }
.banner { font-size: 12px; padding: 4px 9px; border-radius: 4px; margin: 5px 0;
  display: inline-block; }
.banner.bad { color: var(--crit-ink); background: var(--critical-soft); }
.banner.warnv { color: var(--warn-ink); background: var(--warning-soft); }
.round-h { padding: 6px 13px; color: var(--accent-ink); font-size: 11.5px;
  font-family: var(--mono); background: var(--raised); }
.pane details { border-top: 1px solid var(--line); }
.pane details > summary { cursor: pointer; padding: 8px 13px; color: var(--ink-3);
  font-size: 12.5px; }
.pane details pre { margin: 0; padding: 10px 13px; background: var(--sunken);
  overflow-x: auto; font: 11.5px/1.55 var(--mono); }
.fb { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 9px 13px; border-top: 1px solid var(--line); margin-top: auto; }
.fb input[type=text] { flex: 1; min-width: 180px; }
.fb .on { border-color: var(--accent); background: var(--accent-soft); }

/* ------------------------------------------------------------- grading */
.grade-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.grade-row .lb { width: 120px; font-size: 12.5px; color: var(--ink-2); }
.scale { display: flex; gap: 4px; }
.scale button { width: 30px; height: 26px; padding: 0; justify-content: center;
  font-size: 12px; }
.scale button.sel, button.sel { background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); }

/* ------------------------------------------------------------- login */
#login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background:
    radial-gradient(1000px 500px at 20% -10%,
      color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    radial-gradient(800px 500px at 110% 110%,
      color-mix(in srgb, var(--series-2) 10%, transparent), transparent 55%),
    var(--bg); }
#login form { background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 30px; width: 360px; display: flex;
  flex-direction: column; gap: 11px; box-shadow: var(--shadow); }
#login .brand { padding-bottom: 4px; }
#login input { width: 100%; }
.login-label { font-size: 12.5px; color: var(--ink-2); margin-bottom: -4px; }
tr.click:not([data-row]):focus-visible, tr.clickable:not([data-row]):focus-visible, .card.click:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px; }

/* mini bar chart */
.mini-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.mini-bars .b { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0;
  min-height: 2px; position: relative; }
.mini-bars .b.mut { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.mini-lbls { display: flex; gap: 6px; margin-top: 5px; }
.mini-lbls span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-3); }

.keyreveal { border: 1px dashed color-mix(in srgb, var(--warning) 50%, transparent);
  border-radius: var(--r-sm); padding: 10px 14px; margin: 10px 0;
  font: 12.5px var(--mono); color: var(--warn-ink);
  overflow-wrap: anywhere; background: var(--warning-soft); }

/* ------------------------------------------------------------- knowledge: categories */
.cat-card { border-top: 3px solid var(--cat, var(--line-strong)); }
.cat-head { display: flex; gap: 12px; align-items: center; }
.cat-ic { width: 38px; height: 38px; border-radius: 10px; flex: none;
  display: grid; place-items: center; color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 6%, transparent); }
.cat-nm { font-weight: 600; font-size: 14.5px; }
a.khl { cursor: pointer; }
a.khl:hover { border-color: var(--cat, var(--accent)); color: var(--ink);
  text-decoration: none; }

/* ------------------------------------------------------------- knowledge: trees */
ul.tree { list-style: none; margin: 0; padding-left: 22px; position: relative; }
ul.tree.root { padding-left: 2px; margin-top: 10px; }
ul.tree:not(.root)::before { content: ""; position: absolute; left: 6px; top: 0;
  bottom: 10px; width: 1px; background: var(--line-strong); }
ul.tree li { position: relative; }
ul.tree:not(.root) li::before { content: ""; position: absolute; left: -16px; top: 14px;
  width: 12px; height: 1px; background: var(--line-strong); }
.tree-row { display: flex; align-items: center; gap: 7px; padding: 5px 6px;
  border-radius: 6px; flex-wrap: wrap; }
.tree-row:hover { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.tree-row .slug { font-size: 11px; }
.tree-row a.main { color: var(--ink); font-weight: 500; }
.tree-row a.main:hover { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------- motion */
@media (prefers-reduced-motion: no-preference) {
  /* The page fades in without moving: a transform on the page, even one that has finished but is still
     filled, makes the page rather than the window the frame of every position:fixed element inside it
     (the blocker drawer then showed its edge and widened the page). Cards keep their slide. */
  .page { animation: pageIn .22s ease backwards; }
  @keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
  .grid > * { animation: cardIn .3s ease backwards; }
  .grid > *:nth-child(2) { animation-delay: .04s; }
  .grid > *:nth-child(3) { animation-delay: .08s; }
  .grid > *:nth-child(4) { animation-delay: .12s; }
  .grid > *:nth-child(5) { animation-delay: .16s; }
  .grid > *:nth-child(6) { animation-delay: .20s; }
  @keyframes cardIn { from { opacity: 0; transform: translateY(8px); }
                      to { opacity: 1; transform: none; } }
  .card.click, .tile { transition: border-color .15s, transform .15s, box-shadow .15s; }
  .card.click:hover { transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,.12), 0 14px 30px -14px rgba(0,0,0,.5); }
  button:active:not(:disabled) { transform: translateY(1px); }
  .step.current .node { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--accent-soft); }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 7%, transparent); } }
  .msg { animation: msgIn .22s ease both; }
  @keyframes msgIn { from { opacity: 0; transform: translateY(6px) scale(.98); }
                     to { opacity: 1; transform: none; } }
  .prog > i { transition: width .7s cubic-bezier(.2,.8,.25,1); }
  #login form { animation: cardIn .35s ease both; }
}

/* skeleton loading */
.skel { max-width: 100%; border-radius: 6px; background: var(--raised); position: relative;
  overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--ink) 5%, transparent), transparent);
  animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); }
                     to { transform: translateX(100%); } }

/* spinner */
.spin { width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* typing indicator */
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3);
  animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; transform: none; }
                   30% { opacity: 1; transform: translateY(-3px); } }

/* toasts */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--panel); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--good); border-radius: 8px; padding: 9px 14px;
  font-size: 12.5px; box-shadow: var(--shadow); display: flex; gap: 8px;
  align-items: center; max-width: 380px; animation: toastIn .25s ease both; }
.toast.bad { border-left-color: var(--critical); }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); }
                     to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(16px); } }

/* ------------------------------------------------------------- knowledge: graph */
/* Cytoscape renders to canvas, so node/edge appearance is set in JS from resolved
   theme tokens (see themeTokens()). Only the frame around it is styled here. */
.gwrap { position: relative; }
#gstage { height: 620px; width: 100%; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--sunken);
  background-image: radial-gradient(var(--line) 1.1px, transparent 1.1px);
  background-size: 26px 26px; cursor: grab; }
#gstage:active { cursor: grabbing; }
.gzoom { position: absolute; right: 12px; bottom: 12px; display: flex;
  flex-direction: column; gap: 4px; }
.gzoom button { width: 30px; height: 28px; padding: 0; justify-content: center;
  background: var(--panel); box-shadow: var(--shadow); }
.gfilter { cursor: pointer; user-select: none; }
.gfilter.off { opacity: .35; }

/* ---------------------------------------------------------------- ingestion
   The review gate (plan/15 stage 4). The quote block is load-bearing, not
   decoration: a reviewer judging a proposal without the span it claims to come
   from is rubber-stamping a grounding link, which is worse than having none. */
a.box.linkrow { display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel); margin: 8px 0; padding: 0 13px;
  transition: border-color .12s; }
a.box.linkrow:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.card.warnbox { border-color: color-mix(in srgb, var(--warn-ink, #d79b3c) 45%, var(--line)); }
.card.quote { background: var(--sunken); font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; }
.card.quote + .card.quote { margin-top: 8px; }
details.prop > .body { padding: 4px 13px 13px; border-top: 1px solid var(--line); }
details.prop > .body .sect { margin-top: 14px; }
details.prop input { font-size: 12.5px; }

/* the ingestion record: five numbered sections read top to bottom */
.ingsec { margin-top: 26px; }
.ingsec-h { display: flex; align-items: center; gap: 9px; font-size: 15px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.ingsec-h svg { color: var(--ink-3); flex: none; }
.ingsec-h .n { font: 600 11px var(--mono); color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; }
.ingsec-b { margin: 8px 0 12px; max-width: 78ch; }
.ingsec .sect { margin-top: 16px; }
.ingsec select { max-width: 100%; min-width: 0; }
.person label { display: block; margin: 8px 0; min-width: 0; }
.person input, .person select { max-width: 100%; min-width: 0; }
.personExistingPanel input, .personExisting { display: block; width: 100%; }
a.btn.sm { padding: 3px 9px; font-size: 12.5px; text-decoration: none; }


/* ------------------------------------------------------ record lenses (plan/44) */
.rec-band { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px;
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.rec-band::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rec-band a { text-transform: none; letter-spacing: 0; font-weight: 500; }
.rec-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.rec-step { flex: 1 1 88px; min-width: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 12px; color: var(--ink-3); background: var(--panel); text-transform: capitalize; }
.rec-step.done { color: var(--ink-2); border-color: var(--line-strong); }
.rec-step.now { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); font-weight: 600; }
.rec-step small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-top: 2px; text-transform: none; }
.rec-list { margin: 0; padding: 0; list-style: none; }
.rec-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.rec-list li:last-child { border-bottom: 0; }
.rec-sev { width: 8px; height: 8px; border-radius: 2px; margin-top: 6px; background: var(--ink-3); }
.rec-sev.critical { background: var(--critical); } .rec-sev.warning { background: var(--warning); }
.rec-sev.accent { background: var(--accent); }
.rec-delta li { grid-template-columns: 84px 1fr; }
.rec-delta .k { font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 2px; }
.rec-comp { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.rec-warn { color: var(--warn-ink); } .rec-crit { color: var(--crit-ink); }
.rec-tag { font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.rec-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.rec-chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 10px; font-size: 12px;
  color: var(--ink-2); background: var(--panel); }
.rec-chip:hover { text-decoration: none; color: var(--ink); }
.rec-chip.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.rec-older { margin-top: 4px; }
.rec-ref { margin: 1px 0; }
.rec-ref .dot { margin-right: 5px; }
.rec-cov { display: inline-block; width: 13px; height: 13px; border-radius: 3px; border: 1px solid var(--line-strong);
  vertical-align: -2px; margin-right: 3px; background: transparent; }
.rec-cov.y { background: var(--good); border-color: var(--good); }
.rec-cov.stale { background: var(--warning); border-color: var(--warning); }
.rec-area { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; color: var(--ink); transition: border-color .12s; }
.rec-area:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.rec-area h3 { margin: 0 0 8px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: baseline; }
.rec-area-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.rec-area-row div { background: var(--raised); border-radius: 5px; padding: 5px 4px; }
.rec-area-row b { display: block; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.rec-area-row small { color: var(--ink-3); font-size: 10.5px; }
.rec-area-row div.bad b { color: var(--crit-ink); } .rec-area-row div.warn b { color: var(--warn-ink); }
.rec-area-last { margin-top: 8px; }
.rec-tl { overflow-x: auto; padding-bottom: 8px; }
.rec-lane { display: grid; grid-template-columns: 110px 1fr; align-items: center; min-height: 36px; border-top: 1px dashed var(--line); }
.rec-lane:first-child { border-top: 0; }
.rec-lane-t { position: relative; height: 32px; }
.rec-lane-t.two { height: 56px; }
.rec-ev.row1 { top: 30px; }
.rec-ev { position: absolute; top: 6px; height: 20px; line-height: 18px; border-radius: 4px; font-size: 11px;
  padding: 1px 6px; white-space: nowrap; color: #fff; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.rec-ev:hover { text-decoration: none; z-index: 5; max-width: none; }
.rec-ev.m { background: var(--cat-record); } .rec-ev.d { background: var(--cat-build); }
.rec-ev.steer { background: var(--ink); color: var(--bg); }
.rec-strip { position: absolute; top: 11px; height: 10px; border-radius: 3px; opacity: .7;
  background: repeating-linear-gradient(90deg, var(--cat-record) 0 4px, transparent 4px 9px); }
.rec-axis { display: grid; grid-template-columns: 110px 1fr; margin-top: 6px; }
.rec-axis div { display: flex; justify-content: space-between; }
.rec-quote { margin: 0 0 10px; padding: 6px 14px; border-left: 3px solid var(--line-strong);
  color: var(--ink-2); font-style: italic; line-height: 1.5; white-space: pre-wrap; }
.rec-quote:last-child { margin-bottom: 0; }
.rec-quote cite { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.rec-quote details { font-style: normal; margin-top: 4px; }
.rec-quote pre { white-space: pre-wrap; }


/* ------------------------------------------------------------- explorer (plan/44) */
.rec-modes { display: flex; gap: 6px; }
.rec-modes a { padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13px; background: var(--panel); }
.rec-modes a:hover { text-decoration: none; color: var(--ink); border-color: var(--accent); }
.rec-modes a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
:root[data-theme="dark"] .rec-modes a.on, :root:not([data-theme="light"]) .rec-modes a.on { color: var(--bg); }
.rec-root { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 100%; }
.rec-root input { min-width: min(340px, 100%); font-family: var(--mono); font-size: 12px; padding: 5px 10px; }
label.rec-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
label.rec-chip input { accent-color: var(--accent); margin: 0; }
.rec-legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-top: 10px; font-size: 11.5px; color: var(--ink-2); }
.rec-legend i { display: inline-block; width: 18px; border-top: 2px solid var(--ink-2); vertical-align: middle; margin-right: 5px; }
.rec-legend i.dash { border-top-style: dashed; }
.rec-legend .ring { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px dashed var(--critical); vertical-align: -1px; margin-right: 5px; }
#gstage { height: 640px; }
.toolbar .rec-root input[type=text] { min-width: min(360px, 100%); flex: none; }

/* Governed documents (plan/49 DOC-04). The preview column holds a sandboxed frame; everything around
   it is redrawn in place, so the frame never reloads on a selection or a tab switch. */
.doc-page { max-width: none; }
@media (max-width: 640px) {
  .doc-page .page-head { flex-wrap: wrap; }
  .doc-page .page-head .actions { margin-left: 0; flex-wrap: wrap; }
  .doc-new-form select { max-width: 100%; }
}
.doc-register .page-head .actions { min-width: 0; max-width: 100%; }
.doc-register .grid.c4 { margin-bottom: 14px; }
.doc-register-tools { padding: 12px; border-bottom: 1px solid var(--line); margin: 0; }
.doc-table td { vertical-align: top; }
.doc-table td:first-child { width: 36%; }
.doc-table-wrap { overflow-x: auto; }
.doc-controls { margin: -8px 0 10px; }
.doc-controls .grow { flex: 1; }
.doc-lock-note, .doc-old, .doc-banner { margin-bottom: 10px; }
.doc-old { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.doc-ws { display: grid; grid-template-columns: 250px minmax(0, 1fr) 390px; gap: 14px; align-items: start; }
@media (max-width: 1500px) { .doc-ws { grid-template-columns: 210px minmax(0, 1fr) 340px; } }
@media (max-width: 1150px) { .doc-ws { grid-template-columns: minmax(0, 1fr); } }
.doc-outline { position: sticky; top: calc(var(--topbar-height) + 12px); max-height: calc(100dvh - var(--topbar-height) - 24px); overflow: auto; padding: 10px 6px; }
.doc-outline .sect { margin: 0 8px 6px; }
.doc-row { display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }
.doc-row:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); text-decoration: none; color: var(--ink); }
.doc-row.active { background: var(--accent-soft); color: var(--accent-ink); }
.doc-row-tag { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex: none; min-width: 26px; }
.doc-row-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-badge { flex: none; font-size: 10.5px; font-weight: 600; border-radius: 9px; padding: 0 6px; line-height: 16px; }
.doc-badge.c { color: var(--warn-ink); background: var(--warning-soft); }
.doc-badge.p { color: var(--crit-ink); background: var(--critical-soft); }
.doc-centre { min-width: 0; }
.doc-selection { padding: 10px 12px; margin-bottom: 10px; }
.doc-selection .toolbar { margin: 8px 0 0; }
.doc-quote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--warning); color: var(--ink-2);
  font-size: 12.5px; white-space: pre-wrap; }
.doc-editor { margin-bottom: 10px; }
.doc-editor .spread { gap: 8px; margin-bottom: 8px; }
.doc-editor .toolbar { margin: 8px 0 0; }
.doc-source { width: 100%; font: 12px/1.45 var(--mono); }
.doc-summary { flex: 1; min-width: 220px; }
.doc-preview { overflow: hidden; background: #fff; }
.doc-frame { display: block; width: 100%; height: calc(100vh - 150px); min-height: 560px; border: 0; background: #fff; }
.doc-preview-error { padding: 16px; background: var(--panel); }
.doc-side { min-width: 0; position: sticky; top: calc(var(--topbar-height) + 12px); }
.doc-tabs { margin: 0 0 10px; overflow-x: auto; flex-wrap: wrap; row-gap: 2px; }
.doc-tabs a { padding: 8px 7px; white-space: nowrap; }
.doc-count { display: inline-block; font-size: 10.5px; border-radius: 9px; padding: 0 6px; margin-left: 3px;
  background: var(--accent-soft); color: var(--accent-ink); }
.doc-panel { max-height: calc(100dvh - var(--topbar-height) - 80px); overflow: auto; padding-right: 2px; }
.doc-panel .card { padding: 10px 12px; margin-bottom: 8px; }
.doc-panel .card + .card { margin-top: 0; }
.doc-panel .toolbar { margin: 6px 0 0; }
.doc-panel .sect { margin-top: 12px; }
.doc-composer textarea, .doc-cev-form textarea { width: 100%; margin-top: 6px; }
.doc-composer select { margin-top: 6px; }
.doc-composer-hint { margin-bottom: 8px; }
.doc-filter { margin: 4px 0 8px !important; }
.doc-comment.active, .doc-rev.active { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.doc-comment-body { white-space: pre-wrap; margin: 6px 0 4px; line-height: 1.45; }
.doc-event { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 6px; }
.doc-set-preview { margin: 8px 0; }
.doc-decided { margin-top: 10px; }
.doc-decided .doc-event { margin: 6px 10px; }
.doc-link { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-link .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.doc-link-form { margin-top: 10px !important; }
.doc-link-form input { flex: 1; min-width: 160px; }
.doc-file .kv { grid-template-columns: 150px 1fr; margin-top: 6px; font-size: 12px; }
.doc-faults ul { margin: 0 0 6px 18px; padding: 0; font-size: 12.5px; }
.doc-faults li { margin: 2px 0; }
.doc-redline .rl { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.doc-redline .rl:last-child { border-bottom: none; }
.doc-redline .rl > b { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; margin-right: 4px; }
.doc-redline .rl.add > b { color: var(--good-ink); }
.doc-redline .rl.del > b { color: var(--crit-ink); }
.doc-redline .rl.chg > b, .doc-redline .rl.mov > b { color: var(--warn-ink); }
.doc-redline .rl-text { margin-top: 4px; line-height: 1.5; }
.doc-redline pre { white-space: pre-wrap; font-size: 11px; max-height: 160px; overflow: auto; }
.doc-redline ins { text-decoration: none; color: var(--good-ink); background: var(--good-soft); border-radius: 2px; }
.doc-redline del { color: var(--crit-ink); background: var(--critical-soft); border-radius: 2px; }
.doc-card { margin-bottom: 14px; }
.doc-card .sect { margin-top: 12px; }
.doc-card-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.doc-card-row:last-child { border-bottom: none; }
.doc-card-row .grow { flex: 1; min-width: 0; }
.doc-card-row .main { font-weight: 500; }
/* plan/49 DOC-05: the agent */
.doc-collateral { color: var(--warn-ink); background: var(--warning-soft); }
.doc-agent-strip { display: flex; align-items: flex-start; gap: 8px; }
.doc-agent-strip .spin { margin-top: 2px; }
/* plan/49 DOC-07: a file whose record has changed since it was made */
.doc-source-changed { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.doc-source-changed details { flex-basis: 100%; }
.doc-source-list { margin: 4px 0 0 18px; padding: 0; }
.doc-source-list li { margin: 2px 0; overflow-wrap: anywhere; }
/* plan/49 DOC-08: approval and release */
.doc-approved-tiles { margin-top: 12px; }
/* Ticket 276: the store audit, and what stands in for a file the store does not hold */
.doc-store-audit:empty { display: none; }
.doc-audit { margin-top: 12px; }
.doc-audit-row { gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.doc-audit-row a { min-width: 0; overflow-wrap: anywhere; }
.doc-file-state { margin: 6px 0; }
.doc-approval-state { margin: 10px 0; }
.doc-approval-state .toolbar { margin-top: 8px; }
.doc-approval { padding: 8px 0; border-bottom: 1px solid var(--line); }
.doc-approval:last-child { border-bottom: none; }
/* plan/49 DOC-09: decks */
.doc-badge.w { color: var(--crit-ink); background: var(--critical-soft); }
.doc-slide-row { border-top: 1px solid var(--line); margin-top: 2px; }
.doc-slide-row .doc-row-tag { font-weight: 600; }
.doc-budget-note { margin: 4px 0 6px; }

/* plan/53: implementation builds — process cards with their folders, a chooser bar, a file preview. */
.build-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.build-layout:has(> .build-side:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.build-process h3, .build-side h3 { margin: 0; font-size: 15px; }
.build-actions { display: flex; gap: 6px; flex: none; }
.build-folder { margin-top: 12px; }
.build-folder-head { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--line); }
.build-file { display: flex; align-items: center; gap: 10px; padding: 5px 2px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.build-file:last-child { border-bottom: 0; }
.build-file .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.build-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px;
  position: sticky; top: calc(var(--topbar-height) + env(safe-area-inset-top, 0px)); z-index: 5; }
.build-bar .grow { flex: 1; min-width: 180px; }
.build-bar select { max-width: 260px; }
.build-bar .btn.disabled { opacity: .45; pointer-events: none; }
.build-bar-msg { flex-basis: 100%; }
.build-bar-msg:empty { display: none; }
.build-side { position: sticky; top: calc(var(--topbar-height) + 76px); max-height: calc(100dvh - var(--topbar-height) - 100px); display: flex; flex-direction: column; }
.build-preview { flex: 1; overflow: auto; margin: 10px 0 0; padding: 10px 12px; background: var(--sunken);
  border: 1px solid var(--line); border-radius: var(--r-sm); font: 12px/1.5 var(--mono); white-space: pre; }
@media (max-width: 1100px) { .build-layout:has(> .build-side:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .build-side { position: static; max-height: none; } }

/* ---- EPM implementation tests (plan/54) ---- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 12px; margin: 8px 0; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2, inherit); }
.form-grid select, .form-grid input { min-width: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover { background: var(--hover, rgba(0,0,0,.03)); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.bad td { color: var(--crit-ink); background: var(--critical-soft); }
.outline-detail { overflow: auto; }
.scroll-x { overflow-x: auto; flex-shrink: 0; }    /* inside a flex column (the run detail) it must keep its table's height */

/* ------------------------------------------------------------- plan (plan/57) */
.plan-line { position: relative; height: 58px; margin: 4px 0 18px; }
.plan-seg { position: absolute; top: 0; height: 44px; padding: 5px 7px; overflow: hidden; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--raised); box-sizing: border-box; }
.plan-seg + .plan-seg { border-left-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.plan-seg .n { display: block; font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.plan-seg .d { display: block; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.plan-seg.passed { background: var(--good-soft); border-color: color-mix(in srgb, var(--good-ink) 30%, transparent); }
.plan-seg.current { background: var(--accent-soft); border-color: var(--accent); }
.plan-seg.late:not(.current):not(.passed) { background: var(--warning-soft); }
.plan-seg.presales { border-style: dashed; }
.plan-seg.not-pursued { opacity: .45; }
.plan-today { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 2px solid var(--accent); }
.plan-today span { position: absolute; bottom: -2px; left: 4px; font: 500 10.5px var(--mono); color: var(--accent-ink); }
.plan-stage { margin-top: 12px; }
.plan-stage.current { border-color: var(--accent); }
.plan-stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.plan-stage-head h3 { margin: 0; font-size: 15px; }
.plan-stage-head input[type="date"], .plan-items input[type="date"], .plan-stage .dim2 input[type="date"] { font-size: 12px; padding: 2px 4px; }
.plan-items { margin-top: 8px; }
.plan-items tr.dim td { opacity: .6; }
.plan-save { margin: 12px 0; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.plan-gate { margin: 6px 0 2px; font-size: 12.5px; color: var(--warn-ink); }
.plan-gate.ready, .plan-gate.passed { color: var(--good-ink); }
.plan-items .linkish { border: 0; background: none; padding: 0; margin-top: 4px; font: inherit; font-size: 12px;
  color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.plan-act td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.plan-act-grid { display: grid; gap: 6px; }
.plan-act-grid .toolbar { margin: 0; flex-wrap: wrap; }
.plan-next td { vertical-align: top; }
@media (max-width: 720px) { .plan-actions { flex-direction: column; align-items: stretch; } }
@media (max-width: 720px) {
  .plan-seg .d { display: none; }
  .plan-line { height: 48px; }
}

/* plan/58: the delivery registers (Risks & issues, and the pages after it) */
.raid-list tbody tr { cursor: pointer; }
.raid-list tbody tr.sel td { background: var(--accent-soft); }
.raid-detail { margin-top: 14px; }
.raid-detail h3 { margin: 0; }
.raid-form { margin-top: 10px; }
.raid-form select[multiple] { min-height: 96px; }
.raid-filter { margin: 10px 0; }
.raid-list td.mono { white-space: nowrap; }
.effort-capacity tr.over td { background: var(--warning-soft); }
.effort-estimates td input { margin-right: 4px; }
@media (max-width: 640px) { .effort .page-head { flex-wrap: wrap; } .effort .page-head .actions { margin-left: 0; } }
.cutover-steps tr.next td { background: var(--accent-soft); }
.testing-steps { margin: 4px 0 4px 18px; padding: 0; }
.testing-steps li { margin: 6px 0; }
.testing-evidence { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin: 4px 0; }
.testing-evidence img { width: 160px; max-height: 110px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.testing-steps-row td { background: color-mix(in srgb, var(--ink) 3%, transparent); }

/* plan/69 work items: the board, the list as a tree, an item's hub, and the card that links back to them */
.work .crumb { overflow-wrap: anywhere; }
.work-modes { margin-bottom: 12px; }
.work-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: start; }
.work-col { min-width: 0; padding: 8px; background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r); }
.work-col h3 { display: flex; align-items: center; gap: 6px; margin: 2px 4px 8px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.work-col h3 .cnt { margin-left: auto; font: 500 11px var(--mono); color: var(--ink-3); }
.work-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-bottom: 8px; padding: 9px 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.work-card:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); text-decoration: none; }
.work-card.late { border-left: 3px solid var(--warn-ink); }
.work-card .work-title { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.work-card .work-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11.5px; color: var(--ink-2); }
.work-card .pill { align-self: flex-start; }
.work-ref { font-size: 11px; color: var(--ink-3); }
.page-head h1 .work-ref { font-size: 15px; vertical-align: middle; }
.work-none { padding: 4px; font-size: 12px; color: var(--ink-3); }
.work-closed-bar { margin: 12px 0 8px; }
.work-closed { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.work-closed .work-card { margin: 0; opacity: .8; }
.work-filter { margin: 10px 0; align-items: flex-end; }
.work-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.work-facts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.work-source { margin-top: 4px; color: var(--ink-3); overflow-wrap: anywhere; }
.work-actions .toolbar { margin-bottom: 6px; }
.work-form { margin: 10px 0; }
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 12px; margin-bottom: 12px; }
.work-grid .work-wide { grid-column: 1 / -1; }
.work-grid > * { min-width: 0; }
.work-grid label.fld > input, .work-grid label.fld > select { min-width: 0; }
/* A long item title in a picker narrows to the page instead of widening it. */
.work-grid select, .work-form select, .work-link-form select, .work-filter select { max-width: 100%; }
.work-form .toolbar label.fld, .work-link-form .toolbar label.fld, .work-filter label.fld { min-width: 0; max-width: 100%; }
.work .page-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.work-form .toolbar label.fld.grow, .work-link-form .toolbar label.fld.grow { flex: 1 1 220px; }
.work-entries td.mono { white-space: nowrap; }
.work-meeting { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0 0 12px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow-wrap: anywhere; }
.work-hub { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 12px; }
.work-hub h3 { margin: 0 0 8px; font-size: 14px; }
.work-hub .card + .card { margin-top: 12px; }
.work-brief { margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.work-accept, .work-files, .work-timeline, .work-link-group ul, .work-backlinks ul { list-style: none; margin: 0; padding: 0; }
.work-accept li { margin: 4px 0; }
.work-accept label { display: flex; align-items: flex-start; gap: 8px; overflow-wrap: anywhere; }
.work-link-group { margin-bottom: 10px; }
.work-link-group .k { margin-bottom: 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.work-link-group li, .work-files li, .work-backlinks li { padding: 3px 0; overflow-wrap: anywhere; }
.work-link-group li.unavailable { color: var(--ink-3); }
.work-link-form, .work-upload { margin-top: 10px; }
.work-upload input[type="file"] { min-width: 0; max-width: 100%; }
.work-effort { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.work-effort > div { display: flex; flex-direction: column; min-width: 0; }
.work-effort .k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.work-effort .v { font-size: 18px; font-variant-numeric: tabular-nums; }
.work-effort .d { font-size: 11.5px; color: var(--ink-3); }
.work-entries tr.voided td { color: var(--ink-3); text-decoration: line-through; }
.work-timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; overflow-wrap: anywhere; }
.work-timeline li:last-child { border-bottom: 0; }
.work-backlinks h3 { margin: 0 0 6px; font-size: 13px; }
@media (max-width: 900px) {
  .work-board { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .work-hub { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- email (plan/61) */
.mail .page-head { flex-wrap: wrap; }
.mail .page-head .actions { flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; }
.mail-tabs { margin-top: 4px; overflow: auto hidden; }
.mail-tabs a { white-space: nowrap; }
.mail-tabs .count { margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 9px;
  background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink-2); }
.mail #emailStatus:empty { display: none; }
.mail-split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .mail-split { grid-template-columns: minmax(0, 1fr); } }
/* From 901 px the split fills the window under the top bar, and the list and the reader each scroll inside their own pane
   (ticket 308). A short window keeps a usable pane height and the page scrolls instead; so do open mail settings, above a
   split that still fills the window. Tasks and the Calendar have no reader, so the page scrolls as before. */
@media (min-width: 901px) {
  .mail:has(> .mail-split:not(.desk-tasks-mode)) { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar-height));
    min-height: 620px; padding-bottom: 16px; }
  .mail:has(> .mail-split:not(.desk-tasks-mode)) > * { flex: none; }
  .mail > .mail-split:not(.desk-tasks-mode) { flex: 1 1 0; min-height: 420px; align-items: stretch; grid-template-rows: minmax(0, 1fr); }
  .mail:has(> details[open]):has(> .mail-split:not(.desk-tasks-mode)) { height: auto; }
  .mail:has(> details[open]) > .mail-split:not(.desk-tasks-mode) { flex: none; height: calc(100dvh - var(--topbar-height) - 16px); }
  .mail-split:not(.desk-tasks-mode) > .mail-list { min-height: 0; overflow: hidden auto; }
  .mail-split:not(.desk-tasks-mode) > .mail-read { min-height: 0; overflow: auto; }
  .mail-split:not(.desk-tasks-mode) > .mail-list > .mail-list-h { position: sticky; top: 0; z-index: 1; }
}
.mail-list { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: hidden; min-width: 0; }
.mail-list-h { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px 7px 12px;
  border-bottom: 1px solid var(--line); background: var(--raised); font-size: 12px; color: var(--ink-3); }
.mail-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--line); padding: 10px 12px; color: var(--ink); }
.mail-item:last-child { border-bottom: 0; }
.mail-item:hover:not(:disabled) { background: var(--raised); border-color: var(--line); }
.mail-item.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-item > span { display: block; }
.mail-item-top { display: flex !important; justify-content: space-between; gap: 8px; font-size: 12.5px; min-width: 0; }
.mail-item-top > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail .from { font-weight: 600; }
.mail .when { color: var(--ink-3); flex: none; font-size: 12px; }
.mail .subj { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail .snippet { font-size: 12px; color: var(--ink-3); margin-top: 3px; display: -webkit-box !important;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-item .chips { display: flex !important; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.mail-item .chips:empty { display: none !important; }
.mail-read { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 16px 18px; min-width: 0; }
.mail-read h2 { margin: 0 0 6px; font-size: 18px; overflow-wrap: anywhere; }
.mail-meta { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; margin-top: 2px; }
.mail-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.mail-head .mail-actions { padding-top: 10px; border-top: 1px solid var(--line); margin-top: 12px; }
.mail-actions .grow { flex: 1; }
.mail-actions label.fld.inline { flex-direction: row; align-items: center; gap: 8px; }
.mail-actions label.fld.inline > select { min-width: 0; max-width: 260px; }
.mail-card { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); padding: 12px 14px; margin-top: 12px; }
.mail-card h3 { margin: 0 0 6px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--ink); }
.mail-card h3 .note { font-weight: 400; }
.mail-card p { margin: 6px 0; font-size: 13px; }
.mail-card ul { margin: 6px 0 0 18px; padding: 0; font-size: 13px; }
.mail-card li { margin: 3px 0; }
.mail-card label.fld { margin-top: 8px; }
.mail-card textarea, .mail-card input { width: 100%; box-sizing: border-box; }
.mail-reply-text, .mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.mail-reply-text { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 10px 12px; margin: 8px 0; max-width: 90ch; }
/* A plain message keeps a readable line however wide the reader gets (ticket 308), and its divider still crosses the pane.
   A formatted one does the same in its frame, where its tables can use the pane. */
.mail-body { padding: 12px max(14px, calc(100% - 90ch)) 12px 14px; border-top: 1px solid var(--line); }
.mail-read details.box { margin-top: 12px; }
/* A preview comes after the repaint that asked for it, and the reader goes back to its place at once (ticket 308): while empty,
   a preview holds the height its frame will have (mail_preview.js). A failed one says so in a line. */
.mail-read :is([data-stored-preview], #deskDraftPreview, #cmpPreview, #emailPreview):empty { min-height: max(240px, min(480px, 70vh)); }
.mail-rows { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.mail-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px 16px; padding: 12px 14px;
  border-top: 1px solid var(--line); align-items: end; }
.mail-row:first-child { border-top: 0; }
.mail-row .controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; justify-content: flex-end; }
.mail-row .controls label.fld > select { min-width: 140px; max-width: 100%; }
.mail-row details.box { margin: 6px 0 0; }
@media (max-width: 900px) { .mail-row { grid-template-columns: minmax(0, 1fr); } .mail-row .controls { justify-content: flex-start; } }
.mail-settings { display: grid; gap: 14px; }
.mail-section { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 14px 16px; min-width: 0; }
.mail-section h2 { font-size: 15px; margin: 0 0 4px; }
.mail-section > .note { margin: 0 0 10px; }
.mail-switch { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.mail-switch input { margin-top: 3px; flex: none; }
.mail-switch .t { font-weight: 500; font-size: 13px; }
.mail-switch .s { font-size: 12px; color: var(--ink-3); }
.mail-lines select { width: 100%; min-width: 0; padding: 3px 7px; font-size: 12.5px; }
.mail-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 12px; }
.mail-add label.fld { flex: 1 1 180px; min-width: 0; }
.mail-add label.fld > input, .mail-add label.fld > select { min-width: 0; width: 100%; box-sizing: border-box; }
@media (max-width: 900px) { .mail-read:has(> .empty) { display: none; } }

/* ------------------------------------------------------------- my mail (plan/68) */
.desk .mail-item.unread .from, .desk .mail-item.unread .subj { font-weight: 700; }
.desk .mail-item.unread { box-shadow: inset 3px 0 0 var(--accent); }
.desk .mail-item.unread.on { box-shadow: inset 3px 0 0 var(--accent); }
.desk .desk-more { text-align: center; color: var(--accent-ink); font-size: 12.5px; }
.desk .desk-pad { padding: 10px 12px; }
.desk #deskStatus:empty { display: none; }
.desk-connect { max-width: 680px; }
.desk-connect p { font-size: 13px; margin: 8px 0; }
.desk-points { margin: 6px 0 10px 18px; padding: 0; font-size: 13px; color: var(--ink-2); }
.desk-points li { margin: 4px 0; }
.desk-body { border-top: 1px solid var(--line); margin-top: 14px; padding: 14px max(2px, calc(100% - 90ch)) 0 2px; }
.desk-html { display: block; width: 100%; min-height: 160px; height: 320px; margin-top: 14px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: #fff; color-scheme: light; }
.desk-file-row { display: flex; gap: 10px; flex-wrap: wrap; }
.desk-file-row label.fld { flex: 1 1 200px; min-width: 0; }
.desk-file-row select, .desk-file-row input { width: 100%; box-sizing: border-box; }
.desk-file .mail-switch, .desk-task .mail-switch, .desk-work .mail-switch { border-top: 0; padding: 8px 0 0; }
.mail-card input[type="checkbox"], .mail-card input[type="radio"] { width: auto; }
.desk-file .mail-switch > span, .desk-work .mail-switch > span { display: flex; flex-direction: column; gap: 1px; }
.desk-agent > p { margin: 6px 0 10px; }
.desk-card { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-top: 1px solid var(--line); }
.desk-card .t { flex: 1 1 220px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.desk-suggest { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.desk-draft { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.desk-draft-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.desk-decisions, .desk-blanks { margin: 8px 0; font-size: 13px; }
.desk-decisions > .note { margin-left: 4px; }
.desk-decision { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 6px; background: var(--panel); }
.desk-decision .q { overflow-wrap: anywhere; }
.desk-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.desk-options button { max-width: 100%; white-space: normal; text-align: left; }
.desk-options button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.desk-blanks .fld { margin-top: 6px; }
mark.desk-blank { background: var(--warning-soft); color: inherit; border-radius: 3px; padding: 0 2px; }
.desk-sources { margin: 8px 0; font-size: 13px; }
.desk-sources summary { cursor: pointer; }
.desk-sources ul { list-style: none; margin: 4px 0; padding: 0; }
.desk-sources li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 4px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.desk-records { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; font-size: 13px; }
.desk-records > .note { display: block; margin: 2px 0 6px; }
.desk-record { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 8px; background: var(--panel); }
.desk-record.sent { color: var(--ink-2); }
.desk-closes { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; font-size: 13px; }
.desk-closes > .note { display: block; margin: 2px 0 6px; }
.desk-close { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; margin-top: 8px; background: var(--panel); }
.desk-close.sent { color: var(--ink-2); }
.desk-close-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; overflow-wrap: anywhere; }
.desk .mail-item-top .desk-count { flex: none; margin: 0 auto 0 0; }
.desk-msg.unread { box-shadow: inset 3px 0 0 var(--accent); }
.desk-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; text-align: center;
  font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink-2); }
.desk-thread { display: grid; gap: 8px; margin-top: 12px; }
.desk-msg { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--raised); color: var(--ink); padding: 10px 12px; min-width: 0; box-sizing: border-box; }
.desk-msg.collapsed:hover { border-color: var(--line-strong); }
.desk-msg.mine { border-left: 3px solid var(--accent); }
.desk-msg.unread .from { font-weight: 700; }
.desk-msg > span { display: block; }
.desk-msg-top, .desk-msg-head { display: flex !important; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.desk-msg-top .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 600; }
.desk-msg-head { flex-wrap: wrap; }
.desk-msg-head .from { min-width: 0; overflow-wrap: anywhere; }
.desk-msg .when { margin-left: auto; color: var(--ink-3); font-size: 12px; flex: none; }
.desk-msg .snippet { font-size: 12px; color: var(--ink-3); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-msg.open { background: var(--panel); }
.desk-msg.open.active { box-shadow: 0 0 0 1px var(--accent-soft); }
.desk-msg-fold { padding: 0; border: 0; background: none; color: var(--ink); font: 600 13px var(--sans); cursor: pointer; }
.desk-msg .desk-html { margin-top: 10px; }
/* The open conversation unfolds in the list into its messages (Outlook's conversation view). */
.desk-children { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--raised) 55%, transparent); }
.desk .mail-item.desk-child { position: relative; padding: 7px 12px 7px 28px; border-bottom: 1px dashed var(--line); }
.desk .mail-item.desk-child:last-child { border-bottom: 0; }
.desk .mail-item.desk-child::before { content: ""; position: absolute; left: 16px; top: 0; bottom: 0; border-left: 1px solid var(--line-strong); }
.desk .mail-item.desk-child .snippet { -webkit-line-clamp: 1; }
.desk .mail-item.desk-child .from { font-weight: 500; }
.desk .mail-item.desk-child.unread .from { font-weight: 700; }
.desk .mail-item.desk-child .pill { margin-right: auto; }
.desk .mail-item[aria-expanded="true"] { border-bottom-color: transparent; }
.desk-codex select { max-width: 320px; }
.desk-undo { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.desk-pinned-h { padding: 6px 12px; font-size: 11.5px; border-bottom: 1px solid var(--line); background: var(--raised); }
#deskCodexSearch[aria-pressed="false"] { color: var(--ink-3); }
.mail-split.desk-tasks-mode { grid-template-columns: minmax(0, 1fr); }
.mail-split.desk-tasks-mode #deskList { border: 0; background: transparent; }
.mail-split.desk-tasks-mode #deskRead { display: none; }
.desk-tasks { max-width: 860px; }
.desk-task-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.desk-task-row input { margin-top: 3px; flex: none; }
.desk-task-text { flex: 1; min-width: 0; }
.desk-task-text .t { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.desk-task-text .s { color: var(--ink-3); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }
.desk-task-row.done .t { text-decoration: line-through; color: var(--ink-3); }
.desk-agenda { max-width: 860px; }
.desk-day h3 { margin: 14px 0 4px; font-size: 13px; }
.desk-event { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.desk-event-time { flex: 0 0 150px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.desk-event-text { flex: 1 1 220px; min-width: 0; }
.desk-event-text .t { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.desk-event-text .s { color: var(--ink-3); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; white-space: pre-wrap; }
.desk-event-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.desk-event.cancelled .t { text-decoration: line-through; color: var(--ink-3); }
.desk-event.private .t { color: var(--ink-2); font-style: italic; }
.desk-event.on { background: var(--accent-soft); }
.desk-respond { margin-bottom: 12px; }
.desk-respond h3 { overflow-wrap: anywhere; }
.desk-respond-choice { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; }
.desk-respond-propose { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: 10px; font-size: 13px; }
.desk-respond-propose label.fld { flex: 1 1 100%; min-width: 0; margin-top: 2px; }
.desk-respond-propose label.fld > input { min-width: 0; max-width: 260px; }
.desk-recommend { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; overflow-wrap: anywhere; }
.desk-recommend p { margin: 0 0 6px; }
.desk-prepared { margin-top: 8px; padding: 10px 12px; border: 1px solid var(--accent, var(--line)); border-radius: var(--r-sm); font-size: 13px; overflow-wrap: anywhere; }
.desk-prepared p { margin: 0 0 6px; }
.desk-respond-review { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; }
.desk-respond-review dt { color: var(--ink-3); }
.desk-respond-review dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.desk-related-meeting { overflow-wrap: anywhere; }
.desk-brief { flex: 1 1 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 2px; }
.desk-brief-body { flex: 1 1 100%; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.desk-brief-body summary { cursor: pointer; font-weight: 500; font-size: 12.5px; }
.desk-brief-body h4 { margin: 8px 0 2px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.desk-brief-body ul { margin: 0; padding-left: 18px; }
.desk-brief-cited { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.desk-brief-people { margin: 0; }
.desk-brief-state { flex: 1 1 100%; margin: 0; }
.desk-brief-doubt { flex: 1 1 200px; min-width: 0; color: var(--warn-ink); overflow-wrap: anywhere; }
.desk-brief-settings { margin: 8px 0; }
.desk-brief-settings label { display: block; margin: 6px 0; overflow-wrap: anywhere; }
.desk-brief-settings input[type="number"] { width: 80px; }
.desk-images { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); }

/* ------------------------------------------------------------- people, access and signers (2026-10-17, D32.12a) */
.acc-sect { display: flex; align-items: center; gap: 12px; }
.acc-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; font-weight: 400;
  letter-spacing: 0; text-transform: none; color: var(--ink-2); cursor: pointer; }
.cl-tabs { margin: 0 0 12px; }
.cl-people td { vertical-align: top; }
.card.cl-scroll { overflow-x: auto; }
.cl-people { min-width: 820px; } .cl-history { min-width: 560px; }
.cl-linked { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
select.cl-link { max-width: 260px; font-size: 12.5px; }
/* plan/70 workbooks */
:root {
  --wb-input: #36311a;        /* soft yellow */
  --wb-assumption: #3a2716;   /* soft orange */
  --wb-check: var(--good-soft);
  --wb-output: var(--accent-soft);
}
:root[data-theme="light"] {
  --wb-input: #fff5cc;
  --wb-assumption: #ffe6cf;
}
.wb-page .page-head { flex-wrap: wrap; }
.wb-page .page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.wb-page .page-head h1 { overflow-wrap: anywhere; }
.wb-page .page-head .actions { flex-wrap: wrap; }
.wb-rev-summary { color: var(--ink-3); }
.wb-status { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -8px 0 12px; }
.wb-whatif { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 50%, var(--line)); border-radius: var(--r);
  background: var(--warning-soft); color: var(--ink); }
.wb-whatif b { color: var(--warn-ink); }
.wb-whatif-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.wb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.wb-main, .wb-side { min-width: 0; }
.wb-side { display: grid; gap: 12px; }
.wb-side .card + .card { margin-top: 0; }
.wb-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 6px 8px 0; border-bottom: 1px solid var(--line);
  background: var(--raised); scrollbar-width: thin; }
.wb-tabs button { flex: none; padding: 5px 12px; font-size: 12.5px; color: var(--ink-2); background: transparent;
  border: 1px solid transparent; border-bottom: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; }
.wb-tabs button.on { color: var(--ink); font-weight: 600; background: var(--panel); border-color: var(--line); margin-bottom: -1px; }
.wb-tabs .dot { margin: 0 0 0 2px; }
.wb-bar { display: flex; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); }
.wb-namebox { width: 92px; flex: none; }
.wb-fx-mark { flex: none; color: var(--ink-3); font: italic 13px var(--serif); }
.wb-fx { flex: 1 1 auto; min-width: 0; }
.wb-bar-state { padding: 5px 10px; color: var(--ink-3); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.wb-bar-state:empty { display: none; }
.wb-bar-state.bad { color: var(--crit-ink); background: var(--critical-soft); }
.wb-grid-wrap { overflow: auto; max-width: 100%; max-height: min(68vh, 760px); outline: none; background: var(--panel); }
.wb-grid-wrap:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
table.wb-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.5px; }
.wb-grid th, .wb-grid td { height: 24px; padding: 0 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-grid thead th { position: sticky; top: 0; z-index: 2; background: var(--raised); color: var(--ink-3);
  font-weight: 500; font-size: 11.5px; text-align: center; }
.wb-grid tbody th { position: sticky; left: 0; z-index: 1; background: var(--raised); color: var(--ink-3);
  font-weight: 500; font-size: 11.5px; text-align: right; }
.wb-grid thead th.wb-corner { left: 0; z-index: 3; }
.wb-grid th.on { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 16%, var(--raised)); }
.wb-grid td { position: relative; cursor: cell; }
.wb-grid td.num { text-align: right; }
.wb-grid td.mid { text-align: center; }
.wb-grid td.r-input, .wb-legend i.r-input { background: var(--wb-input); }
.wb-grid td.r-assumption, .wb-legend i.r-assumption { background: var(--wb-assumption); }
.wb-grid td.r-check, .wb-legend i.r-check { background: var(--wb-check); }
.wb-grid td.r-output, .wb-legend i.r-output { background: var(--wb-output); }
.wb-grid td.r-label { color: var(--ink-2); }
.wb-grid td.err, .wb-legend i.err { color: var(--crit-ink); font-weight: 600; background: var(--critical-soft); }
.wb-grid td.bad, .wb-legend i.bad { box-shadow: inset 0 0 0 2px var(--critical); }
.wb-grid td.over { box-shadow: inset 0 0 0 2px var(--warning); font-style: italic; }
.wb-grid td.open::before, .wb-legend i.open::before { content: ""; position: absolute; top: 0; left: 0;
  border-style: solid; border-width: 7px 7px 0 0; border-color: var(--warning) transparent transparent transparent; }
.wb-grid td.noted::after, .wb-legend i.noted::after { content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--accent) transparent transparent; }
.wb-grid td.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.wb-window-note { padding: 6px 10px; border-top: 1px solid var(--line); }
.wb-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 10px; border-top: 1px solid var(--line); color: var(--ink-3); }
.wb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wb-legend i { position: relative; display: inline-block; width: 14px; height: 14px; border: 1px solid var(--line-strong);
  border-radius: 3px; overflow: hidden; background: var(--panel); }
.wb-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wb-card-head h3 { font-size: 14px; }
.wb-cell-ref { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.wb-facts { display: grid; gap: 4px; margin: 6px 0 4px; }
.wb-facts > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
.wb-facts dt { color: var(--ink-3); font-size: 11.5px; padding-top: 1px; }
.wb-facts dd { margin: 0; overflow-wrap: anywhere; }
.wb-facts dd.wb-err { color: var(--crit-ink); font-weight: 600; }
.wb-sect { margin: 14px 0 5px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.wb-sect-n { margin-left: 6px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.wb-nosource { color: var(--warn-ink); }
.wb-cell label.fld { margin-top: 10px; }
.wb-cell select, .wb-cell textarea { width: 100%; min-width: 0; }
.wb-note { display: grid; gap: 6px; justify-items: start; }
.wb-note label { width: 100%; }
.wb-evidence, .wb-implements { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wb-evidence li { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised);
  font-size: 12.5px; overflow-wrap: anywhere; }
.wb-evidence li.wb-open { border-color: color-mix(in srgb, var(--warning) 55%, var(--line)); background: var(--warning-soft); }
.wb-evidence li.wb-open b { display: block; color: var(--warn-ink); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.wb-evidence li.wb-open p { margin: 3px 0 0; color: var(--ink); font-size: 13px; font-weight: 500; }
.wb-ev-kind { margin-right: 6px; color: var(--ink-3); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.wb-implements li { overflow-wrap: anywhere; }
.wb-trace-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
button.wb-link { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; }
button.wb-link.mono { font-family: var(--mono); font-size: 12px; }
button.wb-link:hover:not(:disabled) { text-decoration: underline; }
.wb-trace ul, .wb-ready ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 5px; }
.wb-trace li, .wb-ready li { font-size: 12.5px; overflow-wrap: anywhere; }
.wb-trace li .mono.small { display: block; color: var(--ink-3); }
.wb-trace-role { color: var(--ink-3); font-size: 11.5px; }
.wb-group { margin-top: 8px; }
.wb-group summary { cursor: pointer; font-size: 12.5px; }
.wb-question b { font-weight: 500; }
.wb-tests { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.wb-test { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.wb-test-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wb-test .small { margin-top: 3px; overflow-wrap: anywhere; }
.wb-accept { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.wb-accept input { flex: 1 1 140px; min-width: 0; }
.wb-form-status { flex-basis: 100%; color: var(--crit-ink); overflow-wrap: anywhere; }
.wb-form-status:empty { display: none; }
.wb-lower { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; align-items: start; }
.wb-lower > div { min-width: 0; }
.wb-submit { display: grid; gap: 6px; margin-bottom: 10px; }
.wb-submit textarea, .wb-approve textarea { width: 100%; min-width: 0; }
.wb-submit .row, .wb-approve .row, .wb-form .row { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.wb-version { padding: 10px 0; border-top: 1px solid var(--line); }
.wb-version-head, .wb-run { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wb-run { margin-top: 6px; font-size: 12.5px; }
.wb-version-note, .wb-decision { margin: 6px 0 0; overflow-wrap: anywhere; }
.wb-approve { display: grid; gap: 6px; margin-top: 8px; padding: 9px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--sunken); }
.wb-revs { list-style: none; margin: 0; padding: 0; }
.wb-revs > li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.wb-revs > li.cur .wb-rev-line b { color: var(--accent-ink); }
.wb-rev-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wb-rev-line button { margin-left: auto; }
.wb-diff { margin-top: 8px; }
.wb-diff-tbl td { vertical-align: top; font-size: 12px; }
.wb-diff-tbl td.mono { overflow-wrap: anywhere; min-width: 90px; }
.wb-scroll { max-width: 100%; overflow-x: auto; }
.wb-form { display: grid; gap: 10px; margin-bottom: 12px; }
.wb-form h3 { font-size: 14px; }
.wb-form p { margin: 0; }
.wb-form label.fld { flex: 1 1 220px; min-width: 0; }
.wb-form label.fld > input, .wb-form label.fld > select { width: 100%; min-width: 0; }
.wb-import-report { margin-bottom: 12px; }
.wb-import-report ul { margin: 4px 0; padding-left: 18px; }
/* plan/72: one financial model — the register's calculations with no model, and a model's sections as tabs. */
.wb-ptabs { margin: 12px 0; overflow-x: auto; overflow-y: hidden; padding-bottom: 1px; scrollbar-width: thin; }
.wb-ptabs a { white-space: nowrap; flex: none; }
.wb-questions, .wb-assumptions, .wb-sources, .wb-tests-card { margin-bottom: 12px; }
/* Fixed columns: a long value or source wraps in its own column instead of squeezing the others to a letter. */
.wb-question-tbl, .wb-source-tbl { table-layout: fixed; }
.wb-question-tbl td { vertical-align: top; overflow-wrap: anywhere; }
.wb-question-tbl th:nth-child(1) { width: 44px; }
.wb-question-tbl th:nth-child(3) { width: 22%; }
.wb-question-tbl th:nth-child(4) { width: 34%; }
.wb-qcells { display: grid; gap: 2px; }
.wb-cell-label { color: var(--ink-2); font-size: 12px; }
.wb-more { margin-top: 3px; font-size: 12px; }
.wb-more summary { cursor: pointer; color: var(--ink-3); }
.wb-cell-name { margin: -4px 0 8px; font-weight: 500; overflow-wrap: anywhere; }
.wb-confirm { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-confirm input { flex: 1 1 160px; min-width: 0; }
.wb-source-tbl td { vertical-align: top; overflow-wrap: anywhere; }
.wb-source-tbl th:nth-child(1) { width: 30%; }
.wb-source-tbl th:nth-child(2) { width: 16%; }
.wb-source-tbl td .main { margin-bottom: 2px; }
.wb-source-tbl tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.wb-source-tbl .wb-evidence li { padding: 4px 7px; }
.wb-unmodelled { margin-top: 12px; }
.wb-model-it { text-align: right; width: 1%; white-space: nowrap; }
.wb-for-calculation { margin: 0 0 6px; }
.wb-calc-models ul { margin: 0 0 8px; padding-left: 18px; }
.wb-coverage, .wb-links, .wb-epm-tables, .wb-epm-bindings, .wb-epm-made, .wb-evaluation { margin-bottom: 12px; }
.wb-coverage-tbl td { vertical-align: top; }
.wb-coverage-tbl tr.bad td:first-child, .wb-epm-bindings tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.wb-link-group ul, .wb-related-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
.wb-link-group li, .wb-related-list li, .wb-implements li { display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.wb-link-form label.fld { flex: 1 1 200px; min-width: 0; }
.wb-link-form label.fld > input, .wb-link-form label.fld > select { width: 100%; min-width: 0; }
.wb-implement { display: flex; gap: 6px; margin: 4px 0 8px; }
.wb-implement input { flex: 1 1 auto; min-width: 0; }
.wb-release { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.wb-eval-group + .wb-eval-group { margin-top: 14px; }
.wb-eval-cells { margin-top: 6px; }
@media (max-width: 700px) {
  .wb-source-tbl thead, .wb-question-tbl thead, .wb-question-tbl td:first-child { display: none; }
  .wb-source-tbl, .wb-source-tbl tbody, .wb-source-tbl tr, .wb-source-tbl td,
  .wb-question-tbl, .wb-question-tbl tbody, .wb-question-tbl tr, .wb-question-tbl td { display: block; width: 100%; }
  .wb-source-tbl tr, .wb-question-tbl tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
  .wb-source-tbl td, .wb-question-tbl td { border: 0; padding: 2px 0; white-space: normal; }
  .wb-source-tbl tr.bad td:first-child { box-shadow: none; }
  .wb-source-tbl tr.bad { box-shadow: inset 3px 0 0 var(--critical); padding-left: 8px; }
}
@media (max-width: 1100px) { .wb-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1000px) { .wb-lower { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .wb-page .page-head .actions { margin-left: 0; flex: 1 1 100%; min-width: 0; }
  .wb-grid-wrap { max-height: 60vh; }
  .wb-whatif-actions { margin-left: 0; }
}
/* plan/73: client Meetings tab */
.cm-langs { display: flex; flex-wrap: wrap; gap: 6px 14px; }
/* Ingestion: the Sources list on the one-line table (ticket 302) */
.ing-tiles { margin-bottom: 12px; }
.ing-tiles.still > * { animation: none; }
.ing-warn { margin-bottom: 12px; }
.ing-tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.ing-tabs button { border-radius: 999px; }
.ing-tabs button.on { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.ing-tabs .n { font: 600 11px var(--mono); margin-left: 4px; color: var(--ink-3); }
.ing-foot { margin-top: 8px; }
.ing-panel { display: flex; flex-direction: column; gap: 10px; }
.ing-summary { color: var(--ink); }
.ing-panel .kv { grid-template-columns: 110px minmax(0, 1fr); }

/* Long Oracle job logs remain readable in Details without stretching the list. */
.operation-outcome { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden; overflow-wrap: anywhere; line-height: 1.45; max-height: 4.35em; }
.operation-log { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }

.meeting-shell-page { height: calc(100dvh - var(--topbar-height) - 16px); min-height: 600px; }
.meeting-shell-frame { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 800px) { .meeting-shell-page { height: calc(100dvh - var(--topbar-height) - 16px); } }

/* Environment Settings keeps long Oracle host hints inside the form on narrow screens. */
[data-env-form] { overflow-wrap:anywhere; }
[data-env-form] .fld { min-width:0; }
[data-env-form] input, [data-env-form] select { box-sizing:border-box; max-width:100%; }
@media (max-width:720px) {
  [data-env-form] > .grid.c2 { grid-template-columns:minmax(0,1fr); }
}

/* Shared model defaults (ticket124). */
.model-defaults { min-width:0; }
.md-table-scroll { max-width:100%; overflow:auto; margin-top:8px; border:1px solid var(--line); border-radius:6px; }
.md-settings-table { width:100%; min-width:1080px; table-layout:fixed; border-collapse:collapse; font-size:12px; }
.md-settings-table .md-col-setting { width:17%; }.md-col-source { width:21%; }.md-col-provider { width:13%; }.md-col-model { width:20%; }.md-col-effort { width:11%; }.md-col-actions { width:18%; }
.md-settings-table th,.md-settings-table td { padding:5px 7px; text-align:left; border-bottom:1px solid var(--line); vertical-align:middle; overflow-wrap:anywhere; }
.md-settings-table thead th { font-size:11px; color:var(--ink-2); padding:8px 7px; background:var(--panel,#fff); }
.md-settings-table tbody .md-purpose { height:46px; }
.md-settings-table select { width:100%; min-width:0; max-width:100%; height:30px; font-size:12px; padding:3px 5px; box-sizing:border-box; }
.md-settings-table .md-system { background:var(--surface-2,#f1f5fb); }
.md-group-heading th { padding:6px 7px; background:var(--surface-2,#f6f8fb); }
.md-group-heading span { margin-left:12px; font-weight:400; color:var(--ink-3); font-size:11px; }
.md-row-actions { display:flex; flex-wrap:wrap; gap:3px 7px; align-items:center; }
.md-row-actions button,.md-row-details summary { padding:0; border:0; background:none; font-size:11px; color:var(--accent,#2650b7); cursor:pointer; }
.md-row-details { min-width:0; }.md-row-details summary { width:max-content; }
.md-row-details[open] { flex-basis:100%; }.md-detail-panel { padding:6px 0; font-size:12px; }
.md-detail-panel p { margin:4px 0; overflow-wrap:anywhere; }
[data-compact-status] { font-size:11px; color:var(--ink-2); }
.md-actions { position:sticky; top:calc(var(--topbar-height) + 4px); z-index:4; display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; padding:8px 10px; background:var(--panel,#fff); border:1px solid var(--line); border-radius:6px; font-size:12px; }
.md-actions [data-impact] { flex:1; min-width:120px; }.md-actions [data-impact] summary { cursor:pointer; }
.md-actions [data-impact] ul { max-height:150px; overflow:auto; padding-left:20px; max-width:700px; }
.md-actions [data-result] { flex:1 1 100%; overflow-wrap:anywhere; }.md-actions [data-result]:empty { display:none; }
.md-save-buttons { display:flex; gap:8px; flex-wrap:wrap; }.md-save-buttons button { padding:5px 9px; font-size:12px; }
.md-unavailable { color:var(--danger,#a32626)!important; }.md-diagnostics { margin-top:14px; }
@media(max-width:600px) { .md-actions { top:0; }.md-settings-table { min-width:1080px; } }

/* Question review: native option text stays within the mobile review card. */
.mail-knowledge-review [data-proposal] label:not(.fld) { display: block; min-width: 0; }
.mail-knowledge-review [data-proposal] select { max-width: 100%; min-width: 0; }

/*380: owner-only conversation menus and bulk controls, contained at phone widths. */
.codex-conversation-tools { display:flex; flex-wrap:wrap; gap:5px; padding:6px; border-bottom:1px solid var(--line); }
.codex-conversation-row { display:flex; align-items:center; gap:3px; min-width:0; }
.codex-conversation-row > .codex-conversation { min-width:0; flex:1; }
.codex-conversation-actions { width:72px; min-width:0; max-width:90px; font-size:11px; padding:4px; flex:none; }
.codex-conversation-header { gap:8px; min-width:0; }
.codex-conversation-header > .codex-conversation-title { min-width:0; flex:1; }
.codex-archive-notice { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px; margin:0; }
.codex-archive-notice[hidden], .codex-conversation-header[hidden] { display:none; }
@media(max-width:1180px) { .codex-history { max-height:240px; } .codex-conversation-row { min-width:270px; flex:none; } }
