:root {
  --bg: #0f1326;
  --bg-soft: #181e38;
  --panel: #101932;
  --text: #f5f7ff;
  --muted: #95a0c0;
  --accent: #26d7b2;
  --data: #3db4ff;
  --model: #f2a341;
  --decision: #f06c9b;
  --logic: #ffd24f;
  --trade: #7ad14c;
  --bot: #63f1e3;
  --wallet: #58e0ff;
  --macro: #9f83ff;
  --border: #2b3356;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 18% 12%, #1c2853 0%, #0f1326 52%, #090c1d 100%);
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.overlay-locked {
  overflow: hidden;
}

.splash-screen {
  position: fixed;
  inset: 0;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 18px;
  z-index: 200;
  background: radial-gradient(circle at 25% 20%, rgba(29, 53, 125, 0.62), rgba(4, 8, 20, 0.92));
  backdrop-filter: blur(6px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.auth-card {
  width: min(460px, 100%);
}

.splash-screen.hidden {
  display: none;
}

.splash-card {
  width: min(520px, 100%);
  margin-top: clamp(18px, 8dvh, 72px);
  max-height: calc(100dvh - 36px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #121d3a 0%, #0a1024 100%);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.48);
  padding: 20px;
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.splash-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid #4d5f95;
  border-radius: 8px;
  background: #102041;
  color: #dce8ff;
  cursor: pointer;
}

.splash-card p {
  color: var(--muted);
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.wallet-btn {
  border: 1px solid #3f4d7b;
  border-radius: 10px;
  background: #142142;
  color: #d7e4ff;
  font-family: inherit;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

.wallet-btn.active {
  border-color: #7ec8ff;
  background: #1a3764;
  color: #e8f7ff;
}

.wallet-input-label {
  display: block;
  color: #b7c5f3;
  font-size: 0.86rem;
  margin-bottom: 10px;
}

.auth-onboarding-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wallet-input-label input,
.wallet-input-label textarea,
.wallet-input-label select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid #41507e;
  border-radius: 8px;
  background: #0e1630;
  color: white;
  padding: 8px;
  font-family: "IBM Plex Mono", monospace;
}

.wallet-input-label textarea {
  min-height: 110px;
  resize: vertical;
}

.password-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.password-inline input {
  margin-top: 0;
}

.password-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid #334271;
  background: #17264d;
  color: var(--text);
  padding: 11px;
  cursor: pointer;
  font-weight: 700;
  min-width: 48px;
  min-height: 44px;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.password-toggle:hover {
  border-color: #4b7fff;
}

.password-toggle[aria-pressed="true"] {
  background: #1d315f;
}

.password-toggle:focus-visible {
  outline: none;
  border-color: #7ec8ff;
  box-shadow: 0 0 0 3px rgba(126, 200, 255, 0.18);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

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

.auth-guest-bypass {
  width: 100%;
  margin-top: 8px;
}

.yap-wallet-decision {
  margin: 12px 0;
}

.yap-wallet-decision-card {
  border: 1px solid rgba(82, 104, 168, 0.72);
  border-radius: 14px;
  background: rgba(14, 23, 48, 0.86);
  padding: 14px;
}

.yap-wallet-decision-card strong {
  display: block;
  margin-bottom: 6px;
  color: #eef5ff;
}

.yap-wallet-guide {
  margin-top: 12px;
}

.yap-wallet-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.yap-wallet-download-note {
  margin: 10px 0 0;
  font-size: 0.84rem;
}

.yap-wallet-steps {
  margin: 12px 0;
  padding-left: 18px;
  color: var(--muted);
}

.yap-wallet-steps li {
  margin-bottom: 6px;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr 320px;
  min-height: 100dvh;
}

.panel {
  padding: 18px;
  background: linear-gradient(180deg, rgba(16, 25, 50, 0.95) 0%, rgba(12, 18, 37, 0.95) 100%);
  border-right: 1px solid var(--border);
  overflow: auto;
  min-width: 0;
}

.right-panel {
  border-right: none;
  border-left: 1px solid var(--border);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

h2 {
  margin: 18px 0 10px;
  font-size: 1rem;
  color: #d3dbff;
}

.subtitle,
.muted,
ol {
  color: var(--muted);
}

.palette {
  display: grid;
  gap: 8px;
}

.palette-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(17, 26, 52, 0.72);
  overflow: hidden;
}

.palette-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 600;
}

.palette-summary::marker,
.palette-summary::-webkit-details-marker {
  display: none;
}

.palette-items {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.left-panel-priority-stack {
  display: grid;
  gap: 14px;
}

.left-panel-priority-stack.is-collapsed {
  display: none;
}

.left-panel-collapse-row {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

.left-panel-collapse-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(112, 139, 214, 0.5);
  background: radial-gradient(circle at 30% 30%, rgba(90, 191, 255, 0.18), rgba(20, 31, 58, 0.98));
  color: #e8f1ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(1, 6, 19, 0.28);
}

.left-panel-collapse-glyph {
  display: inline-flex;
  transition: transform 0.18s ease;
  font-size: 0.88rem;
  line-height: 1;
}

.left-panel-collapse-toggle[aria-expanded="false"] .left-panel-collapse-glyph {
  transform: rotate(180deg);
}

.wallet-status {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(20, 30, 58, 0.42);
  font-size: 0.84rem;
  padding: 8px 44px 8px 10px;
  width: 100%;
  line-height: 1.35;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wallet-status-row {
  position: relative;
  display: block;
}

.signer-status-list {
  display: grid;
  gap: 8px;
}

.signer-hero {
  border: 1px solid rgba(91, 110, 168, 0.55);
  border-radius: 12px;
  background: rgba(16, 25, 50, 0.82);
  padding: 12px;
}

.signer-hero-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.signer-hero-ok {
  border-color: rgba(79, 195, 126, 0.6);
}

.signer-hero-warn {
  border-color: rgba(255, 194, 84, 0.6);
}

.signer-hero-danger {
  border-color: rgba(255, 121, 121, 0.6);
}

.signer-bridge-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.signer-bridge-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(80, 102, 165, 0.55);
  background: rgba(14, 22, 44, 0.68);
  font-size: 0.78rem;
  font-weight: 700;
}

.signer-bridge-chip-ok {
  border-color: rgba(79, 195, 126, 0.45);
  color: #bff7d0;
}

.signer-bridge-chip-warn {
  border-color: rgba(255, 194, 84, 0.45);
  color: #ffe0a0;
}

.signer-bridge-chip-danger {
  border-color: rgba(255, 121, 121, 0.45);
  color: #ffc3c3;
}

.signer-bridge-chip-scan {
  border-color: rgba(126, 192, 255, 0.52);
  color: #cbe5ff;
}

.signer-bridge-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #93a6db;
  box-shadow: 0 0 0 0 rgba(147, 166, 219, 0.4);
}

.signer-bridge-dot.ok {
  background: #43d59b;
}

.signer-bridge-dot.warn {
  background: #ffca69;
}

.signer-bridge-dot.danger {
  background: #ff7f8a;
}

.signer-bridge-dot.scan,
.signer-bridge-dot.scanning {
  background: #7ec0ff;
  animation: signerProbePulse 1.1s ease-in-out infinite;
}

.signer-bridge-card {
  border: 1px solid rgba(80, 102, 165, 0.45);
  border-radius: 10px;
  background: rgba(12, 20, 40, 0.5);
  padding: 10px;
  margin-bottom: 10px;
}

.signer-bridge-card-ok {
  border-color: rgba(79, 195, 126, 0.45);
}

.signer-bridge-card-warn {
  border-color: rgba(255, 194, 84, 0.45);
}

.signer-bridge-card-danger {
  border-color: rgba(255, 121, 121, 0.45);
}

.signer-bridge-card-scan {
  border-color: rgba(126, 192, 255, 0.52);
  box-shadow: inset 0 0 0 1px rgba(126, 192, 255, 0.08), 0 0 18px rgba(37, 148, 255, 0.08);
}

.signer-status-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 25, 50, 0.55);
  padding: 10px;
}

.signer-status-item strong {
  display: block;
  margin-bottom: 4px;
  color: #dce8ff;
}

.signer-status-item code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  color: #bfe6ff;
}

@keyframes signerProbePulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(126, 192, 255, 0.42);
  }
  70% {
    transform: scale(1.08);
    box-shadow: 0 0 0 10px rgba(126, 192, 255, 0);
  }
  100% {
    transform: scale(0.96);
    box-shadow: 0 0 0 0 rgba(126, 192, 255, 0);
  }
}

@keyframes signerScanSweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

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

.checklist-group {
  display: grid;
  gap: 10px;
}

.checklist-group + .checklist-group {
  margin-top: 14px;
}

.checklist-group-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8fb6ff;
}

.checklist-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 25, 50, 0.5);
  padding: 10px;
}

.checklist-item.ok {
  border-color: rgba(75, 240, 143, 0.45);
}

.checklist-item.todo {
  border-color: rgba(255, 191, 71, 0.45);
}

.checklist-item strong {
  display: block;
  margin-bottom: 4px;
}

.proof-list .checklist-item.ok {
  border-color: rgba(89, 221, 185, 0.5);
}

.proof-list .checklist-item.todo {
  border-color: rgba(255, 166, 77, 0.48);
}

.checklist-footnote {
  color: #9cb0d8;
  font-size: 0.8rem;
  line-height: 1.45;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(16, 25, 50, 0.6);
  padding: 12px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.metric-card strong {
  display: block;
  font-size: 1.05rem;
  color: #eef4ff;
}

.runner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.compile-stage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.compile-stage-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.compile-stage-pill {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(14, 23, 46, 0.72);
  padding: 12px;
  min-height: 86px;
}

.compile-stage-pill .label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a9b9df;
  margin-bottom: 6px;
}

