/* SPAZZBOT CONTROL CENTER — visual design system.
   Premium dark operational console: near-black background, charcoal panels,
   thin structural borders, restrained effects. Color carries meaning only:
   blue/cyan = selected/info/config, green = healthy/validated, amber = warning,
   red = stop/danger, neutral = disabled/unavailable. */

:root {
  --bg-app: #0a0b0d;
  --bg-panel: #15171a;
  --bg-panel-raised: #1b1e22;
  --bg-inset: #101214;
  --border-default: #2a2d32;
  --border-strong: #3a3e45;
  --text-primary: #e8e9eb;
  --text-secondary: #9aa0a8;
  --text-tertiary: #64696f;
  --text-disabled: #4a4e54;

  --accent-info: #4db8ff;
  --accent-info-dim: #1c3a4d;
  --accent-safe: #35c987;
  --accent-safe-dim: #123324;
  --accent-warn: #e8a33d;
  --accent-warn-dim: #3d2f14;
  --accent-danger: #f2545b;
  --accent-danger-dim: #3d1518;
  --accent-neutral: #7a8087;
  --accent-neutral-dim: #26282b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.4);

  --sidebar-width: 220px;
  --header-height: 56px;
  --safety-strip-height: 40px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-info); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- App Shell ---------- */

#app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  /* The status strip sits in the content column, so its left edge lines up with the pages
     and the menu column runs from under the header to the bottom. */
  grid-template-areas:
    "header header"
    "sidebar safety"
    "sidebar main";
  min-height: 100vh;
}

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.mono { font-family: var(--font-mono); font-size: 11.5px; }

.app-header {
  grid-area: header;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 14px 24px 10px;
  background: var(--bg-app);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: none;
}
.brand-text { white-space: nowrap; }

.brand-logo-slot {
  /* The source mark (web/assets/img/spazzbot-panda.png, 1659x948,
     transparent background) is a wide peeking-panda graphic: contain, never
     crop, so the ears and paws are not cut off. */
  width: 250px;
  height: 143px;
  object-fit: contain;
  flex: none;
  margin: -8px -10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-name {
  font-size: 52px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.01em;
  color: #fff;
  transform: skewX(-6deg);
}
.brand-sub {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.62em;
  color: var(--text-primary);
}
.brand-tagline {
  margin-top: 6px;
  font-size: 9.5px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.network-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-size: 12.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap;
}
.network-item.active { color: var(--accent-safe); font-weight: 600; }
.network-item.network-link { color: var(--accent-info, inherit); text-decoration: none; cursor: pointer; }
.network-item.network-link:hover { text-decoration: underline; }
.network-item.muted { color: var(--text-disabled); text-decoration: line-through; }
.network-sep { color: var(--text-tertiary); }

.header-slogan {
  padding-left: 22px;
  border-left: 1px solid var(--border-strong);
  font-size: 15px;
  font-weight: 800;
  font-style: italic;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--text-primary);
  transform: rotate(-4deg);
  white-space: nowrap;
}

.header-wallets {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 6px;
  font-size: 12.5px;
}

.wallet-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.wallet-field .label {
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.08em;
}
.wallet-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

select.wallet-select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
}
select.wallet-select option { background: var(--bg-panel); }

