:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #030303;
  --panel: #050505;
  --panel-hi: #0a0a0f;
  --border: #575757;
  --border-soft: #303030;
  --text: #d8d8d8;
  --text-hi: #ffffff;
  --muted: #8a8a8a;
  --blue: #0055ff;
  --blue-soft: #0b0b28;
  --blue-mid: #1f64ff;
  --green: #7dff9a;
  --amber: #ffd166;
  --red: #ff6b7d;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-width: 320px;
  height: 100%;
  margin: 0;
  padding: 12px;
  overflow: hidden;
  background:
    linear-gradient(rgba(0, 85, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 85, 255, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 16px 16px;
  color: var(--text);
  font-family: var(--mono);
  line-height: 1.35;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.88), transparent 16%, transparent 84%, rgba(0, 0, 0, 0.88)),
    linear-gradient(180deg, #000000 0%, #030305 50%, #000000 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.035) 1px,
    transparent 1px,
    transparent 5px
  );
  opacity: 0.18;
}

.terminal-shell {
  width: min(1420px, 100%);
  height: 100%;
  margin: 0 auto;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.96);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px #000000,
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 48px rgba(0, 85, 255, 0.08);
}

.shell-banner {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(280px, 1fr);
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border-soft);
}

.logo-frame,
.node-status {
  background: #000000;
}

.logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  padding: 6px 8px;
  text-decoration: none;
  overflow: hidden;
}

.brand-image {
  display: block;
  width: 100%;
  max-height: 88px;
  object-fit: contain;
  image-rendering: auto;
}

.node-status {
  display: grid;
  grid-template-rows: 1fr auto;
  min-width: 0;
  padding: 10px 12px;
}

.node-status pre,
.memory-block,
.asset-record pre,
.signal-report,
.mini-log,
.query-output,
.asset-chart {
  margin: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: pre;
}

.node-status pre {
  color: var(--text-hi);
  line-height: 1.35;
}

.status-strip,
.keybar,
.pane-title {
  color: var(--blue-mid);
  text-transform: uppercase;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid var(--border-soft);
  padding-top: 7px;
  font-size: 0.72rem;
}

.status-strip span {
  border: 1px solid var(--border-soft);
  background: var(--blue-soft);
  padding: 3px 7px;
}

.keybar {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--border-soft);
  font-size: 0.72rem;
}

.keybar button {
  flex: 1 1 160px;
  border: 0;
  border-radius: 0;
  background: #000000;
  color: #b8d0ff;
  padding: 6px 10px;
  text-align: center;
  text-transform: uppercase;
}

.keybar button:hover,
.keybar button:focus-visible,
.keybar button.active {
  background: var(--blue);
  color: var(--text-hi);
  outline: none;
}

.terminal-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.62fr) minmax(640px, 1.75fr) minmax(250px, 0.7fr);
  grid-template-rows: minmax(0, 1fr) 118px;
  grid-template-areas:
    "tree memory signal"
    "console console console";
  gap: 1px;
  background: var(--border-soft);
  min-height: 0;
  overflow: hidden;
}

.pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 85, 255, 0.035), transparent 90px),
    #000000;
  color: var(--text);
}

.tree-pane {
  grid-area: tree;
  padding: 12px;
  overflow: auto;
  scrollbar-color: var(--border) #000000;
}

.memory-pane {
  grid-area: memory;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) minmax(255px, 0.82fr);
  gap: 10px;
}

.signal-pane {
  grid-area: signal;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 0.9fr) auto minmax(0, 1fr);
  gap: 10px;
}

.console-pane {
  grid-area: console;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(260px, 0.48fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px 12px;
}

.pane-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  padding-bottom: 6px;
  color: var(--text-hi);
  font-size: 0.78rem;
}

.pane-title::before {
  color: var(--blue);
  content: "[";
}

.pane-title::after {
  color: var(--blue);
  content: "]";
}

.pane-title.sub {
  margin-top: 0;
  color: #b8d0ff;
}

.market-search {
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-transform: uppercase;
}

.market-search::before,
.market-search::after {
  content: none;
}

.market-search label {
  color: var(--blue-mid);
  font-size: 0.72rem;
}

.search-input-wrap {
  position: relative;
  display: grid;
  min-width: 0;
  align-items: center;
}

.market-search input {
  width: 100%;
  min-height: 26px;
  border-color: var(--border-soft);
  background: #000000;
  color: var(--text-hi);
  padding-right: 38px;
  font-size: 0.76rem;
}

.market-search input::placeholder {
  color: #666666;
  opacity: 1;
}