.compile-stage-pill .state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #eef4ff;
}

.compile-stage-pill .detail {
  display: block;
  margin-top: 8px;
  color: #b7c5e8;
  font-size: 0.78rem;
  line-height: 1.45;
}

.compile-stage-pill.state-idle {
  opacity: 0.74;
}

.compile-stage-pill.state-active {
  border-color: rgba(126, 212, 255, 0.56);
  box-shadow: 0 0 0 1px rgba(126, 212, 255, 0.16), 0 0 20px rgba(82, 170, 255, 0.12);
  animation: compileStageActivePulse 0.8s ease-in-out infinite;
}

.compile-stage-pill.state-ok {
  border-color: rgba(75, 240, 143, 0.44);
}

.compile-stage-pill.state-warn {
  border-color: rgba(255, 191, 71, 0.44);
}

.compile-stage-pill.state-fail {
  border-color: rgba(255, 111, 143, 0.48);
  box-shadow: 0 0 0 1px rgba(255, 111, 143, 0.12), 0 0 18px rgba(255, 111, 143, 0.12);
}

.compile-step-list {
  display: grid;
  gap: 8px;
}

.compile-step-row {
  border: 1px solid rgba(71, 90, 142, 0.6);
  border-radius: 10px;
  background: rgba(10, 18, 39, 0.88);
  padding: 10px;
}

.compile-step-row.active {
  border-color: rgba(126, 212, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(126, 212, 255, 0.12), 0 0 14px rgba(79, 177, 255, 0.1);
  animation: compileStageActivePulse 0.75s ease-in-out infinite;
}

.compile-step-row.ok {
  border-color: rgba(75, 240, 143, 0.42);
}

.compile-step-row.warn {
  border-color: rgba(255, 191, 71, 0.44);
}

.compile-step-row.fail {
  border-color: rgba(255, 111, 143, 0.46);
}

.compile-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.compile-step-title {
  font-weight: 700;
}

.compile-step-meta {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 3px;
}

.compile-step-state {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(103, 132, 214, 0.42);
  background: rgba(18, 28, 52, 0.82);
  color: #eef4ff;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.subview-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.compile-ribbon {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(86, 103, 158, 0.44);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 24, 47, 0.92), rgba(10, 16, 30, 0.94)),
    radial-gradient(circle at top left, rgba(61, 180, 255, 0.1), transparent 42%);
}

.compile-ribbon-summary {
  font-size: 0.84rem;
  line-height: 1.45;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 26, 52, 0.9), rgba(10, 15, 31, 0.95)),
    radial-gradient(circle at top left, rgba(61, 180, 255, 0.08), transparent 45%);
  padding: 10px;
}

.line-chart {
  width: 100%;
  height: 180px;
  display: block;
}

.line-chart .chart-grid {
  stroke: rgba(149, 160, 192, 0.18);
  stroke-width: 1;
}

.line-chart .chart-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart .chart-area {
  opacity: 0.16;
}

.line-chart .chart-caption {
  fill: #dce8ff;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
}

.line-chart .chart-axis {
  stroke: rgba(223, 233, 255, 0.32);
  stroke-width: 1.2;
}

.line-chart .chart-baseline {
  stroke: rgba(255, 216, 127, 0.72);
  stroke-width: 1.4;
  stroke-dasharray: 5 5;
}

.line-chart .chart-marker {
  stroke: #091022;
  stroke-width: 2;
}

.line-chart .chart-marker.buy {
  fill: #4bf08f;
}

.line-chart .chart-marker.sell {
  fill: #ff8a8a;
}

.line-chart .chart-label {
  fill: #9fb0d9;
  font-size: 10px;
  font-family: "IBM Plex Mono", monospace;
}

.paper-performance-center {
  margin: 16px 0;
  border: 1px solid rgba(86, 103, 158, 0.5);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(9, 16, 34, 0.96), rgba(6, 11, 24, 0.98)),
    radial-gradient(circle at 12% 0%, rgba(61, 180, 255, 0.12), transparent 36%),
    radial-gradient(circle at 88% 12%, rgba(75, 240, 143, 0.1), transparent 34%);
  padding: 14px;
}

.paper-performance-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.paper-performance-head h3 {
  margin: 0 0 4px;
}

.paper-performance-head p {
  margin: 0;
}

.paper-graph-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: #b7c5f3;
  font-size: 0.76rem;
}

.paper-graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(83, 103, 160, 0.48);
  border-radius: 999px;
  background: rgba(15, 25, 49, 0.78);
  padding: 5px 8px;
}

.paper-graph-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.paper-graph-legend .btn {
  min-height: 28px;
  padding: 4px 8px;
}

.paper-graph-zoom-label {
  min-width: 70px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.legend-equity {
  background: #3db4ff;
}

.legend-buy {
  background: #4bf08f;
}

.legend-sell {
  background: #ff8a8a;
}

.paper-performance-chart-card {
  padding: 0;
  overflow: hidden;
}

.paper-performance-chart {
  height: clamp(220px, 34vh, 340px);
  cursor: zoom-in;
}

.paper-graph-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.paper-graph-stat {
  border: 1px solid rgba(74, 91, 142, 0.54);
  border-radius: 12px;
  background: rgba(13, 21, 42, 0.78);
  padding: 9px;
}

.paper-graph-stat span {
  display: block;
  color: #91a4d1;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.paper-graph-stat strong {
  color: #eef4ff;
  font-size: 0.88rem;
}

.subview-card h3 {
  margin: 10px 0 8px;
  font-size: 0.92rem;
  color: #dbe6ff;
}

.compact-log {
  min-height: 84px;
  max-height: 240px;
  margin: 0;
}

.wallet-disconnect {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 1px solid #495990;
  border-radius: 10px;
  background: #162446;
  color: #dce8ff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}

.btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  background: #182244;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  filter: brightness(1.12);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.btn.btn-scanning {
  position: relative;
  overflow: hidden;
  border-color: rgba(120, 184, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(120, 184, 255, 0.18), 0 0 18px rgba(37, 148, 255, 0.18);
}

.btn.btn-scanning::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(126, 192, 255, 0.08) 32%, rgba(46, 217, 182, 0.2) 50%, rgba(126, 192, 255, 0.08) 68%, transparent 100%);
  transform: translateX(-120%);
  animation: signerScanSweep 1.15s linear infinite;
  pointer-events: none;
}

.btn.btn-connected {
  border-color: rgba(66, 212, 156, 0.65);
  box-shadow: 0 0 0 1px rgba(66, 212, 156, 0.14), 0 0 16px rgba(66, 212, 156, 0.12);
}

.btn.compact {
  width: auto;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.btn.compact.tone-zoom {
  background: linear-gradient(180deg, rgba(23, 36, 66, 0.96), rgba(15, 24, 45, 0.96));
  border-color: rgba(113, 131, 184, 0.46);
}

.btn.compact.tone-network {
  background: linear-gradient(180deg, rgba(19, 41, 76, 0.96), rgba(15, 29, 53, 0.96));
  border-color: rgba(103, 176, 255, 0.5);
}

.btn.compact.tone-wallet {
  background: linear-gradient(180deg, rgba(18, 49, 72, 0.96), rgba(13, 36, 55, 0.96));
  border-color: rgba(63, 207, 186, 0.52);
}

.btn.compact.tone-kit {
  background: linear-gradient(180deg, rgba(40, 30, 72, 0.96), rgba(26, 19, 50, 0.96));
  border-color: rgba(171, 129, 255, 0.5);
}

.btn.compact.tone-paper {
  background: linear-gradient(180deg, rgba(40, 52, 78, 0.96), rgba(22, 34, 57, 0.96));
  border-color: rgba(125, 195, 255, 0.52);
}

.btn.compact.tone-guard {
  background: linear-gradient(180deg, rgba(69, 51, 20, 0.96), rgba(43, 30, 11, 0.96));
  border-color: rgba(242, 188, 86, 0.5);
}

.btn.compact.tone-save {
  background: linear-gradient(180deg, rgba(14, 62, 52, 0.96), rgba(10, 39, 33, 0.96));
  border-color: rgba(66, 212, 156, 0.52);
}

.btn.compact.tone-storage {
  background: linear-gradient(180deg, rgba(26, 34, 64, 0.96), rgba(17, 24, 45, 0.96));
  border-color: rgba(121, 157, 235, 0.48);
}

.btn.compact.tone-refresh {
  background: linear-gradient(180deg, rgba(21, 45, 73, 0.96), rgba(15, 31, 51, 0.96));
  border-color: rgba(90, 169, 255, 0.48);
}

.btn.compact.tone-macro {
  background: linear-gradient(180deg, rgba(48, 33, 73, 0.96), rgba(31, 20, 48, 0.96));
  border-color: rgba(181, 123, 255, 0.5);
}

.btn.compact.tone-publish {
  background: linear-gradient(135deg, rgba(28, 111, 255, 0.96), rgba(27, 200, 176, 0.96));
  border-color: rgba(139, 233, 255, 0.58);
  color: #f5fbff;
  box-shadow: 0 10px 24px rgba(16, 118, 245, 0.22);
}

.btn.compact.tone-danger {
  background: linear-gradient(180deg, rgba(97, 29, 44, 0.96), rgba(58, 19, 28, 0.96));
  border-color: rgba(231, 110, 137, 0.52);
}

.btn.tab {
  width: auto;
  padding: 7px 12px;
  background: #132042;
}

.btn.tab.active {
  border-color: #7bc8ff;
  background: #1f3c73;
}

.primary {
  background: linear-gradient(135deg, #1f8fff 0%, #17c9b4 100%);
  border: none;
}

.danger {
  background: linear-gradient(135deg, #ab3068 0%, #df4b52 100%);
  border: none;
}

.actions {
  display: grid;
  gap: 8px;
}

.runner-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.runner-badge {
  width: fit-content;
}

.runner-badge.on {
  background: rgba(38, 215, 178, 0.24);
  border-color: rgba(38, 215, 178, 0.5);
  color: #caffef;
}

.runner-badge.off {
  background: rgba(154, 178, 255, 0.14);
  border: 1px solid rgba(154, 178, 255, 0.28);
  color: #dbe4ff;
}

.runner-interval-label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.runner-interval-label input {
  width: 100%;
  border: 1px solid #3f5186;
  border-radius: 8px;
  background: #0f1b38;
  color: #edf4ff;
  padding: 8px;
  font-family: inherit;
}

.graph-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 100dvh;
}

.graph-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 17, 34, 0.8);
}

