/* CGM Industrial — Comprador digital
   Corporate application design system (2-nov-2026, owner's direction): navy / blue / grey / white / black.
   An operating program, not a brochure: a fixed command bar, a menu, white panels on a light grey canvas,
   one accent blue for what can be acted on, and colour for state only (always with its word).
   Typefaces are the ones installed on the corporate PCs (Segoe UI / Windows) with system fallbacks —
   nothing is downloaded (CSP 'self'). Every colour, size and space comes from the tokens below. */

:root {
  /* palette: the platform's neutral identity; a company's own colour (its BRANDING document: configuration,
     never code) replaces --blue / --blue-dark / --blue-tint / --navy at sign-in (app.js applyBrand) */
  --navy: #1f2838;           /* strong titles */
  --navy-2: #2a3446;         /* second tone */
  --blue: #2f3b52;           /* actions, links, selection (the company's primary colour once signed in) */
  --blue-dark: #252f42;      /* hover of actions */
  --blue-tint: #eceef3;      /* selected rows / menu, quiet fills */
  --mark: #8a8c8e;           /* rules and marks only, never text (3.4:1) */
  --canvas: #f2f4f7;         /* page */
  --paper: #ffffff;          /* panels, tables, forms, dialogs */
  --tint: #f5f7fa;           /* hover, table headers */
  --ink: #0f1b2d;            /* titles, strong figures */
  --graphite: #1f2933;       /* running text */
  --muted: #5b6573;          /* secondary text (5.9:1 on white) */
  --stone: #98a2b3;          /* control borders only, never text */
  --hair: #e3e7ed;           /* hairlines */
  --rule: #cfd6df;           /* panel borders */
  /* semantic (each with its word; ≥ 4.8:1 on its tint) */
  --crit: #b42318; --crit-tint: #fdecea;
  --warn: #9a5b00; --warn-tint: #fff4e0;
  --ok: #0e7a4f; --ok-tint: #e7f6ee;
  --sim: #5a4fb3; --sim-tint: #efedfb;
  /* legacy names used across the screens */
  --ivory: var(--canvas); --champagne: var(--blue);
  /* type */
  --sans: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* editorial, classic, high-end: Cambria / Garamond for the text and the titles (the owner, 2-nov-2026) */
  --serif: Cambria, "Cambria Math", Garamond, "EB Garamond", Georgia, "Times New Roman", serif;
  --display: var(--serif);
  --text: var(--serif);
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
  --fs-caps: 11px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 16px;
  --fs-h3: 16px; --fs-h2: 19px; --fs-h1: 26px; --fs-figure: 30px;
  /* space and shape */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --gutter: 32px; --nav: 232px;
  --radius: 6px; --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 1px rgba(15, 27, 45, .04);
  --focus: 2px solid var(--blue);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--graphite);
  font: var(--fs-base)/1.55 var(--text); font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--blue); color: #fff; padding: 6px 12px; z-index: 20; }
.skip:focus { left: 12px; }

/* ------------------------------------------------------------ command bar (the program, its agent and the user) */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s5);
  padding: 8px var(--gutter) 8px 20px; background: var(--paper); color: var(--ink);
  border-bottom: 3px solid var(--blue); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo { display: block; height: 47px; width: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 2px; padding-left: 14px; border-left: 1px solid var(--mark); }
