/* ════════════════════════════════════════════════════════════════════════════
   InterbankOS Terminal · surface compositions
   ────────────────────────────────────────────────────────────────────────────
   Layout patterns specific to the three demonstration surfaces. Each
   surface is a self-contained composition that could become a route in a
   real router. The grid system and responsive breakpoints live here too,
   since they are surface-level concerns.
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── SURFACE FRAMING ─────────────────────────────────────────────────── */

.surface {
  padding: var(--s-12) var(--gutter) var(--s-8);
}
.surface + .surface {
  padding-top: var(--s-8);
}
.surface-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.surface-header {
  margin-bottom: var(--s-6);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.surface-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--s-2);
}
.surface-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  line-height: 1.1;
  max-width: 22ch;
}
.surface-title em {
  font-style: italic;
  color: var(--brand);
}
.surface-anno {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-tertiary);
  max-width: 420px;
}

/* ─── GRID ────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  gap: var(--s-4);
}
.grid-12 {
  grid-template-columns: repeat(12, 1fr);
}
.span-3  { grid-column: span 3; }
.span-4  { grid-column: span 4; }
.span-5  { grid-column: span 5; }
.span-6  { grid-column: span 6; }
.span-7  { grid-column: span 7; }
.span-8  { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* ═════════════════════════════════════════════════════════════════════════
   §A — PORTFOLIO DASHBOARD
   ═════════════════════════════════════════════════════════════════════════ */

.hero {
  padding: var(--s-7) var(--s-7) var(--s-6);
}
.hero-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--s-3);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.hero-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-bright);
  box-shadow: 0 0 6px rgba(20, 160, 152, 0.5);
}
.hero-value {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 400;
  letter-spacing: -0.035em;
  color: var(--text-strong);
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.hero-value .sym {
  font-size: 0.6em;
  color: var(--text-tertiary);
  margin-right: 4px;
}
.hero-value .dec {
  font-size: 0.6em;
  color: var(--text-tertiary);
}
.hero-deltas {
  display: flex;
  gap: var(--s-6);
  margin-top: var(--s-4);
  flex-wrap: wrap;
}
.hero-delta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-delta-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.hero-delta-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.hero-delta-val.pos { color: var(--positive); }
.hero-delta-val.neg { color: var(--negative); }
.hero-delta-val small {
  font-size: 11px;
  opacity: 0.78;
  font-weight: 400;
}
.btn-row {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-5);
  flex-wrap: wrap;
}

