:root {
  --ink: #17212b;
  --muted: #697582;
  --faint: #8e99a4;
  --line: #dce2e7;
  --line-strong: #c9d1d8;
  --paper: #ffffff;
  --canvas: #f2f4f3;
  --panel: #f7f9f9;
  --sidebar-bg: #182732;
  --sidebar-active: #29404e;
  --blue: #205c88;
  --blue-dark: #174766;
  --blue-soft: #e9f1f6;
  --teal: #08776b;
  --teal-soft: #e4f3f0;
  --amber: #a85b04;
  --amber-soft: #fff3df;
  --red: #b54138;
  --red-soft: #fcecea;
  --shadow: 0 1px 2px rgba(20, 33, 43, .04), 0 12px 30px rgba(20, 33, 43, .06);
  --radius: 7px;
  --sidebar-width: 244px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
code { padding: 2px 4px; color: #455761; background: #eef1f2; border-radius: 3px; font: .88em ui-monospace, SFMono-Regular, Menlo, monospace; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.ui-icon { width: 17px; height: 17px; flex: 0 0 auto; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; color: #d9e2e8; background: var(--sidebar-bg); border-right: 1px solid #203643; }
.brand { height: 72px; padding: 0 22px; display: flex; align-items: center; gap: 11px; color: white; border-bottom: 1px solid rgba(255,255,255,.08); text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: #182732; background: #e7f0f5; border-radius: 5px; font-size: 14px; font-weight: 800; letter-spacing: -.07em; }
.brand-copy small { display: block; margin-top: 1px; color: #91a5b2; font-size: 9px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-label { margin: 24px 22px 8px; color: #8298a6; font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.side-nav { padding: 0 12px; }
.nav-link { width: 100%; height: 42px; padding: 0 12px; margin: 2px 0; display: flex; align-items: center; gap: 12px; color: #acbbc5; border-radius: 5px; text-decoration: none; transition: background .16s ease, color .16s ease; }
.nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.nav-link.active { color: white; background: var(--sidebar-active); }
.sidebar-footer { margin: auto 12px 12px; padding: 14px 10px 2px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; color: #19303d; background: #dce7ec; border-radius: 50%; font-size: 10px; font-weight: 800; }
.workspace-identity { min-width: 0; display: block; }
.workspace-identity strong, .workspace-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-identity strong { color: white; font-size: 11px; }
.workspace-identity small { max-width: 125px; color: #8298a6; font-size: 9px; }
.signout-button { width: 30px; height: 30px; min-height: 0; margin-left: auto; padding: 0; display: grid; place-items: center; color: #9eb0bb; background: transparent; border: 0; border-radius: 4px; box-shadow: none; }
.signout-button:hover { color: white; background: rgba(255,255,255,.08); }
.app-main { min-width: 0; }
.topbar { height: 72px; padding: 0 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.breadcrumb { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumb strong { overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.scope-pill { padding: 6px 9px; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: #435563; background: #f5f7f7; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; font-weight: 650; }
.scope-pill > span { width: 6px; height: 6px; background: var(--teal); border-radius: 50%; }
.app-content { width: min(1320px, 100%); margin: 0 auto; padding: 34px; }
.flash-stack { width: min(1320px, 100%); margin: 16px auto -10px; padding: 0 34px; }
.flash { padding: 11px 14px; color: #36515e; background: white; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 1px 2px rgba(20,33,43,.04); }
.flash.alert { color: #7b312c; background: var(--red-soft); border-color: #edc8c3; }
.flash.notice { color: #075e56; background: var(--teal-soft); border-color: #c5e0da; }

/* Guest screens */
.guest-shell { width: min(440px, calc(100% - 32px)); min-height: 100vh; margin: auto; display: grid; align-content: center; gap: 18px; padding: 40px 0; }
.guest-brand { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 800; }
.guest-panel { padding: 30px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.guest-panel h1 { margin-top: 0; }
.guest-intro { margin: 8px 0 24px; color: var(--muted); }
.guest-panel form { display: grid; gap: 14px; }
.guest-panel br { display: none; }
.guest-form .button { width: 100%; margin-top: 4px; }
.guest-link { margin: 18px 0 0; text-align: center; font-size: 12px; }

/* Shared primitives */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.page-head { min-height: 60px; margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.page-head.compact { max-width: 860px; margin-inline: auto; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: 27px; line-height: 1.2; letter-spacing: -.035em; }
.page-head p { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.page-head h1 small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }
.page-head-actions form { margin: 0; }
.button, button, input[type="submit"] { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #324451; background: white; border: 1px solid var(--line-strong); border-radius: 5px; box-shadow: 0 1px 1px rgba(20,33,43,.03); font-weight: 650; font-size: 12px; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .05s ease; }
.button:hover, button:hover, input[type="submit"]:hover { background: #f7f9f9; border-color: #b4c0c8; }
.button:active, button:active { transform: translateY(1px); }
.button.primary, button.primary, input[type="submit"].primary { color: white; background: var(--blue); border-color: var(--blue); }
.button.primary:hover, button.primary:hover, input[type="submit"].primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button:disabled, button:disabled { opacity: .46; cursor: not-allowed; }
.text-button { min-height: auto; padding: 3px 6px; color: inherit; background: transparent; border: 0; box-shadow: none; text-decoration: underline; }
.danger { color: var(--red); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #a9d3ef; outline-offset: 2px; }
.status-badge { width: max-content; padding: 5px 8px; display: inline-flex; align-items: center; gap: 6px; color: #66727d; background: #edf0f2; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.status-badge::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status-badge.pass { color: var(--teal); background: var(--teal-soft); }
.status-badge.fail { color: var(--red); background: var(--red-soft); }
.status-badge.warning { color: var(--amber); background: var(--amber-soft); }
.status-badge.archived { color: #5d6870; background: #e6e9eb; }
.status-badge.draft { color: #66727d; background: #edf0f2; }
.empty-state { padding: 50px 24px; text-align: center; }
.empty-state h2 { margin: 0; font-size: 18px; }
.empty-state p { margin: 7px 0 18px; color: var(--muted); }
.archive-notice { margin: -8px 0 24px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; color: #5d4a2f; background: #f5f1e9; border: 1px solid #ded3c2; border-radius: 5px; font-size: 11px; }
.archive-notice .ui-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.archive-notice strong, .archive-notice span { display: block; }
.archive-notice span { margin-top: 2px; color: #756753; }

/* Calculation workspace */
.table-panel { overflow: hidden; }
.table-toolbar { min-height: 58px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.filter-group { display: flex; align-items: center; gap: 4px; }
.filter { padding: 7px 10px; color: var(--muted); border-radius: 4px; font-size: 11px; font-weight: 650; text-decoration: none; }
.filter:hover { background: #f5f7f7; }
.filter.active { color: var(--blue); background: var(--blue-soft); }
.filter span { margin-left: 2px; color: inherit; opacity: .72; }
.search-form { position: relative; width: min(270px, 40vw); }
.search-form .ui-icon { position: absolute; left: 11px; top: 50%; z-index: 1; width: 14px; height: 14px; color: var(--faint); transform: translateY(-50%); }
.search-form input { width: 100%; height: 34px; min-height: 34px; padding: 0 10px 0 34px; color: var(--ink); background: #fafbfb; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.workspace-table, .criteria-table { width: 100%; border-collapse: collapse; }
.workspace-table th, .criteria-table th { height: 42px; padding: 0 18px; color: var(--faint); background: #fafbfb; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 700; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.workspace-table td { height: 65px; padding: 10px 18px; border-bottom: 1px solid #edf0f2; font-size: 12px; }
.workspace-table tbody tr { transition: background .12s ease; }
.workspace-table tbody tr:hover { background: #f8fafb; }
.workspace-table tbody tr:last-child td { border-bottom: 0; }
.workspace-table strong, .workspace-table small { display: block; }
.workspace-table strong { color: #21333f; font-weight: 680; }
.workspace-table small { margin-top: 3px; color: var(--faint); font-size: 10px; }
.row-primary-link { color: inherit; text-decoration: none; }
.row-primary-link::after { content: ""; position: absolute; }
.row-actions { width: 112px; text-align: right; white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions .text-button { margin-right: 8px; text-decoration: none; }
.row-actions a { display: inline-grid; place-items: center; color: #8d9aa4; }
.row-actions .ui-icon { width: 15px; }
.creation-panel { max-width: 860px; margin: 0 auto; padding: 28px; }
.creation-form { max-width: 620px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.project-card { position: relative; min-height: 150px; padding: 22px; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.project-card:hover { border-color: #b8c5cc; transform: translateY(-2px); }
.project-card h2 { margin: 6px 0 4px; font-size: 18px; }
.project-card p { margin: 0; color: var(--muted); }
.card-arrow { position: absolute; right: 18px; bottom: 18px; color: var(--faint); }
.simple-list-panel { overflow: hidden; }
.simple-list-row { min-height: 72px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0f2; }
.simple-list-row:last-child { border-bottom: 0; }
.simple-list-row strong, .simple-list-row small { display: block; }
.simple-list-row small { margin-top: 3px; color: var(--muted); }

/* Forms and wizard */
.wizard-shell { min-height: 650px; display: grid; grid-template-columns: 214px minmax(0,1fr); overflow: hidden; }
.wizard-steps { padding: 23px 16px; background: #f7f9f9; border-right: 1px solid var(--line); }
.stepper-label { margin: 0 10px 16px; display: block; color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.wizard-step { padding: 11px 10px; margin: 2px 0; display: flex; align-items: flex-start; gap: 10px; color: #6c7882; border-radius: 5px; text-decoration: none; }
.wizard-step > span:first-child { width: 21px; height: 21px; display: grid; place-items: center; flex: 0 0 auto; color: inherit; background: white; border: 1px solid #aeb9c0; border-radius: 50%; font-size: 9px; font-weight: 800; }
.wizard-step.active { color: #1d4f70; background: var(--blue-soft); }
.wizard-step.active > span:first-child { color: white; background: var(--blue); border-color: var(--blue); }
.wizard-step.done { color: #405864; }
.wizard-step.done > span:first-child { color: white; background: var(--teal); border-color: var(--teal); }
.step-copy { min-width: 0; }
.step-copy strong, .step-copy small { display: block; }
.step-copy strong { font-size: 11px; }
.step-copy small { margin-top: 2px; overflow: hidden; color: #8c979f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.wizard-panel { min-width: 0; display: flex; flex-direction: column; }
.wizard-panel-header { padding: 24px 28px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.wizard-panel-header h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.wizard-panel-header p { margin: 4px 0 0; color: var(--muted); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; }
.save-status { display: flex; align-items: center; gap: 6px; color: var(--teal); font-size: 10px; white-space: nowrap; }
.save-status .ui-icon { width: 14px; height: 14px; }
.wizard-form { padding: 25px 28px 0; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px 18px; margin: 16px 0 26px; }
.field { min-width: 0; display: grid; gap: 6px; }
.field.span-2 { grid-column: 1/-1; }
.field label, legend { color: #485661; font-size: 10px; font-weight: 700; }
.field > small, .field label > small { color: var(--faint); font-size: 9px; font-weight: 500; }
input, select, textarea { width: 100%; min-height: 38px; padding: 8px 11px; color: #24343f; background: white; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 12px; transition: border .14s ease, box-shadow .14s ease; }
input:focus, select:focus, textarea:focus { border-color: #6f9fbe; box-shadow: 0 0 0 3px #e8f1f6; outline: 0; }
.input-unit { position: relative; display: block; }
.input-unit input { padding-right: 48px; }
.input-unit > span { position: absolute; right: 10px; top: 50%; color: #77838d; font-size: 10px; transform: translateY(-50%); pointer-events: none; }
.core-path { display: block; margin-top: 3px; color: #98a3aa !important; font: 8px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace !important; font-weight: 500 !important; }
fieldset { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 6px; }
.check { display: block; margin: 8px 0; font-weight: 500; }
.check input { width: auto; min-height: auto; margin-right: 8px; }
.scope-note, .ready-notice { padding: 12px 14px; color: #405c6d; background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 0 4px 4px 0; font-size: 11px; }
.validation-summary { margin: 16px 28px 0; padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px; color: #7b312c; background: var(--red-soft); border: 1px solid #edc8c3; border-radius: 5px; font-size: 11px; }
.validation-summary.compact { margin: 15px 0; }
.validation-summary[hidden] { display: none; }
.validation-summary .ui-icon { color: var(--red); }
.validation-summary ul { margin: 7px 0 0; padding-left: 18px; }
.form-actions { margin: 26px -28px 0; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fafbfb; border-top: 1px solid var(--line); }
.form-actions .primary { margin-left: auto; }
.creation-form .form-actions { margin: 28px -28px -28px; }
.review-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 24px 0; }
.review-grid section { padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
dt { color: var(--muted); }
dd { margin: 0; font-weight: 650; }
.flue-editor { display: grid; grid-template-columns: minmax(0,1fr) 245px; gap: 26px; align-items: start; }
.segment-card { position: relative; margin: 20px 0; padding: 20px; background: #fbfcfc; }
.segment-card legend { padding: 0 8px; color: #334751; font-size: 11px; }
.segment-card .danger { position: absolute; right: 13px; top: 10px; }
.field-section + .field-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid #edf0f2; }
.section-head h3 { margin: 0; font-size: 12px; }
.section-head p { margin: 3px 0 0; color: var(--faint); font-size: 10px; }
.add-segment { margin-bottom: 24px; }
.system-diagram { position: sticky; top: 92px; padding: 15px; color: #405561; background: #f8faf9; border: 1px solid var(--line); border-radius: 5px; }
.system-diagram > strong { display: block; margin-bottom: 8px; font-size: 10px; }
.system-diagram svg { width: 100%; height: 270px; display: block; }
.system-diagram text { fill: #6f7e87; stroke: none; font-size: 8px; }
.system-diagram text:nth-of-type(-n+2) { fill: var(--blue); font-size: 10px; }
.diagram-accent { color: var(--blue); }
.diagram-guide { color: #9aa6ad; stroke-dasharray: 3 3; }
.diagram-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; color: #7b8790; font-size: 8px; }

/* Result */
.result-grid { display: grid; grid-template-columns: minmax(0,1.48fr) minmax(290px,.72fr); gap: 20px; }
.result-main { min-width: 0; }
.result-hero { padding: 23px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: linear-gradient(100deg,#f2f9f7 0%,#fff 72%); border: 1px solid #cfe4df; border-radius: var(--radius); box-shadow: var(--shadow); }
.result-hero.fail { background: linear-gradient(100deg,#fff4f2 0%,#fff 72%); border-color: #efcfca; }
.result-hero.incomplete { background: linear-gradient(100deg,#fff8e9 0%,#fff 72%); border-color: #ead39c; }
.result-lockup { min-width: 0; display: flex; align-items: center; gap: 14px; }
.result-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--teal); border-radius: 50%; }
.result-icon .ui-icon { width: 21px; height: 21px; stroke-width: 2; }
.result-hero.fail .result-icon, .run-message.failure .result-icon { background: var(--red); }
.result-hero.incomplete .result-icon, .run-message.pending .result-icon { background: var(--amber); }
.result-hero h2 { margin: 0; color: #075e56; font-size: 19px; letter-spacing: -.02em; }
.result-hero.fail h2 { color: #8d2f29; }
.result-hero.incomplete h2 { color: #79510d; }
.result-hero p { margin: 4px 0 0; color: #647871; font-size: 11px; }
.result-id { max-width: 190px; color: #72817c; font-size: 9px; text-align: right; overflow-wrap: anywhere; }
.result-id strong { display: block; margin-top: 2px; color: #43565f; }
.summary-metrics { margin: 14px 0; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.summary-metric { padding: 17px; display: block; background: white; border: 1px solid var(--line); border-radius: 6px; }
.summary-metric span, .summary-metric small { display: block; color: var(--muted); font-size: 10px; }
.summary-metric strong { margin: 6px 0 3px; display: block; color: #1e3645; font-size: 22px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.summary-metric strong.fail { color: var(--red); }
.summary-metric strong.pass { color: var(--teal); }
.summary-metric small { color: var(--faint); font-size: 9px; }
.criteria-panel { padding: 20px; }
.panel-title { margin-bottom: 17px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-title h2, .panel-title h3 { margin: 0; font-size: 12px; }
.panel-title p { margin: 3px 0 0; color: var(--faint); font-size: 9px; }
.criteria-table { min-width: 780px; }
.criteria-table th { height: 35px; padding: 0 10px; font-size: 8px; }
.criteria-table td { height: 43px; padding: 7px 10px; border-bottom: 1px solid #edf0f2; font-size: 10px; vertical-align: middle; }
.criteria-table td strong, .criteria-table td small { display: block; }
.criteria-table td small { margin-top: 2px; color: var(--faint); }
.criteria-table .margin { font-weight: 800; white-space: nowrap; }
.criteria-table .margin.pass { color: var(--teal); }
.criteria-table .margin.fail { color: var(--red); }
.criterion-not_applicable { color: #7c898f; }
.case-badge { padding: 3px 6px; display: inline-flex; color: #50606b; background: #eef2f4; border-radius: 3px; font-size: 8px; font-weight: 750; }
.result-note { margin: 12px 0 0; padding: 10px 12px; color: #63717a; background: #f5f7f7; border: 1px solid var(--line); border-radius: 4px; font-size: 9px; }
.result-side { display: grid; align-content: start; gap: 14px; }
.side-panel { padding: 18px; }
.quiet-copy { color: var(--muted); font-size: 10px; }
.notice-list { margin: 0; padding: 0; list-style: none; }
.notice-list li { padding: 10px 0; display: flex; gap: 8px; color: #5f6d77; border-top: 1px solid #edf0f2; font-size: 10px; }
.notice-list li:first-child { border-top: 0; }
.notice-list .ui-icon { width: 14px; height: 14px; color: var(--amber); }
.notice-list strong { display: block; color: #42545f; }
.detail-list { grid-template-columns: auto minmax(0,1fr); gap: 10px 16px; margin: 0; font-size: 10px; }
.detail-list dd { text-align: right; overflow-wrap: anywhere; }
.result-actions { display: grid; gap: 8px; }
.result-actions form, .result-actions .button { width: 100%; }
.result-actions .button { justify-content: flex-start; }
.run-message { padding: 24px; display: flex; align-items: center; gap: 16px; }
.run-message h2 { margin: 2px 0; }
.run-message p { margin: 4px 0; color: var(--muted); }
.live-run { align-items: flex-start; }
.live-run-body { min-width: 0; flex: 1; }
.live-run-details { margin: 20px 0 12px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 5px; }
.live-run-details > div { min-width: 0; padding: 11px 12px; background: white; }
.live-run-details dt, .live-run-details dd { display: block; }
.live-run-details dt { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.live-run-details dd { margin-top: 4px; overflow: hidden; color: #334650; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.live-run-details code { font-size: 8px; }
.live-connection { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-size: 9px; font-weight: 700; }
.live-connection i { width: 7px; height: 7px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 0 rgba(8,119,107,.35); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 5px rgba(8,119,107,0); } }
.audit-history { margin-top: 24px; padding: 20px; }
.audit-list { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.audit-row { min-height: 62px; padding: 10px 14px; display: grid; grid-template-columns: minmax(0,1fr) auto 18px; align-items: center; gap: 14px; color: inherit; border-bottom: 1px solid #edf0f2; text-decoration: none; }
.audit-row:last-child { border-bottom: 0; }
.audit-row:hover, .audit-row.active { background: #f7f9f9; }
.audit-row strong, .audit-row small { display: block; }
.audit-row small { margin-top: 2px; color: var(--faint); font-size: 10px; }
.audit-row > .ui-icon { color: var(--faint); }

/* Reports */
.report-layout { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 20px; align-items: start; }
.report-preview { max-width: 900px; min-width: 0; margin: 0 auto; padding: 50px 54px; background: white; border: 1px solid var(--line); box-shadow: 0 10px 35px rgba(25,39,47,.09); }
.verification-report { max-width: 960px; margin: auto; }
.report-masthead, .report-footer { display: flex; justify-content: space-between; gap: 20px; }
.report-masthead { padding-bottom: 20px; border-bottom: 2px solid #253c49; }
.report-masthead div { display: grid; }
.report-masthead span, .report-footer { color: var(--muted); font-size: 9px; }
.report-title-block { padding: 30px 0 20px; }
.report-title-block h1 { margin: 4px 0; font-size: 24px; }
.report-title-block p { margin: 0; color: var(--muted); font-size: 10px; }
.report-decision { margin-bottom: 24px; display: grid; grid-template-columns: 1.35fr 1fr 1fr; background: #f1f8f4; border: 1px solid #bfd8c9; border-left: 5px solid var(--teal); }
.report-decision.fail { background: #fff4f2; border-color: #e5bbb7; border-left-color: var(--red); }
.report-decision.incomplete { background: #fff9e9; border-color: #ead39c; border-left-color: var(--amber); }
.report-decision div { padding: 16px; display: grid; gap: 2px; }
.report-decision div + div { border-left: 1px solid var(--line); }
.report-decision span, .report-decision small { color: var(--muted); font-size: 9px; }
.report-decision strong { font-size: 18px; }
.verification-report .report-section { margin: 26px 0; padding: 0; border: 0; }
.verification-report .report-section h2 { margin: 0 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.report-data-grid { margin: 0; display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--line); }
.report-data-grid div { padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.report-data-grid dt { font-size: 9px; }
.report-data-grid dd { margin-top: 2px; font-size: 10px; }
.report-explainer { color: var(--muted); font-size: 10px; }
.report-criteria { width: 100%; border-collapse: collapse; font-size: 9px; }
.report-criteria th { padding: 8px; color: var(--muted); background: #f5f7f7; border-bottom: 1px solid var(--line); text-align: left; text-transform: uppercase; font-size: 8px; }
.report-criteria td { padding: 8px; border-bottom: 1px solid #e3e7e9; vertical-align: top; }
.report-criteria td small { display: block; color: var(--muted); }
.report-criteria tr.fail td:nth-last-child(-n+2) { color: var(--red); }
.report-criteria tr.pass td:nth-last-child(-n+2) { color: var(--teal); }
.report-criteria tr.not_applicable { color: #7d898f; }
.report-two-column { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.report-two-column ul { padding-left: 18px; }
.report-manifest { margin: 0; padding: 14px; display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 5px 12px; background: #f5f7f7; font: 9px/1.4 ui-monospace,monospace; overflow-wrap: anywhere; }
.report-manifest dd { font-weight: normal; }
.report-footer { margin-top: 30px; padding-top: 9px; border-top: 1px solid var(--line); }
.report-tools { position: sticky; top: 94px; padding: 17px; }
.report-tools h2 { margin: 0 0 4px; font-size: 12px; }
.report-tools > p { margin: 0 0 14px; color: var(--muted); font-size: 10px; }
.report-option { margin-bottom: 14px; padding: 11px 0; display: flex; align-items: flex-start; gap: 8px; border-block: 1px solid #edf0f2; }
.option-dot { width: 13px; height: 13px; margin-top: 1px; display: block; border: 4px solid var(--blue); border-radius: 50%; }
.report-option strong, .report-option small { display: block; }
.report-option strong { font-size: 10px; }
.report-option small { margin-top: 2px; color: var(--faint); font-size: 9px; }
.report-tools .button { width: 100%; margin-top: 8px; justify-content: flex-start; }
.report-digest { margin: 16px 0 0; display: block; }
.report-digest dt { font-size: 9px; }
.report-digest dd { margin-top: 5px; }
.report-digest code { display: block; overflow-wrap: anywhere; font-size: 8px; }

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

@media (max-width: 1120px) {
  .flue-editor { grid-template-columns: 1fr; }
  .system-diagram { display: none; }
  .result-grid, .report-layout { grid-template-columns: 1fr; }
  .report-tools { position: static; }
  .result-side { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-column: 1/-1; grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 980px) {
  :root { --sidebar-width: 72px; }
  .brand { padding: 0 20px; }
  .brand-copy, .sidebar-label, .nav-link span, .workspace-identity { display: none; }
  .side-nav { padding: 0 12px; }
  .nav-link { justify-content: center; padding: 0; }
  .sidebar-footer { justify-content: center; padding-inline: 0; }
  .avatar { display: none; }
  .signout-button { margin: 0; }
  .wizard-shell { grid-template-columns: 180px minmax(0,1fr); }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  :root { --sidebar-width: 0px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 50; width: 100%; height: 64px; flex-direction: row; border: 0; box-shadow: 0 -4px 18px rgba(20,33,43,.12); }
  .brand, .sidebar-label, .avatar { display: none; }
  .side-nav { width: 100%; padding: 7px; display: grid; grid-template-columns: 1fr; }
  .nav-link { height: 50px; margin: 0; gap: 5px; flex-direction: column; justify-content: center; font-size: 9px; }
  .nav-link span { display: block; }
  .nav-link .ui-icon { width: 16px; height: 16px; }
  .sidebar-footer { width: 54px; margin: 7px 7px 7px 0; padding: 0; border: 0; }
  .signout-button { width: 50px; height: 50px; }
  .topbar { height: 58px; padding: 0 18px; }
  .scope-pill { display: none; }
  .breadcrumb { font-size: 11px; }
  .app-content { padding: 22px 14px 88px; }
  .flash-stack { margin-top: 12px; padding: 0 14px; }
  .page-head { min-height: 0; flex-direction: column; gap: 16px; }
  .page-head > .button, .page-head > form, .page-head > form .button, .page-head-actions, .page-head-actions .button, .page-head-actions form { width: 100%; }
  .page-head-actions { align-items: stretch; flex-direction: column; }
  h1 { font-size: 25px; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-form { width: 100%; }
  .workspace-table { min-width: 680px; }
  .project-grid { grid-template-columns: 1fr; }
  .simple-list-row { align-items: stretch; flex-direction: column; }
  .wizard-shell { display: block; min-height: auto; overflow: visible; }
  .wizard-steps { padding: 8px; display: flex; gap: 4px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .stepper-label, .step-copy small { display: none; }
  .wizard-step { flex: 0 0 auto; align-items: center; padding: 8px 10px; }
  .wizard-panel-header { padding: 20px 18px 16px; }
  .save-status { display: none; }
  .wizard-form { padding: 20px 18px 0; }
  .field-grid, .review-grid, .summary-metrics { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .validation-summary { margin-inline: 18px; }
  .form-actions { margin-inline: -18px; padding-inline: 18px; align-items: stretch; flex-direction: column; }
  .form-actions .button, .form-actions button { width: 100%; margin-left: 0; }
  .creation-form .form-actions { margin: 28px -28px -28px; }
  .segment-card { padding: 16px; }
  .segment-card .danger { position: static; float: right; margin-top: -40px; }
  .result-hero { align-items: flex-start; flex-direction: column; }
  .result-id { max-width: 100%; text-align: left; }
  .result-side { grid-template-columns: 1fr; }
  .live-run-details { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-column: auto; grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: minmax(0,1fr) auto; }
  .audit-row > .ui-icon { display: none; }
  .report-preview { padding: 28px 22px; overflow-x: auto; }
  .report-decision, .report-data-grid, .report-two-column { grid-template-columns: 1fr; }
  .report-decision div + div { border-left: 0; border-top: 1px solid var(--line); }
  .report-criteria { min-width: 680px; }
  .report-manifest { grid-template-columns: 1fr; }
}
