/* TROYA AGENT — app (/agent). Shared component styles; page-specific styles live at the end, grouped by page. */
body.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.a-top { position: sticky; top: 0; z-index: 60; height: 56px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); }
/* the blur lives on a pseudo-element: a backdrop-filter on .a-top itself would trap the fixed mobile nav inside it */
.a-top::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(2, 4, 5, 0.82); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }
.a-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; justify-self: start; }
.a-brand .mark { width: 28px; height: 28px; margin: -3px 0; }
.a-nav { display: flex; gap: 2px; height: 56px; }
.a-nav a { position: relative; display: grid; place-items: center; padding: 0 11px; font-size: 13px; color: var(--muted); transition: color .2s; }
.a-nav a:hover { color: var(--fg); }
.a-nav a[aria-current="page"] { color: var(--fg); }
.a-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 1.5px; background: var(--blue-2); }
.a-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.chain-chip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line-2); font-size: 12px; color: var(--fg-2); }
.chain-chip .dot { width: 6px; height: 6px; animation: none; box-shadow: none; }
.chain-chip.off .dot { background: var(--faint); }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; color: var(--fg-2); position: relative; }
.icon-btn:hover { background: var(--bg-3); color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.x-link svg { width: 14px; height: 14px; }
.icon-btn .badge { position: absolute; top: 4px; right: 4px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--blue-2); color: #021014; font-size: 9px; font-weight: 600; display: grid; place-items: center; }
.wallet-btn { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line-3); font-size: 12.5px; color: var(--fg); background: var(--bg-2); }
.wallet-btn:hover { border-color: var(--blue); }
.wallet-btn svg { width: 15px; height: 15px; flex: none; }
.wallet-btn.on { border-color: rgba(95,211,239,.35); }
.wallet-btn .av { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(from 90deg, var(--blue), var(--deep), var(--blue-3), var(--blue)); }
.a-burger { display: none; }