.execution-wallet-chip {
  padding: 3px 9px;
  border: 1px solid rgba(53, 201, 135, 0.45);
  border-radius: var(--radius-sm);
  background: var(--accent-safe-dim);
  color: var(--accent-safe);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* ---------- Safety Strip ---------- */

.safety-strip {
  grid-area: safety;
  display: flex;
  align-items: stretch;
  margin: 14px 24px 14px;
  padding: 14px 0;
  background: var(--bg-app);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.safety-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0 18px;
  border-left: 1px solid var(--border-strong);
}
.safety-item:first-child { border-left: none; }
.safety-tiles {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.safety-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex: none;
  background: var(--accent-neutral);
}
.safety-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.safety-item .label {
  color: var(--text-primary);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.safety-item .value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.safety-item .caption {
  color: var(--text-secondary);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.safety-item.tone-safe .safety-dot { background: var(--accent-safe); box-shadow: 0 0 10px rgba(53, 201, 135, 0.45); }
.safety-item.tone-safe .value { color: var(--accent-safe); }
.safety-item.tone-warn .safety-dot { background: var(--accent-warn); }
.safety-item.tone-warn .value { color: var(--accent-warn); }
.safety-item.tone-danger .safety-dot { background: var(--accent-danger); box-shadow: 0 0 10px rgba(242, 84, 91, 0.45); }
.safety-item.tone-danger .label { color: var(--accent-danger); }
.safety-item.tone-danger .value { color: var(--accent-danger); }
.safety-item.tone-neutral .safety-dot { background: #c9ced6; }
.safety-item.tone-neutral .value { color: var(--text-primary); }

/* ---------- Sidebar ---------- */

.sidebar {
  grid-area: sidebar;
  background: var(--bg-app);
  border-right: 1px solid var(--border-default);
  padding: 8px 0 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}
.nav-links { display: flex; flex-direction: column; gap: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  border-left: 4px solid transparent;
}
.nav-link .icon { width: 26px; height: 26px; color: var(--text-secondary); }
.nav-link:hover { background: var(--bg-panel); text-decoration: none; }
.nav-link.active {
  background: var(--bg-panel-raised);
  border-left-color: #fff;
}
.nav-link.active .icon { color: #fff; }

.sidebar-footer {
  padding: 0 24px;
  font-size: 11px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text-secondary);
  line-height: 1.9;
}
.sidebar-motto, .sidebar-est {
  padding: 12px 0;
  border-top: 2px solid var(--border-strong);
}
.sidebar-est { color: var(--text-primary); }

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
  z-index: 30;
  width: 38px;
  height: 38px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

/* Folded sidebar (wider screens): an icon rail, so pages get the room. */
@media (min-width: 901px) {
  #app-shell.nav-collapsed { grid-template-columns: 76px minmax(0, 1fr); }
  #app-shell.nav-collapsed .nav-link { justify-content: center; padding: 16px 0; gap: 0; position: relative; }
  #app-shell.nav-collapsed .nav-link > span:not(.nav-count) { display: none; }
  #app-shell.nav-collapsed .nav-link .nav-count { position: absolute; top: 8px; right: 10px; margin: 0; }
  #app-shell.nav-collapsed .sidebar-footer { display: none; }
}

/* ---------- Main workspace ---------- */

.main-workspace {
  grid-area: main;
  min-width: 0;
  padding: 6px 24px 48px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 16px;
}
.page-heading {
  flex: 1;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
}
.page-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 4px;
}
.page-subtitle {
  color: var(--text-primary);
  font-size: 15px;
  margin: 0;
}
.page-quote {
  align-self: center;
  font-size: 16px;
  font-style: italic;
  color: var(--text-primary);
  white-space: nowrap;
}
.page-clock {
  min-width: 170px;
  padding: 6px 0 10px 20px;
  border-left: 1px solid var(--border-strong);
  border-bottom: 2px solid var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  line-height: 1.6;
  white-space: pre-line;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 14px;
}
.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 22px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  cursor: pointer;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.tab:hover { border-color: var(--text-secondary); }
.tab.active {
  color: var(--accent-info);
  background: var(--accent-info-dim);
  border-color: var(--accent-info);
  box-shadow: 0 0 0 1px rgba(77, 184, 255, 0.25) inset;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Panel ---------- */

.panel {
  min-width: 0;
  margin-bottom: 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  padding: 14px 16px 16px;
}
.grid > .panel { margin-bottom: 0; }
.panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title-text { display: flex; align-items: center; gap: 10px; }
.panel-title .icon { width: 22px; height: 22px; }

/* ---------- Metric Card ---------- */

.metric-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.metric-icon { flex: none; color: #fff; }
.metric-icon .icon { width: 44px; height: 44px; stroke-width: 1.8; }
.metric-body { min-width: 0; }
.metric-card .metric-label {
  font-size: 11.5px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.metric-card .metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.metric-card .metric-value.unavailable {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.06em;
}
.metric-card .metric-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ---------- Status Badge ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

.badge.safe { background: var(--accent-safe-dim); color: var(--accent-safe); }
.badge.safe .dot { background: var(--accent-safe); }

.badge.warn { background: var(--accent-warn-dim); color: var(--accent-warn); }
.badge.warn .dot { background: var(--accent-warn); }

.badge.danger { background: var(--accent-danger-dim); color: var(--accent-danger); }
.badge.danger .dot { background: var(--accent-danger); }

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

.badge.neutral { background: var(--accent-neutral-dim); color: var(--accent-neutral); }
.badge.neutral .dot { background: var(--accent-neutral); }

/* ---------- Data Table ---------- */

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data-table th {
  text-align: left;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-default);
}
table.data-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
}
table.data-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* ---------- Empty state / unavailable field ---------- */

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-disabled);
  font-size: 12.5px;
}

.readonly-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.readonly-field .field-label {
  font-size: 11px;
  color: var(--text-tertiary);
}
.readonly-field .field-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
}
.readonly-field .field-value.unavailable {
  color: var(--text-disabled);
  font-family: var(--font-sans);
  font-style: normal;
}
.readonly-field .field-source {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ---------- Protected action ---------- */

.protected-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-inset);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
}
.protected-action .protected-label {
  font-size: 12.5px;
  color: var(--text-secondary);
}
.protected-action button {
  background: var(--bg-panel-raised);
  color: var(--text-disabled);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  cursor: not-allowed;
}

.hard-deny-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--accent-danger-dim);
  border: 1px solid rgba(242, 84, 91, 0.35);
  border-radius: var(--radius-md);
  color: var(--accent-danger);
  font-size: 12.5px;
  font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 1400px) {
  .header-slogan { display: none; }
  .page-quote { display: none; }
  .safety-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .safety-item:nth-child(4) { border-left: none; }
}

@media (max-width: 1100px) {
  .network-bar { display: none; }
  .brand-logo-slot { width: 210px; height: 120px; }
  .brand-name { font-size: 40px; }
}