.search-hotkey {
  position: absolute;
  right: 5px;
  display: inline-grid;
  width: 26px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 5px;
  background: rgba(0, 85, 255, 0.12);
  box-shadow: 0 0 10px rgba(0, 112, 255, 0.28);
  color: var(--blue-mid);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1;
  pointer-events: none;
}

.search-modes {
  display: flex;
  max-width: min(430px, 42vw);
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--border-soft);
  background: #000000;
  scrollbar-width: none;
}

.search-modes::-webkit-scrollbar {
  display: none;
}

.search-mode {
  min-height: 24px;
  border: 0;
  border-right: 1px solid var(--border-soft);
  border-radius: 0;
  background: #000000;
  color: var(--muted);
  padding: 0 7px;
  font-size: 0.66rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.search-mode:last-child {
  border-right: 0;
}

.search-mode:hover,
.search-mode:focus-visible,
.search-mode.active {
  background: var(--blue);
  color: var(--text-hi);
  outline: none;
}

.currency-toggle {
  display: flex;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #000000;
}

.currency-mode {
  min-height: 24px;
  min-width: 44px;
  border: 0;
  border-right: 1px solid var(--border-soft);
  border-radius: 0;
  background: #000000;
  color: var(--muted);
  padding: 0 8px;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.currency-mode:last-child {
  border-right: 0;
}

.currency-mode:hover,
.currency-mode:focus-visible,
.currency-mode.active {
  background: var(--blue);
  color: var(--text-hi);
  outline: none;
}

.currency-mode.unavailable:not(.active) {
  color: #555555;
}

.header-currency {
  justify-self: end;
  margin-left: auto;
}

.tree-root,
.tree-node,
.lens-node {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 0;
  text-align: left;
  white-space: nowrap;
}

.tree-root {
  color: var(--muted);
  margin-bottom: 4px;
}

.tree-node:hover,
.tree-node:focus-visible,
.tree-node.active,
.lens-node:hover,
.lens-node:focus-visible,
.lens-node.active {
  background: var(--blue);
  color: var(--text-hi);
  outline: none;
}

.lens-node {
  color: #b8d0ff;
  padding-inline: 8px;
}

.mini-log {
  border-top: 1px solid var(--border-soft);
  margin-top: 18px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.memory-report,
.signal-report,
.query-output,
.chart-window {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--panel);
  background-size: 8px 8px;
  padding: 12px;
  scrollbar-color: var(--border) #000000;
  min-height: 0;
}

.memory-report {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  color: #e8e8e8;
  line-height: 1.42;
}

.memory-block {
  color: #e8e8e8;
  line-height: 1.42;
}

.asset-record-list {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  scrollbar-color: var(--border) #000000;
}

.asset-record-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-color: var(--blue) #050505;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.asset-record-body::-webkit-scrollbar {
  width: 12px;
}

.asset-record-body::-webkit-scrollbar-track {
  border-left: 1px solid var(--border-soft);
  background: #050505;
}

.asset-record-body::-webkit-scrollbar-thumb {
  border: 2px solid #050505;
  background: var(--blue);
}

.asset-record-body::-webkit-scrollbar-thumb:hover {
  background: var(--green);
}

.asset-board-head,
.asset-record {
  display: grid;
  grid-template-columns:
    minmax(46px, 0.34fr)
    minmax(120px, 1.25fr)
    minmax(106px, 0.9fr)
    minmax(86px, 0.8fr)
    minmax(64px, 0.62fr)
    minmax(64px, 0.62fr)
    minmax(64px, 0.62fr)
    minmax(112px, 1fr)
    minmax(84px, 0.78fr);
  min-width: 750px;
  align-items: center;
}

.asset-board-head {
  border-bottom: 1px solid var(--border-soft);
  background: #050505;
  color: var(--muted);
  font-size: 0.64rem;
  text-transform: uppercase;
}

.asset-board-head .sort-head {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 8px 7px;
  font-size: inherit;
  text-align: left;
  text-transform: inherit;
}

.asset-board-head .sort-head.active::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--blue);
  box-shadow: 0 0 10px rgba(0, 112, 255, 0.7);
  content: "";
}

.asset-board-head .sort-head.active.asc::after {
  top: 0;
}

.asset-board-head .sort-head.active.desc::after {
  bottom: 0;
}

.asset-board-head .sort-head:last-child {
  border-right: 0;
}

.asset-board-head .sort-head span {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  text-overflow: ellipsis;
}

.asset-board-head .sort-head:hover,
.asset-board-head .sort-head:focus-visible,
.asset-board-head .sort-head.active {
  background: var(--blue-soft);
  color: var(--text-hi);
  outline: none;
}

