:root {
  --terminal-border-strong: #3c596d;
  --terminal-surface: #061522;
  --terminal-surface-raised: #0d2638;
  --terminal-focus: #7de8f1;
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--terminal-focus);
  outline-offset: 2px;
}

.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  color: var(--cyan);
  transform: none;
}

.brand-mark path,
.brand-mark circle,
.brand-mark rect,
.inline-icon,
.rail-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.inline-icon,
.rail-icon {
  display: block;
  flex: 0 0 auto;
}

.account-avatar {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.account-pill {
  min-height: 40px;
  max-width: 210px;
}

.account-pill b,
.account-pill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link-with-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.nav-link-with-state small {
  color: var(--muted);
  font: 8px var(--mono);
  letter-spacing: .04em;
  margin-top: 3px;
  text-transform: uppercase;
}

.overview-empty {
  margin: 10px auto;
  max-width: 720px;
  padding: clamp(28px, 6vw, 72px);
  text-align: center;
}

.overview-empty h1 {
  font-size: clamp(24px, 4vw, 40px);
  margin: 8px 0 12px;
}

.overview-empty > p:not(.eyebrow) {
  color: var(--muted);
  margin: 0 auto;
  max-width: 560px;
}

.overview-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 22px;
}

.sample-book-banner {
  align-items: center;
  background: #e5a52f12;
  border: 1px solid #e5a52f80;
  border-radius: var(--r);
  color: var(--amber);
  display: flex;
  gap: 12px;
  margin: 10px 0 4px;
  padding: 10px 12px;
}

.sample-book-banner[hidden] {
  display: none;
}

.sample-book-banner span {
  color: var(--text);
}

.sample-book-banner button {
  margin-left: auto;
}

.status-indicator {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--muted);
}

.status-indicator.connected {
  color: var(--green);
  background: var(--green);
}

.status-indicator.warning {
  color: var(--amber);
  background: var(--amber);
}

.status-indicator.idle {
  color: var(--muted);
  background: transparent;
}

.utility-rail button {
  min-height: 68px;
  border-radius: 6px;
}

.utility-rail button:hover,
.utility-rail button:focus-visible {
  background: #27c7d812;
}

.utility-rail button span {
  font-size: 10px;
  letter-spacing: .04em;
}

.market-boundary,
.selection-help,
.purchase-disclaimer,
.purchase-help,
.purchase-error,
.action-note,
.faucet-note,
.compare-note {
  color: var(--muted);
}

.market-boundary {
  max-width: 260px;
  padding: 8px 10px;
  border-left: 2px solid var(--amber);
  background: #e5a52f0d;
  text-align: right;
}

.selection-help {
  min-height: 18px;
  margin: 6px 0;
  font: 10px var(--mono);
}

.columns-menu {
  right: 150px;
}

.columns-menu b {
  display: block;
  padding: 7px 4px 3px;
  color: var(--text);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.column-option,
.columns-all {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.column-option small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font: 9px var(--mono);
}

.identity-cell,
.instrument-cell {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.instrument-cell {
  display: flex;
  min-width: 170px;
}

.identity-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
}

.identity-logo {
  border: 1px solid #ffffff20;
  background: #edf3f6;
  overflow: hidden;
}

.identity-logo img {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.identity-monogram {
  border: 1px dashed #6f8494;
  border-radius: 6px;
  background: #182b39;
  color: #c0ccd4;
  font: 8px var(--mono);
  letter-spacing: .02em;
}

.identity-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px 2px 3px;
  color: #c9d4da;
  font: 9px var(--mono);
}

.type-indicator > span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: #274154;
  color: #e8f1f4;
  font-size: 8px;
}

.type-native > span {
  background: #135864;
}

.type-rwa > span {
  background: #5c4121;
}

.type-vault > span {
  background: #433366;
}

.availability {
  display: inline-grid;
  gap: 1px;
  min-width: 76px;
  padding: 3px 6px;
  border-radius: 4px;
  text-align: left;
  white-space: nowrap;
}

