* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
}

::selection {
  background: var(--accent);
  color: white;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 10px;
  background: color-mix(in srgb, var(--muted) 42%, transparent);
  background-clip: padding-box;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: -70px;
  left: 18px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 14px;
}

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

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 14px 10px 12px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  border-right: 1px solid var(--sidebar-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 8px;
  margin-bottom: 14px;
  color: var(--sidebar-ink-strong);
  text-decoration: none;
}

.brand-mark {
  width: 24px;
  height: 24px;
  display: grid;
  flex: none;
  place-items: center;
  border-radius: 6px;
  background: var(--ink-strong);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
}

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.011em;
}

#primary-nav {
  display: grid;
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 1px;
}

.nav-group > p {
  margin: 6px 8px 4px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
}

#primary-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 31px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--sidebar-ink);
  font-size: 13.5px;
  font-weight: 450;
  letter-spacing: -.006em;
  text-decoration: none;
  transition: color .12s ease, background-color .12s ease;
}

#primary-nav a svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .62;
  transition: opacity .12s ease;
}

#primary-nav a:hover {
  color: var(--sidebar-ink-strong);
  background: var(--sidebar-raised);
}

#primary-nav a:hover svg { opacity: .85; }

#primary-nav a.active {
  color: var(--sidebar-ink-strong);
  font-weight: 550;
  background: var(--sidebar-raised);
}

#primary-nav a.active svg {
  opacity: 1;
  stroke: var(--accent);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--sidebar-border);
}

.console-switch {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color .12s ease;
}

.console-switch:hover { background: var(--sidebar-raised); }

.console-switch-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--warning);
}

.console-switch span:last-child {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.console-switch b {
  color: var(--sidebar-ink-strong);
  font-size: 12.5px;
  font-weight: 550;
  letter-spacing: -.006em;
}

.console-switch small {
  color: var(--faint);
  font-size: 11.5px;
}

.sidebar-foot .icon-button {
  width: 30px;
  height: 30px;
  flex: none;
}

.dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--faint) 13%, transparent);
}

.dot-green {
  background: var(--positive);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 13%, transparent);
}

.dot-amber {
  background: var(--warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 13%, transparent);
}

.dot-red {
  background: var(--negative);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--negative) 13%, transparent);
}

.icon-button {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}

.sidebar .icon-button {
  border-color: var(--sidebar-border);
  background: var(--surface);
  color: var(--muted);
}

.icon-button svg {
  width: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
  color: var(--ink-strong);
}

.sidebar .icon-button:hover {
  border-color: var(--border-strong);
  background: var(--sidebar-raised);
  color: var(--ink-strong);
}

.content-shell {
  min-width: 0;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
}

.env-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.env-chip b { color: var(--ink); font-weight: 500; }

.last-updated {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font: 400 12px/1 var(--sans);
}

.last-updated time { font-variant-numeric: tabular-nums; }

.topbar-left,
.topbar-right,
.connection,
.environment,
.command-statuses,
.command-status {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 10px;
}

.topbar-right {
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}

.connection {
  gap: 8px;
}

.command-button {
  min-width: 180px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-align: left;
  transition: border-color .16s ease, background-color .16s ease;
}

.command-button:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.command-button svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.command-button kbd {
  margin-left: auto;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--faint);
  font: 9px var(--mono);
  box-shadow: 0 1px 0 var(--border);
}

.environment {
  gap: 9px;
  white-space: nowrap;
}

.environment-label {
  color: var(--faint);
  font-size: 10px;
}

.environment strong {
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--border));
  border-radius: 3px;
  background: var(--warning-soft);
  color: var(--warning);
  font: 500 9px var(--mono);
  letter-spacing: .08em;
}

.environment > span:last-child,
.connection,
time {
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .015em;
}

.command-statuses {
  min-width: 0;
  justify-content: center;
  overflow: hidden;
  border-inline: 1px solid var(--border);
}

.command-status {
  min-width: 68px;
  height: 32px;
  display: grid;
  grid-template-columns: 9px 1fr;
  grid-template-rows: 1fr 1fr;
  column-gap: 6px;
  align-content: center;
  padding: 0 9px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.command-status:last-child {
  border-right: 0;
}

.command-status small {
  align-self: end;
  color: var(--faint);
  font: 8px/1 var(--mono);
  letter-spacing: .045em;
  text-transform: uppercase;
}

.command-status b {
  align-self: start;
  color: var(--ink);
  font: 500 9px/1.25 var(--mono);
  letter-spacing: .015em;
}

.status-shape {
  grid-row: 1 / 3;
  align-self: center;
  width: 5px;
  height: 5px;
  background: var(--disconnected);
}

.status-shape.market {
  border-radius: 50%;
  background: var(--warning);
}

.status-shape.paper {
  border: 1px solid var(--paper);
  background: transparent;
  transform: rotate(45deg);
}

.status-shape.route {
  width: 6px;
  height: 2px;
  background: var(--paper);
}

.status-shape.data {
  border-radius: 50%;
  background: var(--info);
}

.notification-button {
  position: relative;
}

.notification-button > span {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  padding-inline: 3px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--warning);
  color: white;
  font: 500 7px var(--mono);
}

.emergency-access {
  color: var(--negative);
}

.environment-menu {
  position: relative;
}

.environment-menu summary {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
  font: 500 9px var(--mono);
  list-style: none;
}

.environment-menu summary::-webkit-details-marker {
  display: none;
}

.environment-menu > div {
  position: absolute;
  z-index: 80;
  top: 41px;
  right: 0;
  width: 190px;
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-float);
}

.environment-menu b {
  font-size: 11px;
}

.environment-menu span,
.environment-menu a {
  color: var(--muted);
  font: 9px var(--mono);
}

