/* App pages — same system as the landing: black canvas, #161616 panels, 1px #2b2b2b hairlines, Geist + Instrument Serif. */
.app { width: 1280px; max-width: calc(100% - 48px); margin: 0 auto; padding: 128px 0 0; display: flex; flex-direction: column; gap: 40px; min-height: 70vh; }
.app-head { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.app-head h1 { margin: 0; font-size: 56px; line-height: 58px; letter-spacing: -2.24px; font-weight: 400; }
.app-head .lede { margin: 0; max-width: 720px; font-size: 20px; line-height: 28px; letter-spacing: -.8px; color: var(--muted); }
.app-head.left { align-items: flex-start; text-align: left; }
.crumb { display: inline-flex; gap: 8px; padding: 9px 12px 9px 14px; border-radius: 100px; background: rgba(255, 255, 255, .07); font-family: var(--mono); font-size: 13px; line-height: 14px; color: #d9d9d9; }
.crumb a { color: #8a8a8a; } .crumb a:hover { color: #fff; }

.box { background: var(--panel); border-radius: 15px; box-shadow: inset 0 0 0 1px var(--line); padding: 24px; }
.box.flat { background: transparent; }
.box h2, .box h3 { margin: 0; font-weight: 400; }
.box-title { font-family: var(--serif); font-size: 32px; line-height: 38px; }
.box-sub { margin: 6px 0 0; color: var(--dim); font-size: 14px; line-height: 18px; }
.box-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--dim); text-transform: uppercase; }

/* Toolbar: segmented pills + search */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button, .seg a { display: inline-flex; align-items: center; height: 34px; padding: 7px 13px; border-radius: 99px; font-size: 14px; font-weight: 500; color: #7a7a7a; transition: color .2s, background-color .2s; }
.seg button:hover, .seg a:hover { color: #cfcfcf; }
.seg button[aria-pressed="true"], .seg a[aria-pressed="true"] { background: var(--tab); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.search { height: 38px; min-width: 240px; border-radius: 99px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); border: 0; padding: 0 16px; font-size: 14px; color: #fff; outline: 0; }
.search:focus { box-shadow: inset 0 0 0 1px #4a4a4a; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--dim); padding: 0 12px 12px; white-space: nowrap; letter-spacing: .02em; text-transform: uppercase; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl td { padding: 14px 12px; border-top: 1px solid #1f1f1f; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background-color .15s; cursor: pointer; }
.tbl tbody tr:hover { background: #1b1b1b; }
.tbl .asset { display: flex; align-items: center; gap: 12px; }
.tbl .asset .tok, .tbl .asset img.tok { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; flex-shrink: 0; }
.tbl .asset b { display: block; font-weight: 500; }
.tbl .asset small { display: block; font-family: var(--mono); font-size: 12px; color: var(--dim); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 99px; background: #1f1f1f; font-size: 12px; color: #cfcfcf; white-space: nowrap; }
.tag.green { background: rgba(20, 255, 0, .08); color: #8dff80; }
.tag.warn { background: rgba(245, 165, 36, .1); color: #f5c06a; }
.mini-bar { width: 90px; height: 4px; border-radius: 4px; background: #262626; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-bar i { display: block; height: 100%; background: var(--accent); }
.star { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #555; transition: color .2s; }
.star:hover { color: #aaa; } .star.on { color: #f5c542; }
.star svg { width: 16px; height: 16px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.note { font-size: 13px; line-height: 19px; color: var(--dim); }
.note a { color: #cfcfcf; text-decoration: underline; text-underline-offset: 2px; }
.empty { padding: 56px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty h3 { margin: 0; font-family: var(--serif); font-size: 32px; color: #fff; font-weight: 400; }
.skel { background: linear-gradient(90deg, #1a1a1a, #232323, #1a1a1a); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 6px; color: transparent !important; }
@keyframes skel { to { background-position: -200% 0; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > label, .field > .lbl { font-size: 14px; color: #d9d9d9; font-weight: 500; }
.field small { color: var(--dim); font-size: 12.5px; line-height: 17px; }
.input, .textarea, .select { width: 100%; height: 46px; border-radius: 10px; background: #0d0d0d; box-shadow: inset 0 0 0 1px var(--line); border: 0; padding: 0 14px; font-size: 15px; color: #fff; outline: 0; transition: box-shadow .2s; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus, .select:focus { box-shadow: inset 0 0 0 1px #5a5a5a; }
.input.big { height: 64px; font-size: 28px; letter-spacing: -.5px; font-family: var(--sans); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 20px; color: #d9d9d9; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 99px; font-size: 15px; font-weight: 600; background: #fff; color: #000; transition: background-color .2s, opacity .2s, transform .15s; }
.btn:hover { background: #e6e6e6; }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.dark { background: var(--btn); color: #fff; }
.btn.dark:hover { background: #3d3d42; }
.btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: #1b1b1b; }
.btn.wide { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.opt { text-align: left; padding: 12px; border-radius: 10px; background: #0d0d0d; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 2px; transition: box-shadow .2s, background-color .2s; }
.opt b { font-size: 14px; font-weight: 600; } .opt small { font-size: 11.5px; color: var(--dim); }
.opt:hover { background: #141414; }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 1px #fff; background: #151515; }
.opt:disabled { opacity: .4; cursor: not-allowed; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.callout { border-radius: 12px; padding: 14px 16px; background: #111; box-shadow: inset 0 0 0 1px var(--line); font-size: 13.5px; line-height: 20px; color: #cfcfcf; }
.callout.warn { box-shadow: inset 0 0 0 1px #4a3a1a; background: #15110a; }
.callout b { color: #fff; }
.steps-mini { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.steps-mini li { list-style: none; display: flex; gap: 10px; align-items: center; color: #8a8a8a; }
.steps-mini li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #333; flex-shrink: 0; }
.steps-mini li.on { color: #fff; } .steps-mini li.on::before { background: var(--warn); animation: blink 1s infinite; }
.steps-mini li.done { color: #cfcfcf; } .steps-mini li.done::before { background: var(--accent); }
.steps-mini li.err { color: #ff8a8a; } .steps-mini li.err::before { background: var(--down); }
@keyframes blink { 50% { opacity: .35; } }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--panel); border-radius: 15px; box-shadow: inset 0 0 0 1px var(--line); padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.stat .eyebrow { font-size: 11.5px; }
.stat b { font-family: var(--mono); font-size: 26px; line-height: 30px; font-weight: 500; letter-spacing: -.5px; }
.stat small { color: var(--dim); font-size: 12.5px; }

/* Tabs inside boxes */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid #1f1f1f; margin-bottom: 18px; overflow-x: auto; }
.subtabs button { padding: 10px 14px; font-size: 14px; color: #7a7a7a; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs button[aria-selected="true"] { color: #fff; border-color: #fff; }

/* Doc-style prose */
.prose { font-size: 17px; line-height: 27px; color: #cfcfcf; }
.prose h2 { font-family: var(--serif); font-size: 36px; line-height: 42px; color: #fff; margin: 48px 0 12px; font-weight: 400; scroll-margin-top: 110px; }
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--mono); font-size: 14px; background: #1a1a1a; padding: 2px 6px; border-radius: 5px; }
.prose a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.toc { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 4px; }
.toc a { font-size: 14px; color: #7a7a7a; padding: 6px 12px; border-radius: 8px; transition: color .2s, background-color .2s; }
.toc a:hover { color: #fff; } .toc a.on { color: #fff; background: #161616; }
.doc-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }

/* Modal (wallet picker, review) */
.modal-bg { position: fixed; z-index: 80; inset: 0; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-bg.open { opacity: 1; pointer-events: auto; }
.modal { width: 440px; max-width: 100%; max-height: calc(100vh - 32px); overflow: auto; background: #111; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px rgba(0, 0, 0, .6); padding: 24px; transform: translateY(8px); transition: transform .25s var(--ease-out); }
.modal-bg.open .modal { transform: none; }
.modal h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 30px; font-weight: 400; }
.modal .x { float: right; width: 32px; height: 32px; border-radius: 50%; color: #999; font-size: 20px; }
.modal .x:hover { background: #1f1f1f; color: #fff; }
.wallet-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.wallet-list button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #161616; box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 500; text-align: left; transition: background-color .2s; }
.wallet-list button:hover { background: #1d1d1d; }
.wallet-list img { width: 28px; height: 28px; border-radius: 7px; }
.wallet-list small { margin-left: auto; color: var(--dim); font-size: 12px; }

/* Chart */
.chart { position: relative; height: 320px; }
.chart canvas { width: 100%; height: 100%; display: block; }
.chart .tip { position: absolute; pointer-events: none; background: #0d0d0d; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; padding: 6px 9px; font-family: var(--mono); font-size: 11.5px; color: #ddd; white-space: nowrap; opacity: 0; transition: opacity .1s; }

@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > aside { position: static !important; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .doc-grid { grid-template-columns: 1fr; gap: 24px; }
  .toc { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .app { max-width: calc(100% - 32px); padding-top: 112px; gap: 28px; }
  .app-head h1 { font-size: 40px; line-height: 42px; letter-spacing: -1.4px; }
  .app-head .lede { font-size: 17px; line-height: 24px; }
  .grid-2, .grid-3, .row-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 20px; }
  .search { min-width: 0; width: 100%; }
  .box { padding: 18px; }
  .tbl td, .tbl th { padding-left: 8px; padding-right: 8px; }
}