.asset-record {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  border-radius: 0;
  background: #000000;
  color: var(--text);
  font-size: 0.76rem;
  padding: 0;
  text-align: left;
}

.asset-record:last-child {
  border-bottom: 0;
}

.asset-record-empty {
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.76rem;
  padding: 10px 7px;
  text-transform: uppercase;
}

.asset-record-empty.error {
  color: var(--red);
}

.asset-record span {
  min-width: 0;
  overflow: hidden;
  padding: 6px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-name {
  display: block;
}

.asset-name strong {
  color: var(--text-hi);
  font-size: 0.78rem;
}

.asset-name small {
  color: var(--muted);
  font-size: 0.76rem;
}

.asset-rank {
  color: var(--muted);
  text-align: right;
}

.move.up {
  color: var(--green);
}

.move.down {
  color: var(--red);
}

.move.flat {
  color: var(--amber);
}

.asset-record:hover,
.asset-record:focus-visible,
.asset-record.active {
  background: var(--blue);
  color: var(--text-hi);
  outline: none;
}

.asset-record:hover .asset-name small,
.asset-record:focus-visible .asset-name small,
.asset-record.active .asset-name small,
.asset-record:hover .asset-rank,
.asset-record:focus-visible .asset-rank,
.asset-record.active .asset-rank,
.asset-record:hover .move,
.asset-record:focus-visible .move,
.asset-record.active .move {
  color: var(--text-hi);
}

.asset-details-pane {
  display: none;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    #000000;
  background-size: 8px 8px;
  color: var(--text);
  padding: 9px;
  font-size: 0.62rem;
  line-height: 1.28;
}

.asset-details-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 7px;
}

.asset-details-name {
  min-width: 0;
}

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

.asset-details-name strong {
  color: var(--text-hi);
  font-size: 0.72rem;
}

.asset-details-name span {
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.asset-detail-logo {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--blue);
  border-radius: 5px;
  background: rgba(0, 85, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 14px rgba(0, 85, 255, 0.22);
  color: var(--blue-mid);
  font-size: 0.76rem;
  font-weight: 700;
}

.asset-detail-grid {
  display: grid;
  grid-template-columns: 8.75ch minmax(10ch, 1fr) 8.75ch minmax(9ch, 1fr);
  gap: 4px 1.35ch;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 7px 0;
}

.asset-detail-grid:last-of-type {
  border-bottom: 0;
}

.asset-detail-grid span {
  color: var(--muted);
  text-transform: uppercase;
}

.asset-detail-grid strong,
.asset-id-button {
  min-width: 0;
  overflow: hidden;
  color: var(--text-hi);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-id-button {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.asset-id-button:hover,
.asset-id-button:focus-visible {
  color: var(--blue-mid);
  outline: none;
}

.asset-id-button[data-state="copied"] {
  color: var(--green);
}

.asset-id-button[data-state="copy-failed"] {
  color: var(--red);
}

.asset-detail-site {
  display: grid;
  grid-template-columns: 8.75ch minmax(0, 1fr);
  gap: 1.35ch;
  padding-top: 6px;
}

.asset-detail-site span {
  color: var(--muted);
  text-transform: uppercase;
}

.asset-detail-site a,
.asset-detail-site strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-hi);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-detail-site a:hover,
.asset-detail-site a:focus-visible {
  color: var(--blue-mid);
  outline: none;
}

.chart-window {
  margin-top: 0;
  color: var(--text);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.chart-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  margin: -12px -12px 10px;
  padding: 8px 12px;
  color: #b8d0ff;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.asset-chart {
  min-height: 0;
  color: #f0f0f0;
  font-size: 0.76rem;
  line-height: 1.32;
  overflow: auto;
}

.signal-report {
  color: #d8d8d8;
  line-height: 1.35;
}

.bbs-feed {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  overflow: auto;
  scrollbar-color: var(--border) #000000;
}

.bbs-feed li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
  padding: 8px;
}

.bbs-feed li:last-child {
  border-bottom: 0;
}

.bbs-feed span {
  color: var(--green);
}

.bbs-feed p {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
}

.query-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: start;
  margin-bottom: 0;
  color: var(--green);
}

input,
textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #000000;
  color: var(--text-hi);
  padding: 0 8px;
}

textarea {
  resize: none;
}

input:focus,
textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 1px var(--blue);
}

#run-query {
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #303030;
  color: var(--text-hi);
}

#run-query:hover,
#run-query:focus-visible {
  border-color: var(--text-hi);
  background: var(--blue);
  outline: none;
}

.query-line textarea {
  min-height: 142px;
  padding: 8px;
  line-height: 1.35;
}