@media (max-width: 900px) {
  #app-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "safety"
      "main";
  }
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    padding-top: 72px;
    transform: translateX(-100%);
    transition: transform 0.15s ease;
    z-index: 20;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6);
  }
  #app-shell.nav-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    position: relative;
    z-index: 30;
    width: 38px;
    height: 38px;
    background: var(--bg-panel);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
  }
  .app-header { flex-wrap: wrap; gap: 12px; padding: 12px 16px 8px; }
  .header-wallets { margin-left: auto; }
  .safety-strip { margin: 4px 16px 12px; }
  .main-workspace { padding: 4px 16px 40px; }
  .page-title { font-size: 28px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .brand { gap: 10px; }
  .brand-logo-slot { width: 140px; height: 80px; margin: -6px -8px; }
  .brand-name { font-size: 30px; }
  .brand-sub { font-size: 10px; letter-spacing: 0.4em; }
  .brand-tagline { display: none; }
  /* Desktop wallet chrome collapses to a full-width row under the brand. */
  .header-wallets { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; margin-left: 0; }
  .wallet-field { flex-direction: row; gap: 8px; min-width: 0; }
  .wallet-field .label { display: none; }
  select.wallet-select { font-size: 13px; max-width: 150px; }
  .execution-wallet-chip { font-size: 9.5px; padding: 3px 7px; }
  .safety-strip { flex-direction: column; padding: 10px 0; }
  .safety-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .safety-item { padding: 0 12px; gap: 10px; }
  .safety-item:nth-child(4) { border-left: 1px solid var(--border-strong); }
  .safety-item:nth-child(odd) { border-left: none; }
  .safety-dot { width: 12px; height: 12px; }
  .safety-item .label { font-size: 9px; letter-spacing: 0.08em; }
  .safety-item .value { font-size: 15px; }
  .safety-item .caption { font-size: 8.5px; letter-spacing: 0.04em; }
  .page-header { flex-wrap: wrap; gap: 8px; }
  .page-clock { display: none; }
  .tab { padding: 7px 12px; font-size: 11.5px; gap: 6px; }
  .tab .icon { width: 15px; height: 15px; }
  .metric-icon .icon { width: 32px; height: 32px; }
  .health-label { min-width: 120px; }
}

/* Lock banner, health list and portfolio chart */
.lock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--accent-danger);
  background: var(--accent-danger-dim);
  color: var(--accent-danger);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.health-list { display: flex; flex-direction: column; gap: 8px; }
.health-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.health-label { min-width: 140px; color: var(--text-secondary); }
.health-detail { color: var(--text-tertiary); font-size: 11.5px; }
.line-chart { width: 100%; height: 180px; display: block; }
.line-chart .axis { stroke: var(--border-default); stroke-width: 1; }
.line-chart .series { fill: none; stroke: var(--accent-info); stroke-width: 2; vector-effect: non-scaling-stroke; }
.line-chart .tick { fill: var(--text-tertiary); font-size: 10px; font-family: var(--font-mono); }
.chart-caption { margin-top: 6px; font-size: 11.5px; color: var(--text-tertiary); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1200px) { .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid.cols-4 { grid-template-columns: 1fr; } }

/* Token list editors (Assets > Blacklist / Accumulate) */
.list-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.list-add input {
  flex: 1 1 140px;
  min-width: 0;
  background: var(--bg-inset);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: var(--font-sans);
}
.list-add button, .list-remove {
  background: var(--bg-panel-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
}
.list-remove { padding: 4px 10px; font-size: 11.5px; }
.list-add button:hover, .list-remove:hover { border-color: var(--accent-info); }
.list-status { margin-top: 8px; font-size: 12px; color: var(--accent-warn); min-height: 1em; }
.list-error {
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid var(--accent-danger);
  background: var(--accent-danger-dim);
  color: var(--accent-danger);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* Locked control card (mockup "LIVE EXECUTION DISABLED" / "AUTOMATION LOCKED"). */
.lock-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1.5px solid var(--accent-danger);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(242, 84, 91, 0.16), rgba(242, 84, 91, 0.06));
}
.lock-card-icon { color: var(--accent-danger); }
.lock-card-icon .icon { width: 30px; height: 30px; }
.lock-card-title {
  color: var(--accent-danger);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.lock-card-body { margin-top: 3px; color: var(--text-secondary); font-size: 12.5px; }

/* Viewing-wallet strip at the top of every page */
.wallet-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--accent-info);
  border-radius: var(--radius-md);
}
.wallet-cell { min-width: 0; }
.wallet-cell .field-label {
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.wallet-cell-value {
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}
.wallet-cell .field-source {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 3px;
}
.muted { color: var(--text-tertiary); }

/* Launches page */
.panel-subtitle { margin: 16px 0 8px; font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-tertiary); font-weight: 500; }

/* Approvals count in the nav */
.nav-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--accent-danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* One-tap kill switch (engage only): top right of the header; a floating button on phones. */
.kill-switch { display: flex; align-items: center; gap: 8px; }
.kill-button {
  background: var(--accent-danger);
  color: #fff;
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 0 18px rgba(242, 84, 91, 0.35);
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
}
.kill-button:disabled { background: var(--accent-danger-dim); cursor: default; opacity: 0.8; }

