:root {
  --forest-950: #102b3a;
  --forest-900: #173f52;
  --forest-700: #176f77;
  --green-600: #187f7b;
  --green-100: #e5f3f1;
  --blue-700: #315d88;
  --blue-100: #e9f0f7;
  --red-700: #a33e39;
  --red-100: #fae9e7;
  --amber-700: #986420;
  --amber-100: #fff3df;
  --ink: #182d38;
  --muted: #66777f;
  --canvas: #f2f6f6;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --line: #d7e1e2;
  --line-dark: #b7c8cb;
  --shadow-sm: 0 2px 9px rgba(16, 43, 58, 0.06);
  --shadow-lg: 0 18px 48px rgba(16, 43, 58, 0.18);
  --sidebar: 238px;
  --topbar: 64px;
  --z-sidebar: 20;
  --z-scrim: 30;
  --z-drawer: 40;
  --z-dialog: 50;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(20, 120, 92, 0.3); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 9px 12px; transform: translateY(-150%); border-radius: 4px; background: var(--forest-950); color: white; }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.admin-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: var(--z-sidebar); inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 16px 12px; overflow-y: auto; background: var(--forest-950); color: #e8f0ed; }
.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 7px 14px; border-bottom: 1px solid rgba(255,255,255,0.11); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid #7ea497; border-radius: 5px; background: #d5e7df; color: var(--forest-950); font-size: 19px; font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 1px; color: #8fb0a4; font-family: "DM Mono", monospace; font-size: 9px; }
.nav-list { display: grid; gap: 3px; padding-top: 15px; }
.nav-item { min-height: 42px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: #bcd0c8; text-align: left; transition: background-color 180ms ease, color 180ms ease; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active { background: #d8ebe2; color: var(--forest-950); font-weight: 700; }
.nav-item svg { width: 17px; height: 17px; }
.nav-item b { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,0.12); color: inherit; font-family: "DM Mono", monospace; font-size: 10px; }
.nav-item.active b { background: #bddbcf; }
.nav-item .risk-badge { background: #873b36; color: white; }
.boundary-note { margin-top: auto; padding: 13px 10px; border: 1px solid rgba(255,255,255,0.12); border-radius: 6px; background: rgba(255,255,255,0.04); }
.tiny-label, .eyebrow { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 500; }
.boundary-note .tiny-label { display: block; margin-bottom: 8px; color: #8fb0a4; }
.boundary-note > div { display: flex; align-items: center; gap: 7px; margin-top: 6px; font-size: 12px; }
.boundary-note p { margin: 9px 0 0; color: #91aaa1; font-size: 10px; line-height: 1.55; }
.source-tag { min-width: 24px; height: 20px; display: inline-grid; place-items: center; border-radius: 3px; font-family: "DM Mono", monospace; font-size: 10px; font-weight: 700; }
.source-tag.b { background: #d7eee4; color: #155a45; }
.source-tag.c { background: #dbe9f3; color: #235e85; }
.admin-profile { min-height: 54px; display: grid; grid-template-columns: 34px 1fr 16px; align-items: center; gap: 9px; margin-top: 10px; padding: 7px 8px; border: 0; border-radius: 5px; background: transparent; color: white; text-align: left; transition: background-color 180ms ease; }
.admin-profile:hover { background: rgba(255,255,255,0.07); }
.admin-profile strong, .admin-profile small { display: block; }
.admin-profile strong { font-size: 12px; }
.admin-profile small { color: #8fb0a4; font-size: 10px; }
.admin-profile svg { width: 15px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d9ebe3; color: var(--forest-900); font-weight: 700; }

.main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 10; top: 0; min-height: var(--topbar); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.96); }
.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.breadcrumb svg { width: 14px; }
.breadcrumb strong { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.system-status { display: flex; align-items: center; gap: 6px; margin-right: 4px; color: var(--muted); font-size: 11px; }
.system-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 3px var(--green-100); }
.system-status.offline i { background: var(--red-700); box-shadow: 0 0 0 3px var(--red-100); }
.system-status.syncing i { background: var(--amber-700); box-shadow: 0 0 0 3px var(--amber-100); }
.icon-button, .primary-button, .secondary-button, .ghost-button, .danger-button, .assistant-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 5px; font-weight: 600; transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease; }
.icon-button { width: 38px; padding: 0; border: 1px solid var(--line); background: white; color: var(--forest-900); }
.icon-button:hover { background: var(--surface-2); border-color: var(--line-dark); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button em { position: absolute; width: 7px; height: 7px; margin: -22px 0 0 21px; border: 2px solid white; border-radius: 50%; background: var(--red-700); }
.primary-button { padding: 0 15px; border: 1px solid var(--forest-900); background: var(--forest-900); color: white; }
.primary-button:hover { background: var(--forest-700); }
.secondary-button { padding: 0 14px; border: 1px solid var(--line-dark); background: white; color: var(--forest-900); }
.secondary-button:hover { border-color: var(--forest-700); background: var(--green-100); }
.ghost-button { padding: 0 9px; border: 0; background: transparent; color: var(--forest-700); }
.ghost-button:hover { background: var(--green-100); }
.danger-button { padding: 0 14px; border: 1px solid #e4b9b6; background: var(--red-100); color: var(--red-700); }
.danger-button:hover { border-color: var(--red-700); }
.assistant-button { padding: 0 13px; border: 1px solid #bed1c9; background: var(--green-100); color: var(--forest-900); }
.assistant-button:hover { background: #d5e9e0; }
.primary-button svg, .secondary-button svg, .assistant-button svg { width: 16px; height: 16px; }
.mobile-menu { display: none; }
.content { max-width: 1600px; margin: 0 auto; padding: 22px 24px 48px; }

.view-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.view-heading h1 { margin: 3px 0 4px; font-size: 24px; line-height: 1.25; }
.view-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.scope-control { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.scope-control button { min-height: 31px; padding: 0 11px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; }
.scope-control button.active { background: var(--forest-900); color: white; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { min-height: 126px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: var(--shadow-sm); }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.metric-head svg { width: 16px; height: 16px; color: var(--forest-700); }
.metric-value { display: block; margin-top: 13px; font-family: "DM Mono", monospace; font-size: 28px; font-weight: 500; line-height: 1; }
.metric-foot { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 10px; }
.trend-good { color: var(--green-600); }
.trend-warn { color: var(--amber-700); }
.trend-risk { color: var(--red-700); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.8fr); gap: 14px; margin-top: 14px; }
.panel { border: 1px solid var(--line); border-radius: 6px; background: white; box-shadow: var(--shadow-sm); }
.panel-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.panel-body { padding: 16px; }
.section-space { margin-top: 14px; }

.data-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.search-field { min-width: 240px; min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line-dark); border-radius: 5px; background: white; color: var(--muted); }
.search-field:focus-within { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(20,120,92,0.12); }
.search-field svg { width: 15px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.toolbar-spacer { flex: 1; }
.select-field { min-height: 38px; padding: 0 31px 0 11px; border: 1px solid var(--line-dark); border-radius: 5px; background: white; color: var(--ink); font-size: 12px; }
.table-scroll { width: 100%; overflow-x: auto; }
.data-table { min-width: 790px; }
.table-row { display: grid; grid-template-columns: 1.65fr 0.8fr 0.8fr 0.82fr 0.72fr 96px; align-items: center; gap: 12px; min-height: 58px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12px; }
.table-row:last-child { border-bottom: 0; }
.table-row.heading { min-height: 38px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 600; }
.table-row:not(.heading):hover { background: #f9fbfa; }
.cell-main strong, .cell-main small { display: block; }
.cell-main strong { color: var(--ink); font-size: 12px; }
.cell-main small { margin-top: 3px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 5px; }
.text-action { min-height: 31px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--forest-700); font-size: 11px; font-weight: 600; }
.text-action:hover { background: var(--green-100); }
.status, .tag { display: inline-flex; align-items: center; width: fit-content; min-height: 24px; padding: 0 7px; border-radius: 4px; background: var(--green-100); color: #155b45; font-size: 10px; font-weight: 600; }
.status.pending, .tag.pending { background: var(--amber-100); color: var(--amber-700); }
.status.risk, .tag.risk { background: var(--red-100); color: var(--red-700); }
.status.info, .tag.info { background: var(--blue-100); color: var(--blue-700); }
.status.muted, .tag.muted { background: #edf1ef; color: #63716c; }
.amount { font-family: "DM Mono", monospace; font-weight: 500; }

.task-list, .risk-list, .ledger-list { display: grid; }
.task-item, .risk-item, .ledger-item { display: grid; grid-template-columns: 18px 1fr auto; align-items: start; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.task-item:last-child, .risk-item:last-child, .ledger-item:last-child { border-bottom: 0; }
.task-icon { width: 18px; height: 18px; color: var(--forest-700); }
.task-item strong, .task-item small, .risk-item strong, .risk-item small { display: block; }
.task-item strong, .risk-item strong { font-size: 12px; }
.task-item small, .risk-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.task-time { color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; }
.risk-item .task-icon { color: var(--red-700); }

.safety-workbench { margin-top: 14px; border-top: 3px solid var(--red-700); border-bottom: 1px solid var(--line); background: #fffafa; }
.safety-workbench > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 16px; border-bottom: 1px solid #efd6d4; }
.safety-workbench h2 { margin: 2px 0 3px; font-size: 15px; }
.safety-workbench p { margin: 0; color: var(--muted); font-size: 11px; }
.safety-work-list { padding: 0 16px; }
.safety-work-item { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(250px, 1.2fr) auto 106px; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid #efd6d4; }
.safety-work-item:last-child { border-bottom: 0; }
.safety-work-item > div:first-child strong, .safety-work-item > div:first-child small { display: block; }
.safety-work-item > div:first-child strong { font-size: 12px; }
.safety-work-item > div:first-child small { margin-top: 4px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; }
.small-button { min-height: 32px; padding: 0 9px; font-size: 11px; }
.safety-flow { display: grid; grid-template-columns: repeat(4, 1fr); min-width: 240px; }
.safety-flow-step { position: relative; min-width: 0; text-align: center; }
.safety-flow-step::before { position: absolute; top: 10px; left: -50%; width: 100%; height: 1px; background: #d8c9c7; content: ""; }
.safety-flow-step:first-child::before { display: none; }
.safety-flow-step span { position: relative; z-index: 1; display: grid; width: 21px; height: 21px; place-items: center; margin: 0 auto 4px; border: 2px solid #fffafa; border-radius: 50%; background: #d8c9c7; color: #735d5b; font-family: "DM Mono", monospace; font-size: 9px; box-shadow: 0 0 0 1px #d8c9c7; }
.safety-flow-step strong { display: block; color: var(--muted); font-size: 9px; white-space: nowrap; }
.safety-flow-step.done::before, .safety-flow-step.current::before { background: var(--red-700); }
.safety-flow-step.done span { background: var(--red-700); color: white; box-shadow: 0 0 0 1px var(--red-700); }
.safety-flow-step.current span { background: var(--amber-700); color: white; box-shadow: 0 0 0 1px var(--amber-700); }
.safety-flow-step.done strong, .safety-flow-step.current strong { color: var(--ink); font-weight: 700; }
.safety-empty { padding: 20px 0; color: var(--muted); font-size: 12px; }

.isolation-map { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: stretch; gap: 8px; }
.business-lane { padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.business-lane h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; }
.business-lane ul { margin: 0; padding-left: 17px; color: var(--muted); font-size: 11px; }
.business-lane li + li { margin-top: 5px; }
.shared-core { display: grid; place-items: center; padding: 5px; border-right: 1px dashed var(--line-dark); border-left: 1px dashed var(--line-dark); color: var(--forest-700); font-family: "DM Mono", monospace; font-size: 9px; text-align: center; writing-mode: vertical-rl; }

.evidence-ribbon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; padding: 18px 12px; }
.evidence-step { position: relative; min-width: 0; text-align: center; }
.evidence-step::before { position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--line-dark); content: ""; }
.evidence-step:first-child::before { display: none; }
.evidence-icon { position: relative; z-index: 1; width: 36px; height: 36px; display: grid; place-items: center; margin: 0 auto 9px; border: 4px solid white; border-radius: 50%; background: var(--green-100); color: var(--forest-700); box-shadow: 0 0 0 1px #a8c4b8; }
.evidence-icon svg { width: 15px; }
.evidence-step.hit .evidence-icon { background: var(--red-100); color: var(--red-700); box-shadow: 0 0 0 1px #d7aaa6; }
.evidence-step.pending .evidence-icon { background: var(--amber-100); color: var(--amber-700); box-shadow: 0 0 0 1px #d7b786; }
.evidence-step strong, .evidence-step small { display: block; padding: 0 5px; }
.evidence-step strong { font-size: 11px; }
.evidence-step small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.summary-strip > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .summary-strip strong { display: block; }
.summary-strip span { color: var(--muted); font-size: 10px; }
.summary-strip strong { margin-top: 5px; font-family: "DM Mono", monospace; font-size: 17px; }

.evidence-grid { display: grid; grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 0.8fr); gap: 14px; }
.site-media { position: relative; min-height: 340px; overflow: hidden; border-radius: 6px; background: #d7e1dc; }
.site-media img { width: 100%; height: 340px; display: block; object-fit: cover; }
.site-caption { position: absolute; right: 12px; bottom: 12px; left: 12px; display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 4px; background: rgba(16,42,35,0.9); color: white; font-size: 10px; }
.site-caption strong { font-size: 11px; }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.proof-tile { min-height: 76px; padding: 11px; border: 1px solid var(--line); border-radius: 5px; background: white; }
.proof-tile span, .proof-tile strong { display: block; }
.proof-tile span { color: var(--muted); font-size: 9px; }
.proof-tile strong { margin-top: 5px; font-family: "DM Mono", monospace; font-size: 14px; }

.materials-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border: 1px solid #1d5365; border-radius: 6px; background: #123849; color: white; box-shadow: var(--shadow-sm); }
.materials-hero .eyebrow { color: #a8ddd4; }
.materials-hero h2 { margin: 5px 0; font-size: 20px; }
.materials-hero p { max-width: 670px; margin: 0; color: #c9dee1; font-size: 12px; }
.materials-hero-stats { display: flex; align-self: stretch; }
.materials-hero-stats > div { min-width: 92px; display: flex; flex-direction: column; justify-content: center; padding: 0 14px; border-left: 1px solid rgba(255,255,255,0.2); }
.materials-hero-stats strong { color: #8ed9d2; font-family: "DM Mono", monospace; font-size: 22px; }
.materials-hero-stats .warn strong { color: #f0c76a; }
.materials-hero-stats span { margin-top: 3px; color: #c0d6da; font-size: 9px; }
.materials-grid, .materials-bottom { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.85fr); gap: 14px; }
.material-purchase-row { grid-template-columns: minmax(235px, 1.5fr) minmax(120px, 0.78fr) 84px 88px 105px 74px; }
.material-compliance-list, .material-issue-list { display: grid; gap: 0; padding-top: 0; padding-bottom: 0; }
.material-compliance-list > div { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.material-compliance-list > div:last-child { border-bottom: 0; }
.material-compliance-list svg { width: 17px; color: var(--forest-700); }
.material-compliance-list strong, .material-compliance-list small { display: block; }
.material-compliance-list strong { font-size: 11px; }
.material-compliance-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.supply-list { display: grid; }
.supply-row { display: grid; grid-template-columns: 30px minmax(160px,1fr) minmax(160px,1fr) 48px 78px 46px; align-items: center; gap: 10px; min-height: 61px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.supply-row:last-child { border-bottom: 0; }
.supply-row.heading { min-height: 38px; background: var(--surface-2); color: var(--muted); font-size: 10px; font-weight: 600; }
.supply-row strong, .supply-row small { display: block; }
.supply-row strong { font-size: 11px; }
.supply-row small { margin-top: 3px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 9px; }
.supply-row > span:not(.status) { color: var(--muted); font-size: 10px; line-height: 1.45; }
.supply-row > b { color: var(--forest-900); font-family: "DM Mono", monospace; font-size: 13px; }
.supplier-seal { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #b7d4d1; border-radius: 50%; background: #e8f5f3; color: var(--forest-700); font-size: 11px; font-weight: 700; }
.material-issue-list > div { display: grid; grid-template-columns: 11px minmax(0,1fr) 38px; align-items: center; gap: 9px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.material-issue-list > div:last-child { border-bottom: 0; }
.issue-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber-700); box-shadow: 0 0 0 3px var(--amber-100); }
.issue-dot.risk { background: var(--red-700); box-shadow: 0 0 0 3px var(--red-100); }
.material-issue-list strong, .material-issue-list small { display: block; }
.material-issue-list strong { font-size: 11px; }
.material-issue-list small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.material-trace-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.material-trace-mini > div { min-height: 104px; padding: 11px; border-right: 1px solid var(--line); background: var(--surface-2); }
.material-trace-mini > div:last-child { border-right: 0; }
.material-trace-mini svg { width: 17px; color: var(--forest-700); }
.material-trace-mini span, .material-trace-mini small { display: block; }
.material-trace-mini span { margin-top: 9px; font-size: 10px; font-weight: 700; }
.material-trace-mini small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }

.community-metrics .metric-head svg { color: var(--blue-700); }
.community-toolbar { padding: 12px 16px 0; }
.community-table { min-width: 1100px; }
.community-row { grid-template-columns: minmax(270px, 1.65fr) 0.66fr minmax(160px, 0.88fr) minmax(128px, 0.76fr) minmax(160px, 0.88fr) 88px; }
.cell-subtle { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.content-review-note { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 14px 16px; border: 1px solid #b8d8d4; border-radius: 6px; background: #edf8f6; color: var(--forest-900); }
.content-review-note > div { display: flex; align-items: flex-start; gap: 10px; }
.content-review-note > div > svg { width: 19px; height: 19px; flex: none; color: var(--green-600); }
.content-review-note strong, .content-review-note span { display: block; }
.content-review-note strong { font-size: 12px; }
.content-review-note span { max-width: 760px; margin-top: 2px; color: var(--muted); font-size: 10px; }

.media-review-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.media-review-strip > div { min-height: 106px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); }
.media-review-strip svg { width: 18px; height: 18px; color: var(--forest-700); }
.media-review-strip strong, .media-review-strip small { display: block; }
.media-review-strip strong { margin-top: 9px; font-size: 11px; }
.media-review-strip small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.governance-banner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 24px; border: 1px solid #1c5367; border-radius: 6px; background: #12384c; color: white; box-shadow: var(--shadow-sm); }
.governance-banner .eyebrow { color: #a5d7d3; }
.governance-banner h2 { margin: 5px 0 5px; font-size: 20px; }
.governance-banner p { max-width: 720px; margin: 0; color: #c9dce1; font-size: 12px; }
.governance-version { min-width: 178px; padding-left: 22px; border-left: 1px solid rgba(255,255,255,0.2); }
.governance-version span, .governance-version strong, .governance-version small { display: block; }
.governance-version span, .governance-version small { color: #b8d4d8; font-size: 10px; }
.governance-version strong { margin: 4px 0; font-family: "DM Mono", monospace; font-size: 17px; }
.governance-layout, .governance-bottom { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.9fr); gap: 14px; }
.governance-switches { padding-top: 0; padding-bottom: 0; }
.governance-switch { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.governance-switch:last-child { border-bottom: 0; }
.governance-switch strong, .governance-switch small { display: block; }
.governance-switch strong { font-size: 12px; }
.governance-switch small { max-width: 620px; margin-top: 3px; color: var(--muted); font-size: 10px; }
.toggle { width: 42px; height: 24px; flex: none; padding: 2px; border: 1px solid #a9bcc1; border-radius: 14px; background: #dbe5e7; transition: background-color 180ms ease, border-color 180ms ease; }
.toggle span { display: block; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(16,43,58,0.23); transition: transform 180ms ease; }
.toggle.on { border-color: var(--green-600); background: var(--green-600); }
.toggle.on span { transform: translateX(18px); }
.ai-quality-list { display: grid; gap: 0; padding-top: 0; padding-bottom: 0; }
.ai-quality-list > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ai-quality-list > div:last-child { border-bottom: 0; }
.ai-quality-list span { color: var(--muted); font-size: 10px; }
.ai-quality-list strong { color: var(--forest-900); font-family: "DM Mono", monospace; font-size: 17px; }
.ai-quality-list small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.rule-list { display: grid; }
.rule-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 48px; align-items: center; gap: 13px; min-height: 74px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.rule-row:last-child { border-bottom: 0; }
.rule-row strong, .rule-row small { display: block; }
.rule-row strong { font-size: 11px; }
.rule-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.permission-list { display: grid; gap: 11px; }
.permission-list > div { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.permission-list strong, .permission-list small { display: block; }
.permission-list strong { font-size: 11px; }
.permission-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.avatar-small { width: 32px; height: 32px; font-size: 11px; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan { padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.plan.featured { border-top: 3px solid var(--forest-700); }
.plan h3 { margin: 7px 0 3px; font-size: 16px; }
.plan-price { font-family: "DM Mono", monospace; font-size: 24px; font-weight: 500; }
.plan-price small { color: var(--muted); font-family: inherit; font-size: 10px; }
.plan ul { min-height: 106px; padding-left: 17px; color: var(--muted); font-size: 11px; }
.plan li + li { margin-top: 5px; }
.config-row { display: grid; grid-template-columns: 180px 1fr 100px; align-items: center; gap: 14px; min-height: 62px; border-bottom: 1px solid var(--line); }
.config-row:last-child { border-bottom: 0; }
.config-row label { font-weight: 600; }
.config-row small { color: var(--muted); }
.config-row output { font-family: "DM Mono", monospace; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--forest-700); }

.case-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; }
.case-list { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: white; }
.case-card { width: 100%; display: block; padding: 14px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); text-align: left; transition: background-color 180ms ease; }
.case-card:last-child { border-bottom: 0; }
.case-card:hover, .case-card.active { background: var(--green-100); }
.case-card .case-top { display: flex; justify-content: space-between; gap: 8px; }
.case-card strong, .case-card small { display: block; }
.case-card strong { font-size: 12px; }
.case-card small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.case-detail { border: 1px solid var(--line); border-radius: 6px; background: white; }
.case-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.case-facts div { padding: 13px; border-right: 1px solid var(--line); }
.case-facts div:last-child { border-right: 0; }
.case-facts span, .case-facts strong { display: block; }
.case-facts span { color: var(--muted); font-size: 9px; }
.case-facts strong { margin-top: 4px; font-size: 11px; }
.case-copy { padding: 16px; }
.case-copy h3 { margin: 0 0 7px; font-size: 14px; }
.case-copy p { margin: 0; color: var(--muted); font-size: 11px; }

.scrim { position: fixed; z-index: var(--z-scrim); inset: 0; display: none; background: rgba(11,29,24,0.5); }
.scrim.show { display: block; }
.detail-drawer { position: fixed; z-index: var(--z-drawer); inset: 0 0 0 auto; width: min(560px, 94vw); display: grid; grid-template-rows: auto 1fr auto; transform: translateX(102%); border-left: 1px solid var(--line); background: white; box-shadow: var(--shadow-lg); transition: transform 220ms ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 2px 0 0; font-size: 18px; }
.drawer-body { overflow-y: auto; padding: 18px; }
.drawer-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.detail-section { margin-bottom: 18px; }
.detail-section h3 { margin: 0 0 9px; font-size: 13px; }
.detail-section p { color: var(--muted); font-size: 11px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.detail-field { padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
.detail-field span, .detail-field strong { display: block; }
.detail-field span { color: var(--muted); font-size: 9px; }
.detail-field strong { margin-top: 4px; font-size: 11px; }
.audit-log { border-left: 2px solid var(--line-dark); }
.audit-entry { position: relative; padding: 0 0 13px 16px; }
.audit-entry::before { position: absolute; top: 4px; left: -6px; width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 1px var(--green-600); content: ""; }
.audit-entry strong, .audit-entry small { display: block; }
.audit-entry strong { font-size: 11px; }
.audit-entry small { margin-top: 3px; color: var(--muted); font-size: 9px; }

.decision-dialog { z-index: var(--z-dialog); width: min(500px, calc(100vw - 28px)); padding: 0; border: 0; border-radius: 7px; box-shadow: var(--shadow-lg); }
.decision-dialog::backdrop { background: rgba(11,29,24,0.55); }
.decision-dialog form { padding: 18px; }
.decision-dialog header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.decision-dialog h2 { margin: 2px 0 0; font-size: 18px; }
.decision-dialog label { display: block; margin: 12px 0 6px; font-size: 11px; font-weight: 700; }
.decision-dialog select, .decision-dialog textarea, .decision-dialog input { width: 100%; padding: 10px 11px; border: 1px solid var(--line-dark); border-radius: 5px; background: white; color: var(--ink); font-size: 12px; }
.decision-dialog .helper { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast { position: fixed; z-index: 80; right: 22px; bottom: 22px; max-width: 380px; padding: 11px 14px; transform: translateY(20px); border-radius: 5px; background: var(--forest-950); color: white; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1120px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .evidence-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
  .case-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .governance-layout, .governance-bottom { grid-template-columns: 1fr; }
  .materials-grid, .materials-bottom { grid-template-columns: 1fr; }
  .system-status { display: none; }
}

@media (max-width: 800px) {
  :root { --sidebar: 250px; }
  .sidebar { transform: translateX(-102%); transition: transform 220ms ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .breadcrumb > span, .breadcrumb svg { display: none; }
  .topbar { padding: 0 14px; }
  .top-actions .assistant-button span, .top-actions .primary-button span { display: none; }
  .top-actions .assistant-button, .top-actions .primary-button { width: 38px; padding: 0; }
  .content { padding: 17px 14px 36px; }
  .view-heading { align-items: flex-start; }
  .heading-actions { flex-wrap: wrap; justify-content: flex-end; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .case-layout { grid-template-columns: 1fr; }
  .case-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .case-card:nth-child(odd) { border-right: 1px solid var(--line); }
  .plan-grid { grid-template-columns: 1fr; }
  .isolation-map { grid-template-columns: 1fr; }
  .shared-core { min-height: 38px; border: 0; border-top: 1px dashed var(--line-dark); border-bottom: 1px dashed var(--line-dark); writing-mode: horizontal-tb; }
  .evidence-ribbon { min-width: 520px; }
  .ribbon-scroll { overflow-x: auto; }
  .safety-work-item { grid-template-columns: 1fr auto; }
  .safety-work-track { grid-column: 1 / -1; }
  .governance-banner { align-items: flex-start; flex-direction: column; }
  .governance-version { padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,0.2); border-left: 0; }
  .materials-hero { align-items: flex-start; flex-direction: column; }
  .materials-hero-stats { width: 100%; border-top: 1px solid rgba(255,255,255,0.2); }
  .materials-hero-stats > div { flex: 1; padding: 12px 0 0; border-left: 0; }
}

@media (max-width: 520px) {
  body { font-size: 13px; }
  .top-actions .assistant-button { display: none; }
  .view-heading { display: block; }
  .heading-actions { justify-content: flex-start; margin-top: 12px; }
  .view-heading h1 { font-size: 21px; }
  .metrics { grid-template-columns: 1fr; }
  .metric { min-height: 110px; }
  .data-toolbar { flex-wrap: wrap; }
  .search-field { width: 100%; min-width: 0; }
  .toolbar-spacer { display: none; }
  .summary-strip, .case-facts { grid-template-columns: 1fr 1fr; }
  .summary-strip > div:nth-child(2), .case-facts div:nth-child(2) { border-right: 0; }
  .summary-strip > div, .case-facts div { border-bottom: 1px solid var(--line); }
  .proof-grid { grid-template-columns: 1fr; }
  .site-media, .site-media img { height: 260px; min-height: 260px; }
  .safety-workbench > header { display: block; }
  .safety-workbench > header .status { margin-top: 10px; }
  .safety-work-item { grid-template-columns: 1fr; gap: 10px; }
  .safety-work-track { grid-column: auto; overflow-x: auto; }
  .safety-work-item .primary-button { width: 100%; }
  .case-list { grid-template-columns: 1fr; }
  .case-card:nth-child(odd) { border-right: 0; }
  .config-row { grid-template-columns: 1fr 70px; gap: 8px; padding: 12px 0; }
  .config-row input { grid-column: 1 / -1; grid-row: 2; }
  .detail-grid { grid-template-columns: 1fr; }
  .content-review-note { align-items: flex-start; flex-direction: column; }
  .media-review-strip { grid-template-columns: 1fr; }
  .rule-row { grid-template-columns: 1fr auto; }
  .rule-row .text-action { grid-column: 1 / -1; justify-self: start; }
  .materials-hero { padding: 18px; }
  .materials-hero h2 { font-size: 17px; }
  .material-trace-mini { grid-template-columns: 1fr 1fr; }
  .material-trace-mini > div:nth-child(2) { border-right: 0; }
  .material-trace-mini > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

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