.availability b,
.availability small {
  font-family: var(--mono);
}

.availability b {
  font-size: 9px;
}

.availability small {
  font-size: 8px;
}

.availability.not-applicable {
  border: 1px dashed #6f8494;
  background: transparent;
  color: #aebbc4;
}

.availability.not-measured {
  border-left: 3px solid var(--amber);
  background: #e5a52f17;
  color: #f0c56d;
}

.view[data-view="market"] .chart-grid .panel {
  height: auto;
  min-height: 196px;
  overflow: visible;
}

.notional-console {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
  overflow: visible;
  border-color: #27c7d866;
  background: linear-gradient(135deg, #0b2638, #071725);
}

.notional-heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notional-heading h2 {
  font-size: 15px;
}

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

.notional-info {
  position: relative;
}

.notional-info summary {
  display: grid;
  width: 28px;
  height: 28px;
  cursor: pointer;
  list-style: none;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
}

.notional-info summary::-webkit-details-marker {
  display: none;
}

.notional-info > div {
  position: absolute;
  z-index: 12;
  top: 34px;
  left: 0;
  width: min(390px, calc(100vw - 48px));
  padding: 10px;
  border: 1px solid var(--terminal-border-strong);
  border-radius: 6px;
  background: var(--terminal-surface-raised);
  box-shadow: 0 12px 30px #0009;
  color: var(--text);
}

.notional-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.notional-presets {
  display: flex;
  align-items: stretch;
  gap: 5px;
}

.notional-presets button[aria-pressed="true"] {
  border-color: var(--cyan);
  background: #27c7d817;
  color: var(--cyan);
}

.notional-entry {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #061522;
}

.notional-entry > span {
  padding-left: 8px;
  color: var(--muted);
}

.notional-entry input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 7px 5px;
  font-family: var(--mono);
}

.notional-entry:focus-within {
  outline: 2px solid var(--terminal-focus);
  outline-offset: 2px;
}

.notional-entry .ghost {
  min-height: 30px;
  border-block: 0;
  border-right: 0;
  border-radius: 0 6px 6px 0;
}

.notional-status {
  grid-column: 1 / -1;
}

.notional-status {
  min-height: 18px;
  padding-left: 8px;
  border-left: 2px solid var(--cyan);
}

.notional-status.error {
  border-color: var(--coral);
  color: var(--coral);
}

.market-recomputing {
  opacity: .62;
}

.yield-chart-layout,
.depth-chart-layout {
  display: grid;
  gap: 5px;
}

.chart-grid .yield-chart-layout svg,
.chart-grid .depth-chart-layout svg {
  width: 100%;
  height: 118px;
}

.chart-target {
  cursor: help;
}

.chart-target:focus-visible {
  outline: 2px solid var(--terminal-focus);
  outline-offset: 2px;
}

.chart-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(270px, calc(100vw - 24px));
  padding: 8px 10px;
  border: 1px solid var(--terminal-border-strong);
  border-radius: 6px;
  background: #020e18f2;
  box-shadow: 0 10px 28px #000a;
  color: var(--text);
  font: 10px/1.45 var(--mono);
  pointer-events: none;
  white-space: pre-line;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-series-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  color: var(--muted);
  font: 9px var(--mono);
}

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

.chart-series-legend i {
  display: inline-block;
  width: 13px;
  height: 2px;
}

.series-p25 {
  background: #27c7d8;
}

.series-median {
  background: #d770cf;
}

.series-p75 {
  background: #758cff;
}

.verdict-chart-layout {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.chart-grid .verdict-chart-layout svg {
  width: 104px;
  height: 104px;
}

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

.verdict-legend > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0 5px;
  min-width: 0;
}

.verdict-legend i {
  width: 7px;
  height: 7px;
  grid-row: span 2;
  border-radius: 50%;
}