.environment-menu a {
  margin-top: 4px;
  color: var(--accent);
  text-decoration: none;
}

.safety-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}

.safety-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--warning);
}

main {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 35px 36px 70px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 27px;
}

.eyebrow {
  display: none;
}

.eyebrow i {
  width: 18px;
  height: 1px;
  background: var(--border-strong);
}

.page-heading h1 {
  margin: 0 0 6px;
  color: var(--ink-strong);
  font: var(--type-page-title);
  letter-spacing: -.02em;
}

.page-heading p {
  max-width: 74ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.page-heading-meta {
  color: var(--faint);
  font: 400 12px/1.55 var(--sans);
  text-align: right;
}

.page-content {
  min-height: 440px;
}

.page-content > * {
  animation: surface-enter .3s cubic-bezier(.2, .75, .3, 1) both;
}

.grid {
  display: grid;
  gap: 14px;
}

.metrics-grid {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

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

.two-col {
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, .85fr);
}

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

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stack {
  display: grid;
  gap: 14px;
}

.section-gap {
  margin-top: 14px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .18s ease, background-color .18s ease;
}

.panel-head {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.panel-head h2 {
  margin: 0;
  color: var(--ink-strong);
  font: var(--type-card-title);
}

.panel-head p,
.panel-head span {
  margin: 0;
  color: var(--faint);
  font: 400 12px/1.4 var(--sans);
}

.panel-body {
  padding: 18px;
}

.panel-body:has(> .table-wrap),
.panel-body:has(> .empty-state),
.panel-body:has(> .error-state),
.panel-body:has(> .portfolio-chart) {
  padding: 0;
}

.metric-card {
  min-width: 0;
  min-height: 112px;
  padding: 18px 17px 16px;
  background: var(--surface);
  animation: metric-enter .34s cubic-bezier(.2, .75, .3, 1) both;
}

.metric-card:nth-child(2) {
  animation-delay: 35ms;
}

.metric-card:nth-child(3) {
  animation-delay: 70ms;
}

.metric-card:nth-child(4) {
  animation-delay: 105ms;
}

.metric-card:nth-child(5) {
  animation-delay: 140ms;
}

.metric-card:nth-child(6) {
  animation-delay: 175ms;
}

.metric-label {
  min-height: 20px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font: var(--type-label);
}

.metric-value {
  color: var(--ink-strong);
  font: var(--type-metric);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.metric-sub {
  margin-top: 8px;
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.positive {
  color: var(--positive) !important;
}

.negative {
  color: var(--negative) !important;
}

.warning {
  color: var(--warning) !important;
}

.neutral {
  color: var(--accent) !important;
}

.chart-wrap {
  position: relative;
  height: 260px;
  overflow: hidden;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid line {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: chart-reveal .75s .12s cubic-bezier(.2, .8, .3, 1) forwards;
}

.chart-line.secondary {
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: .012 .012;
}

.chart-area {
  fill: url("#area-gradient");
  opacity: .13;
}

.portfolio-chart {
  min-width: 0;
  background: var(--surface);
}

.integration-endpoint {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.integration-endpoint span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font: 9px var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.integration-endpoint code {
  color: var(--text);
  font: 11px var(--mono);
  overflow-wrap: anywhere;
}

.chart-toolbar {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
}

.range-control,
.chart-options,
.chart-selectors,
.zoom-control {
  display: flex;
  align-items: center;
}

.range-control {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.range-control button,
.zoom-control button {
  min-width: 31px;
  height: 28px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
  font: 500 8px var(--mono);
}

.range-control button:last-child,
.zoom-control button:last-child {
  border-right: 0;
}

.range-control button:hover,
.range-control button.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chart-options {
  justify-content: center;
  gap: 12px;
}

.series-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  cursor: pointer;
  font: 8px var(--mono);
  letter-spacing: .035em;
  text-transform: uppercase;
}

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

.series-toggle i {
  width: 15px;
  height: 2px;
  background: var(--faint);
  opacity: .35;
}

.series-toggle.portfolio i {
  background: var(--chart-portfolio);
}

.series-toggle.spy i {
  background: var(--chart-spy);
}

.series-toggle.btc i {
  background: var(--chart-btc);
}

.series-toggle.drawdown i {
  height: 7px;
  background: repeating-linear-gradient(135deg, var(--chart-drawdown) 0 2px, transparent 2px 4px);
}

.series-toggle input:checked + i {
  opacity: 1;
}

.series-toggle:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.chart-selectors {
  justify-content: flex-end;
  gap: 7px;
}

.chart-selectors label {
  display: grid;
  gap: 2px;
}

.chart-selectors label > span {
  color: var(--faint);
  font: 7px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chart-selectors select {
  width: 112px;
  height: 28px;
  padding: 0 25px 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-muted);
  color: var(--ink);
  font: 8px var(--mono);
}

.zoom-control {
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.zoom-control span {
  width: 27px;
  color: var(--muted);
  font: 8px var(--mono);
  text-align: center;
}

.chart-stage {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 22%, transparent), transparent 32%),
    var(--surface);
  cursor: crosshair;
  outline: none;
}

.chart-stage:focus-visible {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.chart-stage svg {
  width: 100%;
  height: 410px;
  overflow: visible;
}

.portfolio-grid line {
  stroke: var(--chart-grid);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.portfolio-grid text,
.chart-axis-labels text {
  fill: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .01em;
}

.portfolio-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.portfolio-line.portfolio {
  stroke: var(--chart-portfolio);
}

.portfolio-line.spy {
  stroke: var(--chart-spy);
  stroke-width: 1.35;
  stroke-dasharray: 4 5;
}

.portfolio-line.btc {
  stroke: var(--chart-btc);
  stroke-width: 1.5;
}

.drawdown-area {
  fill: color-mix(in srgb, var(--chart-drawdown) 20%, transparent);
  stroke: var(--chart-drawdown);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

[data-layer="drawdown"] line {
  stroke: var(--border);
  vector-effect: non-scaling-stroke;
}

.trade-marker {
  fill: var(--surface);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.trade-marker.entry {
  stroke: var(--chart-entry);
}

.trade-marker.exit {
  stroke: var(--chart-exit);
}

.chart-crosshair {
  stroke: var(--chart-crosshair);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.stream-tick {
  fill: var(--chart-portfolio);
  stroke: var(--surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  animation: stream-tick var(--motion-slow) var(--ease-enter);
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 12px;
  width: 176px;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  box-shadow: var(--shadow-float);
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.chart-tooltip time {
  margin-bottom: 3px;
  color: var(--faint);
}

.chart-tooltip span {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.chart-tooltip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
}

.chart-tooltip i.portfolio {
  background: var(--chart-portfolio);
}

.chart-tooltip i.spy {
  background: var(--chart-spy);
}

.chart-tooltip i.btc {
  background: var(--chart-btc);
}

.chart-tooltip b {
  color: var(--ink);
  font: 500 9px var(--mono);
}

.chart-foot {
  min-height: 35px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .025em;
  text-transform: uppercase;
}

.chart-foot span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chart-foot b {
  color: var(--muted);
  font-weight: 500;
}

.chart-help {
  margin-left: auto;
}

.stream-indicator {
  width: 6px;
  height: 6px;
  border: 1px solid var(--disconnected);
  border-radius: 50%;
  background: transparent;
}

.stream-indicator.streaming,
.stream-indicator.connected {
  border-color: var(--live);
  background: var(--live);
}

.stream-indicator.connecting,
.stream-indicator.reconnecting,
.stream-indicator.stale {
  border-color: var(--stale);
  background: repeating-linear-gradient(135deg, var(--stale) 0 1px, transparent 1px 2px);
}

.chart-data {
  border-top: 1px solid var(--border);
}

.chart-data summary {
  padding: 10px 14px;
  color: var(--muted);
  cursor: pointer;
  font: 8px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.chart-data caption {
  padding: 10px 14px;
  color: var(--muted);
  font: 9px var(--mono);
  text-align: left;
}

.metric-value.tick-change {
  animation: value-tick var(--motion-slow) var(--ease-enter);
}

.table-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.legend {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 0;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font: 8px var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.legend i {
  width: 17px;
  height: 2px;
  display: inline-block;
  margin-right: 6px;
  background: var(--accent);
  vertical-align: middle;
}

.legend i.secondary {
  height: 1px;
  background: var(--muted);
}

.allocation {
  display: grid;
  grid-template-columns: 126px 1fr;
  gap: 23px;
  align-items: center;
  min-height: 260px;
}

.donut {
  position: relative;
  width: 122px;
  height: 122px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0 17.75%,
    var(--cyan) 17.75% 21.75%,
    var(--canvas-deep) 21.75% 100%
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 65%, transparent);
  animation: donut-enter .55s cubic-bezier(.2, .8, .3, 1) both;
}

.donut::after {
  content: "21.8%\A deployed";
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font: 9px/1.45 var(--mono);
  text-align: center;
  white-space: pre;
}

.legend-list {
  display: grid;
}

.legend-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.legend-row:last-child {
  border-bottom: 0;
}

.legend-row b {
  color: var(--ink);
  font: 500 10px var(--mono);
}

.legend-row i {
  width: 7px;
  height: 7px;
  border-radius: 1px;
  background: var(--accent);
}

.legend-row:nth-child(2) i {
  background: var(--cyan);
}

.legend-row:nth-child(3) i {
  background: var(--canvas-deep);
  border: 1px solid var(--border-strong);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th {
  height: 38px;
  padding: 0 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font: 500 12px/1.4 var(--sans);
  text-align: left;
}

td {
  height: 44px;
  padding: 9px 15px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color .14s ease;
}

tbody tr:hover {
  background: var(--surface-muted);
}

td strong {
  color: var(--ink-strong);
  font-weight: 500;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border-radius: 2px;
  background: var(--surface-muted);
  color: var(--muted);
  font: 500 8px var(--mono);
  letter-spacing: .045em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .72;
}

.badge.good {
  background: var(--positive-soft);
  color: var(--positive);
}

.badge.bad {
  background: var(--negative-soft);
  color: var(--negative);
}

.badge.warn {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.info {
  background: var(--accent-soft);
  color: var(--accent);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.input,
.select,
input,
textarea {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 11px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

.input:focus,
.select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button.secondary {
  color: var(--muted);
}

.button.danger {
  border-color: color-mix(in srgb, var(--negative) 48%, var(--border));
  background: var(--negative-soft);
  color: var(--negative);
}

.button.warning-button {
  border-color: color-mix(in srgb, var(--warning) 48%, var(--border));
  background: var(--warning-soft);
  color: var(--warning);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.agent-grid {
  grid-template-columns: repeat(3, minmax(260px, 1fr));
}

.agent-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .16s ease, transform .16s ease;
}

.agent-card::after {
  content: "";
  position: absolute;
  right: 15px;
  bottom: 12px;
  width: 28px;
  height: 12px;
  opacity: .35;
  background:
    linear-gradient(135deg, transparent 0 15%, var(--positive) 16% 20%, transparent 21% 34%, var(--positive) 35% 40%, transparent 41% 52%, var(--positive) 53% 57%, transparent 58% 69%, var(--positive) 70% 74%, transparent 75%);
}

.agent-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.agent-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.agent-top h3 {
  margin: 0 0 3px;
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
}

.agent-top p {
  margin: 0;
  color: var(--faint);
  font: 8px var(--mono);
}

.agent-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  max-width: calc(100% - 40px);
}

.agent-metrics div {
  padding: 0 10px;
  border-right: 1px solid var(--border);
}

.agent-metrics div:first-child {
  padding-left: 0;
}

.agent-metrics div:last-child {
  border-right: 0;
}

.agent-metrics small {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font: 8px var(--mono);
  text-transform: uppercase;
}

.agent-metrics b {
  color: var(--ink);
  font: 500 9px var(--mono);
}

.topology {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 3px;
}

.topology-node {
  min-width: 112px;
  padding: 11px 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 9px;
  text-align: center;
}

.topology-node:first-child {
  border-radius: 4px 0 0 4px;
}

.topology-node:last-of-type {
  border-radius: 0 4px 4px 0;
}

.topology-arrow {
  min-width: 25px;
  display: grid;
  place-items: center;
  margin-left: -1px;
  border-block: 1px solid var(--border);
  color: var(--faint);
  font-family: var(--mono);
}

.timeline {
  position: relative;
  display: grid;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 13px;
  width: 1px;
  background: var(--border-strong);
}

.timeline-row {
  display: grid;
  grid-template-columns: 28px 155px 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 52px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-row:last-child {
  border-bottom: 0;
}

.timeline-marker {
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-left: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline-row.rejected .timeline-marker {
  background: var(--negative);
  box-shadow: 0 0 0 1px var(--negative);
}

.timeline-type {
  color: var(--accent);
  font: 8px var(--mono);
  letter-spacing: .035em;
}

.timeline-summary {
  color: var(--muted);
  font-size: 10px;
}

.timeline-summary b {
  color: var(--ink);
  font-weight: 500;
}

.thresholds {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--border);
  gap: 1px;
  overflow: hidden;
}

.threshold {
  min-height: 83px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 8px;
  background: var(--surface-muted);
  color: var(--ink);
  text-align: center;
}

.threshold b {
  font: 500 17px var(--mono);
}

.threshold span {
  color: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.threshold.hard {
  background: var(--negative-soft);
  color: var(--negative);
}

.progress {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--canvas-deep);
}

.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.definition-list {
  margin: 0;
}

.definition-list > div {
  display: grid;
  grid-template-columns: minmax(140px, .55fr) 1fr;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.definition-list > div:first-child {
  padding-top: 0;
}

.definition-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.definition-list dt {
  color: var(--muted);
  font-size: 10px;
  text-transform: capitalize;
}

.definition-list dd {
  margin: 0;
  color: var(--ink);
  font: 9px var(--mono);
  text-align: right;
  word-break: break-word;
}

.empty-state,
.error-state {
  min-height: 150px;
  display: grid;
  place-content: center;
  padding: 40px 22px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.empty-state::before {
  content: "—";
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--faint);
  font-family: var(--mono);
}

.empty-state b,
.error-state b {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 600;
}

.error-state code {
  display: inline-block;
  margin: 11px auto 0;
  padding: 5px 8px;
  border-radius: 3px;
  background: var(--negative-soft);
  color: var(--negative);
  font: 9px var(--mono);
}

.synthetic-note {
  position: relative;
  padding: 10px 13px 10px 35px;
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--border));
  border-radius: 4px;
  background: var(--warning-soft);
  color: color-mix(in srgb, var(--warning) 70%, var(--ink));
  font-size: 10px;
}

.synthetic-note::before {
  content: "S";
  position: absolute;
  top: 9px;
  left: 11px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--border));
  border-radius: 50%;
  color: var(--warning);
  font: 500 7px var(--mono);
}

.control-grid {
  grid-template-columns: repeat(4, minmax(155px, 1fr));
}

.control-card {
  display: flex;
  flex-direction: column;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-muted);
}

.control-card h3 {
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-size: 11px;
  font-weight: 600;
}

.control-card p {
  min-height: 47px;
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 9px;
}

.control-card .button {
  width: 100%;
  margin-top: auto;
}

dialog {
  width: min(500px, calc(100vw - 30px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-float);
}

dialog::backdrop {
  background: rgba(9, 14, 17, .68);
  backdrop-filter: blur(5px);
}

dialog form {
  padding: 27px;
}

.dialog-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--negative);
  font: 500 8px var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.dialog-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--negative);
}

dialog h2 {
  margin: 10px 0 6px;
  color: var(--ink-strong);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.025em;
}

dialog p {
  margin: 0 0 20px;
  font-size: 11px;
}

dialog label {
  display: grid;
  gap: 6px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

dialog label span {
  font-weight: 500;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.form-feedback {
  min-height: 18px;
  margin-top: 11px;
  color: var(--negative);
  font-size: 10px;
}

.command-dialog {
  width: min(560px, calc(100vw - 30px));
  overflow: hidden;
}

.notification-dialog {
  width: min(430px, calc(100vw - 30px));
  max-height: min(620px, calc(100vh - 30px));
  overflow: hidden;
}

.notification-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}

.notification-head span {
  color: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.notification-head h2 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
}

.notification-list {
  display: grid;
  max-height: 470px;
  overflow-y: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.notification-item i {
  width: 6px;
  height: 6px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--warning);
}

.notification-item b {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
}

.notification-item p,
.notification-item time {
  margin: 0;
  color: var(--muted);
  font: 9px/1.5 var(--mono);
}

.command-head {
  display: grid;
  grid-template-columns: 20px 1fr 33px;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}

.command-head > svg {
  width: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.command-head label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.command-dialog > input {
  width: calc(100% - 28px);
  min-height: 45px;
  margin: 14px;
  padding-inline: 13px;
  font-size: 13px;
}

.command-results {
  max-height: 355px;
  display: grid;
  gap: 2px;
  overflow-y: auto;
  padding: 0 14px 14px;
}

.command-result {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.command-result:hover,
.command-result.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.command-result > span:first-child {
  color: var(--faint);
  font: 9px var(--mono);
}

.command-result > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.command-result b {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.command-result small {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font: 9px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-empty {
  padding: 35px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.command-foot {
  display: flex;
  gap: 18px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--faint);
  font: 8px var(--mono);
}

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

.loading-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.skeleton {
  min-height: 110px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, transparent 38%, color-mix(in srgb, var(--surface-raised) 80%, transparent) 48%, transparent 58%),
    var(--surface);
  background-size: 220% 100%;
  animation: skeleton-sweep 1.6s infinite linear;
}

.skeleton.wide {
  min-height: 330px;
  grid-column: 1 / -1;
}

.sort-button,
.table-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: inherit;
}

.sort-button {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.sort-button span {
  opacity: .45;
}

.sort-button[data-direction] {
  color: var(--accent);
}

.table-action {
  color: var(--accent);
}

.table-action:hover {
  text-decoration: underline;
}

.ops-status-strip {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
}

.ops-status-strip > span {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border-right: 1px solid var(--border);
  color: var(--muted);
  font: 9px var(--mono);
}

.ops-status-strip b {
  color: var(--ink);
  font-weight: 500;
}

.agent-brief,
.agent-network-info {
  color: var(--muted);
}

.agent-brief-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font: 500 8px var(--mono);
  letter-spacing: .08em;
}

.agent-brief h3,
.agent-network-info h3 {
  margin: 0 0 8px;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -.025em;
}

.agent-brief p,
.agent-network-info p {
  margin: 0;
  font-size: 11px;
  line-height: 1.65;
}

.agent-brief-flow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 17px 0;
  overflow-x: auto;
  color: var(--ink);
  font: 500 8px var(--mono);
  letter-spacing: .035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.agent-brief-flow i {
  color: var(--faint);
  font-style: normal;
}

.agent-network-info {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(420px, 1.2fr);
  gap: 38px;
}

.agent-network-info dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--border);
}

.agent-network-info dl > div {
  min-height: 82px;
  padding: 13px 15px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.agent-network-info dl > div:nth-child(2n) {
  border-right: 0;
}

.agent-network-info dl > div:nth-last-child(-n+2) {
  border-bottom: 0;
}

.agent-network-info dt {
  margin-bottom: 5px;
  color: var(--ink);
  font: 500 9px var(--mono);
  letter-spacing: .045em;
  text-transform: uppercase;
}

.agent-network-info dd {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.agent-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(235px, 1fr));
  gap: 1px;
  background: var(--border);
}

.agent-directory .agent-card {
  width: 100%;
  min-height: 195px;
  border: 0;
  border-radius: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.agent-card::after {
  display: none;
}

.agent-card > p {
  min-height: 46px;
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.agent-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-identity > span:last-child {
  min-width: 0;
}

.agent-identity b {
  display: block;
  overflow: hidden;
  color: var(--ink-strong);
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-identity small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .035em;
}

.agent-mark {
  width: 34px;
  height: 34px;
  display: grid;
  flex: none;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface-muted);
  color: var(--accent);
  font: 500 9px var(--mono);
  letter-spacing: .04em;
}

.agent-mark.control,
.agent-mark.execution {
  border-style: double;
  color: var(--warning);
}

.agent-mark.audit,
.agent-mark.orchestration {
  color: var(--purple);
}

.profile-link {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 15px;
  color: var(--accent);
  font: 8px var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.profile-link i {
  font-style: normal;
}

.topology {
  min-width: max-content;
  align-items: center;
}

.topology-stage {
  width: 160px;
  min-height: 66px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
}

.topology-index {
  color: var(--faint);
  font: 8px var(--mono);
}

.topology-stage b {
  display: block;
  color: var(--ink);
  font-size: 10px;
  font-weight: 600;
}

.topology-stage small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: var(--faint);
  font-size: 8px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topology-health {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font: 8px var(--mono);
}

.topology-caption {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 9px;
}

.trace-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, 1.3fr) repeat(3, minmax(130px, .7fr));
  gap: 9px;
  margin-bottom: 14px;
}

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

.trace-toolbar label > span {
  color: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.timeline-row {
  width: 100%;
  grid-template-columns: 28px 24px 160px minmax(260px, 1fr) auto;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.timeline-row:hover {
  background: var(--surface-muted);
}

.timeline-sequence {
  color: var(--faint);
  font: 8px var(--mono);
  text-align: center;
}

.timeline-type small,
.timeline-summary {
  display: block;
}

.timeline-type small {
  margin-top: 3px;
  color: var(--faint);
}

.timeline-summary b {
  display: block;
  margin-bottom: 2px;
}

.detail-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 36px 38px 56px;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: -24px 0 60px rgba(7, 12, 15, .18);
}

.detail-dialog::backdrop {
  background: rgba(6, 10, 13, .45);
  backdrop-filter: blur(2px);
}

.detail-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
}

.detail-dialog h2 {
  margin: 5px 0 9px;
  color: var(--ink-strong);
  font-size: 26px;
  letter-spacing: -.04em;
}

.detail-dialog h3 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: 12px;
}

.detail-dialog h4 {
  margin: 17px 0 8px;
  color: var(--faint);
  font: 8px var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.detail-dialog > #detail-content > p,
.profile-hero p {
  color: var(--muted);
}

.profile-hero {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.profile-hero .agent-mark {
  width: 52px;
  height: 52px;
  font-size: 12px;
}

.profile-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--faint);
  font: 8px var(--mono);
}

.profile-grid,
.trace-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-bottom: 1px;
  background: var(--border);
}

.profile-grid > section,
.trace-detail-grid > * {
  min-width: 0;
  padding: 19px;
  background: var(--surface);
}

.profile-section {
  margin: 22px 0;
}

.profile-definition {
  margin: 0;
}

.profile-definition > div {
  display: grid;
  grid-template-columns: minmax(105px, .55fr) 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.profile-definition dt {
  color: var(--faint);
  font-size: 9px;
}

.profile-definition dd {
  margin: 0;
  color: var(--ink);
  font-size: 9px;
  text-align: right;
  overflow-wrap: anywhere;
}

.token-list,
.inline-list,
.guardrail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.token-list li,
.inline-list li {
  padding: 5px 7px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font: 8px var(--mono);
}

.guardrail-list {
  display: grid;
}

.guardrail-list li {
  position: relative;
  padding: 7px 8px 7px 22px;
  border-left: 2px solid var(--negative);
  background: var(--negative-soft);
  color: var(--muted);
  font-size: 9px;
}

.guardrail-list li::before {
  content: "×";
  position: absolute;
  left: 8px;
  color: var(--negative);
  font-family: var(--mono);
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--border);
}

.profile-metrics > div {
  padding: 12px;
  border-right: 1px solid var(--border);
}

.profile-metrics > div:last-child {
  border-right: 0;
}

.profile-metrics span,
.profile-metrics b {
  display: block;
}

.profile-metrics span {
  margin-bottom: 5px;
  color: var(--faint);
  font: 8px var(--mono);
  text-transform: uppercase;
}

.profile-metrics b {
  color: var(--ink);
  font: 500 10px var(--mono);
}

.profile-note,
.reasoning-boundary {
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 9px;
}

.profile-note b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.reasoning-boundary {
  margin: 22px 0 0;
  border-left: 2px solid var(--accent);
}

.trace-summary {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr .8fr;
  gap: 1px;
  margin-bottom: 18px;
  background: var(--border);
}

.trace-summary > div {
  min-width: 0;
  padding: 12px;
  background: var(--surface-muted);
}

.trace-summary span,
.trace-summary b {
  display: block;
}

.trace-summary > div > span {
  margin-bottom: 4px;
  color: var(--faint);
  font: 8px var(--mono);
  text-transform: uppercase;
}

.trace-summary > div > b {
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-explorer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.trace-stage {
  min-height: 82px;
  display: grid;
  grid-template-columns: 22px 7px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.trace-stage:hover {
  border-color: var(--accent);
}

.trace-stage > span,
.trace-stage em {
  color: var(--faint);
  font: 8px var(--mono);
  font-style: normal;
}

.trace-stage > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--positive);
}

.trace-stage.rejected > i {
  background: var(--negative);
}

.trace-stage b,
.trace-stage small {
  display: block;
}

.trace-stage b {
  color: var(--ink);
  font-size: 9px;
}

.trace-stage small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--faint);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trace-stage .badge {
  grid-column: 3 / -1;
}

.desk-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  background: var(--surface);
}

.desk-tabs button {
  min-width: 92px;
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 9px var(--mono);
}

.desk-tabs button:last-child {
  border-right: 0;
}

.desk-tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.desk-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
}

.desk-layout > *,
.stack {
  min-width: 0;
}

.stack {
  display: grid;
  align-content: start;
  gap: var(--grid-gap);
}

.micro-chart {
  padding: 14px;
}

.market-chart {
  background: var(--surface);
}

.market-chart-toolbar,
.market-chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.market-chart-toolbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.market-chart-toolbar strong {
  color: var(--ink-strong);
  font: 600 12px var(--mono);
}

.market-chart-toolbar > div > span {
  color: var(--muted);
  font-size: 10px;
}

.market-chart svg {
  width: 100%;
  height: 340px;
  padding: 10px 0;
  background: linear-gradient(180deg, var(--surface-muted), var(--surface));
}

.market-chart-grid path {
  fill: none;
  stroke: var(--chart-grid);
  vector-effect: non-scaling-stroke;
}

.candle line,
.candle rect {
  vector-effect: non-scaling-stroke;
}

.candle.up line,
.candle.up rect {
  fill: color-mix(in srgb, var(--positive) 32%, transparent);
  stroke: var(--positive);
}

.candle.down line,
.candle.down rect {
  fill: color-mix(in srgb, var(--negative) 27%, transparent);
  stroke: var(--negative);
}

.volume-bar {
  fill: color-mix(in srgb, var(--accent) 24%, transparent);
}

.market-average,
.market-stop,
.market-target {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.market-average {
  stroke: var(--accent);
  stroke-width: 1.4;
}

.market-stop {
  stroke: var(--negative);
  stroke-dasharray: 4 4;
}

.market-target {
  stroke: var(--positive);
  stroke-dasharray: 4 4;
}

.market-chart-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 0;
  color: var(--faint);
  font: 8px var(--mono);
  text-transform: uppercase;
}

.market-chart-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.market-chart-meta span:nth-last-child(-n+2) {
  margin-left: auto;
}

.market-chart-meta i {
  width: 12px;
  height: 2px;
  background: var(--muted);
}

.market-chart-meta .legend-average {
  background: var(--accent);
}

.market-chart-meta .legend-stop {
  background: var(--negative);
}

.market-chart-meta .legend-target {
  background: var(--positive);
}

.market-chart-meta b {
  color: var(--muted);
  font-weight: 500;
}

.micro-chart-head,
.micro-chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font: 8px var(--mono);
}

.micro-chart-head b {
  color: var(--warning);
}

.micro-chart svg {
  width: 100%;
  height: 145px;
  margin: 12px 0;
}

.micro-grid path {
  fill: none;
  stroke: var(--border);
  vector-effect: non-scaling-stroke;
}

.micro-line,
.micro-stop,
.micro-target {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.micro-line {
  stroke: var(--accent);
  stroke-width: 1.6;
}

.micro-stop {
  stroke: var(--negative);
  stroke-dasharray: 4 4;
}

.micro-target {
  stroke: var(--positive);
  stroke-dasharray: 4 4;
}

.micro-chart-foot {
  align-items: flex-start;
  flex-wrap: wrap;
}

.micro-chart-foot span {
  display: grid;
  gap: 2px;
}

.micro-chart-foot b {
  color: var(--ink);
  font-weight: 500;
}

.research-brief {
  padding: 21px;
}

.research-label {
  color: var(--warning);
  font: 8px var(--mono);
  letter-spacing: .06em;
}

.research-brief h3 {
  margin: 9px 0;
  color: var(--ink-strong);
  font-size: 15px;
}

.research-brief p {
  color: var(--muted);
  font-size: 11px;
}

.research-rule {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.research-rule b {
  color: var(--ink);
  font-size: 9px;
}

.research-rule span {
  color: var(--faint);
  font: 8px/1.5 var(--mono);
}

.attribution-list {
  display: grid;
}

.attribution-list > div {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.attribution-list > div:last-child {
  border-bottom: 0;
}

.attribution-list i {
  height: 4px;
  background: linear-gradient(90deg, var(--accent) var(--share), var(--surface-muted) var(--share));
}

.attribution-list b {
  color: var(--ink);
  font: 500 9px var(--mono);
}

.mobile-only {
  display: none;
}

@keyframes surface-enter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

@keyframes metric-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes chart-reveal {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes donut-enter {
  from {
    opacity: 0;
    transform: rotate(-14deg) scale(.94);
  }
}

@keyframes skeleton-sweep {
  to {
    background-position: -220% 0;
  }
}

@keyframes stream-tick {
  from {
    opacity: 0;
    transform: scale(.25);
    transform-box: fill-box;
    transform-origin: center;
  }
}

@keyframes value-tick {
  45% {
    color: var(--accent);
  }
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .agent-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .agent-directory,
  .trace-explorer {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .profile-metrics > div:nth-child(3) {
    border-right: 0;
  }

  .profile-metrics > div:nth-child(-n+3) {
    border-bottom: 1px solid var(--border);
  }

  .control-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .chart-toolbar {
    grid-template-columns: auto 1fr;
  }

  .chart-selectors {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

}

@media (max-width: 1080px) {
  .command-status:nth-child(3),
  .command-status:nth-child(4) {
    display: none;
  }

  .agent-network-info {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 960px) {
  .content-shell {
    margin-left: 0;
  }

  .sidebar {
    transform: translateX(-101%);
    box-shadow: 18px 0 45px rgba(7, 12, 15, .28);
    transition: transform .22s cubic-bezier(.2, .8, .3, 1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: grid;
  }

  .topbar {
    grid-template-columns: minmax(140px, .7fr) minmax(280px, 1.3fr) auto;
    padding-inline: 20px;
  }

  .connection {
    display: none;
  }

  .safety-banner {
    padding-inline: 20px;
  }

  .two-col,
  .equal-col {
    grid-template-columns: 1fr;
  }

  .desk-layout {
    grid-template-columns: 1fr;
  }

  .trace-toolbar {
    grid-template-columns: 1fr 1fr;
  }

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

  .chart-options {
    justify-content: flex-start;
  }
}

@media (max-width: 680px) {
  main {
    padding: 27px 15px 55px;
  }

  .topbar {
    min-height: 89px;
    height: auto;
    grid-template-columns: 1fr auto;
    grid-template-rows: 58px 31px;
    gap: 0;
    padding: 0 14px;
  }

  .topbar-left {
    grid-column: 1;
    grid-row: 1;
  }

  .topbar-right {
    grid-column: 2;
    grid-row: 1;
  }

  .command-statuses {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    overflow-x: auto;
    border: 0;
    border-top: 1px solid var(--border);
  }

  .command-status {
    flex: 1 0 86px;
    padding-inline: 8px;
  }

  .command-status:nth-child(3),
  .command-status:nth-child(4) {
    display: grid;
  }

  .command-button {
    min-width: 34px;
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .command-button span,
  .command-button kbd,
  .connection span,
  #utc-clock {
    display: none;
  }

  .topbar-right {
    gap: 7px;
  }

  .environment-menu {
    display: none;
  }

  .safety-banner {
    align-items: flex-start;
    padding: 8px 15px;
  }

  .safety-copy > div {
    display: grid;
    gap: 1px;
  }

  .safety-copy > div span {
    line-height: 1.35;
  }

  .banner-flags {
    display: none;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .page-heading-meta {
    text-align: left;
  }

  .metrics-grid,
  .agent-grid,
  .three-col,
  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 103px;
  }

  .chart-toolbar {
    grid-template-columns: 1fr;
    align-items: start;
    overflow-x: auto;
  }

  .range-control {
    width: max-content;
  }

  .chart-options,
  .chart-selectors {
    width: max-content;
    justify-content: flex-start;
  }

  .chart-stage,
  .chart-stage svg {
    min-height: 330px;
    height: 330px;
  }

  .chart-foot {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .chart-help {
    width: 100%;
    margin-left: 0;
  }

  .timeline-row {
    grid-template-columns: 25px 22px 1fr auto;
    gap: 9px;
  }

  .timeline-type,
  .timeline-summary {
    grid-column: 3;
  }

  .timeline-row .badge {
    grid-column: 4;
    grid-row: 1 / 3;
  }

  .profile-grid,
  .trace-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-dialog {
    width: min(680px, calc(100vw - 18px));
    padding: 28px 24px 44px;
  }

  .thresholds {
    grid-template-columns: repeat(3, 1fr);
  }

  .allocation {
    grid-template-columns: 112px 1fr;
  }
}

@media (max-width: 430px) {
  .metrics-grid,
  .agent-grid,
  .three-col,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .metric-sub {
    white-space: normal;
  }

  .agent-directory,
  .trace-explorer,
  .trace-toolbar,
  .profile-metrics {
    grid-template-columns: 1fr;
  }

  .agent-network-info dl {
    grid-template-columns: 1fr;
  }

  .agent-network-info dl > div,
  .agent-network-info dl > div:nth-child(2n),
  .agent-network-info dl > div:nth-last-child(-n+2) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .agent-network-info dl > div:last-child {
    border-bottom: 0;
  }

  .profile-metrics > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .profile-metrics > div:last-child {
    border-bottom: 0;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .trace-stage {
    grid-template-columns: 20px 6px 1fr;
  }

  .trace-stage em {
    display: none;
  }

  .trace-stage .badge {
    grid-column: 3;
  }

  .allocation {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend-list {
    width: 100%;
  }

  .definition-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .definition-list dd {
    text-align: left;
  }
}

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

/* Live TradingView chart (Market view) */
.tv-live-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tv-live-note {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tv-frame-wrap {
  position: relative;
  width: 100%;
  height: clamp(360px, 62vh, 560px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--canvas-deep);
}
.tv-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ============================================================
   Restrained design system — Risk page + shared components
   ============================================================ */

.plain-table td { color: var(--ink); }
.plain-table .stage-state {
  display: inline-flex;
  align-items: center;
  color: var(--faint);
}
.plain-table .stage-state.on { color: var(--warning); font-weight: 500; }
.plain-table tr.policy-active td { background: var(--warning-soft); }
.plain-table tr.policy-active td:first-child { box-shadow: inset 3px 0 0 var(--warning); }

.section-note {
  margin: 12px 18px 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.section-note.flush { margin: 0 0 14px; }

/* Allocation bars */
.alloc-list { display: grid; gap: 14px; }
.alloc-row {
  display: grid;
  grid-template-columns: 92px 1fr 52px;
  align-items: center;
  gap: 12px;
}
.alloc-name { color: var(--ink); font-size: 13px; }
.alloc-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-inset);
  overflow: hidden;
}
.alloc-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}
.alloc-val { text-align: right; color: var(--muted); font-size: 12px; }

/* Compact action menu */
.menu-list { display: grid; gap: 2px; }
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 400 14px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background-color .14s ease;
}
.menu-item:hover:not(:disabled) { background: var(--surface-muted); }
.menu-item:disabled { color: var(--faint); cursor: default; }
.menu-item.danger { color: var(--negative); }
.menu-item.danger:hover { background: var(--negative-soft); }
.menu-note { color: var(--faint); font-size: 12px; }
.risk-actions { display: grid; gap: 4px; }

/* Smaller empty state used inside two-column panels */
.empty-state.small {
  min-height: 0;
  padding: 20px 18px;
  text-align: left;
  align-items: flex-start;
}
.empty-state.small::before { display: none; }

/* Live market ticker bar */
.ticker-bar {
  height: 44px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.ticker-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Global market session clocks */
.market-clocks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px) {
  .market-clocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.market-clock {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.market-clock-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.market-clock-head b { color: var(--ink); font-size: 14px; font-weight: 500; }
.market-clock-head small { color: var(--faint); font-size: 12px; }
.market-clock-time { color: var(--ink-strong); font-size: 18px; font-variant-numeric: tabular-nums; }
.market-clock-state { color: var(--faint); font-size: 12px; }
.market-clock-state.open { color: var(--positive); font-weight: 500; }

/* Company org structure */
.org-chart { display: grid; gap: 16px; }
.org-root {
  justify-self: center;
  display: grid;
  gap: 2px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
  text-align: center;
}
.org-root b { color: var(--ink-strong); font-size: 15px; font-weight: 600; }
.org-root small { color: var(--muted); font-size: 12px; }
.org-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .org-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.org-division {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.org-division-head { display: grid; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.org-division-head b { color: var(--ink); font-size: 13px; font-weight: 600; }
.org-division-head small { color: var(--muted); font-size: 12px; }
.org-members { display: grid; gap: 2px; }
.org-member {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink);
  font: 400 13px/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}
.org-member:hover { background: var(--surface-muted); color: var(--accent); }
.org-member .dot { box-shadow: none; width: 5px; height: 5px; }

/* Connection switch in the account menu */
.conn-switch {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}
.conn-option {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  font: 400 12px/1.2 var(--sans);
  cursor: pointer;
}
.conn-option.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

/* Live console: not-connected state */
.connect-state {
  display: flex;
  justify-content: center;
  padding: 32px 0 8px;
}
.connect-card {
  width: min(680px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.connect-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}
.connect-card h2 {
  margin: 0;
  color: var(--ink-strong);
  font: var(--type-page-title);
  letter-spacing: -.02em;
}
.connect-card > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.connect-card code {
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--surface-inset);
  font: var(--type-code);
}
.connect-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.safety-banner a { color: var(--accent); text-decoration: none; font-weight: 500; }
.safety-banner a:hover { text-decoration: underline; }

/* Live console: connect steps (neutral, numbered — not error styling) */
.connect-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.connect-steps li::marker { color: var(--muted); font-weight: 500; }