/* Approval and settings controls */
.control-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.control-button {
  background: var(--bg-panel-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12.5px;
  cursor: pointer;
}
.control-button.approve { border-color: var(--accent-safe); }
.control-button.reject { border-color: var(--accent-neutral); }
.control-button.armed { background: var(--accent-warn-dim); border-color: var(--accent-warn); }
.control-button:disabled { opacity: 0.6; cursor: default; }
.settings-input {
  width: 100%;
  min-width: 72px;
  background: var(--bg-panel-raised);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: var(--font-sans);
}

/* Phone alert settings (Monitoring) */
.alert-toggles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 14px; }
.alert-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-primary); }
.alert-field { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }
.alert-field select, .alert-field input {
  background: var(--bg-inset);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12.5px;
}
.alert-field input { width: 70px; }
.alert-settings .list-add button { flex: 0 0 auto; }

/* Remote sign-in page and session controls */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg-app); }
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  padding: 28px 24px 22px;
}
/* Sign-in page: large logo, the name centered under it, then the form, then the tagline. */
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 24px; }
.login-logo { width: 100%; max-width: 300px; height: auto; aspect-ratio: 1659 / 948; object-fit: contain; }
.login-name {
  margin-top: 12px;
  font-size: 46px;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  color: #fff;
  transform: skewX(-6deg);
}
.login-sub { margin-top: 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.5em; padding-left: 0.5em; color: var(--text-primary); }
.login-tagline {
  margin: 22px 0 0;
  text-align: center;
  white-space: nowrap;
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
}
.login-form { display: flex; flex-direction: column; gap: 8px; }
.login-input { font-size: 16px; padding: 10px 12px; }
.login-submit { margin-top: 10px; padding: 12px 14px; font-size: 15px; background: var(--accent-info-dim); border-color: var(--accent-info); color: var(--text-primary); }
.login-submit:disabled { opacity: 0.6; cursor: default; }
.login-error { color: var(--accent-danger); font-size: 12.5px; }
.login-note { margin-top: 16px; font-size: 11.5px; color: var(--text-tertiary); line-height: 1.5; }
.login-mode-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.login-mode-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}
.login-mode-btn:hover {
  color: var(--text-primary);
}
.login-mode-btn.active {
  background: var(--bg-card);
  color: #fff;
  border: 1px solid var(--border-default);
}
.guest-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid var(--accent-warn);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}
.guest-banner-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--accent-warn);
  color: #000;
}
.session-field { display: flex; align-items: center; gap: 8px; }
.logout-button { padding: 4px 10px; font-size: 11.5px; }
@media (max-width: 560px) {
  /* On phones the header keeps just the Sign out button; the login page already said what remote can do. */
  .session-field .badge { display: none; }
  select.wallet-select { max-width: 150px; }
}

/* Section tab row: the pages inside one sidebar section */
.section-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--border-strong);
  overflow-x: auto;
  scrollbar-width: none;
}
.section-tabs::-webkit-scrollbar { display: none; }
.section-tab {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 10px 16px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.section-tab:hover { color: var(--text-primary); }
.section-tab.active { color: var(--accent-info); border-bottom-color: var(--accent-info); }
.nav-link .nav-count { margin-left: auto; }

/* Header: approvals waiting and the remote sign-out */
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions:empty { display: none; }
.approvals-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-sm);
  background: var(--accent-danger-dim);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.approvals-chip .icon { width: 15px; height: 15px; }
.session-field { display: inline-flex; align-items: center; gap: 8px; }
.logout-button { padding: 4px 10px; font-size: 12px; }

/* Six tiles in one row only when they fit without cutting off their values. */
@media (max-width: 1500px) {
  .safety-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .safety-tiles .safety-item:nth-child(4) { border-left: none; }
}

@media (max-width: 560px) {
  .safety-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safety-tiles .safety-item:nth-child(4) { border-left: 1px solid var(--border-strong); }
  .safety-tiles .safety-item:nth-child(odd) { border-left: none; }
  .section-tabs { margin-left: -16px; margin-right: -16px; padding: 0 12px; }
  .section-tab { padding: 10px 12px; font-size: 13px; }
}

/* Phones and narrow tablets: STOP ALL floats at the bottom right, always in thumb reach. */
@media (max-width: 900px) {
  .kill-switch { position: fixed; right: 16px; bottom: 18px; z-index: 40; flex-direction: column; align-items: flex-end; }
  .kill-button { padding: 14px 22px; font-size: 15px; border-radius: 999px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6), 0 0 18px rgba(242, 84, 91, 0.45); }
  .main-workspace { padding-bottom: 96px; }

  /* Mobile quick action bar docked at the bottom */
  .mobile-quick-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(18, 22, 28, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 50;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
  }
  .mobile-venue-pills {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 2px;
    gap: 2px;
  }
  .mobile-venue-btn {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .mobile-venue-btn.active {
    background: var(--accent-info-dim);
    color: var(--text-primary);
  }
  .mobile-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
  }
  .mobile-action-btn .icon {
    width: 14px;
    height: 14px;
  }
  .mobile-action-btn.mobile-approvals {
    background: rgba(242, 84, 91, 0.12);
    border-color: var(--accent-danger);
    color: var(--accent-danger);
  }
  .mobile-action-btn.spinning .icon {
    animation: spin 0.6s linear infinite;
  }
  @keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  .mobile-kill-slot .kill-button {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 10px rgba(242, 84, 91, 0.35);
  }
}

