/* === Base / state shell === */
:root {
  --bg: #f3f5f7;
  --surface: #fff;
  --ink: #16201e;
  --muted: #6e7975;
  --line: #dde3e0;
  --green: #087f5b;
  --green-2: #e5f5ef;
  --teal: #20a879;
  --blue: #3566d6;
  --blue-2: #edf2ff;
  --amber: #aa6d0c;
  --amber-2: #fff6df;
  --red: #b94141;
  --red-2: #fff0ef;
  --nav: #12241f;
  --shadow: 0 10px 28px rgba(22, 45, 37, 0.09);
  font-family: Inter, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  font-size: 14px;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template: 64px 1fr/236px 1fr;
}

.readonly-banner {
  grid-column: 1 / -1;
  background: #fff4cc;
  color: #664d00;
  border-bottom: 1px solid #e4c55a;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 20;
}

.readonly-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.readonly-fieldset:disabled {
  opacity: 0.78;
}

.app-shell.is-read-only {
  grid-template-rows: auto 60px 1fr;
}

.app-shell.is-read-only .readonly-banner { grid-row: 1; }
.app-shell.is-read-only .topbar { grid-row: 2; }
.app-shell.is-read-only .sidebar,
.app-shell.is-read-only main { grid-row: 3; }
.topbar {
  grid-column: 1/-1;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 22px;
  z-index: 3;
}
.brand {
  width: 214px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 720;
  font-size: 16px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-size: 12px;
  letter-spacing: -1px;
}
.env {
  font-size: 11px;
  color: var(--green);
  background: var(--green-2);
  padding: 4px 7px;
  border-radius: 5px;
}
.project-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 1px solid var(--line);
  padding-left: 20px;
}
.chev {
  color: var(--muted);
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.sidebar {
  background: var(--nav);
  color: #d8e4df;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 64px);
}
.side-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 8px;
  text-transform: uppercase;
  color: #80958d;
  font-size: 11px;
  letter-spacing: 0.1em;
}
.icon-btn {
  border: 0;
  background: #24443a;
  color: #d7e9e2;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 18px;
  cursor: pointer;
}
.experiment {
  width: 100%;
  border: 0;
  background: transparent;
  color: #d9e5e0;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  text-align: left;
  gap: 9px;
  padding: 11px 9px;
  border-radius: 9px;
  cursor: pointer;
}
.experiment.active {
  background: #1b352d;
}
.experiment strong {
  font-size: 12px;
}
.experiment small {
  display: block;
  color: #81968e;
  font-size: 11px;
  margin-top: 4px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #81938d;
  margin-top: 5px;
}
.status-dot.success {
  background: #46d49d;
  box-shadow: 0 0 0 3px rgba(70, 212, 157, 0.13);
}
.status-dot.warn {
  background: #f2b84b;
}
.more {
  color: #72877f;
}
.nav {
  border-top: 1px solid #2a4039;
  margin-top: 13px;
  padding-top: 13px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav a {
  color: #9fb0aa;
  text-decoration: none;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.nav a.active {
  background: #eff8f4;
  color: #0d3428;
  font-weight: 670;
}
.nav-icon {
  font-size: 16px;
}
.nav em {
  font-size: 11px;
  font-style: normal;
  background: #2a443b;
  padding: 3px 6px;
  border-radius: 8px;
}
.nav a.active em {
  background: #d8ebe4;
}
.nav em.green {
  color: #70e3b5;
}
.side-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ghost {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 8px 11px;
  color: #44514d;
  cursor: pointer;
}
.sidebar .ghost {
  background: transparent;
  border-color: #2a443b;
  color: #a9b8b3;
}
.full {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
.avatar {
  border: 0;
  background: #dce9e4;
  color: #244238;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: bold;
}
.workspace {
  padding: 24px 28px 48px;
  max-width: 1500px;
  margin: auto;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.page-head h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.03em;
}
.page-head p {
  margin: 7px 0 0;
  color: var(--muted);
}
.head-actions {
  display: flex;
  gap: 8px;
}
.primary {
  border: 0;
  background: var(--green);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 650;
  cursor: pointer;
}
.secondary {
  border: 1px solid var(--line);
  background: white;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: #40504b;
  cursor: pointer;
}
.primary:hover {
  background: #076c4e;
}
.progress-rail {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 18px;
  overflow: hidden;
}
.progress-step {
  border-right: 1px solid var(--line);
  padding: 13px 14px;
  display: flex;
  gap: 9px;
  align-items: center;
  cursor: pointer;
}
.progress-step:last-child {
  border: 0;
}
.progress-step.active {
  background: var(--green-2);
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6ebe9;
  color: #58645f;
  font-size: 11px;
}
.complete .step-num {
  background: var(--green);
  color: white;
}
.progress-step strong {
  display: block;
  font-size: 12px;
}
.progress-step small {
  font-size: 11px;
  color: var(--muted);
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 1px 1px rgba(20, 40, 30, 0.02);
}
.card-head {
  padding: 17px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 15px;
}
.card-body {
  padding: 18px;
}
.section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #73807b;
  margin: 2px 0 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}
.field label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #cfd8d4;
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: #24312d;
  font: inherit;
  outline: 0;
}
.field textarea {
  resize: vertical;
  min-height: 84px;
  font-family: Consolas, monospace;
  font-size: 12px;
}
.field input:focus,
.field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.1);
}
.field small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.span-2 {
  grid-column: 1/-1;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 650;
  background: #eef1f0;
  color: #53615c;
}
.chip.green {
  background: var(--green-2);
  color: var(--green);
}
.chip.blue {
  background: var(--blue-2);
  color: var(--blue);
}
.chip.amber {
  background: var(--amber-2);
  color: var(--amber);
}
.source {
  font-family: Consolas, monospace;
  font-size: 11px;
  background: #f1f3f2;
  color: #67736f;
  padding: 2px 5px;
  border-radius: 3px;
}
.config-block {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.config-block:first-child {
  padding-top: 0;
  border: 0;
}
.segmented {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.segmented button {
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 11px;
  border-radius: 7px;
  color: #53605c;
  cursor: pointer;
}
.segmented button.selected {
  border-color: var(--green);
  background: var(--green-2);
  color: var(--green);
  font-weight: 650;
}
.helpbox {
  background: #f6f8f7;
  border-radius: 9px;
  padding: 12px;
  color: #53605c;
  font-size: 12px;
  line-height: 1.55;
}
.helpbox strong {
  color: var(--ink);
}
.validation {
  display: flex;
  gap: 9px;
  padding: 11px 12px;
  background: var(--amber-2);
  border: 1px solid #f0d99d;
  border-radius: 8px;
  color: #76511b;
  font-size: 12px;
  margin-top: 14px;
}
.sticky {
  position: sticky;
  top: 20px;
  height: max-content;
}
.summary-list {
  display: flex;
  flex-direction: column;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.summary-row:last-child {
  border: 0;
}
.summary-row span {
  color: var(--muted);
}
.resource-bar {
  height: 8px;
  background: #e9edeb;
  border-radius: 8px;
  overflow: hidden;
  margin: 7px 0;
}
.resource-bar i {
  display: block;
  height: 100%;
  background: var(--teal);
  width: 71%;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 17px;
}
.metric {
  padding: 16px;
}
.metric-label {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.metric-value {
  font-size: 25px;
  font-weight: 730;
  margin: 8px 0 5px;
  letter-spacing: -0.04em;
}
.delta {
  font-size: 11px;
  color: var(--green);
}
.delta.bad {
  color: var(--red);
}
.decision-banner {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  background: #17382e;
  color: white;
  padding: 22px 24px;
  border-radius: 12px;
  margin-bottom: 17px;
}
.decision-banner h2 {
  margin: 4px 0 8px;
  font-size: 20px;
}
.decision-banner p {
  color: #b8cec6;
  line-height: 1.55;
  margin: 0;
}
.decision-score {
  border-left: 1px solid #34564b;
  padding-left: 22px;
  display: flex;
  align-items: center;
  gap: 15px;
}
.score {
  width: 66px;
  height: 66px;
  border: 6px solid #48c995;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: bold;
}
.evidence-link {
  color: #72dcb4;
  text-decoration: none;
  font-weight: 650;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px;
}
.chart {
  height: 190px;
  position: relative;
  padding: 20px 12px 22px 40px;
}
.chart-grid {
  position: absolute;
  inset: 20px 12px 28px 40px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    #e8ecea 32px
  );
}
.bars {
  position: absolute;
  inset: 30px 20px 28px 50px;
  display: flex;
  align-items: flex-end;
  gap: 25px;
}
.bar-group {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  position: relative;
}
.bar {
  flex: 1;
  background: #aab8b3;
  border-radius: 4px 4px 0 0;
}
.bar.opt {
  background: var(--teal);
}
.bar-label {
  position: absolute;
  bottom: -19px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.callout {
  border-left: 3px solid var(--green);
  padding: 3px 0 3px 12px;
  margin: 14px 0;
  font-size: 12px;
  line-height: 1.55;
}
.callout strong {
  display: block;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: #7a8782;
  letter-spacing: 0.06em;
  padding: 9px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 11px 9px;
  border-bottom: 1px solid #edf0ef;
  font-size: 12px;
}
.table tr.clickable {
  cursor: pointer;
}
.table tr.clickable:hover,
.table tr.selected {
  background: #f0f8f5;
}
.run-stage {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.run-stage:last-child {
  border: 0;
}
.stage-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-2);
  color: var(--green);
  font-size: 11px;
}
.run-stage small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.log {
  background: #14211d;
  color: #9cc3b5;
  border-radius: 8px;
  padding: 14px;
  font:
    11px/1.7 Consolas,
    monospace;
  max-height: 210px;
  overflow: auto;
}
.topology {
  padding: 18px;
  min-height: 310px;
  background: #f8faf9;
}
.cabinet {
  border: 1px solid #b8c7c1;
  border-radius: 10px;
  padding: 13px;
  background: white;
}
.cabinet-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.nodes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.node {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
}
.node.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(8, 127, 91, 0.1);
}
.npus {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.npu {
  height: 30px;
  border-radius: 4px;
  background: #dcebe6;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #315348;
  cursor: pointer;
}
.npu.hot {
  background: #f7dba6;
  color: #805514;
}
.legend {
  display: flex;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}
.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 17px;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 13px 11px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--green);
  border-color: var(--green);
  font-weight: 650;
}
.operator-graph {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 26px 18px;
  overflow-x: auto;
  min-height: 160px;
}
.op {
  min-width: 104px;
  border: 1px solid var(--line);
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.op.active {
  border-color: var(--green);
  background: var(--green-2);
}
.op.comm {
  border-style: dashed;
  border-color: #5b7ed1;
  background: var(--blue-2);
}
.op strong {
  font-size: 11px;
}
.op small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}
.arrow {
  color: #94a29d;
}
.roofline {
  height: 230px;
  position: relative;
  background: linear-gradient(#fff, #fafcfa);
  overflow: hidden;
}
.roof-axis-x,
.roof-axis-y {
  position: absolute;
  background: #aeb9b5;
}
.roof-axis-x {
  height: 1px;
  left: 45px;
  right: 18px;
  bottom: 32px;
}
.roof-axis-y {
  width: 1px;
  top: 18px;
  bottom: 32px;
  left: 45px;
}
.roof-line {
  position: absolute;
  width: 72%;
  height: 2px;
  background: var(--green);
  transform: rotate(-24deg);
  left: 34px;
  top: 124px;
  transform-origin: left;
}
.roof-flat {
  position: absolute;
  width: 43%;
  height: 2px;
  background: var(--green);
  right: 18px;
  top: 58px;
}
.roof-dot {
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--blue);
  cursor: pointer;
}
.roof-dot.active {
  background: #ee8b2b;
  box-shadow: 0 0 0 3px #fde2c7;
}
.compare-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 17px;
}
.compare-step {
  background: white;
  border: 1px solid var(--line);
  border-right: 0;
  padding: 15px;
  position: relative;
  cursor: pointer;
}
.compare-step:first-child {
  border-radius: 9px 0 0 9px;
}
.compare-step:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 9px 9px 0;
}
.compare-step.active {
  background: var(--green-2);
  border-color: #9bcfbc;
}
.compare-step span {
  font-size: 11px;
  color: var(--muted);
}
.compare-step strong {
  display: block;
  margin: 5px 0;
}
.change {
  font-size: 11px;
  color: var(--green);
}
.compare-step:after {
  content: "›";
  position: absolute;
  right: -7px;
  top: 27px;
  z-index: 2;
  background: white;
  border: 1px solid var(--line);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.compare-step:last-child:after {
  display: none;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #15352c;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s;
  pointer-events: none;
  z-index: 9;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.persistent-alert {
  position: fixed;
  z-index: 20;
  top: 68px;
  right: 24px;
  max-width: min(520px, calc(100vw - 48px));
  padding: 12px 16px;
  border: 1px solid #d42b35;
  border-left: 4px solid var(--brand-red);
  border-radius: 4px;
  background: #fff4f4;
  color: #7d1118;
  box-shadow: var(--shadow);
  font-size: 13px;
}
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 190px 1fr;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sticky {
    position: static;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nodes {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === State workflow and drawers === */
.result-tabs {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 17px;
  padding: 0 12px;
  overflow-x: auto;
}
.result-tabs button {
  white-space: nowrap;
}
.result-body {
  min-height: 420px;
}
.result-scenarios {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: -5px 0 17px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.result-scenarios > div:first-child { min-width: 130px; }
.result-scenarios strong,
.result-scenarios span { display: block; }
.result-scenarios span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.scenario-buttons { display: flex; gap: 8px; overflow-x: auto; padding: 2px; }
.scenario-buttons button { white-space: nowrap; border: 1px solid var(--line); background: #fff; padding: 8px 10px; border-radius: 5px; }
.scenario-buttons button[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
@media (max-width: 1100px) {
  .result-scenarios { align-items: flex-start; }
  .scenario-buttons { flex-wrap: wrap; overflow-x: visible; }
}
.link-button,
.text-action {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.text-action {
  color: var(--green);
  font-weight: 650;
}
.full-center {
  width: 100%;
  margin-top: 14px;
}
.timeline-mini {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin: 18px 0;
}
.timeline-mini i {
  height: 24px;
  background: #9dd5c0;
  border-radius: 4px;
}
.timeline-mini i.comm {
  background: #8aa5df;
}
.compare-steps:has(.compare-step:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 720px) {
  .app-shell {
    display: block;
  }
  .topbar {
    position: sticky;
    top: 0;
  }
  .sidebar {
    min-height: auto;
  }
  .side-bottom {
    display: none;
  }
  .nav {
    flex-direction: row;
  }
  .nav a {
    flex: 1;
  }
  .nav-icon,
  .nav em {
    display: none;
  }
  .workspace {
    padding: 18px 14px;
  }
  .page-head {
    gap: 12px;
  }
  .head-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .progress-rail {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
  .metric-grid {
    grid-template-columns: 1fr;
  }
  .compare-steps {
    grid-template-columns: 1fr !important;
  }
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 20, 0.36);
  z-index: 20;
}
.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(520px, 92vw);
  background: #fff;
  z-index: 21;
  box-shadow: -16px 0 44px rgba(12, 30, 24, 0.18);
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  margin: 0;
  font-size: 18px;
}
.drawer-body {
  padding: 16px;
  overflow: auto;
}
.drawer-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.drawer-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 13px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
}
.drawer-item:hover {
  border-color: var(--green);
  background: var(--green-2);
}
.drawer-item strong,
.drawer-item small {
  display: block;
}
.drawer-item small {
  color: var(--muted);
  margin-top: 5px;
}
.drawer-item .error-text {
  color: var(--red);
}
.hash-wrap {
  font:
    10px/1.5 Consolas,
    monospace;
  max-width: 185px;
  overflow-wrap: anywhere;
  text-align: right;
}
.hash-panel {
  font:
    11px/1.6 Consolas,
    monospace;
  background: #f1f4f2;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.empty-state {
  text-align: center;
  padding: 34px;
  color: var(--muted);
}
.empty-state h2 {
  color: var(--ink);
}
.chip.red {
  background: var(--red-2);
  color: var(--red);
}
.result-tabs button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.compare-picker {
  margin-bottom: 17px;
}
.table-scroll {
  overflow-x: auto;
}
.block {
  display: block;
  margin-top: 4px;
}
.side-heading span {
  cursor: pointer;
}
.drawer .summary-row strong {
  max-width: 65%;
  overflow-wrap: anywhere;
  text-align: right;
}

/* === Visual tokens and components === */
:root {
  --brand-red: #c7000b;
  --brand-red-dark: #9f0008;
  --brand-red-soft: #fff1f2;
  --data-blue: #1f66e5;
  --data-blue-deep: #15376f;
  --data-blue-soft: #edf4ff;
  --signal-yellow: #f5bf19;
  --signal-amber: #a15c00;
  --signal-soft: #fff7dc;
  /* Cross-visual category contract: compute=red, memory=blue, communication=yellow. */
  --category-compute: #c7000b;
  --category-compute-soft: #fff1f2;
  --category-memory: #1f66e5;
  --category-memory-soft: #edf4ff;
  --category-communication: #805600;
  --category-communication-soft: #fff7dc;
  --selection-strong: #15376f;
  --neutral-950: #101828;
  --neutral-900: #172033;
  --neutral-800: #293348;
  --neutral-700: #465269;
  --neutral-600: #5f6b7d;
  --neutral-500: #7a8597;
  --neutral-400: #a6afbd;
  --neutral-300: #cfd5df;
  --neutral-200: #e3e7ed;
  --neutral-100: #f1f3f6;
  --neutral-50: #f7f8fa;
  --success: #16835b;
  --success-soft: #eaf7f1;
  --error: #c7000b;
  --error-soft: #fff1f2;
  --focus: #1f66e5;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: var(--neutral-950);
  --muted: var(--neutral-600);
  --line: var(--neutral-200);
  --green: var(--brand-red);
  --green-2: var(--brand-red-soft);
  --teal: var(--data-blue);
  --blue: var(--data-blue);
  --blue-2: var(--data-blue-soft);
  --amber: var(--signal-amber);
  --amber-2: var(--signal-soft);
  --red: var(--error);
  --red-2: var(--error-soft);
  --nav: #111b2e;
  --shadow: 0 12px 30px rgba(20, 31, 52, 0.14);
  color: var(--ink);
  font-family:
    "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Noto Sans CJK SC", system-ui, sans-serif;
  font-synthesis: none;
}

html {
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #075bd8;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff !important;
}
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed !important;
  opacity: 0.4;
  filter: saturate(0.35);
  pointer-events: none;
}

.avatar {
  cursor: pointer;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(16, 24, 40, 0.72);
  backdrop-filter: blur(6px);
}

.login-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.login-card h1 { margin: 12px 0 8px; font-size: 24px; }
.login-card form { display: grid; gap: 10px; margin-top: 24px; }
.login-card input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; }
.login-card button { margin-top: 6px; }
.login-error { margin-top: 14px; color: var(--red); }
[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: 0.4;
  pointer-events: none;
}

.app-shell {
  grid-template: 60px 1fr / 248px minmax(0, 1fr);
}
.topbar {
  min-width: 0;
  height: 60px;
  padding: 0 20px;
  border-color: var(--neutral-200);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}
.brand {
  width: 226px;
  gap: 10px;
  color: var(--neutral-950);
  font-size: 16px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--brand-red);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.env {
  padding: 2px 6px;
  border: 1px solid #f0c7ca;
  border-radius: 2px;
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  font-size: 11px;
  font-weight: 600;
}
.project-switcher {
  min-width: 0;
  padding-left: 20px;
  border-color: var(--neutral-200);
  color: var(--neutral-800);
}
.project-switcher strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-actions {
  gap: 6px;
}
.top-actions .ghost {
  border-color: transparent;
  background: transparent;
}
.top-actions .ghost:hover {
  border-color: var(--neutral-200);
  background: var(--neutral-50);
  color: var(--neutral-950);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: var(--data-blue-deep);
  color: #fff;
}

.sidebar {
  min-width: 0;
  min-height: calc(100vh - 60px);
  padding: 20px 12px 14px;
  background: linear-gradient(180deg, #121d31 0%, #0f1829 100%);
  color: #e9edf4;
  border-right: 1px solid #202d43;
}
.side-heading {
  padding: 0 8px 9px;
  color: #8997ad;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.icon-btn {
  border: 1px solid #3b4960;
  border-radius: 3px;
  background: #202c41;
  color: #f2f5f9;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.icon-btn:hover {
  border-color: #66758d;
  background: #2a374d;
}
.experiment {
  position: relative;
  gap: 10px;
  padding: 11px 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #dce3ed;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.experiment:hover {
  border-color: #334158;
  background: #19253a;
}
.experiment.active {
  border-color: #435168;
  background: #202c41;
}
.experiment.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  background: #6e7d93;
}
.experiment strong {
  color: #f4f6fa;
  font-size: 12px;
  font-weight: 650;
}
.experiment small {
  color: #91a0b5;
  font-size: 11px;
}
.status-dot {
  border: 1px solid #a8b3c3;
  background: transparent;
}
.status-dot.success {
  border-color: #48c992;
  background: var(--success);
  box-shadow: none;
}
.status-dot.warn {
  border-color: var(--signal-yellow);
  background: var(--signal-yellow);
}
.nav {
  margin-top: 16px;
  padding-top: 14px;
  border-color: #2a364c;
  gap: 4px;
}
.nav a {
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #aab5c5;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.nav a:hover {
  border-color: #344158;
  background: #19253a;
  color: #f2f5f9;
}
.nav a.active {
  border-color: #45536a;
  background: #fff;
  color: var(--neutral-950);
  box-shadow: inset 3px 0 0 var(--brand-red);
}
.nav-icon {
  color: #8290a5;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.nav a.active .nav-icon {
  color: var(--selection-strong);
}
.nav em {
  border-radius: 2px;
  background: #263248;
  color: #b9c2d0;
}
.nav a.active em {
  background: var(--neutral-100);
  color: var(--neutral-600);
}
.nav em.green {
  color: #8eb6ff;
}
.side-bottom {
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid #28354a;
}
.sidebar .ghost {
  border-color: #354258;
  border-radius: 3px;
  color: #bac4d2;
}
.sidebar .ghost:hover {
  border-color: #5a6980;
  background: #1b273c;
  color: #fff;
}

main {
  min-width: 0;
}
.workspace {
  max-width: 1480px;
  padding: 28px 32px 48px;
}
.page-head {
  gap: 28px;
  margin-bottom: 22px;
}
.eyebrow {
  margin-bottom: 5px;
  color: var(--brand-red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.page-head h1 {
  color: var(--neutral-950);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.page-head p {
  max-width: 850px;
  color: var(--neutral-600);
}
.head-actions {
  flex: 0 0 auto;
  align-items: center;
}

.primary,
.secondary,
.ghost {
  min-height: 36px;
  border-radius: 4px;
  font-weight: 650;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}
.primary {
  border: 1px solid var(--brand-red);
  background: var(--brand-red);
  color: #fff;
  box-shadow: none;
}
.primary:hover {
  border-color: var(--brand-red-dark);
  background: var(--brand-red-dark);
}
.primary:active,
.secondary:active,
.ghost:active {
  transform: translateY(1px);
}
.secondary {
  border-color: var(--neutral-300);
  background: #fff;
  color: var(--neutral-800);
}
.secondary:hover {
  border-color: var(--data-blue);
  background: var(--data-blue-soft);
  color: var(--data-blue-deep);
}
.ghost {
  border-color: var(--neutral-300);
  border-radius: 4px;
  color: var(--neutral-700);
}

.progress-rail {
  border-color: var(--neutral-200);
  border-radius: 4px;
  background: #fff;
  box-shadow: inset 0 -1px 0 var(--neutral-200);
}
.progress-step {
  min-width: 112px;
  padding: 14px;
  border-color: var(--neutral-200);
}
.progress-step:hover {
  background: var(--neutral-50);
}
.progress-step.active {
  background: var(--brand-red-soft);
  box-shadow: inset 0 -3px 0 var(--brand-red);
}
.step-num {
  border: 1px solid var(--neutral-300);
  border-radius: 50%;
  background: #fff;
  color: var(--neutral-600);
  font-variant-numeric: tabular-nums;
}
.complete .step-num {
  border-color: var(--data-blue);
  background: var(--data-blue);
}
.progress-step.active .step-num {
  border-color: var(--brand-red);
  background: var(--brand-red);
  color: #fff;
}
.progress-step strong {
  color: var(--neutral-900);
}

.layout {
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) 320px;
}
.card {
  border-color: var(--neutral-200);
  border-radius: 4px;
  background: #fff;
  box-shadow: none;
}
.card-head {
  min-height: 52px;
  padding: 15px 18px;
  border-color: var(--neutral-200);
}
.card-head h2,
.card-head h3 {
  color: var(--neutral-900);
  font-size: 15px;
  font-weight: 700;
}
.card-body {
  padding: 20px;
}
.section-title {
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.config-block {
  border-color: var(--neutral-200);
}
.field label {
  color: var(--neutral-800);
  font-size: 12px;
}
.field input,
.field select,
.field textarea {
  min-height: 40px;
  border-color: var(--neutral-300);
  border-radius: 3px;
  color: var(--neutral-950);
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.03);
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--neutral-500);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(31, 102, 229, 0.12);
}
.field small {
  color: var(--neutral-600);
}
.segmented {
  gap: 8px;
}
.segmented button {
  border-color: var(--neutral-300);
  border-radius: 3px;
  color: var(--neutral-700);
}
.segmented button:hover {
  border-color: var(--data-blue);
  background: var(--data-blue-soft);
}
.segmented button.selected {
  border-color: var(--brand-red);
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  box-shadow: inset 3px 0 0 var(--brand-red);
}
.helpbox {
  border-left: 3px solid var(--data-blue);
  border-radius: 2px;
  background: var(--data-blue-soft);
  color: var(--neutral-700);
}
.validation {
  align-items: flex-start;
  border-color: #efd27c;
  border-radius: 3px;
  background: var(--signal-soft);
  color: #704500;
}
.remote-notice {
  border-left: 4px solid var(--signal-yellow);
}
.sticky {
  top: 18px;
}
.summary-row {
  border-color: var(--neutral-200);
  font-variant-numeric: tabular-nums;
}
.summary-row span {
  color: var(--neutral-600);
}
.summary-row strong {
  color: var(--neutral-900);
}
.hash-wrap,
.source,
.log,
.hash-panel {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.hash-panel {
  border: 1px solid var(--neutral-200);
  border-radius: 3px;
  background: var(--neutral-50);
}

.chip {
  border: 1px solid var(--neutral-200);
  border-radius: 2px;
  background: var(--neutral-100);
  color: var(--neutral-700);
}
.chip.green {
  border-color: #b9dfcf;
  background: var(--success-soft);
  color: var(--success);
}
.chip.blue {
  border-color: #bfd4fa;
  background: var(--data-blue-soft);
  color: var(--data-blue-deep);
}
.chip.amber {
  border-color: #efd27c;
  background: var(--signal-soft);
  color: var(--signal-amber);
}
.chip.red {
  border-color: #f0c1c4;
  background: var(--error-soft);
  color: var(--error);
}
.source {
  border-radius: 2px;
  background: var(--neutral-100);
  color: var(--neutral-600);
}

.metric-grid {
  gap: 10px;
  margin-bottom: 18px;
}
.metric {
  position: relative;
  min-width: 0;
  padding: 17px 18px;
}
.metric::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 3px;
  background: var(--data-blue);
}
.metric:nth-child(1)::before {
  background: var(--data-blue);
}
.metric-label {
  color: var(--neutral-600);
}
.metric-value {
  color: var(--neutral-950);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.delta {
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.delta.bad {
  color: var(--error);
}
.decision-banner {
  position: relative;
  overflow: hidden;
  border: 1px solid #274779;
  border-radius: 4px;
  background: linear-gradient(105deg, #122f61 0%, #193d77 100%);
  box-shadow: none;
}
.decision-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--brand-red);
}
.decision-banner p {
  color: #c6d4e9;
}
.decision-score {
  border-color: rgba(255, 255, 255, 0.2);
}
.score {
  border-color: var(--brand-red);
  border-radius: 50%;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.evidence-link {
  color: #b9d3ff;
}
.evidence-link:hover {
  color: #fff;
}

.resource-bar {
  border-radius: 2px;
  background: var(--neutral-200);
}
.resource-bar i {
  background: var(--data-blue);
}
.chart-grid {
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 31px,
    var(--neutral-200) 32px
  );
}
.bar {
  border-radius: 2px 2px 0 0;
  background: var(--neutral-400);
}
.bar.opt {
  background: var(--brand-red);
}
.callout {
  border-color: var(--brand-red);
  background: linear-gradient(90deg, var(--brand-red-soft), transparent 70%);
}

.table {
  font-variant-numeric: tabular-nums;
}
.table th {
  padding: 10px 9px;
  border-color: var(--neutral-300);
  background: var(--neutral-50);
  color: var(--neutral-600);
  font-size: 11px;
}
.table td {
  padding: 12px 9px;
  border-color: var(--neutral-200);
}
.table tbody tr:hover {
  background: #f8faff;
}
.table tr.clickable:hover,
.table tr.selected {
  background: var(--data-blue-soft);
  box-shadow: inset 3px 0 0 var(--data-blue);
}
.table-scroll {
  border: 0;
}

.result-tabs {
  border-color: var(--neutral-200);
  border-radius: 4px;
  background: #fff;
}
.tabs {
  border-color: var(--neutral-200);
}
.tabs button {
  color: var(--neutral-600);
  font-weight: 600;
}
.tabs button:hover:not(:disabled) {
  background: var(--neutral-50);
  color: var(--neutral-950);
}
.tabs button.active {
  border-color: var(--brand-red);
  color: var(--brand-red-dark);
}
.run-stage {
  border-color: var(--neutral-200);
}
.stage-icon {
  border: 1px solid #bdd1f2;
  background: var(--data-blue-soft);
  color: var(--data-blue);
}
.run-stage:last-child .stage-icon {
  border-color: #efc1c4;
  background: var(--brand-red-soft);
  color: var(--brand-red);
}
.log {
  border: 1px solid #26364e;
  border-radius: 3px;
  background: #111b2e;
  color: #c3d4ec;
}

.topology {
  border: 1px solid var(--neutral-200);
  background: #f7f9fc;
}
.cabinet {
  border-color: #aebbd0;
  border-radius: 4px;
  box-shadow: inset 0 3px 0 var(--data-blue-deep);
}
.node {
  border-color: #c7d4e7;
  border-radius: 3px;
  background: #fbfdff;
}
.node:hover {
  border-color: var(--data-blue);
}
.node.selected {
  border-color: var(--data-blue);
  box-shadow: 0 0 0 2px rgba(31, 102, 229, 0.12);
}
.npu {
  border: 1px solid #c7d8f3;
  border-radius: 2px;
  background: #e8f1ff;
  color: var(--data-blue-deep);
}
.npu:hover {
  border-color: var(--data-blue);
  background: #d9e8ff;
}
.npu.hot {
  border-color: #e2b643;
  background: var(--signal-soft);
  color: #754600;
}
.legend i {
  border-radius: 1px;
}

.operator-graph {
  background: linear-gradient(180deg, #fff, #fbfcfe);
}
.op {
  position: relative;
  border-color: var(--neutral-300);
  border-radius: 3px;
  box-shadow: inset 0 3px 0 var(--brand-red);
}
.op:hover {
  border-color: var(--brand-red);
  background: var(--brand-red-soft);
}
.op.active {
  border-color: var(--brand-red);
  background: var(--brand-red-soft);
}
.op.comm {
  border-style: solid;
  border-color: #dfb33c;
  background: var(--signal-soft);
  box-shadow: inset 0 3px 0 var(--signal-yellow);
}
.arrow {
  color: var(--neutral-500);
}
.roofline {
  border: 1px solid var(--neutral-200);
  background: linear-gradient(#fff, #f8faff);
}
.roof-axis-x,
.roof-axis-y {
  background: var(--neutral-500);
}
.roof-line,
.roof-flat {
  background: var(--brand-red);
}
.roof-dot {
  background: var(--data-blue);
  box-shadow: 0 0 0 1px var(--data-blue);
}
.roof-displacement {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.roof-displacement line {
  stroke: #68756f;
  stroke-width: 0.45;
  stroke-dasharray: 1.6 1.2;
}
.roof-displacement circle {
  fill: #17211e;
  stroke: #fff;
  stroke-width: 0.35;
}
.roof-dot.active {
  background: var(--signal-yellow);
  box-shadow: 0 0 0 3px rgba(245, 191, 25, 0.28);
}
.timeline-mini i {
  border-radius: 2px;
  background: var(--brand-red);
}
.timeline-mini i.comm {
  background: var(--signal-yellow);
}

.compare-picker {
  border-top: 3px solid var(--data-blue);
}
.compare-steps {
  margin-bottom: 18px;
}
.compare-step {
  border-color: var(--neutral-200);
  background: #fff;
}
.compare-step:first-child {
  border-radius: 4px 0 0 4px;
}
.compare-step:last-child {
  border-radius: 0 4px 4px 0;
}
.compare-step:hover {
  background: var(--neutral-50);
}
.compare-step.active {
  border-color: #efb7ba;
  background: var(--brand-red-soft);
  box-shadow: inset 0 3px 0 var(--brand-red);
}
.compare-step strong {
  font-variant-numeric: tabular-nums;
}
.change {
  color: var(--data-blue-deep);
}
.compare-step.active .change {
  color: var(--brand-red-dark);
}
.compare-step::after {
  border-color: var(--neutral-300);
  border-radius: 50%;
  color: var(--neutral-600);
}

.drawer-backdrop {
  background: rgba(10, 18, 34, 0.44);
  backdrop-filter: blur(1px);
}
.drawer {
  border-left: 1px solid var(--neutral-300);
  box-shadow: -16px 0 36px rgba(20, 31, 52, 0.16);
}
.drawer-head {
  border-color: var(--neutral-200);
}
.drawer-item {
  border-color: var(--neutral-200);
  border-radius: 3px;
}
.drawer-item:hover {
  border-color: var(--data-blue);
  background: var(--data-blue-soft);
}
.empty-state {
  border-style: dashed;
  background: #fff;
}
.toast {
  border-radius: 3px;
  background: var(--neutral-950);
  box-shadow: var(--shadow);
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 212px minmax(0, 1fr);
  }
  .brand {
    width: 190px;
  }
  .workspace {
    padding: 24px 22px 42px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 14px;
  }
  .card-body {
    padding: 17px;
  }
  .progress-step {
    padding: 12px 9px;
  }
  .progress-step small {
    display: none;
  }
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .brand {
    width: 168px;
  }
  .project-switcher {
    padding-left: 14px;
  }
  .project-switcher .muted {
    display: none;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sticky {
    position: static;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col {
    gap: 12px;
  }
  .topology {
    overflow-x: auto;
  }
  .nodes {
    min-width: 560px;
  }
}

@media (max-width: 800px) {
  .top-actions .ghost {
    padding-inline: 7px;
  }
  .env,
  .project-switcher {
    display: none;
  }
  .brand {
    width: auto;
  }
}

@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;
  }
  .toast {
    transform: none;
  }
}

/* Round 2 release-gate refinements: decision continuity and technical visual grammar. */
.decision-banner .eyebrow {
  color: #bfd5fb !important;
}
.card-head h2,
.card-head h3 {
  word-break: keep-all;
  overflow-wrap: normal;
}

.compare-decision {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.8fr) minmax(330px, 1.65fr) minmax(180px, 1fr)
    auto;
  gap: 18px;
  align-items: center;
  min-height: 82px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #bdc9da;
  border-left: 4px solid var(--selection-strong);
  border-radius: 4px;
  background: #f7f9fc;
}
.compare-decision.is-disabled {
  border-left-color: var(--neutral-500);
  background: var(--neutral-50);
}
.decision-status span,
.compare-decision small {
  display: block;
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.decision-status strong {
  display: block;
  margin-top: 3px;
  color: var(--neutral-950);
  font-size: 16px;
}
.decision-gains {
  display: grid;
  grid-template-columns: repeat(4, minmax(58px, 1fr));
  border-left: 1px solid var(--neutral-200);
}
.decision-gains > span {
  padding: 2px 12px;
  border-right: 1px solid var(--neutral-200);
}
.decision-gains strong {
  display: block;
  margin-top: 2px;
  color: var(--neutral-900);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.decision-gains strong.up,
.decision-gains strong.down {
  color: var(--selection-strong);
}
.decision-risk {
  min-width: 0;
}
.decision-risk strong {
  display: block;
  margin-top: 3px;
  color: var(--signal-amber);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.compare-decision .primary {
  white-space: nowrap;
}

.result-decision-anchor {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  margin: -4px 0 12px;
  padding: 8px 12px;
  border: 1px solid #c6d2e4;
  border-left: 3px solid var(--selection-strong);
  border-radius: 3px;
  background: #f5f8fc;
  color: var(--neutral-700);
  font-size: 12px;
}
.result-decision-anchor > span:first-child {
  color: var(--neutral-900);
}
.result-decision-anchor > span:nth-child(2) {
  color: var(--signal-amber);
}
.result-decision-anchor .text-action {
  margin-left: auto;
  white-space: nowrap;
  color: var(--data-blue-deep);
}
.result-decision-anchor.risk {
  border-left-color: var(--signal-yellow);
  background: var(--signal-soft);
}

.viz-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 9px 16px;
  border-top: 1px solid var(--neutral-200);
  color: var(--neutral-700);
  font-size: 11px;
}
.viz-legend span,
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.viz-legend span::before,
.category-badge::before {
  content: "";
  width: 10px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 1px;
  background: currentColor;
}
.viz-legend .compute,
.category-badge.compute {
  color: var(--category-compute);
}
.viz-legend .memory,
.category-badge.memory {
  color: var(--category-memory);
}
.viz-legend .communication,
.category-badge.communication {
  color: var(--category-communication);
}
.viz-legend small {
  margin-left: auto;
  color: var(--neutral-600);
}
.category-badge {
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.operator-scroll-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: var(--neutral-400) var(--neutral-100);
}
.operator-graph {
  min-width: 930px;
  overflow: visible;
}
.op {
  border-color: var(--neutral-300);
  box-shadow: none;
  text-align: left;
  font: inherit;
  color: var(--neutral-900);
}
.op.compute {
  box-shadow: inset 0 3px 0 var(--category-compute);
}
.op.memory {
  box-shadow: inset 0 3px 0 var(--category-memory);
}
.op.communication {
  border-style: solid;
  border-color: #dfc06d;
  background: var(--category-communication-soft);
  box-shadow: inset 0 3px 0 var(--category-communication);
}
.op.compute:hover {
  border-color: var(--category-compute);
  background: var(--category-compute-soft);
}
.op.memory:hover {
  border-color: var(--category-memory);
  background: var(--category-memory-soft);
}
.op.communication:hover {
  border-color: var(--category-communication);
}
.op.active,
.op.compute.active,
.op.memory.active,
.op.communication.active {
  border-color: var(--selection-strong);
  outline: 2px solid var(--selection-strong);
  outline-offset: 2px;
}
.graph-scroll-hint {
  padding: 7px 16px 10px;
  border-top: 1px solid var(--neutral-100);
  color: var(--neutral-600);
  font-size: 11px;
  text-align: right;
}

.roofline-card {
  min-width: 0;
}
.roofline {
  height: 320px;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--neutral-200);
  background: linear-gradient(180deg, #fff, #f8faff);
  overflow: hidden;
}
.roof-axis-x {
  left: 70px;
  right: 24px;
  bottom: 52px;
  background: var(--neutral-700);
}
.roof-axis-y {
  left: 70px;
  top: 24px;
  bottom: 52px;
  background: var(--neutral-700);
}
.roof-axis-label {
  position: absolute;
  z-index: 4;
  color: var(--neutral-700);
  font-size: 11px;
  font-weight: 650;
}
.roof-axis-label.x {
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
}
.roof-axis-label.y {
  left: 8px;
  top: 50%;
  transform: translate(-28%, -50%) rotate(-90deg);
  white-space: nowrap;
}
.roof-tick {
  position: absolute;
  z-index: 4;
  color: var(--neutral-600);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.roof-tick.x {
  bottom: 34px;
  transform: translateX(-50%);
}
.roof-tick.y {
  left: 38px;
  transform: translateY(-50%);
}
.roof-tick.x::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 17px;
  height: 5px;
  border-left: 1px solid var(--neutral-400);
}
.roof-tick.y::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 50%;
  width: 6px;
  border-top: 1px solid var(--neutral-400);
}
.roof-region {
  position: absolute;
  z-index: 0;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
}
.roof-region.memory {
  left: 72px;
  bottom: 54px;
  width: 43%;
  height: 52%;
  background: rgba(31, 102, 229, 0.055);
  color: var(--category-memory);
}
.roof-region.compute {
  right: 26px;
  top: 26px;
  width: 37%;
  height: 34%;
  background: rgba(199, 0, 11, 0.045);
  color: var(--category-compute);
  text-align: right;
}
.roof-line {
  left: 70px;
  top: auto;
  bottom: 53px;
  width: 61%;
  height: 2px;
  background: var(--category-memory);
  transform: rotate(-31deg);
  transform-origin: left center;
}
.roof-flat {
  left: 55%;
  right: 24px;
  top: 69px;
  width: auto;
  background: var(--category-compute);
}
.roof-line-label {
  position: absolute;
  z-index: 5;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 700;
}
.roof-line-label.bandwidth {
  left: 27%;
  top: 47%;
  color: var(--category-memory);
  transform: rotate(-31deg);
}
.roof-line-label.peak {
  right: 28px;
  top: 47px;
  color: var(--category-compute);
}
.roofline.quantitative .roof-region.dynamic {
  top: 26px;
  right: auto;
  bottom: 54px;
  height: auto;
  padding-top: 7px;
}
.roofline.quantitative .roof-region.memory.dynamic {
  background: rgba(31, 102, 229, 0.045);
  text-align: left;
}
.roofline.quantitative .roof-region.compute.dynamic {
  background: rgba(199, 0, 11, 0.04);
  text-align: right;
}
.roof-envelope {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.roof-envelope polyline {
  fill: none;
  stroke: var(--selection-strong);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}
.roof-line-label.bandwidth.dynamic {
  left: 31%;
  top: 58%;
  transform: none;
}
.roof-line-label.peak.dynamic {
  right: 24px;
  top: 36px;
}
.roof-dot {
  z-index: 7;
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--selection-strong);
  padding: 0;
  cursor: pointer;
  opacity: 0.66;
  transform: scale(0.86);
  transition: opacity 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 24px;
}
.roof-dot:hover,
.roof-dot:focus-visible,
.roof-dot.active {
  z-index: 8;
  opacity: 1;
  transform: scale(1.16);
}
.roof-dot:focus-visible {
  outline: 2px solid var(--selection-strong);
  outline-offset: 4px;
}
.optimization-badge {
  display: inline-block;
  margin: 4px 0;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.roof-dot.compute,
.roof-dot.compute.active {
  background: var(--category-compute);
  border-radius: 50%;
}
.roof-dot.memory,
.roof-dot.memory.active {
  background: var(--category-memory);
  border-radius: 2px;
}
.roof-dot.communication,
.roof-dot.communication.active {
  background: var(--category-communication);
  border-radius: 1px 8px 1px 8px;
}
.roofline.quantitative .roof-dot {
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px currentColor;
  opacity: 0.9;
  transform: translate(-50%, -50%);
  color: inherit;
  font-size: 0;
  line-height: 0;
}
.roofline.quantitative .roof-dot span {
  display: none;
}
.roofline.quantitative .roof-dot:hover,
.roofline.quantitative .roof-dot:focus-visible {
  z-index: 9;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.35);
}
.roofline.quantitative .roof-dot.active {
  z-index: 10;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 3px var(--selection-strong);
  opacity: 1;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  line-height: 24px;
}
.roofline.quantitative .roof-dot.active span {
  display: inline;
}
.roof-dot-label {
  position: absolute;
  z-index: 7;
  margin: -9px 0 0 18px;
  padding: 3px 6px;
  border: 1px solid var(--neutral-300);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--neutral-900);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.roof-dot-label small {
  display: block;
  color: var(--neutral-600);
  font-weight: 500;
}
.card-head .roof-dot-label {
  position: static;
  display: flex;
  gap: 6px;
  margin: 3px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.card-head .roof-dot-label small {
  display: inline;
}
.roof-legend {
  border-top: 0;
}

.timeline-mini {
  grid-template-columns: 1.25fr 1fr 1fr 0.7fr 1.25fr 1fr 0.7fr 1fr;
  align-items: stretch;
  gap: 4px;
}
.timeline-mini i {
  position: relative;
  min-width: 0;
  height: 42px;
  border-radius: 2px;
  background: var(--category-compute);
}
.timeline-mini i.compute {
  background: var(--category-compute);
}
.timeline-mini i.memory {
  background: var(--category-memory);
}
.timeline-mini i.communication {
  background: var(--category-communication);
}
.timeline-mini i span {
  position: absolute;
  left: 3px;
  bottom: 3px;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
}
.timeline-legend {
  padding-inline: 0;
  border-top: 0;
}

.experiment.risk .status-dot {
  border-color: var(--signal-yellow);
  background: var(--signal-yellow);
}
.experiment.risk.active {
  border-color: #9b7a22;
  background: #272b36;
}

@media (max-width: 1200px) {
  .compare-decision {
    grid-template-columns: 160px minmax(0, 1fr);
  }
  .decision-risk {
    grid-column: 1 / 2;
  }
  .compare-decision .primary {
    grid-column: 2 / 3;
    justify-self: end;
  }
  .decision-gains {
    min-width: 0;
  }
}

@media (max-width: 1050px) {
  .env {
    display: none;
  }
  .result-body > .two-col,
  .result-body > .evidence-split,
  .operator-details {
    grid-template-columns: minmax(0, 1fr);
  }
  .result-body .card {
    min-width: 0;
  }
  .topology {
    overflow-x: auto;
  }
  .topology + .card,
  .evidence-split > .card {
    min-width: 0;
  }
  .result-decision-anchor {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .result-decision-anchor .text-action {
    margin-left: 0;
  }
  .operator-scroll-wrap {
    border-bottom: 1px solid var(--neutral-200);
  }
}

/* === Whitebox evidence views === */
/* Round 3: white-box views. Category colors inherit the frozen Round 2 contract. */
.source-strip {
  margin: 0;
  padding: 8px 14px;
  border-top: 1px solid var(--neutral-200);
  background: var(--neutral-50);
  color: var(--neutral-600);
  font-size: 11px;
}
.source-strip summary {
  cursor: pointer;
  color: var(--data-blue-deep);
  font-weight: 700;
}
.source-strip span {
  display: block;
  margin-top: 6px;
  font-family: "Cascadia Mono", Consolas, monospace;
  overflow-wrap: anywhere;
}

.topology-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.topology-card,
.hbm-detail {
  min-width: 0;
}
.physical-path {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--neutral-200);
  background: #f8faff;
  font-size: 11px;
}
.physical-path span {
  color: var(--data-blue);
}
.physical-path strong {
  white-space: nowrap;
}
.topology-card .topology {
  border: 0;
  padding: 16px;
}
.topology-card .cabinet {
  padding: 13px;
}
.node-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.node-title small {
  color: var(--neutral-600);
  white-space: nowrap;
}
.topology-card .npu {
  height: auto;
  min-height: 42px;
  padding: 5px 2px;
  border: 1px solid #c7d8f3;
  background: #e8f1ff;
  text-align: center;
}
.topology-card .npu strong,
.topology-card .npu small {
  display: block;
  font-size: 11px;
}
.topology-card .npu.hot {
  border-color: var(--selection-strong);
  outline: 2px solid var(--selection-strong);
  outline-offset: 1px;
  background: #fff;
  color: var(--selection-strong);
}
.tp-link,
.dp-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--signal-amber);
  font-size: 11px;
}
.tp-link i,
.dp-link i {
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--category-communication) 0 8px,
    transparent 8px 12px
  );
}
.dp-link {
  margin: 12px 2px 2px;
  color: var(--neutral-600);
}
.dp-link i {
  background: repeating-linear-gradient(
    90deg,
    var(--neutral-400) 0 8px,
    transparent 8px 12px
  );
}
.topology-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--neutral-600);
  font-size: 11px;
}
.topology-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 7px;
  margin-right: 5px;
  border: 2px solid currentColor;
  vertical-align: -1px;
}
.topology-legend .memory {
  color: var(--category-memory);
}
.topology-legend .communication {
  color: var(--category-communication);
}
.topology-legend .selected {
  color: var(--selection-strong);
}

.hbm-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.hbm-total strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.hbm-total span {
  color: var(--neutral-600);
  font-size: 11px;
}
.hbm-stack {
  display: flex;
  height: 20px;
  margin: 12px 0 14px;
  overflow: hidden;
  border: 1px solid var(--neutral-300);
  border-radius: 2px;
  background: var(--neutral-100);
}
.hbm-stack i {
  min-width: 2px;
  height: 100%;
}
.hbm-stack .weight,
.swatch.weight {
  background: #174d9f;
}
.hbm-stack .kv,
.swatch.kv {
  background: var(--category-memory);
}
.hbm-stack .state,
.swatch.state {
  background: #5b8fd9;
}
.hbm-stack .activation,
.swatch.activation {
  background: #73a7f4;
}
.hbm-stack .workspace,
.swatch.workspace {
  background: var(--category-communication);
}
.hbm-stack .remaining,
.swatch.remaining {
  background: #d9dee7;
}
.hbm-parts {
  display: grid;
  gap: 8px;
}
.hbm-parts > div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.hbm-parts strong {
  font-variant-numeric: tabular-nums;
}
.swatch {
  width: 9px;
  height: 9px;
}
.capacity-risk {
  margin-top: 14px;
  padding: 9px 10px;
  border-left: 3px solid var(--success);
  background: var(--success-soft);
}
.capacity-risk.warning {
  border-color: var(--signal-yellow);
  background: var(--signal-soft);
}
.capacity-risk.critical {
  border-color: var(--error);
  background: var(--error-soft);
}
.capacity-risk strong,
.capacity-risk small {
  display: block;
}
.capacity-risk small {
  margin-top: 2px;
  color: var(--neutral-600);
  font-size: 11px;
}

.operator-dag-card {
  min-width: 0;
}
.operator-dag-card .card-head > div small {
  color: var(--neutral-600);
}
.phase-switch {
  display: inline-flex;
  gap: 0;
  padding: 3px;
  border: 1px solid var(--neutral-300);
  border-radius: 3px;
  background: var(--neutral-100);
}
.operator-dag-card > .phase-switch {
  margin: 12px 16px 0;
}
.phase-switch button {
  border: 0;
  border-radius: 2px;
  padding: 7px 11px;
  background: transparent;
  color: var(--neutral-600);
  cursor: pointer;
  font-weight: 650;
}
.phase-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--selection-strong);
  box-shadow:
    0 1px 3px rgba(16, 24, 40, 0.12),
    inset 0 -2px 0 var(--data-blue);
}
.dag-canvas {
  padding: 14px 16px 18px;
  overflow: visible;
}
.dag-lane {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
}
.dag-lane.ingress,
.dag-lane.egress {
  max-width: 760px;
  margin: auto;
}
.dag-arrow {
  display: inline-grid;
  pointer-events: none;
  place-items: center;
  flex: 0 0 16px;
  color: var(--neutral-500);
  font-weight: 800;
}
.dag-arrow.main {
  display: block;
  margin: 5px auto;
  text-align: center;
  transform: rotate(90deg);
}
.block-repeat {
  min-width: 0;
  padding: 10px;
  border: 1px solid #b7c5da;
  border-left: 4px solid var(--selection-strong);
  border-radius: 3px;
  background: #f9fbfe;
}
.block-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.block-title span {
  color: var(--neutral-600);
  font-size: 11px;
}
.dag-branch {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--neutral-200);
}
.dag-branch > label {
  flex: 0 0 58px;
  align-self: center;
  color: var(--neutral-600);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.dag-dependency {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 6px 10px;
  border-top: 1px dashed #aebbd0;
  color: var(--selection-strong);
  font-size: 11px;
}
.dag-dependency span {
  padding: 2px 6px;
  border: 1px solid #b8c6da;
  background: #fff;
  color: var(--neutral-700);
}
.dag-dependency.exit {
  border-bottom: 1px dashed #aebbd0;
}
.dag-op {
  position: relative;
  flex: 1 1 0;
  min-width: 118px;
  max-width: 168px;
  padding: 8px;
  border: 1px solid var(--neutral-300);
  border-top: 3px solid currentColor;
  border-radius: 3px;
  background: #fff;
  text-align: left;
  color: var(--neutral-800);
  cursor: pointer;
}
.dag-op.compute {
  color: var(--category-compute);
}
.dag-op.memory {
  color: var(--category-memory);
}
.dag-op.communication {
  color: var(--category-communication);
  background: var(--category-communication-soft);
}
.dag-op.rank-critical::after {
  content: "RANK";
  position: absolute;
  right: 4px;
  top: 3px;
  color: var(--selection-strong);
  font-size: 7px;
  font-weight: 800;
}
.dag-op.active {
  outline: 3px solid var(--selection-strong);
  outline-offset: 2px;
  z-index: 2;
}
.op-title,
.op-metrics {
  display: block;
}
.op-title strong {
  display: block;
  padding-right: 25px;
  color: var(--neutral-950);
  font-size: 11px;
}
.op-title em {
  display: block;
  margin-top: 3px;
  color: currentColor;
  font-size: 11px;
  font-style: normal;
}
.op-metrics {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--neutral-200);
}
.op-metrics small {
  display: block;
  color: var(--neutral-700);
  font-size: 11px;
  line-height: 1.45;
}
.op-metrics b {
  color: var(--neutral-950);
  font-variant-numeric: tabular-nums;
}
.operator-inspector {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 16px;
  margin-top: 16px;
}
.op-quant {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  padding: 0;
  background: var(--neutral-200);
}
.op-quant > div {
  padding: 13px 15px;
  background: #fff;
}
.op-quant span,
.op-quant strong {
  display: block;
}
.op-quant span {
  color: var(--neutral-600);
  font-size: 11px;
}
.op-quant strong {
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.linked-actions .card-body {
  display: grid;
  gap: 8px;
}
.linked-actions.inline {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.phase-kpi {
  display: grid;
  grid-template-columns: 180px 180px 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.phase-kpi > div {
  padding: 10px 12px;
  border: 1px solid var(--neutral-200);
  border-radius: 3px;
  background: #fff;
}
.phase-kpi span,
.phase-kpi small,
.phase-kpi strong {
  display: block;
}
.phase-kpi span {
  color: var(--neutral-600);
  font-size: 11px;
}
.phase-kpi strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.phase-kpi small {
  color: var(--neutral-600);
  font-size: 11px;
}
.phase-kpi .phase-switch {
  justify-self: end;
  align-self: center;
  padding: 3px;
}
.phase-definition {
  margin: 0 0 12px;
  padding: 8px 11px;
  border-left: 3px solid var(--data-blue);
  background: var(--data-blue-soft);
  color: var(--neutral-700);
  font-size: 11px;
}
.evidence-split {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.timeline-card {
  min-width: 0;
}
.whitebox-timeline {
  display: flex;
  min-width: 0;
  height: auto;
  gap: 4px;
  overflow: visible;
}
.timeline-card .card-body {
  overflow: visible;
}
.timeline-segment {
  flex-basis: 0;
  min-width: 0;
  min-height: 58px;
  padding: 5px 3px;
  border: 0;
  border-radius: 2px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
}
.timeline-segment.compute {
  background: var(--category-compute);
}
.timeline-segment.memory {
  background: var(--category-memory);
}
.timeline-segment.communication {
  background: var(--category-communication);
}
.timeline-segment.active {
  outline: 3px solid var(--selection-strong);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 2px #fff;
}
.timeline-segment span,
.timeline-segment strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.timeline-segment em {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  min-height: 18px;
  margin-bottom: 3px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.timeline-segment strong {
  margin-top: 5px;
}
.timeline-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin-top: 12px;
}
.timeline-table button {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 5px 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--neutral-700);
  text-align: left;
  cursor: pointer;
  font-size: 11px;
}
.timeline-table button:hover,
.timeline-table button.active {
  border-color: var(--selection-strong);
  background: var(--data-blue-soft);
}
.timeline-table i {
  width: 7px;
  height: 7px;
}
.timeline-table i.compute {
  background: var(--category-compute);
  border-radius: 50%;
}
.timeline-table i.memory {
  background: var(--category-memory);
  border-radius: 1px;
}
.timeline-table i.communication {
  background: var(--category-communication);
  border-radius: 1px 6px 1px 6px;
  transform: rotate(45deg);
}
.timeline-table strong {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1400px) {
  .topology-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .hbm-detail {
    position: static;
  }
  .operator-inspector {
    grid-template-columns: minmax(0, 1fr);
  }
  .evidence-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .dag-branch {
    flex-wrap: wrap;
  }
  .dag-branch > label {
    flex: 0 0 100%;
  }
  .dag-op {
    flex: 1 1 125px;
    max-width: none;
  }
}
@media (max-width: 1050px) {
  .topology-card .nodes {
    min-width: 0;
  }
  .topology-card .topology {
    overflow: visible;
  }
  .physical-path {
    overflow-x: auto;
  }
  .phase-kpi {
    grid-template-columns: 1fr 1fr;
  }
  .phase-kpi .phase-switch {
    grid-column: 1/-1;
    justify-self: stretch;
  }
  .phase-kpi .phase-switch button {
    flex: 1;
  }
  .op-quant {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* === Management and scenario comparison === */
.management-decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px 14px;
  align-items: center;
  min-height: 0;
  padding: 11px 13px;
  margin-bottom: 12px;
}
.decision-top {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}
.management-decision .decision-gains {
  min-width: 0;
}
.decision-answers {
  grid-column: 1/3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #d8dee8;
  border-bottom: 1px solid #d8dee8;
}
.decision-answers > div {
  padding: 7px 10px;
  border-right: 1px solid #d8dee8;
  min-width: 0;
}
.decision-answers > div:last-child {
  border-right: 0;
}
.decision-answers strong {
  display: block;
  margin-top: 2px;
  color: #344054;
  font-size: 11px;
  line-height: 1.35;
}
.decision-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}
.management-decision .decision-actions {
  grid-column: 1/3;
}
.decision-actions button {
  white-space: nowrap;
}
.compare-section {
  margin-top: 16px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42/0.04);
  padding: 18px;
  min-width: 0;
}
.section-question {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 2px 14px;
  margin-bottom: 14px;
}
.section-question > span,
.table-question > span {
  grid-row: 1/3;
  color: var(--brand, #c62233);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-question h2 {
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
  color: #14233c;
}
.section-question small {
  color: #667085;
}
.trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.trend-card {
  border: 1px solid #e2e7ef;
  padding: 10px;
  min-width: 0;
}
.trend-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.trend-card header strong {
  font-size: 13px;
}
.trend-card header small {
  font-size: 11px;
  color: #667085;
}
.trend-card svg {
  display: block;
  width: 100%;
  height: 112px;
  margin-top: 4px;
  overflow: visible;
}
.trend-card polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.trend-card circle {
  fill: currentColor;
}
.trend-card text {
  fill: #475467;
  font-size: 11px;
}
.trend-card.compute {
  color: #c62233;
}
.trend-card.memory {
  color: #2366b1;
}
.trend-card.communication {
  color: #b7791f;
}
.contribution-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.contribution-card {
  appearance: none;
  text-align: left;
  border: 1px solid #d8dee8;
  border-radius: 3px;
  background: #fff;
  color: inherit;
  padding: 12px;
  min-width: 0;
  cursor: pointer;
}
.contribution-card:hover {
  border-color: #8ca5c5;
}
.contribution-card.active {
  border-color: #16365f;
  box-shadow: inset 0 0 0 2px #16365f;
}
.contribution-card header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  margin-bottom: 10px;
}
.contribution-card header span {
  color: #c62233;
  font-size: 11px;
  font-weight: 800;
}
.contribution-card header strong {
  justify-self: end;
}
.contribution-card header small {
  grid-column: 1/3;
  color: #667085;
  white-space: normal;
}
.contribution-card > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.contribution-card > div span {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  border-top: 1px solid #edf0f4;
  padding-top: 5px;
  font-size: 11px;
}
.contribution-card > div strong {
  font-size: 11px;
  white-space: nowrap;
}
.contribution-card footer {
  margin-top: 10px;
}
.mechanism-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #e2e7ef;
}
.mechanism-grid > div {
  padding: 14px;
  min-width: 0;
}
.mechanism-grid > div:nth-child(odd) {
  border-right: 1px solid #e2e7ef;
}
.mechanism-grid > div:nth-child(-n + 2) {
  border-bottom: 1px solid #e2e7ef;
}
.mechanism-grid h3 {
  font-size: 12px;
  margin: 0 0 8px;
  color: #14233c;
}
.mechanism-grid p {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
  font-size: 12px;
  line-height: 1.45;
}
.mechanism-grid p span {
  text-align: right;
  color: #475467;
}
.risk-next > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.risk-next a,
.scenario-evidence-actions a {
  border: 1px solid #9fb1c8;
  color: #16365f;
  padding: 6px 9px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}
.source-strip {
  margin-top: 10px;
  color: #667085;
  font-size: 11px;
}
.source-strip summary {
  cursor: pointer;
  color: #344054;
}
.scenario-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.scenario-cell {
  appearance: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: left;
  border: 1px solid #d8dee8;
  border-left-width: 4px;
  border-radius: 2px;
  background: #fff;
  color: #344054;
  padding: 9px;
  cursor: pointer;
  min-width: 0;
}
.scenario-cell strong {
  grid-column: 1/3;
  color: #14233c;
  margin-bottom: 4px;
}
.scenario-cell span {
  font-size: 11px;
  white-space: nowrap;
}
.scenario-cell.safe {
  border-left-color: #16835f;
}
.scenario-cell.warning {
  border-left-color: #d4a017;
}
.scenario-cell.critical {
  border-left-color: #c62233;
  background: #fff8f8;
}
.scenario-cell.active {
  outline: 2px solid #16365f;
  outline-offset: 1px;
}
.scenario-conclusion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 12px;
  border-left: 4px solid #16835f;
  background: #f7fafc;
}
.scenario-conclusion.warning {
  border-left-color: #d4a017;
  background: #fffaf0;
}
.scenario-conclusion.critical {
  border-left-color: #c62233;
  background: #fff4f4;
}
.scenario-conclusion span {
  display: block;
  color: #667085;
  font-size: 11px;
}
.scenario-conclusion strong {
  display: block;
  color: #14233c;
  margin: 2px 0;
}
.scenario-conclusion p {
  margin: 0;
  font-size: 12px;
}
.scenario-evidence-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  flex: none;
}
.scenario-evidence-actions small {
  grid-column: 1/3;
  text-align: right;
}
.full-data-section {
  margin-top: 16px;
  min-width: 0;
}
.table-question {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-right: auto;
}
.table-question > span {
  grid-row: auto;
}
.table-question strong {
  font-size: 12px;
  color: #14233c;
}
.full-data-section .card-head {
  flex-wrap: wrap;
}
.full-data-section .card-head h2 {
  width: 100%;
  font-size: 14px;
}
.full-data-section table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.full-data-section th,
.full-data-section td {
  overflow-wrap: anywhere;
  font-size: 11px;
  padding: 7px 5px;
}
@media (max-width: 1400px) {
  .trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scenario-matrix {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1050px) {
  .decision-top {
    grid-template-columns: 145px minmax(0, 1fr);
  }
  .decision-answers strong {
    font-size: 11px;
  }
  .section-question {
    grid-template-columns: 90px minmax(0, 1fr);
  }
  .trend-grid {
    grid-template-columns: 1fr;
  }
  .contribution-grid {
    grid-template-columns: 1fr;
  }
  .mechanism-grid {
    grid-template-columns: 1fr;
  }
  .mechanism-grid > div:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid #e2e7ef;
  }
  .mechanism-grid > div:last-child {
    border-bottom: 0;
  }
  .scenario-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scenario-conclusion {
    align-items: flex-start;
    flex-direction: column;
  }
  .scenario-evidence-actions {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }
  .full-data-section .table-scroll {
    overflow: visible;
  }
  .full-data-section th,
  .full-data-section td {
    font-size: 11px;
    padding: 5px 3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .contribution-card,
  .scenario-cell {
    transition: none;
  }
}
.side-heading-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 4px 0;
  cursor: pointer;
}

/* === Final responsive and accessibility safeguards === */
.avatar {
  display: grid;
  place-items: center;
}
.recovery-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--neutral-300, #bdc9da);
  border-left: 4px solid var(--brand-red, #c62233);
  background: var(--neutral-50, #f7f9fc);
}
.recovery-actions small {
  display: block;
  margin-top: 3px;
  color: var(--neutral-600, #667085);
}
@media (max-width: 1400px) {
  .topology-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .topology-card,
  .topology-card .topology,
  .topology-card .cabinet,
  .topology-card .nodes,
  .topology-card .node {
    min-width: 0;
    max-width: 100%;
  }
  .topology-card .topology,
  .topology-card .nodes {
    overflow: hidden;
  }
  .topology-card .nodes {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hbm-detail {
    position: static;
    width: 100%;
  }
}
@media (max-width: 1050px) {
  .recovery-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .recovery-actions button {
    width: 100%;
  }
}