/* ---------- page frame ---------- */
.a-main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px 64px; }
.a-main.wide { max-width: none; padding: 0 16px 40px; }
.page-head { position: relative; padding: 44px 0 26px; margin-bottom: 18px; isolation: isolate; }
.page-head::before { content: ""; position: absolute; z-index: -1; top: 0; right: -28px; width: min(760px, 70vw); height: 100%; min-height: 150px;
  background: url(/img/ribbon-head.jpg) right center / cover no-repeat; opacity: .55;
  -webkit-mask: linear-gradient(to left, #000 30%, transparent), linear-gradient(to bottom, #000 55%, transparent); -webkit-mask-composite: source-in;
  mask: linear-gradient(to left, #000 30%, transparent) intersect, linear-gradient(to bottom, #000 55%, transparent); pointer-events: none; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 12px; font-size: clamp(32px, 3.4vw, 46px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; max-width: 60em; }
.page-head .act { position: absolute; right: 0; bottom: 26px; display: flex; gap: 8px; }
.badge-s { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; border: 1px solid var(--line-3); font-size: 10.5px; font-weight: 500; letter-spacing: .02em; color: var(--fg-2); vertical-align: middle; }
.badge-s.blue { border-color: rgba(95,211,239,.4); color: var(--blue-3); background: rgba(95,211,239,.08); }
.badge-s.warn { border-color: rgba(242,194,107,.4); color: var(--warn); background: var(--warn-bg); }
.badge-s.down { border-color: rgba(255,107,125,.4); color: var(--down); background: var(--down-bg); }

/* ---------- footer + ask ---------- */
.a-foot { width: 100%; max-width: 1240px; margin: 0 auto; padding: 18px 28px 26px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; }
.a-foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.a-foot nav a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-3); }
.a-foot nav a:hover { color: var(--fg); }
.ask-fab { position: fixed; z-index: 70; right: 18px; bottom: 18px; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border-radius: 8px; border: 1px solid var(--line-3); background: rgba(10, 16, 19, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px rgba(0,0,0,.5); font-size: 12.5px; }
.ask-fab .mark { width: 18px; height: 18px; margin: -2px 0; }
.ask-fab kbd, kbd { font-family: var(--mono); font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px; background: var(--bg-2); }
.ask-fab:hover { border-color: var(--blue); }

/* ---------- primitives ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 7px; font-size: 13px; font-weight: 500; border: 1px solid var(--line-3); background: var(--bg-2); color: var(--fg); white-space: nowrap; transition: border-color .2s, background .2s; }
.btn:hover { border-color: var(--blue); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn.primary:hover { background: var(--ice); border-color: var(--ice); }
.btn.blue { background: var(--blue-2); border-color: var(--blue-2); color: #021014; }
.btn.blue:hover { background: var(--blue-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.ghost:hover { background: var(--bg-3); color: var(--fg); }
.btn.danger { border-color: rgba(255,107,125,.45); color: var(--down); background: transparent; }
.btn.danger:hover { background: var(--down-bg); }
.btn.big { height: 46px; font-size: 14.5px; width: 100%; border-radius: 9px; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 6px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.link { color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-3); font-size: inherit; }
.link:hover { color: var(--blue-3); text-decoration-color: var(--blue); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.fine { color: var(--faint); font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }

.panel { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px; }
.panel-h h2, .panel-h h3 { margin: 0; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.panel-b { padding: 8px 16px 16px; }
.info { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-3); color: var(--muted); font-size: 9px; display: inline-grid; place-items: center; cursor: help; font-style: normal; }

/* tabs (underline) + segmented control */
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { position: relative; padding: 8px 0 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--fg); }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--fg); }
.tabs [aria-selected="true"]::after, .tabs [aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px; background: var(--blue-2); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 12px; border-radius: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.seg.blue button[aria-pressed="true"] { background: var(--blue-2); color: #021014; }
.seg.long button[aria-pressed="true"][data-v="long"] { background: rgba(95,211,239,.18); color: var(--blue-3); box-shadow: inset 0 0 0 1px rgba(95,211,239,.45); }
.seg.long button[aria-pressed="true"][data-v="short"] { background: var(--down-bg); color: var(--down); box-shadow: inset 0 0 0 1px rgba(255,107,125,.45); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 11.5px; color: var(--fg-2); background: transparent; }
.chip:hover { border-color: var(--line-3); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip .ct { color: var(--faint); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .ct { color: var(--bg-4); }

/* inputs */
.input, .select { height: 34px; padding: 0 11px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg); font-size: 13px; outline: none; min-width: 0; }
.input:focus, .select:focus { border-color: var(--blue); }
.input::placeholder, textarea::placeholder { color: var(--faint); }
textarea.input { height: auto; padding: 10px 11px; resize: vertical; line-height: 1.45; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); }
.search { width: 280px; max-width: 100%; }

/* tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: right; font-weight: 400; color: var(--muted); font-size: 11.5px; padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); user-select: none; }
.tbl th.l, .tbl td.l { text-align: left; }
.tbl th.sort { cursor: pointer; }
.tbl th.sort:hover { color: var(--fg); }
.tbl th[aria-sort] { color: var(--fg); }
.tbl td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-2); }
.tbl .rank { color: var(--faint); width: 32px; }
.tok { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok-ico { width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--bg-4); color: var(--fg-2); display: grid; place-items: center; font-size: 10px; font-weight: 600; overflow: hidden; }
.tok-ico img { width: 100%; height: 100%; object-fit: cover; }
.tok-ico.sm { width: 20px; height: 20px; font-size: 8px; }
.tok b { font-weight: 500; display: block; }
.tok small { display: block; color: var(--muted); font-size: 11px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.pct { display: inline-block; min-width: 58px; padding: 2px 6px; border-radius: 4px; font-size: 11.5px; text-align: center; }
.pct.up { background: var(--up-bg); color: var(--up); }
.pct.down { background: var(--down-bg); color: var(--down); }
.pct.flat { background: var(--bg-3); color: var(--muted); }
.sub { display: block; color: var(--muted); font-size: 11px; }
.spark { width: 80px; height: 24px; display: inline-block; vertical-align: middle; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 0; font-size: 12px; color: var(--muted); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); }
.stat { padding: 14px 16px 16px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .k { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* skeleton + empty */
.sk { background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 6px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { display: grid; justify-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty b { color: var(--fg); font-weight: 500; font-size: 14px; }

/* modal / sheet */
.modal-bg { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(1, 3, 4, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 30px 90px rgba(0,0,0,.7); animation: pop .25s var(--ease); }
.modal.wide { width: min(640px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-h h2 { margin: 0; font-size: 16px; font-weight: 500; }
.modal-b { padding: 10px 18px 18px; }
.rows { display: grid; gap: 0; margin: 6px 0 14px; }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.rows > div > span:first-child { color: var(--muted); }
.rows > div > span:last-child { text-align: right; font-variant-numeric: tabular-nums; word-break: break-word; }
.alert { padding: 10px 12px; border-radius: 7px; font-size: 12.5px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2); }
.alert.warn { border-color: rgba(242,194,107,.35); background: var(--warn-bg); color: #f6dba5; }
.alert.error { border-color: rgba(255,107,125,.4); background: var(--down-bg); color: #ffc2ca; }
.alert.ok { border-color: rgba(95,211,239,.35); background: var(--up-bg); color: var(--ice); }

/* wallet picker */
.wl { display: grid; gap: 6px; }
.wl-item { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); text-align: left; font-size: 14px; }
.wl-item:hover { border-color: var(--blue); }
.wl-item img { width: 26px; height: 26px; border-radius: 6px; }
.wl-item em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); }

/* gate check card (Troya Gate) */
.gate-box { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.gate-box .gh { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 12.5px; margin-bottom: 4px; }
.gate-box ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.gate-box li { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.gate-box li b { font-weight: 500; }
.gate-box li.pass b { color: var(--up); }
.gate-box li.fail b { color: var(--down); }
.gate-box li.warn b { color: var(--warn); }

/* command palette / quick ask */
.palette { width: min(620px, 100%); }
.palette input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 18px; font-size: 15px; outline: none; }
.palette .opts { max-height: 320px; overflow: auto; padding: 6px; }
.palette .opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 7px; text-align: left; font-size: 13.5px; color: var(--fg-2); }
.palette .opt:hover, .palette .opt.sel { background: var(--bg-3); color: var(--fg); }
.palette .opt small { margin-left: auto; color: var(--faint); font-size: 11px; }

@media (max-width: 1100px) {
  .a-top { grid-template-columns: auto 1fr auto; }
  .a-nav { justify-self: start; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 860px) {
  .wallet-btn { white-space: nowrap; }
  .a-top { grid-template-columns: auto 1fr; padding: 0 12px; }
  .a-nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 56px; z-index: 65; justify-content: space-around; gap: 0; background: rgba(2,4,5,.95); border-top: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); overflow-x: auto; }
  .a-nav { justify-self: stretch; }
  .a-nav a { flex: 1 1 auto; padding: 0 2px; font-size: 10px; letter-spacing: -0.01em; }
  .a-nav a[aria-current="page"]::after { top: -1px; bottom: auto; }
  .chain-chip { display: none; }
  .a-main { padding: 0 16px 90px; }
  .a-foot { padding-bottom: 136px; }
  .ask-fab { bottom: 68px; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .page-head .act { position: static; margin-top: 14px; }
  .page-head::before { right: -16px; }
  .search { width: 100%; }
}

/* ---------- logos (tokens, coins, chains, launchpads, wallets) ---------- */
.tok-ico.has-img { background: var(--bg-4) !important; }
.tok-ico img, .chain-logo img, .pad-logo img, .wallet-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chain-logo, .pad-logo, .wallet-logo { display: inline-grid; place-items: center; flex: none; overflow: hidden; vertical-align: middle; }
.chain-logo { border-radius: 50%; background: var(--bg-4); }
.pad-logo { border-radius: 30%; background: var(--bg-4); color: var(--muted); font-size: 8px; font-weight: 600; }
.wallet-logo { border-radius: 7px; background: var(--bg-4); color: var(--fg-2); }
.wallet-logo svg { width: 60%; height: 60%; }
.wl-item .wallet-logo img { border-radius: 0; width: 100%; height: 100%; }
.tok-link { display: inline-flex; align-items: center; gap: 8px; }
.tok-link .tok-ico.sm { width: 18px; height: 18px; }
.seg-ico { display: inline-flex; align-items: center; gap: 7px; }
.pad-tag { display: inline-flex; align-items: center; gap: 4px; }
.pad-badge { display: inline-flex; align-items: center; gap: 6px; }
.chip .pad-logo { margin-right: 2px; }
.chip { gap: 6px; }
.stat .k .chain-logo { margin-right: 6px; }
.chain-chip .chain-logo { width: 16px; height: 16px; }
.chain-chip.off .chain-logo { opacity: .85; }
.tk-h .tok-ico.sm, .tk-h .chain-logo { width: 20px; height: 20px; }
.tok-ico.xs { width: 16px; height: 16px; font-size: 7px; }
.br-sym { display: inline-flex; align-items: center; gap: 7px; }
.stat .k .tok-ico.k-ico { width: 14px; height: 14px; margin-right: 6px; }
.tok-ico.k-big { width: 26px; height: 26px; }
.sig-t b.tok-link { gap: 7px; }
.sig-t b .tok-ico.sm { width: 16px; height: 16px; }
@media (max-width: 480px) { .wb-more { display: none; } .a-brand { white-space: nowrap; } }
@media (max-width: 360px) { .a-brand { font-size: 0; gap: 0; } }