.runtime-banner {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #884545;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(104, 27, 27, 0.95) 0%, rgba(72, 17, 17, 0.95) 100%);
  color: #ffe2e2;
  font-size: 0.88rem;
  font-weight: 600;
  min-height: 40px;
  display: flex;
  align-items: center;
  white-space: normal;
  overflow-wrap: anywhere;
  contain: layout paint;
}

.runtime-banner.ok {
  border-color: #2d6657;
  background: linear-gradient(180deg, rgba(18, 69, 55, 0.95) 0%, rgba(12, 44, 35, 0.95) 100%);
  color: #d7fff4;
}

.runtime-banner.ok.warn {
  border-color: #876326;
  background: linear-gradient(180deg, rgba(93, 67, 23, 0.95) 0%, rgba(55, 39, 16, 0.95) 100%);
  color: #ffeac2;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.project-row {
  margin-top: 10px;
  justify-content: flex-start;
}

.project-status {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 27, 52, 0.6);
  padding: 8px 10px;
  line-height: 1.35;
  font-size: 0.84rem;
}

.cockpit-status-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.cockpit-card {
  min-height: 74px;
  border: 1px solid rgba(58, 72, 112, 0.78);
  border-radius: 8px;
  background: rgba(10, 16, 30, 0.82);
  padding: 10px;
  display: grid;
  gap: 3px;
  align-content: center;
  min-width: 0;
}

.cockpit-card span {
  color: #8f9bbd;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cockpit-card strong,
.cockpit-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-card strong {
  color: #f5f7ff;
  font-size: 0.98rem;
}

.cockpit-card small {
  color: #aab6d6;
  font-size: 0.75rem;
}

.cockpit-card.ok {
  border-color: rgba(38, 215, 178, 0.62);
  background: rgba(10, 35, 34, 0.86);
}

.cockpit-card.warn {
  border-color: rgba(242, 163, 65, 0.72);
  background: rgba(42, 31, 16, 0.9);
}

.cockpit-card.danger {
  border-color: rgba(240, 108, 155, 0.68);
  background: rgba(42, 18, 32, 0.9);
}

.cockpit-card.muted {
  border-color: rgba(58, 72, 112, 0.68);
  background: rgba(9, 14, 26, 0.8);
}

.sandbox-subtabs {
  margin-top: 10px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn.subtab {
  background: #132042;
}

.btn.subtab.active {
  border-color: #7bc8ff;
  background: #1f3c73;
}

.exec-mode-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.exec-mode-select {
  border: 1px solid #3f5186;
  border-radius: 8px;
  background: #0f1b38;
  color: #edf4ff;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 0.86rem;
}

.header-row.controls {
  margin-top: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.node-workbench {
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(12, 18, 34, 0.9), rgba(9, 14, 27, 0.92)),
    radial-gradient(circle at top left, rgba(61, 180, 255, 0.08), transparent 34%);
  padding: 12px 18px 14px;
}

.node-workbench-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.node-workbench-headline {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.node-workbench-actions {
  display: flex;
  gap: 8px;
}

.node-workbench-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-workbench-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(79, 98, 154, 0.44);
  border-radius: 12px;
  background: rgba(17, 26, 49, 0.94);
  cursor: pointer;
  color: #e7efff;
  text-align: left;
}

.node-workbench-tab.active {
  border-color: rgba(118, 204, 255, 0.72);
  background: linear-gradient(180deg, rgba(26, 56, 92, 0.98), rgba(17, 31, 54, 0.98));
  box-shadow: 0 0 0 1px rgba(118, 204, 255, 0.12), 0 10px 22px rgba(6, 14, 31, 0.24);
}

.node-workbench-tab-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.node-workbench-tab-title {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.node-workbench-tab-meta {
  color: #a8b9e8;
  font-size: 0.7rem;
  white-space: nowrap;
}

.node-workbench-tab-close {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1px solid rgba(111, 129, 184, 0.4);
  border-radius: 999px;
  background: rgba(13, 18, 31, 0.56);
  color: #dfe9ff;
  cursor: pointer;
}

.node-workbench-details {
  margin-top: 12px;
  border: 1px solid rgba(79, 98, 154, 0.38);
  border-radius: 14px;
  background: rgba(11, 17, 31, 0.84);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.node-workbench-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-workbench-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 30, 57, 0.92);
  border: 1px solid rgba(90, 117, 181, 0.38);
  color: #dce7ff;
  font-size: 0.76rem;
}

.node-workbench-previews {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.node-workbench-preview {
  border: 1px solid rgba(85, 103, 154, 0.3);
  border-radius: 12px;
  background: rgba(12, 18, 34, 0.7);
  padding: 10px;
}

.node-workbench-preview strong {
  display: block;
  margin-bottom: 6px;
}

.graph-header.marketplace .controls {
  display: none;
}

.graph-header.marketplace .sandbox-subtabs {
  display: none;
}

.mobile-shell-controls,
.panel-drawer-header,
.mobile-drawer-scrim {
  display: none;
}

.mobile-shell-controls {
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.mobile-shell-controls .btn[aria-pressed="true"] {
  border-color: #7bc8ff;
  background: #1f3c73;
}

.btn.compact.tool-active {
  border-color: #7bc8ff;
  background: #1f3c73;
  color: #f6fbff;
}

.panel-drawer-header {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -18px -18px 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(76, 96, 150, 0.35);
  background: linear-gradient(180deg, rgba(17, 26, 52, 0.98), rgba(12, 18, 37, 0.94));
  position: sticky;
  top: calc(-18px + env(safe-area-inset-top));
  z-index: 2;
}

.mobile-drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(2, 7, 18, 0.55);
  backdrop-filter: blur(3px);
  z-index: 215;
}

.sandbox-subview {
  padding: 18px;
}

.subview-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(13, 20, 41, 0.86);
  padding: 18px;
}

.subview-card h2 {
  margin-top: 0;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #132042;
  color: #d6e4ff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.inline-toggle input {
  accent-color: #26d7b2;
  cursor: pointer;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 8, 22, 0.72);
  backdrop-filter: blur(6px);
  z-index: 260;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  width: min(460px, 100%);
  max-height: calc(100dvh - 40px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #121d3a 0%, #0a1024 100%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-card h2 {
  margin-top: 0;
 }

.exchange-modal-card {
  width: min(760px, 100%);
}

.yap-agent-modal-card {
  width: min(720px, 100%);
}

.config-hub-modal-card {
  width: min(780px, 100%);
}

.config-hub-body {
  display: grid;
  gap: 12px;
}

.config-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.config-hub-card {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(52, 65, 101, 0.72);
  border-radius: 12px;
  background: rgba(12, 18, 32, 0.78);
  padding: 12px;
}

.config-hub-card-label,
.agent-overview-card span {
  color: #93a9de;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.config-hub-card strong {
  color: #f4f7ff;
}

.config-hub-card small {
  color: #aebbd8;
  line-height: 1.4;
}

.exchange-list {
  display: grid;
  gap: 10px;
}

.project-browser-actions {
  margin-bottom: 12px;
}

.project-browser-list {
  display: grid;
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
}

.project-browser-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(14, 22, 45, 0.86);
}

.project-browser-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.project-browser-item .actions {
  grid-template-columns: repeat(auto-fit, minmax(110px, max-content));
}

.yap-agent-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.yap-agent-summary-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(14, 22, 45, 0.86);
}

.yap-agent-summary-card.tone-ok {
  border-color: rgba(79, 195, 126, 0.45);
}

.yap-agent-summary-card.tone-warn {
  border-color: rgba(255, 216, 127, 0.42);
}

.yap-agent-summary-card.tone-danger {
  border-color: rgba(255, 150, 150, 0.4);
}

.yap-agent-summary-card.tone-scan {
  border-color: rgba(126, 192, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(126, 192, 255, 0.06), 0 0 18px rgba(37, 148, 255, 0.1);
}

.yap-agent-summary-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #93a9de;
}

.yap-agent-list {
  display: grid;
  gap: 8px;
  max-height: 54vh;
  overflow: auto;
}

.yap-agent-row {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(69, 86, 133, 0.72);
  border-radius: 12px;
  padding: 12px;
  background: rgba(9, 16, 34, 0.94);
}

.yap-agent-row.current {
  box-shadow: 0 0 0 1px rgba(59, 198, 179, 0.2), 0 0 22px rgba(39, 156, 255, 0.08);
}

.yap-agent-row.tone-ok {
  border-color: rgba(79, 195, 126, 0.4);
}

.yap-agent-row.tone-warn {
  border-color: rgba(255, 216, 127, 0.34);
}

.yap-agent-row.tone-danger {
  border-color: rgba(255, 150, 150, 0.34);
}

.yap-agent-row.tone-scan {
  border-color: rgba(126, 192, 255, 0.42);
}

.yap-agent-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.yap-agent-title-wrap {
  min-width: 0;
}

.yap-agent-name {
  font-weight: 700;
  font-size: 0.98rem;
}

.yap-agent-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  word-break: break-word;
}