.brand-house { font: 600 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.brand-name { font: 700 19px/1.15 var(--display); color: var(--navy); }
.agent-state { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; padding: 3px 10px; border-radius: 999px;
  background: var(--blue-tint); color: var(--navy); font: 600 11.5px/1.4 var(--sans); }
.agent-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.agent-state.attn::before { background: #c27803; }
.top .who { display: flex; gap: var(--s4); align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.top .who .actor { color: var(--ink); font-weight: 600; }
.top .who .role { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--navy);
  padding: 2px 8px; border: 1px solid var(--rule); border-radius: 999px; }
.top .who a, .top .who button.link { color: var(--blue); }
.top .who .company-pick { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); min-height: 30px; }
.top .who .company-pick option { color: var(--ink); }

/* status strip: mode, SAP read, cycle, worker, health, gates */
.status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  padding: 8px var(--gutter) 8px 20px; background: var(--paper); border-bottom: 1px solid var(--rule);
  font-size: var(--fs-sm); color: var(--muted);
}
.status:empty { display: none; }
.status .seg { white-space: nowrap; padding: 3px 10px; border: 1px solid var(--hair); border-radius: 999px; background: var(--tint); }
.status .k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; margin-right: 6px; color: var(--muted); font-weight: 600; }
.status .v { color: var(--graphite); }
.status .v.strong { color: var(--navy); font-weight: 700; }
.status .prov { flex-basis: 100%; font-size: 12px; }
.status .prov span:not(.k) + span::before { content: "·"; margin: 0 8px; color: var(--stone); }

/* ------------------------------------------------------------ frame */
.layout { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); min-height: calc(100vh - 100px); }
.nav { background: var(--paper); border-right: 1px solid var(--rule); padding: 16px 10px 40px; }
.nav[hidden] { display: none; }
.layout:has(> .nav[hidden]), .signed-out .layout { grid-template-columns: minmax(0, 1fr); }  /* sign-in: no menu column */
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 1px 0; color: var(--graphite);
  text-decoration: none; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
}
.nav a::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--stone); flex: none; }
.nav a:hover { background: var(--tint); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--blue-tint); color: var(--blue-dark); font-weight: 700; }
.nav a.on::before { background: var(--blue); }
.main { padding: 26px var(--gutter) 64px; min-width: 0; }
.main:focus { outline: none; }

