/* NucLex-owl (NucLex ontology workbench on Snow Owl), styled to NUCLEX-BRAND-001 v2.0 (brand/tokens.json).
   Light only, no pink. NucLex Blue for the mark, headings and outline buttons; NucLex Red is editorial
   (the rule above page titles) and never an error; Orange once per view as a fill (the primary action);
   Concept Blue for anything you can follow in the ontology. Source Serif 4, Arimo, IBM Plex Mono,
   self-hosted from brand/fonts. Cards: White, Hairline, 12px radius, card shadow.
   Layout: white masthead with a hairline, then list pane + document pane + rail; footer on Page Gray. */

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Arimo"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/arimo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Arimo"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/arimo-latin-700-normal.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-latin-400-normal.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-latin-500-normal.woff2") format("woff2"); }

:root {
  /* brand tokens */
  --navy: #011F5B; --crimson: #990000; --ember: #F47F52; --on-ember: #15161B;
  --sky: #2B5C8E; --sky-light: #6A9BCC;
  --surface: #FFFFFF; --surface-sunk: #F6F7F9;
  --ink: #15161B; --ink-muted: #595F6A; --heading: #011F5B;
  --rule: #D8DCE1; --rule-strong: #8592A3;
  --wash-sky: #E8F0F8; --wash-ember: #FFF2E5;
  --shadow-card: 0 2px 8px rgba(1,31,91,0.10);
  --shadow-float: 0 6px 20px rgba(1,31,91,0.14);
  /* app-only values: hover shade, status (no pink, no red tints), modal scrim */
  --navy-hover: #F0F4FA;
  --ok: #1E6B45; --ok-wash: #E6F2EA;
  --warn: #7A4E00; --warn-wash: #FFF3D6;
  --overlay: rgba(1,31,91,.35);
  --serif: "Source Serif 4", Cambria, Georgia, serif;
  --sans: Arimo, Arial, Helvetica, sans-serif;
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--surface-sunk); color: var(--ink); font: 15px/22px var(--sans); -webkit-font-smoothing: antialiased; }
#app { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--heading); margin: 0; font-weight: 600; text-wrap: balance; }
h1 { font-size: 36px; line-height: 42px; letter-spacing: -0.01em; }
h2 { font-size: 26px; line-height: 32px; }
h3 { font-size: 20px; line-height: 26px; }
h4 { font-size: 16px; line-height: 22px; }
a { color: var(--sky); text-underline-offset: 2px; }
a:hover { color: var(--heading); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; line-height: 20px; }
.caption { font-size: 12px; line-height: 18px; color: var(--ink-muted); }
.label { font-size: 11px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.sctid { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--sky); }
.lead { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 32px; color: var(--ink); }
.hidden { display: none !important; }