.query-output {
  color: #f0f0f0;
  white-space: pre-wrap;
  grid-column: 2;
  grid-row: 1 / span 2;
}

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

@media (max-width: 1100px) {
  .terminal-layout {
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    grid-template-areas:
      "tree memory"
      "signal signal"
      "console console";
  }

  .memory-report {
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  body {
    padding: 6px;
  }

  .terminal-shell {
    width: 100%;
    margin: 0 auto;
  }

  .shell-banner,
  .terminal-layout {
    grid-template-columns: 1fr;
  }

  .shell-banner {
    gap: 0;
  }

  .logo-frame {
    min-height: 104px;
    padding: 6px;
  }

  .brand-image {
    max-height: 100px;
  }

  .node-status {
    padding: 10px;
  }

  .node-status pre {
    font-size: 0.76rem;
  }

  .terminal-layout {
    grid-template-areas:
      "tree"
      "memory"
      "signal"
      "console";
  }

  .pane {
    padding: 10px;
  }

  .memory-report,
  .signal-report,
  .asset-chart {
    min-height: 280px;
    font-size: 0.78rem;
  }

  .tree-list {
    overflow-x: auto;
  }

  .query-line {
    grid-template-columns: 1fr;
  }
}

/* Simple interface pass */
.terminal-shell {
  width: min(1180px, 100%);
}

.shell-banner {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
}

.logo-frame {
  justify-content: flex-start;
  min-height: 142px;
  padding: 4px 14px;
}

.brand-image {
  width: min(402px, 100%);
  height: auto;
  max-height: none;
  filter: contrast(1.08) saturate(1.06);
}

.node-status {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
}

.node-status pre {
  font-size: 0.68rem;
  line-height: 1.25;
  white-space: pre-wrap;
}

.status-strip {
  align-items: center;
  border-top: 0;
  padding-top: 0;
}

.status-strip span:not(#header-date) {
  display: inline-block;
}

.keybar button {
  flex: 1 1 0;
  min-width: 0;
  padding-block: 7px;
}

.keybar {
  flex-wrap: nowrap;
}

.terminal-layout,
.terminal-shell[data-view="market"] .terminal-layout,
.terminal-shell[data-view="chart"] .terminal-layout,
.terminal-shell[data-view="snapshots"] .terminal-layout,
.terminal-shell[data-view="query"] .terminal-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "single";
}

.terminal-shell[data-view] .pane {
  display: none;
}

.terminal-shell[data-view="market"] .memory-pane,
.terminal-shell[data-view="chart"] .memory-pane {
  display: grid;
  grid-area: single;
}

.terminal-shell[data-view="snapshots"] .tree-pane {
  display: block;
  grid-area: single;
}

.terminal-shell[data-view="query"] .console-pane {
  display: grid;
  grid-area: single;
}

.terminal-shell[data-view="market"] .memory-pane {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
  grid-template-rows: auto minmax(0, 1fr);
}

.terminal-shell[data-view="market"] .market-search {
  grid-column: 1 / -1;
  grid-row: 1;
}

.terminal-shell[data-view="chart"] #memory-title {
  display: none;
}

.terminal-shell[data-view="market"] .asset-focus {
  display: none;
}

.terminal-shell[data-view="market"] .memory-report {
  grid-column: 1;
  grid-row: 2;
}

.terminal-shell[data-view="market"] .asset-details-pane {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

.terminal-shell[data-view="chart"] .memory-pane {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.terminal-shell[data-view="chart"] .memory-report {
  display: none;
}

.asset-focus {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.selected-report {
  width: 100%;
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--border-soft);
  background: var(--panel);
  color: var(--text);
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.42;
  white-space: pre-wrap;
  scrollbar-color: var(--border) #000000;
}

.terminal-shell[data-view="query"] .console-pane {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.terminal-shell[data-view="query"] .query-output {
  grid-column: 1;
  grid-row: 3;
}

.memory-report,
.asset-record-list,
.asset-details-pane,
.chart-window,
.asset-chart,
.tree-pane,
.query-output {
  min-height: 0;
}

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

  .logo-frame {
    justify-content: center;
    min-height: 54px;
  }

  .brand-image {
    max-height: 42px;
  }

  .node-status {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .asset-focus {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(96px, 0.32fr) minmax(0, 1fr);
  }

  .terminal-shell[data-view="market"] .memory-pane {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .terminal-shell[data-view="market"] .asset-details-pane {
    grid-column: 1;
    grid-row: 2;
  }

  .terminal-shell[data-view="market"] .memory-report {
    grid-column: 1;
    grid-row: 3;
  }
}