/* ------------------------------------------------------------ type */
.page-head { margin: 0 0 var(--s5); max-width: 110ch; }
.eyebrow { margin: 0 0 4px; font: 700 var(--fs-caps)/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
h1 { font: 700 var(--fs-h1)/1.2 var(--display); color: var(--ink); margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font: 700 var(--fs-h2)/1.3 var(--display); color: var(--ink); margin: 32px 0 12px; }
h3 { font: 700 var(--fs-h3)/1.3 var(--display); color: var(--ink); margin: 16px 0 8px; }
.sub, .lede { color: var(--muted); font-size: var(--fs-md); margin: 0 0 var(--s4); max-width: 100ch; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.caps { font-size: var(--fs-caps); letter-spacing: .1em; text-transform: uppercase; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.nowrap { white-space: nowrap; }
.unit { font-size: 11.5px; color: var(--muted); }
.id { font: 11.5px/1.4 var(--mono); color: var(--muted); }
.loading { font: 600 15px/1.4 var(--sans); color: var(--muted); margin-top: 40px; }
.loading::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; vertical-align: -1px;
  border: 2px solid var(--blue-tint); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unknown { color: var(--sim); font-weight: 700; font-size: 12px; letter-spacing: .02em; }

/* ------------------------------------------------------------ status pills (the word always says what the colour means) */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--rule);
  font: 600 11.5px/1.5 var(--sans); color: var(--graphite); background: var(--tint); white-space: nowrap; vertical-align: baseline;
}
.b-P0_CRITICAL, .b-crit { color: var(--crit); background: var(--crit-tint); border-color: #f5c2bd; }
.b-P1_URGENT, .b-warn { color: var(--warn); background: var(--warn-tint); border-color: #f3d29b; }
.b-P2_PLANNED { color: var(--blue-dark); background: var(--blue-tint); border-color: #c4d6f2; }
.b-P3_ROUTINE { color: var(--muted); background: var(--tint); border-color: var(--hair); }
.b-DATA_INSUFFICIENT, .b-sim { color: var(--sim); background: var(--sim-tint); border-color: #d3cef3; }
.b-ok { color: var(--ok); background: var(--ok-tint); border-color: #b5e2c9; }
.b-neutral { color: var(--graphite); background: var(--tint); border-color: var(--hair); }
.b-gate { color: var(--warn); background: var(--warn-tint); border-color: #f3d29b; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.b-DETECTED { color: var(--blue-dark); background: var(--blue-tint); border-color: #c4d6f2; }
.b-REQUESTED { color: var(--graphite); background: var(--tint); border-color: var(--rule); }
.b-BOTH { color: var(--blue-dark); background: #d9e6f8; border-color: #9fbbe6; }

/* ------------------------------------------------------------ notices */
.notice { margin: 0 0 var(--s4); padding: 10px 14px; border: 1px solid #c4d6f2; border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm); background: var(--blue-tint); font-size: 13px; color: var(--graphite); max-width: 130ch; }
.notice.sim { border-color: #d3cef3; border-left-color: var(--sim); background: var(--sim-tint); }
.notice.sim::before { content: "Datos"; display: block; margin-bottom: 3px; font: 700 10.5px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--sim); }
.notice.ok { border-color: #b5e2c9; border-left-color: var(--ok); background: var(--ok-tint); }
.notice.err { border-color: #f5c2bd; border-left-color: var(--crit); background: var(--crit-tint); }
.notice.warn { border-color: #f3d29b; border-left-color: var(--warn); background: var(--warn-tint); }

/* ------------------------------------------------------------ tables */
.tablewrap { overflow: auto; max-height: 72vh; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 var(--s4); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums lining-nums; background: var(--paper); }
th {
  position: sticky; top: 0; z-index: 1; background: var(--tint); text-align: left; vertical-align: bottom;
  padding: 9px 12px; border-bottom: 1px solid var(--rule);
  font: 700 10.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
td { padding: 9px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--graphite); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfd; }
th.num, td.num { text-align: right; }
td.num { white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td, tr.click:focus-visible td { background: var(--blue-tint); }
tr.click:focus-visible { outline: var(--focus); outline-offset: -2px; }
td b { color: var(--ink); }
td button { padding: 4px 10px; font-size: 12px; margin: 0 4px 4px 0; }
.tablewrap td:last-child { min-width: 220px; }  /* the explanation column: lines, not a tower of words */

/* ------------------------------------------------------------ controls */
input, select, textarea {
  font: 13.5px/1.4 var(--sans); color: var(--graphite); background: var(--paper);
  border: 1px solid var(--stone); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 34px;
}
input:hover, select:hover, textarea:hover { border-color: #7c8798; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 95, 191, .18); }
textarea { width: 100%; min-height: 72px; resize: vertical; }
.wide { width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; max-width: 720px; }
.field-name { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.state-error { max-width: 720px; margin-top: var(--s5); }
.state-error .notice { margin-bottom: var(--s3); }
.row-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
button {
  font: 600 13px/1.2 var(--sans); cursor: pointer; border-radius: var(--radius-sm);
  padding: 8px 16px; border: 1px solid var(--blue); background: var(--blue); color: #fff;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
button.secondary { background: var(--paper); color: var(--blue-dark); border-color: var(--rule); }
button.secondary:hover { background: var(--blue-tint); border-color: #c4d6f2; }
button.danger { background: var(--paper); color: var(--crit); border-color: #f5c2bd; }
button.danger:hover { background: var(--crit-tint); }
button:disabled, button:disabled:hover { background: var(--tint); color: var(--muted); border: 1px dashed var(--stone); cursor: not-allowed; font-weight: 500; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; }
button.link:hover { color: var(--blue-dark); text-decoration: underline; background: none; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 4px 0 var(--s4); padding: 14px 16px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters label { display: flex; flex-direction: column; gap: 4px; font: 700 10.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.filters label input, .filters label select { text-transform: none; letter-spacing: normal; font-weight: 400; }
.pager { font-size: var(--fs-sm); color: var(--muted); margin: 0 0 var(--s3); }
.pager a { margin-left: 12px; font-weight: 600; }
.more { font-size: var(--fs-sm); font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 var(--s5); padding: 4px; background: #e6eaf0; border-radius: var(--radius); width: fit-content; max-width: 100%; }
.tabs a { padding: 7px 14px; color: var(--muted); text-decoration: none; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; }
.tabs a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); text-decoration: none; }
.tabs a.on { color: var(--blue-dark); background: var(--paper); box-shadow: var(--shadow); }

/* ------------------------------------------------------------ definition lists */
.kv { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr); margin: 0; font-size: 13.5px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.kv dt, .kv dd { padding: 8px 14px; border-bottom: 1px solid var(--hair); margin: 0; }
.kv dt { font: 700 10.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 10px; background: var(--tint); }
.kv dd { color: var(--graphite); }

/* ------------------------------------------------------------ panels */
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px 12px; margin: 0 0 var(--s4); }
.card h2 { margin-top: 0; }
.card h3 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .count { font: 700 26px/1 var(--sans); color: var(--navy); font-variant-numeric: tabular-nums lining-nums; }
.card ul { list-style: none; margin: 8px 0 0; padding: 0; }
.card li { padding: 7px 0; border-top: 1px solid var(--hair); font-size: 13px; }
.card .more { display: inline-block; margin-top: 8px; }
.card .tablewrap { box-shadow: none; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.actions .off-head { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--hair); }
.action.off { gap: 10px; }
.action.off button { padding: 4px 10px; font-size: 12px; }
.off-group { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair); }
.off-group > .action { margin-top: 10px; }
.off-group > summary { cursor: pointer; font: 700 10.5px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.off-group[open] > summary { margin-bottom: 4px; }
/* the approval decision: the exact conditions before the buttons */
.decision { background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--navy); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 18px 14px; margin: 0 0 var(--s5); }
.decision h3 { margin: 4px 0 10px; font-size: 20px; font-variant-numeric: tabular-nums lining-nums; }
.decision .tablewrap { margin-top: 10px; box-shadow: none; }
.action { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.action .why { color: var(--muted); font-size: 12px; max-width: 52ch; }
.form { background: var(--tint); border: 1px solid var(--rule); border-left: 4px solid var(--blue); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 2px 0 8px; display: flex; flex-direction: column; gap: 8px; }
.form p { margin: 0; }
.form select, .form input, .form textarea { max-width: 720px; }
.form button { align-self: flex-start; }
.two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: var(--s6); align-items: start; }
.two > div + div table { font-size: 12.5px; }
.two > div + div th, .two > div + div td { padding-left: 8px; padding-right: 8px; }
.events { list-style: none; padding: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--radius); }
.events li { padding: 7px 12px; border-bottom: 1px solid var(--hair); }
.events li:last-child { border-bottom: 0; }
.events .when { color: var(--muted); margin-right: 6px; }
.events b { font-weight: 650; color: var(--ink); }
details.rel { border-top: 1px solid var(--hair); padding: 8px 0; margin: 0; }
.ceo { border-left: 4px solid var(--navy); background: var(--tint); border-radius: var(--radius-sm); padding: 8px 14px; margin: 8px 0 12px; }
.ceo p { margin: 4px 0; }
details.rel summary { cursor: pointer; font-weight: 600; color: var(--blue-dark); }
details.rel[open] summary { margin-bottom: 8px; }
pre { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 var(--mono); background: var(--tint); border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 12px; margin: 0; }

/* case: the six answers */
.case-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 2px 0 var(--s5); }
.case-meta .id { font-size: 12px; color: var(--muted); margin-left: 8px; }
.answers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 var(--s5); }
.answers .answer { margin: 0; padding: 14px 16px 16px; border-top: 3px solid var(--blue); }
.answer h3 { font-size: 13px; margin: 0 0 8px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.answer > div > b, .answer .big { font: 700 20px/1.25 var(--sans); color: var(--ink); }

/* ------------------------------------------------------------ desk */
.level { margin: 0 0 var(--s6); }
.level-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 700 var(--fs-h2)/1.2 var(--display); color: var(--ink); }
.level-title .n { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font: 700 12.5px/1 var(--sans); letter-spacing: .04em; }
.situation { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: var(--s5); margin-top: var(--s4); align-items: start; }
.situation > div { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.situation h3 { margin: 0 0 8px; }
.risk-list, .card ul { list-style: none; margin: 8px 0 0; padding: 0; }
.risk-list li { padding: 7px 0; border-top: 1px solid var(--hair); font-size: 13px; }
.meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.meta .badge { margin-right: 2px; }
.figures { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; }
.figure { margin: 0; padding: 14px 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); border-top: 3px solid var(--blue); }
.figure dt { font: 700 10.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.figure dd { margin: 8px 0 0; font: 700 var(--fs-figure)/1 var(--sans); color: var(--navy); font-variant-numeric: tabular-nums lining-nums; }
.figure dd.attn { color: var(--crit); }
.figure:has(dd.attn) { border-top-color: var(--crit); }
.figure .note { display: block; margin-top: 6px; font: 12px/1.4 var(--sans); color: var(--muted); }
.priorities { margin-top: var(--s4); }
.inv table { min-width: 980px; }
.inv th, .inv td { padding-left: 8px; padding-right: 8px; }
.inv td:nth-child(2) { min-width: 150px; }
.inv td:nth-child(8) { min-width: 150px; }
.inv td:nth-child(10) { min-width: 150px; }
.inv td.num { white-space: normal; }
.priorities table td:first-child { width: 120px; }
.grid-rules { margin: 0; }
.desk-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.desk-cols .card { margin: 0; }
.desk-cols.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.desk-cols.three .card .count { font-size: 22px; }
.desk-cols .card.wide { grid-column: span 2; }
.card .lead { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
.empty { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
/* purchases by impact */
.pills { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin-top: 4px; }
.count-pill { display: inline-block; min-width: 26px; padding: 1px 9px; border-radius: 999px; background: var(--navy); color: #fff;
  font: 700 13px/1.5 var(--sans); text-align: center; vertical-align: 2px; }
.set-letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font: 700 12px/1 var(--sans); vertical-align: 2px; }
.crit-summary { border-top: 4px solid var(--crit); }
.impact table { min-width: 1040px; }
.impact td:nth-child(1) { width: 30px; }
.impact td { padding-top: 8px; padding-bottom: 8px; }
.impact .art { display: block; min-width: 250px; }
.impact .urg { display: block; min-width: 160px; }
.impact .tablewrap td:last-child { min-width: 150px; }
[title]:not([title=""]) { cursor: help; }

/* ------------------------------------------------------------ dialogs, sign-in */
.modal { position: fixed; inset: 0; background: rgba(11, 37, 69, .45); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 10; }
.modal[hidden] { display: none; }
.modal-box { background: var(--paper); width: min(860px, 94vw); max-height: 84vh; overflow: auto; border-radius: 8px;
  border-top: 4px solid var(--blue); box-shadow: 0 16px 40px rgba(11, 37, 69, .28); padding: 20px 26px 24px; }
.modal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; font: 700 18px/1.3 var(--sans); color: var(--ink); }
.modal-head button.link { font: 600 13px var(--sans); }
.login { max-width: 520px; margin: 8vh auto 0; padding: 28px 30px 30px; background: var(--paper); border: 1px solid var(--rule);
  border-top: 4px solid var(--blue); border-radius: 8px; box-shadow: var(--shadow); }
.login-logo { display: block; height: 72px; width: auto; margin: 0 0 18px; }
.login-form button { min-width: 140px; }
.login-alt { margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--hair); }
.login-alt summary { cursor: pointer; color: var(--blue); font-size: var(--fs-sm); }
/* T-F7-05: the verification in two steps (the key to type, the recovery codes shown once) */
.mfa-key { font-size: 1.15em; letter-spacing: 0.08em; word-break: break-all; }
.mfa-codes { columns: 2; padding-left: 1.2em; }
.mfa-codes code { letter-spacing: 0.05em; }
.nav a[hidden] { display: none; }
.login h1 { font-size: 26px; }
.login label { display: flex; flex-direction: column; gap: 6px; font: 700 10.5px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: var(--s4) 0; }
.login input { text-transform: none; letter-spacing: normal; font-weight: 400; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s6); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1280px) {
  :root { --gutter: 24px; }
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desk-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr); gap: var(--s5); }
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav { border-right: 0; border-bottom: 1px solid var(--rule); padding: 6px 8px; display: flex; gap: 2px; overflow-x: auto; white-space: nowrap; }
  .nav a { padding: 8px 12px; }
  .inv table { min-width: 900px; }
  .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two { grid-template-columns: minmax(0, 1fr); }
  .desk-cols.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .situation { grid-template-columns: minmax(0, 1fr); }
  .agent-state { display: none; }
}
@media (max-width: 860px) {
  :root { --gutter: 16px; --fs-h1: 22px; --fs-h2: 18px; }
  .top { padding: 10px var(--gutter); flex-wrap: wrap; position: static; }  /* small screens: the bar scrolls away */
  .brand-house { display: none; }
  .status { padding: 8px var(--gutter); }
  .main { padding: 18px var(--gutter) 48px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures .figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .desk-cols, .desk-cols.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .answers, .split { grid-template-columns: minmax(0, 1fr); }
  /* touch: every control is at least 40 px tall */
  button, .nav a, .tabs a { min-height: 40px; }
  td button, .action.off button { min-height: 36px; }
  .tabs a { display: inline-flex; align-items: center; }
  input, select { min-height: 40px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .tablewrap table { min-width: 680px; }  /* a table scrolls inside its frame, never crushed into word-wide columns */
  .login { margin-top: 4vh; }
}
@media (max-width: 600px) {
  .desk-cols, .desk-cols.three { grid-template-columns: minmax(0, 1fr); }
  .desk-cols .card.wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .nav, .status, .top .who, .actions, .filters, .tabs { display: none !important; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  body { background: #fff; }
  .top { background: #fff; color: var(--ink); position: static; }
  .brand-name { color: var(--ink); }
  .card, .tablewrap, .figure, .situation > div { box-shadow: none; }
}

/* ------------------------------------------------------------ controls in the editorial type */
button, input, select, textarea { font-family: var(--text); }
.brand-logo[src=""], .brand-logo:not([src]) { display: none; }
.brand-mark[hidden], .brand-logo[hidden], .login-logo[hidden] { display: none !important; }
.brand-mark { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: var(--blue);
  color: #fff; font: 700 20px/1 var(--display); flex: none; }

/* ------------------------------------------------------------ navigation: the owner's three entries, then operation */
.nav .nav-label { margin: 18px 12px 6px; font: 700 10.5px/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav .nav-label:first-child { margin-top: 2px; }
.nav a.primary { font: 700 14.5px/1.3 var(--display); color: var(--navy); }
.nav a.primary::before { width: 8px; height: 8px; background: var(--blue); }

/* ------------------------------------------------------------ the owner's entrance: three doors */
.entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 8px 0 32px; }
.entry { display: flex; flex-direction: column; gap: 10px; padding: 26px 26px 22px; background: var(--paper); border: 1px solid var(--rule);
  border-top: 4px solid var(--blue); border-radius: 8px; box-shadow: var(--shadow); color: var(--graphite); text-decoration: none; }
.entry:hover { border-color: var(--blue); text-decoration: none; box-shadow: 0 6px 18px rgba(15, 27, 45, .08); }
.entry .door { font: 700 11px/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--blue); }
.entry h2 { margin: 0; font-size: 23px; color: var(--ink); }
.entry p { margin: 0; color: var(--muted); }
.entry .facts { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hair); font-size: 13.5px; color: var(--graphite); }
.demo-strip { padding: 8px var(--gutter) 8px 20px; background: var(--warn-tint); color: var(--warn); font: 700 13px/1.4 var(--sans);
  border-bottom: 1px solid #f0d9a8; letter-spacing: .02em; }

/* ------------------------------------------------------------ audit: a recommendation opened completely */
.explain section { margin: 0 0 26px; }
.formula-table td:first-child { font-weight: 700; color: var(--ink); white-space: nowrap; }
.formula-table .with { font-family: var(--mono); font-size: 12.5px; color: var(--graphite); }
.state-known { color: var(--ok); font-weight: 700; }
.state-na { color: var(--warn); font-weight: 700; }
.verdict { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 700 12px/1.6 var(--sans); }
.verdict.good { background: var(--ok-tint); color: var(--ok); }
.verdict.bad { background: var(--crit-tint); color: var(--crit); }
.verdict.mid { background: var(--warn-tint); color: var(--warn); }
.verdict.neutral { background: var(--tint); color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.kpi { padding: 14px 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.kpi .k { font: 700 10.5px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font: 700 28px/1.2 var(--display); color: var(--ink); margin-top: 4px; }
.kpi .n { font-size: 12.5px; color: var(--muted); }
.case { border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); margin: 0 0 10px; }
.case > summary { cursor: pointer; padding: 12px 16px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.case > div { padding: 0 16px 14px; }
.logo-preview { max-height: 72px; max-width: 220px; border: 1px solid var(--hair); padding: 6px; background: #fff; border-radius: 4px; }
.company-card { display: flex; gap: 16px; align-items: center; }
.company-card img { max-height: 48px; max-width: 120px; }
@media (max-width: 1100px) { .entries { grid-template-columns: minmax(0, 1fr); } }
/* a communication draft: shown as written, never sent */
pre.draft { white-space: pre-wrap; font-family: inherit; font-size: 0.95rem; background: var(--paper, #fff);
  border: 1px solid var(--line, #d9dee5); padding: 12px; max-height: 60vh; overflow: auto; }

/* ------------------------------------------------------------ conversation (PD-11): the person, then the answer */
.talk-thread { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-direction: column; gap: 14px; }
.talk-thread > .empty { padding: 14px 16px; background: var(--paper); border: 1px dashed var(--rule); border-radius: var(--radius); }
.talk-turn { display: flex; flex-direction: column; gap: 6px; }
.talk-who { font: 700 10.5px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.talk-you { align-self: flex-end; max-width: 78%; padding: 8px 14px; background: var(--blue-tint); border: 1px solid #c9d0dc;
  border-radius: var(--radius); }
.talk-you p { margin: 2px 0 0; color: var(--ink); white-space: pre-wrap; }
.talk-answer { padding: 12px 16px; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--navy);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.talk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.talk-points { margin: 6px 0 8px; padding-left: 18px; }
.talk-points > li { margin: 6px 0; }
.cite > summary { cursor: pointer; font: 600 12px/1.4 var(--sans); color: var(--blue); }
.cite-row { margin: 8px 0 0; padding: 8px 10px; background: var(--tint); border: 1px solid var(--hair); border-radius: var(--radius-sm); font-size: 13px; }
.cite-row .kv { margin-top: 6px; background: var(--paper); }
.talk-pending { margin-top: 10px; }
.talk-pending .tablewrap { box-shadow: none; }
.talk-compose textarea { min-height: 84px; }
/* ------------------------------------------------------------ indicators: a value only with its basis */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin: 8px 0 var(--s5); }
.kpi-card { margin: 0; display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--blue); }
.kpi-card p { margin: 0; }
.kpi-big { font: 700 var(--fs-figure)/1.1 var(--sans); color: var(--navy); font-variant-numeric: tabular-nums lining-nums; }
.kpi-lines { font-size: 14px; color: var(--ink); display: flex; flex-direction: column; gap: 2px; }
.kpi-none { font: 700 15px/1.3 var(--sans); color: var(--sim); }
.kpi-basis .kv { font-size: 12.5px; }
.profile-preview { margin-top: var(--s5); }
.profile-preview h2 { margin-top: 0; }
@media (max-width: 860px) { .talk-you { max-width: 100%; } .kpi-grid { grid-template-columns: minmax(0, 1fr); } }