/* ---------- shell ---------- */
.shell { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.topbar { background: var(--surface); color: var(--heading); border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 24px; padding: 10px 24px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; flex-wrap: wrap; }
.lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--heading); }
/* Mark height = wordmark cap height x 1.25. The drawn brackets span 48/64 of the SVG box, so the box is sized to 1.25 x cap / 0.75. */
.lockup .mark { display: block; flex: none; height: calc(var(--wm, 26px) * 0.66 * 1.25 / 0.75); width: auto; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: var(--wm, 26px); line-height: 1; letter-spacing: -0.01em; color: var(--heading); }
.descriptor { font-family: var(--sans); font-size: 11px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-muted); }
.lockup .product { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-muted); border-left: 1px solid var(--rule); padding-left: 12px; line-height: 1.4; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--ink-muted); text-decoration: none; padding: 7px 12px; border-radius: var(--r-md); font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.nav a:hover { background: var(--navy-hover); color: var(--heading); }
.nav a[aria-current="page"] { color: var(--heading); font-weight: 700; box-shadow: inset 0 -2px 0 var(--navy); }
.nav .count { border: 1px solid var(--navy); color: var(--navy); border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.who strong { color: var(--heading); font-weight: 700; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--wash-sky); color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.demo-band { background: var(--wash-sky); color: var(--ink); font-size: 13px; line-height: 20px; padding: 6px 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.footer { background: var(--surface-sunk); color: var(--ink-muted); border-top: 1px solid var(--rule); font-size: 13px; line-height: 20px; padding: 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: end; }
.footer .lockup { --wm: 30px; }
.topbar .lockup { --wm: 30px; }
/* At --wm 30px the mark box is 33px, above the 32px floor where the favicon file would be required. */
.footer .publisher { color: var(--ink-muted); }
.footer p { margin: 0; }
.footer .tm { font-size: 12px; }
main { padding: 32px 24px; min-width: 0; }
.page { max-width: 1320px; margin: 0 auto; display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 8px 0 0; max-width: 70ch; }
.rule { width: 48px; height: 3px; background: var(--crimson); border: 0; margin: 0 0 12px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-card); min-width: 0; }
.card > .card-head { padding: 16px 20px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card > .card-body { padding: 20px; }
.card.flush > .card-body { padding: 0; }
.card.concept { border-top: 3px solid var(--sky); }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); }
.callout { border-left: 4px solid var(--sky); background: var(--wash-sky); border-radius: var(--r-md); padding: 12px 16px; font-size: 14px; }
.callout.attention { border-left-color: var(--warn); background: var(--warn-wash); }
.callout.note { border-left-color: var(--heading); background: var(--surface-sunk); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: var(--r-md); padding: 8px 16px; border: 2px solid transparent; font-weight: 700; font-size: 14px; line-height: 20px; cursor: pointer; transition: background-color .12s, color .12s, border-color .12s; text-decoration: none; white-space: nowrap; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.primary { background: var(--ember); border-color: var(--ember); color: var(--on-ember); }
.btn.primary:hover { filter: brightness(1.05); }
/* "navy" and "outline" are the secondary button: a 2px NucLex Blue outline, never a fill. */
.btn.navy, .btn.outline { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.btn.navy:hover, .btn.outline:hover { background: var(--navy-hover); }
.btn.ghost { background: transparent; color: var(--sky); text-decoration: underline; text-underline-offset: 2px; padding-left: 8px; padding-right: 8px; }
.btn.ghost:hover { background: var(--wash-sky); }
.btn.danger { background: var(--surface); color: var(--ink); border-color: var(--rule-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(1); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--heading); }
.field small { color: var(--ink-muted); font-size: 12px; }
input[type="text"], input[type="password"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 8px 10px; background: var(--surface); min-width: 0; }
textarea { min-height: 80px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--rule-strong); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sky); outline-offset: 2px; }
.checkbox { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--navy); border-radius: var(--r-md); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 14px; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-muted); }
.seg button[aria-pressed="true"] { background: var(--wash-sky); color: var(--navy); box-shadow: inset 0 -2px 0 var(--navy); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); padding: 0 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 700; font-size: 14px; color: var(--ink-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--heading); border-bottom-color: var(--navy); }

