/* /explorer/assets/css/authority-graph.css — D32b-impl-1
 *
 * Authority Graph lens-specific styling. Namespaced under
 * .authority-graph-* / .authority-connector-* / .authority-badge-*
 * so existing Context Graph classes are not affected.
 *
 * Intentionally minimal — the Authority lens reuses the same
 * .gmap-node card visual treatment as the Context lens; only
 * connector colours and a small set of authority-specific badges
 * are introduced.
 *
 * Diagnostics + surface_posture panel styling is deferred to
 * D32b-impl-2.
 */

/* Loading / empty / error overlay --------------------------------------
 * Mirrors the Context lens overlay shape (full-canvas, centred copy)
 * so users see consistent treatment across lenses.
 */
.authority-graph-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}
.authority-graph-overlay-inner {
  max-width: 480px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--surface-2, rgba(20, 24, 32, 0.92));
  color: var(--text-1, #e8ecf2);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  pointer-events: auto;
}
.authority-graph-overlay-error .authority-graph-overlay-inner {
  border-left: 4px solid var(--danger, #e35a5a);
}
.authority-graph-overlay-empty .authority-graph-overlay-inner {
  border-left: 4px solid var(--muted, #6b7383);
}

/* Connectors -----------------------------------------------------------
 * One class per edge kind. The visible <path> and the hit-target
 * <path> share the class; the renderer assigns the .gmap-connector
 * geometry class so default stroke widths still apply.
 *
 * D32g-fix-1 — Every authority connector explicitly sets fill: none.
 * Without it, the SVG default (fill: black) paints the curved area
 * the C-bezier `d` attribute encloses as a solid black band — the
 * "large black artefact" symptom that masked node cards. The
 * stroke-width + opacity match the Context Graph connector classes
 * (1.6–1.8, opacity 0.85–0.95) so visual weight stays consistent
 * across both lenses.
 */
.authority-connector,
[class*="authority-connector-"] {
  fill: none;
  stroke-width: 1.6;
  opacity: 0.85;
}
.authority-connector-business_service_has_surface {
  fill: none;
  stroke: var(--authority-conn-surface, #6da3ff);
  stroke-width: 1.6;
  opacity: 0.85;
}
.authority-connector-surface_uses_profile {
  fill: none;
  stroke: var(--authority-conn-profile, #8b7fff);
  stroke-width: 1.6;
  opacity: 0.85;
}
.authority-connector-profile_has_grant {
  fill: none;
  stroke: var(--authority-conn-grant, #ac9bff);
  stroke-width: 1.6;
  opacity: 0.85;
}
.authority-connector-grant_authorises_agent {
  fill: none;
  stroke: var(--authority-conn-agent, #c79bff);
  stroke-width: 1.6;
  opacity: 0.85;
}
.authority-connector-surface_has_fail_mode_policy,
.authority-connector-business_service_has_fail_mode_policy {
  fill: none;
  stroke: var(--authority-conn-fmp, #ffb86b);
  stroke-width: 1.6;
  stroke-dasharray: 4 4;
  opacity: 0.85;
}
.authority-connector-profile_escalates_to {
  fill: none;
  stroke: var(--authority-conn-escalation, #ff7e9b);
  stroke-width: 1.6;
  stroke-dasharray: 6 3;
  opacity: 0.85;
}

/* Badges --------------------------------------------------------------- */
.authority-badge-validity-valid    { background: var(--badge-good, #1d6b3f); color: #fff; }
.authority-badge-validity-invalid  { background: var(--badge-bad,  #8a1f1f); color: #fff; }
.authority-badge-validity-pending  { background: var(--badge-warn, #8a601f); color: #fff; }
.authority-badge-opstate-active        { background: var(--badge-good, #1d6b3f); color: #fff; }
.authority-badge-opstate-deprecated    { background: var(--badge-warn, #8a601f); color: #fff; }
.authority-badge-opstate-retired       { background: var(--badge-muted, #495163); color: #fff; }
.authority-badge-fmp-override          { background: var(--badge-info, #1c5278); color: #fff; }
.authority-badge-fmp-inherited         { background: var(--badge-muted, #495163); color: #fff; }
.authority-badge-fmp-origin-imported   { background: var(--badge-info, #1c5278); color: #fff; }
.authority-badge-fmp-origin-defined    { background: var(--badge-muted, #495163); color: #fff; }

/* D32b-impl-2 — Service Workbench mode toolbar -------------------------
 * The three-button toolbar (Form View | Context Graph | Authority Graph)
 * lives in .services-map-view-header. It piggy-backs the existing
 * .graph-lens-switcher / .graph-lens-button styling so the visual
 * treatment lands automatically; the .service-workbench-mode class is
 * a namespacing hook for tests and any D32b-impl-3 customisation.
 */
.service-workbench-modes {
  display: inline-flex;
  gap: 4px;
}
.service-workbench-mode {
  /* Inherit default button visuals from .graph-lens-button when both
   * classes are present; .service-workbench-mode alone (Form View)
   * uses neutral defaults consistent with the segmented control. */
}

/* D32b-impl-3 — Icon-only Service Workbench mode toolbar.
 * The icon variant of the mode buttons takes its visual treatment
 * from the bottom-right canvas controls (.gmap-mode-rail /
 * .gmap-camera-cluster buttons): fixed compact bounding box, centred
 * inline SVG icon, currentColor stroke so :hover / .is-active recolours
 * the glyph. Accessible name lives on aria-label + title.
 */
.service-workbench-icon-modes {
  align-items: center;
  margin: 0 4px;
}
.service-workbench-icon-mode {
  width: 28px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2, #c4ccd6);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 100ms ease, color 100ms ease, border-color 100ms ease;
}
.service-workbench-icon-mode:hover,
.service-workbench-icon-mode:focus-visible {
  background: var(--surface-3, rgba(255, 255, 255, 0.06));
  color: var(--text-1, #e8ecf2);
  outline: none;
}
.service-workbench-icon-mode:focus-visible {
  border-color: var(--focus, #6da3ff);
}
.service-workbench-icon-mode.is-active {
  background: var(--surface-3, rgba(255, 255, 255, 0.08));
  color: var(--text-1, #e8ecf2);
  border-color: var(--border-muted, rgba(255, 255, 255, 0.16));
}

/* D32b-impl-3 — Authority drawer sections.
 * The diagnostics + posture panel modules render into data-*
 * containers injected by the Authority drawer provider into the
 * existing drawer panel mounts. The .authority-drawer-section class
 * provides matching spacing to the .gmap-details-section convention
 * used by the Context inspector so both lenses look uniform inside
 * the right rail.
 */
.authority-drawer-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-muted, rgba(255, 255, 255, 0.08));
}
.authority-drawer-section:last-child {
  border-bottom: none;
}

/* D32b-impl-2 / D32b-impl-3 — Authority Graph panels.
 * The previous floating overlay (.authority-graph-panels) was removed
 * in D32b-impl-3. Authority diagnostics + surface posture now render
 * inside the unified right-side graph drawer (#gmap-details). The
 * panel chrome inherits .gmap-right-rail styling; per-section
 * dividers come from .authority-drawer-section (declared above).
 */

/* Diagnostic summary panel */
.authority-diagnostics-summary-title,
.authority-diagnostics-list-title,
.authority-posture-title {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text-2, #c4ccd6);
}
.authority-diagnostics-summary-rows {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 12px;
  row-gap: 4px;
}
.authority-diagnostics-summary-row {
  display: contents;
}
.authority-diagnostics-summary-key {
  color: var(--text-2, #c4ccd6);
}
.authority-diagnostics-summary-val {
  font-weight: 600;
}
.authority-diagnostics-summary-empty,
.authority-diagnostics-list-empty,
.authority-posture-empty {
  color: var(--text-3, #93a0b0);
  font-style: italic;
}
.authority-diagnostics-summary-bykind {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-muted, rgba(255, 255, 255, 0.08));
}
.authority-diagnostics-summary-bykind-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-2, #c4ccd6);
}
.authority-diagnostics-summary-bykind-row {
  display: flex;
  justify-content: space-between;
}

/* Severity colour tokens */
.authority-diagnostics-severity-none     { color: var(--text-3, #93a0b0); }
.authority-diagnostics-severity-info     { color: var(--badge-info, #6da3ff); }
.authority-diagnostics-severity-warning  { color: var(--badge-warn, #ffb86b); }
.authority-diagnostics-severity-critical { color: var(--badge-bad,  #ff7e9b); }

/* Diagnostics list */
.authority-diagnostics-list-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.authority-diagnostics-row {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--surface-2, rgba(20, 24, 32, 0.7));
}
.authority-diagnostics-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.authority-diagnostics-row-severity {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.authority-diagnostics-row-kind {
  font-size: 11px;
  color: var(--text-2, #c4ccd6);
}
.authority-diagnostics-row-msg {
  margin-top: 4px;
  color: var(--text-1, #e8ecf2);
}
.authority-diagnostics-row-refs {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.authority-diagnostics-row-ref {
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-3, rgba(255, 255, 255, 0.06));
  font-size: 11px;
}

/* Surface posture panel */
.authority-posture-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.authority-posture-row {
  text-align: left;
  width: 100%;
  appearance: none;
  border: 1px solid var(--border-muted, rgba(255, 255, 255, 0.08));
  background: var(--surface-2, rgba(20, 24, 32, 0.7));
  color: inherit;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.authority-posture-row:hover,
.authority-posture-row:focus-visible {
  background: var(--surface-3, rgba(255, 255, 255, 0.06));
  outline: 2px solid var(--focus, #6da3ff);
  outline-offset: 1px;
}
.authority-posture-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.authority-posture-row-surface {
  font-weight: 600;
  word-break: break-all;
}
.authority-posture-row-severity {
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.authority-posture-row-axes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.authority-posture-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--surface-3, rgba(255, 255, 255, 0.06));
  font-size: 11px;
}
.authority-posture-chip-key {
  font-weight: 600;
  color: var(--text-2, #c4ccd6);
}
.authority-posture-row-paths {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-2, #c4ccd6);
}
.authority-posture-row-diagkinds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.authority-posture-row-diagkind {
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-3, rgba(255, 255, 255, 0.06));
  font-size: 11px;
  color: var(--text-2, #c4ccd6);
}

/* ============================================================================
 * D32f-impl-1 + D32g-fix-1 + D32g-fix-2 — Authority Graph overlays.
 *
 * D32g-fix-2 corrective pass:
 *   • The full-width Authority canvas toolbar introduced by D32g-fix-1
 *     is REMOVED. Authority lens reuses the existing graph shell chrome
 *     (graph header + #gmap-layers-button + right-side drawer) — no
 *     mode-specific second menu bar.
 *   • Layers control is the EXISTING #gmap-layers-button. The overlays
 *     module installs a capture-phase click interceptor so the click
 *     opens the shared drawer's Posture & Help tab in Authority mode
 *     instead of the Context-only .gmap-layers-panel.
 *   • All risk / gap counts live inside the shared drawer's Diagnostics
 *     + Posture & Help tabs. No canvas-overlay pill row.
 *   • Diagnostic markers, posture badges, connector fill-fix, and
 *     layer-hide CSS rules are unchanged from D32g-fix-1.
 *
 * Visual contract preserved:
 *   - Diagnostic severity (critical > warning > info) still readable.
 *   - Surface posture badges still indicate gaps.
 *   - Layer-hide CSS rules unchanged so contract tests pin them.
 * ============================================================================
 */

/* Hide the legacy Context-Graph bottom-centre connector legend when
   the operator is in Authority lens. Authority has its own legend in
   the shared drawer's Posture & Help tab. */
body[data-graph-lens="authority"] .gmap-legend-overlay {
  display: none;
}

/* ── Summary pills ─────────────────────────────────────────────────────
 * Shared between the compact toolbar (high-priority only) and the
 * drawer's Summary section (full set).
 */
.authority-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 10px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--surface-3, rgba(255, 255, 255, 0.08));
  color: var(--text-1, #e6ebf2);
  line-height: 1.4;
  white-space: nowrap;
}
.authority-summary-pill-label {
  color: var(--text-2, #c4ccd6);
}
.authority-summary-pill-count {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-1, #e6ebf2);
}
.authority-summary-pill-gap {
  border-color: rgba(232, 87, 87, 0.5);
  background: rgba(232, 87, 87, 0.08);
}
.authority-summary-pill-gap .authority-summary-pill-count { color: #ffb3b3; }
.authority-summary-pill-emphasis {
  border-color: rgba(245, 200, 90, 0.45);
  background: rgba(245, 200, 90, 0.08);
}
.authority-summary-pill-critical {
  border-color: rgba(232, 87, 87, 0.6);
  background: rgba(232, 87, 87, 0.10);
}
.authority-summary-pill-critical .authority-summary-pill-count { color: #ffb3b3; }
.authority-summary-pill-warning {
  border-color: rgba(245, 200, 90, 0.55);
  background: rgba(245, 200, 90, 0.10);
}
.authority-summary-pill-warning .authority-summary-pill-count { color: #ffdb88; }
.authority-summary-pill-info {
  border-color: rgba(110, 180, 255, 0.4);
  background: rgba(110, 180, 255, 0.08);
}

/* ── Layer chips (drawer-only) ─────────────────────────────────────────── */
.authority-graph-layer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--surface-3, rgba(255, 255, 255, 0.08));
  cursor: pointer;
  user-select: none;
}
.authority-graph-layer-chip input[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}
.authority-graph-layer-chip-input { margin: 0; }
.authority-graph-layer-chip-label { color: var(--text-1, #e6ebf2); }

/* ── Drawer-only sections (Posture & Help tab) ─────────────────────────── */
.authority-drawer-section {
  margin: 0 0 12px 0;
  padding: 0;
}
.authority-drawer-section + .authority-drawer-section {
  border-top: 1px solid var(--surface-3, rgba(255, 255, 255, 0.06));
  padding-top: 10px;
}
.authority-drawer-section-title {
  margin: 0 0 6px 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2, #c4ccd6);
  font-weight: 600;
}
.authority-drawer-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.authority-drawer-layer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.authority-drawer-help-intro {
  font-size: 11px;
  color: var(--text-2, #c4ccd6);
  margin-bottom: 8px;
  line-height: 1.45;
}
.authority-drawer-legend-columns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.authority-drawer-legend-column h4 {
  margin: 0 0 4px 0;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2, #c4ccd6);
  font-weight: 600;
}
.authority-drawer-empty {
  font-size: 11px;
  color: var(--text-2, #c4ccd6);
  font-style: italic;
}

/* ── Legend list (used inside drawer) ──────────────────────────────────── */
.authority-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.authority-legend-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.authority-legend-swatch {
  width: 14px;
  height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.authority-legend-swatch-node {
  background: var(--surface-3, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--text-2, rgba(196, 204, 214, 0.4));
}
.authority-legend-swatch-edge {
  background: var(--text-2, rgba(196, 204, 214, 0.45));
  height: 2px;
  border-radius: 1px;
}
.authority-legend-swatch-severity[data-diagnostic-severity="critical"] { background: #e85757; }
.authority-legend-swatch-severity[data-diagnostic-severity="warning"]  { background: #f5c85a; }
.authority-legend-swatch-severity[data-diagnostic-severity="info"]     { background: #6eb4ff; }
.authority-legend-swatch-posture[data-fmp-status="override"]  { background: #a574e8; }
.authority-legend-swatch-posture[data-fmp-status="inherited"] { background: var(--text-2, #c4ccd6); }
.authority-legend-swatch-posture[data-fmp-status="missing"]   { background: #e85757; }
.authority-legend-swatch-posture[data-fmp-status="dangling"]  { background: transparent; border: 1px solid #e85757; }

/* ── Diagnostic severity marker on node cards ──────────────────────────
 *
 * D32g-fix-1 — Subtler treatment. The pre-fix box-shadow ring of
 * 0 0 0 2px <colour> + 0 0 12px <halo> made warning nodes look
 * selected. Replace with a left-edge accent stripe + small corner
 * dot. Critical gets a thicker accent; warning gets a thinner one;
 * info uses only the corner dot. The selected-node treatment
 * (separate styling on .gmap-node.selected) keeps its own ring so
 * the operator can always tell which node is selected.
 */
.gmap-node[data-diagnostic-severity] {
  position: relative;
}
.gmap-node[data-diagnostic-severity]::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  pointer-events: none;
}
.gmap-node[data-diagnostic-severity="critical"]::before {
  background: #e85757;
  box-shadow: 0 0 4px rgba(232, 87, 87, 0.4);
}
.gmap-node[data-diagnostic-severity="warning"]::before {
  background: #f5c85a;
}
.gmap-node[data-diagnostic-severity="info"]::before {
  background: rgba(110, 180, 255, 0.65);
  top: 8px;
  bottom: 8px;
  width: 2px;
}
/* Tiny corner dot for critical only — operator-eye attractor at the
   top-right of the card. Warning + info rely on the left accent. */
.gmap-node[data-diagnostic-severity="critical"]::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e85757;
  pointer-events: none;
}

/* ── Posture badges on node cards (rendered via spec.badges in addNode) ──
 *
 * D32g-fix-1 — Shorter labels + subtler colours. The pre-fix
 * "FMP MISSING" / "agent blocked" / "no profile" badges were bright
 * red filled rectangles that repeated loudly on the canvas. The
 * shortened labels are emitted in JS; the styles here pair muted
 * fills with coloured outlines so the badges read as compact tags
 * rather than alarms.
 */
.gmap-badge.authority-badge-posture-dangling {
  background: rgba(232, 87, 87, 0.08);
  color: #ffb3b3;
  border: 1px solid rgba(232, 87, 87, 0.6);
}
.gmap-badge.authority-badge-posture-missing {
  background: rgba(232, 87, 87, 0.10);
  color: #ffc8c8;
  border: 1px solid rgba(232, 87, 87, 0.5);
}
.gmap-badge.authority-badge-posture-blocked {
  background: rgba(232, 87, 87, 0.12);
  color: #ffcaca;
  border: 1px solid rgba(232, 87, 87, 0.55);
  font-weight: 500;
}
.gmap-badge.authority-badge-posture-no-profile,
.gmap-badge.authority-badge-posture-no-grant {
  background: rgba(245, 200, 90, 0.08);
  color: #ffdb88;
  border: 1px solid rgba(245, 200, 90, 0.45);
}
.gmap-badge.authority-badge-fmp-override {
  background: rgba(165, 116, 232, 0.10);
  color: #d4baff;
  border: 1px solid rgba(165, 116, 232, 0.4);
}
.gmap-badge.authority-badge-fmp-inherited {
  background: rgba(196, 204, 214, 0.08);
  color: var(--text-2, #c4ccd6);
  border: 1px solid rgba(196, 204, 214, 0.25);
}
.gmap-badge.authority-badge-fmp-missing {
  background: rgba(232, 87, 87, 0.08);
  color: #ffb3b3;
  border: 1px solid rgba(232, 87, 87, 0.5);
}

/* ── Inspector subsections (Diagnostics + Posture) ──────────────────────── */
.authority-inspector-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--surface-3, rgba(255, 255, 255, 0.06));
}
.authority-inspector-section-title {
  margin: 0 0 4px 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2, #c4ccd6);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.authority-inspector-diagnostics-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.authority-inspector-diagnostic {
  display: flex;
  flex-direction: column;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--surface-2, rgba(255, 255, 255, 0.04));
  border-left: 3px solid var(--text-2, #c4ccd6);
}
.authority-inspector-diagnostic-critical { border-left-color: #e85757; }
.authority-inspector-diagnostic-warning  { border-left-color: #f5c85a; }
.authority-inspector-diagnostic-info     { border-left-color: #6eb4ff; }
.authority-inspector-diagnostic-severity {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.authority-inspector-diagnostic-severity[data-diagnostic-severity="critical"] { color: #e85757; }
.authority-inspector-diagnostic-severity[data-diagnostic-severity="warning"]  { color: #f5c85a; }
.authority-inspector-diagnostic-severity[data-diagnostic-severity="info"]     { color: #6eb4ff; }
.authority-inspector-diagnostic-kind {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: var(--text-2, #c4ccd6);
}
.authority-inspector-diagnostic-message {
  margin-top: 2px;
  color: var(--text-1, #e6ebf2);
  font-size: 11px;
}

.authority-inspector-posture {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.authority-inspector-posture-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}
.authority-inspector-posture-key {
  color: var(--text-2, #c4ccd6);
}
.authority-inspector-posture-val {
  color: var(--text-1, #e6ebf2);
  font-weight: 500;
}
.authority-inspector-posture-val[data-posture-axis="fail-mode-policy"][data-posture-value="dangling"],
.authority-inspector-posture-val[data-posture-axis="fail-mode-policy"][data-posture-value="missing"],
.authority-inspector-posture-val[data-posture-axis="agent-status"][data-posture-value="blocked"],
.authority-inspector-posture-val[data-posture-axis="profile-status"][data-posture-value="missing"],
.authority-inspector-posture-val[data-posture-axis="grant-status"][data-posture-value="missing"] {
  color: #ffb3b3;
  font-weight: 600;
}

/* ── Layer-hide rules ───────────────────────────────────────────────────
 * Each chip's "off" state adds the corresponding class to the toolbar's
 * parent (the .governance-map-body wrapper or whatever holds gmap-canvas).
 * The class names are pinned by the overlays module's _layerClassFor
 * helper and by the D32f Explorer contract tests. */
.authority-layer-diagnostics-off .gmap-node[data-diagnostic-severity] {
  box-shadow: none;
}
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-posture-dangling,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-posture-missing,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-posture-blocked,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-posture-no-profile,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-posture-no-grant,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-fmp-override,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-fmp-inherited,
.authority-layer-surface-posture-off .gmap-node[data-projection-kind="decision_surface"] .gmap-badge.authority-badge-fmp-missing {
  display: none;
}
.authority-layer-escalation-off .gmap-node[data-projection-kind="escalation_target"],
.authority-layer-escalation-off .authority-connector-profile_escalates_to {
  display: none;
}
.authority-layer-fail-mode-off .gmap-node[data-projection-kind="fail_mode_policy"],
.authority-layer-fail-mode-off .authority-connector-surface_has_fail_mode_policy,
.authority-layer-fail-mode-off .authority-connector-business_service_has_fail_mode_policy {
  display: none;
}

/* ── D32h-fix-1 — Lens-aware bottom workbench routing ───────────────────
 * The Authority Graph and the Context Graph share the vertical column
 * beneath .governance-map-workbench. Each lens owns its own bottom
 * workbench element:
 *   • #gmap-evidence-tray         — Context: existing Drift Analytics
 *   • #gmap-authority-workbench   — Authority Workbench (this tranche)
 * The active lens is surfaced as body[data-graph-lens] by the existing
 * inline workbench code; we route visibility from that single
 * attribute so Context behaviour is unchanged and the modules never
 * have to coordinate visibility imperatively. */
body[data-graph-lens="authority"] #gmap-evidence-tray {
  display: none;
}
body[data-graph-lens="authority"] #gmap-authority-workbench {
  display: flex;
}
body[data-graph-lens="context"] #gmap-authority-workbench {
  display: none;
}

/* ── D32h-fix-1 — Authority Workbench shell ─────────────────────────────
 * Mirrors .gmap-evidence-tray's geometry so the column reserved for the
 * bottom workbench is identical regardless of lens — switching lenses
 * does not reflow the canvas. */
/* D32h-fix-2d-converge — Height-driven collapse model matching
 * Context's evidence tray contract (governance-map.css:1246-1265).
 * Collapsed state shows only the 36px header bar (overflow hidden
 * clips the body). Expanded state grows to 320px. Animates `height`
 * (not `max-height`) so the visible affordance follows the
 * `.is-expanded` class toggle. The previous `min-height: 36px;
 * max-height: 280px; transition: max-height …` form let content
 * drive the rendered height — collapse was a no-op visually, which
 * was the root cause of the operator-reported "workbench has no
 * close control" and "defaults open" defects. Convergence tracked
 * in docs/analysis/D32h-fix-2d-parity-letterbox-divergence.md. */
.gmap-authority-workbench {
  flex-direction: column;
  background: var(--surface-container-low);
  border-top: 1px solid var(--outline-variant);
  color: var(--on-surface);
  height: 36px;
  overflow: hidden;
  transition: height 0.18s ease-out;
}
/* D32h-fix-2d — The previous `.gmap-authority-workbench[hidden] {
 * display: none !important; }` rule has been deleted. Its
 * `!important` was silently overriding the lens-aware reveal at
 * body[data-graph-lens="authority"] #gmap-authority-workbench
 * (display: flex), leaving the workbench permanently invisible at
 * runtime even when the Authority lens was active. The lens-aware
 * rules at lines 782-790 above cover both lens states through
 * normal specificity, and the HTML `hidden` attribute's UA default
 * (display: none) handles the no-lens-set boot fallback.
 * Regression-guarded by
 * TestExplorer_D32hFix2d_AuthorityWorkbenchNotHiddenByImportantOverride. */
.gmap-authority-workbench.is-expanded {
  height: 320px;
}
/* D32h-fix-2d-converge — Header chrome aligned with Context tray
 * (governance-map.css:1266-1342). Explicit height:36px+flex-shrink:0
 * keeps the header visible when the workbench is collapsed to 36px.
 * Padding and font-family match Context. Title styling switches to
 * uppercase eyebrow form (11px, 700, 0.08em, --slate-300) so the
 * two lenses' letterbox chrome are visually indistinguishable apart
 * from the lens-specific subtitle content. */
.gmap-authority-workbench-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  height: 36px;
  flex-shrink: 0;
  background: var(--surface-container-lowest);
  border-bottom: 1px solid var(--outline-variant);
  font-family: var(--font-display);
}
.gmap-authority-workbench-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-300);
}
.gmap-authority-workbench-subtitle {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--slate-400);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gmap-authority-workbench-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  background: var(--surface-container-low);
  border: 1px solid var(--outline-variant);
  border-radius: 4px;
  color: var(--slate-400);
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.gmap-authority-workbench-toggle:hover {
  background: var(--surface-container);
  color: var(--on-surface);
}
.gmap-authority-workbench-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
/* D32h-fix-2d-converge — Body / tabs / panel chrome aligned with
 * Context tray (governance-map.css:1345-1368). Body gets explicit
 * flex:1 1 auto + min-height:0 so it expands within the height-driven
 * collapse model. Tab strip gets the Material surface-container-lowest
 * background so the active tab's surface-container-low background
 * reads as a raised tab on a deeper surface. */
.gmap-authority-workbench-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gmap-authority-workbench-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 14px 0;
  border-bottom: 1px solid var(--outline-variant);
  background: var(--surface-container-lowest);
  flex: 0 0 auto;
}
.gmap-authority-workbench-tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--slate-400);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  cursor: pointer;
}
.gmap-authority-workbench-tab:hover {
  color: var(--on-surface);
}
.gmap-authority-workbench-tab.is-active {
  color: var(--on-surface);
  background: var(--surface-container-low);
  border-color: var(--outline-variant);
}
.gmap-authority-workbench-panel {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 16px 16px;
}

/* D32h-fix-2d-converge — Panel-content token migration. Shell-chrome
 * concerns (background, border, text) move to the defined Material
 * Design tokens used by Context's tray + tokens.css. Severity / status
 * colours move to the `--badge-bad/warn/info` convention-with-fallback
 * tokens used by drift-analytics.css and the broader Explorer (so a
 * future theme-aware badge palette catches Authority alongside Drift).
 * The translucent rgba background overlays on the per-severity
 * diagnostic-severity badges are preserved intentionally — they are
 * brand-tinted overlays of the badge text colour, not theme-bound
 * surfaces. */
.authority-workbench-section {
  margin-bottom: 12px;
}
.authority-workbench-section:last-child {
  margin-bottom: 0;
}
.authority-workbench-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  margin: 0 0 6px;
}
.authority-workbench-section-context {
  font-size: 11px;
  color: var(--slate-400);
  margin: 0 0 6px;
  font-style: italic;
}
.authority-workbench-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 4px 16px;
}
.authority-workbench-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--outline-variant);
}
.authority-workbench-stat-label {
  color: var(--slate-400);
}
.authority-workbench-stat-value {
  color: var(--on-surface);
  font-weight: 600;
}
.authority-workbench-stat-emphasis .authority-workbench-stat-value {
  color: var(--badge-warn, #fbbf24);
}
.authority-workbench-stat-gap .authority-workbench-stat-value {
  color: var(--badge-bad, #f87171);
}
.authority-workbench-stat-critical .authority-workbench-stat-value {
  color: var(--badge-bad, #ef4444);
}
.authority-workbench-stat-warning .authority-workbench-stat-value {
  color: var(--badge-warn, #f59e0b);
}
.authority-workbench-stat-info .authority-workbench-stat-value {
  color: var(--badge-info, #60a5fa);
}
.authority-workbench-empty {
  font-size: 12px;
  color: var(--slate-400);
  padding: 8px 0;
  font-style: italic;
}
.authority-workbench-diagnostics {
  list-style: none;
  margin: 0;
  padding: 0;
}
.authority-workbench-diagnostic {
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dotted var(--outline-variant);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.authority-workbench-diagnostic-severity {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-container);
}
.authority-workbench-diagnostic-critical .authority-workbench-diagnostic-severity {
  color: var(--badge-bad, #ef4444);
  background: rgba(239,68,68,0.12);
}
.authority-workbench-diagnostic-warning .authority-workbench-diagnostic-severity {
  color: var(--badge-warn, #f59e0b);
  background: rgba(245,158,11,0.12);
}
.authority-workbench-diagnostic-info .authority-workbench-diagnostic-severity {
  color: var(--badge-info, #60a5fa);
  background: rgba(96,165,250,0.12);
}
.authority-workbench-diagnostic-kind {
  color: var(--on-surface);
  font-weight: 600;
}
.authority-workbench-diagnostic-message {
  color: var(--slate-400);
}