@media (min-width: 901px) {
  .mobile-quick-bar {
    display: none !important;
  }
}

/* Header room: with the larger logo, the slogan and then the venue bar give way first. */
@media (max-width: 1700px) { .header-slogan { display: none; } }
@media (max-width: 1500px) { .network-bar { display: none; } }

/* A disabled STOP ALL (folder not set up, or a request already sent) stays solid, never see-through. */
.kill-button:disabled { background: #3a1417; opacity: 1; color: #f3c4c6; }

/* The sign-in button borrows the kill-button base only for its shape; no red glow or pill. */
.login-submit, .login-submit:disabled { box-shadow: none; border-radius: var(--radius-sm); background: var(--accent-info-dim); color: var(--text-primary); }

/* Wallet picker: larger, centered in the header's free space, its top level with the logo's top. */
.app-header > .sidebar-toggle { align-self: center; }
.header-wallets { gap: 8px; margin-top: 4px; }
.header-wallets .wallet-field { gap: 6px; }
.header-wallets .wallet-field .label { font-size: 11px; letter-spacing: 0.14em; }
.header-wallets .wallet-select-wrap { padding: 8px 16px; gap: 12px; min-width: 340px; border-radius: var(--radius-md); }
.header-wallets .wallet-select-wrap .icon { width: 22px; height: 22px; }
.header-wallets select.wallet-select { font-size: 19px; flex: 1; min-width: 0; }
.header-wallets .execution-wallet-chip { font-size: 12px; padding: 4px 10px; }

/* STOP ALL: pinned to the bottom of the menu column on wider screens, always on screen. */
@media (min-width: 901px) {
  #kill-switch {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 25;
    width: var(--sidebar-width);
    padding: 14px 16px 18px;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-app);
    border-top: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-default);
  }
  #kill-switch .kill-button { width: 100%; padding: 12px 6px; font-size: 13px; letter-spacing: 0.02em; }
  /* Keep the menu footer clear of the pinned button. */
  .sidebar { padding-bottom: 120px; }
  #app-shell.nav-collapsed + #kill-switch, #app-shell.nav-collapsed #kill-switch { width: 76px; padding: 12px 8px 16px; }
  #app-shell.nav-collapsed #kill-switch .kill-button { font-size: 0; padding: 14px 0; }
  #app-shell.nav-collapsed #kill-switch .kill-button::before { content: "STOP"; font-size: 13px; }
}

/* Narrow screens: the picker goes back to its compact size so nothing scrolls sideways. */
@media (max-width: 1200px) {
  .header-wallets .wallet-select-wrap { min-width: 260px; }
  .header-wallets select.wallet-select { font-size: 16px; }
}
@media (max-width: 900px) {
  .header-wallets { flex: none; margin-left: auto; margin-top: 0; align-items: flex-end; }
  .app-header { align-items: center; }
  .header-wallets .wallet-select-wrap { min-width: 0; padding: 4px 10px; }
  .header-wallets select.wallet-select { font-size: 14px; }
}

/* Header wallet list: every wallet with its role and status; tap one to view it. It fills the
   header's free space (the venue bar and slogan give it their room; venues stay on Trading). */
.network-bar, .header-slogan { display: none; }
.header-wallets { align-items: stretch; align-self: stretch; gap: 6px; }
.wallet-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wallet-list-head .label { color: var(--text-tertiary); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.wallet-all {
  padding: 2px 10px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
}
.wallet-all.selected { color: var(--accent-info); border-color: var(--accent-info); background: var(--accent-info-dim); }
.wallet-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 6px;
  width: 100%;
}
.wallet-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "top top" "role status";
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  padding: 5px 9px;
  min-width: 0;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.wallet-card:hover { border-color: var(--text-secondary); }
