/* TruStack Due Diligence: design system.
   Layout: fixed left sidebar + full-width work area. One primary action per screen; detail one click away.
   Type: the operating system's standard UI font. Themes: light, dark and auto (OS), rendered server-side via <html data-theme>. */

/* ================================================================ tokens */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --sunken: #f1f3f5;
  --hover: #eef0f3;
  --border: #e3e6ea;
  --border-strong: #cfd4da;
  --text: #111827;
  --text-2: #4b5563;
  --muted: #6b7280;
  --faint: #9ca3af;

  --accent: #4f46e5;           /* TruStack indigo (wordmark "TRU") */
  --accent-hover: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --accent-line: #c7d2fe;
  --accent-2: #2563eb;         /* TruStack blue (wordmark "STACK") */
  --accent-3: #0ea5e9;         /* sky ("API") */
  --grad: linear-gradient(135deg, #4f46e5 0%, #3b5bf0 55%, #2563eb 100%);
  --grad-hover: linear-gradient(135deg, #4338ca 0%, #3150e0 55%, #1d4ed8 100%);
  --glow: 0 6px 18px rgba(79, 70, 229, .28);

  --ok: #15803d;     --ok-soft: #ecfdf3;     --ok-line: #bbe5c9;
  --warn: #b45309;   --warn-soft: #fff8eb;   --warn-line: #f3d6a4;
  --danger: #b91c1c; --danger-soft: #fef2f2; --danger-line: #f5c2c2;
  --info: #1d4ed8;   --info-soft: #eff4ff;   --info-line: #c4d4fb;
  --purple: #7e22ce; --purple-soft: #f7f0fe; --purple-line: #e0c8f8;

  --sidebar: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  --sidebar-line: rgba(229, 231, 235, .6);
  --sidebar-w: 256px;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, .10), 0 4px 6px -4px rgba(15, 23, 42, .08);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, .12), 0 8px 10px -6px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0b0f16;
  --surface: #12151c;
  --surface-2: #161a22;
  --sunken: #0f1218;
  --hover: #1b2029;
  --border: #232833;
  --border-strong: #323a47;
  --text: #e6e8ec;
  --text-2: #b6bcc6;
  --muted: #8a919d;
  --faint: #636b78;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-ink: #ffffff;
  --accent-soft: #1a1d3f;
  --accent-line: #3a3f86;
  --accent-2: #60a5fa;
  --accent-3: #38bdf8;
  --grad: linear-gradient(135deg, #6366f1 0%, #4f6cf5 55%, #3b82f6 100%);
  --grad-hover: linear-gradient(135deg, #7c83f7 0%, #6380f7 55%, #60a5fa 100%);
  --glow: 0 6px 18px rgba(99, 102, 241, .35);
  --ok: #4ade80;     --ok-soft: #10231a;     --ok-line: #1f4a33;
  --warn: #fbbf24;   --warn-soft: #2a2110;   --warn-line: #5a4418;
  --danger: #f87171; --danger-soft: #2c1414;  --danger-line: #5e2626;
  --info: #93b4ff;   --info-soft: #141d33;   --info-line: #2b3f70;
  --purple: #d0a8ff; --purple-soft: #221630; --purple-line: #4a2e6b;
  --sidebar: linear-gradient(135deg, #0f141c 0%, #101a2e 100%);
  --sidebar-line: rgba(51, 58, 71, .6);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, .45);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .5), 0 4px 6px -4px rgba(0, 0, 0, .4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .55), 0 8px 10px -6px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0b0f16;
    --surface: #12151c;
    --surface-2: #161a22;
    --sunken: #0f1218;
    --hover: #1b2029;
    --border: #232833;
    --border-strong: #323a47;
    --text: #e6e8ec;
    --text-2: #b6bcc6;
    --muted: #8a919d;
    --faint: #636b78;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-ink: #ffffff;
    --accent-soft: #1a1d3f;
    --accent-line: #3a3f86;
    --accent-2: #60a5fa;
    --accent-3: #38bdf8;
    --grad: linear-gradient(135deg, #6366f1 0%, #4f6cf5 55%, #3b82f6 100%);
    --grad-hover: linear-gradient(135deg, #7c83f7 0%, #6380f7 55%, #60a5fa 100%);
    --glow: 0 6px 18px rgba(99, 102, 241, .35);
    --ok: #4ade80;     --ok-soft: #10231a;     --ok-line: #1f4a33;
    --warn: #fbbf24;   --warn-soft: #2a2110;   --warn-line: #5a4418;
    --danger: #f87171; --danger-soft: #2c1414;  --danger-line: #5e2626;
    --info: #93b4ff;   --info-soft: #141d33;   --info-line: #2b3f70;
    --purple: #d0a8ff; --purple-soft: #221630; --purple-line: #4a2e6b;
    --sidebar: linear-gradient(135deg, #0f141c 0%, #101a2e 100%);
    --sidebar-line: rgba(51, 58, 71, .6);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, .45);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .5), 0 4px 6px -4px rgba(0, 0, 0, .4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, .55), 0 8px 10px -6px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

/* ================================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
a.link { color: var(--accent); }
a.link:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.icon { flex: none; vertical-align: -3px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 8px; }
.stack.loose { gap: 24px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }

/* ================================================================ app frame: floating sidebar + floating header + full-width content */
.app { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-w); display: flex; flex-direction: column; background: var(--sidebar);
  border-right: 1px solid var(--sidebar-line); border-radius: 0 18px 18px 0; box-shadow: var(--shadow-lg); overflow: hidden; }
.sidebar .brand { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 20px 18px; border-bottom: 1px solid var(--sidebar-line); }
.sidebar .brand img { height: 30px; width: auto; display: block; transition: transform .2s; }
.sidebar .brand:hover img { transform: scale(1.04); }
.version-pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 4px; }
.side-label { padding: 12px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.side-link { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px; color: var(--text-2); font-weight: 500;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s; }
.side-link .tile { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--muted); transition: background .2s, color .2s; }
.side-link:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); transform: translateX(3px); box-shadow: var(--shadow); }
.side-link[aria-current="page"] { background: var(--grad); color: #fff; transform: translateX(6px); box-shadow: var(--glow); }
.side-link[aria-current="page"] .tile { background: transparent; color: #fff; }
.side-link .count { margin-left: auto; white-space: nowrap; }
.side-link[aria-current="page"] .count { background: rgba(255, 255, 255, .22); color: #fff; }
.side-link.locked { color: var(--faint); cursor: not-allowed; opacity: .6; }
.side-link.locked:hover { background: none; transform: none; box-shadow: none; }
.side-link.done .tile { color: var(--ok); }
.side-deal { margin: 4px 0 6px; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--sidebar-line); }
.side-deal .name { font-weight: 600; font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-deal .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.side-foot { padding: 12px 14px 14px; border-top: 1px solid var(--sidebar-line); display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--grad); color: #fff;
  font-weight: 700; font-size: 13px; }

.main { margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; padding: 12px 24px 0 20px; }
.topbar-card { display: flex; align-items: center; gap: 20px; padding: 16px 24px; border-radius: 18px 0 0 18px; margin-right: -24px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.topbar h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.topbar-crumb { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.topbar-crumb a { color: var(--accent); font-weight: 600; }
.topbar-crumb a:hover { text-decoration: underline; }
.topbar .desc:empty { display: none; }
.topbar .desc { margin-top: 3px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.content { flex: 1; padding: 22px 24px 112px 20px; }
.menu-toggle { display: none; }

/* ================================================================ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 500 13px/1 var(--font); cursor: pointer;
  white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { background: var(--grad-hover); }
.btn.secondary { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.btn.secondary:hover { background: color-mix(in srgb, var(--accent-soft) 60%, var(--accent-line)); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.ok { color: var(--ok); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn.icon-only { width: 34px; padding: 0; }
.btn.sm.icon-only { width: 28px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.btn-group .btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); z-index: 1; }

/* ================================================================ surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); min-height: 58px; }
.card-head h2 { font-size: 15px; font-weight: 700; }
.card-body { padding: 22px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius); }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* page heading */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head .sub { margin-top: 4px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sep::before { content: "·"; color: var(--faint); margin-right: 10px; }

/* KPI tiles (symmetric, equal cells): icon square, uppercase label, bold value */
.kpis { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 0; transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-xl); }
.kpi .top { display: flex; align-items: center; gap: 10px; }
.kpi .sq { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--grad); color: #fff; }
.kpi .sq.blue { background: linear-gradient(135deg, #2563eb, #0ea5e9); } .kpi .sq.amber { background: #f59e0b; } .kpi .sq.red { background: #ef4444; }
.kpi .sq.green { background: #22c55e; } .kpi .sq.violet { background: #8b5cf6; } .kpi .sq.slate { background: #64748b; }
.kpi .k { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi .v.warn { color: var(--warn); } .kpi .v.ok { color: var(--ok); } .kpi .v.danger { color: var(--danger); }
.kpi .s { font-size: 12px; color: var(--muted); }

/* ================================================================ pills, chips, counts */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font: 500 12px/1 var(--font);
  background: var(--hover); color: var(--text-2); white-space: nowrap; border: 1px solid transparent; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.pill.info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pill.purple { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-line); }
.pill.neutral { background: var(--sunken); color: var(--muted); border-color: var(--border); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font: 500 11.5px/1 var(--mono);
  background: var(--sunken); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px/1 var(--font);
  background: var(--sunken); color: var(--muted); }
.count.attention { background: var(--warn-soft); color: var(--warn); }
.count.accent { background: var(--accent-soft); color: var(--accent); }
.pri { display: inline-grid; place-items: center; width: 28px; height: 20px; border-radius: 5px; font: 600 11px/1 var(--font); }
.pri.p0 { background: var(--danger-soft); color: var(--danger); }
.pri.p1 { background: var(--sunken); color: var(--text-2); }

/* ================================================================ forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 500; font-size: 12.5px; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; height: 36px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 13.5px var(--font); transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; min-height: 96px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;   /* the arrow centred on every height (.sm, the phone min-height) */
  background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input.sm { height: 30px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.choice input:checked + label { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* ================================================================ disclosure, menus, drawer, dialog */
details.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; color: var(--text-2); user-select: none; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .chev { transition: transform .15s; }
details.disclosure[open] > summary .chev { transform: rotate(90deg); }
details.disclosure > summary:hover { color: var(--text); }
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > .menu-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 40; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
details.menu.up > .menu-panel { top: auto; bottom: calc(100% + 6px); }
details.menu.left > .menu-panel { left: 0; right: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text); font: 13px var(--font); text-align: left; cursor: pointer; }
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 8px; background: var(--sunken); border: 1px solid var(--border); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 5px; height: 26px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font: 500 12px var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

dialog.modal { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal.wide { width: min(960px, calc(100vw - 32px)); }
/* the app's confirmation (app.js askConfirm): a title, one line of what happens, Cancel and the named action */
dialog.confirm-dlg { width: min(440px, calc(100vw - 32px)); }
.confirm-dlg form { padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 8px; }
.confirm-dlg .cd-title { margin: 0; font-size: 17px; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
.confirm-dlg .cd-text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.confirm-dlg .cd-text:empty { display: none; }
.confirm-dlg .cd-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.confirm-dlg .cd-foot .btn { min-width: 96px; justify-content: center; }
.confirm-dlg .cd-ok.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
dialog.modal::backdrop { background: rgba(10, 12, 16, .42); backdrop-filter: blur(2px); }
.modal-head { padding: 18px 20px 4px; }
.modal-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.modal-body { padding: 14px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow: auto; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }

.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 50; display: flex; flex-direction: column; background: var(--surface);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .2s ease; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }
.scrim { position: fixed; inset: 0; z-index: 45; background: rgba(10, 12, 16, .28); opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* key-value */
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 18px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.section-title { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.quote { padding: 10px 12px; border-left: 3px solid var(--accent-line); background: var(--sunken); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; color: var(--text-2); }
.quote .by { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ================================================================ lists & tables */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover, .list-row.clickable:hover { background: var(--surface-2); }
.list-row .title { font-weight: 550; }
.list-row .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
button.list-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.scroll-list { max-height: calc(100vh - 380px); min-height: 240px; overflow-y: auto; }
.list-group { padding: 8px 18px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between; }
.list-group:first-child { border-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { position: sticky; top: 0; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr.selected td { background: var(--accent-soft); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; border-radius: var(--radius); }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ================================================================ banners, empty states */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid; font-size: 13px; }
.banner .icon { margin-top: 1px; }
.banner strong { display: block; }
.banner p { color: var(--text-2); margin-top: 2px; }
.banner .act { margin-left: auto; display: flex; gap: 8px; }
.banner .banner-close { width: 28px; height: 28px; color: inherit; opacity: .7; }
.banner .banner-close:hover { opacity: 1; }
.banner.danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.banner.info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.empty { text-align: center; padding: 56px 24px; }
.empty .glyph { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 12px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.empty h2 { margin-bottom: 6px; }
.empty p { color: var(--muted); max-width: 440px; margin: 0 auto 18px; }

/* ================================================================ action bar (bottom of the work area) */
.actionbar { position: fixed; left: calc(var(--sidebar-w) + 20px); right: 24px; bottom: 14px; z-index: 25; display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--border); box-shadow: var(--shadow-xl); }
.actionbar .msg { display: flex; align-items: center; gap: 10px; color: var(--text-2); min-width: 0; font-size: 13px; }
.actionbar .msg span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; }
.status-dot.green { background: var(--ok); }
.actionbar .cta { margin-left: auto; display: flex; gap: 8px; }

/* ================================================================ upload, transcript, progress */
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .12s, background .12s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.file-chip .glyph { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.paper { padding: 24px 28px; font-size: 13.5px; line-height: 1.7; color: var(--text); }
.paper .preamble { color: var(--muted); font-size: 12.5px; margin-bottom: 16px; }
.turn { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; padding: 8px 0; border-top: 1px solid var(--border); }
.turn:first-of-type { border-top: 0; }
.turn .who { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.turn .who small { display: block; font-weight: 400; color: var(--muted); }
.turn .nf { color: var(--muted); }
mark.q { background: color-mix(in srgb, var(--accent) 12%, transparent); color: inherit; border-bottom: 1.5px solid var(--accent-line); padding: 0 1px; border-radius: 2px; cursor: pointer; }
.raw { white-space: pre-wrap; font-size: 13px; line-height: 1.65; color: var(--text-2); }
.run { display: flex; flex-direction: column; }
.run-step { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.run-step:first-child { border-top: 0; }
.run-step .state { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--border-strong); color: transparent; }
.run-step[data-status="running"] .state { border-color: var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.run-step[data-status="done"] .state { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.run-step[data-status="queued"] { color: var(--muted); }
.run-step .result { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dropzone.is-off { opacity: .45; cursor: not-allowed; }
.rl-person.rl-dept { padding-left: 34px; font-size: 13px; }
/* a form without a button saving (a "Sent" checkbox): a spinner beside it, the checkbox held (app.js formBusy) */
form.is-busy label { position: relative; cursor: progress; }
form.is-busy label::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
form.is-busy label span { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }
/* an action in progress: a spinner on its own button (app.js busyButton); the label stays for its width, hidden */
.btn.is-busy { position: relative; color: transparent !important; cursor: progress; opacity: 1; }
.btn.is-busy > * { visibility: hidden; }
.btn.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn.primary.is-busy::after { border-color: #fff; border-right-color: transparent; }
@media (prefers-reduced-motion: reduce) { .btn.is-busy::after { animation-duration: 2s; } }

/* ================================================================ toasts */
.toasts { position: fixed; left: calc(50% + var(--sidebar-w) / 2); bottom: 80px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column;
  gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 10px 14px; border-radius: 9px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-size: 13px; animation: toast-in .18s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
/* in the top layer (app.js toast): the browser's popover box reset, the place kept */
.toasts[popover] { inset: auto; left: calc(50% + var(--sidebar-w) / 2); bottom: 80px; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
/* a dialog form's error, shown inside the dialog above its buttons */
.form-error { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--danger-line); border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; line-height: 1.45; }

/* ================================================================ sign-in */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; background: linear-gradient(160deg, #0f1430 0%, #1b2160 55%, #2a3aa8 100%);
  color: #e8eaff; }
.auth-brand img.word { height: 26px; width: auto; align-self: flex-start; filter: brightness(1.9) saturate(.9); }
.auth-brand img.mark { width: min(340px, 70%); align-self: center; opacity: .9; mix-blend-mode: screen; }
.auth-brand p { color: #b9bff5; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--surface); }
.auth-form .inner { width: min(360px, 100%); }

/* ================================================================ htmx */
.htmx-request .btn[type=submit]:not(.is-busy), .htmx-request.btn:not(.is-busy) { opacity: .6; pointer-events: none; }

/* ================================================================ responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .main { margin-left: 0; }
  .sidebar { z-index: 60; width: 264px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 12px 0; }
  .topbar-card { margin-right: 0; border-radius: 16px; padding: 12px 14px; }
  .topbar h1 { font-size: 19px; }
  .content { padding: 16px 12px 112px; }
  .actionbar { left: 12px; right: 12px; bottom: 10px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .turn { grid-template-columns: 1fr; gap: 2px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ================================================================ charts (dataviz reference palette, validated light + dark) */
:root {
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --meter-track: #cde2fb; --chart-grid: #e1e0d9;
}
html[data-theme="dark"] {
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --meter-track: #17304f; --chart-grid: #2c2c2a;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --meter-track: #17304f; --chart-grid: #2c2c2a;
  }
}
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.s5 { --c: var(--s5); } .s6 { --c: var(--s6); } .s7 { --c: var(--s7); } .s8 { --c: var(--s8); }

.chart-title { font-size: 13px; font-weight: 600; color: var(--text); }
.chart-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stackbar { display: flex; gap: 2px; height: 14px; margin: 14px 0 12px; }
.stackbar .seg { position: relative; background: var(--c); min-width: 6px; }
.stackbar .seg:first-child { border-radius: 4px 0 0 4px; }
.stackbar .seg:last-child { border-radius: 0 4px 4px 0; }
.stackbar .seg:only-child { border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--text-2); }
.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend .val { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.hbars { display: grid; grid-template-columns: minmax(90px, max-content) minmax(0, 1fr); gap: 10px 14px; align-items: center; margin-top: 14px; }
.hbars .lab { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.hbars .track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hbars .bar { height: 12px; background: var(--s1); border-radius: 0 4px 4px 0; min-width: 3px; }
.hbars .v { font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

.meter { display: flex; align-items: center; gap: 14px; }
.meter .figure { font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.meter .figure small { font-size: 15px; font-weight: 500; color: var(--muted); }
.meter-track { height: 10px; border-radius: 999px; background: var(--meter-track); overflow: hidden; margin-top: 12px; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--s1); transition: width .4s ease; }
.meter-fill.done { background: var(--s3); }

[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 10;
  white-space: nowrap; padding: 6px 9px; border-radius: 7px; background: var(--text); color: var(--bg); font-size: 12px; font-weight: 500;
  box-shadow: var(--shadow-lg); pointer-events: none; }

/* ================================================================ grouped, expandable cards */
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.group + .group { margin-top: 16px; }
.group > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; user-select: none; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary:hover { background: var(--surface-2); }
.group > summary .gicon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.group > summary .gicon.done { background: var(--ok-soft); color: var(--ok); }
.group > summary h3 { font-size: 15px; font-weight: 700; }
.group > summary .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.group > summary .chev { color: var(--muted); transition: transform .15s; }
.group[open] > summary .chev { transform: rotate(90deg); }
.group[open] > summary { border-bottom: 1px solid var(--border); }
.item-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 20px; border-top: 1px solid var(--border); }
.item-row:first-child { border-top: 0; }
.item-row .what { flex: 1; min-width: 0; }
.item-row .name { font-weight: 600; }
.item-row .why { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.item-row .answer { font-size: 13px; margin-top: 6px; color: var(--text-2); }
.item-row .do { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 52%; }
.item-row.resolved .name { color: var(--muted); font-weight: 500; }
button.item-row { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.item-row:hover { background: var(--surface-2); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.fact { text-align: left; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); cursor: pointer; font: inherit; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fact:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.fact .k { font-size: 12px; font-weight: 600; color: var(--muted); }
.fact .val { font-size: 13.5px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; margin-bottom: 22px; }
.overview .card-body { height: 100%; }
@media (max-width: 860px) { .overview { grid-template-columns: 1fr; } .item-row { flex-direction: column; } .item-row .do { max-width: none; justify-content: flex-start; } }

/* ================================================================ compact scale (one rhythm: 8 / 12 / 16 / 20) and symmetric rows */
:root { --sidebar-w: 228px; --radius: 14px; }
body { font-size: 13.5px; }
.sidebar .brand { padding: 16px 16px 14px; gap: 8px; }
.sidebar .brand img { height: 24px; }
.side-nav { padding: 10px 10px 8px; gap: 2px; }
.side-label { padding: 10px 8px 4px; font-size: 10.5px; }
.side-link { gap: 10px; padding: 5px 8px; font-size: 13px; border-radius: 9px; }
.side-link .tile { width: 26px; height: 26px; border-radius: 7px; }
.side-link[aria-current="page"] { transform: translateX(3px); }
.side-deal { padding: 10px; margin: 2px 0 4px; }
.side-foot { padding: 10px 12px 12px; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }

.topbar { padding: 10px 20px 0 16px; }
.topbar-card { padding: 10px 18px; gap: 14px; border-radius: 14px 0 0 14px; }
.topbar h1 { font-size: 18px; font-weight: 700; }
.topbar .desc { font-size: 12.5px; margin-top: 2px; }
.content { padding: 16px 20px 96px 16px; }
.btn { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 36px; padding: 0 16px; font-size: 13.5px; }

/* KPI tiles: one compact row, icon left, number and label stacked */
.kpis { gap: 12px; margin-bottom: 16px; }
.kpi { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 12px 14px; border-radius: 12px; }
.kpi .top { display: contents; }
.kpi .sq { grid-row: 1 / span 2; width: 34px; height: 34px; border-radius: 9px; }
.kpi .v { grid-column: 2; grid-row: 1; font-size: 18px; }
.kpi .k { grid-column: 2; grid-row: 2; font-size: 11px; letter-spacing: .04em; }

.card-head { padding: 10px 16px; min-height: 46px; }
.card-head h2 { font-size: 14px; }
.card-body { padding: 16px; }
.card-foot { padding: 10px 16px; }

/* equal columns, equal heights */
.overview, .grid-2, .grid-3 { align-items: stretch; }
.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 { gap: 16px; }
.grid-3 { gap: 16px; }
.overview > .card, .grid-2 > .card, .grid-3 > .card { height: 100%; display: flex; flex-direction: column; }
.overview > .card > .card-body, .grid-3 > .card > .card-body { flex: 1; }
.meter .figure { font-size: 24px; }
.meter .figure small { font-size: 13px; }
.stackbar { margin: 12px 0 10px; height: 12px; }
.hbars { gap: 7px 12px; margin-top: 12px; }
.hbars .bar { height: 10px; }
.chart-title { font-size: 13px; }

/* grouped cards: slimmer headers and rows */
.group + .group { margin-top: 12px; }
.group > summary { padding: 11px 16px; gap: 12px; }
.group > summary .gicon { width: 30px; height: 30px; border-radius: 8px; }
.group > summary h3 { font-size: 13.5px; }
.group > summary .hint { font-size: 12px; margin-top: 1px; }
.item-row { padding: 10px 16px; gap: 14px; }
.item-row .name { font-size: 13.5px; }
.item-row .why { font-size: 12px; margin-top: 2px; }
.fact-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 12px 16px 16px; }
.fact { padding: 11px 12px; gap: 6px; border-radius: 10px; }
.fact .val { font-size: 13px; }

.actionbar { left: calc(var(--sidebar-w) + 16px); right: 20px; bottom: 12px; padding: 9px 14px; border-radius: 13px; }
.scroll-pane { max-height: 520px; overflow-y: auto; }
.list-row { padding: 10px 16px; }
@media (max-width: 860px) { .overview { grid-template-columns: 1fr; } }

@media (max-width: 1200px) { .fact-grid[style] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* ================================================================ fit-screen pages: the page never scrolls, the cards do */
body.fit-screen .main { height: 100vh; min-height: 0; }
body.fit-screen .content { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 82px; }
body.fit-screen .fit-row { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
body.fit-screen .fit-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
body.fit-screen .fill { min-height: 0; height: 100%; display: flex; flex-direction: column; }
body.fit-screen .fit-col > .fill { flex: 1; height: auto; }
body.fit-screen .fill > .scroll { flex: 1; min-height: 0; overflow-y: auto; }
body.fit-screen .fit-col > .banner { flex: none; }
@media (max-width: 699px) {
  body.fit-screen .main { height: auto; }
  body.fit-screen .content { overflow: visible; }
  body.fit-screen .fill { height: auto; }
  body.fit-screen .fill > .scroll { max-height: 70vh; }
}

/* the header card sits inside the page like every other card: same right edge as the content, all corners rounded, no bleed */
.topbar { padding: 10px 20px 0 16px; }
.topbar-card { margin-right: 0; border-radius: 14px; }
.main { min-width: 0; max-width: 100%; }
body.fit-screen { overflow: hidden; }
@media (max-width: 699px) { body.fit-screen { overflow: auto; } }
@media (max-width: 860px) { .topbar { padding: 10px 12px 0; } }

/* "What the agents found": sections stacked from the top, divided by hairlines; the speaker list may grow below */
.found-sec { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }
.found-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
@media (max-width: 1100px) { .found-pair { grid-template-columns: 1fr; } }

/* taller action bar: 72px, with the content's bottom gap raised to match */
.actionbar { min-height: 72px; padding: 14px 18px 14px 22px; }
.actionbar .msg { font-size: 13.5px; }
.content { padding-bottom: 116px; }
body.fit-screen .content { padding-bottom: 102px; }
@media (max-width: 860px) { .content { padding-bottom: 116px; } }

/* sidebar deal switcher: the deal button opens a floating, searchable list (rendered outside the sidebar so nothing clips it) */
.side-switch { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.side-switch:hover, .side-switch[aria-expanded=true] { background: var(--surface); border-color: var(--border); }
.side-switch .grow { min-width: 0; display: flex; flex-direction: column; }
.side-switch .chev { flex: none; color: var(--muted); transition: transform .15s; }
.side-switch[aria-expanded=true] .chev { transform: rotate(180deg); }
.switch-pop { position: fixed; z-index: 70; width: 320px; display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xl); overflow: hidden; animation: pop-in .12s ease-out; }
.switch-pop[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.switch-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--muted); cursor: text; }
.switch-search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: 13px var(--font); color: var(--text); }
.switch-search input::-webkit-search-cancel-button { cursor: pointer; }
.switch-list { flex: 1; min-height: 0; max-height: 320px; overflow-y: auto; padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.switch-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); min-width: 0; }
.switch-item[hidden] { display: none; }
.switch-item:hover, .switch-item.active { background: var(--hover); text-decoration: none; }
.switch-item .grow { min-width: 0; display: flex; flex-direction: column; }
.switch-item .name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-item .meta { font-size: 11.5px; color: var(--muted); }
.switch-item.current { color: var(--accent); }
.switch-item.current .name { font-weight: 600; }
.switch-item > svg { flex: none; margin-left: auto; }
.switch-empty { padding: 14px 10px; font-size: 12.5px; color: var(--muted); text-align: center; }
.switch-foot { display: flex; gap: 4px; padding: 6px; border-top: 1px solid var(--border); background: var(--surface-2); }
.switch-link { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.switch-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.switch-search:focus-within { color: var(--accent); }
.switch-search input, .switch-search input:focus, .switch-search input:focus-visible { -webkit-appearance: none; appearance: none; border: 0; outline: none; box-shadow: none; padding: 2px 0; height: auto; border-radius: 0; }

/* ================================================================ Deal Context Card: work tabs on the left, progress + settled facts on the right */
.ctx-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; }
.tabs-head { gap: 16px; padding-bottom: 0; align-items: flex-end; min-height: 0; }
.tabs-head h2 { padding-bottom: 10px; white-space: nowrap; }
.deals-tabs .tabs-head .console-search { align-self: center; margin: 7px 0 7px auto; }      /* the deal list's search, on the tabs' line: it searches the open tab */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-bottom: -1px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role=tab] { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px 10px; border: 0; border-bottom: 2px solid transparent; background: none;
  font: 500 13px var(--font); color: var(--muted); white-space: nowrap; cursor: pointer; }
.tabs [role=tab]:hover { color: var(--text); }
.tabs [role=tab][aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--sunken); color: var(--text-2); font-variant-numeric: tabular-nums; }
.tabs [data-open] .tab-n { background: var(--warn-soft); color: var(--warn); }
.tab-done { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.tab-alerts { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 0; }
.tab-alerts .banner { margin: 0; }
.tab-panel[hidden] { display: none; }
body.fit-screen .fill > .tab-panel { flex: 1; min-height: 0; overflow-y: auto; }
.panel-intro { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 12.5px; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.panel-intro + .item-row { border-top: 0; }
.answer-input { width: 180px; }
.item-row.lead-row { background: var(--surface-2); }
.ctx-layout .item-row .do { max-width: 62%; }
.link-name { padding: 0; border: 0; background: none; font: 600 13.5px var(--font); color: var(--text); cursor: pointer; text-align: left; }
.link-name:hover { color: var(--accent); }

.progress-second { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.progress-wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.progress-wide .progress-second { margin: 0; padding: 0 0 0 28px; border-top: 0; border-left: 1px solid var(--border); }
.all-clear { display: flex; align-items: center; gap: 12px; }
.all-clear .tick { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.all-clear .chart-sub { margin-top: 2px; }

.fact-list { padding: 4px 8px 8px; }
.fact-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 6px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding-left: 8px; padding-right: 8px; }
.fact-sec + .fact-rows { margin-bottom: 6px; }
.fact-row { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 10px 8px; border: 0; border-radius: 9px; background: none;
  text-align: left; font: inherit; color: inherit; cursor: pointer; }
.fact-row + .fact-row { box-shadow: inset 0 1px 0 var(--border); }
.fact-row:hover { background: var(--hover); box-shadow: none; }
.fact-row:hover + .fact-row { box-shadow: none; }
.fact-row .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.fact-row .k { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-row .src { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 500; color: var(--text-2); }
.fact-row .src::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.fact-row .src.ok::before { background: var(--ok); }
.fact-row .src.warn::before { background: var(--warn); }
.fact-row .src.danger::before { background: var(--danger); }
.fact-row .src.info::before, .fact-row .src.accent::before { background: var(--accent); }
.fact-row .src.purple::before { background: var(--purple); }
.fact-row .val { font-size: 13px; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fact-list.wide { padding: 4px 16px 16px; }
.fact-list.wide .fact-sec { padding-left: 0; padding-right: 0; }
.fact-list.wide .fact-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 8px; }
.fact-list.wide .fact-row { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); box-shadow: none;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
.fact-list.wide .fact-row:hover { border-color: var(--accent-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.fact-list.wide .fact-row .val { min-height: 2.9em; }
body.fit-screen .ctx-calm { flex: 1; min-height: 0; }
@media (max-width: 1100px) { .ctx-layout { grid-template-columns: 1fr; } .progress-wide { grid-template-columns: 1fr; } .progress-wide .progress-second { padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--border); } }

/* ================================================================ drawers: the body is the part that scrolls */
.drawer-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.drawer-title { font-size: 16px; line-height: 1.35; margin-top: 8px; }
.drawer-body { gap: 16px; }
.drawer-body .lead-text { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.drawer-body .quote + .quote { margin-top: 6px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; }
.facts:empty { display: none; }
.facts dt { color: var(--muted); }
.facts dd { color: var(--text); margin: 0; }
.doc-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.doc { padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.drawer-more { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--border); }
.drawer-more .disclosure { padding-top: 10px; }
.drawer-more .disclosure > summary { font-size: 13px; font-weight: 500; }
.drawer-more .disclosure > summary .pill { margin-left: 6px; }
.line-items { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.line-items li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.line-items .id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ================================================================ Draft IRL: folders inside the requests panel */
.fold { border-bottom: 1px solid var(--border); }
.fold > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px 16px; cursor: pointer; user-select: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary:hover { background: var(--surface-2); }
.fold > summary .chev { color: var(--muted); transition: transform .15s; flex: none; }
.fold[open] > summary .chev { transform: rotate(90deg); }
.fold > summary .grow { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.fold-name { font-weight: 600; font-size: 13.5px; }
.fold-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.fold[open] > summary { background: var(--surface-2); }
.fold .item-row { padding-left: 40px; }
button.item-row { width: 100%; background: none; border: 0; border-top: 1px solid var(--border); text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.item-row:hover { background: var(--hover); }
.req-row { align-items: center; }
.req-row > .pri { flex: none; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-stats > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.mini-stats .v { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.mini-stats .k { font-size: 11.5px; color: var(--muted); }
.mini-stats .v.ok { color: var(--ok); } .mini-stats .v.warn { color: var(--warn); } .mini-stats .v.danger { color: var(--danger); }
.approve-layout .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ================================================================ Draft IRL: slim overview over the requests */
body.fit-screen .fit-stack { flex: 1; min-height: 0; }
.ov-row { display: flex; align-items: center; gap: 0; padding: 12px 16px; }
.ov-stat { display: flex; align-items: baseline; gap: 6px; padding-right: 20px; margin-right: 20px; border-right: 1px solid var(--border); white-space: nowrap; }
.ov-stat .v { font-size: 20px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ov-stat .k { font-size: 12.5px; color: var(--muted); }
.ov-chart { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; }
.ov-chart .stackbar { flex: 1; min-width: 120px; margin: 0; }
.ov-chart .legend { margin: 0; flex-wrap: nowrap; white-space: nowrap; }
.ov-toggle { margin-left: 16px; flex: none; }
.ov-toggle .chev { transition: transform .15s; }
.ov-toggle[aria-expanded=true] .chev { transform: rotate(180deg); }
.ov-more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.ov-more[hidden] { display: none; }
@media (max-width: 1100px) { .ov-row { flex-wrap: wrap; row-gap: 10px; } .ov-chart { flex-basis: 100%; order: 5; } .ov-more { grid-template-columns: 1fr; } }

/* ================================================================ Approve & release: two numbered steps side by side */
.approve-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 16px; }
.step-no { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.is-waiting .step-no { background: var(--sunken); color: var(--muted); }
.state-badge { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.state-badge .tick { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.checklist { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.checklist li { display: flex; align-items: flex-start; gap: 9px; }
.checklist li > svg { flex: none; margin-top: 1px; }
.checklist .pass { color: var(--text-2); }
.checklist .pass > svg { color: var(--ok); }
.checklist .fail > svg { color: var(--danger); }
.folds { margin: 4px -16px -16px; border-top: 1px solid var(--border); }
.folds .fold:last-child { border-bottom: 0; }
.fold-body { padding: 2px 16px 14px 40px; }
.fold-body.kv { margin: 0; }
.fold .fold-meta.clamp-1 { min-width: 0; }
.person-row { display: grid; grid-template-columns: 30px minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.2fr); align-items: center; gap: 12px; padding: 9px 16px;
  border-bottom: 1px solid var(--border); }
.person-row .avatar { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); }
.person-row .who { min-width: 0; }
.person-row.delivery { grid-template-columns: 10px minmax(0, 1fr) max-content max-content; }
.dot-status { width: 8px; height: 8px; border-radius: 50%; background: var(--info, var(--accent)); }
.dot-status.sent { background: var(--ok); }
.dot-status.failed { background: var(--danger); }
.text-danger { color: var(--danger); }
.mail p { margin: 6px 0 0; }
.mail .line-items { margin-top: 10px; }
.card-foot .grow { flex: 1; min-width: 0; }
@media (max-width: 1100px) { .approve-layout { grid-template-columns: 1fr; } .person-row { grid-template-columns: 30px minmax(0, 1fr); } .person-row > .input, .person-row > span:not(.avatar) { grid-column: 2; } }

/* ================================================================ TruStackDD brand (TruStackDD-brand-kit)
   UI colours from the kit: navy #0B1328 (nav ground), ink #0F1A33, body #3A4458, muted #6B7488, rule #DFE4EE, band #EEF2FA,
   accent #3550C8 (links and primary buttons on light), sky #2C9BF0 (the highlight on navy). The logo gradient never builds UI.
   Type: IBM Plex Sans for the interface, Source Serif 4 SemiBold for headings, IBM Plex Mono for eyebrows, IDs and figures. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("../fonts/ibm-plex-sans-latin.d28498895ed7.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/ibm-plex-mono-400-latin.814fe1615d4d.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-latin.6708425c446b.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; font-display: swap; src: url("../fonts/source-serif-4-latin.325f42e1505f.woff2") format("woff2"); }

:root {
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --navy: #0B1328; --navy-2: #16215A; --navy-line: #26315C; --on-navy: #EEF2FA; --on-navy-muted: #9AA8C8; --sky: #2C9BF0;
}
:root, html[data-theme="light"] {
  --bg: #EEF2FA; --surface: #FFFFFF; --surface-2: #F6F8FC; --sunken: #EAEEF6; --hover: #EEF2FA;
  --border: #DFE4EE; --border-strong: #C6CDDB; --text: #0F1A33; --text-2: #3A4458; --muted: #6B7488; --faint: #A9B1C2;
  --accent: #3550C8; --accent-hover: #2B43AD; --accent-ink: #FFFFFF; --accent-soft: #E9EDFA; --accent-line: #C3CCEE;
  --accent-2: #3550C8; --accent-3: #2C9BF0;
  --grad: #3550C8; --grad-hover: #2B43AD; --glow: 0 4px 12px rgba(53, 80, 200, .22);
  --info: #3550C8; --info-soft: #E9EDFA; --info-line: #C3CCEE;
  --shadow: 0 1px 2px rgba(15, 26, 51, .06), 0 2px 6px rgba(15, 26, 51, .04);
  --shadow-lg: 0 4px 14px rgba(15, 26, 51, .07), 0 1px 3px rgba(15, 26, 51, .05);
  --shadow-xl: 0 16px 32px rgba(15, 26, 51, .14), 0 4px 10px rgba(15, 26, 51, .08);
}
html[data-theme="dark"] {
  --bg: #0B1328; --surface: #111A36; --surface-2: #142041; --sunken: #0A1124; --hover: #1A2650;
  --border: #26315C; --border-strong: #354373; --text: #EEF2FA; --text-2: #C5CEE3; --muted: #9AA8C8; --faint: #6B7896;
  --accent: #2C9BF0; --accent-hover: #54B0F5; --accent-ink: #0B1328; --accent-soft: #132B4E; --accent-line: #1F4B7E;
  --accent-2: #2C9BF0; --accent-3: #54C1FF;
  --grad: #2C9BF0; --grad-hover: #54B0F5; --glow: 0 4px 14px rgba(44, 155, 240, .25);
  --info: #54B0F5; --info-soft: #132B4E; --info-line: #1F4B7E;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 6px 18px rgba(0, 0, 0, .35); --shadow-xl: 0 18px 36px rgba(0, 0, 0, .5);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0B1328; --surface: #111A36; --surface-2: #142041; --sunken: #0A1124; --hover: #1A2650;
    --border: #26315C; --border-strong: #354373; --text: #EEF2FA; --text-2: #C5CEE3; --muted: #9AA8C8; --faint: #6B7896;
    --accent: #2C9BF0; --accent-hover: #54B0F5; --accent-ink: #0B1328; --accent-soft: #132B4E; --accent-line: #1F4B7E;
    --accent-2: #2C9BF0; --accent-3: #54C1FF;
    --grad: #2C9BF0; --grad-hover: #54B0F5; --glow: 0 4px 14px rgba(44, 155, 240, .25);
    --info: #54B0F5; --info-soft: #132B4E; --info-line: #1F4B7E;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-lg: 0 6px 18px rgba(0, 0, 0, .35); --shadow-xl: 0 18px 36px rgba(0, 0, 0, .5);
  }
}

body { font-family: var(--font); font-feature-settings: "tnum" 0; }
h1, .serif, .auth h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; }
.topbar-card h1 { font-size: 21px; }
.btn.primary { color: var(--accent-ink); }
.btn.primary:disabled { opacity: .45; box-shadow: none; }

/* labels and data in Plex Mono: eyebrows (uppercase, +0.1em), IDs, figures */
.side-label, .kpi .k, .fact-sec, .section-title, .eyebrow { font-family: var(--mono); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.kpi .k { font-size: 10.5px; }
.mini-stats .v, .ov-stat .v { font-family: var(--mono); font-weight: 500; letter-spacing: -.02em; }
.kpi .v, .meter .figure { font-variant-numeric: tabular-nums; }
.line-items .id, .mono { font-family: var(--mono); }

/* KPI tiles: one brand tint instead of a rainbow; status colour stays on the value only */
.kpi .sq, .kpi .sq.blue, .kpi .sq.amber, .kpi .sq.red, .kpi .sq.green, .kpi .sq.violet, .kpi .sq.slate { background: var(--accent-soft); color: var(--accent); }

/* the navigation sits on navy in every theme, with the colour-on-navy logo (24-28px) and sky as its highlight */
.sidebar { background: var(--navy); border-right: 1px solid var(--navy-line); box-shadow: none;
  --text: var(--on-navy); --text-2: #C5CEE3; --muted: var(--on-navy-muted); --faint: #7F8DAF; --hover: rgba(238, 242, 250, .06);
  --surface: var(--navy-2); --surface-2: #121B44; --border: var(--navy-line); --sidebar-line: var(--navy-line);
  --accent: var(--sky); --accent-soft: rgba(44, 155, 240, .16); --accent-ink: var(--navy); --sunken: #070D1D; color: var(--text); }
html[data-theme="dark"] .sidebar { background: #080E1F; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .sidebar { background: #080E1F; } }
.sidebar .brand { padding: 20px 18px 18px; align-items: flex-start; }
.sidebar .brand img { height: 26px; width: auto; }
.sidebar .brand:hover img { transform: none; }
.side-link { color: var(--on-navy-muted); }
.side-link:hover { color: var(--on-navy); background: var(--hover); }
.side-link .tile { color: inherit; background: transparent; }
.side-link[aria-current="page"] { background: rgba(44, 155, 240, .14); color: #FFFFFF; transform: none; box-shadow: inset 3px 0 0 var(--sky); }
.side-link[aria-current="page"] .tile { color: var(--sky); }
.side-link[aria-current="page"] .count { background: var(--sky); color: var(--navy); }
.side-link .count { background: rgba(238, 242, 250, .1); color: var(--on-navy); }
.side-link .count.attention { background: rgba(245, 158, 11, .2); color: #FCD38A; }
.side-link.done .tile { color: #6EE7A8; }
.side-link.locked { color: #56648A; }
.side-deal, .side-switch { background: rgba(238, 242, 250, .04); border-color: var(--navy-line); }
.side-switch:hover, .side-switch[aria-expanded=true] { background: rgba(238, 242, 250, .08); border-color: #34416F; }
.side-foot .avatar, .avatar { background: var(--accent); color: var(--accent-ink); }
.sidebar .seg { background: rgba(0, 0, 0, .25); border-color: var(--navy-line); }
.sidebar .seg button { color: var(--on-navy-muted); }
.sidebar .seg button[aria-pressed="true"] { background: var(--navy-2); color: var(--on-navy); box-shadow: none; }

/* sign-in: navy brand ground, mono eyebrow, serif headline with one sky phrase */
.auth-brand { position: relative; overflow: hidden; background: radial-gradient(120% 95% at 72% -20%, #16215A 0%, #0B1328 65%); color: var(--on-navy); padding: 44px 56px; }
.auth-brand .logo { height: 24px; width: auto; align-self: flex-start; position: relative; z-index: 1; }
.auth-brand .pitch { position: relative; z-index: 1; max-width: 460px; margin-top: auto; margin-bottom: 40px; }
.auth-brand .eyebrow { font-size: 11px; color: var(--on-navy-muted); margin-bottom: 16px; }
.auth-brand h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 3vw, 38px); line-height: 1.18; color: var(--on-navy); letter-spacing: -.01em; }
.auth-brand h2 em { font-style: normal; color: var(--sky); }
.auth-brand .pitch p { margin-top: 16px; font-size: 14.5px; line-height: 1.6; color: var(--on-navy-muted); }
.auth-brand .foot { position: relative; z-index: 1; font-size: 12px; color: var(--on-navy-muted); border-top: 1px solid var(--navy-line); padding-top: 14px; }

.map-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; }
.flag-meta { margin-left: 6px; font-weight: 400; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 12px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.ftag { display: inline; padding: 0 6px; margin: 0 2px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-soft);
  color: var(--accent); font: 500 11px var(--mono); cursor: pointer; vertical-align: 1px; white-space: nowrap; }
.ftag:hover { background: var(--accent); color: var(--accent-ink); }
.mom-meta, .mom-roster { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0 0 6px; font-size: 12.5px; }
.mom-meta dt, .mom-roster dt { color: var(--muted); }
.mom-meta dd, .mom-roster dd { margin: 0; color: var(--text-2); }
.lib-fold { margin-left: -16px; margin-right: -16px; border-bottom: 0; }

.seg-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.seg-pills :is(button, a) { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font: 500 12px var(--font); cursor: pointer; white-space: nowrap; }
.seg-pills :is(button, a)[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.select.sm { height: 28px; padding: 0 28px 0 10px; font-size: 12.5px; width: auto; max-width: 240px; }
[data-item][hidden], [data-item-group][hidden] { display: none; }
.view-only { margin: 0; }

.card-facts { margin-top: 10px; line-height: 1.6; }
.field-row .link-name .mono { margin-right: 4px; }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 8px; }
.side { padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } 100% { background: transparent; } }
.tabs a[role=tab] { display: inline-flex; align-items: center; padding: 8px 12px 10px; border-bottom: 2px solid transparent; color: var(--muted);
  font: 500 13px var(--font); white-space: nowrap; text-decoration: none; }
.tabs a[role=tab]:hover { color: var(--text); }
.tabs a[role=tab][aria-selected=true] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.table-wrap { overflow: auto; }

.mic-wrap { position: relative; display: inline-flex; align-items: stretch; width: auto; }
.modal-body .mic-wrap, .field > .mic-wrap { display: flex; width: 100%; }
.mic-wrap > .input, .mic-wrap > .textarea { flex: 1; padding-right: 34px; }
.mic { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer; }
.mic:hover { background: var(--hover); color: var(--text); }
.mic.on { background: var(--danger-soft); color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.ind-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ind-pill { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font: 500 12px var(--font); cursor: pointer; white-space: nowrap; }
.ind-pill:hover { border-color: var(--accent-line); }
.ind-pill.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.ind-pill.static { cursor: default; }
.libbox .small { line-height: 1.7; color: var(--text-2); }

/* ================================================================ Deal Context Card table (reference grid-ctx: ID, Field, Value, Class, Conf., Source quote, Drives, DD lead) */
.ctx-table { min-width: 1080px; }
.ctx-grid { display: grid; grid-template-columns: 58px minmax(140px, 1fr) minmax(170px, 1.35fr) 120px 58px minmax(180px, 1.45fr) 96px minmax(170px, 1.05fr);
  gap: 12px; align-items: start; padding: 10px 16px; }
.ctx-th { position: sticky; top: 0; z-index: 3; padding-top: 8px; padding-bottom: 8px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font: 500 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.panel-intro + .ctx-table .ctx-th, .panel-intro + .ctx-table > .ctx-th { top: 0; }
.ctx-row { border-bottom: 1px solid var(--border); font-size: 13px; }
.ctx-row:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.ctx-row.pend { box-shadow: inset 3px 0 0 var(--warn); }
.ctx-row .cid { font: 500 11.5px var(--mono); color: var(--muted); padding-top: 2px; }
.ctx-row .link-name { font-size: 13px; }
.ctx-row .g, .ctx-line .g, .ctx-span.g { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.ctx-row .g.purple { color: var(--purple); }
.ctx-row .g.text-danger { color: var(--danger); }
.ctx-row .vt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); }
.ctx-row .csrc { font-size: 12px; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ctx-row .csrc .qline { color: var(--warn); margin: 0 0 3px; }
.ctx-row .cval .mic-wrap { width: 100%; }
.ctx-row .cval .input { width: 100%; }
.cact { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.tagrow { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.tagchip { padding: 0 7px; border-radius: 999px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--text); font-size: 11px; }
.done { color: var(--ok); font-size: 12px; font-weight: 500; }
.btn.link { height: auto; padding: 0; border: 0; background: none; box-shadow: none; color: var(--accent); font-size: 12px; font-weight: 500; text-decoration: underline;
  text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.link:hover { text-decoration-color: var(--accent); }
.ctx-span { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ctx-span.lead-row { background: var(--surface-2); }
details.ctx-span { display: block; padding: 0; }
.ctx-line { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ctx-line .grow { min-width: 0; }
.ctx-line.contra { align-items: flex-start; }
.accepted-line .cid { font: 500 11.5px var(--mono); color: var(--muted); width: 58px; flex: none; }
.accepted-line .acc-field { width: 220px; flex: none; font-weight: 500; }
.ctx-head .ov-stat .k { white-space: nowrap; }
.ctx-head-text { flex: 0 1 auto; min-width: 0; padding-right: 20px; margin-right: 20px; border-right: 1px solid var(--border); }
.ctx-grid { grid-template-columns: 58px minmax(140px, 1fr) minmax(170px, 1.3fr) 150px 56px minmax(180px, 1.4fr) 96px minmax(170px, 1.05fr); }
.ctx-row .pill { white-space: normal; height: auto; line-height: 1.3; padding-top: 2px; padding-bottom: 2px; text-align: left; }
.ctx-head .ov-chart { flex: 1 1 0; min-width: 0; flex-wrap: wrap; gap: 6px 14px; }
.ctx-head .ov-chart .stackbar { flex: 0 0 120px; min-width: 120px; }
.ctx-head .ov-chart .legend { flex-wrap: wrap; white-space: normal; gap: 4px 14px; }
body.fit-screen .fill > .tab-panel { overflow-x: auto; }

/* card table: buttons wrap inside the DD lead column, nothing spills out of a cell */
.ctx-grid { grid-template-columns: 58px minmax(140px, 1fr) minmax(170px, 1.3fr) 150px 56px minmax(180px, 1.4fr) 92px minmax(190px, 1.1fr); }
.ctx-grid > * { min-width: 0; overflow-wrap: anywhere; }
.cact .btn { white-space: normal; height: auto; min-height: 28px; padding-top: 4px; padding-bottom: 4px; text-align: left; line-height: 1.3; }
.cact form.inline { max-width: 100%; }
.ctx-list { min-width: 0; }
.ctx-head { padding-top: 10px; padding-bottom: 10px; }
/* the card table fits the panel from 1280px up; below that it scrolls sideways inside the panel */
.ctx-table { min-width: 940px; }
.ctx-grid { grid-template-columns: 52px minmax(118px, 1fr) minmax(148px, 1.3fr) 124px 46px minmax(140px, 1.4fr) 76px minmax(156px, 1.1fr);
  gap: 10px; padding-left: 14px; padding-right: 14px; }
.ftag { white-space: normal; display: inline; line-height: 1.6; overflow-wrap: anywhere; }
.ctx-head-text { border-right: 0; margin-right: 0; padding-right: 0; }

/* a row's Actions menu: one quiet button; the actions list as plain menu items */
.row-menu > summary { list-style: none; gap: 4px; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { background: var(--accent-soft); border-color: var(--accent-line); }
.row-menu > .menu-panel { min-width: 230px; max-width: 300px; z-index: 30; }
.row-menu.up > .menu-panel { top: auto; bottom: calc(100% + 6px); }
.menu-panel form { display: block; margin: 0; }
.menu-panel .menu-item, .menu-panel .btn.menu-item { display: flex; width: 100%; height: auto; min-height: 0; justify-content: flex-start; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: none; box-shadow: none; color: var(--text); font: 400 13px var(--font); text-align: left;
  white-space: normal; text-decoration: none; cursor: pointer; }
.menu-panel .menu-item:hover { background: var(--hover); }
.cact { justify-content: flex-start; }
/* column widths now the actions sit in one menu: text columns take the room, DD lead holds a status line and the menu */
.ctx-grid { grid-template-columns: 52px minmax(120px, 1.05fr) minmax(160px, 1.6fr) 124px 48px minmax(170px, 1.8fr) minmax(84px, .6fr) 140px; }
.ctx-row .cact .done, .ctx-row .cact .xs { flex-basis: 100%; }
/* the DD lead column: every button and the Actions menu the same size, one under the other */
.ctx-grid { grid-template-columns: 52px minmax(120px, 1.05fr) minmax(160px, 1.6fr) 124px 48px minmax(170px, 1.75fr) minmax(84px, .6fr) 164px; }
.ctx-row .cact, .ctx-line .cact { flex-direction: column; align-items: stretch; gap: 6px; }
.ctx-row .cact > .btn, .ctx-row .cact > form.inline, .ctx-row .cact > form.inline > .btn, .ctx-row .cact > .row-menu, .ctx-row .cact > .row-menu > summary,
.ctx-line .cact > .btn, .ctx-line .cact > form.inline, .ctx-line .cact > form.inline > .btn, .ctx-line .cact > .row-menu, .ctx-line .cact > .row-menu > summary {
  width: 100%; }
.ctx-row .cact .btn, .ctx-row .cact .row-menu > summary, .ctx-line .cact .btn, .ctx-line .cact .row-menu > summary {
  height: 30px; min-height: 30px; padding: 0 10px; justify-content: center; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-line .cact { width: 164px; flex: none; }
.ctx-row .cact .btn.link { height: auto; min-height: 0; padding: 0; justify-content: flex-start; text-align: left; }
.ctx-row .cact .row-menu > .menu-panel { right: 0; left: auto; }

/* the deal header's stat strip (reference shell.js header strip): eight compact cells */
.stat-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-bottom: 14px; padding: 0; }
.stat-strip .cell { padding: 9px 14px; border-left: 1px solid var(--border); min-width: 0; }
.stat-strip .cell:first-child { border-left: 0; }
.stat-strip .v { font-size: 16px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-strip .v.warn { color: var(--warn); } .stat-strip .v.ok { color: var(--ok); } .stat-strip .v.danger { color: var(--danger); }
.stat-strip .l { margin-top: 2px; font: 500 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat-strip .cell:nth-child(5) { border-left: 0; } }

/* the Deal Context Card header (reference ctxhead) */
.ctx-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding: 14px 18px; }
.ctx-header .eyebrow { font-size: 10.5px; color: var(--muted); }
.ctx-header h3 { margin: 4px 0 2px; font-size: 14.5px; font-weight: 600; }
.ctx-header .hd-line { font-size: 12px; color: var(--muted); }
.ctx-header .hd-line.danger { color: var(--danger); }
.ctx-header p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text-2); max-width: 980px; }
.ctx-header-side { display: flex; align-items: flex-start; }
.ctx-notices { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.notice { padding: 7px 12px; border-radius: 8px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.notice.warn { border-left-color: var(--warn); }
.notice.danger { border-left-color: var(--danger); color: var(--danger); }
.notice form.inline { display: inline-block; margin: 0 4px; }
.stat-strip .l { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; letter-spacing: .04em; }

/* card header, three zones: the counts | the reference note | the toggle */
.ctx-header { grid-template-columns: minmax(300px, auto) minmax(0, 1fr) auto; align-items: center; gap: 6px 22px; padding: 14px 18px; }
.ctx-header-main { min-width: 0; }
.ctx-header h3 { font-weight: 500; color: var(--text-2); }
.ctx-header h3 b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ctx-header-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding-left: 22px; border-left: 1px solid var(--border);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2); max-width: none; }
.ctx-header-note > svg { flex: none; margin-top: 3px; color: var(--muted); }
.ctx-header-side { align-items: center; }
.ctx-header-side .btn { white-space: nowrap; }
@media (max-width: 1180px) { .ctx-header { grid-template-columns: minmax(0, 1fr) auto; } .ctx-header-note { grid-column: 1 / -1; padding-left: 0; border-left: 0; } }
/* card header: side by side only when there is room for the note on a few lines; otherwise the note runs full width below */
.ctx-header { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto; }
.ctx-header .hd-line { overflow-wrap: anywhere; }
@media (max-width: 1499px) {
  .ctx-header { grid-template-columns: minmax(0, 1fr) auto; row-gap: 10px; }
  .ctx-header-main { grid-column: 1; grid-row: 1; }
  .ctx-header-side { grid-column: 2; grid-row: 1; }
  .ctx-header-note { grid-column: 1 / -1; grid-row: 2; padding: 10px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}
@media (min-width: 1500px) { .ctx-header { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; } }
/* stat strip: the interface font, labels as written (no forced capitals, no wide tracking) */
.stat-strip .v { font-family: var(--font); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.stat-strip .l { font-family: var(--font); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); line-height: 1.35; margin-top: 3px; }
.stat-strip { grid-template-columns: 1.5fr 1.15fr repeat(6, minmax(0, 1fr)); }
.stat-strip .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* stat strip as eight small cards */
.stat-strip { gap: 10px; padding: 0; background: none; border: 0; box-shadow: none; }
.stat-strip .cell, .stat-strip .cell:first-child { border-left: 0; padding: 10px 14px; border-radius: 12px; }
@media (max-width: 1100px) { .stat-strip .cell:nth-child(5) { border-left: 0; } }
.stat-strip { grid-template-columns: repeat(8, auto); }
@media (max-width: 1100px) { .stat-strip { grid-template-columns: repeat(4, auto); } }
/* eight equal cards; a long label wraps onto two balanced lines and every card keeps the same height */
.stat-strip { grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: stretch; }
.stat-strip .l { white-space: normal; overflow: visible; text-overflow: clip; text-wrap: balance; }
@media (max-width: 1100px) { .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Kick-off: the file's details as an icon list; industry and transaction type side by side */
.facts-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.facts-list li { display: grid; grid-template-columns: 26px 128px minmax(0, 1fr); align-items: center; font-size: 13px; }
.facts-list .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.facts-list .k { color: var(--muted); padding-left: 10px; }
.facts-list .val { color: var(--text); overflow-wrap: anywhere; }
.deal-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.deal-setup .section-title { margin-bottom: 0; }

/* Minutes: attendees as parties and people */
.attendees { padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.attendees .section-title { margin-bottom: 8px; }
.parties { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 12px; font-size: 13px; }
.parties dt { color: var(--muted); }
.parties dd { margin: 0; color: var(--text); font-weight: 500; }
.people-group + .people-group { margin-top: 10px; }
.pg-title { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.person { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.person .initials { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); }
.person .who { display: flex; flex-direction: column; min-width: 0; }
.person .nm { font-size: 12.5px; font-weight: 500; color: var(--text); }
.person .rl { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.deal-setup { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.facts-list { margin-top: 2px; }
/* people as slim one-line chips that flow: initials · name · role */
.people { display: flex; flex-wrap: wrap; gap: 5px 6px; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; max-width: 100%; }
.person .initials { width: 20px; height: 20px; font-size: 9.5px; }
.person .who { flex-direction: row; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.person .nm { font-size: 12px; }
.person .rl { font-size: 11.5px; }
.person .rl::before { content: "· "; color: var(--faint); }
.people-group + .people-group { margin-top: 8px; }
.pg-title { margin-bottom: 5px; }

/* the bottom bar carries only the next step, centred; with nothing to do it disappears and the page takes the room */
.actionbar { justify-content: center; }
.actionbar .cta { margin: 0 auto; justify-content: center; }
.actionbar.with-msg { justify-content: space-between; } .actionbar.with-msg .cta { margin: 0 0 0 auto; }
.actionbar .msg a { color: inherit; text-decoration: underline; text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actionbar .msg.working { margin: 0 auto; }
.actionbar:not(:has(.cta > *)):not(:has(.working)) { display: none; }
body:has(.actionbar:not(:has(.cta > *)):not(:has(.working))) .content { padding-bottom: 24px; }
/* the next step sits on the right of the bottom bar */
.actionbar { justify-content: flex-end; }
.actionbar .cta { margin: 0 0 0 auto; justify-content: flex-end; }

/* Deal Context Card: one card, title + (i) + one count line, three tabs; rows carry the key information and open the side panel */
.ctx-line1 { margin-top: 3px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.ctx-line1.text-danger { color: var(--danger); }
.info-pop { position: relative; }
.info-pop > summary { list-style: none; }
.info-pop > summary::-webkit-details-marker { display: none; }
.info-btn { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); cursor: pointer; }
.info-btn:hover, .info-pop[open] > .info-btn { background: var(--accent-soft); color: var(--accent); }
.info-pop > .menu-panel { left: 0; right: auto; width: 420px; padding: 12px 14px; font-size: 12.5px; line-height: 1.55; color: var(--text-2); z-index: 40; }
.ctx-grid { grid-template-columns: 52px minmax(150px, 1.4fr) minmax(170px, 1.4fr) 150px 56px 164px; }
.ctx-table { min-width: 760px; }
/* Action needed carries the Source quote (reference grid-ctx), between Conf. and Actions */
.ctx-grid.wq { grid-template-columns: 52px minmax(140px, 1.1fr) minmax(150px, 1fr) 140px 52px minmax(220px, 1.9fr) 164px; }
.ctx-table:has(.wq) { min-width: 980px; }
.ctx-row .csrc { -webkit-line-clamp: 3; font-style: italic; }
.ctx-row { cursor: pointer; }
.ctx-row .cfield .nm { font-weight: 600; font-size: 13px; color: var(--text); }
.ctx-row .vt { -webkit-line-clamp: 2; }
.ctx-line[data-open-drawer] { cursor: pointer; }
.ctx-line[data-open-drawer]:hover, .ctx-row:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }

/* the header is its own card above the table card */
.ctx-head { flex: none; padding: 12px 18px; }
.ctx-title { display: flex; align-items: center; gap: 6px; }
.ctx-title h2 { white-space: nowrap; margin: 0; }
.ctx-countline { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.ctx-countline.text-danger { color: var(--danger); }
.ctx-countline b { font-weight: 600; color: var(--text); }
.ctx-head .ctx-notices { margin-top: 10px; }

/* Draft IRL (reference tab-draft.js): critic banner card, class tabs, stakeholder pills, the request table */
.dr-flags { flex: none; max-height: 34vh; overflow-y: auto; }
.dr-flags-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 4px; }
.dr-flags-head .eyebrow { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dr-flags > .fold { border-top: 1px solid var(--border); }
.dr-head { align-items: flex-end; }
.dr-head .tabs [role=tab][aria-pressed=true] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.dr-head-side { margin-left: auto; display: flex; align-items: center; gap: 12px; padding-bottom: 8px; }
.dr-owners { gap: 10px; align-items: flex-start; }
.dr-owners > .xs { line-height: 26px; }
.dr-owners .seg-pills { flex: 1; min-width: 0; }
.dr-owners .seg-pills :is(button, a) { white-space: nowrap; height: 24px; font-size: 12px; }
.dr-table { min-width: 820px; }
.dr-grid { display: grid; grid-template-columns: 84px minmax(0, 1fr) 48px 112px 96px minmax(140px, 200px); gap: 14px; align-items: start; padding: 10px 16px; }
.dr-grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.dr-row { border-bottom: 1px solid var(--border); font-size: 13px; }
.dr-row[data-open-drawer] { cursor: pointer; }
.dr-row[data-open-drawer]:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.dr-row .rid, .dr-na .rid { font: 500 11.5px var(--mono); color: var(--muted); padding-top: 2px; overflow-wrap: anywhere; }
.dr-row .rq { min-width: 0; }
.dr-row .tx { color: var(--text); line-height: 1.5; }
.dr-row .ws { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.dr-row .num { color: var(--text-2); padding-top: 1px; }
.dr-row .fo { font-size: 12px; color: var(--text-2); line-height: 1.45; overflow-wrap: anywhere; }
.dr-row .pill { white-space: nowrap; }
.dr-row .pri { width: auto; min-width: 28px; padding: 0 7px; white-space: nowrap; }
.dr-group { padding: 10px 16px 4px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.why-link { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.why-link:hover { text-decoration: underline; }
.dr-nalog { border-top: 1px solid var(--border); }
.dr-na { display: grid; grid-template-columns: 84px minmax(0, 1fr) 20px; gap: 14px; align-items: start; padding: 10px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.dr-na:hover { background: color-mix(in srgb, var(--hover) 70%, transparent); }
.dr-na .nm { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.45; }
.dr-na .ws { margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dr-na .go { color: var(--muted); padding-top: 1px; }
.dr-na:hover .go { color: var(--accent); }
/* Deal Context Card, Show all: titled drill-downs */
.ctx-sec > summary .fold-meta { margin-left: 10px; }
.ctx-sec[open] > summary { border-bottom: 1px solid var(--border); }

/* Deals: what waits for the Approver, first thing after sign-in */
.card.waiting { margin-bottom: 16px; }
.wait-sq { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--warn-soft); color: var(--warn); }
.wait-sq.draft { background: var(--accent-soft); color: var(--accent); }
.card.waiting .list-row .btn { pointer-events: none; }
.quote.muted-quote { font-style: italic; color: var(--text-2); }

/* ================================================================ workspace console (deals:home) */
.console-sec { margin-bottom: 26px; }
.console-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.console-head h2 { font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.console-head p { color: var(--muted); font-size: 12.5px; }
.console-head p:last-child:not(:first-child) { margin-left: auto; }

.action-none { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  color: var(--muted); font-size: 13px; }
.action-none svg { color: var(--ok); }
.action-none.in-card { border: 0; border-radius: 0; padding: 22px; }

.console-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.console-filters .push { margin-left: auto; }
.console-search { display: flex; align-items: center; gap: 8px; width: min(340px, 100%); height: 36px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); }
.console-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.console-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 13px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); text-decoration: none; }
.filter-chip:hover { background: color-mix(in srgb, var(--accent-soft) 60%, var(--accent-line)); }


/* the deal's stages in the sidebar: the IRL steps under "01 · IRL", then VDR, Due Diligence and Workpaper */
.side-stage { padding: 6px 10px 2px; font: 600 11px var(--mono); letter-spacing: .04em; color: var(--muted); }
.side-stage-link { margin-top: 2px; }
.side-stage-no { font: 500 11px var(--mono); color: var(--faint); margin-right: 7px; }
.side-link[aria-current="page"] .side-stage-no { color: rgba(255, 255, 255, .75); }
.side-link.locked .count.accent { opacity: 1; }

/* slow-load indicator (app.js): only after 2 s of waiting for a page or an HTMX request */
.slow-load { position: fixed; inset: 0; z-index: 1000; pointer-events: none; }
.slow-load[popover] { width: auto; height: auto; margin: 0; padding: 0; border: 0; background: transparent; overflow: visible; color: inherit; }
.slow-load[popover]::backdrop { display: none; }
.slow-dim { position: absolute; inset: 0; background: rgba(11, 19, 40, .14); backdrop-filter: saturate(.65) brightness(.97);
  -webkit-backdrop-filter: saturate(.65) brightness(.97); animation: slow-fade .3s ease-out; }       /* the page is dulled, not blocked */
.slow-bar { position: relative; }
.slow-text { display: inline-block; min-width: 0; }
.slow-text.in { animation: slow-fade .35s ease-out; }
@keyframes slow-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .slow-dim, .slow-text.in { animation: none; } }
.slow-load[hidden] { display: none; }
.slow-bar { display: block; height: 3px; background: linear-gradient(90deg, transparent, var(--accent) 40%, var(--accent-2) 60%, transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: slow-slide 1.1s ease-in-out infinite; }
.slow-pill { position: absolute; top: 12px; left: 0; right: 0; width: max-content; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500;
  color: var(--text-2); animation: pop-in .18s ease-out; }
.slow-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes slow-slide { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* ---------------------------------------------------------------- console: design review (TruStackDD_Console_Build_Review.pdf) */
.console-page .topbar h1 { font-family: var(--font); font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.greet-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent); font: 600 14px var(--font); }
.greet-line .hot { color: var(--warn); font-weight: 600; }
.console-setup { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }

           /* the whole tile filters the table */

.tab-n.hot { background: var(--warn-soft); color: var(--warn); }
.action-none a { margin-left: 6px; color: var(--accent); font-weight: 600; }
.side-link .tile.side-no { font: 500 12px var(--mono); }
.settings-theme { max-width: 320px; }


/* release e-mails (approve.html, E-mails tab): contributor pills, the chosen e-mail open in full, as in the reference */
.mail-pills { padding: 0 16px 12px; }
.mail-card { margin: 0 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.mail-card.dim { opacity: .6; }
.mail-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 12px; padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); font-size: 12.5px; }
.mail-head .k { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
.mail-body { padding: 12px 14px; font-size: 13px; line-height: 1.55; }
.mail-body p { margin: 0 0 8px; color: var(--text-2); white-space: pre-line; }
.mail-foot { display: flex; justify-content: flex-end; padding: 0 14px 12px; }

/* sidebar groups (Stages, Workspace): open on workspace pages, collapsed inside a deal; the label toggles them */
.side-group { display: flex; flex-direction: column; gap: 4px; }
.side-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; user-select: none; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group > summary:hover { color: var(--text-2); }
.side-group > summary .chev { transition: transform .15s; }
.side-group:not([open]) > summary .chev { transform: rotate(-90deg); }
.side-group:not([open]) > summary::after { content: "Show"; margin-left: auto; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .7; }

/* release e-mails as an inbox: contributor list | the e-mail as it reads (supersedes the pill layout above) */
.mailbox { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100%; }
.mail-list { display: flex; flex-direction: column; border-right: 1px solid var(--border); padding: 8px; gap: 2px; overflow-y: auto; }
.mail-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mail-list button:hover { background: var(--hover); }
.mail-list button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-list .ml-name { font-size: 13px; font-weight: 600; }
.mail-list .ml-meta { font-size: 11.5px; color: var(--muted); }
.mail-list .ml-warn { color: var(--warn); }
.mail-pane { padding: 16px 20px 20px; min-width: 0; }
.mail-pane .mail-card { margin: 0; border: 0; background: none; border-radius: 0; }
.mail-pane .mail-head { display: block; padding: 0 0 12px; background: none; border-bottom: 1px solid var(--border); }
.mail-subject { font: 600 16px/1.35 var(--font); margin: 0 0 10px; }
.mail-to { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.mail-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 12px; }
.mail-copy { flex: none; }
.mail-pane .mail-body { padding: 14px 0 0; font-size: 13.5px; line-height: 1.6; max-width: 760px; }
.mail-pane .mail-body > p { color: var(--text); margin: 0 0 14px; }
.mail-items { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.mail-items li { padding: 9px 12px; }
.mail-items li + li { border-top: 1px solid var(--border); }
.mi-top { display: flex; align-items: baseline; gap: 10px; }
.mi-title { flex: 1; font-weight: 600; font-size: 13px; }
.mi-sub { font-size: 12px; color: var(--muted); line-height: 1.45; }
.mail-more { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.mail-attach { display: flex; align-items: center; gap: 10px; max-width: min(460px, 100%); margin-top: 14px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.mail-attach-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--ok-soft); color: var(--ok); }
.mail-attach-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mail-attach-name { display: flex; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.mail-attach-name .stem { overflow: hidden; text-overflow: ellipsis; min-width: 0; }          /* shortened in the middle: the person and .xlsx stay */
.mail-attach-name .tail { flex: none; }
.mail-attach-meta { font-size: 11.5px; color: var(--muted); }
@media (max-width: 860px) { .mailbox { grid-template-columns: 1fr; } .mail-list { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); } }
/* the contributor list and the open e-mail scroll on their own; the E-mails panel itself does not */
.tab-panel[data-panel="mails"]:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
.tab-panel[data-panel="mails"] > .mailbox { flex: 1; min-height: 0; height: min(70vh, 720px); grid-template-rows: minmax(0, 1fr); }
body.fit-screen .fill > .tab-panel[data-panel="mails"] { overflow: hidden; }
body.fit-screen .tab-panel[data-panel="mails"] > .mailbox { height: auto; }
.mail-list, .mail-pane { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 860px) { .tab-panel[data-panel="mails"] > .mailbox { height: auto; grid-template-rows: auto; } .mail-list, .mail-pane { overflow: visible; } }

/* approve page, left card: library coverage decisions (queued for methodology review) */
.decisions-note { margin: -2px 0 8px; }
.decisions { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.decisions li { padding: 9px 12px; }
.decisions li + li { border-top: 1px solid var(--border); }
.decisions .dc-top { display: flex; align-items: flex-start; gap: 8px; }
.decisions .dc-top .pill { flex: none; height: 20px; font-size: 11px; }
.decisions .dc-title { font-size: 13px; font-weight: 600; line-height: 1.4; }
.decisions .dc-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.decisions .dc-why { margin-top: 5px; padding-left: 9px; border-left: 2px solid var(--border-strong); font-size: 12.5px; color: var(--text-2); }

/* ===== Approve & release: hero, final IRL by folder, release board (reference workflow, one release for all contributors) ===== */
.ap-hero { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.ap-hero .small { color: var(--text-2); margin-top: 2px; }
.ap-hero-icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--sunken); color: var(--muted); }
.ap-hero.locked { background: var(--navy, #0f1b3d); border-color: transparent; color: #fff; }
.ap-hero.locked .small, .ap-hero.locked .ap-hero-meta { color: rgba(255, 255, 255, .72); }
.ap-hero.locked .ap-hero-icon { background: var(--ok); color: #fff; }
.ap-hero.ready { border-color: var(--ok-line); background: var(--ok-soft); } .ap-hero.ready .ap-hero-icon { background: var(--ok); color: #fff; }
.ap-hero.blocked { border-color: var(--warn-line); background: var(--warn-soft); } .ap-hero.blocked .ap-hero-icon { background: var(--warn); color: #fff; }
.ap-hero-meta { white-space: nowrap; }
.ap .kpis { margin-bottom: 0; }
.ap .kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; }      /* no icon: label, number, note */
.ap .kpi .k, .ap .kpi .v, .ap .kpi .s { grid-column: auto; grid-row: auto; max-width: 100%; }
.ap .kpi .v { font-size: 24px; line-height: 1.2; }
.ap .kpi .s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-split { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px; padding: 16px; align-items: start; }
.ap-nav { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.ap-nav-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ap-nav > [role=tab] { display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-align: left; border: 0; border-top: 1px solid var(--border); background: none; color: inherit; cursor: pointer; font: inherit; }
.ap-nav > .ap-nav-head + [role=tab] { border-top: 0; }
.ap-nav > [role=tab]:hover { background: var(--surface-2); }
.ap-nav > [role=tab][aria-selected=true] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.ap-nav .grow { display: flex; flex-direction: column; min-width: 0; }
.ap-nav .nm { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.ap-pane { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.ap-pane-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ap-table td:nth-child(2) { min-width: 260px; }
.ap-table tr[hidden] { display: none; }
.ap-person:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 14px; border: 0; background: none; overflow: visible; }
/* Release: a narrow contributor list and e-mail, the room goes to the contact and the requests in the centre */
.ap-split.ap-people { grid-template-columns: minmax(150px, 190px) minmax(0, 1fr); gap: 14px; }
.ap-people .ap-nav > [role=tab] { gap: 8px; padding: 9px 12px; }
.ap-people .ap-nav .nm { font-size: 12.5px; }
.ap-box { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; }
.ap-box.flush { padding: 0; overflow: hidden; }
.ap-box-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ap-box.flush .ap-box-head { margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ap-mail { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; align-self: start; }
.ap-mail.mail-card { margin: 0; }
.ap-mail .mail-head { display: block; padding: 14px 16px 12px; background: var(--surface-2); }
.ap-mail .mail-head .row { align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ap-mail .mail-subject { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.ap-mail .mail-head .pill { flex: none; margin-top: 1px; }
.ap-mail .mail-to { overflow-wrap: anywhere; }
.ap-mail .mail-body { padding: 14px 16px; font-size: 13.5px; line-height: 1.6; }
.ap-mail .mail-body > p { color: var(--text); margin: 0 0 12px; }
.ap-mail.dim { opacity: .6; }
.ap-mail-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.ap-folders-box { margin: 12px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.ap-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px 16px 0; }
.ap-choice > button { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.ap-choice > button[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ap-choice .grow { display: flex; flex-direction: column; gap: 3px; }
.ap-choice-icon { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.ap-release-foot { gap: 14px; }
.ap-meter { flex: none; width: 140px; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.ap-meter i { display: block; height: 100%; background: var(--ok); }
.ap-record { display: grid; gap: 22px; align-content: start; }
.ap-record .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-hero-btn { flex: none; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.ap-hero-btn:hover { background: rgba(255, 255, 255, .18); }
.dot-status.ready { background: var(--ok-line, var(--ok)); } .dot-status.queued, .dot-status.offline { background: var(--warn); }
.dot-status.room_proposed, .dot-status.room_live { background: var(--ok); }
@media (max-width: 1180px) { .ap-person:not([hidden]) { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .ap .kpis { --cols: 3 !important; } }
@media (max-width: 760px) { .ap .kpis { --cols: 2 !important; } .ap-split, .ap-choice { grid-template-columns: 1fr; } .ap-hero { flex-wrap: wrap; } }

/* the deal id beside its name in deal lists (reference shell.js deals list) */
.deal-id { font: 500 11px var(--mono); color: var(--muted); white-space: nowrap; }
/* BX-15: printing the card shows every value and quote in full, without the navigation */
@media print {
  .sidebar, .actionbar, .topbar .actions, .tabs-head, .row-menu, .cact, .slow-load, .scrim, .drawer { display: none !important; }
  .main { margin: 0 !important; } body.fit-screen, .fit-col, .fit-stack, .scroll, .tab-panel { height: auto !important; overflow: visible !important; }
  .tab-panel[hidden], [data-switch-panel][hidden] { display: block !important; }
  .ctx-row .vt, .ctx-row .csrc, .clamp-1 { -webkit-line-clamp: unset !important; display: block !important; overflow: visible !important; white-space: normal !important; }
  .ctx-row, .ctx-line { break-inside: avoid; }
  details > * { display: block !important; }
}

/* ================================================================ TruStackDD brand, November 2026 (Reference/TruStackDD-logo-kit, VDR screen designs)
   Black on white in light, white on charcoal in dark: the surfaces and the text stay neutral. Deep evergreen #164B43 is the one brand
   colour and is used sparingly (primary buttons, links, the active marker, the logo); brass #C4A568 only marks (a row that waits on
   you). Status keeps its own colours: amber waits, red is missing or failing, green is done, blue is an agent at work. */
:root, html[data-theme="light"] {
  --paper: #F7F7F5; --graphite: #202824; --evergreen: #164B43; --brass: #C4A568;
  --bg: #F7F7F5; --surface: #FFFFFF; --surface-2: #FAFAF9; --sunken: #F1F1EF; --hover: #F2F2F0;
  --border: #E4E4E1; --border-strong: #CACAC6; --text: #111111; --text-2: #3B3B3B; --muted: #6E6E6B; --faint: #A3A3A0;
  --accent: #164B43; --accent-hover: #0F3A33; --accent-ink: #FFFFFF; --accent-soft: #EEF3F1; --accent-line: #C9DAD3;
  --accent-2: #1D5A50; --accent-3: #C4A568;
  --grad: linear-gradient(135deg, #1D5A50 0%, #164B43 60%, #123E37 100%);
  --grad-hover: linear-gradient(135deg, #18504A 0%, #123E37 60%, #0E322C 100%);
  --glow: 0 2px 8px rgba(22, 75, 67, .18);
  --ok: #1E6B37;     --ok-soft: #E9F4EC;     --ok-line: #C4E2CD;
  --warn: #8A4B00;   --warn-soft: #FDF2E4;   --warn-line: #F1D3AE;
  --danger: #A3241B; --danger-soft: #FCEEEC; --danger-line: #F2C9C4;
  --info: #1D5A9E;   --info-soft: #EBF2FB;   --info-line: #C6DAF2;
  --purple: #6B3FA0; --purple-soft: #F4EFFA; --purple-line: #DCCDF0;
  --btn-line: #BDBDB8;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 2px 6px rgba(17, 17, 17, .04);
  --shadow-lg: 0 4px 14px rgba(17, 17, 17, .07), 0 1px 3px rgba(17, 17, 17, .05);
  --shadow-xl: 0 16px 32px rgba(17, 17, 17, .12), 0 4px 10px rgba(17, 17, 17, .06);
  --s1: #1F6B5D; --meter-track: #E3E8E6;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0F1011; --surface: #17181A; --surface-2: #1C1D20; --sunken: #0B0C0D; --hover: #222326;
  --border: #2A2C2F; --border-strong: #3D4044; --text: #F4F4F2; --text-2: #D0D0CC; --muted: #9B9B97; --faint: #6B6B68;
  --accent: #7FC2B2; --accent-hover: #9BD1C4; --accent-ink: #0D1F1B; --accent-soft: #19221F; --accent-line: #2C4740;
  --accent-2: #9BD1C4; --accent-3: #D2B87F;
  --grad: linear-gradient(135deg, #24806F 0%, #1D6B5E 60%, #185A4F 100%);
  --grad-hover: linear-gradient(135deg, #2A8E7C 0%, #22786A 60%, #1D6B5E 100%);
  --glow: 0 2px 10px rgba(0, 0, 0, .35);
  --ok: #6CC489;     --ok-soft: #13221A;     --ok-line: #24482F;
  --warn: #E2AE5C;   --warn-soft: #261E12;   --warn-line: #5A4220;
  --danger: #F08A7F; --danger-soft: #291615; --danger-line: #5C2A25;
  --info: #8AB6EA;   --info-soft: #141D2C;   --info-line: #2A4468;
  --purple: #C9A8F2; --purple-soft: #201A2B; --purple-line: #4A3868;
  --btn-line: #4A4D52;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 6px 18px rgba(0, 0, 0, .4); --shadow-xl: 0 18px 36px rgba(0, 0, 0, .55);
  --s1: #4FA593; --meter-track: #26292C;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0F1011; --surface: #17181A; --surface-2: #1C1D20; --sunken: #0B0C0D; --hover: #222326;
    --border: #2A2C2F; --border-strong: #3D4044; --text: #F4F4F2; --text-2: #D0D0CC; --muted: #9B9B97; --faint: #6B6B68;
    --accent: #7FC2B2; --accent-hover: #9BD1C4; --accent-ink: #0D1F1B; --accent-soft: #19221F; --accent-line: #2C4740;
    --accent-2: #9BD1C4; --accent-3: #D2B87F;
    --grad: linear-gradient(135deg, #24806F 0%, #1D6B5E 60%, #185A4F 100%);
    --grad-hover: linear-gradient(135deg, #2A8E7C 0%, #22786A 60%, #1D6B5E 100%);
    --glow: 0 2px 10px rgba(0, 0, 0, .35);
    --ok: #6CC489;     --ok-soft: #13221A;     --ok-line: #24482F;
    --warn: #E2AE5C;   --warn-soft: #261E12;   --warn-line: #5A4220;
    --danger: #F08A7F; --danger-soft: #291615; --danger-line: #5C2A25;
    --info: #8AB6EA;   --info-soft: #141D2C;   --info-line: #2A4468;
    --purple: #C9A8F2; --purple-soft: #201A2B; --purple-line: #4A3868;
    --btn-line: #4A4D52;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 6px 18px rgba(0, 0, 0, .4); --shadow-xl: 0 18px 36px rgba(0, 0, 0, .55);
    --s1: #4FA593; --meter-track: #26292C;
    color-scheme: dark;
  }
}

/* type: one sans for headings too; eyebrows and labels in neutral grey */
h1, .serif, .auth h1, .topbar-card h1 { font-family: var(--font); font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.eyebrow, .section-title { color: var(--muted); }
.side-label, .kpi .k { color: var(--muted); }

/* buttons: primary = evergreen (a gentle fade), secondary = white with a graphite-grey line, text links in evergreen */
.btn { border-color: var(--border-strong); }
.btn.primary { background: var(--grad); color: var(--accent-ink); border-color: transparent; box-shadow: var(--glow); }
.btn.primary:hover { background: var(--grad-hover); }
.btn.secondary { background: var(--surface); border-color: var(--btn-line); color: var(--text); font-weight: 600; }
.btn.secondary:hover { background: var(--hover); border-color: var(--text-2); color: var(--text); }
html[data-theme="dark"] .btn.primary { color: #FFFFFF; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .btn.primary { color: #FFFFFF; } }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 1; background: var(--bg); border-color: var(--border); color: var(--faint); box-shadow: none; }
a.link, .link, .editlink { color: var(--accent); }

/* tabs: evergreen text and underline; tables: paper header, hairlines */
.tabs [role=tab][aria-selected=true], .tabs .active { color: var(--text); border-color: var(--accent); }
.table th { background: var(--bg); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; }

/* ---------------------------------------------------------------- the sidebar: Paper ground in light, graphite in dark */
.sidebar { background: #FBFBFA; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none;
  --text: #111111; --muted: #6E6E6B; --faint: #A3A3A0; --hover: #F0F0EE; --surface: #FFFFFF; --surface-2: #F4F4F2;
  --border: #E4E4E1; --sidebar-line: #E4E4E1; --sunken: #F1F1EF; color: var(--text); width: var(--sidebar-w); transition: width .2s ease;
  --accent: #164B43; --accent-soft: #EDEDEA; --accent-line: #D6D6D2; --accent-ink: #FFFFFF; }
html[data-theme="dark"] .sidebar { background: #131416; --text: #F4F4F2; --muted: #9B9B97; --faint: #6B6B68; --hover: #1E1F22; --surface: #17181A;
  --surface-2: #1A1B1E; --border: #2A2C2F; --sidebar-line: #2A2C2F; --sunken: #0B0C0D;
  --accent: #7FC2B2; --accent-soft: #232427; --accent-line: #34363A; --accent-ink: #0D1F1B; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .sidebar { background: #131416; --text: #F4F4F2; --muted: #9B9B97; --faint: #6B6B68; --hover: #1E1F22;
  --surface: #17181A; --surface-2: #1A1B1E; --border: #2A2C2F; --sidebar-line: #2A2C2F; --sunken: #0B0C0D;
  --accent: #7FC2B2; --accent-soft: #232427; --accent-line: #34363A; --accent-ink: #0D1F1B; } }
.brand-row { display: flex; align-items: center; gap: 6px; padding: 16px 12px 14px 18px; border-bottom: 1px solid var(--sidebar-line); }
.sidebar .brand-row .brand { flex: 1; min-width: 0; padding: 0; border: 0; align-items: flex-start; }
.sidebar .brand img { height: 21px; width: auto; }
.sidebar .brand .logo-mark { height: 22px; }
.side-collapse { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.side-collapse:hover { background: var(--hover); color: var(--text); }
/* which logo: graphite on light, white on dark; full logo, or the symbol when collapsed */
.logo-mark, .on-dark { display: none !important; }
.logo-full.on-light { display: block !important; }
html[data-theme="dark"] .on-light { display: none !important; }
html[data-theme="dark"] .logo-full.on-dark { display: block !important; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .on-light { display: none !important; } html[data-theme="auto"] .logo-full.on-dark { display: block !important; } }

.side-link { color: var(--text-2, #3E4943); color: color-mix(in srgb, var(--text) 82%, transparent); transform: none !important; }
.side-link:hover { color: var(--text); background: var(--hover); box-shadow: none; }
.side-link .tile { color: var(--muted); background: transparent; }
.side-link[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--evergreen, #164B43); }
.side-link[aria-current="page"] .tile { color: var(--text); }
.side-link .count { background: transparent; color: var(--muted); font-weight: 500; }
.side-link[aria-current="page"] .count { background: transparent; color: var(--text-2); }
.side-link .count.attention { background: var(--warn-soft); color: var(--warn); }
.side-link .count.accent { background: transparent; color: var(--faint); font-weight: 500; }
.side-link.done .tile { color: var(--ok); }
.side-link.locked { color: var(--faint); opacity: .75; }
.side-deal, .side-switch { background: var(--surface); border-color: var(--border); }
.side-switch:hover, .side-switch[aria-expanded=true] { background: var(--surface); border-color: var(--accent-line); }
.side-foot .avatar, .avatar { background: var(--sunken); color: var(--text); border: 1px solid var(--border); }
html[data-theme="dark"] .side-link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .side-link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); } }

/* sign-in panel: deep evergreen, faded towards graphite; the white logo */
.auth-brand { background: radial-gradient(110% 80% at 85% -10%, rgba(31, 97, 85, .55) 0%, rgba(22, 75, 67, 0) 60%), linear-gradient(160deg, #1E2420 0%, #151917 100%);
  --on-navy: #F4F4F2; --on-navy-muted: #B4B6B2; --navy-line: rgba(244, 244, 242, .14); }
.auth-brand h2 em { color: var(--brass, #C4A568); }

/* ---------------------------------------------------------------- collapsed sidebar: a 68px rail of icons (tablet and desktop) */
@media (min-width: 861px) {
  html.sb-collapsed { --sidebar-w: 68px; }
  html.sb-collapsed .brand-row { flex-direction: column; padding: 14px 8px 10px; gap: 10px; }
  html.sb-collapsed .sidebar .brand { align-items: center; }
  html.sb-collapsed .logo-full { display: none !important; }
  html.sb-collapsed .logo-mark.on-light { display: block !important; }
  html.sb-collapsed[data-theme="dark"] .logo-mark.on-light, html.sb-collapsed[data-theme="dark"] .logo-full.on-dark { display: none !important; }
  html.sb-collapsed[data-theme="dark"] .logo-mark.on-dark { display: block !important; }
  html.sb-collapsed .side-nav { padding: 8px 8px; }
  html.sb-collapsed .side-label, html.sb-collapsed .side-stage, html.sb-collapsed .side-stage-no { display: none; }
  html.sb-collapsed .side-link { font-size: 0; justify-content: center; gap: 0; padding: 6px 0; position: relative; }
  html.sb-collapsed .side-link .grow { display: none; }
  html.sb-collapsed .side-link .tile { width: 32px; height: 32px; }
  html.sb-collapsed .side-link .count { position: absolute; top: 3px; right: 9px; min-width: 0; width: 8px; height: 8px; padding: 0; border-radius: 50%; font-size: 0; }
  html.sb-collapsed .side-link .count:not(.attention) { display: none; }
  html.sb-collapsed .side-link .count.attention { background: var(--warn); }
  html.sb-collapsed .side-deal { padding: 6px; display: grid; place-items: center; }
  html.sb-collapsed .side-deal .grow { display: none; }
  html.sb-collapsed details.side-group > summary { justify-content: center; font-size: 0; }
  html.sb-collapsed .side-foot { padding: 10px 8px; }
  html.sb-collapsed .user-chip { flex-direction: column; gap: 6px; }
  html.sb-collapsed .user-chip .grow { display: none; }
  html.sb-collapsed .sidebar .seg { display: none; }
}
@media (min-width: 861px) and (prefers-color-scheme: dark) {
  html.sb-collapsed[data-theme="auto"] .logo-mark.on-light, html.sb-collapsed[data-theme="auto"] .logo-full.on-dark { display: none !important; }
  html.sb-collapsed[data-theme="auto"] .logo-mark.on-dark { display: block !important; }
}
.main, .actionbar { transition: margin-left .2s ease, left .2s ease; }
.menu-toggle { display: none !important; }          /* the menu button exists on phones and portrait tablets only */

/* ---------------------------------------------------------------- tablets (iPad) and touch */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
.app, .main { min-height: 100dvh; }
body.fit-screen .main { height: 100dvh; }
.actionbar { bottom: max(14px, env(safe-area-inset-bottom)); }
@media (max-width: 860px) {
  .side-collapse { display: none; }
  .sidebar { width: 272px; background: var(--bg); box-shadow: var(--shadow-xl); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(18, 22, 20, .32); }
  .menu-toggle { display: inline-flex !important; flex: none; }
  .actionbar { bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (max-width: 1024px) {
  .kpis[style*="--cols:5"], .ap .kpis { --cols: 3 !important; }
  .ap-split, .ap-split.ap-people { grid-template-columns: 1fr; }
  .ap-nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .ap-nav-head { display: none; }
  .ap-nav > [role=tab] { flex: none; border-top: 0; border-right: 1px solid var(--border); }
  .ap-nav > [role=tab][aria-selected=true] { box-shadow: inset 0 -3px 0 var(--accent); }
  .ap-choice { grid-template-columns: 1fr; }
  .topbar-card { flex-wrap: wrap; }
  .topbar .actions { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .btn { min-height: 40px; } .btn.sm { min-height: 34px; } .btn.icon-only { min-width: 40px; }
  .side-link { min-height: 42px; } .side-collapse { width: 38px; height: 38px; }
  .input, .select, .textarea { font-size: 16px; }          /* iOS: no zoom on focus */
  .input, .select { min-height: 40px; }
  .side-link:hover, .kpi:hover { transform: none; }
  .tabs [role=tab] { min-height: 40px; }
}

/* Approve & release on the new palette: the locked banner in graphite with an evergreen lock; contributor names never split mid-word */
.ap-hero.locked { background: linear-gradient(135deg, #24292B 0%, #1C2022 60%, #161A1B 100%); }
.ap-hero.locked .ap-hero-icon { background: var(--evergreen, #164B43); box-shadow: inset 0 0 0 1px rgba(196, 165, 104, .55); }
.ap-hero-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ap-nav .nm { overflow-wrap: break-word; word-break: normal; hyphens: none; }
.ap-people .ap-nav > [role=tab] { flex-wrap: wrap; row-gap: 1px; }
.ap-people .ap-nav > [role=tab] .xs { flex-basis: 100%; margin-left: 16px; }          /* the status under the name, so the name keeps its width */

.auth-brand h2 { font-family: var(--font); font-weight: 600; letter-spacing: -.015em; }

/* ================================================================ brand accent: teal #28A99E, faded (Nov 2026)
   The teal is the one brand colour: primary buttons fade from a light teal into it, the active marker and focus use it, its pale tint
   marks a selection. Text in the accent uses a deeper teal so it stays readable on white; surfaces and body text stay black/white. */
:root, html[data-theme="light"] {
  --teal: #28A99E; --evergreen: #28A99E;
  --accent: #1E877E; --accent-hover: #186F67; --accent-ink: #FFFFFF; --accent-soft: #EAF7F5; --accent-line: #BFE6E1;
  --accent-2: #28A99E; --accent-3: #C4A568;
  --grad: linear-gradient(135deg, #3DBCB1 0%, #28A99E 55%, #1F9187 100%);
  --grad-hover: linear-gradient(135deg, #34AFA4 0%, #22978D 55%, #1B8077 100%);
  --glow: 0 2px 10px rgba(40, 169, 158, .28);
  --s1: #28A99E;
}
html[data-theme="dark"] {
  --teal: #4CC3B8; --evergreen: #4CC3B8;
  --accent: #5FCBC0; --accent-hover: #7DD6CD; --accent-ink: #062320; --accent-soft: #11292A; --accent-line: #1E4A47;
  --accent-2: #5FCBC0; --accent-3: #D2B87F;
  --grad: linear-gradient(135deg, #52C6BB 0%, #34B0A5 55%, #26968C 100%);
  --grad-hover: linear-gradient(135deg, #63CFC5 0%, #3DBAAF 55%, #2CA095 100%);
  --s1: #4CC3B8;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --teal: #4CC3B8; --evergreen: #4CC3B8;
    --accent: #5FCBC0; --accent-hover: #7DD6CD; --accent-ink: #062320; --accent-soft: #11292A; --accent-line: #1E4A47;
    --accent-2: #5FCBC0; --accent-3: #D2B87F;
    --grad: linear-gradient(135deg, #52C6BB 0%, #34B0A5 55%, #26968C 100%);
    --grad-hover: linear-gradient(135deg, #63CFC5 0%, #3DBAAF 55%, #2CA095 100%);
    --s1: #4CC3B8;
  }
}
.btn.primary { background: var(--grad); color: #FFFFFF; text-shadow: 0 1px 0 rgba(0, 0, 0, .08); }
html[data-theme="dark"] .btn.primary { color: #062320; text-shadow: none; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .btn.primary { color: #062320; text-shadow: none; } }
.btn.primary:hover:not(:disabled) { background: var(--grad-hover); }
.sidebar { --accent: #1E877E; --accent-soft: #EAF7F5; --accent-line: #BFE6E1; }
html[data-theme="dark"] .sidebar { --accent: #5FCBC0; --accent-soft: #11292A; --accent-line: #1E4A47; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .sidebar { --accent: #5FCBC0; --accent-soft: #11292A; --accent-line: #1E4A47; } }
.side-link[aria-current="page"] { box-shadow: inset 3px 0 0 var(--teal); }
.ap-hero.locked .ap-hero-icon { background: var(--teal); }

/* ================================================================ Approve & release · Release tab (A send in the app, B send offline) */
.rl-wait { margin: 14px 16px 0; }
.rl-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 16px; }
.rl-mode { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); text-decoration: none; transition: border-color .12s, box-shadow .12s; }
.rl-mode:hover { border-color: var(--accent-line); }
.rl-mode.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--accent-soft); }
.rl-mode-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.rl-mode-t { display: block; font-weight: 650; font-size: 15px; }
.rl-mode-s { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.rl-radio { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--border-strong); flex: none; margin-top: 4px; }
.rl-mode.on .rl-radio { border-color: var(--teal); box-shadow: inset 0 0 0 3px var(--surface); background: var(--teal); }
.rl-app { display: grid; grid-template-columns: minmax(170px, .62fr) minmax(0, 1.75fr) minmax(300px, 1.3fr); gap: 14px; padding: 0 16px 16px; align-items: start; }
.rl-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.rl-head .strong { font-size: 13.5px; }
.rl-pad { padding: 12px 14px; } .rl-pad-x { padding: 6px 14px 8px; }
.rl-people { padding: 0; overflow: hidden; }
.rl-person { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13.5px; }
.rl-person:last-child { border-bottom: 0; }
.rl-person:hover { background: var(--hover); }
.rl-person.on { background: var(--accent-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal); }
.rl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; }
.rl-dot.sent { background: var(--teal); }
.rl-sent { color: var(--accent); font-weight: 600; }
.rl-mid { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rl-contact .form-grid { grid-template-columns: 1fr 1fr; }
.rl-who { color: var(--text); }
.rl-reqs { padding: 0; overflow: hidden; }
.rl-table thead th { background: var(--graphite, #202824); color: #fff; }
html[data-theme="dark"] .rl-table thead th { background: #2A2C2F; }
.rl-mail { padding: 0; overflow: hidden; position: sticky; top: 12px; }
.rl-meta { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.rl-meta dt { color: var(--muted); } .rl-meta dd { margin: 0; }
.rl-meta mark, .rl-body mark { background: var(--warn-soft); color: var(--warn); border-radius: 4px; padding: 0 4px; font-weight: 600; }
.rl-body { padding: 14px; font-size: 14px; line-height: 1.6; }
.rl-body p { margin: 0 0 12px; }
.rl-pre { white-space: pre-wrap; }
.rl-folders { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px; display: grid; gap: 4px; }
.rl-folders .eyebrow { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rl-folders .icon { color: var(--accent); vertical-align: -2px; }
.rl-link { display: inline-block; margin-top: 4px; padding: 2px 6px; border: 1px solid var(--accent-line); border-radius: 4px; background: var(--surface); color: var(--accent); font-size: 11.5px; justify-self: start; }
.rl-foot { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.rl-offline { margin: 0 16px 16px; padding: 0; overflow: hidden; }
.rl-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; padding: 14px; border-bottom: 1px solid var(--border); }
.rl-step { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 6px; align-content: start; }
.rl-step p { margin: 0; }
.rl-step-t { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 13.5px; }
.rl-n { width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 600 11px/1 var(--mono); }
.rl-otable thead th { background: var(--graphite, #202824); color: #fff; }
html[data-theme="dark"] .rl-otable thead th { background: #2A2C2F; }
.rl-file { display: inline-block; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.rl-file:hover { border-color: var(--accent-line); color: var(--accent); }
.rl-table td:nth-child(2) { min-width: 180px; }
.rl-table td:nth-child(3) { min-width: 90px; }
.rl-bar .ap-meter { width: 110px; } .rl-bar .ap-meter i { background: var(--teal); }
.rl-check label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.rl-check input { width: 16px; height: 16px; accent-color: var(--teal); }
.rl-progress { display: flex; align-items: center; gap: 14px; margin: 0 16px 16px; padding: 14px 16px; }
.rl-progress .ap-meter { width: 110px; flex: none; }
.rl-progress .ap-meter i { background: var(--teal); }
.normal { font-weight: 400; }
@media (max-width: 1180px) { .rl-app { grid-template-columns: minmax(160px, .8fr) minmax(0, 2fr); } .rl-mail { grid-column: 1 / -1; position: static; } }
@media (max-width: 760px) { .rl-modes, .rl-app { grid-template-columns: 1fr; } .rl-contact .form-grid { grid-template-columns: 1fr; } }

/* ================================================================ headers: a faded teal gradient instead of near-black (Nov 2026)
   The locked-version banner, dark table header rows and section rows fade from teal into a lighter teal; text stays white. */
:root, html[data-theme="light"] { --head-grad: linear-gradient(120deg, #1F9187 0%, #28A99E 55%, #5CC2B8 100%); --head-ink: #FFFFFF; }
html[data-theme="dark"] { --head-grad: linear-gradient(120deg, #165F59 0%, #1E7F76 55%, #2A978D 100%); --head-ink: #F2FBFA; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { --head-grad: linear-gradient(120deg, #165F59 0%, #1E7F76 55%, #2A978D 100%); --head-ink: #F2FBFA; } }
.ap-hero.locked { background: var(--head-grad); color: var(--head-ink); border-color: transparent; box-shadow: 0 6px 18px rgba(40, 169, 158, .22); }
.ap-hero.locked .small, .ap-hero.locked .ap-hero-meta { color: rgba(255, 255, 255, .85); }
.ap-hero.locked .ap-hero-icon { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.ap-hero.locked .ap-hero-btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); color: #fff; }
.rl-table thead th, .rl-otable thead th, html[data-theme="dark"] .rl-table thead th, html[data-theme="dark"] .rl-otable thead th { background: transparent; color: var(--head-ink); }
.rl-table thead tr, .rl-otable thead tr { background: var(--head-grad); }
.lib-section td { background: var(--head-grad); color: var(--head-ink); }
.auth-brand { background: radial-gradient(110% 80% at 85% -10%, rgba(255, 255, 255, .18) 0%, rgba(255, 255, 255, 0) 60%), linear-gradient(160deg, #1F9187 0%, #28A99E 55%, #4DBDB2 100%);
  --on-navy: #FFFFFF; --on-navy-muted: rgba(255, 255, 255, .82); --navy-line: rgba(255, 255, 255, .24); }

/* page background: a very light teal wash (Nov 2026) */
:root, html[data-theme="light"] { --bg: #F5FAF9; --page-grad: linear-gradient(160deg, #EEF8F6 0%, #F6FBFA 38%, #FBFDFD 70%, #F3F9F8 100%); }
html[data-theme="dark"] { --page-grad: linear-gradient(160deg, #0E1515 0%, #0F1111 45%, #0F1312 100%); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { --page-grad: linear-gradient(160deg, #0E1515 0%, #0F1111 45%, #0F1312 100%); } }
body { background: var(--page-grad) fixed; background-color: var(--bg); }
.app, .main, .content { background: transparent; }

/* Library index: the IRL library card */
.lib-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 380px)); gap: 16px; margin-bottom: 22px; }
.lib-card { padding: 18px 20px; display: grid; gap: 8px; align-content: start; }
.lib-card h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.lib-card.soon { background: var(--surface-2); }
.lib-card .btn { justify-self: start; }
/* console: the library set-up and published notes */
.lib-first { display: flex; align-items: center; gap: 18px; padding: 20px 22px; border-radius: 14px; background: var(--head-grad); color: #fff; margin-bottom: 16px; }
.lib-first .eyebrow { font: 600 11px/1 var(--mono); letter-spacing: .1em; opacity: .85; text-transform: uppercase; }
.lib-first h2 { margin: 6px 0 4px; font-size: 18px; color: #fff; }
.lib-first p { margin: 0; opacity: .92; font-size: 13.5px; max-width: 760px; }
.lib-first .btn { margin-left: auto; background: #fff; color: #186F67; border-color: transparent; box-shadow: none; }
.console-empty { border: 1.5px dashed var(--border-strong); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); background: var(--surface-2); }

/* gradients run under the border (no repeated edge strips) and flow gently left to right */
:root, html[data-theme="light"] {
  --grad: linear-gradient(90deg, #30B3A8 0%, #28A99E 50%, #219A90 100%);
  --grad-hover: linear-gradient(90deg, #2AA79C 0%, #229A90 50%, #1C8C83 100%);
  --head-grad: linear-gradient(90deg, #22968C 0%, #28A99E 50%, #4BBCB1 100%);
}
html[data-theme="dark"] {
  --grad: linear-gradient(90deg, #4CC3B8 0%, #3AB5AA 50%, #2EA398 100%);
  --grad-hover: linear-gradient(90deg, #5CCBC0 0%, #45BCB1 50%, #36AB9F 100%);
  --head-grad: linear-gradient(90deg, #175F59 0%, #1D7A72 50%, #26918A 100%);
}
@media (prefers-color-scheme: dark) { html[data-theme="auto"] {
  --grad: linear-gradient(90deg, #4CC3B8 0%, #3AB5AA 50%, #2EA398 100%);
  --grad-hover: linear-gradient(90deg, #5CCBC0 0%, #45BCB1 50%, #36AB9F 100%);
  --head-grad: linear-gradient(90deg, #175F59 0%, #1D7A72 50%, #26918A 100%);
} }
.btn.primary, .ap-hero.locked, .lib-first, .auth-brand, .rl-table thead tr, .rl-otable thead tr, .lib-section td {
  background-origin: border-box; background-clip: border-box; }
.btn.primary { border: 1px solid transparent; box-shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 4px 12px rgba(40, 169, 158, .18); }
.btn.primary:disabled { opacity: .55; box-shadow: none; }
.lib-first .eyebrow { color: rgba(255, 255, 255, .88); opacity: 1; }

/* ================================================================ sidebar: the page's teal wash, a shade deeper and slightly frosted (macOS source list)
   Selection is a soft rounded fill, not a bar; the logo is the graphite PNG from the logo kit. */
.sidebar { background: linear-gradient(180deg, rgba(228, 243, 240, .92) 0%, rgba(236, 246, 244, .9) 55%, rgba(232, 244, 242, .92) 100%);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border-right: 1px solid rgba(31, 145, 135, .14); --hover: rgba(40, 169, 158, .08); --accent-soft: rgba(40, 169, 158, .14); --sidebar-line: rgba(31, 145, 135, .12); }
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, rgba(20, 31, 30, .94) 0%, rgba(17, 25, 24, .94) 100%); border-right-color: rgba(95, 203, 192, .12);
  --hover: rgba(95, 203, 192, .08); --accent-soft: rgba(95, 203, 192, .14); --sidebar-line: rgba(95, 203, 192, .1); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .sidebar { background: linear-gradient(180deg, rgba(20, 31, 30, .94) 0%, rgba(17, 25, 24, .94) 100%); border-right-color: rgba(95, 203, 192, .12);
  --hover: rgba(95, 203, 192, .08); --accent-soft: rgba(95, 203, 192, .14); --sidebar-line: rgba(95, 203, 192, .1); } }
.sidebar .brand img.logo-full { height: 20px; width: auto; }
.side-link { border-radius: 8px; margin: 1px 8px; padding-left: 10px; transition: background .12s ease; }
.side-link[aria-current="page"] { background: var(--accent-soft); box-shadow: none; color: var(--text); font-weight: 600; }
.side-link[aria-current="page"] .tile { color: var(--accent); }
.side-label { letter-spacing: .06em; font-size: 10.5px; }

/* ================================================================ labels: the app's own font, plain case (macOS), never monospaced capitals */
.kpi .k, .section-title, .eyebrow, .side-label, .rl-folders .eyebrow, .vdr-strip .k, .console-head p, .ap-nav-head .strong, .table thead th, .lib-heads th {
  font-family: var(--font); text-transform: none; letter-spacing: 0; }
.kpi .k { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.kpi .v { letter-spacing: -.01em; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--muted); }
.side-label { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.table thead th { font-size: 12px; font-weight: 600; }
.lib-first .eyebrow { color: rgba(255, 255, 255, .9); }
.tab-n, .rl-head .pill.mono, .tabs .mono { font-family: var(--font); font-variant-numeric: tabular-nums; }
.lib-about { margin: 4px 0 12px; }

/* buttons a shade deeper; sidebar a shade lighter (Nov 2026) */
:root, html[data-theme="light"] {
  --grad: linear-gradient(90deg, #26A096 0%, #1F9187 50%, #1A8279 100%);
  --grad-hover: linear-gradient(90deg, #219389 0%, #1B857C 50%, #16766E 100%);
}
.sidebar { background: linear-gradient(180deg, rgba(242, 249, 248, .94) 0%, rgba(246, 251, 250, .93) 55%, rgba(243, 249, 248, .94) 100%); }
/* (clearer) buttons deeper teal, sidebar near-white with a whisper of teal */
:root, html[data-theme="light"] {
  --grad: linear-gradient(90deg, #1E9389 0%, #188379 50%, #13726A 100%);
  --grad-hover: linear-gradient(90deg, #1A857C 0%, #14756D 50%, #10655E 100%);
}
html[data-theme="dark"] { --grad: linear-gradient(90deg, #36A99E 0%, #2A9A90 50%, #218A80 100%); --grad-hover: linear-gradient(90deg, #3DB3A8 0%, #31A397 50%, #279388 100%); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] { --grad: linear-gradient(90deg, #36A99E 0%, #2A9A90 50%, #218A80 100%); --grad-hover: linear-gradient(90deg, #3DB3A8 0%, #31A397 50%, #279388 100%); } }
html[data-theme="dark"] .btn.primary { color: #FFFFFF; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .btn.primary { color: #FFFFFF; } }
.sidebar { background: linear-gradient(180deg, #FAFDFD 0%, #FCFEFE 60%, #F8FCFB 100%); border-right-color: rgba(31, 145, 135, .12); }
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #1C2726 0%, #192322 100%); }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .sidebar { background: linear-gradient(180deg, #1C2726 0%, #192322 100%); } }

/* ================================================================ IRL library: one panel, Numbers-like (Library screens 02-07, 11)
   Toolbar, formula bar, sheet and sheet tabs sit in one card that fills the page to the bottom. Solid header rows; frozen Use and
   Request ID columns; the app's own font throughout. */
.lib-page .content { padding-bottom: 16px; }
.lib-page .lib, .lib-page .lib * { font-family: var(--font); }
.lib-crumb { font-size: 15px; font-weight: 500; color: var(--muted); } .lib-crumb a { color: var(--muted); text-decoration: none; } .lib-crumb a:hover { color: var(--accent); }
.lib-status { margin-left: 8px; font-size: 11.5px; height: 20px; padding: 0 8px; vertical-align: 2px; }
.lib-sub { color: var(--muted); font-size: 12.5px; }
.lib { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.lib-note { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-size: 13px; color: var(--text-2);
  background: var(--accent-soft); border: 1px solid var(--accent-line); }
.lib-note.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.lib-note .icon { flex: none; color: var(--accent); } .lib-note.warn .icon { color: var(--warn); }
.lib-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 8px 24px rgba(17, 17, 17, .05); }
/* toolbar */
.lib-bar { display: flex; align-items: center; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.lib-sheet-name { font-weight: 650; font-size: 14px; }
.lib-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.lib-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lib-legend i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--surface); position: relative; flex: none; }
.lib-legend .lg-lock { background: #F1F3F2; }
.lib-legend .lg-chg::after { content: ""; position: absolute; top: -1px; right: -1px; border-top: 6px solid #E0913F; border-left: 6px solid transparent; }
.lib-legend .lg-add { box-shadow: inset 3px 0 0 #3B6FD8; }
.lib-only { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.lib-only input, .lib-ack input, .lib-use input { accent-color: var(--teal); }
.lib-q { position: relative; display: inline-flex; color: var(--muted); }
.lib-q .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.lib-q .input { width: 230px; height: 30px; padding-left: 30px; border-radius: 8px; background: var(--surface-2); border-color: var(--border); }
/* formula bar */
.lib-fx { display: grid; grid-template-columns: minmax(150px, auto) 1fr auto; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: #FAFCFC; }
.lib-ref { font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 5px 10px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.lib-fx-text { width: 100%; min-height: 32px; max-height: 160px; resize: vertical; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  font: 13.5px/1.45 var(--font); color: var(--text); field-sizing: content; }
.lib-fx-text[readonly] { background: transparent; border-color: transparent; color: var(--text-2); }
.lib-fx-text:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--accent-soft); }
.lib-fx-side { display: flex; align-items: center; gap: 6px; }
.lib-ro { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.lib-fx-err { grid-column: 2 / -1; color: var(--danger); font-size: 12px; font-weight: 500; margin-top: -4px; }
.btn.danger-ghost { color: var(--danger); border-color: var(--danger-line); }
/* the sheet */
.lib-grid-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
.lib-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; color: var(--text); }
.lib-grid th, .lib-grid td { height: 36px; padding: 0 12px; text-align: left; border-bottom: 1px solid #EDF1F0; border-right: 1px solid #F1F4F3; }
.lib-grid thead { position: sticky; top: 0; z-index: 5; }
.lib-letters th { height: 24px; padding: 0; background: #EEF3F2; color: #7C8885; font-size: 11px; font-weight: 600; text-align: center; border-bottom: 1px solid #DDE5E3; border-right: 1px solid #DDE5E3; }
.lib-heads th { height: 38px; background: #F6F9F8; color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-bottom: 1px solid #DDE5E3; border-right: 1px solid #E7ECEB; }
.lib-heads th .icon { color: var(--faint); vertical-align: -1px; margin-left: 2px; }
.lib-grid thead th:nth-child(1), .lib-grid thead th:nth-child(2), .lib-row td:nth-child(1), .lib-row td:nth-child(2) { position: sticky; z-index: 2; }
.lib-grid thead th:nth-child(1), .lib-grid thead th:nth-child(2) { z-index: 6; }
.lib-grid thead th:nth-child(1), .lib-row td:nth-child(1) { left: 0; text-align: center; padding: 0; }
.lib-grid thead th:nth-child(2), .lib-row td:nth-child(2) { left: 52px; box-shadow: 1px 0 0 #DDE5E3; }
.lib-row td { background: var(--surface); }
.lib-row:hover td { background: #F5FAF9; }
.lib-section td { position: sticky; left: 0; z-index: 3; height: 34px; padding: 0; background: var(--head-grad); background-origin: border-box; color: #fff; border: 0; }
.lib-section-in { position: sticky; left: 0; display: inline-flex; align-items: baseline; gap: 10px; padding: 0 14px; font-size: 12.5px; white-space: nowrap; }
.lib-section-in strong { font-weight: 650; letter-spacing: .01em; }
.lib-section-in span { opacity: .88; }
.lib-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: default; position: relative; }
.lib-cell.locked, .lib-row td.lib-cell.locked { color: var(--muted); background: #FAFBFB; }
.lib-row:hover td.lib-cell.locked { background: #F2F7F6; }
.lib-id { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.lib-new { margin-left: 6px; padding: 1px 6px; border-radius: 5px; background: #E8F0FA; color: #3B6FD8; font-size: 10.5px; font-weight: 600; }
.lib-pri { display: inline-block; min-width: 26px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; text-align: center; background: var(--sunken); color: var(--text-2); }
.lib-pri.p0 { background: var(--danger-soft); color: var(--danger); }
.lib-pri.p1 { background: var(--warn-soft); color: var(--warn); }
.lib-cell.edited::after { content: ""; position: absolute; top: 0; right: 0; border-top: 8px solid #E0913F; border-left: 8px solid transparent; }
.lib-cell.err, .lib-row td.lib-cell.err { color: var(--danger); background: var(--danger-soft); }
.lib-cell.sel, .lib-cell:focus { outline: 2px solid var(--teal); outline-offset: -2px; background: #F0FAF8; }
.lib-row.added td:nth-child(2) { box-shadow: inset 3px 0 0 #3B6FD8, 1px 0 0 #DDE5E3; }
.lib-row.added .lib-id { color: #3B6FD8; }
.lib-req { color: var(--danger); font-style: italic; }
.lib-row.off td.lib-cell, .lib-row.off td.lib-cell.locked { color: var(--faint); background: #F7F8F8; }
.lib-v.strike { text-decoration: line-through; }
.lib-use form { display: grid; place-items: center; height: 100%; }
.lib-use input { width: 15px; height: 15px; cursor: pointer; }
.lib-add td { height: 40px; padding: 0; background: var(--surface); border-bottom: 1px solid #EDF1F0; }
.lib-add form { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 12px; padding: 0 14px; }
.lib-add-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 7px; border: 1px dashed var(--accent-line); background: transparent;
  color: var(--accent); font: 600 12.5px var(--font); cursor: pointer; }
.lib-add-btn:hover { background: var(--accent-soft); border-style: solid; }
.lib-add span { color: var(--muted); font-size: 12px; }
.lib-none { color: var(--muted); padding: 0 14px !important; text-align: left !important; }
/* sheet tabs */
.lib-tabs { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-top: 1px solid var(--border); background: #F6F9F8; }
.lib-sheet-use { padding-right: 12px; border-right: 1px solid var(--border); }
.lib-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; white-space: nowrap; color: var(--text-2); }
.lib-switch input { position: absolute; opacity: 0; }
.lib-switch span { width: 30px; height: 18px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.lib-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.lib-switch input:checked + span { background: var(--teal); }
.lib-switch input:checked + span::after { left: 14px; }
.lib-tab-list { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.lib-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.lib-tab:hover { background: #ECF3F2; }
.lib-tab.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(17, 17, 17, .1), 0 0 0 1px rgba(17, 17, 17, .05); }
.lib-tab.off { text-decoration: line-through; opacity: .55; }
.lib-dot { width: 6px; height: 6px; border-radius: 50%; background: #E0913F; }
.lib-ack { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
/* dark mode: the same panel on charcoal */
html[data-theme="dark"] .lib-fx, html[data-theme="dark"] .lib-tabs, html[data-theme="dark"] .lib-heads th { background: #1A1C1E; }
html[data-theme="dark"] .lib-letters th { background: #202326; color: #8A918F; border-color: #2E3134; }
html[data-theme="dark"] .lib-grid th, html[data-theme="dark"] .lib-grid td { border-color: #26292C; }
html[data-theme="dark"] .lib-cell.locked, html[data-theme="dark"] .lib-row.off td.lib-cell { background: #1B1D1F; }
html[data-theme="dark"] .lib-row:hover td { background: #1E2423; }
@media (max-width: 1000px) { .lib-legend { display: none; } .lib-q .input { width: 170px; } }
body.lib-page.fit-screen .content, body.lib-page .content { padding-bottom: 14px; }
.lib-fx-text[readonly] { resize: none; }

/* sidebar stages: the number when open, an icon in the collapsed rail; collapsed, only the mini logo, which turns into the expand icon on hover */
.side-ico, .brand-expand { display: none; }
.side-num { font-family: var(--font); font-variant-numeric: tabular-nums; }
@media (min-width: 861px) {
  html.sb-collapsed .side-no .side-num { display: none; }
  html.sb-collapsed .side-no .side-ico { display: block; }
  html.sb-collapsed .side-no { font-size: 0; }
  html.sb-collapsed .side-collapse { display: none !important; }
  html.sb-collapsed .brand-row { padding: 14px 8px 12px; }
  html.sb-collapsed .sidebar .brand { width: 40px; height: 36px; margin: 0 auto; display: grid; place-items: center; border-radius: 9px; cursor: pointer; position: relative; }
  html.sb-collapsed .sidebar .brand:hover { background: var(--hover); }
  html.sb-collapsed .brand-expand { position: absolute; inset: 0; place-items: center; color: var(--text-2); }
  html.sb-collapsed .sidebar .brand:hover .brand-expand { display: grid; }
  html.sb-collapsed .sidebar .brand:hover .logo-mark { visibility: hidden; }
}
/* sign-in panel: a deep teal, darkening towards the bottom (Nov 2026) */
.auth-brand { background: radial-gradient(120% 80% at 85% -10%, rgba(40, 169, 158, .35) 0%, rgba(40, 169, 158, 0) 60%), linear-gradient(165deg, #0F5E57 0%, #0B4A45 55%, #073531 100%);
  background-origin: border-box; --on-navy: #FFFFFF; --on-navy-muted: rgba(255, 255, 255, .78); --navy-line: rgba(255, 255, 255, .16); }
@media (min-width: 861px) { html.sb-collapsed .user-chip .avatar { display: none; } html.sb-collapsed .user-chip { justify-content: center; } }
/* finished steps in the sidebar read like every other link (the generic .done label style is for small status words, not links) */
.side-link.done { color: var(--text); font-size: inherit; font-weight: inherit; }
.side-link.done .tile { color: var(--accent); }
/* deal steps: their own icons, no counts; a finished step carries a small teal dot (a ring for the step you are on is the selection itself) */
.step-done { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 18%, transparent); margin-left: auto; margin-right: 4px; flex: none; }
.side-link.done .tile { color: var(--text-2); }
@media (min-width: 861px) { html.sb-collapsed .step-done { position: absolute; top: 7px; right: 12px; margin: 0; width: 6px; height: 6px; box-shadow: none; } }
.sidebar .side-link .tile, .sidebar .side-link.done .tile { color: var(--text-2); }
.sidebar .side-link[aria-current="page"] .tile { color: var(--accent); }
.sidebar .side-link.locked .tile { color: var(--faint); }
.side-stage { font-family: var(--font); letter-spacing: 0; text-transform: none; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sidebar { --text-2: #3B3B3B; }
html[data-theme="dark"] .sidebar { --text-2: #D0D0CC; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .sidebar { --text-2: #D0D0CC; } }
/* collapsed rail: the done dot sits on the icon's top-right corner (the right-hand dot is for the open sidebar) */
.tile-done { display: none; }
@media (min-width: 861px) {
  html.sb-collapsed .side-link .tile { position: relative; }
  html.sb-collapsed .step-done { display: none; }
  html.sb-collapsed .tile-done { display: block; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal);
    box-shadow: 0 0 0 2px var(--surface); }
}
/* collapsed rail tooltip: a small dark pill beside the icon (macOS style) */
.side-tip { position: fixed; z-index: 200; transform: translate(-4px, -50%); opacity: 0; pointer-events: none; padding: 5px 10px; border-radius: 7px;
  background: rgba(32, 40, 36, .94); color: #fff; font: 500 12.5px/1.3 var(--font); white-space: nowrap; box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: opacity .12s ease, transform .12s ease; }
.side-tip.on { opacity: 1; transform: translate(0, -50%); }
.side-tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: inherit; transform: translateY(-50%) rotate(45deg); border-radius: 1px; }
html[data-theme="dark"] .side-tip { background: rgba(244, 244, 242, .95); color: #111; }
@media (prefers-color-scheme: dark) { html[data-theme="auto"] .side-tip { background: rgba(244, 244, 242, .95); color: #111; } }
/* the live line under a run's steps: a soft pulse, what it is doing, how long it has been working */
.run-live { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; color: var(--text-2); }
.run-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); flex: none; animation: run-pulse 1.4s ease-in-out infinite; }
@keyframes run-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(40, 169, 158, .45); } 50% { box-shadow: 0 0 0 6px rgba(40, 169, 158, 0); } }

/* IRL library: PART A, B1, B2, C each with its own header row; a section bar collapses its section */
.lib-part .lib-heads th { position: sticky; top: 24px; z-index: 4; }
.lib-part .lib-heads th:nth-child(1) { left: 0; z-index: 5; text-align: center; padding: 0; }
.lib-part .lib-heads th:nth-child(2) { left: 52px; z-index: 5; box-shadow: 1px 0 0 #DDE5E3; }
.lib-section-in { all: unset; box-sizing: border-box; position: sticky; left: 0; display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px;
  font: 500 12.5px var(--font); color: #fff; white-space: nowrap; cursor: pointer; }
.lib-section-in:focus-visible { outline: 2px solid rgba(255, 255, 255, .8); outline-offset: -4px; border-radius: 6px; }
.lib-caret { transition: transform .15s ease; flex: none; opacity: .9; }
.lib-part.collapsed .lib-caret { transform: rotate(-90deg); }
.lib-part.collapsed tr:not(.lib-section) { display: none; }
.lib-part + .lib-part .lib-section td { border-top: 6px solid var(--surface); }
.lib-pad { background: var(--surface); }
html[data-theme="dark"] .lib-part .lib-heads th:nth-child(2) { box-shadow: 1px 0 0 #2E3134; }

.side-stage { padding-left: 2px; }

/* Deal Context Card header: one compact row (title, counts as chips, state as short pills; the full wording opens on click) */
.ctx-head { padding: 10px 16px; }
.ctx-row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.ctx-row1 h2 { margin: 0; font-size: 16px; }
.ctx-chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctx-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctx-chip.more { cursor: pointer; color: var(--accent); background: var(--surface); list-style: none; }
.ctx-chip.more::-webkit-details-marker, .ctx-flag summary::-webkit-details-marker { display: none; }
.ctx-more .menu-panel, .ctx-flag .menu-panel { min-width: 280px; max-width: 420px; white-space: normal; line-height: 1.5; }
.ctx-flags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ctx-flag summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ctx-flag.warn summary { background: var(--warn-soft); color: var(--warn); }
.ctx-flag[open] summary { box-shadow: 0 0 0 2px var(--accent-line); }
.ctx-flag .menu-panel { right: 0; left: auto; }
.ctx-head .ctx-notices { margin-top: 8px; }

/* deal figures: one compact strip; an (i) on each says what the figure is and why it is there */
.stat-strip.compact { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0; margin-bottom: 12px; padding: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(17, 17, 17, .04); overflow: visible; }
.stat-strip.compact .cell { padding: 7px 12px; border-left: 1px solid var(--border); min-width: 0; background: transparent; box-shadow: none; border-radius: 0; }
.stat-strip.compact .cell:first-child { border-left: 0; }
.stat-strip.compact .v { font-size: 15px; font-weight: 650; line-height: 1.25; }
.stat-strip.compact .l { display: flex; align-items: center; gap: 4px; margin-top: 1px; font-size: 11.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.stat-strip.compact .l > span { overflow: hidden; text-overflow: ellipsis; }
.stat-info { position: relative; flex: none; }
.stat-info summary { list-style: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; color: var(--faint); cursor: pointer; }
.stat-info summary::-webkit-details-marker { display: none; }
.stat-info summary:hover, .stat-info[open] summary { color: var(--accent); background: var(--accent-soft); }
.stat-info .menu-panel { position: absolute; top: calc(100% + 6px); left: -8px; z-index: 40; width: 300px; padding: 10px 12px; white-space: normal; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.stat-info.end .menu-panel { left: auto; right: -8px; }
.stat-info .menu-panel p { margin: 6px 0 0; }
@media (max-width: 1100px) { .stat-strip.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stat-strip.compact .cell:nth-child(5) { border-left: 0; }
  .stat-strip.compact .cell:nth-child(n+5) { border-top: 1px solid var(--border); } .stat-info.end .menu-panel { left: -8px; right: auto; }
  .stat-strip.compact .cell:nth-child(4n) .stat-info .menu-panel { left: auto; right: -8px; } }
.stat-strip.compact { grid-template-columns: repeat(8, auto); }
details.menu.stat-info > .menu-panel { left: -8px; right: auto; min-width: 0; }
details.menu.stat-info.end > .menu-panel { left: auto; right: -8px; }
@media (max-width: 1100px) { .stat-strip.compact { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.slow-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
/* the card counts' (i): a wide panel that opens to the right of the icon */
details.menu.ctx-more > .menu-panel { left: -10px; right: auto; width: min(520px, 80vw); max-width: none; min-width: 0; padding: 12px 14px; line-height: 1.55; }
details.menu.ctx-more > .menu-panel .small { font-size: 13px; }
.ctx-more-btn { list-style: none; }
.ctx-more[open] > .info-btn { background: var(--accent-soft); color: var(--accent); }
/* the card's single (i), at the right end of the header row: opens leftwards */
details.menu.ctx-more > .menu-panel { left: auto; right: -6px; }
.ctx-more-sep { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
details.menu.ctx-more > .menu-panel .section-title { margin: 0 0 4px; font-size: 12px; color: var(--muted); }

/* ================================================================ console: compact tables, a slim stages bar, pages of 20 */
.ctable-wrap { overflow: hidden; }
/* the console's pager, under the deals table: "Showing 1–10 of 38" · Previous / Next · rows per page (10 / 20 / 30) */
.console-pager { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; }
.console-pager[hidden] { display: none; }
.console-pager .pager-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.console-pager .pager-size { display: inline-flex; align-items: center; gap: 8px; }
.ctable { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.ctable .c-deal { width: 32%; } .ctable .c-stage { width: 18%; } .ctable .c-wait { width: 12%; } .ctable .c-act { width: 150px; }
.ctable td { overflow: hidden; text-overflow: ellipsis; }
.ctable th { background: var(--head-grad); color: var(--head-ink, #fff); font-weight: 600; font-size: 12px; text-align: left; padding: 8px 14px; white-space: nowrap; }
.ctable td { padding: 9px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.ctable tbody tr:hover { background: var(--surface-2); }
.ctable tr.on-me td:first-child { box-shadow: inset 3px 0 0 var(--brass, #C4A568); }
.ctable .deal-name { font-weight: 600; color: var(--text); text-decoration: none; }
.ctable .deal-name:hover { color: var(--accent); }
.ctable .deal-id { font: 500 11.5px var(--mono); color: var(--muted); }
.ctable .btn { width: 100%; justify-content: center; }          /* every row action the same width: one clean right edge */
.ctable .due { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--warn); }
.stage-tag { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.stage-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.sb-seg { display: flex; align-items: flex-start; gap: 12px; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.sb-seg:hover { border-color: var(--accent-line); box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, .06)); text-decoration: none; }
.sb-seg.on { border-color: var(--accent); background: var(--accent-soft); }
.sb-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.sb-seg.on .sb-ic { background: var(--surface); }
.sb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.sb-hot { font-size: 11.5px; font-weight: 600; color: var(--warn); }
.sb-facts { font-size: 12px; line-height: 1.4; color: var(--muted); min-height: 2.8em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sb-do { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
.sb-do.muted { color: var(--muted); }
.sb-seg:hover .sb-do { text-decoration: underline; }
.sb-n { flex: none; min-width: 46px; height: 30px; padding: 0 10px; border-radius: 999px; display: grid; place-items: center; font-size: 15px; font-weight: 700; background: var(--surface-2); color: var(--text); }
.sb-seg.on .sb-n { background: var(--surface); }
.sb-n.soon { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--sunken); }
.sb-seg.soon { border-style: dashed; background: transparent; }
.sb-seg.soon .sb-ic { background: var(--sunken); color: var(--muted); }
/* one height for every control in the filter row: tabs, stage chip, search */
.console-filters { --ctl: 32px; }
.console-filters .seg-pills :is(button, a), .console-filters .filter-chip, .console-filters .console-search { height: var(--ctl); }
.console-filters .seg-pills :is(button, a) { display: inline-flex; align-items: center; padding: 0 12px; text-decoration: none; }
.console-filters .console-search { width: min(320px, 100%); border-radius: 999px; }
.console-filters .filter-sep { width: 1px; height: 20px; background: var(--border); }      /* between whose deals and the stage */
.console-filters .seg-pills .soon { display: inline-flex; align-items: center; height: var(--ctl); padding: 0 12px; border-radius: 999px;
  border: 1px dashed var(--border); color: var(--faint); font: 500 12px var(--font); white-space: nowrap; cursor: not-allowed; user-select: none; }     /* a stage not built yet */
.console-note { padding: 8px 16px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--border); }
@media (max-width: 860px) { .console-filters .filter-sep { display: none; } .console-filters .push { margin-left: 0; width: 100%; } }
.card-head .console-search { width: min(300px, 100%); height: 32px; border-radius: 999px; margin-left: auto; }      /* the IRL deal list's search */
@media (max-width: 860px) { .card-head:has(.console-search) { flex-wrap: wrap; } .card-head .console-search { width: 100%; }
  .deals-tabs .tabs-head .console-search { order: -1; margin: 10px 0 2px; } }      /* a narrow screen: the search above the tabs */
.console-head p a { color: var(--accent); font-weight: 600; text-decoration: none; }
.pager { display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-top: 1px solid var(--border); }
.pager .pg { min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); text-decoration: none; border: 1px solid transparent; }
.pager a.pg:hover { border-color: var(--border); background: var(--surface-2); }
.pager .pg.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.pager .pg.gap { color: var(--muted); }
@media (max-width: 760px) { .ctable td:nth-child(3), .ctable th:nth-child(3), .ctable col:nth-child(3) { display: none; } .ctable { table-layout: auto; } }

/* the name at the bottom of the sidebar: a button opening Library, Settings and Log out (the menu floats above it; app.js) */
.user-trigger { position: relative; padding: 6px; margin: -6px; width: calc(100% + 12px); border: 0; border-radius: 10px; background: none; color: inherit;
  font: inherit; text-align: left; cursor: pointer; }
.user-trigger:hover, .user-trigger[aria-expanded=true] { background: var(--hover); }
.user-trigger:focus-visible { outline: none; box-shadow: var(--ring); }
.user-trigger .grow { min-width: 0; display: flex; flex-direction: column; }
.user-trigger .user-name, .user-trigger .grow > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger .user-name { line-height: 1.2; }
.user-trigger .chev { color: var(--muted); transform: rotate(180deg); transition: transform .15s ease; flex: none; }
.user-trigger[aria-expanded=true] .chev { transform: none; }
.user-trigger .user-dot { width: 8px; height: 8px; min-width: 0; padding: 0; border-radius: 50%; background: var(--warn); flex: none; }
.user-pop { padding: 6px; gap: 1px; }
.user-pop form { display: contents; }
.user-pop .switch-item { font-size: 13px; font-weight: 500; }
.user-pop .switch-item svg { color: var(--muted); flex: none; }
.user-pop .switch-item[aria-current=page] { color: var(--accent); background: var(--accent-soft); }
.user-pop .switch-item[aria-current=page] svg { color: var(--accent); }
.user-pop button.switch-item { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer; }
.user-pop button.switch-item:hover, .user-pop .switch-item:focus-visible { background: var(--hover); outline: none; }
@media (min-width: 861px) {
  html.sb-collapsed .user-trigger { justify-content: center; margin: 0; width: 100%; }
  html.sb-collapsed .user-trigger .avatar { display: grid; }
  html.sb-collapsed .user-trigger .chev { display: none; }
  html.sb-collapsed .user-trigger .user-dot { position: absolute; top: 3px; right: 6px; }
}

/* the open deal inside its stage: indented under IRL (or VDR) with a guide line, its switcher first, then its steps */
.side-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 25px; padding-left: 10px; border-left: 1px solid var(--sidebar-line); }
.side-sub .side-deal { margin: 2px 0 4px; }
.side-sub .side-link { padding-top: 5px; padding-bottom: 5px; }
.side-sub .side-link .tile { width: 28px; height: 28px; }
@media (min-width: 861px) { html.sb-collapsed .side-sub { margin-left: 0; padding-left: 0; border-left: 0; } }

/* dialogs: the title and the Cancel / Save buttons stay in place, only the fields between them scroll (a long form never pushes the
   buttons off screen); the thresholds form lists its fields one after the other */
dialog.modal { max-height: calc(100vh - 48px); overflow: hidden; }
dialog.modal[open], dialog.modal[open] > #modal-content, dialog.modal[open] > #modal-content > form, dialog.modal[open] > form {
  display: flex; flex-direction: column; min-height: 0; max-height: calc(100vh - 48px); }
dialog.modal .modal-head, dialog.modal .modal-foot { flex: none; }
dialog.modal .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
dialog.modal .modal-foot { border-top: 1px solid var(--border); background: var(--surface); padding-top: 12px; }
.form-grid.one-col { grid-template-columns: 1fr; }

/* Sidebar labels: one line ending in "…"; hovering (or keyboard focus) scrolls the full name across and back.
   container-type gives the label box width as 100cqw, so the run distance is (box - text) and 0 when the text fits. */
.side-label-run { display: block; container-type: inline-size; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-label-run > .run { display: inline; }
@keyframes side-label-run {
  0%, 15% { transform: translateX(0); }
  55%, 70% { transform: translateX(min(0px, calc(100cqw - 100%))); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .side-link:hover .side-label-run, .side-link:focus-visible .side-label-run,
  .side-deal:hover .side-label-run, .side-deal:focus-visible .side-label-run { text-overflow: clip; }
  .side-link:hover .side-label-run > .run, .side-link:focus-visible .side-label-run > .run,
  .side-deal:hover .side-label-run > .run, .side-deal:focus-visible .side-label-run > .run {
    display: inline-block; animation: side-label-run 5s ease-in-out .3s infinite; }
}

/* ==== Deal Context Card split screen (SH-02 to SH-08, mock v2 of 15 Nov) =====================================================================
   The Maker: the card on the left, the Draft IRL on the right, an even split by default; the divider is dragged or moved with the arrow keys (app.js wireResizer);
   the card collapses to a strip beside the draft (app.js wireDccCollapse; the Approver starts collapsed). The Draft IRL pane shows the Draft IRL page itself
   (irl/partials/draft_page.html) under the four counts; the compact list is the fallback when the page cannot be built. Narrow screens stack. */
.ctx-split { display: flex; align-items: stretch; min-height: 0; }
body.fit-screen .ctx-split { flex: 1; min-height: 0; }
.ctx-split > .fit-col { order: 1; flex: 1 1 0; min-width: 0; }
.ctx-split > .pv-resizer { order: 2; }
.ctx-split > .pv-panel { order: 3; flex: 1 1 0; min-width: 280px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* the divider */
.pv-resizer { flex: 0 0 12px; align-self: stretch; cursor: col-resize; position: relative; touch-action: none; outline: none; }
.pv-resizer::before { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; border-radius: 2px; background: transparent; transition: background .12s; }
.pv-resizer:hover::before, .pv-resizer.dragging::before { background: var(--accent-line); }
.pv-resizer:focus-visible::before { background: var(--accent); }
body.pv-resizing { cursor: col-resize; user-select: none; }
/* the Approver (.signoff): the Draft IRL on the left (70%), "Your sign-off" on the right (30%); the card slides over them from the right
   while it is open (not .dcc-collapsed), under the field drawer (z 50) and its scrim (45) */
.ctx-split.signoff > .pv-panel, .ctx-split.signoff.dcc-collapsed > .pv-panel { order: 1; flex: 1 1 0 !important; max-width: none; margin: 0; }
.ctx-split.signoff > .so-panel { order: 2; flex: 0 0 30%; min-width: 300px; margin-left: 12px; }
.ctx-split.signoff > .fit-col { position: fixed; top: 0; right: 0; bottom: 0; z-index: 42; width: min(860px, 94vw); padding: 12px; background: var(--bg);
  box-shadow: var(--shadow-xl); animation: so-in .2s ease-out; }
.ctx-split.signoff.dcc-collapsed > .fit-col, .ctx-split.signoff.dcc-collapsed > .so-scrim { display: none; }
.so-scrim { position: fixed; inset: 0; z-index: 41; background: rgba(10, 12, 16, .28); }
@keyframes so-in { from { transform: translateX(24px); opacity: .6; } }
@media (prefers-reduced-motion: reduce) { .ctx-split.signoff > .fit-col { animation: none; } }

/* Your sign-off: one line per step — tick · what · status and its one button, every button on the same right-hand edge */
.so-panel { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.so-head { padding: 14px 16px 12px; }
.so-head h2 { font-size: 15px; margin: 0 0 2px; }
.so-head p, .so-main p { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.pv-building { display: flex; align-items: center; gap: 12px; margin: 10px 16px; padding: 10px 14px; border-radius: 8px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: 13px; }
.pv-building .strong { color: var(--text); }
.pv-spin { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pv-spin { animation-duration: 2s; } }
.so-step { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 11px 16px; border-top: 1px solid var(--border); }
.so-tick { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; }
.so-step.done .so-tick { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.so-main { min-width: 0; display: grid; gap: 2px; }
.so-title { font-size: 13.5px; font-weight: 600; line-height: 20px; }
.so-status { font-size: 12.5px; font-weight: 600; line-height: 20px; color: var(--accent); white-space: nowrap; }
.so-status.warn { color: var(--warn); }
/* the step's buttons: one row under the text, on the right edge, all the same width */
.so-actions { grid-column: 2 / -1; display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.so-actions > .btn, .so-actions .btn { width: 112px; justify-content: center; }
.so-actions form.inline { display: contents; }
/* the checks: plain rows under the step, the full list (no inner scroll); each: name and count · severity, two lines of why (all of it on
   hover), then its buttons in the same row as every step's: right edge, same width, the primary on the right */
.so-checks { grid-column: 2 / -1; margin-top: 8px; }
.so-checks .dr-flags { display: grid; max-height: none; overflow: visible; }
.so-checks .item-row { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--border); }
.so-checks .item-row .name { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; }
.so-checks .flag-sev { font-size: 12px; font-weight: 500; color: var(--warn); white-space: nowrap; }
.so-checks .item-row .why { margin: 0; font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.so-checks .item-row .do { max-width: none; display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; margin-top: 6px; }
.so-checks .item-row .do .btn { width: 112px; justify-content: center; }
.so-checks .item-row .do form.inline { display: contents; }
.so-checks .fold { border: 0; }
.so-checks .fold > summary { padding: 8px 0; }
.so-checks .item-row.resolved { display: flex; align-items: center; }
.so-checks .item-row.resolved .do { margin: 0 0 0 auto; }
/* every sign-off button fits its label: 112px at least, wider for a long label, wrapping only when the panel is too narrow (a fixed 112px let
   "Keep set-up values and build" run out of its button and past the panel's edge) */
.so-panel .so-actions .btn, .so-panel .so-checks .item-row .do .btn, .so-conflicts .btn { width: auto; min-width: 112px; max-width: 100%; white-space: normal; text-align: center; justify-content: center; line-height: 1.25; height: auto; min-height: 32px; padding-top: 6px; padding-bottom: 6px; }
/* the deal-type conflicts that hold the single-user build: one block under the Draft IRL step, lined up with its title (16 + 18 + 10 = 44px in) */
.so-conflicts { display: grid; padding: 0 16px 12px 44px; }
.so-conflicts .so-conflict { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }          /* like a check: the text full width, its button under it on the right */
.so-conflicts .so-conflict .what { min-width: 0; display: grid; gap: 2px; }
.so-conflicts .so-conflict .name { font-size: 13px; font-weight: 600; line-height: 20px; }
.so-conflicts .so-conflict .why { margin: 0; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.so-conflicts .so-conflict .do { display: flex; justify-content: flex-end; gap: 8px; max-width: none; }          /* the shared .item-row .do caps it at 52%: here it is the full row, the button on the right */
.so-conflicts .so-conflict .do form.inline { display: contents; }
.so-conflicts > .so-actions { grid-column: auto; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--border); }

/* the card panel over the page: one flat surface, one line per item, every button on the right edge at one size */
.ctx-split.signoff > .fit-col { padding: 0; gap: 0; background: var(--surface); }
.ctx-split.signoff > .fit-col > .card, .ctx-split.signoff .rf-section { border: 0; border-radius: 0; box-shadow: none; }
.ctx-split.signoff > .fit-col > .ctx-head { border-bottom: 1px solid var(--border); }
.ctx-split.signoff .ctx-head .ctx-chips, .ctx-split.signoff .ctx-head .ctx-more { display: none; }          /* the counts are on the sign-off */
.ctx-split.signoff .fit-col .btn:not(.icon-only) { height: 28px; min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.ctx-split.signoff .review-flow { padding: 0; gap: 0; }
.ctx-split.signoff .rf-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.ctx-split.signoff .rf-top .rf-progress { flex: 1; height: 4px; background: var(--sunken); }
.ctx-split.signoff .rf-sec-head { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: nowrap; }
.ctx-split.signoff .rf-sec-head h3 { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ctx-split.signoff .rf-n { font-size: 12px; font-weight: 500; color: var(--muted); }
.ctx-split.signoff .rf-bulk { margin-left: auto; }
/* every row in the panel (each review section, Show all, Not applicable) is the one card row, laid out the same: ID · field · class on the first
   line, the value under it, the quote on one muted line (all of it on hover), the buttons on the right edge */
.ctx-split.signoff .ctx-table { min-width: 0; }
.ctx-split.signoff .ctx-th { display: none; }
.ctx-split.signoff .ctx-grid.ctx-row, .ctx-split.signoff .ctx-grid.ctx-row.wq { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto auto; grid-template-areas: "cid field tag act" "cid val val act" "cid src src act";
  column-gap: 12px; row-gap: 2px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ctx-split.signoff .ctx-row > * { grid-row: auto; grid-column: auto; }
.ctx-split.signoff .ctx-row > .cid { grid-area: cid; line-height: 20px; padding: 0; }
.ctx-split.signoff .ctx-row > .cfield { grid-area: field; min-width: 0; }
.ctx-split.signoff .ctx-row > .cfield .nm { font-size: 13.5px; font-weight: 600; line-height: 20px; }
.ctx-split.signoff .ctx-row > .cfield .g { font-size: 12px; margin-top: 0; }
.ctx-split.signoff .ctx-row > span:nth-child(4) { grid-area: tag; line-height: 20px; }
.ctx-split.signoff .ctx-row > span:nth-child(4) .pill { all: unset; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ctx-split.signoff .ctx-row > span:nth-child(5) { display: none; }          /* confidence: in the field's panel */
.ctx-split.signoff .ctx-row > .cval { grid-area: val; min-width: 0; }
.ctx-split.signoff .ctx-row .vt { font-weight: 500; -webkit-line-clamp: 2; }
.ctx-split.signoff .ctx-row .cval .input { width: 100%; }
.ctx-split.signoff .ctx-row > .csrc { grid-area: src; display: block; font-size: 12px; font-style: italic; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-split.signoff .ctx-row > .cact { grid-area: act; display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 6px; }
.ctx-split.signoff .ctx-row > .cact .btn, .ctx-split.signoff .ctx-row > .cact summary.btn { min-width: 76px; justify-content: center; }
.ctx-split.signoff .rf-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: start; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.ctx-split.signoff .rf-items { display: block; }
.ctx-split.signoff .rf-actions { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.ctx-split.signoff .rf-item-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.ctx-split.signoff .rf-done { padding: 14px 16px; border: 0; border-radius: 0; box-shadow: none; }

/* the Maker's card collapsed to a strip on the left */
.dcc-rail { display: none; }
.ctx-split.dcc-collapsed > .fit-col, .ctx-split.dcc-collapsed > .pv-resizer { display: none; }
.ctx-split.dcc-collapsed > .pv-panel { flex: 1 1 auto !important; margin-left: 12px; }
.ctx-split.dcc-collapsed > .dcc-rail { order: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 12px; flex: 0 0 40px; padding: 10px 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text-2); cursor: pointer; font: inherit; }
.ctx-split.dcc-collapsed > .dcc-rail:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.dcc-rail-btn { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.ctx-split.dcc-collapsed > .dcc-rail:hover .dcc-rail-btn { background: var(--accent); color: var(--accent-ink); }
.dcc-rail-label { writing-mode: vertical-rl; font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.dcc-rail .dcc-rail-n { writing-mode: horizontal-tb; }
.dcc-collapse.icon-only { flex: none; width: 30px; padding: 0; justify-content: center; }

/* the card header on one line: the title, the chips (what does not fit goes under "+N ▾"), then the flags, the (i) and collapse.
   The (i) panel spans the header card, so it never slides under the sidebar */
.ctx-split .ctx-head { position: relative; padding: 10px 16px; }
.ctx-split .ctx-row1 { flex-wrap: nowrap; gap: 8px; }
.ctx-split .ctx-row1 > h2 { white-space: nowrap; flex: none; font-size: 15px; line-height: 24px; }
.ctx-split .ctx-row1 .ctx-chips { flex: 0 1 auto; min-width: 0; }
.ctx-split .ctx-row1 > .grow { flex: 1 1 0; min-width: 0; }
.ctx-split .ctx-row1 .ctx-flags { flex: none; flex-wrap: nowrap; }
.ctx-split .ctx-row1 .ctx-flag summary span { white-space: nowrap; }
.ctx-split .ctx-row1 .ctx-chip { height: 22px; font-size: 12px; white-space: nowrap; }
.ctx-split details.menu.ctx-more { position: static; }
.ctx-split details.menu.ctx-more > .menu-panel { left: 12px; right: 12px; width: auto; top: calc(100% - 4px); }
.ctx-chip.round { background: var(--sunken); }
.ctx-chip.round.done { display: inline-flex; align-items: center; gap: 4px; background: var(--ok-soft); color: var(--ok); }
.ctx-chip.round.open { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* the card fits its half: Value, Class and Conf. narrow, no sideways scroll */
.ctx-split .ctx-table, .ctx-split .ctx-table:has(.wq) { min-width: 0; }
body.fit-screen .ctx-split .fill > .tab-panel { overflow-x: hidden; }
.ctx-split .ctx-grid { grid-template-columns: 44px minmax(96px, 1.2fr) minmax(84px, .9fr) 88px 36px 128px; column-gap: 8px; }
.ctx-split .ctx-grid.wq { grid-template-columns: 44px minmax(96px, 1fr) minmax(80px, .8fr) 88px 36px minmax(110px, 1.3fr) 128px; }
.ctx-split .ctx-grid .pill { white-space: normal; text-align: left; line-height: 1.25; max-width: 100%; }
.ctx-split .ctx-grid .cval .input.sm { min-width: 0; width: 100%; }
.ctx-split .ctx-th > span:nth-child(5) { overflow: hidden; text-overflow: clip; }

/* a group title on one line, its explanation behind (i) (Buyer terms, the last group: the panel opens upwards) */
.fold-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fold-line > .fold-name { white-space: nowrap; }
.ctx-sec > summary .pill { flex: none; }
[data-buyer-terms] .info-pop > .menu-panel { top: auto; bottom: calc(100% + 6px); width: min(420px, 60vw); white-space: normal; font-weight: 400; }

/* the Draft IRL pane: its header, the four counts */
.pv-head { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.pv-head h2 { margin: 0; white-space: nowrap; line-height: 24px; }
.pv-head .pill { flex: none; }
.pv-head .pv-meta { line-height: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-align: right; }
.pv-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.pv-stats > div { padding: 8px 14px; border-right: 1px solid var(--border); }
.pv-stats > div:last-child { border-right: 0; }
.pv-n { font-weight: 700; font-size: 17px; line-height: 1.2; }

/* the Draft IRL page in the pane (open or collapsed): header, counts and page as separate cards */
.ctx-split > .pv-panel:has(.pv-draft) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
/* the Draft IRL header: one line like the card's header on the left (title, pill, the counts as chips); the page below it */
.ctx-split > .pv-panel:has(.pv-draft) > .pv-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px;
  padding: 10px 16px; min-height: 0; flex-wrap: nowrap; }
.ctx-split > .pv-panel:has(.pv-draft) > .pv-head .pv-meta { display: none; }
.pv-head .pv-chips { flex: 0 1 auto; min-width: 0; }
.pv-head .pv-chips .ctx-chip { height: 22px; font-size: 12px; white-space: nowrap; }
.ctx-split > .pv-panel:has(.pv-draft) > .pv-head { order: 0; }
.ctx-split > .pv-panel:has(.pv-draft) > .pv-narrow-all { order: 1; flex: none; }
.ctx-split > .pv-panel:has(.pv-draft) .pv-narrow-all { display: none; }          /* the counts are chips in the header */
.ctx-split .pv-draft { order: 2; display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.ctx-split .pv-draft > .fill { flex: 1; height: auto; min-height: 0; }
.ctx-split .pv-draft .dr-table { min-width: 0; }

/* the compact list (fallback): tabs, sections, rows with their reason */
.pv-panel .pv-tabs { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pv-panel .pv-tabs .tabs { padding: 0 14px; border-bottom: 1px solid var(--border); }
.pv-panel .pv-list, .pv-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pv-panel .pv-note { margin: 8px 14px 0; }
.pv-sec { padding: 7px 14px; background: var(--sunken); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font: 600 10.5px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.pv-row { padding: 8px 14px; border-top: 1px solid var(--border); transition: background .12s; }
.pv-row:first-child, .pv-sec + .pv-row { border-top: 0; }
.pv-row .pv-line { display: flex; gap: 8px; align-items: flex-start; }
.pv-row .pv-t { line-height: 1.4; }
.pv-row .cid, .ans-item .cid { font: 500 11.5px var(--mono); color: var(--muted); flex: none; }
.pv-row.pv-cond { opacity: .72; border-left: 2px dashed var(--border); }
.pv-meta-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 5px; }
.pv-why { font-size: 12px; color: var(--info); }
.pv-closed .pv-t { color: var(--muted); text-decoration: line-through; }
.pv-foot { padding: 10px 14px; border-top: 1px solid var(--border); }
.pv-hot { background: var(--accent-soft) !important; box-shadow: inset 2px 0 0 var(--accent); }          /* a card field and the draft rows it drives, together */

/* seller answers as card rows (SH-07) */
.ans-item .text-warn { color: var(--warn); }
.ans-was { text-decoration: line-through; }
.ans-src { border-left: 3px solid var(--accent); padding-left: 8px; margin-bottom: 6px; font-style: italic; }
.ans-src.prev { border-left-color: var(--border); color: var(--muted); }
.ans-slab { font: 500 10px/1.4 var(--mono); letter-spacing: .05em; font-style: normal; color: var(--accent); margin-bottom: 2px; }
.ans-src.prev .ans-slab { color: var(--faint); }

/* requests after release (SH-08): the steps, the form, the proposals */
.req-flow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--sunken); font-size: 12px; }
.req-step { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.req-step.done { color: var(--accent); }
.req-step.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.req-arrow { color: var(--faint); }
.newreq-form { padding-top: 4px; }
.newreq-opts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.newreq-opts .input.sm { width: auto; min-width: 180px; }
.req-item { align-items: flex-start; }
.req-item .req-text { margin: 4px 0 2px; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* C-004: the periods worked out from the call */
.period-sugg { margin-top: 6px; padding: 6px 8px; border: 1px dashed var(--accent-line); border-radius: var(--radius-sm); background: var(--accent-soft); display: grid; gap: 4px; justify-items: start; }



/* rows kept on one line: what does not fit goes under "+N ▾" (app.js data-overflow) */
[data-overflow] { display: flex; flex-wrap: nowrap; overflow-x: clip; overflow-y: visible; min-width: 0; }          /* clipped sideways only: tab underlines and labels stay whole */
[data-overflow] > * { flex: none; }
[data-overflow] > .ovf-hidden { display: none !important; }
.ovf-more { flex: none; align-self: center; }
.ovf-more[hidden] { display: none; }
.ovf-btn { list-style: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px 0 11px; border-radius: 999px; border: 1px solid var(--accent-line);
  background: var(--accent-soft); color: var(--accent); font: 600 12px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.ovf-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ovf-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.ovf-btn:hover .ovf-n { background: var(--accent-ink); color: var(--accent); }
.ovf-chev { flex: none; transition: transform .15s; }
.ovf-more[open] .ovf-chev { transform: rotate(180deg); }
.tabs[data-overflow] + .ovf-more { margin-left: 6px; }          /* in a tab row it sits like the next tab */
.ctx-chips[data-overflow] + .ovf-more .ovf-btn, .pv-chips + .ovf-more .ovf-btn { height: 22px; }
.ovf-btn::-webkit-details-marker { display: none; }
.ovf-more[open] > .ovf-btn { background: var(--accent-soft); border-color: var(--accent-line); }
.ovf-panel { right: 0; left: auto; min-width: 200px; max-height: 50vh; overflow-y: auto; }
.ovf-panel .menu-item { display: block; width: 100%; text-align: left; white-space: nowrap; }
.dr-owners .seg-pills[data-overflow] { flex: 1 1 auto; }
.tabs-head .tabs[data-overflow] { flex: 1 1 auto; }
.ctx-split .pv-head h2 { font-size: 15px; line-height: 24px; }
.pv-panel:not(:has(.pv-draft)) .pv-chips, .pv-panel:not(:has(.pv-draft)) .pv-chips + .ovf-more { display: none; }          /* the fallback shows its own counts strip */
/* the two header cards are one size: 10px + a 28px row + 10px, the same title; the cards below them start level */
.ctx-split .ctx-head, .ctx-split > .pv-panel > .pv-head { padding: 10px 16px; }
.ctx-split .ctx-row1, .ctx-split > .pv-panel > .pv-head { min-height: 28px; align-items: center; }
.ctx-split > .pv-panel > .pv-head { min-height: 50px; box-sizing: border-box; }          /* 10 + 28 + 10 + borders, as the card's header */
.ctx-split .ctx-row1 > h2, .ctx-split .pv-head > h2 { font-size: 15px; font-weight: 700; line-height: 28px; margin: 0; }
.ctx-split .dcc-collapse.icon-only { width: 28px; height: 28px; min-height: 28px; }
.ctx-split .ctx-more .info-btn { width: 28px; height: 28px; }
.req-submit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* SH-09: the build on submission, above the Draft IRL page */
.pv-signoff { order: 0; margin: 0 0 12px; flex: none; }
.ctx-split > .pv-panel:not(:has(.pv-draft)) .pv-signoff { margin: 8px 14px 0; }
details.pv-signoff > summary { cursor: pointer; list-style: none; font-weight: 600; }
details.pv-signoff > summary::-webkit-details-marker { display: none; }
details.pv-signoff[open] > summary { margin-bottom: 6px; }
.pv-built { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* ---- the DD lead's guided review: every item, in sections stacked one under the other, each with its bulk action (irl/partials/review_flow.html) ---- */
.review-flow { display: grid; gap: 12px; padding: 12px 16px; }
.rf-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; border-color: var(--accent-line); background: var(--accent-soft); position: sticky; top: 0; z-index: 3; }
.rf-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rf-progress { flex: 1 1 120px; height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; min-width: 80px; }
.rf-progress > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.rf-section { overflow: hidden; }
.rf-sec-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.rf-step { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 12px/1 var(--font); flex: none; }
.rf-sec-title { flex: 1 1 200px; min-width: 0; }
.rf-sec-title h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.rf-bulk { display: flex; gap: 8px; flex: none; }
.rf-items { display: grid; }
.rf-item { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); transition: background .2s; }
.rf-item:first-child { border-top: 0; }
.rf-item:hover { background: color-mix(in srgb, var(--hover) 50%, transparent); }
.rf-item-line { display: flex; align-items: center; gap: 12px; }
.rf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rf-head h4, .rf-item-line h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.rf-why { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 12.5px; line-height: 1.45; }
.rf-why .icon { flex: none; margin-top: 2px; }
.rf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; }
@media (max-width: 760px) { .rf-grid { grid-template-columns: 1fr; } }
.rf-cell { display: grid; gap: 6px; align-content: start; }
.rf-label { font: 600 10.5px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.rf-value { font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.rf-entry .mic-wrap { display: flex; width: 100%; }
.rf-quote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--accent-line); background: var(--sunken); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; font-style: italic; color: var(--text-2); line-height: 1.5; }
.rf-drives { overflow-wrap: anywhere; }
.rf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rf-actions .btn { min-height: 32px; }
.rf-table { border-top: 0; }
.rf-done { display: flex; align-items: center; gap: 14px; padding: 18px 16px; flex-wrap: wrap; }
.rf-done-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); flex: none; }
details.rf-accepted > summary { cursor: pointer; list-style: none; border-bottom: 0; }
details.rf-accepted > summary::-webkit-details-marker { display: none; }
details.rf-accepted[open] > summary { border-bottom: 1px solid var(--border); }
details.rf-accepted[open] > summary .chev { transform: rotate(90deg); }
/* a curation running in the Draft IRL panel (the steps, live) */
.ctx-split > .pv-panel:has(.pv-run) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
.ctx-split > .pv-panel:has(.pv-run) > .pv-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.pv-run { order: 1; }
.pv-run-note { margin-top: 10px; }

/* ==== the Draft IRL page (card | draft) on an iPad and on a monitor (19 Nov) ====================================================================
   Each pane is a size container: its rows fit the pane's own width, wherever the divider is and whatever the screen.
   iPad (portrait or landscape) and monitor: side by side; a narrow pane restacks its rows (no sideways scroll), a wide one shows the full table.
   Phones (below 700px): one pane at a time; "Draft IRL ›" in the card's header and the "‹ Deal Context Card" bar switch.
   Spacing is tighter throughout: 8px between cards, 8–12px inside them. */
.ctx-split > .fit-col { container: dcc / inline-size; }
.ctx-split > .pv-panel { container: pv / inline-size; }
.ctx-split.dcc-collapsed > .pv-panel { max-width: none !important; }

/* tighter spacing */
body.fit-screen .ctx-split .fit-col { gap: 8px; }
.ctx-split .ctx-head, .ctx-split > .pv-panel > .pv-head { padding: 7px 12px; }
.ctx-split > .pv-panel > .pv-head { min-height: 44px; }
.ctx-split .ctx-row1, .ctx-split > .pv-panel > .pv-head { min-height: 28px; }
.ctx-split > .pv-panel:has(.pv-draft) > .pv-head, .ctx-split > .pv-panel:has(.pv-run) > .pv-head { margin-bottom: 8px; }
.ctx-split .pv-draft { gap: 8px; }
.ctx-split .pv-signoff { margin-bottom: 8px; }
.ctx-split .card-head { padding: 7px 12px; min-height: 40px; gap: 8px; }
.ctx-split .ctx-grid { padding: 7px 12px; column-gap: 8px; }
.ctx-split .ctx-th { padding-top: 6px; padding-bottom: 6px; }
.ctx-split .dr-grid { padding: 7px 12px; column-gap: 10px; }
.ctx-split .ctx-sec > summary { padding-top: 7px; padding-bottom: 7px; }
.ctx-split.dcc-collapsed > .pv-panel { margin-left: 8px; }
.ctx-split > .pv-resizer { flex-basis: 8px; }
.ctx-split > .pv-resizer::before { left: 3px; }
.review-flow { gap: 8px; padding: 8px 10px; }
.rf-top { padding: 8px 12px; gap: 10px; }
.rf-sec-head { padding: 8px 12px; gap: 10px; }
.rf-item { padding: 10px 12px; gap: 8px; }
.rf-grid { gap: 10px; }
.rf-quote { padding: 6px 10px; }
.rf-done { padding: 12px; }
.pv-row { padding: 7px 12px; }
.pv-stats > div { padding: 6px 12px; }

/* the card's pane: narrow (an iPad half, or the divider moved): each field restacks: ID | field · class, then the value, the quote and the actions */
@container dcc (max-width: 640px) {
  .ctx-grid.ctx-th { display: none; }
  .ctx-grid.ctx-row, .ctx-grid.ctx-row.wq { grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 4px; padding: 8px 10px; }
  .ctx-row > .cid { grid-column: 1; grid-row: 1; }
  .ctx-row > .cfield { grid-column: 2; grid-row: 1; }
  .ctx-row > :nth-child(4) { grid-column: 3; grid-row: 1; justify-self: end; }
  .ctx-row > :nth-child(5) { display: none; }          /* Conf. is in the side panel */
  .ctx-row > .cval { grid-column: 2 / -1; grid-row: 2; }
  .ctx-row > .csrc { grid-column: 2 / -1; grid-row: 3; }
  .ctx-row > .cact { grid-column: 2 / -1; grid-row: 4; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .ctx-row .cact .btn { width: auto; }
  .rf-grid { grid-template-columns: 1fr; }
  .rf-sec-head { gap: 8px; }
  .rf-bulk { flex-wrap: wrap; }
}
@container dcc (max-width: 460px) {
  .ctx-grid.ctx-row, .ctx-grid.ctx-row.wq { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 7px 8px; }
  .review-flow { padding: 6px; }
  .rf-item, .rf-sec-head { padding-left: 10px; padding-right: 10px; }
}

/* the draft's pane: narrow, each request restacks (ID | wording, then class · priority · folder); the column header and the Lines count are left out */
@container pv (max-width: 860px) {
  .pv-draft .dr-table { min-width: 0; }
  .pv-draft .dr-head { flex-wrap: nowrap; }
  .pv-draft .dr-head-side { flex: none; gap: 8px; }
  .pv-draft .dr-head-side > .xs { display: none; }
  .pv-draft .dr-grid.ctx-th { display: none; }
  .pv-draft .dr-grid.dr-row { grid-template-columns: 64px auto auto minmax(0, 1fr); column-gap: 8px; row-gap: 5px; }
  .pv-draft .dr-row > .rid { grid-column: 1; grid-row: 1 / span 2; }
  .pv-draft .dr-row > .rq { grid-column: 2 / -1; grid-row: 1; }
  .pv-draft .dr-row > .num { display: none; }
  .pv-draft .dr-row > :nth-child(4) { grid-column: 2; grid-row: 2; }
  .pv-draft .dr-row > :nth-child(5) { grid-column: 3; grid-row: 2; }
  .pv-draft .dr-row > .fo { grid-column: 4; grid-row: 2; align-self: center; font-size: 11.5px; color: var(--muted); }
  .pv-draft .dr-flags .item-row { flex-wrap: wrap; }
}
@container pv (max-width: 440px) {
  .pv-draft .dr-grid.dr-row { grid-template-columns: 52px auto minmax(0, 1fr); }
  .pv-draft .dr-row > .fo { grid-column: 2 / -1; grid-row: 3; }
}

/* the switch in the card's header: an icon on a monitor, "Draft IRL ›" when one pane shows at a time */
.dcc-collapse-label, .dcc-collapse .ic-tab { display: none; }

/* phones: one pane at a time (iPads and monitors keep the two side by side) */
@media (max-width: 699px) {
  .ctx-split { flex-direction: column; gap: 8px; }
  .ctx-split > .pv-resizer { display: none; }
  .ctx-split:not(.dcc-collapsed) > .pv-panel { display: none; }
  .ctx-split > .pv-panel, .ctx-split.dcc-collapsed > .pv-panel { flex: 1 1 auto !important; max-width: none !important; min-width: 0; margin-left: 0; }
  .ctx-split.dcc-collapsed > .dcc-rail { flex-direction: row; flex: none; align-items: center; gap: 10px; padding: 7px 12px; }
  .ctx-split.dcc-collapsed > .dcc-rail .dcc-rail-label { writing-mode: horizontal-tb; }
  .ctx-split.dcc-collapsed > .dcc-rail .dcc-rail-btn .icon { transform: rotate(180deg); }          /* back to the card */
  .ctx-split .dcc-collapse.icon-only { width: auto; padding: 0 8px 0 10px; gap: 4px; }
  .ctx-split .dcc-collapse .ic-desk { display: none; }
  .ctx-split .dcc-collapse-label, .ctx-split .dcc-collapse .ic-tab { display: inline-flex; }
}
/* touch: a wider divider to grab, the line stays thin */
@media (pointer: coarse) {
  .ctx-split > .pv-resizer { flex-basis: 18px; }
  .ctx-split > .pv-resizer::before { left: 8px; }
  .ctx-split .cact .btn.sm, .rf-actions .btn { min-height: 32px; }
}

/* ---- the Maker's submit dialog: the seller questions to add, ticked; two ways on (irl/partials/submit_check.html) ---- */
dialog.modal:has(.sc) { width: min(620px, calc(100vw - 32px)); }
.sc { display: flex; flex-direction: column; max-height: calc(100vh - 48px); padding: 22px 22px 18px; gap: 12px; }
.sc-head h2 { font-size: 19px; font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
.sc-head p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.sc-bar { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.sc-link { border: 0; background: none; padding: 0; font: 600 12.5px var(--font); color: var(--accent); cursor: pointer; }
.sc-link:hover { text-decoration: underline; }
.sc-list { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 0 1 auto;
  max-height: min(330px, calc(100vh - 330px)); }          /* about five items; more scroll inside the list, the dialog keeps its size */
.sc-item { display: grid; grid-template-columns: 20px 74px minmax(0, 1fr); gap: 0 12px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--border); cursor: pointer; }
.sc-item:first-child { border-top: 0; }
.sc-item:hover { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.sc-item input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.sc-item .cid { font: 500 12px var(--mono); color: var(--muted); padding-top: 2px; }
.sc-what { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sc-name { font-size: 14px; font-weight: 650; line-height: 1.35; }
.sc-why { font-size: 12.5px; color: var(--muted); }
.sc-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.sc-note strong { color: var(--text); }
.sc-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.sc-back { border: 0; background: none; padding: 0; font: 600 13.5px var(--font); color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sc-back:hover { color: var(--text); }
.sc-foot .btn { min-height: 40px; padding-left: 16px; padding-right: 16px; font-size: 14px; }
@media (max-width: 560px) { .sc-foot .grow { display: none; } .sc-foot .btn { flex: 1 1 100%; justify-content: center; } }
.sc-flash { animation: sc-flash 1.8s ease; }
@keyframes sc-flash { 0%, 40% { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); } 100% { box-shadow: none; } }

/* ---- iPad and touch tablets: the sidebar is a menu, closed by default. The menu button opens it over the page; choosing anything closes it
   (app.js DRAWER). The page gets the full width, so the Draft IRL split has room side by side. ---- */
@media (max-width: 860px), (hover: none) and (pointer: coarse) and (max-width: 1400px) {
  :root, html.sb-collapsed { --sidebar-w: 0px; }
  .main { margin-left: 0; }
  .sidebar { z-index: 60; width: 280px; transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-xl); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(18, 22, 20, .32); }
  .menu-toggle { display: inline-flex !important; flex: none; }
  .side-collapse { display: none; }
  .actionbar { left: 12px; right: 12px; }
  .toasts, .toasts[popover] { left: 50%; }
  .topbar { padding-left: 12px; padding-right: 12px; }
  .content { padding-left: 12px; padding-right: 12px; }
}

/* Release · B: "Mark sent" / "Sent" buttons (a toggle: a second click undoes it) */
.sent-btn { min-width: 104px; justify-content: center; }
.sent-btn .on { display: none; align-items: center; gap: 6px; }
.sent-btn[aria-pressed="true"] { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); font-weight: 600; }
.sent-btn[aria-pressed="true"] .on { display: inline-flex; }
.sent-btn[aria-pressed="true"] .off { display: none; }
.sent-btn[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--ok-soft) 70%, var(--ok-line)); }
.sent-static { display: inline-flex; align-items: center; gap: 6px; }

/* Settings: a pop-up from the menu under your name (sections left, the open one right), and the same body on /settings/ */
dialog.settings-modal { width: min(760px, calc(100vw - 32px)); height: min(520px, calc(100vh - 64px)); position: relative; overflow: hidden; }
.settings-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.settings { display: grid; grid-template-columns: 200px 1fr; height: 100%; min-height: 360px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 18px 10px; background: var(--surface-2); border-right: 1px solid var(--border); }
.settings-title { padding: 2px 10px 12px; font-size: 15px; font-weight: 700; }
.settings-nav [role=tab] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.settings-nav [role=tab]:hover { background: var(--sunken); color: var(--text); }
.settings-nav [role=tab][aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.settings-main { padding: 22px 28px; overflow: auto; }
.settings-main h2 { font-size: 16px; margin: 4px 0 18px; }
.settings-me { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.settings-rows { display: grid; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.settings-row:last-child { border-bottom: 0; }
.settings-row .k { color: var(--muted); }
.settings-card { max-width: 760px; overflow: hidden; padding: 0; }
@media (max-width: 640px) { .settings { grid-template-columns: 1fr; } .settings-nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); } .settings-title { width: 100%; } }
.settings-note { margin: 14px 0 12px; }

/* ---- Administration (People, Email): the firm Admin's pages ---- */
.adm-tabs { margin: -4px 0 18px; border-bottom: 1px solid var(--border); }
.adm-tabs [role=tab] { text-decoration: none; }
.adm-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.adm-support { margin-top: 22px; display: flex; align-items: center; gap: 6px; }
.adm-support a { color: inherit; }
.adm-banner { margin-bottom: 16px; align-items: center; }
.adm-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--sunken); color: var(--muted); }
.adm-ico.ok { background: var(--ok-soft); color: var(--ok); }
.adm-ico.warn { background: var(--warn-soft); color: var(--warn); }
.adm-link { display: flex; gap: 14px; padding: 18px 20px; margin-bottom: 16px; border-color: var(--ok-line); }
.adm-link-row { display: flex; gap: 8px; margin-top: 12px; }
.adm-link-row .input { font-size: 12px; }
.adm-table td { vertical-align: middle; }
.adm-table tr.off td { color: var(--muted); }
.adm-table tr.off .strong { color: var(--text-2); }
.adm-person { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12.5px; }
.adm-table tr.off .avatar { background: var(--sunken); color: var(--muted); box-shadow: none; }
.adm-role { font-size: 13px; padding-left: 2px; }
.adm-select { min-width: 150px; }
.adm-menu { position: relative; display: inline-block; }
.adm-menu > summary { list-style: none; }
.adm-menu > summary::-webkit-details-marker { display: none; }
.adm-menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 236px; padding: 5px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.adm-roles { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adm-roles legend { margin-bottom: 8px; }
.adm-role-card, .adm-kind { position: relative; display: flex; gap: 11px; align-items: flex-start; padding: 12px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.adm-role-card:hover, .adm-kind:hover { border-color: var(--accent-line); }
.adm-role-card > span, .adm-kind > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.adm-role-card input, .adm-kind input { margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.adm-role-card:has(input:checked), .adm-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--ring); }
.adm-dialog { width: min(600px, calc(100vw - 32px)); }

.adm-status { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 16px; }
.adm-status-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.adm-status .txt { color: var(--text); }
.adm-test { display: flex; align-items: center; gap: 5px; margin-top: 6px; }
.adm-step { display: flex; gap: 16px; padding: 22px 22px 6px; }
.adm-step + .adm-step { border-top: 1px solid var(--border); padding-top: 22px; margin-top: 16px; }
.adm-step:last-of-type { padding-bottom: 22px; }
.adm-step h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.adm-step .stack > h2 { margin-bottom: 0; }
.adm-step-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.adm-step > .grow { min-width: 0; }
.adm-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.adm-kind { flex-direction: column; gap: 10px; padding: 14px; }
.adm-kind input { position: absolute; top: 12px; right: 12px; margin: 0; }
.adm-kind-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); font-weight: 700; }
.adm-kind-logo.k-microsoft365 { grid-template-columns: 9px 9px; grid-template-rows: 9px 9px; gap: 2px; place-content: center; }
.adm-kind-logo.k-microsoft365 i { display: block; width: 9px; height: 9px; }
.adm-kind-logo.k-microsoft365 i:nth-child(1) { background: #F25022; } .adm-kind-logo.k-microsoft365 i:nth-child(2) { background: #7FBA00; }
.adm-kind-logo.k-microsoft365 i:nth-child(3) { background: #00A4EF; } .adm-kind-logo.k-microsoft365 i:nth-child(4) { background: #FFB900; }
.adm-kind-builtin { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 16px; }
.adm-kind-builtin input { top: 50%; transform: translateY(-50%); right: 16px; }
.adm-kind-builtin > span:last-child { padding-right: 28px; }
.adm-kind-builtin .pill { height: 19px; font-size: 11px; margin-left: 6px; vertical-align: 1px; }
.adm-kind-builtin.off { opacity: .55; cursor: not-allowed; }
.adm-kind-logo.k-builtin { background: var(--grad); color: #fff; }
.adm-kinds-or { grid-column: 1 / -1; margin: 6px 0 -2px; font-weight: 600; letter-spacing: .02em; }
.adm-kind-logo.k-google { font: 700 17px/1 var(--font); color: #4285F4; }
.adm-setup .form-grid { max-width: 720px; }
.adm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; align-self: end; min-height: 36px; }
.adm-check input { accent-color: var(--accent); }
.adm-help { display: flex; gap: 9px; align-items: flex-start; max-width: 720px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.adm-help svg { flex: none; margin-top: 2px; color: var(--info); }
.adm-help a { color: var(--accent); }
.adm-more { max-width: 720px; }
.adm-more > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 500; color: var(--text-2); }
.adm-more > summary::-webkit-details-marker { display: none; }
.adm-more > summary:hover { color: var(--text); }
.adm-more > summary .chev { transition: transform .15s; }
.adm-more[open] > summary .chev { transform: rotate(90deg); }
.adm-more > :not(summary) { margin-top: 14px; }
.adm-foot { padding: 14px 22px; border-radius: 0 0 var(--radius) var(--radius); }
.adm-foot-go { display: flex; align-items: center; gap: 14px; margin-left: auto; }
@media (max-width: 980px) { .adm-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .adm-roles, .adm-setup .form-grid { grid-template-columns: 1fr; }
  .adm-step { padding-left: 16px; padding-right: 16px; }
  .adm-step-n { display: none; }
  .adm-status { flex-wrap: wrap; }
  .adm-foot { flex-wrap: wrap; }
  .adm-foot-go { flex-direction: column-reverse; align-items: stretch; width: 100%; }
}

.ctable tr[data-row-href] { cursor: pointer; }
.ctable tr[data-row-href]:hover td { background: var(--surface-2); }
.dr-flags.rechecking .flag-row { opacity: .55; }
.dr-flags .rechecking-note { padding: 2px 0 6px; }

/* The draft IRL could not be built (held or failed): one centred card in place of the Preview and the sign-off; the bottom bar has nothing to act on */
.build-stopped { max-width: 560px; margin: 48px auto; }
.bs-details { max-width: 440px; margin: 0 auto; text-align: left; }
.bs-details > summary { cursor: pointer; list-style: none; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px; }
.bs-details > summary::-webkit-details-marker { display: none; }
.bs-details[open] .bs-chev { display: inline-block; transform: rotate(180deg); }
.bs-actions { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.bs-reason { display: grid; gap: 6px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
body:has(.build-stopped) .actionbar { display: none; }