/* Allocation visualization */
.alloc {
  padding: 0 var(--s-7) var(--s-7);
}
.alloc-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.alloc-head span:last-child {
  color: var(--text-secondary);
}
.alloc-bar {
  display: flex;
  height: 6px;
  background: var(--ink-8);
  border-radius: var(--r-1);
  overflow: hidden;
  gap: 2px;
}
.alloc-seg {
  height: 100%;
  transition: opacity var(--dur-hover) var(--ease-out);
}
.alloc-seg:hover {
  opacity: 0.85;
}
.alloc-seg.s1 { background: linear-gradient(90deg, var(--teal-bright), var(--teal)); }
.alloc-seg.s2 { background: linear-gradient(90deg, var(--mint-bright), var(--mint)); }
.alloc-seg.s3 { background: linear-gradient(90deg, var(--blue-bright), var(--blue)); }
.alloc-seg.s4 { background: linear-gradient(90deg, #f59e0b, var(--amber)); }
.alloc-seg.s5 { background: linear-gradient(90deg, #8b5cf6, #7c3aed); }
.alloc-seg.s6 { background: linear-gradient(90deg, #ec4899, #db2777); }

.alloc-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-2) var(--s-4);
  margin-top: var(--s-3);
}
.alloc-leg {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.alloc-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.alloc-leg.s1 .alloc-leg-dot { background: var(--teal); }
.alloc-leg.s2 .alloc-leg-dot { background: var(--mint); }
.alloc-leg.s3 .alloc-leg-dot { background: var(--blue); }
.alloc-leg.s4 .alloc-leg-dot { background: var(--amber); }
.alloc-leg.s5 .alloc-leg-dot { background: #8b5cf6; }
.alloc-leg.s6 .alloc-leg-dot { background: #ec4899; }
.alloc-leg-name { color: var(--text-secondary); }
.alloc-leg-pct {
  color: var(--text-strong);
  font-weight: 500;
  margin-left: auto;
}

/* Stat strip — 4-up grid of telemetry values */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule-1);
  border-top: 1px solid var(--rule-1);
  border-bottom: 1px solid var(--rule-1);
}
.stat-cell {
  background: rgba(255, 255, 255, 0.55);
  padding: var(--s-3) var(--s-4);
}
.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 4px;
}
.stat-val {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.stat-val.pos { color: var(--positive); }
.stat-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-hint);
  margin-top: 2px;
}

/* Markets ticker */
.ticker {
  display: flex;
  flex-direction: column;
}
.ticker-row {
  display: grid;
  grid-template-columns: 64px 1fr auto 72px;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--rule-1);
  cursor: pointer;
  transition: background var(--dur-hover) var(--ease-out);
}
.ticker-row:last-child {
  border-bottom: 0;
}
.ticker-row:hover {
  background: rgba(13, 115, 119, 0.03);
}
.ticker-sym {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-strong);
}
.ticker-price {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ticker-change {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ticker-change.pos { color: var(--positive); }
.ticker-change.neg { color: var(--negative); }
.ticker-spark {
  width: 72px;
  height: 22px;
}

/* Holdings table */
.holdings-wrap {
  overflow-x: auto;
}
.holdings {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.holdings thead th {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-hint);
  text-align: right;
  padding: var(--s-3);
  border-bottom: 1px solid var(--rule-2);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.4);
  position: sticky;
  top: 0;
}
.holdings thead th:first-child {
  text-align: left;
  padding-left: var(--s-5);
}
.holdings thead th:last-child {
  padding-right: var(--s-5);
}
.holdings thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.holdings thead th.sortable:hover {
  color: var(--brand);
}
.holdings thead th.sorted {
  color: var(--brand);
}
.holdings thead th .sort-mark {
  display: inline-block;
  margin-left: 4px;
  font-size: 8px;
}
.holdings tbody td {
  padding: var(--s-3);
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
  border-bottom: 1px solid var(--rule-1);
}
.holdings tbody td:first-child {
  text-align: left;
  padding-left: var(--s-5);
}
.holdings tbody td:last-child {
  padding-right: var(--s-5);
}
.holdings tbody tr {
  cursor: pointer;
  transition: background var(--dur-hover) var(--ease-out);
}
.holdings tbody tr:hover {
  background: rgba(13, 115, 119, 0.04);
}
.holdings tbody tr:last-child td {
  border-bottom: 0;
}
.holdings .delta.pos { color: var(--positive); }
.holdings .delta.neg { color: var(--negative); }

.asset-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
}
.asset-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 1px 2px rgba(13, 30, 50, 0.1);
}
.asset-mark.xtz   { background: linear-gradient(135deg, var(--teal-bright), var(--teal)); }
.asset-mark.usdc  { background: linear-gradient(135deg, var(--blue-bright), var(--blue)); }
.asset-mark.eurl  { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.asset-mark.xau   { background: linear-gradient(135deg, #fbbf24, #d97706); color: #422006; }
.asset-mark.usdt  { background: linear-gradient(135deg, var(--mint-bright), var(--mint)); }
.asset-mark.lp    { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.asset-mark.usabc { background: linear-gradient(135deg, var(--blue-bright), var(--teal)); }

.asset-info {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  gap: 1px;
}
.asset-sym {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-strong);
}
.asset-name {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--text-hint);
}

.weight-cell {
  position: relative;
  padding-right: var(--s-4);
}
.weight-bar {
  position: absolute;
  right: var(--s-3);
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-bright), var(--brand));
  border-radius: 1px;
}