.wallet-card.selected { border-color: var(--accent-info); background: var(--accent-info-dim); box-shadow: inset 0 0 0 1px var(--accent-info); }
.wallet-card-top { grid-area: top; display: flex; align-items: center; gap: 6px; min-width: 0; }
.wallet-card-id { font-family: var(--font-mono); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A long role wraps to a second line instead of being cut off (e.g. "Opportunity / ARB"). */
.wallet-card-role { grid-area: role; font-size: 11px; line-height: 1.25; color: var(--text-secondary); overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wallet-card-status { grid-area: status; display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; white-space: nowrap; color: var(--text-secondary); }
.wallet-card-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-neutral); }
.wallet-card-status.tone-safe { color: var(--accent-safe); }
.wallet-card-status.tone-safe::before { background: var(--accent-safe); }
.wallet-card-status.tone-warn { color: var(--accent-warn); }
.wallet-card-status.tone-warn::before { background: var(--accent-warn); }
.wallet-card-status.tone-danger { color: var(--accent-danger); }
.wallet-card-status.tone-danger::before { background: var(--accent-danger); }
.wallet-card-status.tone-neutral::before { background: #c9ced6; }
.wallet-card-exec { flex: none; padding: 0 5px; border-radius: 4px; border: 1px solid rgba(53, 201, 135, 0.5); color: var(--accent-safe); font-size: 9px; font-weight: 700; letter-spacing: 0.04em; }
.header-actions { justify-content: flex-end; }

/* Narrower screens: two rows you swipe sideways, so the header stays short. */
@media (max-width: 1200px) {
  .wallet-list { grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: 170px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .wallet-list::-webkit-scrollbar { display: none; }
}

/* Phones: the list sits under the brand as one row you swipe sideways. */
@media (max-width: 900px) {
  .header-wallets { flex: 1 1 100%; width: 100%; margin-left: 0; align-items: stretch; }
  .wallet-list { grid-template-rows: none; grid-auto-columns: minmax(160px, 62%); }
}

/* Armed for a launch: a rocket in the card's top-right corner. */
.wallet-card-armed { margin-left: auto; display: inline-flex; color: var(--accent-warn); }
.wallet-card-armed .icon { width: 15px; height: 15px; }
.wallet-card.armed { border-color: rgba(232, 163, 61, 0.55); }

/* Overview: wallet names open that wallet's own overview; small links in panel headers. */
.wallet-link { color: var(--text-primary); font-family: var(--font-mono); font-weight: 700; text-decoration: none; border-bottom: 1px dotted var(--text-tertiary); }
.wallet-link:hover { color: var(--accent-info); border-bottom-color: var(--accent-info); }
.panel-link { margin-left: auto; font-size: 12px; color: var(--accent-info); text-decoration: none; white-space: nowrap; }
.preview-verdict { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--text-secondary); font-size: 13px; }

/* Slim viewing-wallet line under the page title. */
.wallet-banner.slim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 8px 14px; font-size: 13px; }
.wallet-banner.slim .field-label { color: var(--text-tertiary); text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.06em; margin-right: 4px; }

/* UTC clock, once, in the header (was on every page title). */
.header-clock { margin-right: auto; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; color: var(--text-tertiary); white-space: nowrap; }
.header-actions { justify-content: flex-end; }

/* ---------- MetalX grid bot card (preview), styled after the spot grid cards Cameron posted ---------- */