.yap-agent-pills {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.yap-agent-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(99, 119, 173, 0.58);
  background: rgba(21, 32, 62, 0.82);
  color: #dce8ff;
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.yap-agent-pill.tone-ok {
  border-color: rgba(79, 195, 126, 0.5);
  color: #b7ffcc;
}

.yap-agent-pill.tone-warn {
  border-color: rgba(255, 216, 127, 0.48);
  color: #ffe3a3;
}

.yap-agent-pill.tone-danger {
  border-color: rgba(255, 150, 150, 0.48);
  color: #ffc1c1;
}

.yap-agent-pill.tone-scan {
  border-color: rgba(126, 192, 255, 0.52);
  color: #cfe5ff;
}

.yap-agent-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #c9d6fa;
  font-size: 0.78rem;
  line-height: 1.45;
}

.yap-agent-empty {
  border: 1px dashed rgba(99, 119, 173, 0.48);
  border-radius: 12px;
  padding: 16px;
  color: var(--muted);
  background: rgba(9, 16, 34, 0.7);
}

.exchange-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(180px, 1fr);
  align-items: start;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(14, 22, 45, 0.86);
}

.exchange-master-toggle {
  padding-top: 6px;
}

.exchange-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.exchange-icon,
.wallet-icon {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #445383;
  background: #17264a;
  color: #dbebff;
  font-size: 0.75rem;
  font-weight: 700;
}

.exchange-name,
.wallet-name {
  font-weight: 600;
}

.exchange-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.exchange-link-btn {
  width: auto;
  min-width: 78px;
}

.exchange-cap-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(78, 92, 145, 0.35);
}

.exchange-cap-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) auto auto minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
}

.exchange-cap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d6e4ff;
  font-size: 0.82rem;
  font-weight: 600;
}

.exchange-cap-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid #45527d;
  background: #17264a;
  font-size: 0.76rem;
  font-weight: 700;
}

.exchange-cap-status.down {
  color: #ffb4c1;
  border-color: #8d4b58;
}

.exchange-cap-status.warn {
  color: #ffe6a0;
  border-color: #8e7640;
}

.exchange-cap-status.up {
  color: #b9ffe8;
  border-color: #2d8c7a;
}

.agent-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.agent-overview-card {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(58, 72, 112, 0.68);
  border-radius: 10px;
  background: rgba(9, 14, 26, 0.8);
  padding: 10px;
}

.agent-overview-card.ok {
  border-color: rgba(38, 215, 178, 0.58);
  background: rgba(10, 35, 34, 0.76);
}

.agent-overview-card.warn {
  border-color: rgba(242, 163, 65, 0.68);
  background: rgba(42, 31, 16, 0.78);
}

.agent-overview-card.danger {
  border-color: rgba(240, 108, 155, 0.64);
  background: rgba(42, 18, 32, 0.78);
}

.agent-overview-card strong {
  color: #f4f7ff;
  font-size: 0.92rem;
}

.agent-overview-card small {
  color: #aebbd8;
  overflow-wrap: anywhere;
}

.agent-overview-meta,
.indicator-pairing-row {
  display: grid;
  gap: 8px;
}

.agent-overview-meta div,
.indicator-pairing-row {
  border: 1px solid rgba(52, 65, 101, 0.66);
  border-radius: 10px;
  background: rgba(8, 13, 25, 0.66);
  padding: 9px;
}

.agent-overview-meta div {
  display: grid;
  gap: 3px;
}

.agent-overview-meta strong {
  color: #dce7ff;
  font-size: 0.76rem;
}

.agent-overview-meta span,
.indicator-pairing-row span {
  color: #aebbd8;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.indicator-pairing-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.indicator-pairing-row.tone-paired {
  border-color: rgba(38, 215, 178, 0.58);
}

.indicator-pairing-row.tone-pending {
  border-color: rgba(242, 163, 65, 0.62);
}

.indicator-pairing-row strong {
  display: block;
  color: #f4f7ff;
}

.exchange-link-btn.repairing {
  animation: breathe 1.1s ease-in-out infinite;
}

.exchange-link-btn.down {
  background: #4b1f28;
  border-color: #8d4b58;
}

.exchange-link-btn.up {
  background: #163d3a;
  border-color: #2d8c7a;
}

@keyframes breathe {
  0% { opacity: 0.55; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0.55; transform: scale(0.98); }
}

.view-tabs {
  display: flex;
  gap: 8px;
}

.diagram-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.diagram-tab {
  width: auto;
  padding: 7px 10px;
  font-size: 0.8rem;
}

.diagram-tab.active {
  border-color: #82d9ff;
  background: #21446f;
}

.graph-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(38, 215, 178, 0.2);
  border: 1px solid rgba(38, 215, 178, 0.4);
  color: #b5ffe9;
  font-weight: 600;
  font-size: 0.9rem;
}

.graph-container {
  position: relative;
  overflow: auto;
  --grid-size: 40px;
  touch-action: pan-x pan-y;
}

.minimap-toggle {
  position: sticky;
  left: calc(100% - 74px);
  bottom: 154px;
  z-index: 8;
  width: 58px;
  min-height: 28px;
  border: 1px solid rgba(88, 210, 190, 0.56);
  border-radius: 9px;
  background: rgba(8, 13, 25, 0.9);
  color: #e8efff;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
}

.graph-minimap {
  position: sticky;
  left: calc(100% - 190px);
  bottom: 16px;
  z-index: 8;
  width: 170px;
  height: 120px;
  border: 1px solid rgba(88, 210, 190, 0.5);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(132, 147, 189, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(132, 147, 189, 0.08) 1px, transparent 1px),
    rgba(7, 12, 24, 0.92);
  background-size: 18px 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.36);
  cursor: pointer;
  overflow: hidden;
}

.minimap-node {
  position: absolute;
  width: 10px;
  height: 7px;
  border: 1px solid rgba(126, 166, 255, 0.9);
  border-radius: 3px;
  background: rgba(79, 107, 255, 0.78);
  transform: translate(-50%, -50%);
}

.minimap-node.selected {
  border-color: rgba(88, 210, 190, 0.95);
  background: rgba(88, 210, 190, 0.9);
}

.minimap-viewport {
  position: absolute;
  border: 1px solid rgba(255, 226, 160, 0.92);
  background: rgba(255, 226, 160, 0.08);
  border-radius: 4px;
}

.minimap-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: #8f9bbd;
  font-size: 0.72rem;
  font-weight: 800;
}