/* In-flight ops */
.ops-list {
  display: flex;
  flex-direction: column;
}
.ops-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  border-bottom: 1px solid var(--rule-1);
  align-items: start;
}
.ops-row:last-child {
  border-bottom: 0;
}
.ops-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.ops-dot.live {
  background: var(--positive);
  box-shadow: 0 0 6px rgba(26, 147, 111, 0.5);
}
.ops-dot.live::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--positive);
  opacity: 0.3;
  animation: pulse-status 2.2s ease-out infinite;
}
.ops-dot.await {
  background: var(--caution);
  box-shadow: 0 0 5px rgba(217, 119, 6, 0.45);
}
.ops-dot.confirm {
  background: var(--informational);
  box-shadow: 0 0 5px rgba(3, 83, 164, 0.45);
}
.ops-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ops-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-strong);
}
.ops-detail {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.ops-stage {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-top: 2px;
}
.ops-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.ops-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Research feed */
.news-list {
  padding: var(--s-4) var(--s-5);
  display: flex;
  flex-direction: column;
}
.news-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: var(--s-4);
  padding: var(--s-4) 0;
  border-bottom: 1px solid var(--rule-1);
  cursor: pointer;
  align-items: baseline;
}
.news-row:last-child {
  border-bottom: 0;
}
.news-source {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  padding-top: 2px;
}
.news-body {
  min-width: 0;
}
.news-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-strong);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.news-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--brand);
}
.news-excerpt {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.news-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-hint);
  white-space: nowrap;
  padding-top: 2px;
}

/* ═════════════════════════════════════════════════════════════════════════
   §B — ASSET DETAIL
   ═════════════════════════════════════════════════════════════════════════ */

.detail-head {
  padding: var(--s-6) var(--s-7);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.detail-id {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.detail-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  color: white;
  background: linear-gradient(135deg, var(--teal-bright), var(--teal-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(13, 115, 119, 0.18);
}
.detail-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-name {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  line-height: 1;
}
.detail-tags {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.detail-tag-sep {
  width: 1px;
  height: 12px;
  background: var(--rule-2);
}
.detail-net-pill {
  padding: 2px 8px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: var(--r-1);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.detail-price-block {
  text-align: right;
}
.detail-price {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.detail-price .sym {
  font-size: 0.55em;
  color: var(--text-tertiary);
  margin-right: 2px;
}
.detail-price-meta {
  display: inline-flex;
  gap: var(--s-3);
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
}
.detail-change.pos { color: var(--positive); }
.detail-change.neg { color: var(--negative); }
.detail-range { color: var(--text-tertiary); }
.detail-range strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Chart */
.chart-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-2);
  padding: 2px;
  gap: 1px;
}
.chart-tab {
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  border-radius: 4px;
  transition: all var(--dur-hover) var(--ease-out);
}
.chart-tab:hover {
  color: var(--text-strong);
}
.chart-tab.active {
  background: var(--brand);
  color: white;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(13, 115, 119, 0.3);
}
.chart-wrap {
  position: relative;
  padding: var(--s-5) var(--s-6) var(--s-3);
  background: white;
  border-radius: 0 0 var(--r-4) var(--r-4);
}
.chart-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
  gap: var(--s-3);
}
.chart-legend {
  display: inline-flex;
  gap: var(--s-4);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.chart-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-leg-line {
  width: 16px;
  height: 2px;
  border-radius: 1px;
}
.chart-leg-line.primary { background: var(--brand); }
.chart-leg-line.secondary { background: var(--informational); }
.chart-leg-line.tertiary { background: var(--positive); }
.chart-stats {
  display: inline-flex;
  gap: var(--s-3);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.chart-stat strong {
  color: var(--text-strong);
  font-weight: 500;
}
.chart-svg-wrap {
  position: relative;
  width: 100%;
  height: 320px;
}
.chart-svg {
  width: 100%;
  height: 100%;
}

/* Order book */
.ob-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}
.ob-head {
  display: contents;
}
.ob-head > div {
  padding: var(--s-2) var(--s-3);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-hint);
  border-bottom: 1px solid var(--rule-1);
  background: rgba(255, 255, 255, 0.4);
}
.ob-head > div:first-child {
  text-align: left;
  padding-left: var(--s-5);
}
.ob-head > div:last-child {
  text-align: right;
  padding-right: var(--s-5);
}
.ob-head > div:nth-child(2) {
  text-align: right;
}
.ob-row {
  display: contents;
}
.ob-row > div {
  position: relative;
  padding: 5px var(--s-3);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  z-index: 1;
}
.ob-row > div:first-child {
  padding-left: var(--s-5);
}
.ob-row > div:last-child {
  text-align: right;
  padding-right: var(--s-5);
}
.ob-row > div:nth-child(2) {
  text-align: right;
}
.ob-row .ob-price {
  font-weight: 500;
}
.ob-row.ask .ob-price { color: var(--negative); }
.ob-row.bid .ob-price { color: var(--positive); }
.ob-row .ob-size { color: var(--text-secondary); }
.ob-row .ob-total { color: var(--text-hint); }
.ob-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: -1;
}
.ob-row.ask .ob-bar {
  background: linear-gradient(90deg, var(--crimson-soft), transparent);
  right: 0;
}
.ob-row.bid .ob-bar {
  background: linear-gradient(90deg, transparent, var(--mint-soft));
  left: 0;
}
.ob-spread {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  background: rgba(13, 115, 119, 0.04);
  border-top: 1px solid var(--rule-1);
  border-bottom: 1px solid var(--rule-1);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.ob-spread strong {
  color: var(--text-strong);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* Position panel */
.pos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule-1);
}
.pos-cell {
  background: rgba(255, 255, 255, 0.55);
  padding: var(--s-4) var(--s-5);
}
.pos-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 4px;
}
.pos-val {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.pos-val.pos { color: var(--positive); }
.pos-val small {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 4px;
}
.pos-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--rule-1);
}
.pos-actions .btn {
  width: 100%;
}

