:root {
  color-scheme: dark;
  --bg: #06111d;
  --bg-deep: #040c15;
  --panel: rgba(10, 27, 41, 0.94);
  --panel-soft: rgba(15, 38, 55, 0.86);
  --panel-strong: #0d2132;
  --line: rgba(106, 175, 204, 0.2);
  --line-strong: rgba(60, 203, 225, 0.48);
  --text: #edf8ff;
  --muted: #8fa8b8;
  --cyan: #2fd3ee;
  --cyan-soft: #76e8f6;
  --blue: #56a9ff;
  --teal: #42d9b0;
  --amber: #f2c462;
  --red: #ff6f78;
  --purple: #a38bff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --radius: 12px;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 1180px;
  height: 100%;
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 72% -12%, rgba(34, 144, 181, 0.17), transparent 34%),
    radial-gradient(circle at 8% 30%, rgba(28, 113, 144, 0.12), transparent 24%),
    var(--bg);
  color: var(--text);
}

body {
  overflow-x: auto;
}

@media (min-height: 820px) {
  body {
    overflow-y: hidden;
  }
}

button,
select,
input {
  font: inherit;
}

button,
select {
  color: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  min-height: 78px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(180deg, rgba(12, 29, 43, 0.98), rgba(8, 23, 35, 0.94));
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 365px;
}

.brand-block h1,
.panel-heading h2,
.table-toolbar h2,
.dialog-head h2 {
  margin: 0;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.brand-block h1 {
  font-size: 21px;
}

.brand-block p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(36, 207, 234, 0.26), rgba(32, 91, 139, 0.18));
  border: 1px solid rgba(78, 222, 240, 0.42);
  box-shadow: inset 0 0 18px rgba(54, 206, 224, 0.12), 0 0 22px rgba(35, 191, 220, 0.11);
}

.brand-mark span {
  position: absolute;
  height: 2px;
  background: var(--cyan);
  border-radius: 99px;
  transform-origin: left center;
}

.brand-mark span:nth-child(1) {
  width: 21px;
  transform: translate(-8px, -8px) rotate(28deg);
}

.brand-mark span:nth-child(2) {
  width: 20px;
  transform: translate(-7px, 0) rotate(-26deg);
}

.brand-mark span:nth-child(3) {
  width: 17px;
  transform: translate(-5px, 8px) rotate(19deg);
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.field {
  display: grid;
  gap: 4px;
}

.field > span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.compact-field select {
  width: 170px;
  height: 38px;
  padding: 0 30px 0 11px;
  background: #0d2132;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.compact-field:nth-child(2) select {
  width: 142px;
}

.compact-field select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(47, 211, 238, 0.12);
}

.button,
.icon-button,
.mini-button,
.network-controls button,
.device-card-head button,
.dialog-head button {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #12344c, #0e283b);
  border-radius: 7px;
  color: #dff8ff;
  transition: 160ms ease;
}

.button {
  height: 38px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
}

.button:hover,
.icon-button:hover,
.mini-button:hover,
.network-controls button:hover,
.device-card-head button:hover,
.dialog-head button:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  box-shadow: 0 5px 18px rgba(40, 192, 220, 0.15);
}

.button-primary {
  background: linear-gradient(180deg, #1686aa, #11607e);
  border-color: rgba(74, 219, 241, 0.7);
}

.button-icon {
  margin-right: 5px;
  font-size: 10px;
}

.icon-button {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

.mode-tabs {
  min-height: 48px;
  padding: 4px 20px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  background: rgba(7, 20, 31, 0.95);
  border-bottom: 1px solid var(--line);
}

.mode-tab {
  min-width: 150px;
  padding: 4px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(14, 38, 55, 0.58);
  color: #9eb5c3;
  text-align: left;
}

.mode-tab strong {
  display: block;
  color: inherit;
  font-size: 12px;
}

.mode-tab small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  color: #6f8c9e;
}

.mode-tab-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
  background: rgba(56, 183, 208, 0.12);
  color: var(--cyan-soft);
  font-size: 14px;
}

.mode-tab:hover,
.mode-tab.active {
  color: var(--text);
  border-color: rgba(64, 205, 229, 0.34);
  background: linear-gradient(180deg, rgba(29, 93, 119, 0.48), rgba(13, 47, 66, 0.58));
}

.mode-tab.active {
  box-shadow: inset 0 -2px var(--cyan);
}

.dashboard-grid {
  flex: 0 0 calc(100vh - 156px);
  height: calc(100vh - 156px);
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 322px minmax(640px, 1fr) 352px;
  grid-template-rows: minmax(0, 1fr) 210px;
  gap: 12px;
}

.left-column,
.right-column,
.center-column {
  min-width: 0;
  min-height: 0;
}