.grid-layer {
  position: absolute;
  inset: 0;
  background-size: var(--grid-size) var(--grid-size);
  background-image:
    linear-gradient(to right, rgba(145, 171, 255, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(145, 171, 255, 0.12) 1px, transparent 1px);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.graph-container.grid-on .grid-layer {
  opacity: 1;
}

.canvas-stage {
  position: relative;
  width: 3200px;
  height: 2200px;
  transform-origin: top left;
}

.graph-container.lasso-armed,
.graph-container.lasso-armed .nodes {
  touch-action: none;
}

.graph-container.lasso-armed .nodes {
  cursor: crosshair;
}

.edges,
.execution-edges,
.nodes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.edges,
.execution-edges {
  pointer-events: none;
}

.edges {
  z-index: 0;
}

.execution-edges {
  z-index: 1;
}

.nodes {
  z-index: 2;
}

.lasso {
  position: absolute;
  border: 1px dashed #7ac9ff;
  background: rgba(58, 132, 255, 0.16);
  pointer-events: none;
}

.hidden {
  display: none;
}

.node {
  position: absolute;
  width: 210px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(17, 25, 48, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  user-select: none;
  cursor: grab;
}

.node.selected {
  outline: 2px solid var(--accent);
}

.node.tab-open {
  box-shadow: 0 0 0 1px rgba(125, 198, 255, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.node-header {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.node.dragging {
  cursor: grabbing;
}

.node-type {
  font-size: 0.75rem;
  color: #d2defe;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 100px;
}

.node-body {
  padding: 10px;
  display: grid;
  gap: 8px;
  color: #cfdaff;
  font-size: 0.88rem;
}

.exec-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.exec-lane {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #e7eefc;
  text-align: center;
  user-select: none;
}

.exec-pin {
  width: 18px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 246, 255, 0.72);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), rgba(158, 228, 255, 0.42));
  box-shadow: 0 0 0 1px rgba(85, 135, 255, 0.08), 0 0 10px rgba(98, 195, 255, 0.12);
}

.exec-pin.out {
  background: linear-gradient(90deg, rgba(182, 238, 255, 0.38), rgba(255, 255, 255, 0.88));
}

.pin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.out-pins {
  display: flex;
  gap: 8px;
  align-items: center;
}

.in-pins {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.in-pin-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.in-pin-label {
  font-size: 0.68rem;
  color: #a9b8e6;
  user-select: none;
}

.out-pin-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.out-pin-label {
  font-size: 0.68rem;
  color: #a9b8e6;
  user-select: none;
}

.pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  font-size: 0.58rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #06111b;
  user-select: none;
}

.pin.in {
  background: #4f79ff;
}

.pin.in.connect-valid {
  box-shadow: 0 0 0 4px rgba(75, 240, 143, 0.28);
}

.pin.in.connect-invalid {
  background: #ff6f8f;
  box-shadow: 0 0 0 4px rgba(255, 111, 143, 0.25);
}

.pin.in.connect-warn {
  background: #ffbf47;
  box-shadow: 0 0 0 4px rgba(255, 191, 71, 0.22);
}

.pin.mismatch {
  animation: pinMismatch 0.35s ease-in-out;
}

.pin.out {
  background: #4bf08f;
}

.pin.active {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(38, 215, 178, 0.28);
}

.node.node-warning {
  box-shadow: 0 0 0 1px rgba(255, 191, 71, 0.8), 0 0 20px rgba(255, 191, 71, 0.22);
}

.node.run-active {
  box-shadow: 0 0 0 1px rgba(128, 214, 255, 0.8), 0 0 22px rgba(128, 214, 255, 0.4);
  animation: nodeActivePulse 0.95s ease-in-out infinite;
}

.node.run-ok {
  box-shadow: 0 0 0 1px rgba(75, 240, 143, 0.8), 0 0 22px rgba(75, 240, 143, 0.38);
  animation: nodeSuccessPulse 1.25s ease-in-out infinite;
}

.node.run-warn {
  box-shadow: 0 0 0 1px rgba(255, 191, 71, 0.9), 0 0 22px rgba(255, 191, 71, 0.38);
}

.node.run-fail {
  box-shadow: 0 0 0 1px rgba(255, 111, 143, 0.9), 0 0 24px rgba(255, 111, 143, 0.42);
}

.edge-path.edge-warning {
  stroke: #ffbf47 !important;
  stroke-dasharray: 8 6;
}

.edge-path.edge-run-active {
  stroke-dasharray: 10 6;
  animation: edgeFlow 0.8s linear infinite;
}

.edge-path.edge-run-ok {
  stroke-width: 2.3;
  filter: drop-shadow(0 0 4px rgba(75, 240, 143, 0.6));
  animation: edgeSuccessPulse 1.05s ease-in-out infinite;
}

.edge-path.edge-run-warn {
  stroke: #ffbf47 !important;
  stroke-dasharray: 6 5;
}

.edge-path.edge-run-fail {
  stroke: #ff6f8f !important;
  stroke-dasharray: 6 5;
  animation: edgeFail 0.45s steps(2, jump-none) infinite;
}

.execution-edge-path {
  stroke: rgba(242, 247, 255, 0.28);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}

.execution-edge-path.execution-edge-compiled {
  stroke: rgba(242, 247, 255, 0.44);
}

.execution-edge-path.execution-edge-warning {
  stroke: rgba(255, 191, 71, 0.8);
  stroke-dasharray: 12 8;
}

.execution-edge-path.execution-edge-run-active {
  stroke: rgba(255, 255, 255, 0.96);
  stroke-dasharray: 18 10;
  filter: drop-shadow(0 0 8px rgba(124, 220, 255, 0.8));
  animation: execEdgeFlow 0.55s linear infinite;
}

.execution-edge-path.execution-edge-run-ok {
  stroke: rgba(181, 255, 216, 0.92);
  filter: drop-shadow(0 0 7px rgba(75, 240, 143, 0.75));
  animation: edgeSuccessPulse 0.95s ease-in-out infinite;
}

.execution-edge-path.execution-edge-run-warn {
  stroke: rgba(255, 210, 120, 0.9);
  stroke-dasharray: 12 7;
}

.node-spawn-dialog {
  position: fixed;
  inset: 0;
  z-index: 280;
  pointer-events: none;
}

.node-spawn-card {
  position: absolute;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: hidden;
  border: 1px solid rgba(98, 119, 180, 0.5);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(17, 25, 47, 0.98), rgba(8, 13, 27, 0.98)),
    radial-gradient(circle at top left, rgba(61, 180, 255, 0.1), transparent 40%);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.node-spawn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 8px;
}

.node-spawn-search {
  padding: 0 14px 12px;
}

.node-spawn-results {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
  max-height: 360px;
  overflow-y: auto;
}

.node-spawn-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(82, 101, 156, 0.44);
  border-radius: 12px;
  background: rgba(14, 21, 42, 0.92);
  color: #eef4ff;
  padding: 10px 12px;
}

.node-spawn-item strong {
  font-size: 0.84rem;
}

.node-spawn-item-meta {
  color: #a8b8e2;
  font-size: 0.72rem;
}

.node-spawn-empty {
  border: 1px dashed rgba(88, 106, 164, 0.44);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
  background: rgba(10, 15, 29, 0.82);
}

.execution-edge-path.execution-edge-run-fail {
  stroke: rgba(255, 111, 143, 0.94);
  stroke-dasharray: 10 7;
  animation: edgeFail 0.45s steps(2, jump-none) infinite;
}

@keyframes pinMismatch {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  50% {
    transform: translateX(2px);
  }
  75% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes edgeFlow {
  from {
    stroke-dashoffset: 24;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes execEdgeFlow {
  from {
    stroke-dashoffset: 56;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes compileStageActivePulse {
  0% {
    transform: translateZ(0) scale(1);
  }
  50% {
    transform: translateZ(0) scale(1.012);
  }
  100% {
    transform: translateZ(0) scale(1);
  }
}

@keyframes nodeActivePulse {
  0% {
    transform: translateZ(0) scale(1);
    box-shadow: 0 0 0 1px rgba(128, 214, 255, 0.78), 0 0 18px rgba(128, 214, 255, 0.26);
  }
  50% {
    transform: translateZ(0) scale(1.01);
    box-shadow: 0 0 0 1px rgba(128, 214, 255, 0.96), 0 0 30px rgba(128, 214, 255, 0.56);
  }
  100% {
    transform: translateZ(0) scale(1);
    box-shadow: 0 0 0 1px rgba(128, 214, 255, 0.78), 0 0 18px rgba(128, 214, 255, 0.26);
  }
}

@keyframes nodeSuccessPulse {
  0% {
    transform: translateZ(0) scale(1);
    box-shadow: 0 0 0 1px rgba(75, 240, 143, 0.72), 0 0 16px rgba(75, 240, 143, 0.24);
  }
  50% {
    transform: translateZ(0) scale(1.012);
    box-shadow: 0 0 0 1px rgba(75, 240, 143, 0.95), 0 0 30px rgba(75, 240, 143, 0.54);
  }
  100% {
    transform: translateZ(0) scale(1);
    box-shadow: 0 0 0 1px rgba(75, 240, 143, 0.72), 0 0 16px rgba(75, 240, 143, 0.24);
  }
}

@keyframes edgeSuccessPulse {
  0% {
    stroke-width: 2.1;
    opacity: 0.78;
    filter: drop-shadow(0 0 2px rgba(75, 240, 143, 0.38));
  }
  50% {
    stroke-width: 2.8;
    opacity: 1;
    filter: drop-shadow(0 0 7px rgba(75, 240, 143, 0.8));
  }
  100% {
    stroke-width: 2.1;
    opacity: 0.78;
    filter: drop-shadow(0 0 2px rgba(75, 240, 143, 0.38));
  }
}

@keyframes edgeFail {
  0% {
    opacity: 0.45;
  }
  100% {
    opacity: 1;
  }
}

.inspector {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: rgba(20, 30, 58, 0.65);
  min-height: 110px;
}

.inspector.inspector-scanning {
  border-color: rgba(126, 192, 255, 0.62);
  box-shadow: 0 0 0 1px rgba(126, 192, 255, 0.08), 0 0 24px rgba(37, 148, 255, 0.12);
}

.inspector.inspector-live {
  border-color: rgba(79, 195, 126, 0.5);
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.inspector label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.82rem;
  color: #b7c5f3;
}

.inspector input {
  width: 100%;
  margin-top: 5px;
  border: 1px solid #41507e;
  border-radius: 8px;
  background: #0e1630;
  color: white;
  padding: 8px;
  font-family: "IBM Plex Mono", monospace;
}

.inspector select {
  width: 100%;
  margin-top: 5px;
  border: 1px solid #41507e;
  border-radius: 8px;
  background: #0e1630;
  color: white;
  padding: 8px;
  font-family: "IBM Plex Mono", monospace;
}

.log {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0a1025;
  color: #d8e8ff;
  padding: 10px;
  min-height: 220px;
  max-height: 42vh;
  overflow: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.log-follow-toggle {
  min-width: 88px;
}

.log.log-paused {
  border-color: rgba(255, 184, 104, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 104, 0.12);
}

.health-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 16, 37, 0.9);
  padding: 10px;
  min-height: 90px;
  max-height: 28vh;
  overflow: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  line-height: 1.45;
}

.health-row {
  border-bottom: 1px solid rgba(85, 103, 153, 0.35);
  padding: 10px 0 12px;
}

.health-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.health-row-title {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.health-row-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  margin-top: 10px;
}

.health-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 220px;
}

.health-row-select {
  min-width: 136px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #41507e;
  background: #0e1630;
  color: white;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.health-row-meta {
  color: var(--muted);
  margin-top: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: normal;
}

.stream-chart-card {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(75, 96, 153, 0.44);
  border-radius: 8px;
  background: rgba(8, 14, 29, 0.72);
  padding: 8px;
}

.stream-chart-card-minimal {
  padding-top: 10px;
}

.stream-chart-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 4px;
  color: #edf4ff;
}

.stream-chart-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-chart-meta {
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: normal;
}

.stream-chart-window {
  border: 1px solid rgba(93, 122, 191, 0.62);
  border-radius: 999px;
  color: #9eb7ff;
  font-size: 0.7rem;
  padding: 2px 7px;
  flex: 0 0 auto;
}

.stream-mini-chart {
  display: block;
  width: 100%;
  height: 92px;
}

.stream-chart-axis {
  stroke: #ff4545;
  stroke-width: 2;
}

.stream-chart-path {
  fill: none;
  stroke: #1b55ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stream-chart-dot {
  fill: #1b55ff;
  stroke: rgba(237, 244, 255, 0.65);
  stroke-width: 1;
}

.stream-chart-empty,
.stream-chart-meta {
  color: var(--muted);
  fill: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
}

.health-row-action {
  flex-shrink: 0;
}

.stream-reset-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(232, 221, 210, 0.28);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.stream-reset-btn::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(232, 221, 210, 0.72);
  border-right-color: transparent;
  border-radius: 999px;
}

.stream-reset-btn::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 6px;
  width: 0;
  height: 0;
  border-left: 5px solid rgba(232, 221, 210, 0.82);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transform: rotate(34deg);
}

.stream-reset-btn:hover,
.stream-reset-btn:focus-visible {
  border-color: rgba(255, 179, 89, 0.72);
  background: rgba(255, 179, 89, 0.1);
}

.stream-reset-btn.needs-manual {
  border-color: rgba(255, 91, 85, 0.75);
  background: rgba(255, 91, 85, 0.12);
}

.stream-reset-btn.is-spinning::before {
  animation: spin 0.8s linear infinite;
}

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

.health-summary {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.health-row:last-child {
  border-bottom: none;
}

.health-warn {
  color: #ffd87f;
}

.health-danger {
  color: #ff9696;
}

.marketplace {
  padding: 14px;
  overflow: auto;
}

.market-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.market-controls label {
  color: #b7c5f3;
  font-size: 0.82rem;
}

.market-controls select {
  display: block;
  min-width: 150px;
  margin-top: 5px;
  background: #0f1a35;
  color: #ecf4ff;
  border: 1px solid #3b4d7f;
  border-radius: 8px;
  padding: 5px;
}

.market-filter-summary {
  color: #a9b8df;
  font-size: 0.82rem;
  margin-left: auto;
  padding-bottom: 6px;
}

.market-empty {
  border: 1px dashed rgba(98, 124, 196, 0.55);
  border-radius: 10px;
  color: #b7c5f3;
  background: rgba(13, 22, 43, 0.72);
  padding: 18px;
}

.market-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.market-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(14, 22, 45, 0.88);
  padding: 12px;
}

.market-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.market-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.market-card .meta {
  color: #a9b8df;
  margin: 7px 0;
  font-size: 0.84rem;
}

.market-card .desc {
  margin: 0;
  color: #dce6ff;
}

.market-card .facts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.market-card .fact-row {
  color: #c8d7fb;
  font-size: 0.82rem;
}

.market-card .fact-row strong {
  color: #f2f6ff;
}

.market-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.tag-chip {
  border: 1px solid #3f4f7d;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  color: #dbe7ff;
  background: rgba(25, 40, 76, 0.7);
}

.wallet-choice-help {
  margin-top: 12px;
  margin-bottom: 10px;
  min-height: 78px;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid rgba(76, 96, 150, 0.55);
  border-radius: 12px;
  background: rgba(17, 26, 48, 0.65);
}

.tag-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 260px;
  overflow: auto;
}

.tag-option {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(16, 25, 50, 0.65);
  padding: 8px 10px;
}

.tag-option input {
  margin: 0;
}

ol {
  padding-left: 18px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .mobile-shell-controls {
    display: flex;
  }

  .panel-drawer-header {
    display: flex;
  }

  .graph-panel {
    min-height: 100dvh;
  }

  .panel {
    position: fixed;
    top: 0;
    bottom: 0;
    width: min(360px, 86vw);
    max-width: 86vw;
    z-index: 220;
    padding:
      calc(16px + env(safe-area-inset-top))
      16px
      calc(22px + env(safe-area-inset-bottom))
      16px;
    border: 0;
    transform: translateX(-108%);
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .left-panel {
    left: 0;
    border-right: 1px solid var(--border);
  }

  .right-panel {
    right: 0;
    left: auto;
    border-left: 1px solid var(--border);
    transform: translateX(108%);
  }

  .app-shell.mobile-left-open .left-panel {
    transform: translateX(0);
  }

  .app-shell.mobile-right-open .right-panel {
    transform: translateX(0);
  }

  .mobile-drawer-scrim.active {
    display: block;
  }

  .graph-container {
    min-height: calc(100dvh - 270px);
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .market-list {
    max-height: 58vh;
  }

  .yap-agent-row-top {
    flex-direction: column;
  }

  .yap-agent-pills {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .splash-screen,
  .modal-overlay {
    place-items: start center;
    padding:
      calc(12px + env(safe-area-inset-top))
      12px
      calc(18px + env(safe-area-inset-bottom));
  }

  .splash-card,
  .modal-card {
    width: min(100%, 640px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 20px;
  }

  .auth-onboarding-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .paper-performance-head {
    flex-direction: column;
  }

  .paper-graph-legend {
    justify-content: flex-start;
  }

  .paper-performance-chart {
    height: 220px;
  }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .panel {
    width: min(360px, 46vw);
    max-width: 46vw;
  }

  .graph-panel {
    min-height: 100dvh;
  }

  .mobile-shell-controls,
  .sandbox-subtabs,
  .workflow-hero-actions,
  .view-tabs,
  .header-row.controls,
  .diagram-tabs {
    scroll-padding-inline: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-shell-controls,
  .sandbox-subtabs {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
  }

  .mobile-shell-controls .btn,
  .sandbox-subtabs .btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .workflow-hero-actions {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
  }

  .view-tabs {
    flex: 0 0 auto;
  }

  .project-row,
  .compile-ribbon,
  .diagram-tabs,
  .header-row.controls {
    margin-top: 8px;
  }

  .graph-container {
    min-height: max(190px, calc(100dvh - 440px));
  }
}

/* Focused Yap shell refresh */
:root {
  --bg: #050812;
  --bg-soft: #0a1020;
  --panel: #0c1324;
  --panel-strong: #111a31;
  --surface: #0f1729;
  --surface-soft: #131d35;
  --text: #f4f7ff;
  --muted: #9aa8c7;
  --accent: #4f6bff;
  --accent-strong: #627bff;
  --data: #2ec9d3;
  --model: #d58b45;
  --decision: #e26697;
  --logic: #d6b64b;
  --trade: #65c979;
  --bot: #77a8ff;
  --wallet: #49d0b6;
  --macro: #a679ff;
  --border: #202a44;
  --border-strong: #344161;
}

body {
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(11, 16, 31, 0.98), rgba(5, 8, 18, 1)),
    #050812;
}

.app-shell {
  grid-template-columns: 76px 286px minmax(0, 1fr) 324px;
  min-height: 100dvh;
  background:
    linear-gradient(90deg, rgba(81, 107, 255, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(16, 24, 44, 0.72), rgba(5, 8, 18, 1));
}

.app-shell.nav-collapsed {
  grid-template-columns: 48px 286px minmax(0, 1fr) 324px;
}

.app-shell.nav-collapsed .app-nav {
  padding-inline: 6px;
}

.app-shell.nav-collapsed .nav-item,
.app-shell.nav-collapsed .nav-mini-action,
.app-shell.nav-collapsed .nav-user span:last-child,
.app-shell.nav-collapsed .nav-brand-word,
.app-shell.nav-collapsed .nav-quick-start span {
  font-size: 0;
}

.app-shell.nav-collapsed .nav-item {
  min-height: 40px;
}

.app-shell.nav-collapsed .nav-quick-start {
  padding: 8px 4px;
}

.app-nav {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 14px;
  padding: 16px 10px;
  background: rgba(6, 10, 20, 0.96);
  border-right: 1px solid rgba(53, 64, 96, 0.7);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
  z-index: 30;
}

.nav-brand {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: #f8fbff;
  font-weight: 800;
}

.nav-brand-mark,
.nav-avatar {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #6f7dff, #35d2bb);
  color: #050812;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(50, 93, 255, 0.26);
}

.nav-brand-word,
.nav-user span:last-child,
.nav-quick-start span {
  font-size: 0.72rem;
  color: #dce5ff;
}

.nav-collapse-toggle {
  width: 100%;
  min-height: 24px;
  border: 1px solid rgba(70, 84, 130, 0.72);
  border-radius: 8px;
  background: rgba(18, 27, 49, 0.86);
  color: #cbd7ff;
  font-family: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  cursor: pointer;
}

.app-shell.nav-collapsed .nav-collapse-toggle {
  font-size: 0;
}

.app-shell.nav-collapsed .nav-collapse-toggle::before {
  content: ">";
  font-size: 0.72rem;
}

.nav-group {
  display: grid;
  align-content: start;
  gap: 5px;
}

.nav-item,
.nav-mini-action,
.nav-user {
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-item {
  width: 100%;
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 4px;
  border-radius: 12px;
  background: transparent;
  color: #8997b8;
  font-size: 0.64rem;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(79, 107, 255, 0.14);
  color: #f6f8ff;
}

.nav-dot {
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 1px solid rgba(139, 154, 194, 0.34);
  background: rgba(18, 27, 49, 0.8);
}

.nav-item.active .nav-dot {
  border-color: rgba(91, 217, 194, 0.72);
  background: linear-gradient(145deg, rgba(79, 107, 255, 0.92), rgba(53, 210, 187, 0.72));
}

.nav-quick-start {
  display: grid;
  gap: 7px;
  padding: 10px 6px;
  border: 1px solid rgba(57, 70, 108, 0.62);
  border-radius: 14px;
  background: rgba(12, 18, 32, 0.78);
}

.nav-mini-action,
.nav-user {
  min-height: 32px;
  border-radius: 10px;
  background: rgba(18, 27, 49, 0.86);
  color: #dbe5ff;
  font-size: 0.68rem;
  font-weight: 700;
}

.nav-mini-action:hover,
.nav-user:hover {
  background: rgba(79, 107, 255, 0.18);
}

.nav-user {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 8px 4px;
}

.nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.panel {
  padding: 18px 16px;
  background: rgba(9, 14, 26, 0.94);
  border-color: rgba(45, 56, 86, 0.78);
  scrollbar-color: #3a4563 transparent;
}

.left-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(44, 54, 82, 0.76);
}

.right-panel {
  border-left: 1px solid rgba(44, 54, 82, 0.76);
  background: rgba(9, 14, 25, 0.96);
}

.left-panel h1,
.workflow-title-block h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.1;
}

.left-panel .subtitle,
.workflow-subtitle {
  margin: 5px 0 0;
  color: #91a0bf;
  font-size: 0.82rem;
}

.left-panel section,
.right-panel section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(45, 56, 86, 0.55);
}

.left-panel section:last-child,
.right-panel section:last-child {
  border-bottom: 0;
}

.left-panel h2,
.right-panel h2 {
  margin: 0 0 10px;
  color: #dbe4f8;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-landmarks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.panel-landmarks button {
  border: 1px solid rgba(58, 72, 112, 0.68);
  border-radius: 999px;
  background: rgba(16, 24, 43, 0.82);
  color: #dce7ff;
  padding: 5px 8px;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 800;
  cursor: pointer;
}

.panel-landmarks button:hover {
  border-color: rgba(88, 210, 190, 0.8);
  background: rgba(24, 39, 67, 0.94);
}

.how-it-works-panel {
  display: none;
}

.wallet-status {
  border-color: rgba(53, 66, 104, 0.72);
  border-radius: 12px;
  background: rgba(13, 20, 37, 0.78);
  color: #aebbd8;
}

.left-panel-priority-stack {
  gap: 8px;
  margin-top: 14px;
  order: 5;
}

.palette-section {
  order: 2;
}

.left-panel-collapse-row {
  order: 5;
}

.agent-actions-section {
  order: 6;
}

.left-panel-priority-stack .inspector,
.right-panel .inspector,
.log,
.health-list,
.health-summary {
  border-color: rgba(52, 65, 101, 0.72);
  border-radius: 12px;
  background: rgba(12, 18, 32, 0.76);
}

.node-search-label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: #93a2c2;
  font-size: 0.78rem;
  font-weight: 700;
}

.node-search-label input {
  width: 100%;
  border: 1px solid rgba(55, 69, 110, 0.86);
  border-radius: 10px;
  background: #080d1a;
  color: #f4f7ff;
  padding: 10px 11px;
  font-family: inherit;
  outline: none;
}

.node-search-label input:focus {
  border-color: rgba(88, 210, 190, 0.8);
  box-shadow: 0 0 0 3px rgba(88, 210, 190, 0.12);
}

.palette {
  gap: 9px;
}

.palette-group {
  border-color: rgba(48, 60, 96, 0.72);
  border-radius: 10px;
  background: rgba(12, 18, 32, 0.72);
}

.palette-summary {
  padding: 10px 11px;
  color: #edf3ff;
  font-size: 0.84rem;
}

.palette-summary span:last-child {
  color: #7dd8c7;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
}

.palette-items {
  gap: 8px;
  padding: 0 9px 10px;
}

.palette-items .btn {
  width: 100%;
  justify-content: flex-start;
  border-radius: 9px;
  background: rgba(16, 24, 43, 0.86);
  color: #dfe8ff;
  box-shadow: none;
}

.palette-empty {
  padding: 12px;
  border: 1px dashed rgba(68, 82, 124, 0.74);
  border-radius: 10px;
  background: rgba(10, 16, 29, 0.68);
}

.runner-controls {
  border-color: rgba(48, 60, 96, 0.68);
  background: rgba(12, 18, 32, 0.58);
}

.graph-panel {
  min-height: 100dvh;
  background: #070b15;
  overflow: hidden;
}

.graph-header {
  padding: 16px 18px 12px;
  background: rgba(7, 11, 21, 0.9);
  border-bottom: 1px solid rgba(45, 56, 86, 0.76);
  backdrop-filter: blur(12px);
  min-width: 0;
  overflow: hidden;
  z-index: 20;
}

.graph-header > * {
  max-width: 100%;
  min-width: 0;
}

.runtime-banner {
  width: 100%;
  line-height: 1.4;
}

.compile-ribbon {
  overflow-x: auto;
}

.config-hub-rail {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.config-hub-button {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(58, 72, 112, 0.74);
  border-radius: 10px;
  background: rgba(12, 18, 32, 0.82);
  color: #e8efff;
  padding: 7px 10px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.config-hub-button:hover {
  border-color: rgba(88, 210, 190, 0.82);
  background: rgba(20, 31, 56, 0.96);
}

.config-hub-icon {
  width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(88, 210, 190, 0.46);
  border-radius: 8px;
  background: rgba(7, 13, 26, 0.88);
  color: #9ff4e2;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
}

.workflow-hero-row {
  align-items: flex-start;
}

.workflow-title-block {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.project-switcher {
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(58, 72, 112, 0.74);
  border-radius: 999px;
  background: rgba(12, 18, 32, 0.78);
  color: #dfe7ff;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.project-switcher strong {
  border-radius: 999px;
  background: rgba(79, 107, 255, 0.18);
  color: #bfc9ff;
  padding: 2px 8px;
  font-size: 0.7rem;
}

.workflow-hero-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.exec-mode-wrap {
  gap: 6px;
}

.exec-mode-wrap label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exec-mode-select,
.wallet-input-label input,
.wallet-input-label textarea,
.wallet-input-label select,
.inspector input,
.inspector select,
.runner-interval-label input {
  border-color: rgba(55, 69, 110, 0.86);
  border-radius: 9px;
  background: #080d1a;
  color: #f5f7ff;
}

.view-tabs {
  border: 1px solid rgba(58, 72, 112, 0.74);
  border-radius: 12px;
  background: rgba(12, 18, 32, 0.82);
  padding: 3px;
}

.view-tabs .btn.tab {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9ca9c8;
}

.view-tabs .btn.tab.active {
  background: rgba(79, 107, 255, 0.94);
  color: #ffffff;
}

.project-row {
  margin-top: 12px;
}

.project-status {
  border-color: rgba(48, 60, 96, 0.62);
  border-radius: 10px;
  background: rgba(12, 18, 32, 0.58);
}

.compile-ribbon {
  border-color: rgba(48, 60, 96, 0.58);
  border-radius: 12px;
  background: rgba(11, 17, 31, 0.58);
}

.sandbox-subtabs {
  gap: 6px;
  margin-top: 12px;
  border-bottom: 1px solid rgba(48, 60, 96, 0.62);
  padding-bottom: 9px;
}

.btn.subtab {
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #9ca9c8;
}

.btn.subtab.active {
  background: rgba(79, 107, 255, 0.18);
  color: #ffffff;
  box-shadow: inset 0 -2px 0 rgba(88, 210, 190, 0.96);
}

.diagram-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
}

.diagram-tab,
.header-row.controls .btn,
.inline-toggle,
.btn.compact {
  min-height: 34px;
  border-radius: 9px;
}

.header-row.controls {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: #3c496a rgba(9, 14, 26, 0.5);
}

#headerControls {
  border: 1px solid rgba(48, 60, 96, 0.56);
  border-radius: 12px;
  background: rgba(9, 14, 26, 0.58);
  padding: 8px;
}

#headerControls::-webkit-scrollbar,
.header-row.controls::-webkit-scrollbar,
.diagram-tabs::-webkit-scrollbar {
  height: 8px;
}

#headerControls::-webkit-scrollbar-track,
.header-row.controls::-webkit-scrollbar-track,
.diagram-tabs::-webkit-scrollbar-track {
  background: rgba(9, 14, 26, 0.5);
  border-radius: 999px;
}

#headerControls::-webkit-scrollbar-thumb,
.header-row.controls::-webkit-scrollbar-thumb,
.diagram-tabs::-webkit-scrollbar-thumb {
  background: #3c496a;
  border-radius: 999px;
}

.header-row.controls .btn,
.header-row.controls .inline-toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}

.btn {
  border-color: rgba(58, 72, 112, 0.78);
  border-radius: 10px;
  background: rgba(17, 25, 44, 0.84);
  color: #e6edff;
}

.btn:hover {
  border-color: rgba(104, 126, 255, 0.86);
  background: rgba(26, 37, 65, 0.92);
}

.btn.primary,
.tone-publish {
  border-color: rgba(86, 111, 255, 0.86);
  background: linear-gradient(180deg, #5b6dff, #4055d9);
  color: #ffffff;
}

.graph-container {
  background:
    linear-gradient(90deg, rgba(104, 126, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(104, 126, 255, 0.03) 1px, transparent 1px),
    #070b15;
  background-size: 48px 48px;
}

.grid-layer {
  background-image:
    linear-gradient(to right, rgba(132, 147, 189, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(132, 147, 189, 0.08) 1px, transparent 1px);
}

.node {
  width: 214px;
  border-color: rgba(66, 79, 121, 0.9);
  border-radius: 9px;
  background: rgba(12, 18, 32, 0.96);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34);
}

.node.selected {
  outline: 2px solid rgba(88, 210, 190, 0.96);
  box-shadow: 0 0 0 4px rgba(88, 210, 190, 0.12), 0 18px 38px rgba(0, 0, 0, 0.34);
}

.node-header {
  border-bottom-color: rgba(52, 65, 101, 0.72);
}

.node-type {
  background: rgba(79, 107, 255, 0.16);
  color: #c8d4ff;
}

.pin {
  border-color: rgba(11, 16, 31, 0.88);
  box-shadow: 0 0 0 2px rgba(88, 210, 190, 0.16);
}

.edge-line {
  stroke-width: 2;
}

.right-panel .panel-drawer-header strong,
.right-panel h2:first-child {
  color: #eef3ff;
}

.inspector {
  min-height: 96px;
}

.log {
  background: #070b15;
}

.metric-card,
.subview-card,
.chart-card,
.market-card,
.project-browser-item,
.yap-agent-summary-card,
.signer-status-item,
.signer-bridge-card {
  border-color: rgba(52, 65, 101, 0.72);
  border-radius: 12px;
  background: rgba(12, 18, 32, 0.74);
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 72px 270px minmax(0, 1fr) 310px;
  }

  .app-shell.nav-collapsed {
    grid-template-columns: 48px 270px minmax(0, 1fr) 310px;
  }

  .cockpit-status-bar {
    grid-template-columns: repeat(3, minmax(132px, 1fr));
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-nav {
    display: none;
  }

  .workflow-hero-row,
  .workflow-hero-actions {
    align-items: stretch;
  }

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

  .workflow-hero-row {
    flex-direction: column;
  }

  .workflow-hero-actions {
    justify-content: flex-start;
  }

  .header-row.controls {
    flex-wrap: nowrap;
  }
}

@media (max-width: 720px) {
  .graph-header {
    padding: 12px;
  }

  .workflow-title-block h1 {
    font-size: 1.18rem;
  }

  .project-switcher,
  .view-tabs,
  .workflow-hero-actions {
    width: 100%;
  }

  .workflow-hero-actions {
    display: grid;
  }
}

@media (max-width: 1100px) and (orientation: landscape) {
  .graph-header {
    max-height: min(76dvh, 440px);
    padding: 12px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
  }
}

/* Anchored workbench shell */
html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100dvh;
  overflow: hidden;
}

.app-shell {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  grid-template-columns: 76px minmax(278px, 18vw) minmax(0, 1fr) minmax(314px, 19vw);
}

.app-shell.nav-collapsed {
  grid-template-columns: 48px minmax(278px, 18vw) minmax(0, 1fr) minmax(314px, 19vw);
}

.app-nav,
.panel {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.app-nav::-webkit-scrollbar,
.panel::-webkit-scrollbar,
.graph-header::-webkit-scrollbar,
.graph-container::-webkit-scrollbar,
.sandbox-subview::-webkit-scrollbar,
.marketplace::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.app-nav::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track,
.graph-header::-webkit-scrollbar-track,
.graph-container::-webkit-scrollbar-track,
.sandbox-subview::-webkit-scrollbar-track,
.marketplace::-webkit-scrollbar-track {
  background: rgba(5, 8, 18, 0.72);
}

.app-nav::-webkit-scrollbar-thumb,
.graph-header::-webkit-scrollbar-thumb,
.graph-container::-webkit-scrollbar-thumb,
.sandbox-subview::-webkit-scrollbar-thumb,
.marketplace::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(104, 126, 255, 0.52);
}

.left-panel {
  padding-right: 28px;
  scrollbar-color: #ffd83d rgba(5, 8, 18, 0.72);
}

.right-panel {
  padding-left: 30px;
  scrollbar-color: #ff1f4f rgba(5, 8, 18, 0.72);
}

.left-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #ffd83d;
}

.right-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #ff1f4f;
}

.panel-landmarks {
  position: sticky;
  top: 74px;
  z-index: 12;
  width: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin: 0 -18px 10px auto;
  padding: 4px 0;
}

.right-panel .panel-landmarks {
  margin: 0 auto 10px -22px;
}

.panel-landmarks button {
  width: 24px;
  height: 8px;
  min-height: 8px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  color: transparent;
  font-size: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.left-panel .panel-landmarks button {
  background: #ffd83d;
}

.right-panel .panel-landmarks button {
  background: #ff1f4f;
}

.panel-landmarks button:hover,
.panel-landmarks button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 3px;
}

.graph-panel {
  height: 100dvh;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.graph-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(38dvh, 342px);
  min-height: 0;
  padding: 10px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.runtime-banner {
  min-height: 30px;
  margin: 0;
  padding: 6px 10px;
  font-size: 0.76rem;
}

.top-command-rail {
  min-width: 0;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) auto auto minmax(292px, 1fr);
  align-items: center;
  gap: 8px;
  padding-bottom: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(104, 126, 255, 0.52) transparent;
}

.top-command-rail::-webkit-scrollbar {
  height: 8px;
}

.top-command-rail::-webkit-scrollbar-track {
  background: transparent;
}

.top-command-rail::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(104, 126, 255, 0.52);
}

.top-agent-pill,
.top-file-actions,
.top-mode-actions,
.top-hub-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.top-agent-pill {
  min-height: 40px;
  border: 1px solid rgba(62, 74, 112, 0.8);
  border-radius: 7px;
  background: #b7b9bc;
  color: #060a13;
  padding: 5px 8px;
  font-weight: 900;
}

.top-agent-mark {
  width: 20px;
  height: 28px;
  border-radius: 10px 10px 6px 6px;
  background: #02040a;
  position: relative;
  flex: 0 0 auto;
}

.top-agent-mark::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  right: -2px;
  top: -3px;
  border-radius: 999px;
  background: #02040a;
}