/* Recent trades */
.trades-wrap {
  max-height: 320px;
  overflow-y: auto;
}
.trade-row {
  display: grid;
  grid-template-columns: 70px 1fr 1fr;
  gap: var(--s-3);
  padding: 4px var(--s-5);
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.trade-row:hover {
  background: rgba(13, 115, 119, 0.03);
}
.trade-time { color: var(--text-hint); }
.trade-price { text-align: right; font-weight: 500; }
.trade-price.buy { color: var(--positive); }
.trade-price.sell { color: var(--negative); }
.trade-size {
  color: var(--text-secondary);
  text-align: right;
}

/* ═════════════════════════════════════════════════════════════════════════
   §C — TRANSACT (atomic composability)
   ═════════════════════════════════════════════════════════════════════════ */

.transact {
  display: grid;
  grid-template-columns: 280px 520px 320px;
  gap: var(--s-5);
  align-items: start;
}
.transact-side {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.transact-side-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--s-2);
  padding: 0 var(--s-2);
}

.swap {
  background: var(--glass-fill-strong);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-edge-dim);
  border-radius: var(--r-5);
  box-shadow:
    inset 0 1px 0 #ffffff,
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    var(--shadow-deep);
  overflow: hidden;
  position: relative;
}
.swap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    var(--iris-angle, 135deg),
    var(--tint-cyan) 0%,
    transparent 18%,
    var(--tint-iris) 36%,
    transparent 54%,
    var(--tint-mint) 72%,
    transparent 90%,
    var(--tint-blue) 100%
  );
  mix-blend-mode: overlay;
  pointer-events: none;
  animation: iris-drift 7s ease-in-out infinite alternate;
  z-index: 0;
}
.swap > * {
  position: relative;
  z-index: 1;
}

.swap-head {
  padding: var(--s-5) var(--s-6) var(--s-4);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule-1);
}
.swap-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text-strong);
  letter-spacing: -0.015em;
}
.swap-title em {
  font-style: italic;
  color: var(--brand);
}
.swap-stage-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.swap-stage-label strong {
  color: var(--brand);
}

.swap-stages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--s-3) var(--s-6);
  border-bottom: 1px solid var(--rule-1);
}
.swap-stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-7);
  transition: all var(--dur-state) var(--ease-out);
}
.swap-stage-dot.done {
  background: var(--brand);
}
.swap-stage-dot.active {
  background: var(--brand);
  transform: scale(1.5);
  box-shadow: 0 0 8px rgba(13, 115, 119, 0.5);
}
.swap-stage-line {
  width: 32px;
  height: 1px;
  background: var(--ink-7);
}
.swap-stage-line.done {
  background: var(--brand);
}