/* ---------- badges: state always in words, color only reinforces ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px; font-size: 11px; line-height: 18px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--rule); background: var(--surface-sunk); color: var(--ink-muted); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.s-NEW { background: var(--surface-sunk); color: var(--ink-muted); }
.badge.s-IN_PROGRESS { background: var(--wash-sky); color: var(--sky); border-color: transparent; }
.badge.s-IN_REVIEW { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.badge.s-CHANGES_REQUESTED, .badge.attention { background: var(--warn-wash); color: var(--warn); border-color: transparent; }
.badge.s-APPROVED { background: var(--ok-wash); color: var(--ok); border-color: transparent; }
.badge.s-PROMOTED { background: var(--surface); color: var(--heading); border-color: var(--rule-strong); }
.badge.s-CANCELLED { background: var(--surface); color: var(--ink-muted); }
.badge.defined { background: var(--surface); color: var(--navy); border-color: var(--navy); }
.badge.primitive { background: var(--surface-sunk); color: var(--ink-muted); }
.badge.inactive { background: var(--surface); color: var(--ink-muted); border-color: var(--rule-strong); }
.tag { font-family: var(--mono); font-size: 13px; line-height: 20px; color: var(--sky); background: var(--wash-sky); border-radius: var(--r-sm); padding: 0 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th { background: var(--surface); color: var(--heading); text-align: left; font-weight: 700; padding: 10px 14px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid var(--heading); }
td { padding: 10px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tbody tr:nth-child(even) td { background: var(--surface-sunk); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: var(--wash-sky); }
td.r, th.r { text-align: right; }

/* ---------- browser ---------- */
.workspace { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.workspace.with-rail { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(280px, 340px); }
.side { position: sticky; top: 76px; max-height: calc(100vh - 100px); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.side .card-body { overflow: auto; }
.searchbox { padding: 14px; border-bottom: 1px solid var(--rule); display: grid; gap: 10px; }
.results { list-style: none; margin: 0; padding: 6px; overflow: auto; }
.results li button { width: 100%; text-align: left; border: 0; background: none; border-radius: var(--r-md); padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; }
.results li button:hover, .results li button[aria-current="true"] { background: var(--wash-sky); }
.results .t { font-size: 14px; color: var(--ink); }
.results .f { font-size: 12px; color: var(--ink-muted); }
.tree { list-style: none; margin: 0; padding: 4px 0; font-size: 14px; }
.tree ul { list-style: none; margin: 0 0 0 9px; padding-left: 16px; border-left: 1.5px solid var(--sky-light); }
.tree .node { display: flex; align-items: center; gap: 4px; }
.tree .tw { width: 20px; height: 20px; border: 0; background: none; cursor: pointer; color: var(--sky); padding: 0; flex: none; font-size: 11px; }
.tree .tw[disabled] { cursor: default; opacity: .5; }
.tree .nm { border: 0; background: none; text-align: left; padding: 3px 6px; border-radius: var(--r-sm); cursor: pointer; min-width: 0; color: var(--ink); }
.tree .nm:hover { background: var(--wash-sky); }
.tree .nm[aria-current="true"] { background: var(--wash-sky); color: var(--heading); font-weight: 700; box-shadow: inset 2px 0 0 var(--sky); }
.concept-head { padding: 22px 24px 16px; display: grid; gap: 8px; border-bottom: 1px solid var(--rule); }
.concept-head h1 { font-size: 30px; line-height: 36px; }
.concept-head .fsn { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 24px; color: var(--ink); }
.breadcrumbs { font-size: 13px; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumbs button { border: 0; background: none; color: var(--sky); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.diagram-wrap { overflow-x: auto; padding: 8px 4px; }
.diagram { display: block; max-width: 100%; height: auto; }
.dg-box { fill: var(--surface); stroke: var(--heading); stroke-width: 1.2; }
.dg-box-inner { fill: none; stroke: var(--heading); stroke-width: 1; }
.dg-focus .dg-box { fill: var(--wash-sky); stroke: var(--heading); stroke-width: 2; }
.dg-focus .dg-box-inner { stroke: var(--heading); }
.dg-focus .dg-label { fill: var(--heading); font-weight: 700; }
.dg-label { font: 12.5px var(--sans); fill: var(--ink); }
.dg-id { font: 500 11px var(--mono); fill: var(--sky); }
.dg-attr-box { fill: var(--wash-sky); stroke: var(--sky-light); stroke-width: 1.2; }
.dg-line { stroke: var(--sky-light); stroke-width: 1.5; }
.dg-arrowhead { fill: var(--sky-light); }
.dg-status { fill: var(--surface); stroke: var(--heading); stroke-width: 1.5; }
.dg-status-symbol { font: 600 17px var(--serif); fill: var(--heading); }
.dg-dot { fill: var(--sky-light); }
.dg-group { fill: var(--surface); stroke: var(--sky-light); stroke-width: 1.5; }
.dg-link { cursor: pointer; }
.dg-link:hover .dg-box, .dg-link:focus .dg-box { fill: var(--wash-sky); }
.dg-link:focus { outline: none; }
.defs-table td:first-child { width: 34%; }

/* ---------- task workspace ---------- */
.lifecycle { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); gap: 0; padding: 18px 20px 20px; overflow-x: auto; margin: 0; list-style: none; }
.step { position: relative; display: grid; justify-items: start; align-content: start; gap: 4px; padding-right: 8px; min-width: 0; }
.step::before { content: ""; position: absolute; top: 13px; left: 28px; right: 0; height: 1.5px; background: var(--rule); }
.step:last-child::before { display: none; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface); border: 1.5px solid var(--rule-strong); color: var(--ink-muted); position: relative; z-index: 1; }
.step.done .n { background: var(--sky); border-color: var(--sky); color: var(--surface); }
.step.done::before { background: var(--sky); }
.step.current .n { border: 2px solid var(--navy); color: var(--navy); background: var(--wash-sky); }
.step .t { font-weight: 700; font-size: 13px; color: var(--heading); }
.step .d { font-size: 12px; line-height: 16px; color: var(--ink-muted); max-width: 100%; overflow-wrap: anywhere; }
.change-list { list-style: none; margin: 0; padding: 6px; }
.change-list li button { width: 100%; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; display: grid; gap: 2px; color: var(--ink); }
.change-list li button:hover, .change-list li button[aria-current="true"] { background: var(--wash-sky); }
.kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kind.new { color: var(--sky); } .kind.changed { color: var(--heading); } .kind.deleted { color: var(--warn); }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.issues li { border-left: 3px solid var(--warn); background: var(--warn-wash); padding: 8px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 20px; }
.issues li.warning { border-left-color: var(--sky); background: var(--wash-sky); }
.thread { display: grid; gap: 12px; }
.comment { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface); font-size: 14px; }
.comment.review { border-left: 3px solid var(--warn); }
.comment.resolved { opacity: .6; }
.comment .meta { font-size: 12px; color: var(--ink-muted); display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.gates { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.gates li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; }
.gates .mark { font-weight: 700; color: var(--rule-strong); }
.gates .mark.ok { color: var(--sky); }

/* ---------- editor ---------- */
.editor { display: grid; gap: 22px; }
.editor section { display: grid; gap: 10px; }
.desc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.desc-row > .term { grid-column: 1 / -1; }
.desc-row.inactive input[type="text"] { text-decoration: line-through; color: var(--ink-muted); }
.attr-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.parent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.group-box { border: 1px solid var(--rule); border-left: 3px solid var(--sky); border-radius: var(--r-md); padding: 12px; display: grid; gap: 8px; background: var(--surface-sunk); }
.picker { position: relative; min-width: 0; }
.picker .chosen { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-strong); border-radius: var(--r-sm); padding: 6px 8px; background: var(--surface); min-height: 38px; flex-wrap: wrap; }
.picker .chosen .lbl { flex: 1 1 140px; min-width: 0; font-size: 14px; line-height: 1.3; }
.picker .chosen .sctid { font-size: 11px; }
.picker .menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-float); max-height: 260px; overflow: auto; padding: 4px; }
.picker .menu button { display: grid; width: 100%; text-align: left; border: 0; background: none; padding: 7px 9px; border-radius: var(--r-sm); cursor: pointer; color: var(--ink); }
.picker .menu button:hover, .picker .menu button.active { background: var(--wash-sky); }
.diff-desc { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.diff-desc li { padding: 4px 8px; border-radius: var(--r-sm); }
.diff-desc li.add { background: var(--wash-sky); }
.diff-desc li.del { background: var(--surface-sunk); border-left: 3px solid var(--rule-strong); text-decoration: line-through; color: var(--ink-muted); }

/* ---------- dialogs and toasts ---------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; padding: 16px; z-index: 50; }
.dialog { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-float); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.dialog.wide { width: min(980px, 100%); }
.dialog header { padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.dialog .body { padding: 20px 22px; display: grid; gap: 14px; }
.dialog footer { padding: 14px 22px; border-top: 1px solid var(--rule); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.signature { border: 1px solid var(--rule); border-top: 3px solid var(--navy); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; background: var(--surface-sunk); }
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--surface); color: var(--ink); border: 1px solid var(--rule); border-left: 4px solid var(--navy); padding: 10px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-float); font-size: 14px; max-width: 420px; }
.toast.error { background: var(--surface); color: var(--ink); border: 1px solid var(--warn); border-left: 4px solid var(--warn); }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); }
.signin .hero { background: var(--surface-sunk); color: var(--ink); padding: 48px; display: grid; align-content: space-between; gap: 40px; border-right: 1px solid var(--rule); }
.signin .hero .lockup { --wm: 44px; }
.signin .hero .descriptor { margin-top: 10px; }
.signin .hero h1 { font-size: 40px; line-height: 46px; max-width: 18ch; }
.signin .hero p { color: var(--ink); max-width: 54ch; font-size: 16px; line-height: 26px; margin: 0; }
.signin .hero .publisher { font-size: 13px; color: var(--ink-muted); }
.signin .form { padding: 48px; display: grid; align-content: center; gap: 18px; background: var(--surface); }
.persona { display: grid; gap: 8px; }
.persona button { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); padding: 10px 12px; cursor: pointer; color: var(--ink); }
.persona button:hover { border-color: var(--sky); background: var(--wash-sky); }
.flow { display: grid; gap: 10px; counter-reset: f; padding: 0; margin: 0; list-style: none; }
.flow li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; color: var(--ink-muted); font-size: 14px; line-height: 22px; }
.flow li::before { counter-increment: f; content: counter(f); width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--sky); color: var(--sky); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.flow li strong { color: var(--heading); font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 16px 18px; display: grid; gap: 4px; }
.kpi .v { font-family: var(--serif); font-weight: 600; font-size: 32px; color: var(--heading); line-height: 1.1; }
.kpi.attention { background: var(--wash-ember); border-color: var(--rule); box-shadow: var(--shadow-card), inset 0 3px 0 var(--ember); }
.empty { padding: 28px; text-align: center; color: var(--ink-muted); display: grid; gap: 10px; justify-items: center; }

@media (max-width: 1100px) {
  .workspace.with-rail { grid-template-columns: minmax(0, 1fr); }
  .workspace.with-rail > .side { position: static; max-height: none; }
}
@media (max-width: 860px) {
  main { padding: 20px 16px; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .nav { order: 3; flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .who { margin-left: auto; }
  .who > span:nth-child(2) { display: none; }
  .lockup .product { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: 60vh; }
  .signin { grid-template-columns: 1fr; }
  .signin .hero, .signin .form { padding: 28px 16px; }
  .signin .hero h1 { font-size: 32px; line-height: 38px; }
  .desc-row { grid-template-columns: 1fr 1fr; }
  .attr-row { grid-template-columns: 1fr; }
  .attr-row > :nth-child(2) { display: none; }
  .footer { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