.top-agent-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-agent-caret {
  font-family: "IBM Plex Mono", monospace;
}

.top-guest-chip {
  border-radius: 999px;
  background: #ffdf3f;
  color: #070a12;
  padding: 2px 6px;
  font-size: 0.68rem;
  font-weight: 900;
}

.top-file-actions,
.top-mode-actions,
.top-hub-actions {
  flex-wrap: nowrap;
  overflow: visible;
}

.top-icon-button,
.top-mode-button,
.top-deploy-button,
.top-hub-button {
  height: 40px;
  min-width: 46px;
  flex: 0 0 auto;
  border: 1px solid rgba(16, 20, 35, 0.6);
  border-radius: 6px;
  background: #a9abb0;
  color: #05070c;
  padding: 0 10px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}

.top-icon-button {
  width: 44px;
  padding: 0 6px;
  font-size: 0.68rem;
}

.top-confirm-button {
  width: 42px;
  background: #65a955;
  color: #f7fff4;
}

.top-confirm-button.danger {
  background: #ec3155;
  color: #ffffff;
}

.top-mode-button.active,
.top-mode-button[aria-pressed="true"] {
  background: #641dff;
  color: #ffffff;
}

.top-deploy-button {
  min-width: 86px;
  border-radius: 999px;
  background: #b6b7bb;
  font-size: 0.95rem;
}