.verdict-legend b,
.verdict-legend small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 920px) {
  .notional-console,
  .notional-controls {
    grid-template-columns: 1fr;
  }

  .notional-controls {
    align-items: stretch;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .notional-presets {
    grid-row: auto;
    flex-wrap: wrap;
  }
}

.verdict-legend b {
  font: 8px var(--mono);
}

.verdict-legend small {
  color: var(--muted);
  font: 8px var(--mono);
}

.compare-col,
.compare-cell {
  width: 62px;
  text-align: center;
}

.compare-cell input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.sort-action {
  min-height: 24px;
}

.execution-cell {
  display: inline-block;
  min-width: 154px;
  font: 9px var(--mono);
}

.execution-cell.demo {
  color: var(--cyan);
}

.execution-cell.read-only {
  color: var(--muted);
}

.value-unavailable,
.not-computable {
  color: var(--muted);
  font-family: var(--mono);
}

.inspector-demo-note {
  display: grid;
  gap: 3px;
  margin: 10px 0;
  padding: 9px;
  border: 1px solid #27c7d866;
  border-radius: 6px;
  background: #27c7d80c;
}

.inspector-demo-note.muted {
  border-color: var(--line);
  background: transparent;
}

.rating-refusal {
  margin-top: 7px;
  padding: 7px 0;
  border-top: 1px solid var(--soft);
}

.compare-panel {
  margin-top: 8px;
  border: 1px solid var(--terminal-border-strong);
  border-radius: var(--r);
  background: linear-gradient(145deg, var(--terminal-surface-raised), var(--terminal-surface));
  padding: 14px;
}

.compare-header,
.purchase-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.compare-empty {
  padding: 18px 8px 7px;
  color: var(--muted);
  text-align: center;
}

.compare-empty strong {
  display: block;
  color: var(--text);
}

.comparison-scroll {
  overflow: auto;
  border: 1px solid var(--soft);
  border-radius: 6px;
}

.comparison-table {
  min-width: 760px;
}

.comparison-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 154px;
}

.comparison-table tbody th {
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
}

.comparison-table td,
.comparison-table tbody th {
  min-width: 140px;
  vertical-align: top;
}

.compare-instrument {
  display: block;
  max-width: 180px;
  overflow-wrap: anywhere;
  color: var(--text);
  font: 11px var(--sans);
  white-space: normal;
}

.comparison-table th small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font: 9px var(--mono);
  white-space: normal;
}

.purchase-card {
  margin-top: 8px;
  border: 1px solid #27c7d866;
  border-radius: var(--r);
  background: linear-gradient(145deg, #0b2638, #061522);
  padding: 14px;
}

.network-badge {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--cyan);
  font: 9px var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.purchase-header h2 {
  font-size: 16px;
}

.purchase-disclaimer {
  margin-bottom: 12px;
  padding: 8px;
  border-left: 2px solid var(--amber);
  background: #e5a52f0d;
}

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

.purchase-read-grid {
  grid-template-columns: repeat(5, 1fr);
  margin-top: 10px;
}

.mono-value b,
.purchase-read-grid b {
  max-width: 190px;
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 10px;
}

.purchase-form {
  margin-top: 10px;
}

.purchase-form > label {
  display: grid;
  max-width: 260px;
  gap: 4px;
  color: var(--muted);
}

.purchase-form input {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--terminal-surface);
  padding: 8px;
}

.purchase-help {
  min-height: 20px;
  margin-top: 10px;
}

.purchase-error {
  min-height: 16px;
  margin-top: 5px;
  color: var(--coral);
  overflow-wrap: anywhere;
}

.purchase-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.purchase-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.purchase-steps li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 6px;
  background: #061522;
}

.purchase-steps span {
  color: var(--cyan);
  font: 9px var(--mono);
}

.purchase-steps small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.primary-action {
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: var(--cyan);
  color: #03101b;
  padding: 8px 12px;
  font-weight: 700;
}

.primary-action:disabled,
.purchase-actions .ghost:disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #071725;
  color: var(--muted);
  opacity: .85;
}

