/* Radon⁸⁶ — app pages (world model, swap, developers) */

.app-main {
  padding-top: clamp(28px, 5vw, 56px);
  padding-bottom: 80px;
}

.app-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.app-top .lede {
  margin-top: 12px;
}

.app-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
}

.status-line[data-state='degraded'] .live-dot {
  background: var(--warn);
  animation: none;
}

.status-line[data-state='paused'] .live-dot,
.status-line[data-state='connecting'] .live-dot {
  background: var(--faint);
  animation: none;
}

.ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 14px 20px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.ticker div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.ticker dt {
  color: var(--muted);
  font-size: 12.5px;
}

.ticker dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  padding: 18px 20px 20px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  min-width: 0;
}

.stat dt {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat dd {
  margin: 0;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 560;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat dd small {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 560;
  letter-spacing: -0.015em;
}

.panel-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.panel + .panel,
.grid-main + .panel {
  margin-top: 18px;
}

.grid-main > .panel,
.side-stack > .panel {
  margin-top: 0;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 1080px) {
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.fills-scroll {
  max-height: 560px;
  overflow: auto;
}

.select,
.input {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  padding: 0 12px;
  font-size: 13.5px;
  min-width: 0;
}

.select:focus,
.input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Probes */
.probe {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.probe:last-child {
  border-bottom: 0;
}

.probe-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}

.probe-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 560;
}

.probe-sum {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.probe-sum b {
  color: var(--ink);
  font-weight: 560;
}

.venues {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.venue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  font-size: 12.5px;
}

.venue .lbl {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.venue .val {
  font-family: var(--mono);
  color: var(--muted);
}

.venue .bar {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 4px;
  background: var(--bg-2);
  overflow: hidden;
}

.venue .bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--line-2);
  transition: width 0.6s var(--ease);
}

.venue.best .bar i {
  background: var(--accent);
}

.venue.best .lbl {
  font-weight: 560;
}

/* Infrastructure */
.kv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.kv div {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.kv dt {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .kv {
    grid-template-columns: repeat(2, 1fr);
  }
}

.world-tools {
  display: flex;
  gap: 8px;
}

.world-tools .input {
  width: 200px;
}

.spread-bar {
  display: inline-block;
  width: 46px;
  height: 4px;
  border-radius: 4px;
  background: var(--bg-2);
  margin-left: 8px;
  vertical-align: middle;
  overflow: hidden;
}

.spread-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* ── Swap ─────────────────────────────────────────────── */

.swap-layout {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 960px) {
  .swap-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .swap-card {
    position: static;
  }
}

@media (max-width: 480px) {
  .swap-card {
    padding: 12px;
  }

  .amount-input,
  .amount-out {
    font-size: 26px;
  }

  .swap-details .slip button {
    padding: 0 7px;
  }
}

.swap-card {
  padding: 16px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.seg {
  display: inline-grid;
  grid-auto-flow: column;
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: var(--bg-2);
}

.seg button {
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 540;
  color: var(--muted);
}

.seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.swap-row {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.swap-row:focus-within {
  border-color: var(--line-2);
}

.swap-row-top,
.swap-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.swap-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 6px;
}

.amount-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 32px;
  font-weight: 520;
  letter-spacing: -0.03em;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.amount-input:focus {
  outline: none;
}

.amount-out {
  flex: 1;
  min-width: 0;
  font-size: 32px;
  font-weight: 520;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.amount-out.dim {
  color: var(--faint);
}

.token-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  font-weight: 600;
  font-size: 15px;
  flex: none;
}

.token-btn:hover {
  border-color: var(--ink);
}

.token-btn .sym-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.token-btn svg {
  width: 12px;
  height: 12px;
  color: var(--muted);
}

.link-btn {
  color: var(--accent-ink);
  font-size: 12.5px;
}

.link-btn:hover {
  text-decoration: underline;
}

.flip {
  display: grid;
  place-items: center;
  margin: -6px auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--surface);
  border: 4px solid var(--surface);
  position: relative;
  z-index: 1;
}

.flip span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--bg-2);
}

.flip svg {
  width: 14px;
  height: 14px;
}

.swap-details {
  margin: 14px 4px 4px;
  display: grid;
  gap: 8px;
  font-size: 13px;
}

.swap-details div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.swap-details dt {
  color: var(--muted);
}

.swap-details dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.slip {
  display: flex;
  gap: 6px;
}

.slip button {
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--mono);
  background: var(--bg-2);
  color: var(--muted);
}

.slip button[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.swap-cta {
  width: 100%;
  height: 52px;
  margin-top: 14px;
  font-size: 15.5px;
  border-radius: 16px;
}

.swap-msg {
  margin: 12px 4px 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.4em;
}

.swap-msg.err {
  color: var(--sell);
}

.swap-msg.ok {
  color: var(--buy);
}

.swap-msg a {
  color: var(--accent-ink);
  text-decoration: underline;
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.side-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.token-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.token-stats div {
  padding: 16px 20px;
  border-right: 1px solid var(--line);
}

.token-stats div:last-child {
  border-right: 0;
}

.token-stats dt {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.token-stats dd {
  margin: 0;
  font-size: 18px;
  font-weight: 560;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .token-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .token-stats div:nth-child(2) {
    border-right: 0;
  }

  .token-stats div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

.token-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
}

.token-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  text-align: left;
}

.token-list button:hover,
.token-list button:focus-visible {
  background: var(--bg-2);
}

.token-list .meta {
  flex: 1;
  min-width: 0;
}

.token-list .meta b {
  display: block;
  font-weight: 600;
}

.token-list .meta small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.token-list .px {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.wallet-list {
  display: grid;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.wallet-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  font-weight: 540;
}

.wallet-list button:hover {
  border-color: var(--ink);
}

.wallet-list img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.note {
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 0;
}

/* ── Developers ───────────────────────────────────────── */

.endpoint {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.endpoint:last-child {
  border-bottom: 0;
}

.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.endpoint-head code {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 560;
}

.method {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.endpoint p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 72ch;
}

.endpoint .try {
  margin-left: auto;
}

pre.code {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow: auto;
  max-height: 360px;
  white-space: pre;
}

.addr-table td:first-child {
  color: var(--muted);
}