.left-column,
.right-column {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.left-column {
  grid-template-rows: auto 1fr;
}

.right-column {
  grid-template-rows: minmax(330px, 1fr) minmax(240px, 0.72fr);
}

.panel {
  position: relative;
  min-width: 0;
  background: linear-gradient(160deg, rgba(14, 34, 50, 0.96), rgba(8, 25, 38, 0.94));
  border: 1px solid rgba(68, 164, 194, 0.3);
  border-radius: var(--radius);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), var(--shadow);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.panel-heading {
  padding: 12px 14px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(83, 151, 178, 0.13);
}

.panel-heading h2,
.table-toolbar h2,
.dialog-head h2 {
  margin-top: 3px;
  font-size: 14px;
}

.eyebrow {
  display: block;
  color: #64dcef;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.status-pill,
.insight-badge,
.stage-counter,
.chart-unit,
.network-badge {
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.status-success {
  color: #7cf3cf;
  background: rgba(41, 190, 139, 0.12);
  border: 1px solid rgba(66, 217, 176, 0.25);
}

.status-warning {
  color: #ffd981;
  background: rgba(242, 196, 98, 0.12);
  border: 1px solid rgba(242, 196, 98, 0.28);
}

.status-danger {
  color: #ff969e;
  background: rgba(255, 111, 120, 0.12);
  border: 1px solid rgba(255, 111, 120, 0.28);
}

.metric-grid {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.summary-status-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.calculation-time-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid rgba(52, 211, 153, 0.34);
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.09);
  color: #78e6c4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.multiperiod-profile-panel[hidden],
.ttc-pv-panel[hidden],
.favorite-comparison-panel[hidden] {
  display: none;
}

.multiperiod-profile-panel {
  padding-bottom: 12px;
}

.period-branch-select {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.period-branch-select span {
  color: #718497;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.period-branch-select select {
  height: 30px;
  padding: 0 30px 0 9px;
  color: #d3dee7;
  background: #131c25;
  border: 1px solid #2a3948;
  border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
}

.multiperiod-chart-grid {
  padding: 0 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.period-line-card {
  min-width: 0;
  padding: 10px;
  background: #111923;
  border: 1px solid #253342;
  border-radius: 6px;
}

.period-line-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.period-line-card h3 {
  margin: 0;
  color: #dce7ef;
  font-size: 11px;
}

.period-line-card header span {
  color: #6f8294;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
}

.period-line-card svg {
  width: 100%;
  height: 150px;
  margin-top: 7px;
  overflow: visible;
}

.period-chart-gridline {
  stroke: rgba(105, 126, 145, 0.18);
  stroke-width: 1;
}

.period-chart-axis-label,
.period-chart-value {
  fill: #7f92a5;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
}

.period-chart-value {
  fill: #c5d2dd;
  font-weight: 700;
}

.period-chart-legend {
  min-height: 18px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: #8497a8;
  font-size: 8px;
}

.period-chart-legend i {
  width: 12px;
  height: 2px;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

.ttc-pv-content {
  padding: 0 12px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(470px, 0.85fr);
  align-items: start;
  gap: 10px;
}

.ttc-pv-visual {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.inline-comparison-panel[hidden] {
  display: none;
}

.ttc-pv-guide {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.ttc-pv-guide > div {
  min-width: 0;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  border: 1px solid #283947;
  border-radius: 5px;
  background: rgba(16, 25, 35, 0.82);
}

.ttc-pv-guide strong {
  color: #70dfd0;
  font: 700 9px/1.45 "JetBrains Mono", Consolas, monospace;
  text-transform: uppercase;
}

.ttc-pv-guide span {
  color: #8fa1b0;
  font-size: 9px;
  line-height: 1.45;
}

.ttc-pv-chart,
.ttc-pv-summary {
  min-width: 0;
  padding: 12px;
  background: #111923;
  border: 1px solid #253342;
  border-radius: 6px;
}

.ttc-pv-chart svg {
  width: 100%;
  max-height: 330px;
  min-height: 250px;
  display: block;
  overflow: visible;
}

.ttc-pv-axis-title,
.ttc-pv-limit-label {
  fill: #91a5b7;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
}

.ttc-pv-limit {
  stroke: rgba(255, 111, 120, 0.72);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
}

.ttc-pv-limit-label {
  fill: #ff8b93;
}

.ttc-pv-operating-marker {
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
  opacity: 0.78;
}

.ttc-pv-operating-label,
.ttc-pv-nose-label,
.ttc-pv-uplift-label {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
}

.ttc-pv-uplift-band {
  fill: rgba(66, 217, 176, 0.09);
  stroke: rgba(66, 217, 176, 0.35);
  stroke-width: 0.8;
}

.ttc-pv-uplift-arrow {
  stroke: #7ff1d1;
  stroke-width: 2;
}

.ttc-pv-uplift-arrowhead {
  fill: #7ff1d1;
}

.ttc-pv-uplift-label {
  fill: #9ff7df;
}

.ttc-pv-nose-label {
  fill: #ff9aa1;
}

.ttc-pv-point {
  opacity: 0.82;
}

.ttc-pv-nose {
  filter: drop-shadow(0 0 4px rgba(255, 111, 120, 0.48));
}

.ttc-pv-limit-point {
  stroke: #e9f5fb;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 5px rgba(91, 220, 190, 0.44));
}

.ttc-pv-nose-key {
  background: #ff6f78 !important;
  box-shadow: 0 0 0 2px rgba(255, 111, 120, 0.18);
}

.ttc-pv-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.ttc-pv-endpoint,
.ttc-pv-method,
.ttc-pv-uplift-card {
  min-width: 0;
  padding: 9px;
  background: rgba(18, 29, 39, 0.82);
  border: 1px solid #263746;
  border-radius: 5px;
}

.ttc-pv-nose-card {
  border-color: rgba(255, 111, 120, 0.3);
  box-shadow: inset 2px 0 0 rgba(255, 111, 120, 0.7);
}

.ttc-pv-uplift-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(25, 85, 74, 0.42), rgba(18, 29, 39, 0.92));
  border-color: rgba(66, 217, 176, 0.48);
  box-shadow: inset 3px 0 0 #42d9b0;
}

.ttc-pv-method {
  grid-column: 1 / -1;
}

.ttc-pv-endpoint span,
.ttc-pv-endpoint small,
.ttc-pv-uplift-card span,
.ttc-pv-uplift-card small {
  display: block;
  color: #8296a8;
  font-size: 8px;
  line-height: 1.4;
}

.ttc-pv-endpoint strong,
.ttc-pv-method strong,
.ttc-pv-uplift-card strong {
  display: block;
  margin: 4px 0;
  color: #d9f6ef;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
}

.ttc-pv-uplift-values {
  margin: 8px 0 5px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.ttc-pv-uplift-values div {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(89, 127, 145, 0.28);
  border-radius: 4px;
  background: rgba(8, 18, 26, 0.44);
}

.ttc-pv-uplift-values b {
  display: block;
  margin-top: 3px;
  color: #e3f7f2;
  font: 700 10px/1.25 "JetBrains Mono", Consolas, monospace;
  white-space: nowrap;
}

.ttc-pv-uplift-values i {
  color: #66e4c4;
  font-style: normal;
}

.ttc-pv-uplift-card strong {
  color: #7ff1d1;
  font-size: 19px;
}

.ttc-pv-method p {
  margin: 5px 0 0;
  color: #8093a4;
  font-size: 9px;
  line-height: 1.5;
}

.period-flow-table {
  margin: 10px 12px 0;
  overflow: auto;
}

.period-flow-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
}

.period-flow-table th,
.period-flow-table td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid #23313e;
}

.period-flow-table th:first-child,
.period-flow-table td:first-child {
  text-align: left;
}

.period-flow-table th {
  color: #6e8295;
  font-size: 8px;
  text-transform: uppercase;
}

.period-flow-table td {
  color: #bdcad5;
}

.period-flow-positive {
  color: #66dbb8 !important;
}

.period-flow-negative {
  color: #ff8c92 !important;
}

.favorite-count {
  margin-bottom: 7px;
  color: #61d9b7;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
  white-space: nowrap;
}

.favorite-center-button.active {
  color: #ffd66e;
  border-color: rgba(242, 196, 98, 0.5);
  background: rgba(104, 79, 23, 0.3);
}

.favorite-comparison-panel {
  flex: 0 0 auto;
  max-height: 250px;
  padding: 9px 12px 11px;
  overflow: auto;
  background: #0e151d;
  border-bottom: 1px solid #273442;
}

.favorite-comparison-heading {
  margin-bottom: 8px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.favorite-comparison-heading div {
  display: grid;
  gap: 2px;
}

.favorite-comparison-heading span,
.favorite-comparison-heading small {
  color: #718598;
  font-size: 8px;
}

.favorite-comparison-heading strong {
  color: #d6e2eb;
  font-size: 11px;
}

.favorite-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 8px;
}

.favorite-map-card {
  min-width: 0;
  padding: 8px;
  color: inherit;
  background: #131c25;
  border: 1px solid #293947;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.favorite-map-card:hover,
.favorite-map-card:focus-visible {
  background: #17232d;
  border-color: #3da7a0;
  outline: none;
  transform: translateY(-1px);
}

.favorite-map-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.favorite-map-card header button:first-child {
  min-width: 0;
  padding: 0;
  color: #d9e7ef;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.favorite-map-card header strong,
.favorite-map-card header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-map-card header strong {
  font-size: 10px;
}

.favorite-map-card header span {
  margin-top: 2px;
  color: #75899a;
  font-size: 8px;
}

.favorite-remove-button {
  color: #8395a5;
  background: none;
  border: 0;
  cursor: pointer;
}

.favorite-map-card svg {
  width: 100%;
  height: 105px;
  margin-top: 5px;
  background: #0c131a;
  border-radius: 4px;
}

.favorite-map-card footer {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #718497;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 7px;
}

.favorite-inline-button {
  margin-left: 4px;
  padding: 0 2px;
  color: #6e8497;
  background: none;
  border: 0;
  cursor: pointer;
}

.favorite-inline-button.active {
  color: #ffd66e;
}

@media (max-width: 1450px) {
  .multiperiod-chart-grid {
    grid-template-columns: 1fr;
  }

  .favorite-map-grid {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }

  .ttc-pv-content {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  min-height: 65px;
  padding: 9px 11px 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(72, 143, 173, 0.23);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(19, 47, 66, 0.8), rgba(10, 30, 44, 0.72));
}

.metric-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--cyan);
}

.metric-card.tone-teal::before { background: var(--teal); }
.metric-card.tone-amber::before { background: var(--amber); }
.metric-card.tone-red::before { background: var(--red); }
.metric-card.tone-purple::before { background: var(--purple); }

.metric-card strong {
  display: block;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.metric-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.metric-card small {
  position: absolute;
  right: 9px;
  top: 9px;
  color: #6e91a4;
  font-size: 8px;
}

.primary-kpi {
  margin: 0 10px 10px;
  padding: 10px;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(26, 89, 105, 0.32), rgba(20, 41, 54, 0.8));
  border: 1px solid rgba(66, 217, 176, 0.26);
}

.primary-kpi-copy {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.primary-kpi-copy span {
  color: var(--muted);
  font-size: 10px;
}

.primary-kpi-copy strong {
  font-size: 18px;
  color: #dffff6;
  font-variant-numeric: tabular-nums;
}

.primary-kpi small {
  display: block;
  margin-top: 6px;
  color: #83a4b5;
  font-size: 9px;
}

.progress-track {
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(4, 13, 20, 0.78);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--amber));
  box-shadow: 0 0 12px rgba(66, 217, 176, 0.45);
  transition: width 500ms ease;
}

.workflow-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px 16px;
  counter-reset: stage;
  overflow: auto;
}

.workflow-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.workflow-item {
  min-height: 56px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  position: relative;
}

.workflow-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 30px;
  bottom: 3px;
  width: 1px;
  background: rgba(91, 142, 163, 0.3);
}

.workflow-index {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  border-radius: 50%;
  background: #102c40;
  border: 1px solid rgba(77, 161, 189, 0.36);
  color: #82aabc;
  font-size: 10px;
}

.workflow-copy strong {
  display: block;
  padding-top: 2px;
  font-size: 11px;
  font-weight: 620;
}

.workflow-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.workflow-state {
  margin-top: 5px;
  color: #6f91a2;
  font-size: 9px;
}

.workflow-item.complete .workflow-index {
  color: #07231a;
  border-color: var(--teal);
  background: var(--teal);
}

.workflow-item.complete .workflow-state { color: #70e7c3; }

.workflow-item.active .workflow-index {
  color: #06141c;
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 17px rgba(47, 211, 238, 0.34);
}

.workflow-item.active .workflow-copy strong { color: var(--cyan-soft); }
.workflow-item.active .workflow-state { color: var(--cyan); }

.center-column,
.network-panel {
  height: 100%;
}

.network-panel {
  display: flex;
  flex-direction: column;
}

.network-heading {
  align-items: center;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.network-heading-actions,
.toggle-row,
.legend-row,
.legend-items,
.stage-controller,
.table-actions,
.table-tabs {
  display: flex;
  align-items: center;
}

.network-heading-actions {
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented {
  display: flex;
  padding: 2px;
  border-radius: 7px;
  background: rgba(4, 16, 25, 0.72);
  border: 1px solid var(--line);
}

.segmented button {
  min-width: 54px;
  height: 27px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #7897a8;
  font-size: 9px;
}

.segmented button.active {
  color: #e6fbff;
  background: linear-gradient(180deg, #1a7897, #15536c);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.mini-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 9px;
}

.mini-button.active {
  color: #e7fcff;
  border-color: rgba(47, 211, 238, 0.72);
  background: linear-gradient(180deg, #196f8b, #13485e);
}

.legend-row {
  min-height: 37px;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  border-bottom: 1px solid rgba(77, 149, 175, 0.12);
}

.legend-items,
.toggle-row {
  flex-wrap: wrap;
  gap: 12px;
}

.legend-items span,
.switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8da9b8;
  font-size: 9px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.legend-dot.warning { background: var(--amber); }
.legend-dot.danger { background: var(--red); }
.legend-dot.source { background: var(--blue); box-shadow: 0 0 7px rgba(86, 169, 255, 0.6); }
.legend-dot.sink { background: var(--purple); box-shadow: 0 0 7px rgba(163, 139, 255, 0.6); }

.legend-line {
  width: 14px;
  border-top: 2px dashed #687786;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch > span {
  width: 25px;
  height: 14px;
  padding: 2px;
  display: block;
  border-radius: 99px;
  background: #243c4b;
  transition: 160ms ease;
}

.switch > span::after {
  content: "";
  width: 10px;
  height: 10px;
  display: block;
  border-radius: 50%;
  background: #718d9d;
  transition: 160ms ease;
}

.switch input:checked + span {
  background: rgba(47, 211, 238, 0.34);
}

.switch input:checked + span::after {
  transform: translateX(11px);
  background: var(--cyan);
}

.network-alert {
  min-height: 35px;
  margin: 8px 12px 0;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  background: rgba(114, 62, 38, 0.42);
  border: 1px solid rgba(242, 196, 98, 0.22);
  color: #e9d1a5;
  font-size: 10px;
}

.network-alert.safe {
  background: rgba(29, 89, 79, 0.36);
  border-color: rgba(66, 217, 176, 0.25);
  color: #9ee8d2;
}

.network-alert.danger {
  background: rgba(116, 45, 53, 0.42);
  border-color: rgba(255, 111, 120, 0.26);
  color: #ffc1c5;
}

.network-alert-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 700;
}

.stage-controller {
  min-height: 38px;
  gap: 9px;
  padding: 6px 12px;
}

.stage-label {
  min-width: 95px;
  color: var(--cyan-soft);
  font-size: 10px;
}

.stage-controller input[type="range"] {
  min-width: 120px;
  flex: 1;
  accent-color: var(--cyan);
}

.network-viewport {
  flex: 1;
  min-height: 0;
  position: relative;
  margin: 0 12px 12px;
  overflow: hidden;
  border: 1px solid rgba(76, 171, 199, 0.24);
  border-radius: 8px;
  background-color: #071522;
  background-image:
    linear-gradient(rgba(63, 122, 147, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 122, 147, 0.075) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(22, 88, 112, 0.17), transparent 45%);
  background-size: 58px 58px, 58px 58px, auto;
}

#networkCanvas {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  display: block;
  cursor: grab;
  touch-action: none;
}

#networkCanvas.dragging {
  cursor: grabbing;
}

.network-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  color: #8de9f7;
  background: rgba(7, 24, 35, 0.86);
  border: 1px solid rgba(47, 211, 238, 0.24);
  pointer-events: none;
}

.network-controls {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(5, 20, 30, 0.82);
  border: 1px solid rgba(65, 173, 204, 0.2);
}

.network-controls button {
  width: 29px;
  height: 29px;
  padding: 0;
  font-size: 14px;
}

.network-controls span {
  min-width: 42px;
  color: #a9cad7;
  font-size: 9px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.network-panel.network-focus {
  position: fixed;
  inset: 8px;
  z-index: 80;
  height: calc(100vh - 16px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.7);
}

.network-panel.network-focus .network-viewport {
  min-height: 0;
}

.device-card {
  width: 245px;
  max-height: calc(100% - 20px);
  position: absolute;
  right: 10px;
  top: 10px;
  overflow: auto;
  border-radius: 8px;
  background: rgba(8, 27, 40, 0.92);
  border: 1px solid rgba(65, 173, 204, 0.28);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(9px);
}

.device-card-head {
  height: 34px;
  padding: 0 8px 0 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #bdeef6;
  font-size: 10px;
  border-bottom: 1px solid rgba(74, 158, 186, 0.17);
}

.device-card-head button,
.dialog-head button {
  width: 24px;
  height: 24px;
  padding: 0;
}

.device-details {
  padding: 10px;
}

.device-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.device-title strong {
  font-size: 13px;
}

.device-type {
  color: #79dfee;
  font-size: 9px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.detail-item {
  padding: 7px;
  border-radius: 6px;
  background: rgba(26, 61, 80, 0.45);
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.detail-item strong {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.graph-tooltip {
  min-width: 130px;
  max-width: 230px;
  position: absolute;
  z-index: 5;
  padding: 7px 9px;
  pointer-events: none;
  border-radius: 6px;
  background: rgba(4, 16, 24, 0.94);
  border: 1px solid rgba(84, 194, 219, 0.36);
  color: #dff8ff;
  font-size: 9px;
  line-height: 1.5;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.insight-panel,
.chart-panel {
  display: flex;
  flex-direction: column;
}

.insight-badge {
  color: #d4c9ff;
  background: rgba(163, 139, 255, 0.12);
  border: 1px solid rgba(163, 139, 255, 0.22);
}

.recommendation-card {
  margin: 12px 12px 8px;
  padding: 12px;
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(25, 99, 109, 0.3), rgba(15, 39, 53, 0.72));
  border: 1px solid rgba(63, 211, 214, 0.24);
}

.recommendation-card .recommendation-label {
  color: var(--muted);
  font-size: 9px;
}

.recommendation-card strong {
  display: block;
  margin-top: 6px;
  color: #e7fffb;
  font-size: 16px;
}

.recommendation-card p {
  margin: 7px 0 0;
  color: #97b5c4;
  font-size: 9px;
  line-height: 1.55;
}

.recommendation-tags {
  margin-top: 9px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.recommendation-tags span {
  padding: 4px 7px;
  border-radius: 5px;
  color: #90e4f0;
  background: rgba(32, 123, 143, 0.24);
  font-size: 8px;
}

.insight-list {
  padding: 2px 12px 12px;
  display: grid;
  gap: 7px;
  overflow: auto;
}

.insight-item {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  border-radius: 7px;
  background: rgba(16, 42, 58, 0.54);
  border: 1px solid rgba(72, 136, 161, 0.14);
}

.insight-item i {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(47, 211, 238, 0.4);
}

.insight-item.warning i { background: var(--amber); box-shadow: 0 0 8px rgba(242, 196, 98, 0.4); }
.insight-item.danger i { background: var(--red); box-shadow: 0 0 8px rgba(255, 111, 120, 0.4); }
.insight-item.success i { background: var(--teal); box-shadow: 0 0 8px rgba(66, 217, 176, 0.4); }

.insight-item strong {
  display: block;
  font-size: 10px;
}

.insight-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.chart-unit {
  color: #8ea9b7;
  background: rgba(29, 63, 79, 0.42);
}

.bar-chart {
  flex: 1;
  padding: 11px 13px 14px;
  display: grid;
  align-content: center;
  gap: 9px;
  overflow: auto;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 8px;
}

.bar-label {
  overflow: hidden;
  color: #9cb5c2;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(5, 17, 26, 0.76);
}

.bar-fill {
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1b7491, var(--cyan));
  box-shadow: 0 0 12px rgba(47, 211, 238, 0.18);
}

.bar-row:nth-child(2n) .bar-fill {
  background: linear-gradient(90deg, #277b6c, var(--teal));
}

.bar-value {
  color: #d8f5fb;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table-panel {
  grid-column: 1 / -1;
}

.table-toolbar {
  min-height: 58px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(79, 149, 175, 0.15);
}

.table-actions {
  gap: 9px;
  min-width: 0;
}

.table-tabs {
  padding: 2px;
  border-radius: 7px;
  background: rgba(4, 16, 25, 0.6);
  border: 1px solid var(--line);
}

.table-tab {
  min-width: 68px;
  height: 27px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #7f9cab;
  font-size: 9px;
}

.table-tab.active {
  color: #e8fbff;
  background: rgba(25, 105, 132, 0.7);
}

.search-field {
  width: 215px;
  height: 32px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 7px;
  background: rgba(7, 23, 34, 0.78);
  border: 1px solid var(--line);
}

.search-field span {
  color: #6e91a4;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 10px;
}

.search-field input::placeholder {
  color: #587384;
}

.row-count {
  color: #7895a5;
  font-size: 9px;
  white-space: nowrap;
}

.table-scroll {
  height: calc(100% - 58px);
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0c2233;
}

th,
td {
  min-width: 90px;
  padding: 8px 11px;
  border-right: 1px solid rgba(78, 136, 157, 0.11);
  border-bottom: 1px solid rgba(78, 136, 157, 0.12);
  text-align: left;
  white-space: nowrap;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

th {
  color: #a8c5d2;
  font-weight: 560;
}

td {
  color: #8faab8;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(28, 103, 130, 0.22);
}

.cell-positive { color: #6be5bf; }
.cell-negative { color: #ff969e; }
.cell-warning { color: #f4cf7f; }
.cell-link { color: #65dcef; }

.footer-bar {
  min-height: 28px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6f8a9a;
  font-size: 9px;
  background: #06111b;
  border-top: 1px solid rgba(74, 151, 178, 0.17);
}

.live-dot {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 9px rgba(66, 217, 176, 0.58);
}

.comparison-dialog {
  width: min(860px, calc(100vw - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(71, 186, 214, 0.4);
  border-radius: 12px;
  background: #0a1d2b;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.comparison-dialog::backdrop {
  background: rgba(0, 7, 12, 0.76);
  backdrop-filter: blur(4px);
}

.dialog-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.comparison-content {
  padding: 16px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  gap: 12px;
  align-items: stretch;
}

.comparison-side {
  padding: 14px;
  border-radius: 9px;
  background: rgba(17, 45, 62, 0.74);
  border: 1px solid rgba(70, 150, 177, 0.22);
}

.comparison-side.recommended {
  border-color: rgba(66, 217, 176, 0.34);
  box-shadow: inset 0 0 20px rgba(66, 217, 176, 0.06);
}

.comparison-side h3 {
  margin: 0 0 12px;
  font-size: 13px;
}

.comparison-arrow {
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-size: 24px;
}

.comparison-metric {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(86, 146, 169, 0.13);
  color: var(--muted);
  font-size: 10px;
}

.comparison-metric strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.toast {
  max-width: 360px;
  position: fixed;
  left: 50%;
  bottom: 42px;
  z-index: 100;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  border-radius: 8px;
  color: #dffcff;
  background: rgba(11, 48, 63, 0.96);
  border: 1px solid rgba(67, 207, 228, 0.35);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
  font-size: 10px;
  transition: 200ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1450px) {
  .dashboard-grid {
    grid-template-columns: 292px minmax(600px, 1fr) 320px;
  }

  .metric-card strong { font-size: 19px; }
  .toolbar .button { padding: 0 10px; }
  .compact-field select { width: 150px; }
  .bar-row { grid-template-columns: 75px minmax(0, 1fr) 52px; }
}

@media (max-height: 860px) {
  .app-shell {
    height: auto;
    overflow: visible;
  }

  .dashboard-grid {
    flex: 1;
    height: auto;
    min-height: 850px;
    grid-template-rows: minmax(570px, 1fr) 230px;
  }

  .network-viewport { min-height: 0; }
  .metric-card { min-height: 70px; }
  .workflow-item { min-height: 48px; }
  .table-scroll { height: calc(100% - 58px); }
}

/* Optimal Dispatch inspired offline visual system */
:root {
  --bg: #0b0e13;
  --bg-deep: #080b10;
  --panel: #141a22;
  --panel-soft: #1b232e;
  --panel-strong: #171f29;
  --line: #263341;
  --line-strong: #304153;
  --text: #d6dee7;
  --muted: #8595a6;
  --cyan: #2dd4bf;
  --cyan-soft: #66e4d1;
  --blue: #68a9ff;
  --teal: #2dd4bf;
  --amber: #f0b85a;
  --red: #ef5b68;
  --purple: #9c8cff;
  --shadow: none;
  --radius: 6px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

html,
body {
  background: var(--bg);
}

.topbar {
  min-height: 62px;
  padding: 8px 18px;
  background: linear-gradient(180deg, #111821, #0d131b);
  border-bottom-color: #202c39;
  box-shadow: none;
}

.brand-block {
  min-width: 310px;
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  color: #08201d;
  background: linear-gradient(145deg, #35dac5, #15998d);
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.18);
  font-size: 20px;
  font-weight: 800;
}

.brand-block h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.brand-block p {
  margin-top: 2px;
  font-family: "JetBrains Mono", Consolas, monospace;
  color: #8291a1;
  font-size: 9px;
  letter-spacing: 1.15px;
}

.toolbar {
  align-items: center;
}

.field > span,
.eyebrow {
  color: #8191a2;
  font-size: 9px;
  letter-spacing: 1px;
}

.compact-field select {
  height: 34px;
  background: #1b232e;
  border-color: #263341;
  border-radius: 6px;
  font-size: 11px;
}

.button,
.icon-button,
.mini-button,
.network-controls button,
.device-card-head button,
.dialog-head button {
  border-color: #304153;
  border-radius: 5px;
  background: #1b2530;
  color: #c9d3dc;
  box-shadow: none;
}

.button {
  height: 34px;
  font-size: 11px;
}

.button-primary {
  border-color: #2dd4bf;
  color: #08201d;
  background: linear-gradient(90deg, #3adbc8, #1aa99b);
}

.button:hover,
.icon-button:hover,
.mini-button:hover,
.network-controls button:hover,
.device-card-head button:hover,
.dialog-head button:hover {
  transform: none;
  border-color: #2dd4bf;
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.12);
}

.engine-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
  color: #8795a4;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
  white-space: nowrap;
}

.engine-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #37d67a;
  box-shadow: 0 0 8px rgba(55, 214, 122, 0.6);
}

.mode-tabs {
  min-height: 46px;
  padding: 4px 12px;
  gap: 5px;
  background: #10161e;
  border-bottom-color: #202c39;
}

.mode-tab {
  min-width: 135px;
  padding: 4px 9px;
  border-radius: 5px;
  background: #171f29;
  color: #8e9cab;
}

.mode-tab small {
  color: #697989;
}

.mode-tab-icon {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  color: #4ad8c5;
  background: rgba(45, 212, 191, 0.09);
}

.mode-tab:hover,
.mode-tab.active {
  border-color: rgba(45, 212, 191, 0.52);
  background: #1b292f;
}

.mode-tab.active {
  box-shadow: inset 0 -2px #2dd4bf;
}

.dashboard-grid {
  flex-basis: calc(100vh - 134px);
  height: calc(100vh - 134px);
  padding: 9px;
  grid-template-columns: 306px minmax(620px, 1fr) 334px;
  grid-template-rows: minmax(0, 1fr) 202px;
  gap: 9px;
}

.left-column,
.right-column {
  gap: 9px;
}

.panel {
  background: #141a22;
  border-color: #263341;
  box-shadow: none;
}

.panel::before {
  width: 42px;
  background: linear-gradient(90deg, #2dd4bf, transparent);
}

.panel-heading,
.table-toolbar {
  border-bottom-color: #222e3b;
}

.panel-heading h2,
.table-toolbar h2,
.dialog-head h2 {
  font-size: 13px;
  font-weight: 650;
}

.metric-card {
  min-height: 61px;
  border-color: #283646;
  border-radius: 5px;
  background: #1b232e;
}

.metric-card small {
  color: #637486;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.metric-card strong,
.primary-kpi-copy strong,
.bar-value,
th,
td,
.network-badge,
.stage-counter,
.chart-unit {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.primary-kpi {
  border-color: rgba(45, 212, 191, 0.27);
  border-radius: 5px;
  background: #18252a;
}

.progress-track span {
  background: linear-gradient(90deg, #19998e, #2dd4bf);
  box-shadow: none;
}

.workflow-item,
.recommendation-card,
.insight-item,
.bar-track,
.table-tabs,
.search-field,
.segmented {
  border-radius: 5px;
}

.network-viewport {
  border-color: #273646;
  border-radius: 5px;
  background-color: #0b0e13;
  background-image:
    linear-gradient(rgba(75, 93, 112, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(75, 93, 112, 0.055) 1px, transparent 1px);
  background-size: 52px 52px;
}

.network-alert {
  border-radius: 4px;
  background: rgba(240, 184, 90, 0.09);
  border-color: rgba(240, 184, 90, 0.25);
  color: #d5b87f;
}

.network-alert.safe {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.24);
  color: #8edacc;
}

.segmented button.active,
.mini-button.active,
.table-tab.active {
  color: #d9fff9;
  background: rgba(45, 212, 191, 0.16);
  border-color: rgba(45, 212, 191, 0.55);
}

.bar-fill,
.bar-row:nth-child(2n) .bar-fill {
  background: linear-gradient(90deg, #178e82, #2dd4bf);
  box-shadow: none;
}

.device-card {
  width: 228px;
  border-color: #2b3a49;
  border-radius: 5px;
  background: rgba(20, 26, 34, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

thead {
  background: #18212b;
}

tbody tr:hover,
tbody tr.selected {
  background: rgba(45, 212, 191, 0.08);
}

.footer-bar {
  min-height: 26px;
  background: #0d131a;
  border-top-color: #202c39;
}

.comparison-dialog {
  border-color: #304153;
  border-radius: 6px;
  background: #141a22;
}

@media (max-width: 1450px) {
  .dashboard-grid {
    grid-template-columns: 286px minmax(570px, 1fr) 308px;
  }

  .mode-tab {
    min-width: 124px;
  }

  .engine-state {
    display: none;
  }
}

/* Reference-style study framework */
body {
  min-width: 1100px;
  overflow: hidden;
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  flex: 0 0 62px;
}

.studio-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  overflow: hidden;
  background: #0b0e13;
}

.study-sidebar {
  min-width: 0;
  min-height: 0;
  background: #141a22;
  border-right: 1px solid #263341;
}

.sidebar-scroll {
  height: 100%;
  padding: 16px 15px 20px;
  overflow: auto;
  scrollbar-color: #334354 #141a22;
}

.sidebar-section {
  padding: 0 0 16px;
  margin: 0 0 16px;
  border-bottom: 1px solid #222e3b;
}

.sidebar-label,
.sidebar-subfield > span {
  display: block;
  margin-bottom: 8px;
  color: #9ba9b7;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-subfield {
  display: block;
  margin-top: 10px;
}

.sidebar-subfield > span {
  margin-bottom: 6px;
  color: #667687;
  font-size: 8px;
}

.sidebar-select {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 11px;
  color: #d3dce5;
  background: #1b232e;
  border: 1px solid #2a3847;
  border-radius: 6px;
  outline: none;
  font-size: 11px;
}

.sidebar-select:focus {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.1);
}

.sidebar-help,
.sidebar-footnote {
  margin: 8px 1px 0;
  color: #758494;
  font-size: 9px;
  line-height: 1.55;
}

.sidebar-upload {
  width: 100%;
  height: 31px;
  margin-top: 10px;
  color: #aebbc7;
  background: #171f29;
  border: 1px dashed #334354;
  border-radius: 5px;
  font-size: 10px;
}

.sidebar-upload:hover {
  color: #d9fff9;
  border-color: #2dd4bf;
}

.mode-tabs.study-mode-grid {
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  overflow: visible;
  background: transparent;
  border: 0;
}

.study-mode-grid .mode-tab {
  width: 100%;
  min-width: 0;
  min-height: 65px;
  padding: 9px;
  align-items: flex-start;
  gap: 7px;
  border: 1px solid #283646;
  border-radius: 6px;
  background: #1b232e;
}

.study-mode-grid .mode-tab strong {
  font-size: 10px;
  line-height: 1.25;
}

.study-mode-grid .mode-tab small {
  margin-top: 4px;
  color: #6f7e8d;
  font-size: 8px;
  line-height: 1.3;
}

.study-mode-grid .mode-tab-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #45dcc8;
  background: rgba(45, 212, 191, 0.09);
  border-radius: 4px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
}

.study-mode-grid .mode-tab:hover,
.study-mode-grid .mode-tab.active {
  border-color: rgba(45, 212, 191, 0.62);
  background: #1b292f;
  box-shadow: none;
}

.study-mode-grid .mode-tab.active {
  box-shadow: inset 2px 0 #2dd4bf;
}

.objective-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.objective-card {
  min-height: 76px;
  padding: 10px;
  text-align: left;
  color: #9aa8b6;
  background: #1b232e;
  border: 1px solid #283646;
  border-radius: 6px;
}

.objective-card strong,
.objective-card span,
.objective-card small {
  display: block;
}

.objective-card strong {
  color: #d4dde6;
  font-size: 10px;
}

.objective-card span {
  margin-top: 5px;
  color: #8291a0;
  font-size: 8px;
  line-height: 1.3;
}

.objective-card small {
  margin-top: 7px;
  color: #5f7080;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 7px;
  text-transform: uppercase;
}

.objective-card:hover,
.objective-card.active {
  border-color: rgba(45, 212, 191, 0.58);
  background: #1a292e;
}

.objective-card.active strong,
.objective-card.active small {
  color: #5ce2d0;
}

.run-study-button {
  width: 100%;
  height: 39px;
  font-size: 11px;
}

.command-preview {
  min-height: 44px;
  margin-top: 10px;
  padding: 9px 10px;
  display: block;
  overflow-wrap: anywhere;
  color: #8fa3b5;
  background: #0e131a;
  border: 1px solid #222e3b;
  border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
  line-height: 1.55;
}

.result-workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.result-strip {
  flex: 0 0 48px;
  min-height: 48px;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #111820;
  border-bottom: 1px solid #263341;
}

.result-strip > span {
  color: #768595;
  font-size: 9px;
  letter-spacing: 0.9px;
}

.result-strip > strong {
  padding: 6px 9px;
  color: #8ce8dc;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.26);
  border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
  white-space: nowrap;
}

.result-strip > p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #8795a4;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.result-actions .button,
.result-actions .icon-button {
  height: 30px;
  font-size: 9px;
}

.result-actions .icon-button {
  width: 30px;
}

.workspace-tabs {
  flex: 0 0 43px;
  min-height: 43px;
  padding: 0 14px;
  display: flex;
  align-items: end;
  gap: 22px;
  background: #0f151c;
  border-bottom: 1px solid #263341;
}

.workspace-tabs button {
  height: 42px;
  padding: 0 1px;
  color: #7e8c9a;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 10px;
}

.workspace-tabs button:hover,
.workspace-tabs button.active {
  color: #dce5ed;
}

.workspace-tabs button.active {
  border-bottom-color: #2dd4bf;
}

.workspace-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #0b0e13;
}

.workspace-view {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}

.workspace-view.active {
  display: block;
}

.workspace-view.diagram-view.active {
  display: flex;
}

.summary-scroll,
.input-scroll {
  height: 100%;
  padding: 14px;
  overflow: auto;
}

.result-overview .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
  gap: 9px;
}

.result-overview .metric-card {
  min-height: 79px;
  padding: 13px 13px 10px;
}

.result-overview .metric-card strong {
  margin-top: 10px;
  font-size: 21px;
}

.result-overview .primary-kpi {
  margin: 0 12px 12px;
}

.summary-lower-grid {
  min-height: 355px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 12px;
}

.summary-lower-grid .insight-panel,
.summary-lower-grid .chart-panel {
  min-height: 355px;
}

.summary-lower-grid .insight-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-view[data-workspace-view="tables"],
.diagram-view {
  padding: 14px;
}

.workspace-view .table-panel,
.diagram-view .network-panel {
  width: 100%;
  height: 100%;
}

.diagram-toolbar {
  min-height: 38px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #222e3b;
}

.subnetwork-toolbar {
  min-height: 46px;
  padding: 6px 12px;
  display: flex;
  align-items: end;
  gap: 8px;
  background: #111820;
  border-bottom: 1px solid #222e3b;
}

.subnetwork-toolbar label {
  display: grid;
  gap: 4px;
}

.subnetwork-toolbar label > span {
  color: #6f7f8f;
  font-size: 8px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.subnetwork-toolbar select,
.subnetwork-toolbar input {
  height: 28px;
  color: #cbd5df;
  background: #1b232e;
  border: 1px solid #2d3b4a;
  border-radius: 5px;
  outline: none;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
}

.subnetwork-toolbar select {
  width: 215px;
  padding: 0 28px 0 8px;
}

.subnetwork-toolbar .tier-field select {
  width: 68px;
  padding: 0 24px 0 9px;
}

.subnetwork-toolbar .mini-button {
  height: 28px;
}

.visible-network-count {
  margin: 0 0 7px auto;
  color: #7f91a2;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
  white-space: nowrap;
}

.diagram-toolbar .legend-items {
  flex-wrap: wrap;
}

.diagram-view .network-viewport {
  flex: 1 1 auto;
  min-height: 240px;
  margin: 0 10px 10px;
}

.diagram-view .network-alert {
  margin: 8px 10px 0;
}

.diagram-view .stage-controller {
  margin: 7px 10px;
}

.input-scroll {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr);
  gap: 12px;
}

.input-heading-actions,
.input-view-tabs,
.raw-source-meta {
  display: flex;
  align-items: center;
  gap: 7px;
}

.input-view-tabs {
  padding: 2px;
  background: #0e141b;
  border: 1px solid #273442;
  border-radius: 5px;
}

.input-view-tabs button {
  height: 25px;
  padding: 0 9px;
  color: #778797;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 8px;
}

.input-view-tabs button.active {
  color: #d9fff9;
  background: rgba(45, 212, 191, 0.14);
}

.input-config-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.input-source-pane {
  flex: 1;
  min-height: 0;
  display: none;
  overflow: hidden;
}

.input-source-pane.active {
  display: flex;
  flex-direction: column;
}

.input-source-pane pre {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.raw-source-meta {
  min-height: 36px;
  padding: 5px 12px;
  color: #7f91a2;
  background: #10161d;
  border-bottom: 1px solid #222e3b;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 8px;
}

.raw-source-meta span:nth-child(2) {
  margin-left: auto;
}

.raw-source-meta .mini-button {
  height: 26px;
}

#rawSourceOutput {
  margin: 0;
  background: #0d1218;
  color: #a3b4c4;
  white-space: pre;
  tab-size: 2;
}

.input-stat-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.input-stat-grid article {
  min-height: 76px;
  padding: 12px;
  background: #1b232e;
  border: 1px solid #283646;
  border-radius: 5px;
}

.input-stat-grid span,
.input-stat-grid strong {
  display: block;
}

.input-stat-grid span {
  color: #778797;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.input-stat-grid strong {
  margin-top: 13px;
  color: #d4dee7;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 550;
}

.input-config-panel pre,
.run-log-panel pre {
  margin: 0;
  padding: 15px;
  color: #8fa2b3;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 9px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.input-config-panel pre {
  min-height: 0;
}

.log-layout {
  height: 100%;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.log-layout .workflow-panel,
.run-log-panel {
  min-height: 0;
}

.run-log-panel {
  display: flex;
  flex-direction: column;
}

.run-log-panel pre {
  flex: 1;
  overflow: auto;
  color: #91a4b5;
  background: #0d1218;
}

.run-storage-panel {
  grid-column: 1 / -1;
  min-height: 0;
}

.run-storage-summary {
  padding: 0 15px 11px;
  color: #8fa2b3;
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace);
  font-size: 10px;
  line-height: 1.6;
}

.artifact-list {
  max-height: 104px;
  padding: 0 15px 13px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  overflow: auto;
}

.artifact-link {
  padding: 6px 9px;
  color: #7dd9e8;
  background: rgba(17, 57, 72, 0.72);
  border: 1px solid rgba(73, 170, 192, 0.28);
  border-radius: 5px;
  font-family: var(--font-mono, "JetBrains Mono", Consolas, monospace);
  font-size: 9px;
  text-decoration: none;
}

.artifact-link:hover {
  color: #d8f8ff;
  border-color: rgba(91, 216, 239, 0.62);
}

.footer-bar {
  flex: 0 0 26px;
}

@media (max-width: 1400px) {
  .studio-shell {
    grid-template-columns: 286px minmax(0, 1fr);
  }

  .result-overview .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .summary-lower-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  }
}

@media (max-width: 1180px) {
  .studio-shell {
    grid-template-columns: 264px minmax(0, 1fr);
  }

  .workspace-tabs {
    gap: 14px;
  }

  .summary-lower-grid {
    grid-template-columns: 1fr;
  }
}

/* Legibility pass and one-line diagram overlays */
:root {
  --font-ui: "Aptos", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --font-display: "Aptos Display", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  font-family: var(--font-ui);
}

body {
  font-family: var(--font-ui);
  font-size: 13px;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(102, 228, 209, 0.86);
  outline-offset: 2px;
}

.studio-shell {
  grid-template-columns: 330px minmax(0, 1fr);
}

.brand-block h1 {
  font-family: var(--font-display);
  font-size: 19px;
}

.brand-block p,
.engine-state {
  font-size: 11px;
}

.sidebar-label,
.sidebar-subfield > span {
  font-size: 12px;
}

.sidebar-subfield > span {
  font-size: 10px;
}

.sidebar-select,
.compact-field select {
  height: 40px;
  font-size: 13px;
}

.sidebar-help,
.sidebar-footnote {
  font-size: 11px;
  line-height: 1.6;
}

.sidebar-upload,
.run-study-button,
.button,
.mini-button {
  font-size: 12px;
}

.study-mode-grid .mode-tab {
  min-height: 76px;
  padding: 10px;
}

.study-mode-grid .mode-tab strong,
.objective-card strong {
  font-size: 12px;
}

.study-mode-grid .mode-tab small,
.objective-card span {
  font-size: 10px;
  line-height: 1.45;
}

.study-mode-grid .mode-tab-icon,
.objective-card small,
.command-preview {
  font-size: 10px;
}

.objective-card {
  min-height: 88px;
}

.result-strip > span,
.result-strip > p,
.result-actions .button,
.result-actions .icon-button {
  font-size: 10px;
}

.result-strip > strong,
.workspace-tabs button {
  font-size: 12px;
}

.panel-heading h2,
.table-toolbar h2,
.dialog-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
}

.eyebrow,
.field > span {
  font-size: 10px;
}

.status-pill,
.insight-badge,
.stage-counter,
.chart-unit,
.network-badge {
  font-size: 10px;
}

.result-overview .metric-card strong {
  font-size: 24px;
}

.metric-card span,
.primary-kpi-copy span,
.recommendation-card .recommendation-label {
  font-size: 12px;
}

.metric-card small,
.primary-kpi small,
.recommendation-card p,
.insight-item p,
.bar-label,
.bar-value {
  font-size: 11px;
}

.primary-kpi-copy strong,
.recommendation-card strong {
  font-size: 20px;
}

.insight-item strong,
.workflow-copy strong {
  font-size: 12px;
}

.workflow-copy small,
.workflow-state,
.workflow-index {
  font-size: 10px;
}

.table-tab,
.search-field input,
.row-count,
th,
td {
  font-size: 11px;
}

th,
td {
  padding: 10px 12px;
}

.footer-bar,
.input-view-tabs button,
.raw-source-meta,
.input-config-panel pre,
.run-log-panel pre {
  font-size: 10px;
}

.panel-subtitle,
.visible-network-count,
.stage-label,
.network-alert,
.device-card-head,
.device-type,
.empty-copy,
.graph-tooltip,
.network-controls span {
  font-size: 11px;
}

.subnetwork-toolbar {
  min-height: 54px;
  align-items: end;
  gap: 10px;
}

.subnetwork-toolbar label > span {
  font-size: 10px;
}

.subnetwork-toolbar select,
.subnetwork-toolbar input {
  height: 34px;
  font-size: 11px;
}

.subnetwork-toolbar select {
  width: 250px;
}

.subnetwork-toolbar .tier-field input {
  width: 66px;
}

.subnetwork-toolbar .mini-button {
  height: 34px;
}

.visible-network-count {
  margin-bottom: 9px;
}

.diagram-toolbar {
  min-height: 56px;
  padding: 8px 12px;
  flex-wrap: wrap;
}

.diagram-toolbar .legend-items {
  gap: 10px 14px;
}

.legend-items span,
.switch {
  font-size: 11px;
}

.legend-dot {
  width: 10px;
  height: 10px;
}

.legend-node {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.legend-node.generator {
  color: #cfe5ff;
  background: #234d7a;
  border-color: #56a9ff;
  border-radius: 50%;
}

.legend-node.load {
  color: #fff3cf;
  background: #6b5121;
  border-color: #f2c462;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  padding-bottom: 3px;
}

.legend-node.mixed {
  min-width: 31px;
  color: #e2dcff;
  background: #39315f;
  border-color: #a38bff;
  border-radius: 4px;
}

.diagram-display-controls,
.display-segment {
  display: flex;
  align-items: center;
}

.diagram-display-controls {
  margin-left: auto;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.display-segment {
  gap: 7px;
}

.display-segment > span {
  color: #8f9dab;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.display-chip {
  height: 31px;
  padding: 0 11px;
  color: #8f9dab;
  background: #1b232e;
  border: 1px solid #304153;
  border-radius: 5px;
  font-size: 11px;
}

.display-chip.active {
  color: #d9fff9;
  background: rgba(45, 212, 191, 0.14);
  border-color: rgba(45, 212, 191, 0.58);
}

.compact-segmented button {
  min-width: 50px;
  height: 27px;
  font-size: 10px;
}

.network-viewport {
  background-image:
    linear-gradient(rgba(92, 110, 129, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 110, 129, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(45, 212, 191, 0.055), transparent 48%);
  background-size: 48px 48px, 48px 48px, auto;
}

.network-legend-card {
  min-height: 38px;
  position: absolute;
  left: 170px;
  bottom: 10px;
  z-index: 3;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #8f9dab;
  background: rgba(13, 19, 26, 0.9);
  border: 1px solid #2d3a48;
  border-radius: 5px;
  font-size: 10px;
  pointer-events: none;
  backdrop-filter: blur(7px);
}

.network-legend-card span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.network-legend-card b {
  color: #d7e0e8;
  font-size: 10px;
  letter-spacing: 0.35px;
}

.legend-flow-pie {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #f5f8fa;
  background:
    radial-gradient(circle, #10161d 0 45%, transparent 47%),
    conic-gradient(#f0b85a 0 72%, #65717e 72% 100%);
  font-family: var(--font-mono);
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
}

.network-controls button {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.device-card {
  width: 270px;
}

.device-title strong {
  font-size: 14px;
}

.detail-item span {
  font-size: 10px;
}

.detail-item strong {
  font-size: 12px;
}

.device-type.generator,
.tooltip-gen {
  color: #79b8ff;
}

.device-type.load,
.tooltip-load {
  color: #f2c462;
}

.device-type.mixed {
  color: #b9aaff;
}

@media (max-width: 1400px) {
  .studio-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .diagram-display-controls {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .network-legend-card {
    gap: 8px;
  }
}

/* Scrollable one-line workspace and current-subnetwork data tables */
.workspace-view.diagram-view.active {
  display: block;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.diagram-view .network-panel {
  height: auto;
  min-height: 100%;
}

.diagram-view .network-viewport {
  flex: 0 0 clamp(460px, 58vh, 720px);
  height: clamp(460px, 58vh, 720px);
  min-height: 460px;
  margin-bottom: 0;
}

.diagram-view,
.sidebar-scroll,
.summary-scroll,
.input-scroll,
.table-scroll,
.subnetwork-table-scroll {
  scrollbar-width: auto;
  scrollbar-color: #405164 #111820;
}

.diagram-view::-webkit-scrollbar,
.sidebar-scroll::-webkit-scrollbar,
.summary-scroll::-webkit-scrollbar,
.input-scroll::-webkit-scrollbar,
.table-scroll::-webkit-scrollbar,
.subnetwork-table-scroll::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

.diagram-view::-webkit-scrollbar-track,
.sidebar-scroll::-webkit-scrollbar-track,
.summary-scroll::-webkit-scrollbar-track,
.input-scroll::-webkit-scrollbar-track,
.table-scroll::-webkit-scrollbar-track,
.subnetwork-table-scroll::-webkit-scrollbar-track {
  background: #111820;
  border-left: 1px solid #222e3b;
}

.diagram-view::-webkit-scrollbar-thumb,
.sidebar-scroll::-webkit-scrollbar-thumb,
.summary-scroll::-webkit-scrollbar-thumb,
.input-scroll::-webkit-scrollbar-thumb,
.table-scroll::-webkit-scrollbar-thumb,
.subnetwork-table-scroll::-webkit-scrollbar-thumb {
  min-height: 44px;
  background: #405164;
  border: 2px solid #111820;
  border-radius: 99px;
}

.diagram-view::-webkit-scrollbar-thumb:hover,
.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.summary-scroll::-webkit-scrollbar-thumb:hover,
.input-scroll::-webkit-scrollbar-thumb:hover,
.table-scroll::-webkit-scrollbar-thumb:hover,
.subnetwork-table-scroll::-webkit-scrollbar-thumb:hover {
  background: #537087;
}

.subnetwork-data-section {
  margin: 12px 10px 16px;
  overflow: hidden;
  border: 1px solid #2b3948;
  border-radius: 6px;
  background: #10161d;
}

.subnetwork-data-heading {
  min-height: 76px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.075), transparent 45%), #151c24;
  border-bottom: 1px solid #2b3948;
}

.subnetwork-data-heading h3 {
  margin: 4px 0 0;
  color: #dce5ec;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 650;
}

.subnetwork-data-heading p {
  margin: 5px 0 0;
  color: #7f8e9d;
  font-size: 11px;
  line-height: 1.45;
}

.subnetwork-data-actions,
.subnetwork-search,
.subnetwork-table-card > header,
.subnetwork-table-card > header > div {
  display: flex;
  align-items: center;
}

.subnetwork-data-actions {
  gap: 9px;
}

.subnetwork-search {
  width: 280px;
  height: 36px;
  padding: 0 10px;
  gap: 7px;
  color: #6f8090;
  background: #0e141b;
  border: 1px solid #304153;
  border-radius: 5px;
}

.subnetwork-search:focus-within {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.1);
}

.subnetwork-search input {
  width: 100%;
  color: #d7e1e9;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
}

.subnetwork-search input::placeholder {
  color: #687787;
}

.subnetwork-tables {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 12px;
}

.subnetwork-tables[hidden] {
  display: none;
}

.subnetwork-table-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #2b3948;
  border-radius: 6px;
  background: #0d1319;
}

.subnetwork-table-card > header {
  height: 50px;
  padding: 0 12px;
  justify-content: space-between;
  gap: 10px;
  background: #151c24;
  border-bottom: 1px solid #2b3948;
}

.subnetwork-table-card > header > div {
  min-width: 0;
  gap: 8px;
}

.subnetwork-table-card h4 {
  margin: 0;
  overflow: hidden;
  color: #c8d3dc;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subnetwork-table-index {
  color: #4fdec9;
  font-family: var(--font-mono);
  font-size: 9px;
}

.subnetwork-count {
  min-width: 27px;
  height: 24px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  color: #8ee8dc;
  background: rgba(45, 212, 191, 0.09);
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 99px;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.subnetwork-table-scroll {
  max-height: 380px;
  overflow: auto;
}

.subnetwork-table-card table {
  min-width: 660px;
  table-layout: auto;
}

.branch-table-card table {
  min-width: 760px;
}

.generator-table-card table {
  min-width: 590px;
}

.subnetwork-table-card thead {
  background: #1a2430;
}

.subnetwork-table-card th,
.subnetwork-table-card td {
  min-width: 76px;
  height: 42px;
  padding: 9px 10px;
  border-right-color: #24313e;
  border-bottom-color: #273442;
  font-size: 11px;
}

.subnetwork-table-card th {
  color: #9baaba;
  font-size: 10px;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.subnetwork-table-card td {
  max-width: 190px;
  overflow: hidden;
  color: #bac6d0;
  text-overflow: ellipsis;
}

.subnetwork-table-card tbody tr.selected {
  background: rgba(45, 212, 191, 0.12);
  box-shadow: inset 3px 0 #2dd4bf;
}

.table-device-link {
  min-width: 0;
  padding: 0;
  color: #67e1d0;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted rgba(103, 225, 208, 0.55);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.table-device-link:hover {
  color: #d9fff9;
  border-bottom-color: #d9fff9;
}

.equipment-kind,
.branch-status {
  padding: 3px 6px;
  display: inline-flex;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  white-space: nowrap;
}

.equipment-kind.bus {
  color: #aab6c1;
  background: rgba(133, 149, 166, 0.1);
}

.equipment-kind.generator {
  color: #9bcaff;
  background: rgba(86, 169, 255, 0.12);
}

.equipment-kind.load {
  color: #f3d28b;
  background: rgba(242, 196, 98, 0.12);
}

.equipment-kind.mixed {
  color: #c8bcff;
  background: rgba(163, 139, 255, 0.13);
}

.branch-status.active {
  color: #7fe0c3;
  background: rgba(45, 212, 191, 0.1);
}

.branch-status.opened {
  color: #a1adba;
  background: rgba(126, 140, 154, 0.12);
}

.cell-muted {
  color: #778797 !important;
}

.subnetwork-empty {
  height: 86px !important;
  color: #748493 !important;
  text-align: center;
}

.network-panel.network-focus {
  overflow-y: auto;
}

.network-panel.network-focus .network-viewport {
  flex-basis: clamp(520px, 68vh, 820px);
  height: clamp(520px, 68vh, 820px);
}

@media (max-width: 1500px) {
  .subnetwork-tables {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .branch-table-card {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (max-width: 1080px) {
  .subnetwork-data-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .subnetwork-data-actions,
  .subnetwork-search {
    width: 100%;
  }

  .subnetwork-tables {
    grid-template-columns: 1fr;
  }

  .branch-table-card {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Unified study modes and operating-point summary analytics */
.mode-select-fallback[hidden] {
  display: none;
}

.mode-tabs.study-mode-grid {
  grid-template-columns: 1fr;
  gap: 6px;
}

.study-mode-grid .mode-tab {
  min-height: 60px;
  padding: 7px 9px;
  align-items: flex-start;
}

.study-mode-grid .mode-tab-icon {
  flex-basis: 25px;
  width: 25px;
  height: 25px;
  font-size: 11px;
}

.study-mode-grid .mode-tab-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 4px;
}

.study-mode-grid .mode-tab strong,
.study-mode-grid .mode-tab small {
  margin: 0;
  line-height: 1.2;
}

.study-mode-grid .mode-tab strong {
  color: #d9e2e9;
  font-size: 12px;
  letter-spacing: 0.01em;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.study-mode-grid .mode-tab small {
  color: #718293;
  font-family: var(--font-mono);
  font-size: 9px;
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
}

.study-mode-grid .mode-tab.active small {
  color: #78cfc3;
}

.layout-help {
  min-height: 44px;
  padding: 8px 9px;
  color: #8c9bab;
  background: rgba(27, 35, 46, 0.62);
  border-left: 2px solid rgba(45, 212, 191, 0.58);
  border-radius: 0 5px 5px 0;
}

.summary-analytics-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 12px;
}

.dispatch-breakdown-panel,
.loading-distribution-panel,
.loading-gauge-panel {
  min-height: 0;
}

.loading-gauge-panel {
  grid-column: 1 / -1;
}

.dispatch-breakdown {
  padding: 12px;
}

.dispatch-donut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.summary-donut-card {
  min-width: 0;
  padding: 12px;
  background: #111820;
  border: 1px solid #273545;
  border-radius: 8px;
}

.summary-donut-card h3 {
  margin: 0 0 12px;
  color: #aab7c3;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.015em;
}

.summary-donut-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.summary-donut {
  width: 126px;
  aspect-ratio: 1;
  padding: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--donut-fill);
  box-shadow: 0 0 0 1px rgba(90, 116, 136, 0.25), 0 12px 28px rgba(0, 0, 0, 0.24);
}

.summary-donut > div {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: #111820;
  box-shadow: inset 0 0 0 1px rgba(81, 105, 123, 0.24);
}

.summary-donut strong,
.summary-donut span {
  display: block;
}

.summary-donut strong {
  color: #eef7fb;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 650;
}

.summary-donut span {
  margin-top: 3px;
  color: #738596;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.summary-donut-legend {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.summary-donut-legend > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: #96a6b4;
  font-size: 10px;
}

.summary-donut-legend i,
.loading-band-summary i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.summary-donut-legend span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-donut-legend strong {
  color: #d2dce4;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.dispatch-stat-strip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #273545;
  border-radius: 7px;
  background: #111820;
}

.dispatch-stat-strip.four-column {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dispatch-stat-strip > div {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid #273545;
}

.dispatch-stat-strip > div:last-child {
  border-right: 0;
}

.dispatch-stat-strip span,
.dispatch-stat-strip strong {
  display: block;
}

.dispatch-stat-strip span {
  color: #788999;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dispatch-stat-strip strong {
  margin-top: 5px;
  color: #dce7ed;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}

.dispatch-stat-strip small {
  color: #738596;
  font-size: 9px;
}

.dispatch-balance-note {
  margin-top: 8px;
  padding: 8px 10px;
  color: #8295a5;
  background: rgba(45, 212, 191, 0.045);
  border: 1px solid rgba(45, 212, 191, 0.18);
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.55;
}

.dispatch-balance-note strong {
  color: #62dfcf;
  font-weight: 650;
}

.loading-gauge-grid {
  padding: 15px 14px 17px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 9px;
}

.loading-gauge {
  min-width: 0;
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  background: #111820;
  border: 1px solid #273545;
  border-radius: 8px;
  text-align: center;
}

.loading-gauge svg {
  width: 82px;
  height: 82px;
  overflow: visible;
}

.loading-gauge-track,
.loading-gauge-value {
  fill: none;
  stroke-width: 8;
}

.loading-gauge-track {
  stroke: #26313d;
}

.loading-gauge-value {
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 40px 40px;
  transition: stroke-dasharray 420ms ease;
}

.loading-gauge text {
  fill: #e5eef4;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 650;
  text-anchor: middle;
}

.loading-gauge > strong,
.loading-gauge > span,
.loading-gauge > small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-gauge > strong {
  color: #d6e0e7;
  font-family: var(--font-mono);
  font-size: 10px;
}

.loading-gauge > span {
  margin-top: 4px;
  color: #91a1af;
  font-size: 10px;
}

.loading-gauge > small {
  margin-top: 5px;
  color: #657788;
  font-family: var(--font-mono);
  font-size: 8px;
}

.loading-histogram {
  min-height: 300px;
  padding: 18px 16px 14px;
  display: flex;
  flex-direction: column;
}

.loading-hist-bars {
  flex: 1;
  min-height: 190px;
  padding: 24px 4px 0;
  display: grid;
  grid-template-columns: repeat(21, minmax(4px, 1fr));
  align-items: end;
  gap: 4px;
  border-bottom: 1px solid #334252;
  background-image: linear-gradient(to top, rgba(74, 96, 114, 0.14) 1px, transparent 1px);
  background-size: 100% 25%;
}

.loading-hist-bars i {
  min-height: 0;
  position: relative;
  border-radius: 3px 3px 0 0;
  opacity: 0.88;
  transition: opacity 140ms ease, filter 140ms ease;
}

.loading-hist-bars i:hover {
  opacity: 1;
  filter: brightness(1.14);
}

.loading-hist-bars i span {
  position: absolute;
  top: -17px;
  left: 50%;
  color: #8595a4;
  font-family: var(--font-mono);
  font-size: 8px;
  transform: translateX(-50%);
}

.loading-hist-axis {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  color: #6f8090;
  font-size: 9px;
}

.loading-band-summary {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.loading-band-summary span {
  padding: 5px 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #91a1af;
  background: #111820;
  border: 1px solid #273545;
  border-radius: 4px;
  font-size: 9px;
}

.loading-band-summary strong {
  color: #dbe4eb;
  font-family: var(--font-mono);
}

.summary-analytics-empty {
  margin: auto;
  color: #748493;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 1320px) {
  .summary-analytics-grid {
    grid-template-columns: 1fr;
  }

  .loading-gauge-panel {
    grid-column: auto;
  }

  .study-mode-grid .mode-tab small {
    display: block;
  }
}

@media (max-width: 1040px) {
  .dispatch-donut-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-gauge-value {
    transition: none;
  }
}

/* Transfer configuration, richer input inspection, and typography */
:root {
  --font-ui: "Inter", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --font-display: "Inter", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
  font-family: var(--font-ui);
}

body,
button,
select,
input,
output {
  font-family: var(--font-ui);
}

code,
pre,
.command-preview,
.mode-tab small,
.primary-kpi-percent,
.input-stat-grid strong,
.input-operating-summary strong {
  font-family: var(--font-mono);
}

.transfer-definition-section[hidden],
.switching-limit-section[hidden],
.transfer-result-direction[hidden] {
  display: none;
}

.sidebar-section-heading {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-section-heading .sidebar-label {
  margin-bottom: 0;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8d9baa;
  font-size: 10px;
  white-space: nowrap;
}

.compact-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #2dd4bf;
}

.transfer-selector-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.transfer-area-card {
  min-width: 0;
  padding: 7px;
  background: #171e27;
  border: 1px solid #2a3847;
  border-radius: 6px;
}

.transfer-area-heading,
.transfer-list-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.transfer-area-heading {
  margin-bottom: 6px;
  color: #8c9baa;
  font-size: 10px;
}

.transfer-area-heading output {
  color: #58ddc9;
  font-family: var(--font-mono);
  font-size: 9px;
}

.transfer-bus-list {
  max-height: 142px;
  overflow: auto;
  display: grid;
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: #3b5365 #141b23;
}

.transfer-bus-option {
  min-width: 0;
  padding: 5px 6px;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  color: #a8b5c1;
  background: #1d2631;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}

.transfer-bus-option:hover,
.transfer-bus-option:has(input:checked) {
  color: #d6f8f2;
  background: #1b302f;
  border-color: #2b6b63;
}

.transfer-bus-option input {
  width: 13px;
  height: 13px;
  margin: 1px 0 0;
  accent-color: #2dd4bf;
}

.transfer-bus-option span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.transfer-bus-option strong,
.transfer-bus-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-bus-option strong {
  font-size: 10px;
  font-weight: 600;
}

.transfer-bus-option small {
  color: #758696;
  font-family: var(--font-mono);
  font-size: 8px;
}

.transfer-area-card.disabled {
  opacity: 0.55;
}

.transfer-list-actions {
  margin-top: 6px;
  justify-content: flex-end;
}

.transfer-list-actions button {
  padding: 2px 5px;
  color: #8fa1b1;
  background: transparent;
  border: 0;
  font-size: 9px;
  cursor: pointer;
}

.transfer-list-actions button:hover:not(:disabled) {
  color: #5fe0cc;
}

.transfer-list-actions button:disabled,
.transfer-bus-option input:disabled {
  cursor: not-allowed;
}

.transfer-arrow {
  height: 14px;
  display: grid;
  place-items: center;
  color: #48d8c4;
  font-family: var(--font-mono);
  font-size: 14px;
}

.transfer-config-status {
  margin: 9px 0 0;
  padding: 8px 9px;
  color: #8393a2;
  background: #171f29;
  border: 1px solid #2a3847;
  border-left: 3px solid #607384;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.5;
}

.transfer-config-status.custom {
  color: #bdece5;
  border-left-color: #2dd4bf;
}

.transfer-config-status.warning {
  color: #f0cf87;
  border-left-color: #e8b443;
}

.switching-limit-section output {
  color: #72dfcf;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.opening-range {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: #2dd4bf;
  cursor: ew-resize;
}

.range-ticks {
  margin-top: -3px;
  padding: 0 3px;
  display: flex;
  justify-content: space-between;
  color: #657585;
  font-family: var(--font-mono);
  font-size: 8px;
}

.primary-kpi-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.primary-kpi-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.primary-kpi-copy strong {
  font-family: var(--font-mono);
  font-size: 23px;
}

.primary-kpi-percent {
  min-width: 154px;
  padding: 9px 13px;
  display: grid;
  justify-items: end;
  color: #d9fff7;
  background: rgba(45, 212, 191, 0.13);
  border: 1px solid rgba(45, 212, 191, 0.48);
  border-radius: 7px;
  box-shadow: inset 3px 0 #2dd4bf, 0 0 22px rgba(45, 212, 191, 0.08);
}

.primary-kpi-percent strong,
.primary-kpi-percent span {
  display: block;
}

.primary-kpi-percent strong {
  font-size: 21px;
  line-height: 1;
}

.primary-kpi-percent span {
  margin-top: 5px;
  color: #79bcb2;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.primary-kpi-percent.unverified {
  color: #ffe3a6;
  background: rgba(232, 180, 67, 0.1);
  border-color: rgba(232, 180, 67, 0.48);
  box-shadow: inset 3px 0 #e8b443;
}

.primary-kpi-percent.unverified span {
  color: #b99b5a;
}

.transfer-result-direction {
  margin-top: 9px;
  padding-top: 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid rgba(93, 133, 151, 0.2);
  color: #a8b7c3;
  font-size: 10px;
}

.transfer-result-direction > span {
  color: #62dfcd;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.transfer-result-direction strong {
  max-width: 310px;
  overflow: hidden;
  color: #dbe5eb;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-result-direction i {
  color: #48d8c4;
  font-family: var(--font-mono);
  font-style: normal;
}

.transfer-result-direction small {
  margin: 0 0 0 auto;
  color: #758696;
  font-size: 9px;
}

.transfer-result-direction.custom > span,
.transfer-result-direction.custom i {
  color: #e8b443;
}

.diagram-drag-hint {
  margin: 0 0 9px auto;
  color: #6f8191;
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.table-tabs {
  max-width: min(760px, 58vw);
  display: flex;
  overflow-x: auto;
  scrollbar-width: thin;
}

.table-tab {
  flex: 0 0 auto;
  white-space: nowrap;
}

.input-scroll {
  grid-template-rows: auto minmax(560px, 1fr);
}

.input-panel .panel-subtitle {
  margin-top: 5px;
}

.input-stat-grid article {
  min-height: 112px;
  position: relative;
  padding: 18px 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #131a22;
}

.input-stat-grid article::before {
  content: "";
  width: 4px;
  position: absolute;
  inset: 0 auto 0 0;
  background: #2dd4bf;
}

.input-stat-grid span {
  font-size: 11px;
}

.input-stat-grid strong {
  margin-top: 18px;
  font-size: 22px;
}

.input-view-tabs {
  max-width: 100%;
  overflow-x: auto;
}

.input-view-tabs button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  font-size: 10px;
  white-space: nowrap;
}

.input-source-pane[data-input-pane="parsed"].active {
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  overflow: auto;
}

.input-operating-summary {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid #253240;
}

.input-operating-summary > div {
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #1a2330;
  border: 1px solid #2b3948;
  border-radius: 5px;
}

.input-operating-summary span {
  overflow: hidden;
  color: #8191a1;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input-operating-summary strong {
  color: #dce5eb;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.input-data-toolbar {
  min-height: 46px;
  padding: 7px 12px 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #293746;
}

.input-data-tabs {
  min-width: 0;
  display: flex;
  gap: 14px;
  overflow-x: auto;
}

.input-data-tabs button {
  height: 38px;
  padding: 0 3px;
  flex: 0 0 auto;
  color: #8493a2;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.input-data-tabs button:hover,
.input-data-tabs button.active {
  color: #dce7ec;
  border-bottom-color: #2dd4bf;
}

.input-parsed-table-scroll {
  min-height: 260px;
  overflow: auto;
  scrollbar-color: #364859 #121920;
}

.input-parsed-table-scroll table {
  width: 100%;
  border-collapse: collapse;
}

.input-parsed-table-scroll thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

.input-parsed-table-scroll th {
  background: #1b2532;
}

.input-parsed-table-scroll th,
.input-parsed-table-scroll td {
  padding: 11px 13px;
  border-bottom: 1px solid #263442;
  font-size: 11px;
  white-space: nowrap;
}

.input-parsed-table-scroll td {
  color: #b9c5ce;
}

.input-data-empty {
  height: 112px;
  color: #718292 !important;
  text-align: center;
}

.model-config-details {
  border-top: 1px solid #293746;
  background: #10161d;
}

.model-config-details summary {
  padding: 10px 14px;
  color: #8fa0af;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.model-config-details pre {
  max-height: 280px;
  border-top: 1px solid #24313e;
}

.source-unavailable.active {
  display: grid;
  place-items: center;
  padding: 48px;
}

.source-unavailable > div {
  max-width: 620px;
  padding: 24px;
  color: #8393a2;
  background: #141c25;
  border: 1px dashed #354657;
  border-radius: 8px;
  text-align: center;
}

.source-unavailable strong {
  color: #d4dfe6;
  font-size: 13px;
}

.source-unavailable p {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.7;
}

.run-log-panel pre {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
}

@media (max-width: 1500px) {
  .input-operating-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .table-actions {
    flex-wrap: wrap;
  }

  .table-tabs {
    max-width: 100%;
  }
}

@media (max-width: 1220px) {
  .input-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .input-operating-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-kpi-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-kpi-percent {
    min-width: 0;
    justify-items: start;
  }

  .transfer-result-direction small {
    width: 100%;
    margin-left: 0;
  }
}

/* Final legibility uplift: keep dense engineering data readable at desktop scale. */
@media (min-width: 1401px) {
  .studio-shell {
    grid-template-columns: 380px minmax(0, 1fr);
  }
}

body {
  font-size: 14px;
}

.study-mode-grid .mode-tab strong,
.workspace-tabs button,
.sidebar-select,
.compact-field select {
  font-size: 13px;
}

.sidebar-help,
.sidebar-footnote,
.transfer-config-status,
.transfer-selector-grid label > span,
.compact-check,
.input-operating-summary span,
.input-view-tabs button,
.model-config-details summary,
.source-unavailable p,
.run-log-panel pre {
  font-size: 11px;
}

.panel-heading h2,
.table-toolbar h2,
.dialog-head h2 {
  font-size: 17px;
}

.table-tab,
.search-field input,
.row-count,
th,
td,
.input-parsed-table-scroll th,
.input-parsed-table-scroll td {
  font-size: 12px;
}

.study-mode-grid .mode-tab small,
.result-strip > span,
.result-strip > p,
.transfer-result-direction,
.diagram-drag-hint {
  font-size: 10px;
}

/* Unified TTC configuration: one study mode, one opening-cap slider, one secondary objective. */
.ttc-objective-section[hidden] {
  display: none;
}

.secondary-control-label {
  color: #718293;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.objective-segment {
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  background: #111820;
  border: 1px solid #2a3847;
  border-radius: 7px;
}

.objective-option {
  min-width: 0;
  min-height: 52px;
  padding: 8px 9px;
  display: grid;
  align-content: center;
  gap: 4px;
  color: #8291a0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
}

.objective-option strong,
.objective-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.objective-option strong {
  color: #aebbc7;
  font-size: 12px;
  font-weight: 650;
}

.objective-option small {
  color: #657585;
  font-family: var(--font-mono);
  font-size: 9px;
}

.objective-option:hover {
  color: #cfe9e5;
  background: rgba(45, 212, 191, 0.05);
}

.objective-option.active {
  background: #1a292e;
  border-color: rgba(45, 212, 191, 0.58);
  box-shadow: inset 2px 0 #2dd4bf;
}

.objective-option.active strong,
.objective-option.active small {
  color: #64dfce;
}

.objective-option:focus-visible {
  outline: 2px solid #2dd4bf;
  outline-offset: 2px;
}

.objective-help {
  min-height: 34px;
  margin-top: 7px;
}

@media (max-width: 1099px) {
  html,
  body {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 100%;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    min-height: 0;
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .brand-block {
    min-width: 0;
  }

  .brand-block h1 {
    font-size: 16px;
  }

  .toolbar {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .compact-field {
    min-width: min(150px, 100%);
    flex: 1 1 150px;
  }

  .compact-field select {
    width: 100%;
  }

  .studio-shell {
    display: block;
    min-height: 0;
    overflow: visible;
  }

  .study-sidebar {
    border-right: 0;
    border-bottom: 1px solid #263341;
  }

  .sidebar-scroll {
    height: auto;
    overflow: visible;
  }

  .result-workspace {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .result-strip {
    min-height: 0;
    padding: 10px 12px;
    flex: 0 0 auto;
    flex-wrap: wrap;
  }

  .result-strip > strong {
    white-space: normal;
  }

  .result-strip > p {
    width: 100%;
    white-space: normal;
  }

  .result-actions {
    margin-left: auto;
  }

  .workspace-tabs {
    min-height: 44px;
    padding: 0 12px;
    align-items: end;
    overflow-x: auto;
  }

  .workspace-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .workspace-body {
    min-height: 0;
    overflow: visible;
  }

  .workspace-view,
  .workspace-view.diagram-view.active {
    position: static;
    inset: auto;
    overflow: visible;
  }

  .summary-scroll,
  .input-scroll {
    height: auto;
    overflow: visible;
  }

  .workspace-view .table-panel,
  .diagram-view .network-panel {
    height: auto;
  }

  .workspace-view[data-workspace-view="tables"],
  .diagram-view {
    padding: 10px;
  }

  .footer-bar {
    flex: 0 0 auto;
  }
}

@media (max-width: 520px) {
  .brand-block p {
    display: none;
  }

  .result-actions {
    width: 100%;
    margin-left: 0;
  }

  .result-actions .button {
    flex: 1 1 auto;
  }

  .objective-segment,
  .result-overview .metric-grid,
  .input-stat-grid,
  .input-operating-summary {
    grid-template-columns: 1fr;
  }
}

/* BSI presentation cover and gated access. */
.access-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  min-width: 980px;
  min-height: 620px;
  overflow: hidden;
  color: #ffffff;
  isolation: isolate;
  background: #0d2f5d;
}

.access-gate::before,
.access-gate::after,
.access-hero {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.access-hero {
  z-index: -3;
  background: url("assets/bsi-control-room.jpeg") center 36% / cover no-repeat;
  transform: scale(1.008);
}

.access-gate::before {
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(1, 13, 27, 0.2) 0%, rgba(2, 21, 47, 0.06) 43%, rgba(19, 66, 125, 0.88) 47%, rgba(13, 48, 95, 0.94) 91%, rgba(226, 229, 226, 0.98) 91.4%, rgba(226, 229, 226, 0.98) 100%),
    linear-gradient(90deg, rgba(8, 31, 65, 0.18), transparent 35%, transparent 65%, rgba(8, 31, 65, 0.2));
}

.access-gate::after {
  z-index: -1;
  background: linear-gradient(180deg, transparent 0%, transparent 45%, rgba(75, 120, 177, 0.13) 45.2%, rgba(1, 21, 55, 0.25) 91%, transparent 91.2%);
}

.access-gate[hidden] {
  display: none;
}

body.access-locked {
  overflow: hidden;
}

body.access-locked .app-shell {
  pointer-events: none;
  user-select: none;
  visibility: hidden;
}

.access-title-block {
  position: absolute;
  top: 49.5%;
  left: 50%;
  width: min(74vw, 1420px);
  transform: translate(-50%, -4%);
  text-align: center;
  text-shadow: 0 4px 15px rgba(1, 19, 48, 0.3);
}

.access-rule {
  display: block;
  height: 6px;
  margin: 0 auto;
  background: rgba(244, 244, 238, 0.96);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.access-title-block h1 {
  margin: 34px 0 22px;
  color: #ffc400;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: clamp(56px, 5.2vw, 108px);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.access-title-block p {
  margin: 0 0 34px;
  color: #ffc400;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: clamp(30px, 3vw, 61px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.005em;
  white-space: nowrap;
}

.access-title-block em {
  display: block;
  margin-top: 23px;
  color: rgba(255, 255, 255, 0.94);
  font-family: "Segoe Script", "Lucida Handwriting", cursive;
  font-size: clamp(31px, 3.1vw, 62px);
  font-weight: 400;
  line-height: 1;
  transform: rotate(-1.4deg);
}

.access-accent {
  display: block;
  width: min(34vw, 650px);
  height: 10px;
  margin: 25px auto 0;
  background: #d6af00;
}

.access-locations {
  position: absolute;
  z-index: 1;
  bottom: 0;
  left: 50%;
  width: min(650px, 44vw);
  height: 8.6vh;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateX(-50%);
  color: #244b82;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 1.5vw, 31px);
  font-weight: 700;
  letter-spacing: 0.015em;
}

.access-card {
  position: absolute;
  z-index: 3;
  right: clamp(32px, 3.4vw, 72px);
  bottom: clamp(30px, 3.5vh, 48px);
  width: clamp(390px, 24vw, 485px);
  min-height: 114px;
  padding: 17px 18px 11px;
  background: linear-gradient(180deg, rgba(20, 58, 103, 0.98), rgba(16, 51, 93, 0.98));
  border: 1px solid rgba(196, 215, 236, 0.34);
  border-radius: 15px;
  box-shadow: 0 20px 45px rgba(0, 18, 45, 0.35), inset 0 1px rgba(255, 255, 255, 0.06);
}

.access-kicker {
  display: block;
  margin: 0 0 9px;
  color: #f4f7fb;
  font: 800 13px/1 Arial, "Segoe UI", sans-serif;
  letter-spacing: 0.035em;
}

.access-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px;
  gap: 11px;
}

.access-input-row input,
.access-input-row button {
  height: 52px;
  border-radius: 9px;
}

.access-input-row input {
  min-width: 0;
  padding: 0 16px;
  color: #18355b;
  background: #f1f5fb;
  border: 1px solid #dbe6f2;
  outline: none;
  font-size: 20px;
  letter-spacing: 0.2em;
}

.access-input-row input:focus {
  border-color: #ffcc00;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.22);
}

.access-input-row button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 27px;
  color: #123462;
  background: #ffca05;
  border: 1px solid #ffdb46;
  font-family: Arial, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease;
}

.access-input-row button:hover,
.access-input-row button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 7px 18px rgba(0, 16, 43, 0.28);
}

#accessCodeMessage {
  min-height: 15px;
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.2;
}

#accessCodeMessage.error { color: #ffb4bb; }
#accessCodeMessage.success { color: #b4ffde; }

@media (max-height: 780px) {
  .access-title-block {
    top: 45%;
    transform: translate(-50%, 0);
  }

  .access-title-block h1 {
    margin-top: 22px;
    margin-bottom: 14px;
  }

  .access-title-block p {
    margin-bottom: 22px;
  }

  .access-title-block em {
    margin-top: 14px;
  }

  .access-accent {
    margin-top: 16px;
  }

  .access-card {
    bottom: 18px;
  }
}

.network-case-section {
  padding: 12px;
  background: rgba(19, 29, 40, 0.72);
  border: 1px solid #2c3b49;
  border-radius: 7px;
}

.inline-comparison-panel {
  border-color: rgba(45, 212, 191, 0.32);
  background: linear-gradient(135deg, rgba(19, 38, 45, 0.92), rgba(15, 25, 35, 0.94));
}

.comparison-highlight {
  padding: 5px 9px;
  color: #65e5d3;
  background: rgba(45, 212, 191, 0.09);
  border: 1px solid rgba(45, 212, 191, 0.26);
  border-radius: 4px;
  font: 700 9px/1.1 var(--font-mono, "JetBrains Mono", Consolas, monospace);
  letter-spacing: 0.09em;
}

.inline-comparison-content .comparison-grid {
  align-items: stretch;
}

.inline-comparison-content .comparison-side {
  min-width: 0;
  background: rgba(11, 20, 29, 0.7);
}

.inline-comparison-content .comparison-side.recommended {
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: inset 3px 0 #2dd4bf;
}

.inline-comparison-content .comparison-metric strong {
  color: #eaf2f7;
}

.inline-comparison-content .recommended .comparison-metric strong {
  color: #6ce4d3;
}

.summary-results-grid {
  grid-template-columns: minmax(0, 1fr);
}

.summary-results-grid .insight-panel[hidden] {
  display: none !important;
}

.summary-results-grid .chart-panel {
  min-width: 0;
}

.result-overview.impact-focused .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.result-overview.impact-focused .metric-card {
  min-height: 98px;
  padding: 15px 15px 12px;
}

.result-overview.impact-focused .metric-card strong {
  margin-top: 12px;
  font-size: 27px;
  line-height: 1.05;
}

.result-overview.impact-focused .impact-card-1 {
  background: linear-gradient(145deg, rgba(24, 66, 65, 0.74), rgba(22, 31, 42, 0.98));
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: inset 4px 0 #2dd4bf, 0 0 24px rgba(45, 212, 191, 0.08);
}

.result-overview.impact-focused .impact-card-1 strong {
  color: #78f0de;
  font-size: 35px;
}

.result-overview.impact-focused .impact-card-2 strong {
  color: #78f0de;
  font-size: 31px;
}

.result-overview.impact-focused .primary-kpi {
  padding: 16px 18px;
  border-color: rgba(45, 212, 191, 0.38);
  background: linear-gradient(135deg, rgba(20, 45, 49, 0.86), rgba(18, 27, 37, 0.96));
}

.result-overview.impact-focused .primary-kpi-copy strong {
  color: #74ead8;
  font-size: 34px;
}

.result-overview.impact-focused .primary-kpi-percent strong {
  font-size: 28px;
}

@media (max-width: 1180px) {
  .result-overview.impact-focused .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ttc-pv-nose-zoom rect {
  fill: rgba(10, 18, 27, 0.96);
  stroke: rgba(255, 111, 120, 0.72);
  stroke-width: 1.2;
}

.ttc-pv-nose-zoom > text {
  fill: #ffadb4;
  font: 700 8px/1 var(--font-mono, "JetBrains Mono", Consolas, monospace);
  letter-spacing: 0.08em;
}

.ttc-pv-nose-zoom > line {
  stroke: rgba(129, 153, 169, 0.45);
  stroke-width: 0.8;
}

.ttc-pv-operational-zoom rect {
  fill: rgba(9, 19, 27, 0.97);
  stroke: rgba(66, 217, 176, 0.72);
  stroke-width: 1.2;
}

.ttc-pv-operational-zoom > text {
  fill: #85efd4;
  font: 700 8px/1 var(--font-mono, "JetBrains Mono", Consolas, monospace);
  letter-spacing: 0.08em;
}

.ttc-pv-operational-zoom > line:not(.ttc-pv-operating-marker):not(.ttc-pv-uplift-arrow) {
  stroke: rgba(129, 153, 169, 0.45);
  stroke-width: 0.8;
}

.snapshot-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.snapshot-result-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid #2a3947;
  border-left: 3px solid #4da7d4;
  border-radius: 6px;
  background: #111923;
}

.snapshot-result-card.tone-success,
.snapshot-result-card.tone-primary {
  border-left-color: #42d9b0;
}

.snapshot-result-card.tone-warning {
  border-left-color: #f2c462;
}

.snapshot-result-card span,
.snapshot-result-card strong,
.snapshot-result-card small {
  display: block;
}

.snapshot-result-card span {
  min-height: 25px;
  color: #8496a6;
  font-size: 9px;
  line-height: 1.35;
  text-transform: uppercase;
}

.snapshot-result-card strong {
  margin-top: 5px;
  color: #e7f1f6;
  font: 700 14px/1.25 var(--font-mono, "JetBrains Mono", Consolas, monospace);
  overflow-wrap: anywhere;
}

.snapshot-result-card small {
  margin-top: 6px;
  color: #627687;
  font-size: 8px;
}

.snapshot-comparison-list {
  width: 100%;
  display: grid;
  gap: 8px;
}

.snapshot-comparison-row {
  padding: 10px;
  border: 1px solid #283746;
  border-radius: 6px;
  background: #111923;
}

.snapshot-comparison-row > span {
  display: block;
  color: #9cadba;
  font-size: 10px;
  font-weight: 700;
}

.snapshot-comparison-values {
  margin-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.snapshot-comparison-values div {
  min-width: 0;
}

.snapshot-comparison-values small,
.snapshot-comparison-values strong {
  display: block;
}

.snapshot-comparison-values small {
  color: #637889;
  font-size: 8px;
}

.snapshot-comparison-values strong {
  margin-top: 3px;
  overflow: hidden;
  color: #dfe9ef;
  font: 650 10px/1.3 var(--font-mono, "JetBrains Mono", Consolas, monospace);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-comparison-values div:last-child strong,
.snapshot-comparison-values i {
  color: #62dfc0;
}

.snapshot-comparison-values i {
  font-style: normal;
}

.snapshot-bar-pair {
  margin-top: 8px;
  display: grid;
  gap: 3px;
}

.snapshot-bar-pair > i {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #202e3a;
}

.snapshot-bar-pair b {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #527b9e;
}

.snapshot-bar-pair i:last-child b {
  background: linear-gradient(90deg, #2aa98d, #62dfc0);
}

.snapshot-delta {
  margin-top: 6px;
  display: block;
  color: #6edfc3;
  font: 650 8px/1.3 var(--font-mono, "JetBrains Mono", Consolas, monospace);
}

.snapshot-stage-flow,
.snapshot-verification-strip {
  grid-column: 1 / -1;
  width: 100%;
}

.snapshot-stage-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.snapshot-stage-flow article {
  min-width: 0;
  padding: 12px;
  border: 1px solid #2a3947;
  border-top: 3px solid #42d9b0;
  border-radius: 6px;
  background: #111923;
}

.snapshot-stage-flow span,
.snapshot-stage-flow strong,
.snapshot-stage-flow small {
  display: block;
}

.snapshot-stage-flow span {
  color: #6fe2c7;
  font: 700 9px/1.2 var(--font-mono, "JetBrains Mono", Consolas, monospace);
}

.snapshot-stage-flow strong {
  margin-top: 7px;
  color: #ebf4f7;
  font: 700 17px/1.2 var(--font-mono, "JetBrains Mono", Consolas, monospace);
}

.snapshot-stage-flow small {
  margin-top: 7px;
  color: #7b8e9e;
  font-size: 9px;
  line-height: 1.45;
}

.snapshot-verification-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #2a3947;
  border-radius: 6px;
  background: rgba(16, 25, 35, 0.8);
}

.snapshot-verification-strip > div {
  min-width: 0;
  padding: 10px;
  border-right: 1px solid #2a3947;
}

.snapshot-verification-strip > div:last-child {
  border-right: 0;
}

.snapshot-verification-strip span,
.snapshot-verification-strip strong {
  display: block;
}

.snapshot-verification-strip span {
  color: #708494;
  font-size: 8px;
  text-transform: uppercase;
}

.snapshot-verification-strip strong {
  margin-top: 5px;
  overflow: hidden;
  color: #d8e4ea;
  font: 650 10px/1.35 var(--font-mono, "JetBrains Mono", Consolas, monospace);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .ttc-pv-guide,
  .ttc-pv-summary,
  .snapshot-stage-flow,
  .snapshot-verification-strip {
    grid-template-columns: 1fr;
  }

  .snapshot-verification-strip > div {
    border-right: 0;
    border-bottom: 1px solid #2a3947;
  }

  .snapshot-verification-strip > div:last-child {
    border-bottom: 0;
  }
}

.favorite-quick-select {
  min-width: 145px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.favorite-quick-select span {
  color: #75899a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.favorite-quick-select select {
  width: 110px !important;
  min-width: 96px;
  height: 30px;
  padding: 0 26px 0 9px;
  color: #dce7ed;
  background: #151f29;
  border: 1px solid #344554;
  border-radius: 4px;
  font-size: 10px;
}

.favorite-quick-select select:disabled {
  opacity: 0.48;
}

.subnetwork-toolbar {
  flex-wrap: wrap;
  row-gap: 8px;
}

.subnetwork-toolbar .diagram-drag-hint {
  display: none;
}

.subnetwork-toolbar .visible-network-count {
  margin-left: 0;
}

.legend-line.opened {
  border-top: 4px dashed #ff4f64;
  filter: drop-shadow(0 0 4px rgba(255, 79, 100, 0.78));
}

.table-tab[data-table-tab="stageprogress"] {
  color: #9cf0e4;
}

.table-tab[data-table-tab="stageprogress"].active {
  color: #061713;
}