.top-hub-button {
  width: 48px;
  padding: 0 6px;
  border-radius: 5px;
  background: #b4b5b8;
  font-size: 0.66rem;
}

.top-bot-button {
  border-color: rgba(220, 126, 255, 0.96);
  background: #121a33;
  color: #9ff4ff;
  box-shadow: 0 0 0 3px rgba(196, 101, 255, 0.26);
}

.top-icon-button:disabled,
.top-mode-button:disabled,
.top-deploy-button:disabled,
.top-hub-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.workflow-hero-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.workflow-title-block {
  gap: 4px;
}

.workflow-title-block .project-switcher {
  display: none;
}

.workflow-title-block h1 {
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
}

.workflow-subtitle {
  font-size: 0.78rem;
}

.workflow-hero-actions {
  align-items: center;
}

.project-row,
.cockpit-status-bar,
.config-hub-rail,
.compile-ribbon,
.sandbox-subtabs,
.diagram-tabs,
.header-row.controls {
  margin-top: 0;
}

#configHubRail {
  display: none;
}

.project-status {
  padding: 5px 8px;
  font-size: 0.76rem;
}

.cockpit-status-bar {
  grid-template-columns: repeat(5, minmax(118px, 1fr));
  gap: 6px;
}

.cockpit-card {
  min-height: 54px;
  border-radius: 7px;
  padding: 7px 8px;
  gap: 1px;
}

