/* Shenkin Organisational Intelligence: private beta. Mostly monochrome (Shenkin colour system); orange = selection only. */
:root { --brand: #1d4ed8; --navy: #0b1f3a; --ink: #040404; --muted: #5b6372; --line: #e3e6ea; --bg: #fff; --panel: #f7f7f5; --sel: #ff7a1a; --hyp: #7c3aed; --warn: #b45309; --bad: #b42318;
  --ev-verified: #040404; --ev-reported: #0369a1; --ev-inferred: #92400e; --ev-hyp: #7c3aed; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --ink: #f2f2f2; --muted: #a3a9b4; --line: #2c3036; --bg: #111316; --panel: #1a1d21; --ev-verified: #f2f2f2; --ev-reported: #38bdf8; --ev-inferred: #f59e0b; --ev-hyp: #a78bfa; --hyp: #a78bfa; color-scheme: dark; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.45 'Helvetica Neue', Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sel); outline-offset: 2px; }
.boot { padding: 24px; color: var(--muted); }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* sign-in */
.auth { max-width: 400px; margin: 8vh auto; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.auth h1 { font-size: 20px; margin: 0; } .auth label { font-weight: 600; font-size: 13px; margin-top: 6px; }
.auth input { border: 1.5px solid var(--line); border-radius: 8px; padding: 10px; min-height: 44px; background: var(--bg); }
.msg { color: var(--bad); min-height: 1em; } .note { color: var(--muted); font-size: 13px; }
.qr { width: 200px; height: 200px; } .codes { font-family: ui-monospace, Menlo, monospace; columns: 2; background: var(--panel); padding: 10px; border-radius: 8px; }

/* shell */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .02em; } .brand small { display: block; font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.env { font-size: 11px; font-weight: 700; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, var(--bg)); color: var(--brand); }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.link { background: none; border: 0; color: #0b6f9e; text-decoration: underline; padding: 4px; }
.btn { border: 1.5px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 12px; min-height: 36px; font-weight: 600; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); } .btn[disabled] { opacity: .45; cursor: default; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 7px 14px; min-height: 38px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); position: relative; z-index: 5; background: var(--bg); }
.toolbar .grp { display: inline-flex; gap: 6px; align-items: center; }
.toolbar .btn { min-height: 34px; padding: 5px 10px; white-space: nowrap; } .toolbar .btn.tog.on { border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--sel); }
.scn-select { width: auto; max-width: 210px; min-height: 34px; padding: 4px 8px; }
.toolbar .btn.icon { min-width: 36px; padding: 4px 8px; font-size: 17px; line-height: 1; }
.toolbar .sm { display: none; }
.top .views { flex: 0 1 auto; } .top .seg button { padding: 5px 12px; min-height: 32px; }
.search { position: relative; flex: 1 1 160px; min-width: 150px; max-width: 320px; } .search .input { min-height: 34px; padding: 5px 9px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 4px; max-height: 60vh; overflow: auto; z-index: 20; }
.search-results:empty { display: none; } .search-results li.muted { padding: 6px 8px; }
.menu { position: relative; } .menu > summary { list-style: none; display: inline-flex; align-items: center; } .menu > summary::-webkit-details-marker { display: none; }
.menu-items { position: absolute; right: 0; top: calc(100% + 4px); min-width: 180px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); padding: 4px; display: flex; flex-direction: column; z-index: 20; }
.menu-items button { text-align: left; background: none; border: 0; border-radius: 6px; padding: 8px 10px; min-height: 36px; font-weight: 600; } .menu-items button:hover, .menu-items button:focus-visible { background: var(--panel); }
.banner { padding: 5px 16px; font-size: 12.5px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner.live { background: var(--panel); } .banner.scn { background: color-mix(in srgb, var(--brand) 7%, var(--bg)); border-left: 4px solid var(--brand); color: var(--ink); }   /* 30 Oct: a quiet blue-grey status strip (was lilac) */
/* workspace (29 Oct): the canvas takes the whole width; panels are drawers over it, opened only when wanted */
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.main { position: relative; flex: 1 1 auto; min-height: 420px; overflow: hidden; }
.canvas { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.drawer { position: absolute; z-index: 4; overflow: auto; background: var(--panel); padding: 10px 14px; box-shadow: 0 8px 30px rgba(0,0,0,.16); visibility: hidden; transition: transform .18s ease, visibility .18s; }
.drawer.open { visibility: visible; }
.left { left: 0; top: 0; bottom: 0; width: min(340px, 92vw); border-right: 1px solid var(--line); transform: translateX(-102%); }
.left.open, .left.peek { transform: none; visibility: visible; }   /* while dragging, the drawer slides in at the left edge */
.edge-hint { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 3; writing-mode: vertical-rl; rotate: 180deg; padding: 14px 6px; font-size: 12px; font-weight: 700;
  background: var(--ink); color: var(--bg); border-radius: 0 8px 8px 0; display: none; pointer-events: none; }
body.dragging .edge-hint { display: block; }
body.dragging .right.open, body.dragging .changes.open { opacity: .12; pointer-events: none; }   /* and the other panels step aside */
.right { right: 0; top: 0; bottom: 0; width: min(380px, 94vw); border-left: 1px solid var(--line); transform: translateX(102%); }
.right.open { transform: none; }
.changes { left: 0; right: 0; bottom: 0; max-height: 42%; border-top: 1px solid var(--line); transform: translateY(102%); }
.changes.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -10px; background: var(--panel); padding: 4px 0 6px; z-index: 1; }
.drawer-head h3 { margin: 0; } .btn.close { min-height: 32px; width: 36px; padding: 0; font-size: 18px; line-height: 1; }
.canvas > svg { width: 100%; height: 100%; display: block; user-select: none; }
.zoom { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.zoom button { width: 40px; height: 40px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 700; }
.legend { user-select: none; position: absolute; left: 10px; bottom: 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; max-width: 300px; }
.legend div { display: flex; align-items: center; gap: 6px; margin: 2px 0; } .legend summary { font-weight: 700; cursor: pointer; min-height: 28px; display: flex; align-items: center; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 6px; }
h3 { font-size: 16px; margin: 4px 0 6px; }
.list { list-style: none; margin: 0; padding: 0; } .list li { margin: 2px 0; }
.list button.item { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-height: 36px; }
.list button.item[aria-current="true"] { border-color: var(--sel); box-shadow: inset 3px 0 0 var(--sel); }
.input { border: 1.5px solid var(--line); border-radius: 8px; padding: 7px 9px; min-height: 38px; background: var(--bg); width: 100%; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; border: 1px solid currentColor; margin-left: 4px; text-transform: uppercase; }
.badge.verified { color: var(--ev-verified); } .badge.reported { color: var(--ev-reported); } .badge.inferred { color: var(--ev-inferred); } .badge.hypothetical { color: var(--ev-hyp); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 3px 10px; font-size: 13px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.warn { color: var(--warn); } .muted { color: var(--muted); font-size: 13px; }
.box { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.outline ul { list-style: none; padding-left: 14px; margin: 0; } .outline > ul { padding-left: 0; }
.outline button { background: none; border: 0; padding: 3px 4px; text-align: left; border-radius: 6px; } .outline button[aria-current="true"] { background: color-mix(in srgb, var(--sel) 18%, transparent); }

/* SVG */
.node { cursor: pointer; } .node:focus { outline: none; }
.node:focus-visible .sel-ring, .node.sel .sel-ring { stroke: var(--sel); stroke-width: 3; opacity: 1; }
.sel-ring { fill: none; opacity: 0; }
.card { fill: var(--bg); stroke: color-mix(in srgb, var(--ink) 22%, var(--bg)); stroke-width: 1.3; } .card.vacant { stroke-dasharray: 5 4; }
.card.proposed { stroke: var(--warn); stroke-dasharray: 6 3; stroke-width: 2; } .card.removal { stroke: var(--bad); stroke-dasharray: 3 3; opacity: .7; }
.card.changed { stroke: var(--hyp); stroke-width: 2.5; } .card.drop { stroke: var(--sel); stroke-width: 3; }
.t1 { font-size: 12.5px; font-weight: 700; fill: var(--ink); } .t2 { font-size: 11.5px; fill: var(--ink); opacity: .78; } .t3 { font-size: 10.5px; fill: var(--muted); }
.strike { stroke: var(--bad); stroke-width: 1.5; }
.lbl { font-size: 12px; fill: var(--ink); pointer-events: none; } .lbl-b { font-weight: 700; }
.conn { fill: none; stroke: color-mix(in srgb, var(--ink) 28%, var(--bg)); stroke-width: 1.6; } .conn.changed { stroke: var(--hyp); stroke-dasharray: 8 4; stroke-width: 2; }
.edge { fill: none; }
.toggle { fill: var(--panel); stroke: var(--line); } .toggle-t { font-size: 12px; fill: var(--ink); pointer-events: none; font-weight: 700; }
.ghost { opacity: .6; pointer-events: none; }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 18px; max-width: min(720px, 94vw); width: 100%; background: var(--bg); color: var(--ink); }
dialog::backdrop { background: rgba(4,4,4,.45); }
table { border-collapse: collapse; width: 100%; font-size: 13px; } th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 6px; vertical-align: top; }

@media (max-width: 1100px) { .search { max-width: 220px; } .scn-select { max-width: 190px; } }
@media (max-width: 760px) {
  .top { padding: 4px 10px; } .brand small, .who > span { display: none; }
  .toolbar { padding: 6px 8px; gap: 6px; } .seg button { padding: 6px 9px; font-size: 13px; } .top .views { order: 3; flex-basis: 100%; } .search { order: 9; flex-basis: 100%; max-width: none; }
  .scn-select { max-width: 150px; } .banner { font-size: 12px; } .toolbar .lg, .toolbar .fit-all { display: none; } .toolbar .sm { display: inline; }
  .env { font-size: 10px; padding: 2px 6px; } .top .who { gap: 6px; }
  .right { top: auto; height: 62%; width: 100%; border-left: 0; border-top: 1px solid var(--line); transform: translateY(102%); }
  .changes { max-height: 62%; } .legend { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top .who, .toolbar, .drawer, .zoom, .banner .row { display: none !important; } #app { height: auto; } .main { height: 85vh; } }

/* editing: people as circles, departments as drop targets, dialogs and notices (no browser pop-ups) */
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px 4px 6px; min-height: 32px; font-size: 12.5px; font-weight: 600; user-select: none; touch-action: none; }
.chip.on { border-color: var(--sel); } .chip.proposed { border-style: dashed; border-color: var(--warn); } .chip.drop, .pool.drop { outline: 3px solid var(--sel); outline-offset: 1px; }
.chip.person { cursor: grab; }
.cog { width: 14px; height: 14px; border-radius: 3px; display: inline-block; clip-path: polygon(50% 0, 61% 18%, 82% 10%, 82% 32%, 100% 39%, 88% 57%, 100% 75%, 79% 80%, 75% 100%, 57% 91%, 40% 100%, 33% 81%, 12% 82%, 15% 61%, 0 50%, 14% 36%, 6% 16%, 27% 16%, 33% 0); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.cog.big, .dot.big { width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px; }
.pool { border-radius: 10px; padding: 2px 4px 4px; } .pool.empty h2 { margin-bottom: 2px; }
.person-chip { cursor: grab; } .pdot { stroke: var(--bg); stroke-width: 2; } .pini { font-size: 8px; font-weight: 700; fill: #fff; pointer-events: none; }
.person-chip.drop .pdot { stroke: var(--sel); stroke-width: 3; }
[data-key^="position:"].drop .card { stroke: var(--sel); stroke-width: 3; }
[data-key^="unit:"].drop path { stroke: var(--sel); stroke-width: 4; }
.cogp.proposed { stroke: var(--warn); stroke-width: 2.5; stroke-dasharray: 5 3; } .cogp.removal { stroke: var(--bad); stroke-width: 2; stroke-dasharray: 3 3; }
body.dragging, body.dragging * { cursor: grabbing !important; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1.5px solid var(--sel); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 12.5px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.form-dlg { max-width: min(520px, 94vw); } .form-dlg h3 { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; } .field label { font-weight: 600; font-size: 13px; } .field .muted { margin: 0; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.facts { margin: 6px 0 4px; padding-left: 18px; font-size: 13px; } .facts li { margin: 3px 0; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger-outline { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast span { flex: 1; } .toast .link { color: inherit; font-weight: 700; padding: 0 2px; } .toast .x { text-decoration: none; font-size: 16px; line-height: 1; }
.toast.error { background: var(--bad); color: #fff; } .toast.info { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }

/* Step 3.1: change record */
.change-record { margin-top: 14px; } .change-record table.events { font-size: 12px; } .change-record .ok-line { color: #166534; font-weight: 600; }
@media (prefers-color-scheme: dark) { .change-record .ok-line { color: #4ade80; } }
dialog[aria-label="Version history"] { max-width: min(1100px, 96vw); max-height: 88vh; overflow: auto; }

/* Shenkin Map (29 Oct): design system for the map. Colour = department; line style = evidence; size = headcount. */
.cog-hub { fill: rgba(0,0,0,.24); pointer-events: none; }
.cog-n { font-size: 21px; font-weight: 800; fill: #fff; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.25); stroke-width: 2px; }
.cog-name { font-size: 20px; font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.cog-sub { font-size: 13.5px; fill: var(--muted); pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.cogp.unknown { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 3; }
.cog-spin { transform-box: fill-box; transform-origin: center; }
.cog-spin.on { animation: cog-turn linear infinite; } @keyframes cog-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cog-spin.on { animation: none; } }
.app-chip { fill: var(--bg); stroke: color-mix(in srgb, var(--ink) 30%, var(--bg)); stroke-width: 1.4; }
.app-chip.org { fill: color-mix(in srgb, var(--ink) 6%, var(--bg)); stroke: var(--ink); stroke-width: 1.8; }
.app-name { font-size: 14.5px; font-weight: 700; fill: var(--ink); pointer-events: none; } .app-sub { font-size: 12px; fill: var(--muted); pointer-events: none; }
.fn-name { font-size: 13.5px; fill: var(--ink); opacity: .85; pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.cluster-bg { fill: color-mix(in srgb, var(--ink) 3.5%, transparent); stroke: color-mix(in srgb, var(--ink) 16%, transparent); stroke-width: 1.5; stroke-dasharray: 2 6; }
.cluster-lbl { font-size: 16px; font-weight: 700; letter-spacing: .02em; fill: var(--ink); opacity: .7; } .cluster-sub { font-size: 13px; fill: var(--muted); }
.medge { fill: none; stroke-linecap: round; } .medge.fn { stroke-width: 1.3; } .medge.fa { stroke-width: 1.1; } .medge.use { stroke-width: 1.6; } .medge.rel { stroke-width: 2.8; }
.medge.hot { stroke-width: 3; } .medge.rel.hot { stroke-width: 4; } .medge[tabindex] { cursor: pointer; } .medge:focus-visible { outline: none; stroke: var(--sel) !important; }
.node { transition: opacity .2s ease; } @media (prefers-reduced-motion: reduce) { .node { transition: none; } }
.menu-items.layers { min-width: 280px; } .menu-h { margin: 6px 10px 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.menu-items .tgl { text-align: left; background: none; border: 0; border-radius: 6px; padding: 7px 10px 7px 32px; min-height: 34px; font-weight: 600; position: relative; }
.menu-items .tgl::before { content: ''; position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 1.5px solid var(--ink); border-radius: 3px; }
.menu-items .tgl[aria-pressed="true"]::before { background: var(--ink); box-shadow: inset 0 0 0 2px var(--bg); }
.menu-items .tgl:hover, .menu-items .tgl:focus-visible { background: var(--panel); }
.legend .synthetic { display: block; color: #92400e; background: #fef3c7; border-radius: 6px; padding: 6px 8px; font-weight: 600; max-width: 380px; }
.toolbar .seg.lens button { padding: 5px 11px; min-height: 32px; font-size: 13px; }
/* Shenkin Map visual encoding (29 Oct): compact layout, size metric, flow arrows, encoding legend */
.cluster-bg { stroke-linejoin: round; }
.cogp.nodata { stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 6 4; fill-opacity: .45; }
.flow-arrow { stroke: #fff; stroke-width: 1.2; paint-order: stroke; }
.menu-items .tgl.radio::before { border-radius: 50%; }
.menu-items .tgl.radio[aria-checked="true"]::before { background: var(--ink); box-shadow: inset 0 0 0 3px var(--bg); }
.legend { max-width: 380px; max-height: calc(100% - 20px); overflow: auto; }
.legend details.enc { margin-bottom: 4px; }
.legend details.enc summary { font-weight: 700; }
.legend .enc-row { display: grid; grid-template-columns: 96px 1fr; column-gap: 8px; align-items: start; margin: 5px 0; line-height: 1.35; }
.legend .enc-row b { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding-top: 1px; }
.legend .enc-row .enc-meta { grid-column: 2; color: var(--muted); font-size: 11px; }
@media (max-width: 760px) { .legend { display: block; max-width: calc(100% - 90px); } .legend details.lg { display: none; } }
@media (max-width: 760px) { .legend:not(:has(details.enc)) { display: none; } }
.motion-ctl { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.motion-ctl:empty { display: none; } .motion-ctl .btn { background: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.12); } .motion-ctl .muted { font-size: 11px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.legend { max-width: 330px; } .legend .enc-row { grid-template-columns: 74px 1fr; margin: 3px 0; font-size: 12px; line-height: 1.3; }
.legend .enc-row b { font-size: 9.5px; } .legend .enc-row small { color: var(--muted); font-size: 10.5px; }
.legend .synthetic { max-width: 330px; font-size: 11.5px; }
/* Shenkin Matrix Demo Mode (29 Oct 2026): unmistakable banner */
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 7px 16px; background: var(--navy); color: #fff; }   /* 30 Oct: deep navy (was brown) */
.demo-banner strong { letter-spacing: .04em; }
.demo-banner .demo-note { flex: 1 1 260px; font-size: 13px; }
.demo-banner .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); text-decoration: none; } .demo-banner .btn:hover { background: rgba(255,255,255,.12); }
.demo-banner strong { font-size: 12.5px; } .demo-banner .demo-note { opacity: .82; }
.demo-flag { display: inline-block; padding: 4px 10px; background: #7c2d12; color: #fff; font-weight: 700; letter-spacing: .04em; border-radius: 4px; }

/* 30 Oct redesign, phase 1: progressive disclosure (details on hover, selection or keyboard focus), hover preview, Network nodes */
.cog-sub, .app-sub { opacity: 0; transition: opacity .15s; }
.node:hover .cog-sub, .node.sel .cog-sub, .node:focus-visible .cog-sub, svg.activity .cog-sub, .node:hover .app-sub, .node.sel .app-sub, .node:focus-visible .app-sub { opacity: 1; }
.cluster-sub { display: none; }
svg.previewing .node:not(.pv) { opacity: .22; } svg.previewing .medge:not(.pv), svg.previewing .edge:not(.pv) { opacity: .05; }
svg.previewing .medge.pv, svg.previewing .edge.pv { opacity: 1; stroke-width: 3px; }
.net-name { font-size: calc(20px * var(--ls, 1)); font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.edge { fill: none; stroke-linecap: round; } .edge.hot { stroke-width: 3px; }
.recover { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 3; background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 18px rgba(11,31,58,.25); }
.recover[hidden] { display: none; }

/* ======================================================================================================================
   Shenkin Matrix design system (30 Oct 2026, local preview). One set of tokens for Organisation, Shenkin Map and Network.
   Type: Helvetica Neue (house face) on a 4-step scale. Space: 4-px grid. Colour: navy text, Shenkin blue for interaction,
   orange only for selection, red only for verified risks. Depth: one hairline and one soft shadow, never decoration.
   ====================================================================================================================== */
:root { --fs-xs: 11px; --fs-sm: 12px; --fs-md: 13px; --fs-lg: 15px; --fs-xl: 18px;
  --ink: #0b1f3a; --muted: #5d6b7e; --line: #e2e6ec; --line-strong: #cfd6df; --bg: #fff; --panel: #fbfcfd; --canvas: #f4f6f9; --card: #fff;
  --hover: #eef2f7; --brand-soft: #e8efff; --conn: #b9c2ce; --shadow: 0 1px 2px rgba(11,31,58,.06), 0 4px 14px rgba(11,31,58,.06); }
@media (prefers-color-scheme: dark) { :root { --ink: #e8edf4; --muted: #9aa6b6; --line: #273142; --line-strong: #334056; --bg: #0f1520; --panel: #131b28; --canvas: #0c111a;
  --card: #17202e; --hover: #1c2636; --brand-soft: #16264a; --conn: #3a4658; --brand: #6d9bff; } }
html, body { font: var(--fs-md)/1.45 'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; font-feature-settings: 'tnum'; }

/* header: brand, view tabs, environment, account */
.top { padding: 0 16px; min-height: 48px; gap: 4px 20px; background: var(--bg); }
.brand { font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0; color: var(--ink); } .brand small { font-size: 10px; letter-spacing: .16em; margin-top: 1px; }
.top .seg { border: 0; border-radius: 0; gap: 4px; align-self: stretch; }
.top .seg button { min-height: 48px; padding: 0 12px; border-radius: 0; font-size: var(--fs-md); color: var(--muted); box-shadow: inset 0 -2px 0 transparent; }
.top .seg button:hover { color: var(--ink); } .top .seg button[aria-pressed="true"] { background: none; color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.env { font-size: 10.5px; letter-spacing: .06em; padding: 3px 8px; background: var(--brand-soft); }
.who { font-size: var(--fs-sm); } .link { color: var(--brand); text-decoration: none; font-weight: 600; } .link:hover { text-decoration: underline; }

/* buttons: primary (blue), secondary (ghost, no border until hover), destructive (red text) */
.btn { border: 1px solid var(--line-strong); border-radius: 6px; min-height: 32px; padding: 5px 12px; font-size: var(--fs-md); font-weight: 600; color: var(--ink); background: var(--bg); transition: background .12s, border-color .12s; }
.btn:hover:not([disabled]) { background: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover:not([disabled]) { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.primary[disabled] { background: var(--hover); border-color: var(--line); color: var(--muted); opacity: 1; }
.btn.danger-outline { border-color: transparent; color: var(--bad); } .btn.danger-outline:hover { background: color-mix(in srgb, var(--bad) 8%, var(--bg)) !important; }

/* toolbar: scenario | edit | search ............ panels · export · fit */
.toolbar { padding: 6px 12px; gap: 6px 4px; border-bottom: 1px solid var(--line); }
.toolbar .grp { gap: 2px; padding: 0 8px; } .toolbar .grp + .grp, .toolbar .grp + .search { border-left: 1px solid var(--line); }
.toolbar .grp:first-child { padding-left: 0; }
.toolbar .btn:not(.primary), .toolbar .menu > summary.btn { border-color: transparent; background: none; min-height: 32px; padding: 4px 10px; color: var(--ink); }
.toolbar .btn:not(.primary):hover, .toolbar .menu > summary.btn:hover, .toolbar .menu[open] > summary.btn { background: var(--hover); }
.toolbar .btn.tog.on { border-color: transparent; background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.toolbar .btn.icon { font-size: 16px; color: var(--muted); }
.toolbar .grp.end { margin-left: auto; border-left: 0; }
.scn-select { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; font-weight: 600; font-size: var(--fs-md); }
.search { margin: 0 8px; flex: 1 1 200px; max-width: 360px; }
.search .input { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%235d6b7e' stroke-width='1.6'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='M9.5 9.5L13 13'/%3E%3C/svg%3E") no-repeat 9px 50%; padding-left: 30px; }
.search .input:focus { background-color: var(--bg); border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.menu-items, .search-results { border-radius: 8px; border-color: var(--line); box-shadow: 0 12px 32px rgba(11,31,58,.14); }
.menu-items button { font-weight: 500; font-size: var(--fs-md); }
.toolbar .seg.lens { border: 1px solid var(--line); border-radius: 6px; padding: 2px; }
.toolbar .seg.lens button { min-height: 26px; border-radius: 4px; padding: 2px 10px; font-size: var(--fs-sm); }
.toolbar .seg.lens button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }

/* status strips: demonstration (navy, one line) and scenario (quiet) */
.demo-banner { padding: 5px 16px; gap: 6px 14px; min-height: 36px; }
.demo-banner strong { font-size: 11px; letter-spacing: .1em; } .demo-banner .demo-note { font-size: var(--fs-sm); opacity: .78; }
.demo-banner .btn { min-height: 26px; padding: 2px 10px; font-size: var(--fs-sm); border-radius: 5px; border-color: rgba(255,255,255,.35); }
.banner { font-size: var(--fs-sm); padding: 6px 16px; color: var(--muted); }
.banner.scn { border-left: 0; box-shadow: inset 3px 0 0 var(--brand); background: color-mix(in srgb, var(--brand) 4%, var(--bg)); }
.banner b, .banner strong { color: var(--ink); }

/* canvas: a quiet surface with a faint dot grid, so white cards read as objects */
.canvas { background: var(--canvas) radial-gradient(circle, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px; }
.zoom { gap: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.zoom button { width: 36px; height: 36px; border: 0; border-radius: 0; background: none; color: var(--ink); font-weight: 500; font-size: 16px; }
.zoom button + button { border-top: 1px solid var(--line); } .zoom button:hover { background: var(--hover); }
.legend { background: color-mix(in srgb, var(--bg) 96%, transparent); border-color: var(--line); border-radius: 8px; box-shadow: var(--shadow); font-size: var(--fs-sm); }
.legend summary { font-size: var(--fs-sm); color: var(--ink); }

/* organisation cards */
.card { fill: var(--card); stroke: var(--line-strong); stroke-width: 1; transition: stroke .12s; }
.card-shadow { fill: rgba(11,31,58,.07); pointer-events: none; }
.node:hover .card:not(.proposed):not(.removal):not(.changed):not(.drop) { stroke: color-mix(in srgb, var(--brand) 55%, var(--line-strong)); }
.t1 { font-size: 13px; font-weight: 600; fill: var(--ink); letter-spacing: -.005em; } .t2 { font-size: var(--fs-sm); fill: var(--muted); opacity: 1; } .t3 { font-size: var(--fs-xs); fill: color-mix(in srgb, var(--muted) 80%, var(--bg)); }
.conn { stroke: var(--conn); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.toggle { fill: var(--card); stroke: var(--line-strong); } .toggle-t { font-size: 12px; font-weight: 600; fill: var(--muted); }
[data-toggle]:hover .toggle { stroke: var(--brand); } [data-toggle]:hover .toggle-t { fill: var(--brand); }
.pini { font-size: 8.5px; letter-spacing: .02em; }
.node.sel .sel-ring { stroke-width: 2.5; }

/* inspector: identity, relationships, evidence, then grouped scenario actions */
.right { width: min(400px, 94vw); background: var(--bg); padding: 0 20px 20px; box-shadow: -1px 0 0 var(--line), -12px 0 32px rgba(11,31,58,.08); border-left: 0; }
.drawer-head { top: 0; background: var(--bg); padding: 12px 0 8px; margin-bottom: 2px; }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.btn.close { border-color: transparent; background: none; color: var(--muted); width: 32px; }
.right h3 { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 0 0 2px; }
.right h3 + .muted { margin-top: 0; }
.right h2 { font-size: 10.5px; letter-spacing: .12em; color: var(--muted); margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.right .kv { grid-template-columns: 104px 1fr; gap: 6px 12px; margin: 14px 0 4px; font-size: var(--fs-md); } .right .kv dt { color: var(--muted); font-size: var(--fs-sm); padding-top: 1px; }
.right .kv .link { padding: 0; text-align: left; }
.right .list li { margin: 4px 0; font-size: var(--fs-md); }
.right .list button.item { border-color: var(--line); border-radius: 6px; padding: 7px 10px; font-size: var(--fs-md); } .right .list button.item:hover { background: var(--hover); }
.right .box.edit { margin: 20px 0 8px; padding: 14px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.right .box.edit > b { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.right .box.edit .row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.right .box.edit .btn { text-align: left; border-color: var(--line); font-weight: 500; padding: 6px 10px; min-height: 34px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right .box.edit .btn:first-child { background: var(--brand-soft); border-color: transparent; color: var(--brand); font-weight: 600; }
.right .box.edit .btn.danger-outline { grid-column: 1 / -1; margin-top: 4px; }
.right p.muted:last-child { font-size: var(--fs-sm); margin-top: 18px; color: var(--muted); }
.badge { font-size: 9.5px; letter-spacing: .06em; padding: 1px 6px; border: 0; background: color-mix(in srgb, currentColor 11%, transparent); vertical-align: 1px; }
/* Release A (30 Oct 2026): relationship categories, condensed demonstration indicator and scenario status, Focus mode */
:root { --cat-flow: #1d4ed8; --cat-struct: #0b1f3a; }
@media (prefers-color-scheme: dark) { :root { --cat-flow: #60a5fa; --cat-struct: #cbd5e1; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nedge { fill: none; stroke-linecap: round; } .nedge.rel { cursor: pointer; } .nedge.selected { stroke-width: 3.2px; }
svg.previewing .nedge:not(.pv) { opacity: .06; } svg.previewing .nedge.pv { opacity: 1; }
/* the demonstration indicator: one small pill; its panel holds the full disclosure and the two actions */
.demo-ind { position: relative; display: block; padding: 0; background: none; color: inherit; }
.demo-ind > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 11px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .05em; white-space: nowrap; }
.demo-ind > summary::-webkit-details-marker { display: none; }
.demo-ind > summary .dot { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; }
.demo-ind .demo-panel { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(360px, 88vw); background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.2)); }
.demo-ind .demo-panel strong { display: block; font-size: var(--fs-sm); letter-spacing: .04em; } .demo-ind .demo-note { margin: 6px 0 10px; font-size: var(--fs-md); opacity: .88; line-height: 1.4; }
.demo-ind .row { display: flex; flex-wrap: wrap; gap: 8px; }
.who-wrap { margin-left: auto; display: flex; align-items: center; }
.who-menu > summary.avatar { list-style: none; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft, #e8efff); color: var(--brand); font-size: var(--fs-xs); font-weight: 700; }
.who-menu > summary::-webkit-details-marker { display: none; } .who-menu .menu-items { right: 0; left: auto; min-width: 180px; } .who-menu .menu-items .link { text-align: left; padding: 6px 4px; }
/* the scenario status sits beside the selector: name · version · Saved */
.status-slot { display: inline-flex; min-width: 0; }
.toolbar .banner { padding: 0 4px; border: 0; background: none; font-size: var(--fs-sm); color: var(--muted); max-width: 300px; }
.toolbar .banner.scn { border-left: 0; } .toolbar .banner b { color: var(--ink); font-weight: 600; }
.toolbar .banner .saved { color: #15803d; } .toolbar .banner .unsaved { color: var(--warn); font-weight: 600; }
@media (prefers-color-scheme: dark) { .toolbar .banner .saved { color: #4ade80; } }
/* Focus mode: the canvas, the views, the indicator and a compact details panel */
.exit-focus { display: none; position: absolute; top: 10px; left: 10px; z-index: 5; }
#app.focus-mode .toolbar, #app.focus-mode .legend, #app.focus-mode .edge-hint { display: none !important; }
#app.focus-mode .exit-focus { display: inline-flex; }
#app.focus-mode .right { width: min(320px, 94vw); }
@media (max-width: 760px) { .demo-ind > summary { font-size: 10px; padding: 2px 8px; } .toolbar .banner { max-width: 160px; } }
/* print keeps the scenario status and its full statement (the rest of the toolbar is hidden) */
@media print { #app .toolbar { display: block !important; border: 0; } .toolbar > :not(.grp:first-child), .toolbar > .grp:first-child > :not(.status-slot) { display: none !important; }
  .toolbar .banner { max-width: none; white-space: normal; } .toolbar .banner .sr-only { position: static; width: auto; height: auto; margin: 0; clip: auto; white-space: normal; } }
.toolbar .banner, .toolbar .banner.scn { border: 0 !important; background: none !important; padding: 0 2px; }
#app.focus-mode #focus-mode { box-shadow: inset 0 -3px 0 var(--sel); }
.app-sub.on { opacity: 1; }
.toolbar .banner.scn { box-shadow: none; }
/* merged from ui/map-consolidation (30 Oct): readable labels, motion text, five-view toolbar (its slim demonstration strip is superseded by the Release A indicator) */
/* 30 Oct: Network Intelligence legibility. Secondary links (application and function links) are a clearly visible neutral line;
   stated relationships keep their evidence colour; a selected or previewed link shows its evidence colour. Labels never render
   below a readable size (--ls grows as the view is zoomed out). */
:root { --edge-2: #8a94a3; } @media (prefers-color-scheme: dark) { :root { --edge-2: #7d8899; } }
.edge.light:not(.hot):not(.pv) { stroke: var(--edge-2) !important; }
.fn-name { font-size: calc(16.5px * var(--ls, 1)); opacity: 1; stroke-linejoin: round; }
.app-name.net { font-size: calc(16.5px * var(--ls, 1)); } .app-sub.net { font-size: calc(14.5px * var(--ls, 1)); opacity: 1; }
.flow-rm { font-size: 13px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.cog-sub.net { font-size: calc(14px * var(--ls, 1)); opacity: 1; }

/* 30 Oct (consolidation): five Map views fit on one toolbar line at 1280 px and wider */
.seg.lens button { padding: 7px 9px; }
@media (max-width: 1600px) { .toolbar .grp .lg { display: none; } .toolbar .grp .sm { display: inline; } .search { min-width: 120px; } }   /* “People” instead of “People & departments” */

.toolbar .viewctl { margin-left: auto; flex-wrap: nowrap; }
.cog-sub { font-size: calc(13px * var(--ls, 1)); }
@media (max-width: 760px) { .toolbar .viewctl { margin-left: 0; flex-wrap: wrap; max-width: 100%; min-width: 0; } .toolbar .viewctl .seg { flex-wrap: wrap; } }
/* unified (30 Oct): calculated analysis markers are navy (red is reserved for verified risks) */
.mark-cut-lbl { font-size: calc(12px * var(--ls, 1)); font-weight: 700; letter-spacing: .04em; fill: var(--cat-struct); paint-order: stroke; stroke: var(--canvas); stroke-width: 4px; stroke-linejoin: round; }
.medge { fill: none; stroke-linecap: round; } .medge.selected { stroke-width: 3.2px; }
svg.previewing .medge:not(.pv), svg.previewing .edge:not(.pv) { opacity: .2; }   /* unified: hover keeps ~20% context too */
/* relationship inspector (unified, 30 Oct) */
.rel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px; } .rel-head .rel-arrow { color: var(--brand); font-weight: 600; }
.rel-kind { margin: 2px 0 10px; font-size: var(--fs-md); font-weight: 600; }
.rchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.rchip { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--ink); }
.rchip.syn { background: #fef3c7; color: #92400e; } .rchip.none { color: var(--muted); }
@media (prefers-color-scheme: dark) { .rchip.syn { background: #3b2a06; color: #fcd34d; } }
.rel-note { font-size: var(--fs-md); line-height: 1.45; margin: 0 0 4px; }
.rel-tech { margin-top: 16px; font-size: var(--fs-sm); } .rel-tech summary { cursor: pointer; color: var(--muted); font-weight: 600; }
/* unified (30 Oct): the Map's five views as one floating segmented control at the top of the canvas */
.lens-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 4; }
.lens-bar:empty { display: none; }
.lens-bar .seg.lens { display: inline-flex; gap: 2px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px; box-shadow: var(--shadow); }
.lens-bar .seg.lens button { min-height: 30px; border: 0; border-radius: 6px; padding: 4px 12px; font-size: var(--fs-md); font-weight: 600; color: var(--muted); background: none; }
.lens-bar .seg.lens button:hover { color: var(--ink); background: var(--hover); }
.lens-bar .seg.lens button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand); }
.main:has(.right.open) .lens-bar { left: calc(50% - 200px); }
@media (max-width: 760px) { .lens-bar { top: 8px; max-width: calc(100% - 16px); overflow-x: auto; } .main:has(.right.open) .lens-bar { left: 50%; } }
.lens-bar:not(:empty) ~ .recover { top: 58px; }
.right .kv .link { display: inline-block; min-height: 24px; padding: 3px 0; }   /* WCAG 2.2 target size (24 px) for the people listed in the details */

/* 30 Oct (embedded, E1 + A1; unified 31 Oct): inside the Betable dashboard the Matrix drops its own brand and sign-out; the views,
   Feedback and the demonstration indicator stay. The dashboard owns the page header, navigation and sign-out. */
body.embedded .top .brand, body.embedded .top .who button:last-child, body.embedded .who-menu .menu-items .link:last-child { display: none; }
body.embedded .top { padding-top: 4px; padding-bottom: 4px; }
.embedded-gate h1 { font-size: 20px; }
/* 31 Oct (embedded): the frame's own page never hands an overscroll on to the dashboard (Chromium, Firefox, Safari 16+); a panel or
   menu that reaches its end stops there. Paired with the wheel / pinch containment in app.js. */
html.embedded, html.embedded body { overscroll-behavior: none; }
html.embedded .drawer, html.embedded .menu-items, html.embedded dialog, html.embedded .search-results { overscroll-behavior: contain; }
/* WebKit (measured 31 Oct): after a panel SLIDES in (transform transition), a wheel over it is never given to this page and goes
   straight to the dashboard behind the frame, so inside the frame the panels appear without the slide. */
html.embedded .drawer { transition: none; }