.swap-body {
  padding: var(--s-5) var(--s-6);
}

.swap-leg {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--rule-1);
  border-radius: var(--r-3);
  padding: var(--s-3) var(--s-4);
  transition: border-color var(--dur-hover) var(--ease-out);
}
.swap-leg.focused {
  border-color: var(--brand-rule);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.swap-leg-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.swap-leg-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-hint);
}
.swap-leg-balance {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.swap-leg-balance .max {
  margin-left: 6px;
  color: var(--brand);
  font-weight: 500;
  cursor: pointer;
}
.swap-leg-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.swap-asset-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 5px 10px 5px 5px;
  background: white;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-3);
  cursor: pointer;
  transition: border-color var(--dur-hover) var(--ease-out);
  flex-shrink: 0;
}
.swap-asset-pill:hover {
  border-color: var(--brand-rule);
}
.swap-asset-pill .asset-mark {
  width: 22px;
  height: 22px;
  font-size: 11px;
  border-radius: 5px;
}
.swap-asset-pill-sym {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
}
.swap-asset-pill svg {
  width: 12px;
  height: 12px;
  color: var(--text-hint);
}
.swap-amount {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--text-strong);
  background: transparent;
  border: 0;
  outline: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  flex: 1;
  min-width: 0;
}
.swap-leg-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-hint);
}
.swap-leg-foot .if {
  color: var(--brand);
}
.swap-leg-foot .fiat {
  color: var(--text-tertiary);
}

.swap-direction {
  display: flex;
  justify-content: center;
  margin: -8px 0;
  position: relative;
  z-index: 2;
}
.swap-direction-btn {
  width: 36px;
  height: 36px;
  background: white;
  border: 1px solid var(--rule-2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  transition: all var(--dur-state) var(--ease-out);
  box-shadow: 0 2px 6px rgba(13, 30, 50, 0.08);
}
.swap-direction-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: rotate(180deg);
}
.swap-direction-btn svg {
  width: 16px;
  height: 16px;
}

/* Atomic composability route diagram */
.route {
  margin-top: var(--s-5);
  background: white;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-3);
  overflow: hidden;
}
.route-head {
  padding: var(--s-3) var(--s-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rule-1);
  background: rgba(13, 115, 119, 0.03);
}
.route-head-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--brand);
}
.route-head-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 5px rgba(13, 115, 119, 0.5);
}
.route-head-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}
.route-diagram {
  padding: var(--s-5) var(--s-4) var(--s-3);
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: var(--s-2);
  align-items: center;
}
.route-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.route-node-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  position: relative;
}
.route-node-icon.evm {
  background: linear-gradient(135deg, var(--blue-bright), var(--blue));
  box-shadow:
    0 4px 12px rgba(3, 83, 164, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.route-node-icon.gateway {
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  box-shadow:
    0 4px 14px rgba(13, 115, 119, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.route-node-icon.gateway::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 1px solid var(--brand);
  opacity: 0.3;
  animation: pulse-status 2.8s ease-out infinite;
}
.route-node-icon.michelson {
  background: linear-gradient(135deg, var(--mint-bright), var(--mint));
  box-shadow:
    0 4px 12px rgba(26, 147, 111, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.route-node-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}
.route-node-icon.gateway svg {
  width: 20px;
  height: 20px;
}
.route-node-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.route-node-detail {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-hint);
  text-align: center;
  max-width: 100px;
  line-height: 1.3;
}
.route-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  position: relative;
}
.route-arrow svg {
  width: 100%;
  max-width: 60px;
  height: 24px;
  color: var(--ink-5);
}
.route-arrow-label {
  position: absolute;
  top: -12px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  background: white;
  padding: 1px 6px;
  border-radius: 3px;
}
.route-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule-1);
  border-top: 1px solid var(--rule-1);
}
.route-stat {
  background: white;
  padding: var(--s-3) var(--s-4);
}
.route-stat-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-hint);
  margin-bottom: 2px;
}
.route-stat-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.route-stat-val.good {
  color: var(--positive);
}