.cockpit-card span {
  font-size: 0.6rem;
  letter-spacing: 0;
}

.cockpit-card strong {
  font-size: 0.88rem;
}

.cockpit-card small {
  font-size: 0.68rem;
}

.compile-ribbon {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 2fr);
  align-items: center;
  gap: 8px;
  padding: 6px;
}

.compile-ribbon-summary {
  font-size: 0.76rem;
}

.compile-stage-grid.compact {
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 6px;
}

.compile-stage-pill {
  min-height: 48px;
  padding: 6px 7px;
}

.compile-stage-pill .label,
.compile-stage-pill .state {
  font-size: 0.66rem;
}

.compile-stage-pill .detail {
  display: none;
}

.sandbox-subtabs {
  padding-bottom: 5px;
}

.btn.subtab,
.diagram-tab,
.header-row.controls .btn,
.inline-toggle,
.btn.compact {
  min-height: 30px;
}

#headerControls {
  max-height: 44px;
  padding: 5px;
}

.graph-container,
.sandbox-subview,
.marketplace {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.graph-container {
  border: 2px solid rgba(120, 44, 255, 0.82);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(120, 44, 255, 0.2);
  scrollbar-color: rgba(120, 44, 255, 0.76) rgba(5, 8, 18, 0.72);
}

.graph-container::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(120, 44, 255, 0.76);
}

.minimap-toggle,
.graph-minimap {
  position: absolute;
  left: auto;
  z-index: 18;
}

.minimap-toggle {
  right: 16px;
  bottom: 148px;
}

.graph-minimap {
  right: 16px;
  bottom: 16px;
}

.canvas-stage {
  min-width: 2600px;
  min-height: 1500px;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 72px 270px minmax(0, 1fr) 306px;
  }

  .app-shell.nav-collapsed {
    grid-template-columns: 48px 270px minmax(0, 1fr) 306px;
  }

  .top-command-rail {
    grid-template-columns: minmax(210px, 0.9fr) auto auto minmax(260px, 1fr);
  }

  .cockpit-status-bar {
    grid-template-columns: repeat(5, minmax(108px, 1fr));
  }
}

@media (max-width: 1100px) {
  body {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .graph-panel {
    height: 100dvh;
  }

  .graph-header {
    max-height: min(48dvh, 390px);
  }

  .top-command-rail {
    grid-template-columns: minmax(220px, auto) auto auto minmax(260px, auto);
  }

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

  .panel {
    height: 100dvh;
    max-height: 100dvh;
  }

  .graph-container {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .graph-header {
    max-height: min(55dvh, 430px);
    padding: 10px;
  }

  .top-command-rail {
    min-height: 46px;
  }

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

  .compile-ribbon {
    grid-template-columns: 1fr;
  }

  .compile-stage-grid.compact {
    grid-template-columns: repeat(5, minmax(78px, 1fr));
    overflow-x: auto;
  }
}
