:root {
  color-scheme: light;
  --bg: #eef3f7;
  --rail: #ffffff;
  --pane: #ffffff;
  --pane-2: #f6f8fb;
  --card: #ffffff;
  --line: #dbe3eb;
  --line-strong: #b9c6d2;
  --ink: #17202a;
  --soft: #344054;
  --muted: #667085;
  --quiet: #98a2b3;
  --blue: #2bbfd0;
  --blue-2: #1595ad;
  --red: #d94848;
  --green: #27b887;
  --amber: #d98b19;
  --font: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }

.app-shell {
  --brief-width: clamp(360px, 34vw, 560px);
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 42px var(--brief-width) 10px minmax(0, 1fr);
  background: #eef3f7;
}

.app-shell.home-mode {
  grid-template-columns: 42px minmax(0, 1fr);
}

.app-shell.home-mode .brief-pane,
.app-shell.home-mode .workspace-resizer,
.app-shell.home-mode .visual-pane {
  display: none;
}

.workspace-resizer {
  position: relative;
  z-index: 20;
  min-width: 10px;
  cursor: col-resize;
  touch-action: none;
  background: linear-gradient(90deg, rgba(164, 180, 198, .18), rgba(255, 255, 255, .7), rgba(164, 180, 198, .18));
}

.workspace-resizer::before {
  content: "";
  position: absolute;
  inset: 0 4px;
  border-left: 1px solid rgba(126, 144, 164, .45);
}

.workspace-resizer:hover,
.workspace-resizer:focus-visible,
body.resizing-workspace .workspace-resizer {
  background: linear-gradient(90deg, rgba(49, 95, 168, .10), rgba(255, 255, 255, .9), rgba(49, 95, 168, .10));
  outline: none;
}

body.resizing-workspace {
  cursor: col-resize;
  user-select: none;
}

.icon-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 14px 0;
  border-right: 1px solid #dce4ec;
  background: #ffffff;
}

.rail-logo {
  width: 22px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #e6f7fb;
  color: #167e91;
  font-size: 8px;
  font-weight: 800;
}

.rail-item {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #7d879b;
  font-size: 14px;
}

.rail-item:hover {
  background: #141824;
  color: #c3c9d8;
}

.rail-item.active {
  background: #21366e;
  color: #a8c4ff;
}

.translate-item {
  margin-top: auto;
  font-size: 12px;
  font-weight: 900;
}

.translate-item:hover,
.translate-item.active {
  background: #21366e;
  color: #a8c4ff;
}

.home-view {
  min-width: 0;
  min-height: 0;
  grid-column: 2;
  overflow: auto;
  padding: 18px 26px 26px;
  background: var(--console-bg);
  scrollbar-color: #33363e transparent;
}

.app-shell.home-mode .home-view {
  display: block;
}

.home-title {
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.home-title h1 {
  margin: 0;
  color: #eeeeef;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 720;
}

.home-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.home-search {
  width: min(340px, 36vw);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151619;
  color: var(--muted);
}

.home-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.insight-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.insight-board.daily-ledger {
  grid-template-columns: minmax(280px, 520px);
  align-items: start;
}

#new-session-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.day-group {
  min-width: 0;
}

.day-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.day-group > header strong,
.day-group > header span,
.day-group > header small {
  display: block;
}

.day-group > header strong {
  color: #eef0f5;
  font-size: 14px;
  font-weight: 850;
}

.day-group > header span,
.day-group > header small {
  color: var(--muted);
  font-size: 11px;
}

.history-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #151619;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.history-card:hover,
.history-card.active {
  border-color: #5e70e8;
  background: #181a20;
}

.history-card:hover {
  transform: translateY(-1px);
}

.mini-chart {
  width: 100%;
  height: 142px;
  display: block;
  background: #111214;
  border-bottom: 1px solid #202228;
}

.history-body {
  padding: 10px 11px 12px;
}

.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.history-metrics span {
  padding: 4px 7px;
  border: 1px solid #2d3340;
  border-radius: 5px;
  background: #111820;
  color: #b9c8df;
  font-size: 10px;
  font-weight: 760;
}

.history-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.history-tags span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: #cfd1d7;
  font-size: 10px;
  font-weight: 750;
}

.history-tags .critical {
  border-color: rgba(216, 90, 86, .58);
  color: #ffaaa7;
}

.history-card h2 {
  margin: 0;
  color: #f0f1f3;
  font-size: 16px;
  line-height: 1.32;
  font-weight: 720;
}

.history-card time {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.history-card p {
  margin: 9px 0 0;
  color: #aeb1b8;
  font-size: 12px;
  line-height: 1.45;
}

.brief-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #101112;
}

.workspace-title {
  height: 57px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
}

.workspace-title strong {
  font-size: 16px;
  font-weight: 720;
}

.workspace-title span {
  color: var(--muted);
  font-size: 13px;
}

.station-panel {
  flex: 0 0 auto;
  display: grid;
  gap: 9px;
  margin: 0 22px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.station-tabs,
.station-equipment,
.station-signals {
  display: flex;
  gap: 6px;
  overflow: auto;
  scrollbar-width: none;
}

.station-tabs::-webkit-scrollbar,
.station-equipment::-webkit-scrollbar,
.station-signals::-webkit-scrollbar {
  display: none;
}

.station-tabs button,
.station-equipment button,
.station-signals button {
  flex: 0 0 auto;
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #15171b;
  color: #a9acb4;
  font-size: 11px;
  font-weight: 720;
}

.station-tabs button.active {
  border-color: #5870d9;
  background: #1c254b;
  color: #eef1ff;
}

.station-equipment button.active {
  border-color: #4ca3ff;
  color: #e9f3ff;
}

.station-signals button.active {
  border-color: #5870d9;
  color: #eef1ff;
}

.station-body {
  display: grid;
  gap: 9px;
}

.station-body[hidden] {
  display: none;
}

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

.station-kpis article,
.station-alert {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #141519;
}

.station-kpis article {
  padding: 9px;
}

.station-kpis span,
.station-alert span,
.station-alert small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.station-kpis strong,
.station-alert strong {
  display: block;
  margin-top: 4px;
  color: #eef0f5;
  font-size: 13px;
  line-height: 1.1;
}

.station-alert {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 10px;
  padding: 9px;
}

.station-alert strong {
  grid-column: 1;
  color: #8ee1a2;
}

.station-alert small {
  grid-column: 2;
  grid-row: 1 / span 2;
  white-space: nowrap;
}

.device-table {
  display: grid;
  gap: 7px;
}

.device-table button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #141519;
  text-align: left;
  cursor: pointer;
}

.device-table button.active {
  border-color: #5870d9;
  background: #18203a;
}

.device-table span,
.device-table strong,
.device-table small,
.device-detail span,
.device-detail strong,
.device-detail small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-table span {
  color: #dfe2ec;
  font-size: 12px;
  font-weight: 760;
}

.device-table strong {
  color: #8ee1a2;
  font-size: 11px;
}

.device-table small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
}

.device-detail {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151619;
}

.device-detail header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.device-detail header span,
.device-log-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.device-detail header strong {
  display: block;
  margin-top: 4px;
  color: #eef0f5;
  font-size: 13px;
}

.device-detail em {
  flex: 0 0 auto;
  color: #8ee1a2;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.device-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.device-metrics div {
  min-width: 0;
  padding: 8px;
  border: 1px solid #252831;
  border-radius: 6px;
  background: #111215;
}

.device-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.device-metrics strong {
  display: block;
  margin-top: 4px;
  color: #e6e8ef;
  font-size: 12px;
  white-space: nowrap;
}

.device-detail p {
  margin: 10px 0 0;
  color: #cfd1d7;
  font-size: 12px;
  line-height: 1.45;
}

.device-log-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.device-log-grid section {
  min-width: 0;
  padding: 8px;
  border: 1px solid #252831;
  border-radius: 6px;
}

.device-log-grid small {
  display: block;
  margin-top: 6px;
  color: #aeb1b8;
  font-size: 10px;
  line-height: 1.35;
}

.ai-chat-panel {
  order: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 0;
  padding: 12px 14px 12px;
  background: #101112;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.chat-head span,
.chat-head strong {
  display: block;
}

.chat-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.chat-head strong {
  margin-top: 3px;
  color: #eceef3;
  font-size: 13px;
}

.mini-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
}

.mini-close:hover {
  background: #1a1c21;
  color: var(--ink);
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #141519;
  scrollbar-color: #33363e transparent;
}

.runtime-status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.runtime-status-line[hidden] {
  display: none;
}

.runtime-status-line i {
  width: 11px;
  height: 11px;
  border: 2px solid #2b3140;
  border-top-color: #8390ff;
  border-radius: 999px;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.agentteams-task-panel {
  margin: 0 22px 12px;
  padding: 12px;
  border: 1px solid #d9dee8;
  border-radius: 6px;
  background: #f8fafc;
  color: #1d2430;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.agentteams-task-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.agentteams-task-panel header span,
.agentteams-task-grid span {
  display: block;
  color: #667085;
  font-size: 10px;
  font-weight: 760;
  text-transform: uppercase;
}

.agentteams-task-panel header strong {
  display: block;
  margin-top: 3px;
  font-size: 15px;
  color: #111827;
}

.agentteams-task-panel header small {
  color: #2563eb;
  font-size: 11px;
  white-space: nowrap;
}

.agentteams-task-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.agentteams-task-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid #e4e7ec;
  border-radius: 5px;
  background: #fff;
}

.agentteams-task-grid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #101828;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agentteams-timeline {
  max-height: 110px;
  overflow: auto;
  border-left: 2px solid #c7d7fe;
  padding-left: 9px;
}

.agentteams-timeline p {
  margin: 0 0 6px;
  color: #344054;
  font-size: 11px;
  line-height: 1.35;
}

.agentteams-timeline strong {
  color: #111827;
}

.chat-message {
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 7px;
  padding: 2px 0 2px 8px;
  border: 0;
  border-left: 2px solid #384156;
  border-radius: 0;
  background: transparent;
}