.slippage {
  margin-top: var(--s-3);
  background: white;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-3);
  padding: var(--s-3) var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.slippage-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slippage-label-head {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.slippage-label-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-hint);
}
.slippage-opts {
  display: inline-flex;
  background: var(--ink-8);
  border-radius: var(--r-2);
  padding: 2px;
  gap: 1px;
}
.slip {
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  border-radius: 4px;
  transition: all var(--dur-hover) var(--ease-out);
}
.slip:hover {
  color: var(--text-strong);
}
.slip.active {
  background: white;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(13, 30, 50, 0.08);
}

.swap-sign {
  margin-top: var(--s-5);
  display: flex;
  gap: var(--s-2);
}
.btn-sign {
  flex: 2;
  height: 52px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-3);
  position: relative;
  overflow: hidden;
}
.btn-sign::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.32),
    transparent);
  animation: sign-shimmer 3.5s ease-in-out infinite;
}
@keyframes sign-shimmer {
  0%, 50% { left: -100%; }
  100% { left: 100%; }
}

/* ═════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ─────────────────────────────────────────────────────────────────────────
   Mobile-first composition. At ≤719px we are on a phone with the bottom
   tab bar active. At 720–899px we are on a tablet. At 900–1099px we are
   on a laptop with the sidebars showing but compressed. ≥1100px is the
   full desktop composition.
   ═════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1279px) {
  .transact {
    grid-template-columns: 260px 1fr 300px;
  }
}

@media (max-width: 1100px) {
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-6, .span-7, .span-8 { grid-column: span 12; }
  .transact {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-4);
  }
  .transact-side:first-child {
    display: none;
  }
}

@media (max-width: 899px) {
  .nav-meta { display: none; }
  .nav-mobile { display: block; }
  body { padding-bottom: 72px; }
  .chrome-search { max-width: none; }
  .brand-tier { display: none; }
  .grid-12 > * { grid-column: span 12; }
  .transact {
    grid-template-columns: 1fr;
  }
  .transact-side:last-child {
    display: none;
  }
  .surface-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .stat-strip {
    grid-template-columns: 1fr 1fr;
  }
  .pos-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 719px) {
  .chrome {
    height: var(--chrome-h-mobile);
    padding: 0 var(--s-4);
  }
  .nav-desktop {
    top: var(--chrome-h-mobile);
  }
  .brand-wordmark {
    font-size: 16px;
  }
  .brand-wordmark .os {
    font-size: 13px;
  }
  .chrome-search { display: none; }
  .wallet-pill .wallet-interface { display: none; }
  .wallet-pill .wallet-addr { font-size: 10px; }
  .wallet-pill .wallet-address:nth-of-type(2) { display: none; }
  .wallet-divider { display: none; }
  .wallet-dismiss { display: none; }
  .nav-desktop { display: none; }
  .surface {
    padding: var(--s-6) var(--s-4) var(--s-5);
  }
  .hero {
    padding: var(--s-5);
  }
  .alloc {
    padding: 0 var(--s-5) var(--s-5);
  }
  .head {
    padding: var(--s-3) var(--s-4);
  }
  .swap-body {
    padding: var(--s-4);
  }
  .swap-amount {
    font-size: 26px;
  }
  .route-diagram {
    grid-template-columns: 1fr;
    gap: var(--s-3);
  }
  .route-arrow {
    transform: rotate(90deg);
    width: 60px;
    margin: 0 auto;
  }
  .news-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .news-source,
  .news-time {
    padding-top: 0;
  }
  .ob-grid {
    grid-template-columns: 1fr 60px 80px;
  }
  .chart-svg-wrap {
    height: 240px;
  }
  .holdings {
    font-size: 11px;
  }
  .holdings thead th {
    padding: var(--s-2);
    font-size: 9px;
  }
  .holdings tbody td {
    padding: var(--s-2);
  }
  .asset-mark {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .toast-region {
    top: calc(var(--chrome-h-mobile) + var(--s-3));
    left: var(--s-4);
    right: var(--s-4);
    max-width: none;
  }
}