.bot-picker { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 12px; color: var(--text-secondary); }
.bot-picker select { background: var(--bg-inset); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 6px 8px; font-size: 14px; }
.bot-card { max-width: 520px; background: #171a1f; border: 1px solid var(--border-strong); border-radius: 10px; padding: 14px 14px 12px; }
.bot-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bot-title { display: flex; gap: 10px; align-items: center; min-width: 0; }
.bot-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #3d8bff, #4db8ff); display: inline-flex; align-items: center; justify-content: center; }
.bot-kind { font-size: 15px; font-weight: 700; }
.bot-pair { font-size: 16px; color: var(--text-secondary); margin-top: 2px; overflow-wrap: anywhere; }
.bot-price { color: var(--accent-danger); font-weight: 600; margin-left: 4px; }
.bot-power { flex: none; width: 52px; height: 36px; border-radius: 8px; border: none; background: #262a31; color: var(--text-secondary); font-size: 16px; }
.bot-runtime { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); margin: 10px 0; }
.bot-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-safe); display: inline-block; }
.bot-sep { color: var(--text-tertiary); }
.bot-hero { display: flex; justify-content: space-between; gap: 10px; background: #18332f; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.bot-hero .right { text-align: right; }
.bot-hero-label { font-size: 12.5px; color: var(--text-secondary); }
.bot-hero-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.bot-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; margin-bottom: 6px; }
.bot-stat { min-width: 0; }
.bot-stat.center { text-align: center; }
.bot-stat.right { text-align: right; }
.bot-stat-label { font-size: 12px; color: var(--text-tertiary); text-decoration: underline dotted; text-underline-offset: 3px; }
.bot-stat-value { font-size: 14.5px; font-weight: 600; margin-top: 3px; overflow-wrap: anywhere; }
.bot-pos { color: var(--accent-safe); }
.bot-neg { color: var(--accent-danger); }
.bot-zero { color: var(--text-primary); }
.bot-hero .bot-zero { color: #2ed3b7; }
.bot-ratio-row { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.bot-ratio { display: flex; width: 96px; height: 18px; border-radius: 3px; overflow: hidden; font-size: 11.5px; font-weight: 700; }
.bot-ratio-buy { background: #14443a; color: #35c987; text-align: center; line-height: 18px; min-width: 22px; }
.bot-ratio-sell { background: #4a1c22; color: #f2545b; text-align: center; line-height: 18px; min-width: 22px; }
.bot-note { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.bot-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.bot-button { background: #262a31; color: var(--text-primary); border: none; border-radius: 8px; padding: 11px 6px; font-size: 14px; cursor: pointer; }
.bot-button:disabled { color: var(--text-tertiary); cursor: default; }
.bot-editor { max-width: 520px; margin-top: 10px; background: var(--bg-panel-raised); border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 14px; }
.bot-editor-title { font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.bot-editor-close-btn { background: transparent; border: 1px solid var(--border-subtle); color: var(--text-secondary); border-radius: 6px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; line-height: 1; transition: all 0.15s ease; }
.bot-editor-close-btn:hover, .bot-editor-close-btn:focus { color: var(--text-primary); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.08); }
.bot-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bot-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-secondary); }
.bot-editor-actions { display: flex; gap: 8px; margin: 12px 0 6px; flex-wrap: wrap; }
.bot-editor-actions .bot-button { flex: 1; min-width: 80px; }
.price-list { display: flex; flex-direction: column; margin: 8px 0; }
.price-row { display: grid; grid-template-columns: 120px minmax(90px, 1fr) 56px 44px; gap: 8px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border-default); }
.price-head { color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.price-head span:nth-child(2) { text-align: left; }
.price-pair { font-weight: 600; white-space: nowrap; }
.price-value { text-align: left; font-variant-numeric: tabular-nums; }
.price-star { justify-self: end; text-align: right; }
.price-change { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .price-row { grid-template-columns: 105px minmax(80px, 1fr) 52px 38px; gap: 6px; padding: 8px 1px; }
  .price-pair { font-size: 13px; }
  .price-value { font-size: 13px; }
}
.price-change .pos { color: var(--accent-safe); }
.price-change .neg { color: var(--accent-danger); }
.price-change .zero { color: var(--text-primary); }
.price-star-off { color: var(--text-tertiary); font-size: 18px; }
.star-button { background: none; border: none; padding: 4px 10px; font-size: 22px; line-height: 1; color: var(--text-tertiary); cursor: pointer; }
.star-button.on { color: #f5c518; }
.pair-cell-wrap { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pair-cell-wrap .star-button { padding: 0 4px; font-size: 18px; line-height: 1; vertical-align: middle; }
/* SimpleDEX | MetalX switch under the logo; the wide header shows the venue bar instead. */
.venue-switch { display: none; gap: 6px; margin-top: 8px; }
.venue-tab { padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); background: var(--bg-panel); }
.venue-tab:hover { text-decoration: none; color: var(--text-primary); }
.venue-tab.active { color: #0a0b0d; background: var(--accent-info); border-color: var(--accent-info); }
.metalx-links { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.metalx-link { text-decoration: none; display: inline-block; padding: 11px 16px; }
@media (max-width: 1500px) { .venue-switch { display: flex; } }
.brand-col { display: flex; flex-direction: column; flex: none; min-width: 0; }

/* Reference-sized Spot Grid cards and a separate editable preview for every recorded pair. */
/* Layout A: Focus Inspector + Dense Grid Matrix */
.bot-picker-row { margin: 8px 0 4px; }
.bot-pill-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.bot-pill { background: #131922; border: 1px solid var(--border-subtle); color: var(--text-secondary); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; transition: all 0.15s ease; display: inline-flex; align-items: center; }
.bot-pill:hover, .bot-pill:focus-visible, .bot-pill-active { background: #1c2635; color: var(--text-primary); border-color: var(--accent-info); outline: none; }
.bot-pill-active { box-shadow: 0 0 0 1px var(--accent-info); }

[data-metalx-bots] [data-bot-slot] { max-width: 100%; margin: 8px auto; }
.bot-card { max-width: none; width: 100%; box-sizing: border-box; padding: 12px 14px; background: #181f2b; border-radius: 12px; border: 1px solid var(--border-subtle); transition: border-color 0.15s ease; }
.bot-card:hover { border-color: var(--border-strong); }
.bot-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bot-icon { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bot-icon svg { width: 18px; height: 18px; }
.bot-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); line-height: 1.2; }
.bot-pair { font-size: 15px; font-weight: 700; line-height: 1.2; }
.bot-price { color: var(--accent-info); font-variant-numeric: tabular-nums; font-weight: 600; margin-left: 4px; font-size: 13px; }
.bot-power { width: 38px; height: 32px; font-size: 16px; border-radius: 6px; }
.bot-runtime { font-size: 11px; margin: 4px 0 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--text-secondary); }
.bot-dot-preview { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-info); display: inline-block; }
.bot-hero { background: #073b3c; padding: 8px 12px; border-radius: 8px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.bot-hero-label { font-size: 11px; color: var(--text-secondary); }
.bot-hero-value { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bot-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; margin: 6px 0; }
.bot-stat-label { font-size: 10px; color: var(--text-secondary); }
.bot-stat-value { font-size: 12px; font-weight: 600; margin-top: 1px; font-variant-numeric: tabular-nums; }
.bot-ratio-row { margin: 6px 0; }
.bot-details { color: var(--text-secondary); font-size: 11px; margin: 6px 0; }
.bot-details summary { cursor: pointer; padding: 3px 0; }
.bot-details .bot-note { padding: 4px 0; font-size: 11px; line-height: 1.4; }
.bot-actions { margin-top: 8px; display: flex; gap: 6px; }
.bot-button { padding: 6px 10px; font-size: 12px; border-radius: 6px; }
.bot-editor { max-width: none; margin-top: 8px; padding: 10px 12px; background: #131922; border-radius: 8px; border: 1px solid var(--border-subtle); }
.bot-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.bot-gallery-item { min-width: 0; }
.bot-gallery-item-focused { outline: 2px solid var(--accent-info); outline-offset: 3px; border-radius: 12px; }
.bot-customize { display: none; }
.bot-button:focus-visible, .bot-details summary:focus-visible { outline: 2px solid var(--accent-info); outline-offset: 3px; }
@media (max-width: 680px) {
  .bot-gallery { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
  .bot-card { padding: 10px 12px; }
  .bot-kind { font-size: 10px; }
  .bot-pair { font-size: 14px; }
  .bot-price { font-size: 12px; }
  .bot-hero { padding: 6px 10px; }
  .bot-hero-label { font-size: 10px; }
  .bot-hero-value { font-size: 15px; }
  .bot-stats { gap: 3px 6px; }
  .bot-stat-label { font-size: 9px; }
  .bot-stat-value { font-size: 11px; }
}

/* ---------- Visual Paired Grid Ladder (Tool 2) ---------- */
.grid-ladder-card {
  margin: 10px 0 6px;
  padding: 10px 12px;
  background: #111620;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.grid-ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.grid-ladder-title {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.grid-ladder-levels {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ladder-rung {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.ladder-rung.sell-rung {
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid var(--accent-danger);
  color: var(--accent-danger);
}
.ladder-rung.buy-rung {
  background: rgba(16, 185, 129, 0.12);
  border-left: 3px solid var(--accent-safe);
  color: var(--accent-safe);
}
.rung-side {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.rung-price {
  font-weight: 600;
}
.rung-size {
  color: var(--text-secondary);
  font-size: 10.5px;
}
.ladder-mid-line {
  margin: 4px 0;
  padding: 3px 8px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px dashed var(--accent-info);
  border-radius: 4px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-info);
  letter-spacing: 0.05em;
}
.ladder-caption {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: right;
}

/* ---------- Posture Gauge & Microstructure Skew (Engines 2 & 3) ---------- */
.posture-gauge-card {
  margin: 8px 0;
  padding: 12px 14px;
  background: #111620;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.posture-gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}
.posture-ratio-bar-wrap {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #1c2635;
  margin: 6px 0 10px;
}
.posture-bar-quote {
  background: var(--accent-info);
  transition: width 0.3s ease;
}
.posture-bar-base {
  background: var(--accent-safe);
  transition: width 0.3s ease;
}
.posture-gauge-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 4px;
}
.posture-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.posture-stat .stat-caption {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}
.posture-stat .stat-val {
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.posture-stat .stat-val.pos { color: var(--accent-safe); }
.posture-stat .stat-val.neg { color: var(--accent-danger); }
.posture-advisory {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-secondary);
}

.depth-skew-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 140px;
}
.depth-skew-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-family: var(--font-mono);
}
.liquidity-bar-wrap {
  display: flex;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: #1c2635;
}
.liquidity-bar-bid {
  background: var(--accent-safe);
}
.liquidity-bar-ask {
  background: var(--accent-danger);
}
.depth-skew-warning {
  margin-top: 2px;
}

/* ---------- Smart Rebalance: Allocation Bar & Dip Radar ---------- */
.alloc-bar-container {
  margin: 10px 0 6px;
}
.alloc-bar {
  display: flex;
  height: 26px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #111418;
  border: 1px solid var(--border-default);
}
.alloc-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  transition: width 0.3s ease, filter 0.2s ease;
  cursor: default;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.alloc-seg:hover {
  filter: brightness(1.2);
}
.alloc-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.alloc-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: 11.5px;
}
.alloc-chip-priority {
  border-color: rgba(77, 184, 255, 0.4);
  background: rgba(77, 184, 255, 0.05);
}
.alloc-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.alloc-chip-name {
  font-weight: 700;
  color: var(--text-primary);
}
.alloc-chip-pct {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-info);
}

.dip-radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.dip-radar-card {
  background: var(--bg-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dip-radar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dip-radar-pair {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}
.dip-radar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}
.dip-radar-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
.dip-radar-stat-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}
.dip-radar-buffer {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: rgba(232, 163, 61, 0.08);
  border: 1px solid rgba(232, 163, 61, 0.25);
  color: var(--accent-warn);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dip-radar-ladder {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--border-default);
}
.dip-radar-ladder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}
.dip-radar-ladder-row.triggered {
  background: rgba(242, 84, 91, 0.1);
  border-color: rgba(242, 84, 91, 0.3);
}
.dip-radar-ladder-tier {
  font-weight: 600;
  color: var(--text-secondary);
}
.dip-radar-ladder-mult {
  font-family: var(--font-mono);
  color: var(--accent-info);
  font-size: 10.5px;
}
.dip-radar-ladder-gap {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-warn);
}
.dip-radar-ladder-gap.reached {
  color: var(--accent-danger);
}

.pos { color: var(--accent-safe); font-weight: 600; }
.neg { color: var(--accent-danger); font-weight: 600; }
.spread-tight { color: var(--accent-safe); font-weight: 600; }
.spread-wide { color: var(--accent-warn); font-weight: 600; }

.risk-filter-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}
.risk-filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.risk-filter-btn.active {
  background: var(--accent-safe);
  border-color: var(--accent-safe);
  color: #0d1117;
}

.waterfall-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.waterfall-pct {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

