:root {
  --paper: #f7f4ee;       /* Anthropic warm cream */
  --paper2: #fdfcf9;
  --ink: #1a1a17;
  --ink2: #3d3a34;
  --muted: #6b6558;
  --faint: #938c7d;
  --line: #e3ddd0;
  --line2: #d4ccbb;
  --clay: #c96442;        /* Anthropic coral/clay accent */
  --clay-soft: #e9d5cc;
  --rust: #b5432f;
  --olive: #5B8C5A;
  --gold: #c9a227;
  --slate: #3E7CB1;
  --panel: #fbf9f4;
  --shadow: 0 1px 2px rgba(60,50,30,.05), 0 8px 24px rgba(60,50,30,.06);
  /* category accents for group-by chips (PCE-pattern, Anthropic-tinted) */
  --cat-loc: #8a6d4b;     /* Locations */
  --cat-env: #5B8C5A;     /* Environments */
  --cat-app: #3E7CB1;     /* Applications */
  --cat-role: #a25a8e;    /* Roles */
  --cat-tenant: #c96442;  /* Tenant */
  --tooltip-bg: #26231d;
  --shadow-lg: 0 6px 24px rgba(40,30,15,.18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  display: flex; flex-direction: column; height: 100vh; overflow: hidden;
}
h1,h2,h3,h4 { font-family: "Fraunces", Georgia, serif; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.mono { font-family: "Roboto Mono", monospace; font-size: 11.5px; }
button { font-family: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 10px 18px; background: var(--paper2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand-mark { color: var(--clay); font-size: 16px; }
.brand-name { font-family: "Fraunces", serif; font-size: 16px; font-weight: 600; }
.brand-sub { color: var(--faint); font-size: 11.5px; }
.run-meta { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.run-meta .rm { display: flex; flex-direction: column; line-height: 1.25; }
.run-meta .rm .k { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.run-meta .rm .v { font-family: "Roboto Mono", monospace; font-size: 12px; color: var(--ink); }
.run-meta .fresh { display: flex; align-items: center; gap: 5px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--olive); }
.dot.stale { background: var(--gold); } .dot.dead { background: var(--rust); }
/* nav = PCE underline-tab pattern, Anthropic-styled */
.view-nav { display: flex; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.view-nav button { border: none; background: none; padding: 5px 13px; border-radius: 6px; color: var(--muted); font-size: 12.5px; }
.view-nav button.on { background: var(--paper2); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- transport ---------- */
.transport { display: flex; align-items: center; gap: 8px; padding: 7px 18px; background: var(--paper2); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.transport button { border: 1px solid var(--line2); background: var(--paper2); border-radius: 7px; padding: 5px 11px; font-size: 12px; color: var(--ink2); display: inline-flex; align-items: center; gap: 5px; }
.transport button:hover { border-color: var(--clay); color: var(--clay); }
.transport button.primary { background: var(--clay); color: #fff; border-color: var(--clay); }
.transport button.primary:hover { filter: brightness(1.05); color: #fff; }
.transport .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.transport .tlabel { color: var(--faint); font-size: 11px; }
.transport .scrubwrap { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.transport input[type=range] { accent-color: var(--clay); }

/* ---------- workspace grid ---------- */
.workspace { display: grid; grid-template-columns: 268px 1fr 320px; flex: 1; min-height: 0; }
.page { flex: 1; overflow: auto; padding: 20px 28px; }
.left, .right { overflow-y: auto; background: var(--panel); }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
.center { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--paper); }

/* ---------- left panel ---------- */
.panel-sec { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.panel-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 9px; font-family: "Inter", sans-serif; font-weight: 600; }
.tree { font-size: 12.5px; }
.tree-node { padding: 3px 6px; border-radius: 6px; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.tree-node:hover { background: var(--paper); }
.tree-node.sel { background: var(--clay-soft); }
.tree-node .swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.tree-node.lvl1 { padding-left: 16px; } .tree-node.lvl2 { padding-left: 30px; font-size: 12px; color: var(--ink2); }
.tree-node .count { margin-left: auto; color: var(--faint); font-size: 10.5px; }
.field { margin-bottom: 9px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.field select, .field input[type=text] { width: 100%; padding: 5px 8px; border: 1px solid var(--line2); border-radius: 7px; background: var(--paper2); font-size: 12px; color: var(--ink); font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--line2); background: var(--paper2); color: var(--ink2); cursor: pointer; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ctl-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ctl-row label { flex: 1; font-size: 11.5px; color: var(--ink2); }
.ctl-row input[type=range] { flex: 1.3; accent-color: var(--clay); }
.ctl-row .num { width: 34px; text-align: right; font-family: "Roboto Mono", monospace; font-size: 11.5px; }
.units { color: var(--faint); font-size: 10px; }

/* ---------- graph ---------- */
.graph-head { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); background: var(--paper2); flex-wrap: wrap; }
.seg { display: flex; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: none; background: none; padding: 4px 11px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--paper2); color: var(--ink); box-shadow: var(--shadow); }
.graph-head .ov-label { color: var(--faint); font-size: 11px; margin-left: 6px; }
/* group-by chip row (PCE-pattern, top of graph) */
.groupby { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--paper2); flex-wrap: wrap; }
.groupby .gb-label { color: var(--muted); font-size: 11.5px; }
.gb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--line2); border-radius: 18px; background: var(--paper2); font-size: 11.5px; color: var(--ink2); }
.gb-chip .gb-ic { width: 15px; height: 15px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; }
.gb-chip .gb-x { color: var(--faint); cursor: pointer; font-size: 13px; line-height: 1; }
.gb-chip .gb-x:hover { color: var(--rust); }
.gb-chip.off { opacity: .4; }
.graph-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.graph { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; user-select: none; }
.graph.panning { cursor: grabbing; }
.platform-label { text-anchor: middle; }
.lane-label { font-family: "Inter", sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.node-label { font-size: 10.5px; fill: var(--ink); text-anchor: middle; font-weight: 500; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.node-sub { font-size: 9.5px; fill: var(--faint); text-anchor: middle; font-family: "Roboto Mono", monospace; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.node-sub.side { text-anchor: start; }
.node-sub.side-l { text-anchor: end; }
.node-sub.hot { fill: var(--rust); font-weight: 600; }
.edge-x { font-size: 9px; fill: var(--rust); text-anchor: middle; font-weight: 600; paint-order: stroke; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.edge-cap { font-size: 8.5px; fill: var(--ink2); font-family: "Roboto Mono", monospace; font-weight: 500; }
/* graph toolbar (PCE left vertical rail pattern) */
.graph-toolbar { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.graph-toolbar button { width: 30px; height: 30px; border: 1px solid var(--line2); background: var(--paper2); border-radius: 7px; color: var(--clay); font-size: 13px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.graph-toolbar button:hover { background: var(--clay-soft); }
.graph-toolbar button[aria-pressed="true"] { background: var(--clay); border-color: var(--clay); color: var(--paper2); }
.graph-toolbar button.dirty { border-color: var(--clay); }
.graph-legend.is-hidden { display: none; }
/* full-screen map (toolbar \2921): side panels, transport and bottom dock give way */
body.map-full .transport, body.map-full .left, body.map-full .right, body.map-full .bottom { display: none; }
body.map-full .workspace { grid-template-columns: 1fr; margin-bottom: 30px; } /* clear the fixed read-only bar */
/* legend is a static strip below the graph — never overlaps nodes */
.graph-legend { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 7px 16px; border-top: 1px solid var(--line); background: var(--paper2); font-size: 10.5px; }
.graph-legend .lg-row { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.graph-legend .sw { width: 9px; height: 9px; border-radius: 2px; }
.graph-legend .lg-title { font-weight: 600; margin-right: 2px; }

/* hovercard = PCE dark detail-tooltip pattern, Anthropic-tinted */
.hovercard { position: absolute; pointer-events: none; background: var(--tooltip-bg); color: #efe9dc; border: none; border-radius: 10px; padding: 11px 13px; box-shadow: var(--shadow-lg); width: 218px; opacity: 0; transition: opacity .1s; z-index: 20; }
.hovercard.show { opacity: 1; }
.hovercard .hc-title { font-weight: 600; font-size: 12.5px; color: #fff; }
.hovercard .hc-type { color: #a89e8c; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.hovercard .hc-metrics { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin: 7px 0; font-size: 11.5px; }
.hovercard .hc-metrics .m-k { color: #a89e8c; }
.hovercard .hc-metrics .m-v { text-align: right; font-family: "Roboto Mono", monospace; color: #fff; }
.hovercard .units { color: #97907f; }

/* ---------- inspector ---------- */
.inspector-empty { padding: 30px 18px; color: var(--faint); font-size: 12.5px; text-align: center; }
.insp-head { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.insp-head .ih-type { color: var(--clay); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.insp-head h2 { font-size: 17px; margin: 2px 0; }
.insp-head .ih-owner { color: var(--muted); font-size: 11.5px; }
.insp-tabs { display: flex; gap: 2px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); }
.insp-tabs button { border: none; background: none; padding: 5px 10px; font-size: 11.5px; color: var(--muted); border-bottom: 2px solid transparent; }
.insp-tabs button.on { color: var(--ink); border-bottom-color: var(--clay); }
.insp-body { padding: 13px 15px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.metric { background: var(--paper2); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
.metric .mk { color: var(--muted); font-size: 10.5px; }
.metric .mv { font-family: "Roboto Mono", monospace; font-size: 16px; color: var(--ink); }
.metric .mv.hot { color: var(--rust); }
.insp-block { margin-bottom: 16px; }
.insp-block h4 { font-family: "Inter", sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv .k { color: var(--muted); } .kv .v { font-family: "Roboto Mono", monospace; }

/* chips/badges */
.badge { font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 500; }
.b-allow { background: #e0ebe0; color: #3d6b3c; }
.b-deny { background: #f3dcd6; color: var(--rust); }
.b-pending { background: #f6ecd0; color: #8a6d16; }
.b-active { background: #e0ebe0; color: #3d6b3c; }
.b-drain { background: #f6ecd0; color: #8a6d16; }

/* charts */
.chart, .spark { display: block; }
.chart .axis, svg .axis { font-size: 8px; fill: var(--faint); font-family: "Roboto Mono", monospace; }
.chart-card { background: var(--paper2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.chart-card h4 { font-family: "Inter", sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; font-weight: 600; display: flex; justify-content: space-between; }
.barrows { display: flex; flex-direction: column; gap: 4px; }
.barrow { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 8px; font-size: 11px; }
.barlabel { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bartrack { background: var(--line); height: 7px; border-radius: 4px; overflow: hidden; }
.barfill { display: block; height: 100%; border-radius: 4px; }
.barval { text-align: right; font-family: "Roboto Mono", monospace; color: var(--muted); }
.stackbar-track { display: flex; height: 16px; border-radius: 5px; overflow: hidden; background: var(--line); }
.stackseg { height: 100%; }
.stackseg.free { background: repeating-linear-gradient(45deg, #efe9dc, #efe9dc 4px, #e7e0d0 4px, #e7e0d0 8px); }
.stackleg { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.stackleg i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 3px; vertical-align: -1px; }
.stackleg i.freei { background: #e7e0d0; }

/* bottom dock */
.bottom { height: 172px; border-top: 1px solid var(--line); background: var(--panel); display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 0; }
.dock-cell { padding: 10px 14px; border-right: 1px solid var(--line); overflow: hidden; }
.dock-cell:last-child { border-right: none; overflow-y: auto; }
.dock-cell h4 { font-family: "Inter", sans-serif; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.timeline-item { font-size: 11px; padding: 3px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; }
.timeline-item .tt { font-family: "Roboto Mono", monospace; color: var(--faint); font-size: 10px; flex: none; }
.timeline-item .tk { width: 4px; border-radius: 2px; flex: none; }
.tk-policy { background: var(--slate); } .tk-cap { background: var(--clay); } .tk-fault { background: var(--rust); }
.tk-run { background: var(--olive); } .tk-reshuffle { background: var(--gold); } .tk-layout { background: var(--faint); }

/* counters strip (performance) */
.counters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.counter { background: var(--paper2); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.counter .ck { color: var(--muted); font-size: 11px; }
.counter .cv { font-family: "Fraunces", serif; font-size: 24px; margin: 2px 0; }
.counter .cu { color: var(--faint); font-size: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.section-title { font-size: 18px; margin: 18px 0 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0 14px; max-width: 720px; }

/* rule list */
.rule-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper2); margin-bottom: 7px; }
.rule-item .ri-main { flex: 1; min-width: 0; }
.rule-item .ri-sel { font-size: 12px; }
.rule-item .ri-meta { color: var(--faint); font-size: 10.5px; }
.switch { position: relative; width: 34px; height: 19px; border-radius: 20px; background: var(--line2); border: none; transition: background .15s; flex: none; }
.switch.on { background: var(--olive); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on::after { left: 17px; }

/* decision trace */
.trace-flow { display: flex; flex-direction: column; gap: 0; }
.trace-step { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; position: relative; }
.trace-step .ts-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--olive); margin-top: 3px; flex: none; z-index: 1; }
.trace-step.fail .ts-dot { background: var(--rust); }
.trace-step:not(:last-child)::before { content:""; position: absolute; left: 4px; top: 16px; bottom: -6px; width: 2px; background: var(--line2); }
.trace-step .ts-body { flex: 1; }
.trace-step .ts-name { font-size: 12px; font-weight: 500; }
.trace-step .ts-detail { font-size: 11px; color: var(--muted); }
.reason-pill { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; }
.reason-pill.deny { background: var(--rust); color: #fff; } .reason-pill.allow { background: var(--olive); color: #fff; }

table.cmp { width: 100%; border-collapse: collapse; font-size: 12px; }
table.cmp th, table.cmp td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.cmp th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
table.cmp td.num { font-family: "Roboto Mono", monospace; text-align: right; }
.win { color: var(--olive); font-weight: 600; }

.card { background: var(--paper2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.btn { border: 1px solid var(--line2); background: var(--paper2); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: var(--ink2); }
.btn:hover { border-color: var(--clay); color: var(--clay); }
.btn.sm { padding: 3px 9px; font-size: 11px; }
.split { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* entity hyperlink + status dot (PCE-pattern, Anthropic-tinted) */
.elink { color: var(--slate); font-weight: 500; cursor: pointer; text-decoration: none; }
.elink:hover { text-decoration: underline; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.status-online { background: var(--olive); }

/* ---------- help anchors ---------- */
.help-anchor { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--line2); background: var(--paper2); color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1; padding: 0; cursor: pointer; vertical-align: 1px; margin-left: 4px; }
.help-anchor:hover { border-color: var(--clay); color: var(--clay); background: var(--clay-soft); }
.help-return-flash { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 6px; transition: outline .2s; }

/* ---------- docs drawer ---------- */
.docs-scrim { position: fixed; inset: 0; background: rgba(40,30,15,.28); opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 60; }
.docs-scrim.open { opacity: 1; pointer-events: auto; }
.docs-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 460px; max-width: 92vw; background: var(--paper2); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .2s ease; z-index: 61; display: flex; flex-direction: column; }
.docs-drawer.open { transform: translateX(0); }
.docs-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.docs-title { font-family: "Fraunces", serif; font-size: 17px; font-weight: 600; }
.docs-close { margin-left: auto; border: none; background: none; font-size: 15px; color: var(--muted); cursor: pointer; }
.docs-close:hover { color: var(--clay); }
.docs-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.docs-nav button { border: 1px solid var(--line2); background: var(--paper2); border-radius: 16px; padding: 3px 10px; font-size: 11px; color: var(--ink2); cursor: pointer; }
.docs-nav button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.docs-body { padding: 18px 20px; overflow-y: auto; font-size: 13.5px; line-height: 1.6; }
.docs-body h3 { font-family: "Fraunces", serif; font-size: 18px; margin-bottom: 10px; }
.docs-body ul { padding-left: 18px; } .docs-body li { margin: 4px 0; }
.docs-body code { font-family: "Roboto Mono", monospace; font-size: 12px; background: var(--paper); padding: 1px 5px; border-radius: 4px; }
.docs-body a { color: var(--clay); }
.doc-live { margin-top: 12px; padding: 9px 12px; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--olive); border-radius: 6px; font-size: 12.5px; color: var(--ink2); }
.docs-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- token gate ---------- */
body.locked .workspace, body.locked .bottom, body.locked .transport, body.locked .page, body.locked .view-nav { opacity: .16; pointer-events: none; filter: saturate(.5); }
.token-gate { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(247,244,238,.55); backdrop-filter: blur(2px); z-index: 70; }
.token-gate.show { display: flex; }
.tg-card { background: var(--paper2); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 30px; width: 420px; max-width: 92vw; text-align: center; }
.tg-mark { color: var(--clay); font-size: 26px; }
.tg-card h2 { font-family: "Fraunces", serif; font-size: 20px; margin: 8px 0; }
.tg-sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.tg-row { display: flex; gap: 8px; }
.tg-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--line2); border-radius: 9px; font-size: 14px; font-family: inherit; }
.tg-row input:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.btn.primary { background: var(--clay); color: #fff; border-color: var(--clay); }
.tg-err { color: var(--rust); font-size: 12.5px; min-height: 18px; margin-top: 8px; }
.tg-note { color: var(--faint); font-size: 11px; margin-top: 10px; line-height: 1.5; }
.tg-note code { font-family: "Roboto Mono", monospace; }

/* ---------- action-queue bar ---------- */
.queue-bar { position: fixed; bottom: 0; left: 0; right: 0; height: 30px; background: var(--ink); color: var(--paper); display: flex; align-items: center; gap: 12px; padding: 0 14px; font-size: 11.5px; z-index: 50; }
.queue-bar .qb-label { font-weight: 600; display: inline-flex; align-items: center; }
.queue-bar .help-anchor { border-color: #4a4640; background: transparent; color: #b8ac98; }
.queue-bar .qb-presence { color: var(--olive); }
.queue-bar .qb-items { display: flex; gap: 8px; overflow-x: auto; flex: 1; }
.queue-bar .qb-item { white-space: nowrap; background: #2c2822; border: 1px solid #3d3830; border-radius: 6px; padding: 2px 8px; color: #efe9dc; }
.queue-bar .qb-item b { color: var(--gold); text-transform: capitalize; }
.queue-bar .qb-wm { color: #8a8073; font-family: "Roboto Mono", monospace; }
.queue-bar .units { color: #8a8073; }
/* lift the bottom dock so the queue bar doesn't cover it */
.bottom { margin-bottom: 30px; }

/* ---------- authnz-lab additions: project page links + Live tab ---------- */
.doc-links { display: flex; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.doc-link { padding: 5px 13px; border-radius: 6px; color: var(--muted); font-size: 12.5px; text-decoration: none; }
.doc-link:hover, .doc-link[aria-current="page"] { background: var(--paper2); color: var(--ink); box-shadow: var(--shadow); }
.live-badge { font-size: 10.5px; margin-left: 4px; color: var(--faint); }
.live-badge.live { color: #4d7c5f; }
.live-badge.cached { color: #c9a227; }
.live-badge.unavailable { color: var(--rust); }
.live-status { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 14px; font-size: 13px; }
.live-status .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.live-status.live .live-dot { background: #4d7c5f; }
.live-status.cached .live-dot { background: #c9a227; }
.live-status.unavailable .live-dot { background: var(--rust); }
.live-status .live-error { color: var(--rust); }
.live-grid { max-width: 760px; grid-template-columns: repeat(4, 1fr); }
.live-grid.stale { opacity: .55; }
.live-meta { margin: 6px 0 14px; font-size: 11px; }
.live-parts { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.live-part { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; background: var(--paper2); min-width: 260px; }
.live-part.down { border-color: var(--rust); }
.live-part h4 { margin-bottom: 4px; }
.live-h3 { font-size: 14px; margin: 8px 0; }
.live-table-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--paper2); }
.live-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.live-table th { position: sticky; top: 0; background: var(--paper); text-align: left; font-weight: 600; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line); }
.live-table td { padding: 4px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.live-table tr.busy td { background: #fbf3e6; }
.live-bar { width: 120px; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.live-bar-fill { height: 100%; background: #5B8C5A; }
.live-bar-fill.full { background: #c9a227; }
.live-bar-fill.over { background: var(--rust); }
/* Live tab: process flow (live.js buildFlow); classes only, no inline styles */
.live-grid { max-width: 980px; grid-template-columns: repeat(5, 1fr); }
.live-body.stale { opacity: .55; }
.live-metric .live-sub { margin-top: 1px; font-size: 10px; color: var(--faint); }
.live-flow-wrap { max-width: 1100px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper2); padding: 8px 10px; margin-bottom: 10px; }
.live-flow { width: 100%; height: auto; display: block; }
.lf-node rect { fill: var(--paper); stroke: var(--line2); stroke-width: 1.2; }
.lf-node .lf-title { font-family: "Fraunces", Georgia, serif; font-size: 14px; fill: var(--ink); }
.lf-node .lf-sub { font-size: 10.5px; fill: var(--muted); }
.lf-node .lf-stat { font-family: "Roboto Mono", monospace; font-size: 10.5px; fill: var(--ink2); }
.lf-node.muted .lf-stat { fill: var(--faint); }
.lf-node.down rect { stroke: var(--rust); stroke-width: 2; }
.lf-node.flash rect { stroke: var(--rust); stroke-width: 2.4; fill: #fbeee9; }
.lf-arrowhead { fill: var(--line2); }
.lf-edge .lf-line { fill: none; stroke: var(--line2); stroke-width: 2; }
.lf-edge .lf-dash { fill: none; stroke: var(--olive); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 14; opacity: 0; }
.lf-edge.back .lf-line { stroke-dasharray: 5 4; }
.lf-edge.back .lf-dash { stroke: var(--slate); }
.lf-edge.slow .lf-dash, .lf-edge.med .lf-dash, .lf-edge.fast .lf-dash { opacity: 1; animation: lf-flow 2.4s linear infinite; }
.lf-edge.med .lf-dash { animation-duration: 1.2s; }
.lf-edge.fast .lf-dash { animation-duration: .55s; }
.lf-edge.alert .lf-line { stroke: var(--rust); }
.lf-edge.alert .lf-dash { stroke: var(--rust); }
.lf-edge .lf-rate { font-family: "Roboto Mono", monospace; font-size: 10.5px; fill: var(--ink); }
.lf-edge .lf-total { font-size: 9.5px; fill: var(--muted); }
.lf-edge.idle .lf-rate { fill: var(--faint); }
@keyframes lf-flow { from { stroke-dashoffset: 32; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .lf-edge .lf-dash { animation: none !important; } }
/* Live tab: throughput sparklines and event feed */
.live-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; max-width: 1100px; margin-bottom: 8px; }
.live-sparks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.live-spark { background: var(--paper2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px 5px; }
.live-spark .ls-head { display: flex; justify-content: space-between; align-items: baseline; }
.live-spark .ls-label { font-size: 10.5px; color: var(--muted); }
.live-spark .ls-value { font-family: "Roboto Mono", monospace; font-size: 14px; color: var(--ink); }
.live-spark .ls-svg { width: 100%; height: 44px; display: block; }
.live-spark .ls-line { fill: none; stroke: var(--olive); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.live-spark .ls-area { fill: var(--olive); opacity: .12; }
.live-spark .ls-line.alert { stroke: var(--rust); }
.live-spark .ls-area.alert { fill: var(--rust); }
.live-spark .ls-foot { font-size: 9.5px; color: var(--faint); }
.live-events { max-height: 236px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--paper2); padding: 4px 0; }
.le-row { display: grid; grid-template-columns: 74px 56px 1fr; column-gap: 8px; padding: 3px 10px; font-size: 11.5px; border-bottom: 1px solid var(--line); }
.le-row:last-child { border-bottom: 0; }
.le-row .le-time { color: var(--faint); font-size: 10.5px; }
.le-row .le-kind { font-size: 9.5px; font-weight: 600; letter-spacing: .04em; border-radius: 4px; padding: 1px 5px; text-align: center; align-self: start; background: var(--line); color: var(--ink2); }
.le-row .le-detail { grid-column: 3; color: var(--muted); font-size: 10.5px; }
.le-row.full .le-kind { background: var(--gold); color: #fff; }
.le-row.deny .le-kind { background: var(--rust); color: #fff; }
.le-row.reset .le-kind { background: var(--slate); color: #fff; }
.le-row.warn .le-kind { background: var(--clay-soft); color: var(--rust); }
@media (max-width: 1100px) { .live-row { grid-template-columns: 1fr; } }
/* Live tab: leases per partition and constraint (tiles grouped by tenant) */
.live-heat { max-width: 1100px; margin-bottom: 12px; }
.lh-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 10.5px; margin-bottom: 6px; }
.lh-key { display: inline-flex; gap: 4px; align-items: center; }
.lh-sw { display: inline-block; width: 12px; height: 9px; border-radius: 2px; border: 1px solid var(--line2); }
.lh-group { margin-bottom: 9px; }
.lh-ghead { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 4px; }
.lh-tenant { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.lh-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 5px; }
.lh-tile { border: 1px solid var(--line); border-radius: 7px; padding: 4px 7px 5px; background: var(--paper2); }
.lh-tile.h0 { opacity: .62; }
.lh-tile.hfull, .lh-tile.hover { border-color: var(--rust); }
.lh-name { font-size: 10.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lh-bars { display: grid; gap: 2px; margin-top: 3px; }
.lh-pbar { position: relative; display: grid; grid-template-columns: 20px 1fr 34px; align-items: center; gap: 4px; font-family: "Roboto Mono", monospace; font-size: 9.5px; color: var(--muted); }
.lh-pbar i { display: block; height: 7px; border-radius: 3px; background: var(--olive); grid-column: 2; grid-row: 1; justify-self: start; }
.lh-pbar::before { content: ""; grid-column: 2; grid-row: 1; height: 7px; border-radius: 3px; background: var(--line); }
.lh-pbar .lh-plabel { grid-column: 1; grid-row: 1; }
.lh-pbar .lh-pval { grid-column: 3; grid-row: 1; text-align: right; }
.lh-pbar.h3 i, .lh-sw.h3 { background: var(--gold); }
.lh-pbar.hfull i, .lh-pbar.hover i, .lh-sw.hfull { background: var(--rust); }
.lh-sw.h1, .lh-sw.h2 { background: var(--olive); }
.lh-sw.h1 { opacity: .5; }
.lh-sw.h0 { background: var(--paper2); }
.live-details summary { cursor: pointer; }
.lh-idle { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.lh-chip { font-size: 9.5px; color: var(--faint); border: 1px solid var(--line); border-radius: 10px; padding: 0 7px; background: var(--paper2); white-space: nowrap; }
/* Live tab: agents (roster in the flow box and identity cards) */
.lf-agent .lf-aname { font-family: "Roboto Mono", monospace; font-size: 10px; fill: var(--ink2); }
.lf-agent .lf-asub { font-size: 8.5px; fill: var(--faint); }
.lf-agent .lf-adot { fill: var(--line2); }
.lf-agent.allowed.busy .lf-adot { fill: var(--olive); }
.lf-agent.denied .lf-adot { fill: var(--rust); }
.lf-agent.denied .lf-asub { fill: var(--rust); }
.live-agents { max-width: 1100px; margin-bottom: 12px; }
.la-ids { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 9px; }
.la-id { border: 1px solid var(--line); border-left: 3px solid var(--line2); border-radius: 9px; background: var(--paper2); padding: 8px 12px; }
.la-id.allowed.busy { border-left-color: var(--olive); }
.la-id.denied { border-left-color: var(--rust); }
.la-head { display: flex; gap: 8px; align-items: baseline; }
.la-tag { font-size: 10px; color: var(--muted); }
.la-id.denied .la-tag { color: var(--rust); }
.la-nums { margin: 3px 0 5px; color: var(--ink2); }
.la-w { display: grid; grid-template-columns: 10px 180px 1fr; gap: 6px; align-items: center; font-size: 11px; padding: 1px 0; }
.la-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--olive); }
.la-dot.denied { background: var(--rust); }
.la-note { font-size: 10.5px; margin: 6px 0 0; max-width: 900px; }
