:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #fff;
  --surface-soft: #f7f8fa;
  --ink: #17181a;
  --secondary: #656a73;
  --tertiary: #9298a2;
  --line: #e4e6ea;
  --line-strong: #d4d7dd;
  --blue: #1769e0;
  --blue-deep: #1259bf;
  --blue-soft: #edf4ff;
  --green: #27875d;
  --green-soft: #eaf7f0;
  --amber: #a76712;
  --amber-soft: #fff5e5;
  --red: #b34646;
  --red-soft: #fff0f0;
  --shadow: 0 1px 2px rgba(22, 28, 38, .04), 0 8px 24px rgba(22, 28, 38, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(23, 105, 224, .25); outline-offset: 2px; }

.governance-workspace { display: grid; grid-template-columns: 176px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; display: flex; flex-direction: column; min-width: 0; height: 100vh; padding: 16px 12px; color: #fff; background: #17191e; }
.rail-brand { display: flex; min-height: 42px; align-items: center; gap: 10px; padding: 0 8px; color: #fff; font-size: 13px; font-weight: 750; text-decoration: none; }
.rail-brand-mark { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #2581ff, #1760cf); font-size: 12px; font-weight: 800; box-shadow: 0 7px 18px rgba(23, 105, 224, .28); }
.rail-nav { display: grid; gap: 6px; margin-top: 28px; }
.rail-item { display: flex; width: 100%; min-height: 42px; align-items: center; padding: 0 12px; border-radius: 10px; color: #aeb3bd; background: transparent; font-size: 12px; font-weight: 650; text-decoration: none; transition: .18s ease; }
.rail-item:hover { color: #fff; background: #252932; }
.rail-item.is-active { color: #fff; background: #2a2e36; box-shadow: inset 3px 0 0 #2581ff; }
.rail-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.governance-identity { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 10px 8px 0; border-top: 1px solid #30343d; color: #d6d8dd; font-size: 11px; }
.governance-avatar { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border: 2px solid #40444d; border-radius: 50%; color: #fff; background: #4568dc; font-weight: 750; }

.console { min-width: 0; padding: 0 22px 36px; }
.console-top { position: sticky; top: 0; z-index: 20; display: flex; min-height: 75px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(244, 245, 247, .96); backdrop-filter: blur(12px); }
.console-heading { min-width: 0; margin-right: auto; }
.eyebrow { margin: 0 0 3px; color: var(--tertiary); font: 650 9px/1.2 var(--mono); letter-spacing: .13em; }
.console-title { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -.02em; }
.synthetic-badge { margin: 0; padding: 3px 8px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.console-top-actions { display: flex; align-items: center; gap: 7px; }
.console-top-actions a, .console-top-actions button { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 650; text-decoration: none; }
.console-top-actions a:hover, .console-top-actions button:hover { border-color: #b9bec6; background: var(--surface-soft); }
#reset-button { color: var(--secondary); }

.console-status { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: 360px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); font-size: 12px; }
.console-status[data-tone="ok"], .console-status[data-tone="positive"] { color: var(--green); border-color: #cce9d9; background: var(--green-soft); }
.console-status[data-tone="danger"], .console-status[data-tone="error"] { color: var(--red); border-color: #f1caca; background: var(--red-soft); }

.console-main { display: grid; gap: 14px; max-width: 1600px; margin: 18px auto 0; }
.console-main > * { min-width: 0; }
.panel { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 2px 8px rgba(20, 25, 35, .025); }
.panel h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 11px; font-size: 13px; font-weight: 720; }
.panel h2::before { content: ""; width: 3px; height: 14px; border-radius: 999px; background: var(--blue); }
.stage-hint { margin: -5px 0 12px; color: var(--secondary); font-size: 10px; }
.pane-eyebrow { margin: 0 0 3px; color: var(--tertiary); font: 650 8px/1.2 var(--mono); letter-spacing: .12em; }
.studio-pane-heading, .graph-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.studio-pane-heading h2, .graph-heading h2 { margin: 0; }
.mobile-governance-tabs, .mobile-surface-nav { display: none; }

.overview-panel { padding: 12px 14px; }
.overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.overview-cell { min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.overview-cell dt { color: var(--tertiary); font-size: 9px; font-weight: 650; }
.overview-cell dd { margin: 3px 0 0; color: var(--ink); font: 720 18px/1.2 var(--mono); letter-spacing: -.04em; }
.overview-cell[data-status="active"] dd, .overview-cell[data-status="approved"] dd { color: var(--green); }
.overview-cell[data-status="pending"] dd, .overview-cell[data-status="paused"] dd, .overview-cell[data-status="suppressed"] dd { color: var(--amber); }
.overview-cell[data-status="rejected"] dd, .overview-cell[data-status="forgotten"] dd { color: var(--red); }

.governance-studio { display: grid; grid-template-columns: 270px minmax(480px, 1fr) 292px; min-height: 620px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.governance-studio > * { min-width: 0; }
.governance-studio .panel { border: 0; border-radius: 0; box-shadow: none; }
.studio-pane { border-right: 1px solid var(--line) !important; background: #fbfbfc; }
.source-safety { flex: 0 0 auto; padding: 2px 6px; border-radius: 5px; color: var(--tertiary); background: #eef0f3; font: 8px var(--mono); white-space: nowrap; }
.source-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin: 12px 0; }
.source-dropzone { display: flex; min-width: 0; min-height: 38px; align-items: center; gap: 7px; padding: 6px 8px; border: 1px dashed #b8c8df; border-radius: 7px; color: var(--secondary); background: var(--blue-soft); cursor: pointer; }
.source-dropzone:focus-within { outline: 3px solid rgba(23, 105, 224, .2); outline-offset: 2px; }
.source-dropzone input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.source-upload-action { flex: 0 0 auto; color: var(--blue); font-size: 10px; font-weight: 720; }
.source-upload-name { min-width: 0; overflow: hidden; color: var(--tertiary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
#source-upload-button { min-height: 38px; padding: 0 10px; border: 1px solid var(--blue); border-radius: 7px; color: #fff; background: var(--blue); font-size: 10px; font-weight: 700; }
.source-filter-row { display: flex; justify-content: space-between; gap: 8px; margin: 0 -4px 7px; padding: 6px 7px; border-bottom: 1px solid var(--line); color: var(--tertiary); font-size: 8px; }
.source-list { display: grid; gap: 3px; max-height: 480px; margin: 0 -5px; padding: 0 3px; overflow-y: auto; list-style: none; }
.source-list:empty::before { content: "暂无知识来源"; display: block; padding: 16px; color: var(--tertiary); text-align: center; }
.source-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 9px 10px 9px 30px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; }
.source-item::before { position: absolute; top: 10px; left: 10px; color: var(--tertiary); font-size: 12px; content: "◇"; }
.source-item:hover { background: #f1f2f4; }
.source-item.is-selected { border-color: #d2e2f8; background: var(--blue-soft); }
.source-title-line { display: flex; min-width: 0; align-items: center; gap: 6px; }
.source-title-line strong { min-width: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-status { padding: 1px 5px; border-radius: 4px; color: var(--secondary); background: #eef0f3; font-size: 8px; font-weight: 700; white-space: nowrap; }
.source-status[data-status="validated"] { color: var(--green); background: var(--green-soft); }
.source-status[data-status="pending_validation"] { color: var(--amber); background: var(--amber-soft); }
.source-status[data-status="rejected"] { color: var(--red); background: var(--red-soft); }
.source-preview { display: -webkit-box; overflow: hidden; color: var(--secondary); font-size: 9px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.source-meta { color: var(--tertiary); font: 8px/1.4 var(--mono); overflow-wrap: anywhere; }
.source-actions { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.source-actions button { min-height: 26px; padding: 0 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: #fff; font-size: 9px; font-weight: 650; }
.source-actions button[data-decision="validate"] { color: var(--green); border-color: #c6e1d1; background: var(--green-soft); }
.source-actions button[data-decision="reject"] { color: var(--red); border-color: #efd0d0; background: var(--red-soft); }

.studio-canvas { display: flex; flex-direction: column; padding: 0 !important; color: #eef1f6; background: #202126; }
.graph-heading { flex: 0 0 auto; padding: 14px 16px 10px; border-bottom: 1px solid #35373f; background: #25262c; }
.graph-heading h2 { color: #f5f7fb; }
.graph-heading .pane-eyebrow { color: #8d94a3; }
.graph-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 4px; color: #8d94a3; font-size: 8px; }
.graph-legend span::before { width: 6px; height: 6px; border-radius: 50%; background: #7d8491; box-shadow: 0 0 8px currentColor; content: ""; }
.graph-legend span[data-tone="active"]::before { background: #4ac58b; }
.graph-legend span[data-tone="pending"]::before { background: #e9a94b; }
.graph-toolbar { display: flex; flex: 0 0 auto; min-width: 0; min-height: 40px; align-items: center; gap: 12px; padding: 0 12px 0 14px; border-bottom: 1px solid #35373f; color: #838b99; background: #222329; font-size: 8px; }
.graph-toolbar > span:first-child { flex: 0 0 auto; color: #c4cad4; font-family: var(--mono); }
.graph-toolbar > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graph-controls { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; }
.graph-controls button { min-width: 27px; min-height: 27px; margin: 0; padding: 0 7px; border: 1px solid #454851; border-radius: 6px; color: #d6dae2; background: #2c2e35; font-size: 10px; }
.graph-controls button:hover { border-color: #636878; background: #353842; }
.graph-controls output { min-width: 34px; color: #9ea5b2; font: 8px var(--mono); text-align: center; }
.graph-viewport { position: relative; flex: 1; min-height: 0; overflow: hidden; background-color: #202126; background-image: radial-gradient(rgba(191,199,214,.18) .65px, transparent .65px); background-size: 18px 18px; cursor: grab; touch-action: none; user-select: none; }
.graph-viewport::after { position: absolute; inset: 0; z-index: 20; background: radial-gradient(circle at 50% 45%, transparent 20%, rgba(15,16,20,.18) 100%); content: ""; pointer-events: none; }
.graph-viewport.is-dragging { cursor: grabbing; }
.governance-graph { position: absolute; top: 0; left: 0; width: 860px; height: 580px; transform-origin: 0 0; will-change: transform; }
.graph-node { position: absolute; z-index: 4; display: grid; width: 166px; min-height: 48px; grid-template-columns: 20px minmax(0, 1fr); grid-template-areas: "orb title" "orb meta"; align-content: center; align-items: center; column-gap: 8px; padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; color: #e7eaf0; background: transparent; cursor: grab; transition: opacity .2s ease, color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.graph-node:hover { z-index: 6; border-color: rgba(154,166,187,.25); background: rgba(72,76,88,.55); }
.graph-node.is-dragging { z-index: 8; cursor: grabbing; transition: none; }
.graph-node.is-selected { z-index: 7; border-color: rgba(96,165,250,.65); background: rgba(40,105,190,.24); box-shadow: 0 0 0 1px rgba(96,165,250,.16), 0 12px 30px rgba(0,0,0,.22); }
.graph-node.is-neighbor { opacity: 1; }
.graph-node.is-dimmed { opacity: .28; }
.graph-node-orb { grid-area: orb; display: block; width: 11px; height: 11px; justify-self: center; border: 2px solid #202126; border-radius: 50%; background: #9ca3af; box-shadow: 0 0 0 2px rgba(156,163,175,.3), 0 0 12px rgba(156,163,175,.5); }
.graph-node strong { grid-area: title; min-width: 0; overflow: hidden; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.graph-node span { grid-area: meta; min-width: 0; margin-top: 1px; overflow: hidden; color: #8f96a4; font: 8px/1.3 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.graph-node[data-tone="active"] .graph-node-orb { background: #4ac58b; box-shadow: 0 0 0 2px rgba(74,197,139,.24), 0 0 14px rgba(74,197,139,.48); }
.graph-node[data-tone="pending"] .graph-node-orb { background: #e9a94b; box-shadow: 0 0 0 2px rgba(233,169,75,.25), 0 0 14px rgba(233,169,75,.48); }
.graph-node[data-tone="danger"] .graph-node-orb { background: #ef7676; box-shadow: 0 0 0 2px rgba(239,118,118,.24), 0 0 14px rgba(239,118,118,.45); }
.graph-node[data-area="customer"] .graph-node-orb { background: #a78bfa; box-shadow: 0 0 0 2px rgba(167,139,250,.24), 0 0 14px rgba(167,139,250,.48); }
.graph-node[data-area="device"] .graph-node-orb { background: #60a5fa; box-shadow: 0 0 0 2px rgba(96,165,250,.24), 0 0 14px rgba(96,165,250,.48); }
.graph-node[data-area="issue"] .graph-node-orb { background: #fb923c; box-shadow: 0 0 0 2px rgba(251,146,60,.24), 0 0 14px rgba(251,146,60,.48); }
.graph-node[data-area="memory"] { width: 196px; }
.graph-node[data-area="memory"] .graph-node-orb { width: 17px; height: 17px; background: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,.18), 0 0 22px rgba(59,130,246,.72); }
.graph-edge { position: absolute; z-index: 1; height: 1px; transform-origin: left center; background: #687181; opacity: .72; pointer-events: none; transition: opacity .2s ease, background-color .2s ease; }
.graph-edge.is-dashed { height: 0; border-top: 1px dashed #8b7b5d; background: transparent; }
.graph-edge.is-related { z-index: 2; height: 2px; background: #4b9cff; opacity: 1; box-shadow: 0 0 8px rgba(75,156,255,.45); }
.graph-edge.is-related.is-dashed { height: 0; border-top: 2px dashed #e9a94b; background: transparent; box-shadow: none; }
.graph-edge.is-dimmed { opacity: .16; }
.graph-edge-label { position: absolute; z-index: 3; transform: translate(-50%, -50%); padding: 2px 5px; border: 1px solid #3b3e47; border-radius: 5px; color: #9aa2af; background: rgba(32,33,38,.92); font-size: 8px; pointer-events: none; white-space: nowrap; transition: opacity .2s ease; }
.graph-edge-label.is-related { color: #b9d7ff; border-color: rgba(75,156,255,.35); }
.graph-edge-label.is-dimmed { opacity: .12; }

.studio-inspector { display: grid; grid-template-rows: minmax(0, .85fr) minmax(0, 1.15fr); border-left: 1px solid var(--line); background: #fbfbfc; }
.studio-inspector .panel { min-height: 0; overflow: auto; background: #fbfbfc; }
.studio-inspector .panel + .panel { border-top: 1px solid var(--line); }
.inspector-status { padding: 2px 6px; border-radius: 5px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 700; }
.graph-inspector { display: grid; gap: 0; margin-top: 12px; }
.inspector-kicker { color: var(--blue); font: 650 8px var(--mono); }
.inspector-title { margin: 5px 0 10px; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.inspector-field { display: grid; grid-template-columns: 62px 1fr; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.inspector-field dt { color: var(--tertiary); font-size: 9px; }
.inspector-field dd { margin: 0; color: var(--secondary); font-size: 9px; overflow-wrap: anywhere; }
.review-panel .candidate-list { max-height: 130px; }
.review-detail { display: grid; gap: 0; min-height: 90px; margin: 10px 0; }
.review-detail:empty::before { content: "当前没有待审候选"; display: block; padding: 15px 10px; border: 1px dashed var(--line); border-radius: 7px; color: var(--tertiary); font-size: 9px; text-align: center; }

.governance-records { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.ledger-panel, .audit-panel { min-width: 0; }
.ledger-panel { overflow-x: auto; }
.audit-list { max-height: 300px; overflow-y: auto; }

.candidate-list, .outcome-list, .audit-list { list-style: none; margin: 0; padding: 0; }
.candidate-list, .outcome-list { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; }
.empty-state, .candidate-list:empty::before, .outcome-list:empty::before, .audit-list:empty::before, .review-detail:empty::before, .evidence-chain:empty::after { display: block; padding: 18px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--tertiary); background: var(--surface-soft); font-size: 11px; text-align: center; }
.empty-state a { color: var(--blue); font-weight: 650; text-decoration: none; }
.candidate-list:empty::before { content: "暂无待审候选"; }
.outcome-list:empty::before { content: "暂无已处理结果"; }
.audit-list:empty::before { content: "暂无审计记录"; }

.candidate, .outcome { display: grid; gap: 4px; min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; overflow-wrap: anywhere; }
button.candidate { width: 100%; text-align: left; }
.candidate:hover { border-color: #c9d8ed; background: #fafcff; }
.candidate.is-selected, .candidate[aria-selected="true"] { border-color: #cfe0f8; background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.candidate[data-status="pending"]:not(.is-selected) { box-shadow: inset 3px 0 0 var(--amber); }
.outcome[data-status="approved"] { box-shadow: inset 3px 0 0 var(--green); }
.outcome[data-status="rejected"] { box-shadow: inset 3px 0 0 var(--red); }
.candidate-type, .status-chip { display: inline-flex; min-height: 22px; align-items: center; justify-self: start; padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.candidate-type { color: var(--blue); background: var(--blue-soft); }
.candidate[data-type="forget"] .candidate-type { color: var(--red); background: var(--red-soft); }
.candidate-fact, .outcome strong { font-size: 12px; line-height: 1.5; }
.candidate-reason { color: var(--secondary); font-size: 11px; line-height: 1.5; }
.candidate-meta { color: var(--tertiary); font: 9px/1.4 var(--mono); }

.review-detail { display: grid; gap: 0; min-height: 90px; margin: 10px 0; }
.review-detail:empty::before { content: "当前没有待审候选"; }
.review-field { display: grid; grid-template-columns: 64px 1fr; gap: 10px; margin: 0; padding: 7px 0; border-bottom: 1px solid var(--line); }
.review-field:last-child { border-bottom: 0; }
.review-field dt { color: var(--tertiary); font-size: 10px; }
.review-field dd { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.review-actions, .ledger-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.review-actions button, .ledger-actions button, .dialog-actions button { min-height: 35px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 650; }
.review-actions button { flex: 1 1 auto; }
#approve-button { border-color: var(--blue); color: #fff; background: var(--blue); }
#approve-button:hover { border-color: var(--blue-deep); background: var(--blue-deep); }
#reject-button, #reject-submit-button { color: var(--red); border-color: #efcccc; background: var(--red-soft); }

.evidence-chain { position: relative; display: grid; gap: 12px; max-height: 340px; margin: 0; padding: 2px 0 2px 26px; overflow-y: auto; list-style: none; counter-reset: evidence-step; }
.evidence-chain::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 9px; border-left: 1px solid #cdd9e9; }
.evidence-chain:empty::before { display: none; }
.evidence-chain li { position: relative; display: grid; gap: 2px; font-size: 11px; overflow-wrap: anywhere; }
.evidence-chain li::before { content: counter(evidence-step); counter-increment: evidence-step; position: absolute; top: 0; left: -26px; display: grid; width: 19px; height: 19px; place-items: center; border: 1px solid #b9d3f6; border-radius: 50%; color: var(--blue); background: #fff; font: 650 9px var(--mono); }
.evidence-action { color: var(--blue); font-size: 10px; font-weight: 700; }
.evidence-detail { color: var(--secondary); }
.evidence-time { color: var(--tertiary); font: 9px var(--mono); }

.ledger-panel { overflow-x: auto; }
.ledger-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 11px; }
.ledger-table th { padding: 8px 10px; border-bottom: 1px solid var(--line-strong); color: var(--tertiary); background: var(--surface-soft); font-size: 9px; font-weight: 650; text-align: left; white-space: nowrap; }
.ledger-table th:first-child { border-radius: 8px 0 0 0; }
.ledger-table th:last-child { border-radius: 0 8px 0 0; }
.ledger-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.ledger-table tbody tr:hover { background: #fafbfc; }
.ledger-table tbody tr[data-status="paused"], .ledger-table tbody tr[data-status="suppressed"] { background: var(--amber-soft); }
.ledger-table tbody tr[data-status="forgotten"] { background: var(--red-soft); }
.ledger-table .mono, .ledger-table [data-mono] { font: 9px/1.5 var(--mono); }
.ledger-actions { margin-top: 12px; }
.status-chip { color: var(--secondary); background: #eef0f3; }
.status-chip[data-status="active"], .status-chip[data-status="approved"] { color: var(--green); background: var(--green-soft); }
.status-chip[data-status="pending"], .status-chip[data-status="paused"], .status-chip[data-status="suppressed"] { color: var(--amber); background: var(--amber-soft); }
.status-chip[data-status="rejected"], .status-chip[data-status="forgotten"] { color: var(--red); background: var(--red-soft); }

.audit-list { max-height: 300px; overflow-y: auto; }
.audit-item { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 9px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.audit-time, .audit-actor, .audit-action { font-size: 9px; }
.audit-time { color: var(--tertiary); font-family: var(--mono); }
.audit-actor { color: var(--amber); font-weight: 700; }
.audit-action { color: var(--blue); font-family: var(--mono); font-weight: 650; }
.audit-detail { grid-column: 1 / -1; color: var(--secondary); font-size: 11px; overflow-wrap: anywhere; }

textarea { width: 100%; min-height: 76px; padding: 10px 12px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 10px; outline: 0; color: var(--ink); background: var(--surface-soft); font-size: 13px; }
textarea:focus { border-color: var(--blue); background: #fff; }

dialog { width: min(460px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgba(18, 24, 34, .22); }
dialog::backdrop { background: rgba(20, 24, 32, .38); backdrop-filter: blur(2px); }
dialog form { display: grid; gap: 11px; padding: 20px; }
dialog h2 { margin: 0; font-size: 15px; }
dialog label { color: var(--secondary); font-size: 11px; font-weight: 650; }
.dialog-hint { margin: 0; color: var(--secondary); font-size: 11px; }
#source-reject-submit-button { color: var(--red); border-color: #efcccc; background: var(--red-soft); }
@media (max-width: 1180px) {
  .governance-studio { grid-template-columns: 236px minmax(440px, 1fr) 260px; }
}

@media (max-width: 760px) {
  html, body { width: 100%; height: 100%; min-height: 100%; }
  body { overflow: hidden; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .governance-workspace { display: block; height: calc(100vh - 72px - env(safe-area-inset-bottom)); height: calc(100dvh - 72px - env(safe-area-inset-bottom)); overflow: hidden; }
  .rail { display: none; }
  .console { display: flex; flex-direction: column; height: 100%; padding: 0; }
  .console-main { position: relative; display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 0; margin: 0; overflow: hidden; }
  .console-top-actions a { display: none; }
  .console-top-actions button { min-height: 32px; padding-inline: 10px; }
  .synthetic-badge { margin-left: auto; }
  .overview-panel { display: none; }
  .mobile-governance-tabs { display: grid; flex: 0 0 auto; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
  .mobile-governance-tabs button { min-height: 34px; border: 0; border-radius: 8px; color: var(--secondary); background: transparent; font-size: 11px; font-weight: 650; }
  .mobile-governance-tabs button.is-active { color: var(--blue); background: #fff; box-shadow: 0 1px 5px rgba(20,25,35,.09); }
  .governance-studio { position: relative; display: block; flex: 1; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
  .governance-studio > .source-panel, .governance-studio > .graph-panel, .governance-studio > .studio-inspector { position: absolute; inset: 0; display: none; width: 100%; height: 100%; }
  .console-main[data-mobile-view="graph"] .graph-panel { display: flex; }
  .console-main[data-mobile-view="sources"] .source-panel { display: block; overflow-y: auto; }
  .console-main[data-mobile-view="review"] .studio-inspector { display: block; overflow-y: auto; }
  .console-main[data-mobile-view="review"] .inspector-panel { display: none; }
  .studio-pane { border: 0 !important; padding: 14px 16px !important; }
  .source-list { max-height: none; }
  .source-item { padding-right: 10px; }
  .source-upload { grid-template-columns: minmax(0, 1fr) auto; }
  .studio-canvas { background: #202126; }
  .graph-heading { padding: 11px 14px 8px; }
  .graph-legend { display: none; }
  .graph-toolbar { padding: 0 9px 0 12px; }
  .graph-toolbar > span:nth-child(2) { display: none; }
  .graph-controls { gap: 3px; }
  .graph-controls output { display: none; }
  .graph-controls button { min-width: 30px; min-height: 30px; }
  .graph-viewport { overflow: hidden; }
  .governance-graph { width: 860px; height: 580px; }
  .graph-edge-label { display: none; }
  .studio-inspector { border: 0; background: #f7f8fa; }
  .studio-inspector .panel { border-bottom: 1px solid var(--line); }
  .review-panel .candidate-list { max-height: 220px; }
  .governance-records { position: absolute; inset: 49px 0 0; display: none; overflow-y: auto; padding: 10px; background: var(--bg); }
  .console-main[data-mobile-view="ledger"] .governance-studio { display: none; }
  .console-main[data-mobile-view="ledger"] .governance-records { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .ledger-panel { overflow-x: auto; }
  .mobile-surface-nav { position: fixed; z-index: 90; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: calc(72px + env(safe-area-inset-bottom)); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(250,250,252,.94); box-shadow: 0 -8px 24px rgba(20,25,35,.06); backdrop-filter: blur(24px); }
  .mobile-surface-nav a { display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 14px; color: var(--tertiary); text-decoration: none; }
  .mobile-surface-nav span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: #eceef2; font-size: 11px; font-weight: 750; }
  .mobile-surface-nav strong { font-size: 10px; font-weight: 650; }
  .mobile-surface-nav a.is-active { color: var(--blue); background: var(--blue-soft); }
  .mobile-surface-nav a.is-active span { color: #fff; background: var(--blue); }
  .console-status { right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
