:root {
  --bg: #242322;
  --surface: #1B1B19;
  --surface-2: #282826;
  --surface-3: #232221;
  --line: rgba(239,239,237,.08);
  --line-strong: rgba(239,239,237,.15);
  --text: #EFEFED;
  --muted: #A6A5A3;
  --subtle: #8B8B89;
  --accent: #C0786C;
  --accent-ink: #1E1E1C;
  --positive: #8DB49A;
  --negative: #C0786C;
  --radius: 12px;
  --control: 8px;
  --font: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sidebar: 236px;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2, h3, p { margin: 0; }
svg { display: block; }
::selection { background: rgba(192,120,108,.28); }
.mono, .number, td, .stat-value { font-variant-numeric: tabular-nums; }
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 35; display: flex; width: var(--sidebar); flex-direction: column; padding: 20px 14px 14px; border-right: 1px solid var(--line); background: #1D1D1B; }
.brand, .mobile-brand { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 18px; font-weight: 600; letter-spacing: -.025em; }
.brand { padding: 0 10px; }
.brand img, .mobile-brand img { width: 27px; height: 27px; object-fit: contain; }
.side-nav { display: grid; gap: 4px; margin-top: 36px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px; border-radius: var(--control); background: transparent; color: var(--muted); text-align: left; font-size: 14px; font-weight: 500; transition: color .16s, background .16s; }
.nav-link svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.nav-link:first-child svg { fill: currentColor; stroke: none; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: rgba(192,120,108,.09); color: var(--accent); }
.nav-meta { margin-left: auto; color: var(--subtle); font-family: var(--mono); font-size: 11px; }
.sidebar-bottom { display: grid; gap: 8px; margin-top: auto; }
.account-bar { padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.account-identity { display: flex; align-items: center; gap: 10px; }
.account-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border: 1px solid rgba(192,120,108,.28); border-radius: var(--control); color: var(--accent); font-family: var(--mono); font-size: 14px; }
.account-identity div { display: grid; gap: 2px; }
.account-identity strong { font-size: 14px; font-weight: 600; }
.account-identity div span { color: var(--subtle); font-size: 11px; }
.account-equity { display: grid; gap: 4px; margin-top: 24px; }
.account-equity > span { color: var(--muted); font-size: 12px; }
.account-equity > strong { font-family: var(--mono); font-size: 24px; font-weight: 500; letter-spacing: -.045em; }
.account-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.account-metric { display: grid; gap: 4px; }
.account-metric > span { color: var(--subtle); font-size: 11px; }
.account-metric > strong { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.account-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--subtle); font-size: 11px; }
.account-preview button { min-height: 28px; padding: 0; background: transparent; color: var(--muted); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.api-link { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 0 10px; border-radius: var(--control); background: transparent; color: var(--subtle); font-size: 12px; }
.api-link:hover { background: var(--surface-2); color: var(--text); }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.mobile-account { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(36,35,34,.94); backdrop-filter: blur(16px); }
.mobile-brand { display: none; }
.workspace-search { display: flex; align-items: center; gap: 10px; width: min(430px, 48vw); height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--control); background: var(--surface); color: var(--subtle); text-align: left; font-size: 13px; }
.workspace-search:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.workspace-search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.workspace-search kbd { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--subtle); font-family: var(--mono); font-size: 10px; font-weight: 400; }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.network { display: inline-flex; align-items: center; gap: 7px; color: var(--subtle); font-family: var(--mono); font-size: 11px; }
.network i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--control); background: transparent; color: var(--muted); font-size: 22px; transition: color .16s, background .16s, border-color .16s; }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--control); font-size: 13px; font-weight: 600; transition: background .16s, border-color .16s, transform .16s; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--text); color: #262624; }
.button.primary:hover { background: #EDEDEB; }
.button.secondary { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.button.secondary:hover { background: var(--surface-3); }
.button.ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button.ghost:hover { background: var(--surface-2); color: var(--text); }
.button.compact { min-height: 36px; padding: 0 13px; font-size: 12px; }
.button.full { width: 100%; min-height: 44px; }

#app-main { width: 100%; min-height: calc(100vh - 88px); padding: 24px 24px 60px; }
.view { animation: view-in .2s var(--ease); }
@keyframes view-in { from { opacity: .65; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.view-heading h1 { font-size: 26px; font-weight: 500; letter-spacing: -.035em; line-height: 1.25; }
.view-heading p { max-width: 680px; margin-top: 6px; color: var(--muted); font-size: 14px; }
.heading-actions { display: flex; flex-shrink: 0; gap: 8px; }
.eyebrow { display: block; margin-bottom: 6px; color: var(--subtle); font-size: 12px; }
.demo-label { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-card { min-width: 0; padding: 20px; border-right: 1px solid var(--line); }
.stat-card:last-child { border-right: 0; }
.stat-label { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.stat-value { overflow: hidden; color: var(--text); font-family: var(--mono); font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -.045em; text-overflow: ellipsis; white-space: nowrap; }
.stat-detail { margin-top: 8px; color: var(--subtle); font-size: 11px; }
.stat-detail strong { font-weight: 500; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .72fr); gap: 12px; margin-bottom: 12px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-header h2, .panel-header h3 { font-size: 14px; font-weight: 600; }
.panel-header > span { color: var(--subtle); font-size: 12px; }
.panel-body { padding: 20px; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--control); background: #1D1D1B; }
.segmented button { min-width: 36px; min-height: 28px; padding: 0 8px; border-radius: 5px; background: transparent; color: var(--subtle); font-family: var(--mono); font-size: 11px; }
.segmented button.active { background: var(--surface-3); color: var(--text); }
.chart-wrap { position: relative; height: 280px; padding: 12px 8px 4px; }
.chart-wrap.large { height: 340px; }
.line-chart { width: 100%; height: 100%; overflow: visible; }
.line-chart .grid-line { stroke: rgba(239,239,237,.06); stroke-width: 1; }
.line-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.line-chart .point { fill: var(--accent); }
.chart-axis { display: flex; justify-content: space-between; padding: 0 18px 16px; color: var(--subtle); font-family: var(--mono); font-size: 11px; }
.allocation-list { display: grid; gap: 20px; }
.allocation-row { display: grid; gap: 8px; }
.allocation-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }
.allocation-meta span { color: var(--muted); }
.allocation-meta strong { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.allocation-track { height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.allocation-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.allocation-total { display: flex; justify-content: space-between; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.allocation-total strong { color: var(--text); font-family: var(--mono); font-weight: 500; }
.section-block { margin-top: 12px; }

.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filter-pills { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.filter-pills button { min-height: 32px; padding: 0 11px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.filter-pills button:hover { background: var(--surface-2); color: var(--text); }
.filter-pills button.active { background: var(--surface-3); color: var(--text); }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-field { display: flex; align-items: center; gap: 8px; width: 220px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--control); background: #1D1D1B; }
.search-field svg { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--subtle); stroke-width: 1.5; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-field input::placeholder { color: var(--subtle); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 5px); right: 0; z-index: 15; width: 176px; padding: 4px; border: 1px solid var(--line-strong); border-radius: var(--control); background: var(--surface-2); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.dropdown-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 5px; background: transparent; color: var(--muted); text-align: left; font-size: 13px; }
.dropdown-menu button:hover, .dropdown-menu button.active { background: var(--surface-3); color: var(--text); }
.table-scroll { overflow-x: auto; }
.market-table, .portfolio-table { width: 100%; border-collapse: collapse; }
.market-table th, .portfolio-table th { height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--subtle); font-size: 11px; font-weight: 500; text-align: right; white-space: nowrap; }
.market-table th:first-child, .portfolio-table th:first-child { padding-left: 18px; text-align: left; }
.market-table th:last-child, .portfolio-table th:last-child { padding-right: 18px; }
.market-table th button { padding: 0; background: transparent; color: inherit; font-size: inherit; }
.market-table td, .portfolio-table td { height: 64px; padding: 0 14px; border-bottom: 1px solid rgba(239,239,237,.055); font-family: var(--mono); font-size: 13px; text-align: right; white-space: nowrap; }
.market-table tbody tr:last-child td, .portfolio-table tbody tr:last-child td { border-bottom: 0; }
.market-table tbody tr, .portfolio-table tbody tr { cursor: pointer; transition: background .14s; }
.market-table tbody tr:hover, .portfolio-table tbody tr:hover { background: rgba(237,237,235,.025); }
.market-table td:first-child, .portfolio-table td:first-child { padding-left: 18px; text-align: left; }
.market-table td:last-child, .portfolio-table td:last-child { padding-right: 18px; }
.asset-cell { display: flex; align-items: center; gap: 12px; min-width: 180px; text-align: left; }
.token-icon { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #EDEDEB; object-fit: contain; }
.asset-copy { display: grid; gap: 3px; min-width: 0; }
.asset-copy strong { overflow: hidden; color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 600; text-overflow: ellipsis; }
.asset-copy span { overflow: hidden; max-width: 220px; color: var(--subtle); font-family: var(--font); font-size: 12px; text-overflow: ellipsis; }
.category-badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-family: var(--font); font-size: 11px; }
.row-action { min-width: 56px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-family: var(--font); font-size: 12px; }
tr:hover .row-action { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.empty-state { display: grid; place-items: center; min-height: 200px; padding: 32px; color: var(--muted); text-align: center; }
.empty-state strong { margin-bottom: 6px; color: var(--text); font-size: 14px; }
.empty-state p { font-size: 13px; }
.market-summary { display: flex; gap: 28px; margin: -8px 0 20px; color: var(--subtle); font-size: 12px; }
.market-summary strong { margin-left: 6px; color: var(--muted); font-family: var(--mono); font-weight: 500; }

.portfolio-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .72fr); gap: 12px; margin-bottom: 12px; }
.balance-card { padding: 24px; }
.balance-card .balance-label { color: var(--muted); font-size: 13px; }
.balance-number { margin: 10px 0; font-family: var(--mono); font-size: clamp(32px, 4vw, 44px); font-weight: 500; letter-spacing: -.055em; }
.balance-change { font-family: var(--mono); font-size: 13px; }
.balance-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.balance-details div { display: grid; gap: 5px; }
.balance-details span { color: var(--subtle); font-size: 12px; }
.balance-details strong { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.risk-list { display: grid; gap: 16px; }
.risk-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 13px; }
.risk-row strong { color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.risk-meter { height: 5px; margin: 20px 0 10px; border-radius: 3px; background: var(--surface-3); }
.risk-meter i { display: block; width: 24%; height: 100%; border-radius: inherit; background: var(--positive); }
.risk-note { color: var(--subtle); font-size: 12px; line-height: 1.7; }
.table-tabs { display: flex; align-items: center; gap: 20px; height: 100%; min-height: 48px; }
.table-tabs button { position: relative; align-self: stretch; padding: 0; background: transparent; color: var(--subtle); font-size: 13px; }
.table-tabs button.active { color: var(--text); }
.table-tabs button.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--accent); content: ""; }
.activity-list { display: grid; }
.activity-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: var(--control); color: var(--accent); font-family: var(--mono); font-size: 14px; }
.activity-copy { display: grid; gap: 3px; }
.activity-copy strong { font-size: 13px; font-weight: 500; }
.activity-copy span { color: var(--subtle); font-size: 12px; }
.activity-amount { font-family: var(--mono); font-size: 13px; }

.agent-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 12px; }
.chat-panel { display: flex; min-height: 620px; flex-direction: column; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 20px; max-height: 500px; overflow-y: auto; padding: 22px; }
.message { max-width: 82%; }
.message.user { align-self: flex-end; }
.message.agent { align-self: flex-start; }
.message-label { margin-bottom: 6px; color: var(--subtle); font-size: 11px; }
.message.user .message-label { text-align: right; }
.message-bubble { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: 14px; line-height: 1.75; }
.message.user .message-bubble { border-color: rgba(192,120,108,.16); background: rgba(192,120,108,.07); color: var(--text); }
.message-bubble strong { color: var(--text); font-weight: 600; }
.message-action { margin-top: 10px; }
.suggestion-list { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 22px 16px; }
.suggestion-list button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.suggestion-list button:hover { background: var(--surface-2); color: var(--text); }
.chat-composer { display: flex; gap: 8px; margin: 0 18px 18px; padding: 7px; border: 1px solid var(--line-strong); border-radius: var(--control); background: #1D1D1B; }
.chat-composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.chat-composer input::placeholder { color: var(--subtle); }
.agent-side { display: grid; align-content: start; gap: 12px; }
.mandate-list { display: grid; gap: 16px; }
.mandate-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 13px; }
.mandate-row strong { color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.toggle { position: relative; width: 36px; height: 24px; padding: 0; border-radius: 12px; background: var(--surface-3); }
.toggle::after { position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); content: ""; transition: transform .16s, background .16s; }
.toggle.on { background: rgba(192,120,108,.18); }
.toggle.on::after { background: var(--accent); transform: translateX(12px); }

.api-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; }
.endpoint-list { padding: 8px; }
.endpoint-button { display: grid; width: 100%; gap: 5px; padding: 12px; border-radius: var(--control); background: transparent; text-align: left; }
.endpoint-button:hover, .endpoint-button.active { background: var(--surface-2); }
.endpoint-button strong { color: var(--text); font-family: var(--mono); font-size: 12px; font-weight: 500; }
.endpoint-button span { color: var(--subtle); font-size: 12px; }
.method { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 22px; padding: 0 5px; border-radius: 5px; background: rgba(141,180,154,.1); color: var(--positive); font-family: var(--mono); font-size: 11px; }
.endpoint-title { display: flex; align-items: center; gap: 10px; }
.endpoint-title code { color: var(--text); font-family: var(--mono); font-size: 14px; }
.code-block { max-height: 500px; margin: 0; overflow: auto; padding: 20px; color: #D1D0CE; font-family: var(--mono); font-size: 12px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.api-note { padding: 16px 18px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 12px; line-height: 1.7; }

.campaign-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); min-height: 330px; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #1D1D1B; }
.campaign-copy { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 36px; }
.campaign-copy h2 { max-width: 600px; font-size: clamp(36px, 5vw, 64px); font-weight: 500; letter-spacing: -.055em; line-height: 1.02; }
.campaign-copy p { max-width: 520px; margin-top: 16px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.campaign-copy .actions { display: flex; gap: 8px; margin-top: 24px; }
.campaign-art { position: relative; min-height: 330px; background: linear-gradient(90deg, #1D1D1B 0%, rgba(29,29,27,.35) 55%, rgba(29,29,27,.1) 100%), url('/img/hero-transit.jpg') center 45% / cover; }
.campaign-status { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--accent); font-family: var(--mono); font-size: 12px; }
.campaign-status::before { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); content: ""; }
.campaign-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.campaign-facts div { padding: 20px; border-right: 1px solid var(--line); }
.campaign-facts div:last-child { border-right: 0; }
.campaign-facts span { display: block; margin-bottom: 8px; color: var(--subtle); font-size: 12px; }
.campaign-facts strong { font-family: var(--mono); font-size: 20px; font-weight: 500; }
.campaign-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 12px; }
.track-list { display: grid; }
.track-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 20px; border-bottom: 1px solid var(--line); }
.track-item:last-child { border-bottom: 0; }
.track-item h3 { font-size: 14px; font-weight: 600; }
.track-item p { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.track-reward { color: var(--accent); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.campaign-terms { color: var(--subtle); font-size: 13px; line-height: 1.8; }
.campaign-terms strong { display: block; margin-bottom: 8px; color: var(--text); font-weight: 600; }
.demo-activity { display: grid; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.demo-activity div { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.demo-activity strong { color: var(--text); font-family: var(--mono); font-weight: 500; }

.modal { width: calc(100% - 32px); max-width: 1080px; max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 32px 100px rgba(0,0,0,.65); }
.modal::backdrop { background: rgba(21,21,19,.78); backdrop-filter: blur(5px); }
.modal[open] { animation: modal-in .2s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.modal-header .icon-button { flex: none; }
.modal-copy { padding: 18px 22px 4px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.small-modal { max-width: 450px; padding-bottom: 20px; }
.small-modal form > .button, .small-modal > .button { width: calc(100% - 44px); margin: 20px 22px 0; }
.field-label { display: block; margin: 20px 22px 8px; color: var(--muted); font-size: 12px; }
.amount-field { display: flex; align-items: center; height: 56px; margin: 0 22px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--control); background: #1D1D1B; }
.amount-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 20px; }
.amount-field span { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.quick-amounts { display: flex; gap: 6px; margin: 8px 22px 20px; }
.quick-amounts button { min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.quick-amounts button:hover { background: var(--surface-2); color: var(--text); }
.form-row, .connection-detail { display: flex; justify-content: space-between; gap: 15px; margin: 0 22px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.form-row strong, .connection-detail strong { color: var(--text); font-weight: 500; text-align: right; }
.connection-detail { margin: 0; padding: 14px 22px; }
.small-modal > .connection-detail:first-of-type { margin-top: 16px; border-top: 1px solid var(--line); }
.market-modal-header { display: flex; align-items: center; gap: 13px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.market-modal-header .asset-cell { min-width: 0; }
.market-modal-header .token-icon { width: 38px; height: 38px; }
.market-modal-header .asset-copy strong { font-size: 15px; }
.market-modal-header .asset-copy span { max-width: none; font-size: 12px; }
.market-price { display: grid; gap: 2px; margin-left: auto; text-align: right; }
.market-price strong { font-family: var(--mono); font-size: 18px; font-weight: 500; }
.market-price span { font-family: var(--mono); font-size: 12px; }
.market-modal-header .icon-button { margin-left: 8px; }
.market-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.market-stats div { display: grid; gap: 4px; padding: 14px 20px; border-right: 1px solid var(--line); }
.market-stats div:last-child { border-right: 0; }
.market-stats span { color: var(--subtle); font-size: 11px; }
.market-stats strong { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.market-detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) 320px; }
.market-chart-side { min-width: 0; border-right: 1px solid var(--line); }
.market-chart-side .panel-header { border-bottom: 0; }
.trade-ticket { padding: 20px; }
.trade-ticket h3 { margin-bottom: 16px; font-size: 14px; font-weight: 600; }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.trade-sides button { min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.trade-sides button.active.long { border-color: rgba(141,180,154,.25); background: rgba(141,180,154,.09); color: var(--positive); }
.trade-sides button.active.short { border-color: rgba(192,120,108,.25); background: rgba(192,120,108,.09); color: var(--negative); }
.ticket-label { display: flex; justify-content: space-between; margin: 12px 0 8px; color: var(--muted); font-size: 11px; }
.ticket-label button { padding: 0; background: transparent; color: var(--accent); font-family: var(--mono); font-size: 11px; }
.ticket-input { display: flex; align-items: center; height: 44px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--control); background: #1D1D1B; }
.ticket-input input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 14px; }
.ticket-input span { color: var(--subtle); font-family: var(--mono); font-size: 11px; }
.ticket-summary { display: grid; gap: 10px; margin: 16px 0; }
.ticket-summary div { display: flex; justify-content: space-between; gap: 12px; color: var(--subtle); font-size: 11px; }
.ticket-summary strong { color: var(--muted); font-family: var(--mono); font-weight: 500; }
.ticket-error { min-height: 18px; margin-bottom: 5px; color: var(--negative); font-size: 11px; }
.demo-disclaimer { margin-top: 12px; color: var(--subtle); font-size: 11px; line-height: 1.6; text-align: center; }
.search-modal { max-width: 620px; overflow: hidden; }
.search-box { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.search-box svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.key-hint { min-height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; background: transparent; color: var(--subtle); font-family: var(--mono); font-size: 11px; }
.search-results { max-height: 420px; overflow-y: auto; padding: 7px; }
.search-result { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 56px; padding: 7px 10px; border-radius: var(--control); background: transparent; text-align: left; }
.search-result:hover, .search-result.selected { background: var(--surface-2); }
.search-result .asset-copy { flex: 1; }
.search-result > span { color: var(--subtle); font-family: var(--mono); font-size: 12px; }
.search-empty { padding: 36px; color: var(--muted); text-align: center; font-size: 14px; }
.toast-region { position: fixed; right: 20px; bottom: 44px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 360px; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--control); background: var(--surface-2); box-shadow: 0 16px 40px rgba(0,0,0,.4); color: var(--text); font-size: 13px; animation: toast-in .2s var(--ease); }
.toast::before { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--positive); content: ""; }
.toast.error::before { background: var(--negative); }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.statusbar { position: fixed; right: 0; bottom: 0; left: var(--sidebar); z-index: 25; display: flex; align-items: center; justify-content: space-between; height: 28px; padding: 0 14px; border-top: 1px solid var(--line); background: #1D1D1B; color: var(--subtle); font-family: var(--mono); font-size: 10px; }
.statusbar span { display: flex; align-items: center; gap: 6px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--positive); }
.statusbar button { padding: 0; background: transparent; color: var(--subtle); font-family: inherit; font-size: inherit; }
.mobile-nav { display: none; }
.loading-view { padding-top: 12px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
.skeleton-title { width: 280px; height: 44px; margin-bottom: 24px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.skeleton-grid .skeleton { height: 120px; }
.skeleton-table { height: 400px; margin-top: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.defi-tabs-bar { display: flex; align-items: center; min-height: 48px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.defi-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.defi-actions { display: flex; gap: 8px; margin-top: 22px; }
.automation-note { margin-top: 12px; }
.inline-max { padding: 0; background: transparent; color: var(--accent); font-family: var(--mono); font-size: 11px; }
.leverage-range { width: calc(100% - 44px); margin: 0 22px 18px; accent-color: var(--accent); }
#defi-dialog-content { padding-bottom: 20px; }
#defi-dialog-content #defi-submit { width: calc(100% - 44px); margin: 8px 22px 0; }
#defi-dialog-content .demo-disclaimer { padding: 0 22px; }
#defi-dialog-content .ticket-error { margin: 12px 22px 0; }
#defi-dialog-content .field-label strong { float: right; color: var(--accent); font-family: var(--mono); font-weight: 500; }
.swap-layout { display: grid; grid-template-columns: minmax(400px, 480px) minmax(280px, 1fr); gap: 12px; }
.swap-form { padding: 20px; }
.swap-field { padding: 15px; border: 1px solid var(--line); border-radius: var(--control); background: #1D1D1B; }
.swap-input-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.swap-input-row input, .swap-input-row output { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 24px; font-weight: 500; }
.swap-asset { display: flex; align-items: center; gap: 8px; min-width: 92px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.swap-asset img { width: 23px; height: 23px; border-radius: 50%; }
.swap-asset strong { font-size: 13px; font-weight: 600; }
.swap-flip { display: grid; place-items: center; width: 36px; height: 36px; margin: -4px auto; border: 1px solid var(--line-strong); border-radius: var(--control); background: var(--surface-2); color: var(--muted); font-size: 17px; }
.swap-flip:hover { color: var(--text); background: var(--surface-3); }
.asset-choices { display: flex; gap: 6px; margin: 14px 0 4px; }
.asset-choices button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.asset-choices button.active { border-color: rgba(192,120,108,.28); background: rgba(192,120,108,.08); color: var(--accent); }
.asset-choices img { width: 17px; height: 17px; border-radius: 50%; }
.route-line { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.route-line strong { color: var(--text); font-family: var(--mono); font-weight: 500; }
.route-track { height: 5px; margin-bottom: 20px; border-radius: 3px; background: var(--surface-3); }
.route-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.route-facts { display: grid; gap: 14px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.route-facts div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.route-facts strong { color: var(--text); font-family: var(--mono); font-weight: 500; }
.dialog-tabs { display: flex; gap: 5px; margin: 18px 22px 0; padding: 4px; border: 1px solid var(--line); border-radius: var(--control); background: #1D1D1B; }
.dialog-tabs button { flex: 1; min-height: 32px; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; }
.dialog-tabs button.active { background: var(--surface-3); color: var(--text); }
.chain-options { display: flex; gap: 6px; margin: 0 22px 8px; }
.chain-options button { flex: 1; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.chain-options button.active { border-color: rgba(192,120,108,.3); background: rgba(192,120,108,.08); color: var(--accent); }

@media (min-width: 1700px) {
  :root { --sidebar: 248px; }
  #app-main { padding: 32px; }
  .view-heading h1 { font-size: 30px; }
  .chart-wrap { height: 320px; }
  .stat-card { padding: 24px; }
}

@media (max-width: 1100px) {
  :root { --sidebar: 212px; }
  .sidebar { padding-right: 10px; padding-left: 10px; }
  .account-bar { padding: 13px; }
  .account-equity > strong { font-size: 21px; }
  .overview-grid, .portfolio-grid, .agent-layout, .campaign-grid { grid-template-columns: minmax(0, 1.35fr) minmax(250px, .75fr); }
  .defi-layout, .swap-layout { grid-template-columns: 1fr; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .search-field { width: 100%; }
  .market-table .hide-medium, .portfolio-table .hide-medium { display: none; }
}

@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; }
  .mobile-brand { display: flex; font-size: 16px; }
  .mobile-brand img { width: 24px; height: 24px; }
  .mobile-account { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--muted); text-align: left; font-size: 12px; }
  .mobile-account strong { color: var(--text); font-size: 14px; font-weight: 500; }
  .topbar { height: 56px; padding: 0 14px; }
  .workspace-search { width: min(360px, 45vw); }
  .statusbar { left: 0; bottom: 64px; height: 32px; }
  .statusbar button { min-height: 32px; }
  .mobile-nav { position: fixed; right: 0; bottom: 0; left: 0; z-index: 35; display: grid; grid-template-columns: repeat(6, 1fr); height: 64px; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(29,29,27,.98); backdrop-filter: blur(16px); }
  .mobile-nav button { display: grid; place-items: center; align-content: center; gap: 4px; background: transparent; color: var(--subtle); font-size: 10px; }
  .mobile-nav button.active { color: var(--accent); }
  .mobile-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
  #app-main { padding-bottom: 116px; }
  .toast-region { bottom: 108px; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  .topbar { gap: 10px; }
  .workspace-search { width: 36px; flex: none; padding: 0 10px; }
  .workspace-search span, .workspace-search kbd, .network { display: none; }
  .top-actions { gap: 8px; }
  #app-main { padding: 20px 12px 112px; }
  .view-heading { gap: 16px; margin-bottom: 20px; }
  .view-heading h1 { font-size: 24px; }
  .view-heading p { font-size: 13px; line-height: 1.65; }
  .heading-actions .button.secondary { display: none; }
  .heading-actions .button { padding: 0 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .stat-card { padding: 16px; border-bottom: 1px solid var(--line); }
  .stat-card:nth-child(2) { border-right: 0; }
  .stat-card:nth-child(n+3) { border-bottom: 0; }
  .stat-value { font-size: 19px; }
  .stat-detail { font-size: 10px; }
  .overview-grid, .portfolio-grid, .agent-layout, .api-layout, .campaign-grid { grid-template-columns: 1fr; gap: 8px; }
  .panel-header { min-height: 48px; padding: 0 14px; }
  .segmented button { min-height: 36px; }
  .panel-body { padding: 16px; }
  .chart-wrap { height: 220px; }
  .chart-wrap.large { height: 240px; }
  .allocation-panel { display: none; }
  .table-toolbar { gap: 10px; padding: 10px; }
  .filter-pills { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .filter-pills button { min-height: 36px; flex: none; }
  .dropdown { flex: none; }
  .market-table th, .portfolio-table th { height: 36px; padding: 0 10px; font-size: 10px; }
  .market-table td, .portfolio-table td { height: 64px; padding: 0 10px; font-size: 12px; }
  .market-table td:first-child, .portfolio-table td:first-child { padding-left: 12px; }
  .market-table td:last-child, .portfolio-table td:last-child { padding-right: 12px; }
  .market-table .hide-small, .portfolio-table .hide-small { display: none; }
  .market-table th:nth-child(2), .market-table td:nth-child(2) { display: none; }
  .portfolio-table th:nth-child(2), .portfolio-table td:nth-child(2), .portfolio-table th:nth-child(3), .portfolio-table td:nth-child(3), .portfolio-table th:last-child, .portfolio-table td:last-child { display: none; }
  .asset-cell { min-width: 144px; gap: 9px; }
  .asset-copy strong { font-size: 13px; }
  .asset-copy span { max-width: 140px; font-size: 11px; }
  .token-icon { width: 28px; height: 28px; }
  .category-badge { font-size: 10px; }
  .row-action { min-width: 48px; min-height: 36px; }
  .balance-card { padding: 20px; }
  .balance-number { font-size: 32px; }
  .balance-details { gap: 8px; }
  .balance-details strong { font-size: 11px; }
  .chat-panel { min-height: 580px; }
  .chat-messages { padding: 16px; }
  .message { max-width: 92%; }
  .suggestion-list { padding: 0 16px 13px; }
  .suggestion-list button { min-height: 36px; }
  .chat-composer { margin: 0 12px 12px; }
  .chat-composer input { font-size: 16px; }
  .api-layout .endpoint-list { display: flex; overflow-x: auto; }
  .endpoint-button { min-width: 190px; }
  .campaign-hero { grid-template-columns: 1fr; min-height: 400px; }
  .campaign-copy { z-index: 2; padding: 24px; background: rgba(29,29,27,.72); }
  .campaign-copy h2 { font-size: 40px; }
  .campaign-art { position: absolute; inset: 0; min-height: 0; background: url('/img/hero-transit.jpg') center / cover; }
  .campaign-facts { grid-template-columns: 1fr; }
  .campaign-facts div { border-right: 0; border-bottom: 1px solid var(--line); }
  .campaign-facts div:last-child { border-bottom: 0; }
  .track-item { grid-template-columns: 1fr; gap: 10px; }
  .modal { width: 100%; max-width: none; max-height: 88dvh; margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 16px 16px 0 0; }
  .market-detail-grid { grid-template-columns: 1fr; }
  .market-chart-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .market-chart-side .chart-wrap.large { height: 190px; }
  .market-chart-side .chart-axis { display: none; }
  .market-stats { grid-template-columns: repeat(2, 1fr); }
  .market-stats div:nth-child(2) { border-right: 0; }
  .market-stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .market-modal-header { padding: 14px; }
  .market-modal-header .asset-copy span { max-width: 150px; }
  .market-price strong { font-size: 14px; }
  .trade-ticket { padding: 16px 16px 82px; }
  .trade-ticket > .button.full { position: fixed; right: 0; bottom: 0; left: 0; z-index: 5; width: 100%; min-height: 56px; border-radius: 0; }
  .search-modal { width: calc(100% - 24px); margin: 12vh auto auto; border: 1px solid var(--line-strong); border-radius: 12px; }
  .amount-field input { font-size: 16px; }
  .quick-amounts button { min-height: 36px; }
  .status-center { display: none !important; }
  .toast-region { right: 12px; left: 12px; }
  .toast { max-width: none; }
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