.action-note,
.faucet-note {
  font: 10px var(--mono);
}

.faucet-note {
  margin-top: 9px;
}

.transaction-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.tx-link {
  color: var(--cyan);
  font: 10px var(--mono);
}

.assistant-answer {
  min-height: 40px;
  padding: 10px;
  border: 1px solid var(--soft);
  border-radius: 6px;
  background: var(--terminal-surface);
  color: var(--text) !important;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistant-facts {
  margin-top: 12px;
}

.assistant-facts h3 {
  color: var(--text);
  font-size: 11px;
}

.facts-list {
  display: grid;
  gap: 6px;
}

.facts-list > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--soft);
  border-radius: 5px;
}

.facts-list dt {
  overflow-wrap: anywhere;
  font: 9px var(--mono);
}

.facts-list dd {
  display: grid;
  gap: 2px;
  margin: 0;
}

.facts-list dd b {
  color: var(--cyan);
  font: 9px var(--mono);
}

.facts-list dd span,
.facts-list dd small {
  overflow-wrap: anywhere;
}

.assistant-status {
  display: grid;
  gap: 7px;
}

.assistant-status code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--amber);
  font: 10px var(--mono);
  white-space: normal;
}

.full-width {
  width: 100%;
}

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

@media (max-width: 760px) {
  .market-boundary {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  .purchase-addresses,
  .purchase-read-grid,
  .purchase-steps {
    grid-template-columns: 1fr 1fr;
  }

  .purchase-read-grid .kv:last-child {
    grid-column: span 2;
  }

  .purchase-steps {
    grid-template-columns: 1fr;
  }

  .facts-list > div {
    grid-template-columns: 1fr;
  }
}

/* Allocation rows. The JS emitted these with no styling, so they collapsed into a
   run of text; the track restores the proportional read the composition needs. */
.allocation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) auto;
  align-items: center;
  gap: 12px;
}

.allocation-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.allocation-label b {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.allocation-label small {
  color: var(--muted, #8fa3bf);
  font-size: 11px;
}

.allocation-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.allocation-track span {
  background: linear-gradient(90deg, #22d3ee, #6366f1);
  display: block;
  height: 100%;
}

/* An unresolved slice must not read as a measured one. */
.allocation-track span.unknown {
  background: repeating-linear-gradient(90deg, #64748b 0 4px, transparent 4px 8px);
}

.allocation-row > strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.allocation-note {
  margin-top: 12px;
}

/* styles.css sets the toolbar to a non-wrapping flex row with min-width:0 on its
   controls, so adding Compare/Columns/Export squeezed the filters until their
   labels read "Ver", "Cha", "Tie". Wrap instead of truncating. */
.toolbar {
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
}

.toolbar select {
  min-width: 132px;
}

.toolbar > input {
  flex: 1 1 220px;
}

@media (max-width: 760px) {
  .toolbar select,
  .toolbar > input {
    flex: 1 1 100%;
    min-width: 0;
  }
}

/* .icon-button carried no background rule, so it fell through to the user-agent
   default (rgb(239,239,239)) and rendered as a white block in the dark header. */
.icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  color: var(--muted, #8fa3bf);
  cursor: pointer;
  display: inline-flex;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #edf3f6);
}

.icon-button:focus-visible {
  outline: 2px solid var(--accent, #22d3ee);
  outline-offset: 2px;
}

.icon-button .inline-icon {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

/* The header is fixed at 60px, so scrolling the compare view into place put its
   title underneath it. Reserve the header height when this panel is scrolled to. */
.compare-panel {
  scroll-margin-top: 76px;
}

.compare-header {
  background: var(--panel, #0a1622);
  padding-top: 8px;
  position: sticky;
  top: 68px;
  z-index: 5;
}

@media (max-width: 760px) {
  .compare-panel {
    scroll-margin-top: 196px;
  }

  .compare-header {
    position: static;
  }
}