.chat-message:last-child {
  margin-bottom: 0;
}

.chat-message.user {
  border-left-color: var(--blue);
  background: transparent;
}

.chat-message.actionable {
  border-left-color: #6f7cff;
}

.chat-message.tone-leader { border-left-color: #8aa4ff; }
.chat-message.tone-perception { border-left-color: #4f73c1; }
.chat-message.tone-dispatch { border-left-color: #6ba7ff; }
.chat-message.tone-audit { border-left-color: #f2b15f; }
.chat-message.tone-execution { border-left-color: #bb8cff; }

.chat-avatar {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1px solid #313849;
  border-radius: 50%;
  background: #171d29;
  color: #dfe8ff;
  font-size: 8px;
  font-weight: 900;
  overflow: hidden;
}

.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-content {
  min-width: 0;
}

.chat-message-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin: 0 0 2px;
}

.chat-speaker {
  min-width: 0;
  color: #dce6ff;
  font-size: 11px;
  line-height: 1.1;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-role {
  color: #8793a8;
  font-size: 9px;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-message.user .chat-speaker {
  color: #e7e8ec;
}

.chat-message.tone-perception .chat-speaker { color: #a5ffe8; }
.chat-message.tone-dispatch .chat-speaker { color: #b9d5ff; }
.chat-message.tone-audit .chat-speaker { color: #ffd9a1; }
.chat-message.tone-execution .chat-speaker { color: #dec2ff; }

.chat-message-body {
  min-width: 0;
  color: #cfd1d7;
  font-size: 12px;
  line-height: 1.45;
}

.chat-message-body > *:first-child {
  margin-top: 4px;
}

.chat-message-body > *:last-child {
  margin-bottom: 0;
}

.chat-message-body h3,
.chat-message-body h4,
.chat-message-body h5,
.chat-message-body h6 {
  margin: 12px 0 6px;
  color: #f4f6ff;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 850;
}

.chat-message-body h4,
.chat-message-body h5,
.chat-message-body h6 {
  font-size: 12px;
}

.chat-message-body p {
  margin: 4px 0 0;
  color: #cfd1d7;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-message-body ul,
.chat-message-body ol {
  margin: 6px 0 0;
  padding-left: 18px;
}

.chat-message-body li {
  margin: 3px 0;
}

.chat-message-body strong {
  color: #f2f4ff;
  font-weight: 850;
}

.chat-message-body a {
  color: #95d5ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(149, 213, 255, .36);
}

.chat-message-body code {
  border: 1px solid #303847;
  border-radius: 4px;
  background: #10151f;
  color: #dce8ff;
  padding: 1px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.markdown-code-scroll,
.markdown-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.markdown-code-scroll {
  margin-top: 8px;
  border: 1px solid #283142;
  border-radius: 6px;
  background: #0d1119;
}

.markdown-code-scroll pre {
  margin: 0;
  min-width: max-content;
  padding: 10px;
}

.markdown-code-scroll code {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  color: #dbe7ff;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre;
}

.markdown-table-scroll {
  margin-top: 8px;
  border: 1px solid #283142;
  border-radius: 6px;
}

.chat-message-body table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: #0f141d;
}

.chat-message-body th,
.chat-message-body td {
  border-bottom: 1px solid #283142;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.chat-message-body th {
  color: #f2f4ff;
  background: #151b27;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.chat-message-body td {
  color: #cbd3df;
}

.chat-message-body tr:last-child td {
  border-bottom: 0;
}

.chat-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.chat-action {
  min-width: 0;
  height: 34px;
  border: 1px solid #2a2d35;
  border-radius: 5px;
  background: #15171b;
  color: #d8d9df;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-action.primary {
  border-color: #7c86ff;
  background: #252d75;
  color: #f2f3ff;
}

.chat-action:hover {
  border-color: #7c86ff;
}

.chat-action:disabled {
  cursor: default;
  opacity: .48;
}

.auto-exec-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.auto-exec-label input {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 8px;
  margin-top: 8px;
}

.chat-form input {
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  background: #17181b;
  color: #e5e6ea;
  font-size: 12px;
}

.chat-form input:focus {
  border-color: #6479ef;
}

.operator-prompt {
  order: 2;
  flex: 0 0 auto;
  margin: 13px 14px 8px 35px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #191a1d;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.015);
}

.brief-pane > .operator-prompt,
.brief-pane > .tool-chip,
.brief-pane > .diagnosis,
.brief-pane > .control-block {
  display: none;
}

.operator-prompt p {
  margin: 0;
  color: #d7d8dc;
  font-size: 16px;
  line-height: 1.35;
}

.tool-chip {
  order: 3;
  flex: 0 0 auto;
  width: fit-content;
  margin: 10px 0 10px 14px;
  padding: 3px 9px;
  border: 1px solid var(--blue);
  border-radius: 5px;
  color: #cbd3ff;
  background: rgba(73, 84, 169, .14);
  font-size: 12px;
}

.agent-directory-drawer {
  position: fixed;
  z-index: 30;
  left: 42px;
  top: 0;
  bottom: 0;
  width: 360px;
  border-right: 1px solid var(--line);
  background: rgba(16, 17, 18, .98);
  box-shadow: 18px 0 50px rgba(0,0,0,.32);
}

.drawer-head {
  height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-head span,
.drawer-head strong {
  display: block;
}

.drawer-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.drawer-head strong {
  margin-top: 3px;
  color: #eceef3;
  font-size: 15px;
}

.directory-list {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.directory-list article {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141519;
}

.directory-list article.active {
  border-color: #5870d9;
  background: #18203a;
}

.directory-list img {
  width: 34px;
  height: 34px;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  object-fit: cover;
}

.directory-list strong,
.directory-list span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-list strong {
  color: #eceef3;
  font-size: 12px;
}

.directory-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.directory-chat,
.directory-gateway {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #17181b;
  color: #cfd1d7;
  font-size: 10px;
  font-weight: 700;
}

.directory-chat:hover,
.directory-gateway:hover {
  border-color: #5870d9;
  color: #dfe3ff;
}

.ops-drawer {
  width: 430px;
}

.ops-drawer-body {
  height: calc(100vh - 57px);
  overflow: auto;
  padding: 12px;
  scrollbar-color: #33363e transparent;
}

.ops-status-strip,
.ops-memory-grid,
.ops-slo-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ops-slo-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-status-strip article,
.ops-memory-grid article,
.ops-slo-list article {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141519;
}

.ops-status-strip span,
.ops-memory-grid span,
.ops-slo-list span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.ops-status-strip strong,
.ops-memory-grid strong,
.ops-slo-list strong {
  display: block;
  min-width: 0;
  margin-top: 5px;
  color: #e9edf5;
  font-size: 13px;
  font-weight: 860;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-panel {
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111214;
}

.ops-panel header {
  margin-bottom: 10px;
}

.ops-panel header span,
.ops-panel header strong {
  display: block;
}

.ops-panel header span {
  color: #7f8cff;
  font-size: 9px;
  font-weight: 900;
}

.ops-panel header strong {
  margin-top: 3px;
  color: #eef0f5;
  font-size: 13px;
  font-weight: 820;
}

.ops-loop-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ops-loop-list li {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.ops-loop-list i {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid #3f4d72;
  border-radius: 50%;
  background: #182033;
  color: #cbd6ff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.ops-loop-list strong,
.ops-loop-list span,
.ops-agent-list strong,
.ops-agent-list span,
.ops-agent-list small {
  display: block;
  min-width: 0;
}

.ops-loop-list strong,
.ops-agent-list strong {
  color: #eceef3;
  font-size: 12px;
  font-weight: 820;
}

.ops-loop-list span,
.ops-agent-list span,
.ops-agent-list small,
.ops-rag-insight {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.ops-agent-list,
.ops-permission-list {
  display: grid;
  gap: 8px;
}

.ops-agent-list article,
.ops-permission-list article {
  min-width: 0;
  padding: 9px;
  border: 1px solid #23262c;
  border-radius: 7px;
  background: #151619;
}

.ops-agent-list small {
  margin-top: 5px;
  color: #8fa1cf;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-permission-list article {
  display: grid;
  grid-template-columns: minmax(0, 130px) minmax(0, 1fr);
  gap: 8px;
}

.ops-permission-list strong,
.ops-permission-list span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-permission-list strong {
  color: #eceef3;
  font-size: 11px;
}

.ops-permission-list span {
  margin-top: 3px;
  color: var(--quiet);
  font-size: 10px;
}

.ops-permission-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ops-permission-list li {
  padding: 3px 6px;
  border: 1px solid #2c3340;
  border-radius: 5px;
  color: #bfd0e6;
  background: #121820;
  font-size: 10px;
  font-weight: 760;
}

.ops-rag-insight {
  margin: 0 0 9px;
}

.diagnosis {
  order: 4;
  flex: 1 1 auto;
  min-height: 180px;
  overflow: auto;
  padding: 0 18px 18px 14px;
  color: #d7d8dc;
  font-size: 16px;
  line-height: 1.42;
}

.diagnosis p {
  margin: 0 0 20px;
}

.diagnosis ol {
  margin: 0;
  padding-left: 24px;
}

.diagnosis li {
  margin: 0 0 7px;
}

.diagnosis strong {
  color: #f1f1f2;
  font-weight: 760;
}

.control-block {
  order: 5;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px 18px;
}

.action,
.mini-action {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #17181b;
  color: #e2e3e7;
  font-size: 12px;
  font-weight: 700;
}

.action.primary {
  grid-column: 1 / -1;
  border-color: #677cf7;
  background: #26316a;
  color: #f2f5ff;
}

.action.subtle {
  color: var(--muted);
}

.visual-pane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #f7f9fc;
  scrollbar-color: #c5d0da transparent;
}

.visual-title {
  min-height: 70px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 0;
}

.visual-title h1 {
  margin: 0;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 620;
  letter-spacing: 0;
}

.visual-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.run-status {
  min-width: 160px;
  padding-top: 2px;
  text-align: right;
}

.run-status span,
.run-status strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plot-monitor {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: #8f96a6;
  font-size: 10px;
  font-weight: 760;
}

.plot-monitor span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.plot-monitor strong {
  color: var(--soft);
  font-size: 10px;
}

#monitor-pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #50545d;
  box-shadow: 0 0 0 4px rgba(80,84,93,.12);
}

#monitor-pulse.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(127,197,139,.13), 0 0 14px rgba(127,197,139,.5);
}

#monitor-pulse.alert {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(210,164,87,.13), 0 0 14px rgba(210,164,87,.55);
}

.monitor-gate {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.monitor-gate button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d7e0e8;
  border-radius: 5px;
  background: #ffffff;
  color: #344054;
  font-size: 10px;
  font-weight: 730;
}
.monitor-gate button:not(:disabled):first-child { border-color: #d2a457; color: #f2ca84; }
.monitor-gate button:not(:disabled):nth-child(2) { border-color: #7fc58b; color: #a7e1b0; }

.monitor-event-list { max-height: 82px; overflow: auto; padding: 8px; border-left: 2px solid #35406c; background: rgba(8,9,12,.35); }
.monitor-event-list p { margin: 0 0 5px; color: #999fac; font-size: 9px; line-height: 1.35; }
.monitor-event-list p:last-child { margin-bottom: 0; }
.monitor-event-list strong { color: var(--soft); }
.connector-copy p { color: var(--soft); font-size: 12px; line-height: 1.6; }
.connector-copy code { color: #9eb1ff; }

.connector-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.connector-choice-row button {
  flex: 1 1 180px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #343b49;
  border-radius: 7px;
  background: #151821;
  color: #edf0f7;
  font-size: 14px;
  font-weight: 780;
}

.connector-choice-row button.primary {
  border-color: #6479ef;
  background: #1b2444;
}

.connector-choice-row button.secondary {
  color: #b9beca;
  background: #13151a;
}

.connector-choice-row button:hover {
  border-color: #6f83ff;
  background: #1c243e;
}

.connector-test-actions {
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 2px;
}

.connector-test-actions .action {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
}

.speed-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--pane-2);
}

.speed-toggle span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.speed-toggle button {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--soft);
  font-size: 11px;
  font-weight: 700;
}

.speed-toggle button.active {
  border-color: var(--blue);
  background: rgba(111, 131, 255, .12);
  color: var(--blue);
}

.connector-status {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.connector-status > span {
  color: var(--muted);
  font-size: 11px;
}

.run-status span {
  color: var(--quiet);
  font-size: 11px;
}

.run-status strong {
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
}

.control-bar {
  margin: 0 22px 10px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.monitor-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: #8f96a6;
  font-size: 10px;
  font-weight: 760;
}

.monitor-info span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.monitor-info strong {
  color: var(--soft);
  font-size: 10px;
}

.energy-status {
  margin: 0 22px 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.energy-status article {
  min-height: 68px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.energy-status span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.energy-status strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.energy-status small {
  display: block;
  margin-top: 2px;
  color: var(--quiet);
  font-size: 9px;
}

.energy-main {
  margin: 0 22px 12px;
  min-height: 380px;
}

.energy-bottom {
  margin: 0 22px 12px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
  min-height: 200px;
}

.energy-today {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  min-height: 0;
  overflow: auto;
}

.energy-today h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--soft);
}

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

.today-grid article {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--pane-2);
}

.today-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.today-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 860;
}

.energy-balance {
  margin: 0 22px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.energy-balance h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--soft);
}

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

.balance-in, .balance-out {
  padding: 12px;
  border-radius: 6px;
  background: var(--pane-2);
}

.balance-in h4, .balance-out h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 780;
  color: var(--soft);
}

.balance-amount {
  margin-bottom: 8px;
}

.balance-amount strong {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
}

.balance-amount span {
  font-size: 14px;
  color: var(--muted);
  margin-left: 4px;
}

.balance-in > p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
}

.balance-in ul, .balance-out ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.balance-in li, .balance-out li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.balance-in li:last-child, .balance-out li:last-child {
  border-bottom: 0;
}

.balance-in li span, .balance-out li span {
  color: var(--muted);
}

.balance-in li strong, .balance-out li strong {
  color: var(--soft);
  font-weight: 760;
}

.cost-compare {
  margin: 0 22px 16px;
  padding: 16px;
  border: 1px solid rgba(116, 137, 160, .18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(240, 246, 252, .88));
  box-shadow: 0 18px 48px rgba(58, 82, 110, .08);
}

.cost-compare header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cost-compare header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #111827;
}

.cost-compare header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.cost-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 192px;
  gap: 16px;
}

.cost-chart-wrap {
  min-height: 0;
}

#cost-chart {
  width: 100%;
  height: 224px;
  display: block;
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
  border-radius: 6px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.chart-legend span {
  font-size: 10px;
  color: var(--muted);
}

.legend-baseline { color: #dd5965 !important; }
.legend-optimized { color: #289b7f !important; }
.legend-savings { color: rgba(69, 197, 162, .58) !important; }
.legend-reopt { color: #d2a457 !important; }

.cost-metrics {
  display: grid;
  gap: 8px;
}

.cost-metrics article {
  padding: 10px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(116, 137, 160, .14);
}

.cost-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.cost-metrics strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
  font-weight: 900;
}

.compare-a strong { color: #dd5965; }
.compare-b strong { color: #289b7f; }
.compare-save strong { color: var(--green); }

.cost-metrics small {
  display: block;
  margin-top: 1px;
  color: var(--quiet);
  font-size: 9px;
}

.deviation-metrics, .reopt-metrics {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--pane-2);
}

.deviation-metrics > span, .reopt-metrics > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
  margin-bottom: 4px;
}

.deviation-metrics div, .reopt-metrics strong {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

.deviation-metrics label {
  color: var(--muted);
}

.deviation-metrics strong {
  color: var(--amber);
  font-weight: 800;
}

.reopt-metrics strong {
  color: #d2a457;
  font-weight: 900;
  font-size: 14px;
  margin-top: 2px;
}

.reopt-metrics small {
  display: block;
  color: var(--quiet);
  font-size: 9px;
  margin-top: 2px;
}

.dispatch-evidence-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.dispatch-evidence-strip article {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(84, 104, 134, .18);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(246, 249, 252, .94), rgba(234, 241, 248, .82));
}

.dispatch-evidence-strip span,
.dispatch-evidence-strip small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-evidence-strip strong {
  display: block;
  overflow: hidden;
  margin: 4px 0 2px;
  color: #10141c;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 5px;
  background: rgba(111, 131, 255, .06);
  border-left: 2px solid var(--blue);
}

.compare-note p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.campus {
  position: relative;
  min-height: 380px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #dce4ec;
  border-radius: 8px;
}

#campus-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#campus-3d:active { cursor: grabbing; }
#campus-3d[data-editing="true"] { cursor: default; }
#campus-3d[data-editing="true"]:active { cursor: move; }

.campus-hud {
  position: absolute;
  z-index: 8;
  top: 10px;
  left: 12px;
  right: 84px;
  width: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  pointer-events: none;
}

.campus-hud time {
  width: auto;
  max-width: none;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(142, 174, 196, .38);
  border-radius: 999px;
  background: rgba(30, 35, 45, .78);
  color: #f2f7ff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(44, 71, 91, .1);
  backdrop-filter: blur(12px);
}

.campus-balance {
  flex: 0 0 150px;
}

.campus-power-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  flex: 1 1 230px;
}

.campus-hud article {
  flex: 1 1 120px;
  min-width: 0;
  min-height: 42px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(30, 35, 45, .76);
  box-shadow: 0 8px 18px rgba(20, 31, 42, .18);
  backdrop-filter: blur(12px);
}

.campus-hud span,
.campus-hud strong,
.campus-hud small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campus-hud span {
  color: #88e9c5;
  font-size: 9px;
  font-weight: 820;
}

.campus-hud strong {
  margin-top: 2px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 860;
}

.campus-hud small {
  margin-top: 1px;
  color: #c7d1dc;
  font-size: 9px;
  font-weight: 680;
}

.campus-balance strong {
  color: #6ff0aa;
  font-size: 15px;
  letter-spacing: 0;
}

.campus-storage {
  border-color: rgba(111, 240, 170, .45);
}

.campus-tools {
  position: absolute;
  z-index: 18;
  top: 106px;
  right: 16px;
  display: grid;
  gap: 7px;
  width: 116px;
  max-width: 116px;
  pointer-events: auto;
}

.campus-tools button {
  min-height: 32px;
  border: 1px solid #c7d5df;
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  color: #344054;
  font-size: 10px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(20, 31, 42, .08);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.campus-tools button:hover {
  border-color: var(--blue);
  color: #08798a;
}

.campus-tools button[aria-pressed="true"] {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 10px 22px rgba(29, 78, 216, .24);
}

.campus-hint {
  position: absolute;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: none;
  padding: 7px 14px;
  border: 0;
  border-top: 1px solid #dce4ec;
  border-radius: 0;
  background: rgba(255,255,255,.86);
  color: #667085;
  font-size: 11px;
  font-weight: 720;
  backdrop-filter: blur(10px);
}

.camera-button {
  width: 30px;
  height: 30px;
  padding: 0;
}

.asset {
  position: absolute;
  z-index: 5;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: clamp(108px, 12vw, 148px);
  padding: 5px 7px;
  border-left: 2px solid #70b9eb;
  border-radius: 4px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 24px rgba(23, 47, 70, .1);
  color: #263848;
  pointer-events: none;
  transform: translate(-50%, 4px);
  backdrop-filter: blur(10px);
  transition: opacity .16s ease, transform .16s ease;
}

.asset[data-hidden="true"] {
  opacity: 0;
  transform: translate(-50%, 4px) scale(.96);
}

.asset[data-selected="true"] {
  border-left-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .18), 0 10px 24px rgba(23, 47, 70, .16);
}
.asset span,
.asset em,
.asset strong,
.asset small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.asset span { color: #60788e; font-size: 10px; font-weight: 760; }
.asset em { margin-top: 2px; color: #17202a; font-size: 11px; font-style: normal; font-weight: 850; }
.asset strong { margin-top: 3px; font-size: 14px; }
.asset small { margin-top: 3px; color: #697b8c; font-size: 10px; }
.asset.metric-card { min-width: 108px; }
.asset.metric-card small + small {
  padding-top: 3px;
  border-top: 1px dashed rgba(80, 100, 120, .22);
}
.asset.warning { border-left-color: #bd8132; }
.asset.critical { border-left-color: #c95850; }

#scenario-chart {
  width: 100%;
  height: 210px;
  display: block;
  background: #ffffff;
}

.related {
  margin: 0 22px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.related header,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.related h2,
.section-heading h2 {
  margin: 0;
  color: #e3e4e8;
  font-size: 15px;
  font-weight: 680;
}

.related header span {
  color: var(--muted);
  font-size: 12px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.insight {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151619;
}

.insight span,
.insight strong,
.insight p {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight span {
  color: var(--muted);
  font-size: 11px;
}

.insight strong {
  margin-top: 6px;
  color: #f0f1f3;
  font-size: 14px;
  white-space: nowrap;
}

.insight p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 22px 22px;
}

.detail-columns > div {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mini-action {
  height: 28px;
  padding: 0 9px;
  color: var(--soft);
}

.candidate-list,
.trace-list {
  margin-top: 10px;
  max-height: 310px;
  overflow: auto;
  scrollbar-color: #33363e transparent;
}

.strategy-code,
.audit-report {
  min-width: 0;
  margin-bottom: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #151619;
}

.strategy-code span,
.audit-report span {
  display: block;
  color: #aeb8ff;
  font-size: 10px;
  font-weight: 800;
}

.strategy-code pre {
  max-height: 190px;
  margin: 9px 0 0;
  overflow: auto;
  color: #dce0ec;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
}

.audit-report p {
  margin: 8px 0 0;
  color: #d2d4dc;
  font-size: 12px;
  line-height: 1.45;
}

.agent-artifacts {
  display: grid;
  gap: 8px;
}

.candidate,
.trace-item {
  width: 100%;
  display: block;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--soft);
  text-align: left;
}

.structured-artifact pre {
  max-height: 170px;
  margin: 8px 0 0;
  overflow: auto;
  color: #cfd6e8;
  font: 10.5px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
}

.candidate:hover,
.trace-item:hover {
  background: rgba(255,255,255,.025);
}

.candidate > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.candidate span {
  color: #dfe3ff;
  font-size: 12px;
  font-weight: 700;
}

.candidate strong {
  color: var(--muted);
  font-size: 11px;
}

.candidate dl {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 9px 0 0;
}

.candidate dt {
  color: var(--quiet);
  font-size: 9px;
}

.candidate dd {
  margin: 3px 0 0;
  color: #cfd1d7;
  font-size: 10px;
}

.candidate p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.candidate.rejected p { color: #e07c78; }
.candidate.approved p { color: #91ca9b; }

.trace-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
}

.trace-item i {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--blue);
}

.trace-item i.ok { background: var(--green); }
.trace-item i.warn { background: var(--amber); }
.trace-item i.danger { background: var(--red); }

.trace-item span,
.trace-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-item span {
  font-size: 12px;
}

.trace-item small {
  grid-column: 2;
  color: var(--muted);
  font-size: 10px;
}

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

dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(18,19,21,.96);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(0,0,0,.58);
}

dialog::backdrop { background: rgba(0,0,0,.66); }
dialog form {
  max-height: min(760px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: 56px minmax(0, 1fr);
}

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

.dialog-heading span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.dialog-heading h2 {
  margin: 3px 0 0;
  font-size: 16px;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

.icon-button:hover {
  background: rgba(255,255,255,.06);
  color: var(--ink);
}

.gateway-body {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.gateway-body label {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.gateway-body input {
  width: 100%;
  height: 36px;
  margin-top: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  background: #17181b;
  color: #e5e6ea;
}

.gateway-body input:focus {
  border-color: #6479ef;
}

.gateway-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

#gateway-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
}

pre {
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 14px;
  color: #d7dae1;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

#toast {
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(22,23,26,.96);
  color: var(--soft);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: .18s ease;
}

#toast.visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1120px) {
  body { overflow: auto; }
  .app-shell { min-width: 1120px; }
}

/* ===== dialog layout overrides ===== */
#connect-energy-source.full-width {
  width: 100%; min-height: 48px; margin-top: 6px;
  padding: 0 16px; border: 1px solid #343b49; border-radius: 7px;
  background: #151821; color: #b9beca; font-size: 14px; font-weight: 780;
}
#connect-energy-source.full-width:hover { border-color: #6479ef; background: #1b2444; color: #edf0f7; }

.upload-section {
  margin-top: 10px; padding: 10px 12px;
  border: 1px dashed var(--line); border-radius: 7px;
  background: rgba(19, 21, 26, .5);
}
#upload-energy-data {
  width: 100%; min-height: 40px; padding: 0 16px;
  border: 1px solid #343b49; border-radius: 6px;
  background: #151821; color: #b9beca; font-size: 13px; font-weight: 700;
}
#upload-energy-data:hover { border-color: #6f83ff; background: #1c243e; color: #edf0f7; }

.data-actions { margin-top: 10px; }

.replay-control {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.replay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.replay-head span {
  color: #8b94a4;
  font-size: 12px;
  font-weight: 760;
}

.replay-head strong {
  min-width: 0;
  color: #edf0f7;
  font-size: 12px;
  font-weight: 820;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.replay-row span {
  color: #8b94a4;
  font-size: 12px;
  font-weight: 760;
}

#replay-slider,
#replay-speed-slider {
  width: 100%;
  accent-color: #4f7cff;
}

.replay-scale {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
  color: #8b94a4;
  font-size: 11px;
  font-weight: 720;
}

/* ===== power chart section ===== */
.demo-director {
  margin: 0 22px 16px;
  padding: 14px 16px;
  border: 1px solid #b8d7ce;
  border-radius: 8px;
  background: #f7fcfa;
}

.demo-director header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.demo-director header span {
  display: block;
  color: #138064;
  font-size: 10px;
  font-weight: 900;
}

.demo-director h2 {
  margin: 3px 0 0;
  color: #17352f;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 900;
}

.demo-director header strong {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 5px;
  background: #e4f6ef;
  color: #13745c;
  font-size: 11px;
  font-weight: 900;
}

.demo-director p {
  margin: 0 0 12px;
  color: #475467;
  font-size: 12px;
  line-height: 1.5;
}

.demo-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.demo-flow-grid article {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #d2e6df;
  border-radius: 6px;
  background: #ffffff;
}

.demo-flow-grid span,
.demo-flow-grid small {
  display: block;
  color: #667085;
  font-size: 10px;
  font-weight: 760;
}

.demo-flow-grid strong {
  display: block;
  margin: 3px 0 2px;
  color: #17202a;
  font-size: 15px;
  font-weight: 950;
}

.demo-flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.demo-flow-actions button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #169b7c;
  border-radius: 6px;
  background: #169b7c;
  color: #ffffff;
  font-size: 12px;
  font-weight: 850;
}

.demo-flow-actions button.secondary {
  border-color: #c9d8d3;
  background: #ffffff;
  color: #22554a;
}

.power-chart-section { margin: 0 22px 12px; }
.power-chart-section header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.power-chart-section header h2 { font-size: 14px; font-weight: 780; color: var(--heading); }
.power-chart-wrap {
  position: relative; height: 160px;
  background: #0f1114; border: 1px solid #1e2025; border-radius: 8px; overflow: hidden;
}
.power-chart-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.power-chart-legend {
  display: flex; gap: 18px; padding: 8px 0; font-size: 12px; font-weight: 600; color: #9aa0a8;
}
.legend-load { color: #ff6b6b; }
.legend-pv { color: #ffd93d; }
.legend-grid { color: #ff9f43; }

/* ===== white isometric energy sandbox refresh ===== */
body,
.app-shell,
.home-view,
.brief-pane,
.ai-chat-panel,
.visual-pane {
  background: #f6f8fb;
  color: var(--ink);
}

.app-shell {
  box-shadow: inset 0 0 0 1px #e3e8ef;
}

.icon-rail,
.workspace-title,
.chat-messages,
.station-kpis article,
.station-alert,
.device-table button,
.device-detail,
.device-metrics div,
.device-log-grid section,
.history-card,
.insight,
.strategy-code,
.audit-report,
dialog,
.gateway-body input,
#connect-energy-source.full-width,
#upload-energy-data,
.connector-choice-row button,
.connector-choice-row button.secondary,
.upload-section,
.power-chart-wrap {
  background: #ffffff;
  color: var(--ink);
  border-color: #dbe3eb;
}

.rail-item:hover,
.rail-item.active,
.translate-item:hover,
.translate-item.active {
  background: #e9f7fb;
  color: #177f91;
}

.home-title h1,
.day-group > header strong,
.history-card h2,
.workspace-title strong,
.chat-head strong,
.station-kpis strong,
.station-alert strong,
.device-table span,
.device-detail header strong,
.chat-speaker,
.chat-message.user .chat-speaker,
.chat-message-body h3,
.chat-message-body h4,
.chat-message-body h5,
.chat-message-body h6,
.chat-message-body strong,
.related h2,
.section-heading h2,
.insight strong,
.strategy-code pre,
.audit-report p,
.candidate span,
.candidate dd,
pre,
.gateway-body input {
  color: var(--ink);
}

.history-card:hover,
.history-card.active,
.device-table button.active,
.station-tabs button.active,
.connector-choice-row button.primary,
#connect-energy-source.full-width:hover,
#upload-energy-data:hover {
  border-color: #8fd9df;
  background: #f2fbfc;
  color: #0f6674;
}

.history-metrics span,
.history-tags span,
.station-tabs button,
.station-equipment button,
.station-signals button,
.speed-toggle button,
.cost-metrics article,
.deviation-metrics,
.reopt-metrics,
.today-grid article,
.balance-in,
.balance-out {
  background: #f6f8fb;
  border-color: #dbe3eb;
  color: var(--soft);
}

.chat-message-body,
.chat-message-body p,
.chat-role,
.device-detail p,
.device-log-grid small,
.history-card p,
.structured-artifact pre,
.candidate p,
.monitor-event-list p,
.power-chart-legend {
  color: #667085;
}

.chat-avatar {
  background: #f3f7fa;
  border-color: #cdd8e4;
  color: #177f91;
}

.chat-message,
.chat-message.user,
.chat-message.tone-leader,
.chat-message.tone-perception,
.chat-message.tone-dispatch,
.chat-message.tone-audit,
.chat-message.tone-execution {
  border-left-color: #2bbfd0;
}

.action,
.action.primary {
  border-color: #cbd7e4;
  background: #ffffff;
  color: #1f2937;
}

.action.primary,
.chat-action.primary,
.flow-preview-card button {
  border-color: #2bbfd0;
  background: #2bbfd0;
  color: #ffffff;
}

.monitor-gate button:not(:disabled):first-child,
.monitor-gate button:not(:disabled):nth-child(2) {
  border-color: #2bbfd0;
  color: #177f91;
}

.monitor-event-list,
.compare-note {
  background: #f6f8fb;
  border-color: #2bbfd0;
}

#cost-chart,
#power-chart,
.mini-chart {
  background: #ffffff;
}

.flow-preview-card {
  position: absolute;
  z-index: 24;
  left: 14px;
  bottom: 44px;
  width: min(390px, calc(100% - 28px));
  padding: 14px;
  border: 1px solid rgba(164, 181, 199, .48);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(240,247,253,.88));
  box-shadow: 0 22px 52px rgba(54, 76, 105, .16);
  backdrop-filter: blur(16px);
}

.flow-preview-card.attention {
  animation: approvalPulse 1.1s ease;
}

.flow-preview-card[hidden] {
  display: none;
}

.flow-preview-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.flow-preview-card header span {
  color: #667085;
  font-size: 10px;
  font-weight: 850;
}

.flow-plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.flow-preview-card p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.flow-preview-card button.secondary {
  border-color: #d5dee8;
  background: #ffffff;
  color: #475467;
}

.plan-ledger-section {
  margin: 0 22px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.plan-ledger-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.plan-ledger-section h2 {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
  font-weight: 850;
}

.plan-ledger-section header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
}

.plan-ledger-list {
  display: grid;
  gap: 8px;
}

.plan-ledger-item {
  padding: 10px 11px;
  border: 1px solid #dbe3eb;
  border-radius: 7px;
  background: #f8fafc;
}

.plan-ledger-item header {
  margin: 0;
}

.plan-ledger-item header span,
.plan-ledger-item time,
.plan-ledger-item dt {
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.plan-ledger-item header strong {
  display: block;
  margin-top: 3px;
  color: #17202a;
  font-size: 13px;
}

.plan-ledger-item.adopted header span { color: #138064; }
.plan-ledger-item.rejected header span { color: #b42318; }

.plan-ledger-item p {
  margin: 8px 0 0;
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}

.plan-ledger-item dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.plan-ledger-item dl div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #e1e8ef;
  border-radius: 6px;
  background: #ffffff;
}

.plan-ledger-item dd {
  margin: 3px 0 0;
  color: #137d8d;
  font-size: 12px;
  font-weight: 850;
}

.asset {
  padding: 5px 7px;
  border-left-width: 2px;
  box-shadow: 0 8px 18px rgba(23, 47, 70, .1);
}

.asset[data-placement="below"] {
  transform: translate(-50%, 4px);
}

.asset[data-hidden="true"][data-placement="below"] {
  transform: translate(-50%, 4px) scale(.96);
}

.asset span { font-size: 9px; }
.asset em { font-size: 10px; }
.asset strong { font-size: 12px; }
.asset small { font-size: 9px; }

.agent-directory-drawer,
.ops-drawer {
  background: rgba(255, 255, 255, .98);
  box-shadow: 18px 0 50px rgba(31, 41, 55, .16);
}

.drawer-head strong,
.directory-list strong,
.ops-status-strip strong,
.ops-memory-grid strong,
.ops-slo-list strong,
.ops-panel header strong,
.ops-agent-list strong,
.ops-permission-list strong {
  color: #17202a;
}

.directory-list article,
.directory-list article.active,
.ops-status-strip article,
.ops-memory-grid article,
.ops-slo-list article,
.ops-panel,
.ops-agent-list article,
.ops-permission-list article,
.chat-form,
.chat-form input {
  background: #ffffff;
  border-color: #dbe3eb;
  color: #17202a;
}

.chat-action {
  background: #ffffff;
  border-color: #cbd7e4;
  color: #475467;
}

.chat-action:hover {
  background: #f2fbfc;
  border-color: #8fd9df;
  color: #0f6674;
}

.chat-action.primary {
  background: #2bbfd0;
  border-color: #2bbfd0;
  color: #ffffff;
}

.mini-action,
.candidate,
.trace-item {
  background: #ffffff;
  border-color: #dbe3eb;
  color: #17202a;
}

.mini-action:hover,
.candidate:hover,
.trace-item:hover {
  background: #f2fbfc;
  color: #0f6674;
}

.candidate strong,
.trace-item span,
.trace-item small {
  color: #475467;
}

.chat-message-body table,
.chat-message-body th,
.markdown-code-scroll,
.markdown-table-scroll,
.chat-message-body code {
  background: #ffffff;
  border-color: #dbe3eb;
  color: #17202a;
}

.chat-message-body td,
.markdown-code-scroll code {
  color: #344054;
}

.directory-chat,
.directory-gateway {
  background: #ffffff;
  color: #475467;
  border-color: #cbd7e4;
}

.directory-chat:hover,
.directory-gateway:hover {
  background: #f2fbfc;
  border-color: #8fd9df;
  color: #0f6674;
}

.ops-permission-list li {
  background: #f6f8fb;
  border-color: #dbe3eb;
  color: #475467;
}

#toast {
  background: rgba(255,255,255,.97);
  color: #17202a;
  box-shadow: 0 16px 40px rgba(31, 41, 55, .18);
}

.flow-preview-card header strong {
  color: #17202a;
  font-size: 14px;
  font-weight: 920;
}

.approval-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.approval-summary div {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(178, 190, 204, .54);
  border-radius: 6px;
  background: rgba(255, 255, 255, .72);
}

.approval-summary .approval-wide {
  grid-column: 1 / -1;
}

.approval-summary span {
  display: block;
  color: #667085;
  font-size: 9px;
  font-weight: 820;
}

.approval-summary strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: #10141c;
  font-size: 15px;
  font-weight: 930;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.approval-summary div:nth-child(3) strong,
.approval-summary div:nth-child(4) strong,
.approval-summary div:nth-child(6) strong {
  color: #188c74;
}

.approval-constraints {
  margin-top: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(42, 176, 136, .18);
  border-radius: 6px;
  background: rgba(232, 248, 242, .72);
  color: #16815f;
  font-size: 11px;
  font-weight: 820;
}

.flow-preview-card button {
  width: 100%;
  height: 34px;
  margin-top: 10px;
  border: 1px solid #2bbfd0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
}

@keyframes approvalPulse {
  0% { box-shadow: 0 0 0 rgba(43, 191, 208, 0), 0 22px 52px rgba(54, 76, 105, .16); }
  35% { box-shadow: 0 0 0 4px rgba(43, 191, 208, .16), 0 22px 52px rgba(54, 76, 105, .18); }
  100% { box-shadow: 0 0 0 rgba(43, 191, 208, 0), 0 22px 52px rgba(54, 76, 105, .16); }
}

.campus-day-hud {
  position: absolute;
  z-index: 9;
  top: 14px;
  left: 14px;
  right: 146px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  pointer-events: none;
}

.day-clock,
.day-problems article {
  min-height: 58px;
  border: 1px solid rgba(203, 215, 228, .92);
  border-radius: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 12px 30px rgba(31, 41, 55, .1);
  backdrop-filter: blur(12px);
}

.day-clock {
  flex: 0 0 178px;
  padding: 9px 12px;
}

.day-clock span,
.day-clock small,
.day-problems span {
  display: block;
  color: #667085;
  font-size: 10px;
  font-weight: 800;
}

.day-clock strong {
  display: block;
  margin-top: 4px;
  color: #17202a;
  font-size: 17px;
  font-weight: 900;
}

.day-clock small {
  margin-top: 2px;
  color: #2bbfd0;
}

.day-problems {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 10px;
}

.day-problems article {
  padding: 9px 12px;
}

.day-problems strong {
  display: block;
  margin-top: 5px;
  color: #d94848;
  font-size: 19px;
  font-weight: 950;
}

@media (max-width: 1120px) {
  .campus-day-hud {
    right: 14px;
  }
}

/* ===== final white sandbox surface ===== */
:root {
  --bg: #f3f6f9;
  --pane: #ffffff;
  --pane-2: #f8fafc;
  --card: #ffffff;
  --line: #d9e2ea;
  --line-strong: #b9c8d6;
  --ink: #151c24;
  --soft: #344054;
  --muted: #667085;
  --quiet: #98a2b3;
  --blue: #315fa8;
  --blue-2: #0f91a3;
  --green: #24b88a;
  --amber: #c9872d;
  --red: #d94848;
}

body,
.app-shell,
.home-view,
.brief-pane,
.ai-chat-panel,
.visual-pane {
  background: var(--bg);
  color: var(--ink);
}

.app-shell {
  grid-template-columns: 42px minmax(320px, 380px) minmax(640px, 1fr);
}

.icon-rail {
  border-right-color: #dce5ed;
  background: #ffffff;
}

.rail-item {
  color: #667085;
}

.rail-item:hover,
.rail-item.active,
.translate-item:hover,
.translate-item.active {
  background: #e8f8fb;
  color: #0f8090;
}

.brief-pane {
  border-right-color: #d9e2ea;
}

.workspace-title,
.chat-head,
.control-bar,
.energy-status article,
.energy-today,
.energy-balance,
.cost-compare,
.plan-ledger-section,
.power-chart-section,
.related,
.detail-columns > div,
.agent-directory-drawer,
.ops-drawer,
dialog {
  background: #ffffff;
  border-color: #d9e2ea;
  color: var(--ink);
}

.workspace-title {
  height: 56px;
  border-bottom: 1px solid #d9e2ea;
}

.workspace-title strong,
.visual-title h1 {
  color: #111827;
  font-weight: 780;
}

.ai-chat-panel {
  padding: 12px;
}

.chat-head {
  margin-bottom: 10px;
  padding: 10px 11px;
  border: 1px solid #d9e2ea;
  border-radius: 8px;
}

.chat-head span,
.chat-role,
.chat-message-body,
.chat-message-body p,
.history-card p,
.candidate p,
.trace-item small,
.compare-note p {
  color: #667085;
}

.chat-head strong,
.chat-speaker,
.chat-message.user .chat-speaker,
.chat-message-body strong,
.chat-message-body h3,
.chat-message-body h4,
.chat-message-body h5,
.chat-message-body h6 {
  color: #17202a;
}

.chat-messages {
  padding: 10px;
  border: 1px solid #d9e2ea;
  border-radius: 8px;
  background: #ffffff;
}

.chat-message {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 11px;
  padding: 0;
  border-left: 0;
}

.chat-content {
  padding: 8px 10px;
  border: 1px solid #e0e7ef;
  border-radius: 8px;
  background: #f8fafc;
}

.chat-message.user .chat-content {
  background: #effbfd;
  border-color: #beeaf0;
}

.chat-message.actionable .chat-content {
  border-color: #8fd9df;
  background: #f2fbfc;
}

.chat-avatar {
  width: 22px;
  height: 22px;
  background: #ffffff;
  border-color: #cbd7e4;
  color: #0f8090;
}

.chat-form {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.chat-form input {
  height: 38px;
  border: 1px solid #cbd7e4;
  border-radius: 8px;
  background: #ffffff;
  color: #17202a;
}

.chat-form input:focus {
  border-color: #315fa8;
  box-shadow: 0 0 0 3px rgba(39, 191, 208, .14);
}

.action,
.chat-action,
.monitor-gate button,
.campus-tools button,
.mini-action,
.directory-chat,
.directory-gateway {
  border-radius: 7px;
  background: #ffffff;
  color: #344054;
  border-color: #cbd7e4;
}

.action:hover,
.chat-action:hover,
.monitor-gate button:not(:disabled):hover,
.campus-tools button:hover,
.mini-action:hover,
.directory-chat:hover,
.directory-gateway:hover {
  border-color: #8fd9df;
  background: #f2fbfc;
  color: #0f6674;
}

.action.primary,
.chat-action.primary,
.flow-preview-card button,
.monitor-gate button:not(:disabled):first-child {
  background: #315fa8;
  border-color: #315fa8;
  color: #ffffff;
}

.visual-pane {
  background:
    linear-gradient(90deg, rgba(217,226,234,.62) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(217,226,234,.45) 1px, transparent 1px) 0 0 / 48px 48px,
    #f6f8fb;
}

.visual-title {
  min-height: 62px;
  padding: 18px 22px 0;
}

.control-bar {
  min-height: 44px;
  height: auto;
  border-radius: 8px;
}

.energy-status {
  gap: 8px;
}

.energy-status article {
  min-height: 64px;
  border-radius: 8px;
}

.energy-status strong {
  font-size: 17px;
}

.campus {
  min-height: 510px;
  border-color: #d9e2ea;
  border-radius: 8px;
  background: #fbfcfd;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

#campus-3d {
  background: #fbfcfd;
}

.campus-hint {
  color: #667085;
  background: rgba(255,255,255,.9);
}

.day-clock,
.day-problems article,
.flow-preview-card,
.asset {
  border-color: #d9e2ea;
  background: rgba(255,255,255,.94);
  box-shadow: 0 14px 34px rgba(31, 41, 55, .1);
}

.day-problems strong {
  color: #d94848;
}

.flow-preview-card {
  left: 14px;
  bottom: 42px;
  border-color: #8fd9df;
}

/* Mobile station view: match the attached energy-app reference for recording. */
.visual-pane {
  background:
    linear-gradient(180deg, #d7ebff 0%, #eef3fa 38%, #f4f5fa 100%);
  color: #141821;
}

.visual-title {
  min-height: 92px;
  padding: 28px 32px 8px;
  border-bottom: 0;
  background: transparent;
}

.visual-title h1 {
  position: relative;
  margin-top: 44px;
  color: #222733;
  font-size: 0;
  font-weight: 500;
}

.visual-title h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: -54px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255,255,255,.25), rgba(0,0,0,.08)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Crect width='80' height='80' fill='%23b8bec7'/%3E%3Cpath d='M6 54h68v16H6z' fill='%233a3f48'/%3E%3Cpath d='M12 22h42l16 17H12z' fill='%23262b32'/%3E%3Cpath d='M18 44h28v20H18z' fill='%23585f69'/%3E%3Cpath d='M51 44h18v20H51z' fill='%23f2d68b' opacity='.8'/%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: 0 8px 20px rgba(38, 53, 76, .18);
}

.visual-title h1::after {
  content: none;
  display: none;
}

.run-status {
  align-self: flex-end;
  margin-bottom: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.run-status span {
  color: #5f6470;
  font-size: 0;
  font-weight: 500;
}

.run-status span::before {
  content: none;
  display: none;
}

.run-status span::after {
  content: " 〉";
  color: #9aa0aa;
  font-size: 28px;
  font-weight: 300;
}

.run-status strong {
  display: none;
}

.control-bar,
.agentteams-task-panel {
  margin-inline: 32px;
  border-color: rgba(255,255,255,.72);
  border-radius: 24px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 16px 42px rgba(70, 82, 100, .09);
}

.energy-status {
  margin: 28px 62px -8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 84px;
  position: relative;
  z-index: 4;
}

.energy-status .status-balance {
  display: none;
}

.energy-status article {
  min-height: 88px;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 1px solid rgba(145, 154, 168, .72);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.energy-status span {
  margin-top: 6px;
  color: #8c929c;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.1;
}

.energy-status strong {
  margin-top: 0;
  color: #080b11;
  font-family: Inter, "PingFang SC", "SF Pro Display", sans-serif;
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 10px 24px rgba(20, 27, 39, .08);
}

.energy-status small {
  margin-top: 6px;
  color: #8f95a0;
  font-size: 15px;
  font-weight: 520;
  line-height: 1.25;
}

.energy-status .status-storage strong,
.asset.critical strong {
  color: #315fa8;
}

.energy-main {
  margin: 0 32px 18px;
}

.campus {
  min-height: 580px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#campus-3d {
  inset: 28px 0 0;
  background: transparent;
}

.campus::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 44px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(141, 151, 164, .12), transparent 72%);
  pointer-events: none;
}

.campus-day-hud {
  left: auto;
  right: 18px;
  top: 18px;
  max-width: 270px;
}

.campus-day-hud .day-clock,
.campus-day-hud .day-problems article,
.campus-hud article,
.campus-hud time,
.flow-preview-card {
  border-color: rgba(255,255,255,.76);
  background: rgba(255,255,255,.72);
  box-shadow: 0 18px 34px rgba(62, 75, 94, .11);
}

.day-clock span,
.day-problems span { color: #8f95a0; }
.day-clock strong,
.day-problems strong {
  color: #10141c;
  font-family: Inter, "PingFang SC", sans-serif;
  letter-spacing: 0;
}
.day-clock small { color: #315fa8; }
.day-problems strong { color: #10141c; }

.campus-tools {
  top: 106px;
  right: 16px;
  opacity: .98;
  transition: opacity .15s ease;
}
.campus:hover .campus-tools { opacity: .98; }
.campus-tools button {
  border-color: rgba(178, 187, 199, .62);
  border-radius: 10px;
  background: rgba(255,255,255,.9);
  color: #5f6470;
  box-shadow: 0 12px 24px rgba(70, 82, 100, .1);
}
.campus-tools button:hover {
  border-color: #8ca8d8;
  color: #315fa8;
  background: #fff;
}

.campus-hint {
  left: 0;
  right: 0;
  bottom: 6px;
  width: auto;
  padding: 18px 28px;
  border: 0;
  border-radius: 28px;
  background: rgba(255,255,255,.88);
  color: #111722;
  font-size: 22px;
  font-weight: 520;
  box-shadow: 0 18px 42px rgba(70, 82, 100, .1);
}

.campus-hint::after {
  content: "〉";
  float: right;
  color: #a7abb3;
  font-size: 30px;
  line-height: .7;
}

.asset {
  width: clamp(150px, 16vw, 212px);
  padding: 0 0 0 16px;
  border: 0;
  border-left: 1px solid rgba(145, 154, 168, .74);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #111722;
  backdrop-filter: none;
}
.asset span {
  color: #8f95a0;
  font-size: 18px;
  font-weight: 500;
}
.asset em {
  display: none;
}
.asset strong {
  margin-top: 0;
  color: #080b11;
  font-family: Inter, "PingFang SC", "SF Pro Display", sans-serif;
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  text-shadow: 0 10px 22px rgba(20, 27, 39, .08);
}
.asset small {
  margin-top: 6px;
  color: #8f95a0;
  font-size: 14px;
  font-weight: 500;
}
.asset.warning,
.asset.critical {
  border-left-color: rgba(145, 154, 168, .74);
}
.asset[data-selected="true"] {
  box-shadow: none;
}

.asset[data-anchor="factory"],
.asset[data-anchor="charge"] {
  display: none;
}

.asset[data-anchor="grid"],
.asset[data-anchor="solar"],
.asset[data-anchor="storage"],
.asset[data-anchor="load"] {
  width: 190px;
  transform: translate(0, 0);
}

.asset[data-anchor="grid"] {
  left: 18%;
  top: 38%;
}

.asset[data-anchor="solar"] {
  left: 22%;
  top: 55%;
}

.asset[data-anchor="storage"] {
  left: 41%;
  top: 70%;
}

.asset[data-anchor="load"] {
  left: 64%;
  top: 73%;
}

.energy-bottom {
  margin: 0 32px 18px;
  grid-template-columns: minmax(320px, .44fr) minmax(0, 1fr);
}

.energy-today,
.energy-balance,
.cost-compare {
  border: 0;
  border-radius: 28px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 42px rgba(70, 82, 100, .09);
}

.energy-today h3,
.energy-balance h3,
.cost-compare header h2 {
  color: #0e121a;
  font-size: 24px;
  font-weight: 900;
}

.today-grid {
  gap: 16px 18px;
}

.today-grid article {
  min-height: 72px;
  padding: 10px 12px 10px 64px;
  position: relative;
  border: 0;
  border-radius: 18px;
  background: transparent;
}

.today-grid article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #edf8f3;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72);
}

.today-grid article:nth-child(1)::before { background: #fff7e7; }
.today-grid article:nth-child(3)::before,
.today-grid article:nth-child(4)::before { background: #f0f0ff; }

.today-grid span {
  color: #969aa4;
  font-size: 16px;
  font-weight: 500;
}

.today-grid strong {
  color: #080b11;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.app-shell {
  background:
    linear-gradient(180deg, #d7ebff 0%, #eef3fa 38%, #f4f5fa 100%);
}

.icon-rail {
  border-right-color: rgba(190, 203, 218, .54);
  background: rgba(255,255,255,.76);
  box-shadow: 10px 0 32px rgba(76, 92, 112, .08);
}

.rail-logo {
  border-radius: 9px;
  background: #eef3ff;
  color: #315fa8;
}

.rail-item {
  border-radius: 10px;
  color: #9299a5;
}

.rail-item:hover {
  background: rgba(255,255,255,.88);
  color: #315fa8;
}

.rail-item.active,
.translate-item:hover,
.translate-item.active {
  border-color: rgba(88, 190, 164, .22);
  background: #eef3ff;
  color: #347bc0;
  box-shadow: 0 10px 22px rgba(52, 123, 192, .12);
}

.brief-pane {
  border-right-color: rgba(190, 203, 218, .54);
  background:
    linear-gradient(180deg, #d7ebff 0%, #eef3fa 38%, #f4f5fa 100%);
}

.workspace-title {
  height: 58px;
  padding: 0 22px;
  border-bottom: 0;
  background: transparent;
}

.workspace-title strong {
  color: #111722;
  font-size: 21px;
  font-weight: 850;
}

.workspace-title span {
  color: #6f7885;
  font-size: 20px;
}

.ai-chat-panel {
  padding: 10px 18px 16px;
  background: transparent;
}

.chat-head {
  min-height: 58px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 16px 36px rgba(70, 82, 100, .08);
}

.chat-head span {
  color: #6f7885;
  font-size: 12px;
  font-weight: 650;
}

.chat-head strong {
  color: #111722;
  font-size: 15px;
  font-weight: 900;
}

.mini-close {
  border-radius: 14px;
  background: #f6f8fb;
  color: #7c8592;
}

.mini-close:hover {
  background: #eef3ff;
  color: #315fa8;
}

.chat-messages {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 24px;
  background: rgba(255,255,255,.58);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.42), 0 20px 42px rgba(70, 82, 100, .08);
  scrollbar-color: #cbd6e2 transparent;
}

.chat-message,
.chat-message.user,
.chat-message.actionable,
.chat-message.tone-leader,
.chat-message.tone-perception,
.chat-message.tone-dispatch,
.chat-message.tone-audit,
.chat-message.tone-execution {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 12px;
  padding: 0;
  border-left: 0;
  background: transparent;
}

.chat-avatar {
  width: 24px;
  height: 24px;
  border-color: rgba(190, 203, 218, .8);
  background: #ffffff;
  color: #347bc0;
  box-shadow: 0 8px 18px rgba(70, 82, 100, .1);
}

.chat-content {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 28px rgba(70, 82, 100, .08);
}

.chat-message.user .chat-content {
  background: #f6f9ff;
  border-color: #d7e2f2;
}

.chat-speaker,
.chat-message.user .chat-speaker,
.chat-message.tone-perception .chat-speaker,
.chat-message.tone-dispatch .chat-speaker,
.chat-message.tone-audit .chat-speaker,
.chat-message.tone-execution .chat-speaker {
  color: #5f6470;
}

.chat-message-body,
.chat-message-body p,
.chat-message-body li {
  color: #303744;
}

.chat-message-body strong,
.chat-message-body h3,
.chat-message-body h4,
.chat-message-body h5,
.chat-message-body h6 {
  color: #10141c;
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 16px 34px rgba(70, 82, 100, .09);
}

.chat-form input {
  height: 38px;
  border-color: #d9e4ee;
  border-radius: 14px;
  background: #ffffff;
  color: #111722;
}

.chat-form input:focus {
  border-color: #8ca8d8;
  box-shadow: 0 0 0 3px rgba(119, 204, 184, .18);
}

.chat-form .action {
  border-radius: 14px;
  background: #ffffff;
  color: #315fa8;
  border-color: #d7e2f2;
}

/* Cold-chain blue pass: replace the old pale-cyan accents with one model-wide blue. */
.energy-status .status-storage strong,
.asset.critical strong,
.day-clock small {
  color: #315fa8;
}

.rail-logo {
  background: #eef3ff;
  color: #315fa8;
}

.rail-item:hover,
.mini-close:hover,
.campus-tools button:hover,
.chat-form .action {
  color: #315fa8;
}

.rail-item.active,
.translate-item:hover,
.translate-item.active,
.mini-close:hover {
  border-color: rgba(49, 95, 168, .2);
  background: #eef3ff;
}

.campus-tools button:hover,
.chat-form input:focus {
  border-color: #8ca8d8;
}

.chat-form input:focus {
  box-shadow: 0 0 0 3px rgba(49, 95, 168, .14);
}

.chat-message.user .chat-content {
  background: rgba(246, 249, 255, .94);
  border-color: #d7e2f2;
}

.chat-form .action {
  border-color: #d7e2f2;
}

.today-grid article::before,
.today-grid article:nth-child(1)::before,
.today-grid article:nth-child(3)::before,
.today-grid article:nth-child(4)::before {
  background: #f1f5ff;
}

.campus-model-switch {
  position: absolute;
  z-index: 16;
  right: 20px;
  bottom: 54px;
  width: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 34px 34px;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 26px rgba(70, 82, 100, .1);
  transform: none;
  backdrop-filter: blur(14px);
}

.campus-model-switch button {
  width: 34px;
  height: 34px;
  border: 1px solid #d7e2f2;
  border-radius: 50%;
  background: #f6f9ff;
  color: #315fa8;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
}

.campus-model-switch > div {
  display: none;
}

.campus-model-switch span,
.campus-model-switch strong,
.campus-model-switch small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campus-model-switch span {
  color: #7d8796;
  font-size: 12px;
  font-weight: 650;
}

.campus-model-switch strong {
  margin-top: 2px;
  color: #10141c;
  font-size: 22px;
  font-weight: 900;
}

.campus-model-switch small {
  margin-top: 3px;
  color: #6f7885;
  font-size: 13px;
}

.campus[data-site-model="coldchain"] .asset[data-anchor="factory"] {
  display: block;
}

.campus[data-site-model="coldchain"] .asset[data-anchor="grid"] {
  left: 12%;
  top: 54%;
}

.campus[data-site-model="coldchain"] .asset[data-anchor="solar"] {
  left: 13%;
  top: 68%;
}

.campus[data-site-model="coldchain"] .asset[data-anchor="storage"],
.campus[data-site-model="coldchain"] .asset[data-anchor="charge"] {
  display: none;
}

.campus[data-site-model="coldchain"] .asset[data-anchor="load"] {
  left: 69%;
  top: 48%;
}

.campus[data-site-model="coldchain"] .asset[data-anchor="factory"] {
  left: 80%;
  top: 63%;
  width: 190px;
  transform: translate(0, 0);
}

.asset[data-anchor="grid"],
.asset[data-anchor="solar"],
.asset[data-anchor="storage"],
.asset[data-anchor="load"],
.campus[data-site-model="coldchain"] .asset[data-anchor="grid"],
.campus[data-site-model="coldchain"] .asset[data-anchor="solar"],
.campus[data-site-model="coldchain"] .asset[data-anchor="load"],
.campus[data-site-model="coldchain"] .asset[data-anchor="factory"] {
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
}

.campus-tools {
  opacity: .92;
}

.campus[data-site-model="coldchain"] .campus-add[data-campus-add="generation"],
.campus[data-site-model="coldchain"] .campus-add[data-campus-add="storage"] {
  display: none;
}

#campus-3d[data-editing="true"] ~ .asset {
  color: #10141c;
  text-shadow: 0 8px 18px rgba(49, 95, 168, .12);
}

.flow-deltas div,
.today-grid article,
.balance-in,
.balance-out,
.cost-metrics article,
.deviation-metrics,
.reopt-metrics,
.candidate,
.trace-item,
.insight,
.plan-ledger-item,
.device-detail,
.device-metrics div,
.device-table button,
.station-kpis article,
.station-alert,
.ops-panel,
.ops-status-strip article,
.ops-memory-grid article,
.ops-slo-list article,
.ops-agent-list article,
.ops-permission-list article {
  background: #f8fafc;
  border-color: #dce5ed;
  color: #17202a;
}

.power-chart-wrap,
.cost-chart-wrap,
.mini-chart,
#cost-chart,
#power-chart {
  background: #ffffff;
  border-color: #dce5ed;
}

.markdown-code-scroll,
.markdown-table-scroll,
.chat-message-body table,
.chat-message-body th,
.chat-message-body td,
.chat-message-body code,
pre {
  background: #ffffff;
  border-color: #dce5ed;
  color: #17202a;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 42px minmax(280px, 34vw) minmax(520px, 1fr);
  }

  .energy-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== runtime console surface lock =====
   Keep the Agent workspace aligned with the current cold-chain glass surface.
   Older white sandbox passes above are still used by parts of the visual stage,
   but they must not repaint the left operation console with mismatched blocks. */
:root {
  --console-bg: linear-gradient(180deg, #d7ebff 0%, #eef3fa 38%, #f4f5fa 100%);
  --console-panel: rgba(255, 255, 255, .78);
  --console-panel-2: rgba(246, 249, 255, .92);
  --console-elevated: rgba(255, 255, 255, .94);
  --console-line: rgba(190, 203, 218, .62);
  --console-line-strong: #cbd7e4;
  --console-ink: #111722;
  --console-soft: #303744;
  --console-muted: #6f7885;
  --console-blue: #315fa8;
}

.app-shell {
  background: linear-gradient(180deg, #d7ebff 0%, #eef3fa 38%, #f4f5fa 100%);
}

.icon-rail {
  border-right-color: rgba(190, 203, 218, .54);
  background: rgba(255, 255, 255, .76);
  box-shadow: 10px 0 32px rgba(76, 92, 112, .08);
}

.rail-logo {
  border-radius: 9px;
  background: #eef3ff;
  color: var(--console-blue);
}

.rail-item {
  border-radius: 10px;
  color: #9299a5;
}

.rail-item:hover,
.rail-item.active,
.translate-item:hover,
.translate-item.active {
  border-color: rgba(49, 95, 168, .2);
  background: #eef3ff;
  color: var(--console-blue);
  box-shadow: 0 10px 22px rgba(52, 123, 192, .12);
}

.brief-pane {
  border-right-color: var(--console-line);
  background: var(--console-bg);
  color: var(--console-ink);
}

.workspace-title {
  border-bottom: 0;
  background: transparent;
}

.workspace-title strong,
.chat-head strong,
.station-kpis strong,
.station-alert strong,
.device-table span,
.device-detail header strong,
.chat-speaker,
.chat-message.user .chat-speaker,
.chat-message-body strong,
.chat-message-body h3,
.chat-message-body h4,
.chat-message-body h5,
.chat-message-body h6,
.agentteams-task-panel header strong,
.agentteams-task-grid strong {
  color: var(--console-ink);
}

.workspace-title span,
.chat-head span,
.chat-role,
.chat-message-body,
.chat-message-body p,
.device-detail p,
.device-log-grid small,
.agentteams-task-panel header span,
.agentteams-task-grid span,
.agentteams-task-log li {
  color: var(--console-muted);
}

.station-tabs button,
.station-equipment button,
.station-signals button,
.station-kpis article,
.station-alert,
.device-table button,
.device-detail,
.device-metrics div,
.device-log-grid section,
.chat-head,
.chat-messages,
.chat-content,
.chat-form,
.chat-form input,
.agentteams-task-panel,
.agentteams-task-grid div,
.agentteams-task-log,
.mini-action,
.candidate,
.trace-item,
.directory-chat,
.directory-gateway {
  border-color: var(--console-line);
  background: var(--console-panel);
  color: var(--console-soft);
  box-shadow: 0 12px 28px rgba(70, 82, 100, .08);
}

.station-tabs button.active,
.device-table button.active,
.chat-message.user .chat-content,
.chat-message.actionable .chat-content,
.mini-action:hover,
.candidate:hover,
.trace-item:hover,
.directory-chat:hover,
.directory-gateway:hover {
  border-color: #3a4d91;
  background: #f6f9ff;
  color: var(--console-blue);
}

.ai-chat-panel {
  background: transparent;
}

.chat-head,
.chat-messages,
.chat-form {
  border-radius: 8px;
}

.chat-content {
  border-radius: 7px;
}

.chat-avatar {
  border-color: rgba(190, 203, 218, .8);
  background: #ffffff;
  color: var(--console-blue);
  box-shadow: 0 8px 18px rgba(70, 82, 100, .1);
}

.chat-form .action,
.action,
.chat-action {
  border-color: var(--console-line-strong);
  background: var(--console-panel-2);
  color: var(--console-soft);
}

.chat-form .action:hover,
.action:hover,
.chat-action:hover {
  border-color: #8ca8d8;
  background: #eef3ff;
  color: var(--console-blue);
}

.action.primary,
.chat-action.primary {
  border-color: var(--console-blue);
  background: var(--console-blue);
  color: #ffffff;
}

.agentteams-task-panel {
  box-shadow: 0 16px 36px rgba(70, 82, 100, .08);
}

.agentteams-task-panel header small {
  color: var(--console-blue);
}

.agentteams-task-log {
  border-radius: 6px;
}

.agent-directory-drawer,
.ops-drawer {
  background: rgba(255, 255, 255, .96);
  box-shadow: 18px 0 50px rgba(31, 41, 55, .16);
}

.drawer-head strong,
.directory-list strong,
.ops-status-strip strong,
.ops-memory-grid strong,
.ops-slo-list strong,
.ops-panel header strong,
.ops-agent-list strong,
.ops-permission-list strong {
  color: var(--console-ink);
}

.directory-list article,
.directory-list article.active,
.ops-status-strip article,
.ops-memory-grid article,
.ops-slo-list article,
.ops-panel,
.ops-agent-list article,
.ops-permission-list article {
  border-color: var(--console-line);
  background: var(--console-panel);
  color: var(--console-soft);
}

/* Product cleanup: compact tools, one daily summary, unified insight cards. */
.energy-bottom {
  grid-template-columns: minmax(0, 1fr);
}

.campus-tools {
  width: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.campus-tools > .camera-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  font-size: 20px;
}

.campus-tools-menu {
  width: min(320px, calc(100vw - 96px));
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 16px 34px rgba(70, 82, 100, .12);
  backdrop-filter: blur(14px);
}

.campus-tools.open .campus-tools-menu {
  display: flex;
}

.campus-tools-menu button {
  min-height: 30px;
  border-radius: 12px;
  white-space: nowrap;
}

.home-view {
  background: var(--console-bg);
}

.visual-title h1 {
  margin-top: 0;
  font-size: 26px;
  font-weight: 900;
}

.visual-title h1::before,
.visual-title h1::after,
.run-status span::before,
.run-status span::after {
  content: none;
  display: none;
}

.run-status {
  align-self: center;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--console-line);
  border-radius: 8px;
  background: var(--console-panel);
}

.run-status span {
  color: var(--console-muted);
  font-size: 11px;
  font-weight: 800;
}

.run-status strong {
  display: inline;
  color: var(--console-ink);
  font-size: 12px;
}

.energy-balance,
.cost-compare,
.agentteams-task-panel {
  width: auto;
  margin: 0 32px 18px;
  border: 1px solid var(--console-line);
  border-radius: 10px;
  background: var(--console-panel);
  box-shadow: 0 16px 36px rgba(70, 82, 100, .08);
}

.energy-balance {
  padding: 16px;
}

.energy-balance h3,
.cost-compare header h2,
.agentteams-task-panel header strong {
  color: var(--console-ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.balance-grid {
  gap: 10px;
}

.balance-in,
.balance-out {
  min-height: 150px;
  border: 1px solid var(--console-line);
  border-radius: 8px;
  background: var(--console-panel-2);
}

.insight-board,
.insight-board.daily-ledger {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.day-group {
  display: grid;
  gap: 8px;
  align-content: start;
}

.history-card {
  min-height: 268px;
  display: grid;
  grid-template-rows: 132px minmax(0, 1fr);
  border-radius: 10px;
}

.history-card.ledger-summary {
  grid-template-rows: minmax(0, 1fr);
}

.history-card.ledger-summary .history-body {
  min-height: 268px;
}

.history-card .mini-chart {
  height: 132px;
}

.history-body {
  display: flex;
  flex-direction: column;
}

.history-card h2 {
  min-height: 42px;
}

.history-card p {
  min-height: 52px;
}

.history-metrics {
  margin-top: auto;
}

/* ===== cockpit/sandbox split final lock ===== */
.app-shell {
  --brief-width: clamp(360px, 34vw, 560px);
  grid-template-columns: 42px var(--brief-width) 10px minmax(0, 1fr);
  min-width: 0;
}

.brief-pane {
  min-width: 0;
  overflow: hidden;
}

.visual-pane {
  min-width: 0;
  overflow: auto;
}

.workspace-resizer {
  display: block;
  grid-column: 3;
  grid-row: 1;
  width: 10px;
  min-width: 10px;
  cursor: col-resize;
  touch-action: none;
  background: linear-gradient(90deg, rgba(164, 180, 198, .16), rgba(255, 255, 255, .72), rgba(164, 180, 198, .16));
}

.workspace-resizer::before {
  content: "";
  display: block;
  width: 1px;
  height: 100%;
  margin: 0 auto;
  background: rgba(126, 144, 164, .48);
}

.workspace-resizer:hover,
.workspace-resizer:focus-visible,
body.resizing-workspace .workspace-resizer {
  background: linear-gradient(90deg, rgba(49, 95, 168, .12), rgba(255, 255, 255, .94), rgba(49, 95, 168, .12));
  outline: none;
}

body.resizing-workspace {
  cursor: col-resize;
  user-select: none;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .brief-pane,
  .visual-pane {
    grid-column: 2;
  }

  .workspace-resizer {
    display: none;
  }
}
