/* App pages (markets, coin, portfolio, pool…): same blacks, type and pills as the template. */
:root { --card: #0b0b0c; --line: #1a1a1f; --line2: #24242a; --mut: #8a8a93; --dim: #5c5c66; --pur: #8b5cf6; --up: #34d399; --dn: #f87171; --upbg: #0b3a2a; --dnbg: #3a0f16; }
.ap { box-sizing: border-box; width: 100%; max-width: 1312px; margin: 0 auto; padding: 132px 16px 120px; font-family: "Satoshi", sans-serif; color: #fff; font-size: 15px; }
.ap *, .ap *::before, .ap *::after { box-sizing: border-box; }
.ap a { color: inherit; text-decoration: none; }
.ap h1, .ap h2, .ap h3 { font-family: "TASA Orbiter", sans-serif; font-weight: 400; letter-spacing: -.03em; margin: 0; }
.ap h1 { font-size: clamp(38px, 4.2vw, 60px); line-height: 1.05; }
.ap h2 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; }
.ap h3 { font-size: 20px; line-height: 1.2; }
.ap .sub { color: var(--mut); font-size: 16px; line-height: 1.5; max-width: 560px; margin: 14px 0 0; }
.ap .head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.pad { padding: 22px; }
.mut { color: var(--mut); } .dim { color: var(--dim); } .up { color: var(--up); } .dn { color: var(--dn); }
.num { font-variant-numeric: tabular-nums; }

/* buttons: the template's white pill + trading sides */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 22px; border-radius: 48px; border: 0; background: #fff; color: #000; font: 500 14px/1 "Satoshi", sans-serif; letter-spacing: -.01em; cursor: pointer; transition: background .2s, opacity .2s, transform .15s; white-space: nowrap; }
.btn:hover { background: #e9e9ec; } .btn:active { transform: scale(.98); }
.btn.ghost { background: #141417; color: #fff; border: 1px solid var(--line2); } .btn.ghost:hover { background: #1b1b20; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.short { background: linear-gradient(90deg, #f26b5b, #c2413a); color: #fff; } .btn.short:hover { opacity: .9; }
.btn.long { background: linear-gradient(90deg, #34d399, #149a6c); color: #04130d; } .btn.long:hover { opacity: .9; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.chipb { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: #121215; color: #cfcfd4; font: 500 13px "Satoshi", sans-serif; cursor: pointer; }
.chipb.on, .chipb:hover { border-color: #3a3a44; color: #fff; background: #1a1a1f; }
.chipb[disabled] { opacity: .3; pointer-events: none; }

/* mode switch + balance (top of every app page) */
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; border-radius: 48px; background: #111114; border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 16px; border-radius: 48px; border: 0; background: none; color: var(--mut); font: 500 13px "Satoshi", sans-serif; cursor: pointer; }
.seg button.on { background: #fff; color: #000; }
.bal { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 48px; background: #111114; border: 1px solid var(--line); font-weight: 500; }
.bal img { width: 18px; height: 18px; border-radius: 50%; }

/* search */
.search { position: relative; flex: 1; min-width: 260px; max-width: 520px; }
.search input { width: 100%; height: 48px; border-radius: 48px; border: 1px solid var(--line2); background: #0d0d10; color: #fff; padding: 0 160px 0 20px; font: 400 15px "Satoshi", sans-serif; outline: none; text-overflow: ellipsis; }
.search input:focus { border-color: #4a4a55; }
.search .btn { position: absolute; right: 4px; top: 4px; height: 40px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font: 500 12px "Satoshi", sans-serif; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid #131317; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: #0f0f12; }
.tbl .r { text-align: right; }
.coin { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #1b1b1f; flex: none; }
.coin b { display: block; font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.coin small { display: block; color: var(--mut); font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 600; background: var(--upbg); color: var(--up); }
.pill.dn { background: var(--dnbg); color: var(--dn); }
.spk { width: 110px; height: 34px; display: block; }
.spk path { fill: none; stroke: var(--up); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.spk.dn path { stroke: var(--dn); }
.scroll { overflow-x: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.empty { padding: 48px 16px; text-align: center; color: var(--mut); }

/* coin page */
.cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.chead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chead > img { width: 64px; height: 64px; border-radius: 18px; object-fit: cover; background: #1b1b1f; }
.chead .px { font: 300 clamp(30px, 3vw, 44px)/1 "Satoshi", sans-serif; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: 16px; overflow: hidden; margin-top: 22px; }
.stats > div { background: var(--card); padding: 14px 16px; }
.stats small { display: block; color: var(--dim); font-size: 12px; margin-bottom: 4px; }
.stats b { font-weight: 600; }
.chart { position: relative; height: 380px; margin-top: 20px; padding: 16px 8px 8px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart text { font: 500 11px "Satoshi", sans-serif; fill: var(--dim); }
.chart .tf { position: absolute; right: 14px; top: 12px; display: flex; gap: 4px; z-index: 1; }
.ticket { position: sticky; top: 100px; padding: 18px; }
.ticket .seg { width: 100%; } .ticket .seg button { flex: 1; height: 40px; font-size: 14px; }
.ticket .seg button.on.s { background: linear-gradient(90deg, #f26b5b, #c2413a); color: #fff; }
.ticket .seg button.on.l { background: linear-gradient(90deg, #34d399, #149a6c); color: #04130d; }
.fld { margin-top: 16px; }
.fld label { display: flex; justify-content: space-between; color: var(--mut); font-size: 13px; margin-bottom: 8px; }
.inp { display: flex; align-items: center; height: 48px; border-radius: 12px; background: #121215; border: 1px solid var(--line2); padding: 0 14px; gap: 8px; }
.inp input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #fff; font: 500 16px "Satoshi", sans-serif; }
.inp span { color: var(--mut); font-size: 14px; }
.row2 { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.sum { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 9px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; } .sum span { color: var(--mut); }
.ticket .btn.go { width: 100%; height: 52px; margin-top: 18px; font-size: 15px; }
.note { margin-top: 12px; font-size: 13px; color: var(--mut); line-height: 1.45; }
.err { color: var(--dn); font-size: 13px; margin-top: 10px; min-height: 18px; }
.checks { display: grid; gap: 8px; font-size: 14px; }
.checks div { display: flex; justify-content: space-between; gap: 10px; }
.checks i { font-style: normal; } .checks .ok { color: var(--up); } .checks .no { color: var(--dn); }
.room { height: 8px; border-radius: 8px; background: #17171b; overflow: hidden; display: flex; margin: 10px 0 6px; }
.room i { display: block; height: 100%; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.status.off::before { background: var(--dn); }
.side { font-weight: 600; } .side.short { color: var(--dn); } .side.long { color: var(--up); }

/* portfolio / pool */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpis .card { padding: 20px; }
.kpis small { display: block; color: var(--dim); font-size: 13px; margin-bottom: 10px; }
.kpis b { font: 400 30px/1 "TASA Orbiter", sans-serif; letter-spacing: -.02em; }
.sect { margin-top: 28px; }
.sect > h3 { margin-bottom: 14px; }
.feed { display: grid; }
.feed div { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid #131317; font-size: 14px; }
.feed img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.feed .t { margin-left: auto; color: var(--dim); font-size: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* sheet (connect / deposit) */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; padding: 16px; }
.sheet.on { display: flex; }
.sheet .card { width: 100%; max-width: 420px; padding: 24px; }
.sheet h3 { margin-bottom: 8px; }
.sheet .x { float: right; background: none; border: 0; color: var(--mut); font-size: 22px; cursor: pointer; }
.wallets { display: grid; gap: 8px; margin-top: 16px; }
.wallets button { display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line2); background: #121215; color: #fff; font: 500 15px "Satoshi", sans-serif; cursor: pointer; }
.wallets button:hover { background: #18181c; }
.wallets img { width: 28px; height: 28px; border-radius: 8px; }

/* prose (how / legal) */
.prose { max-width: 760px; }
.prose h2 { margin: 48px 0 14px; } .prose h3 { margin: 28px 0 8px; }
.prose p, .prose li { color: #c9c9cf; line-height: 1.65; font-size: 16px; }
.prose ul { padding-left: 20px; }
.rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 24px; }
.rules .card { padding: 20px; } .rules h3 { margin-bottom: 8px; } .rules p { margin: 0; color: var(--mut); line-height: 1.55; font-size: 15px; }

@media (max-width: 1000px) {
  .cgrid { grid-template-columns: 1fr; } .ticket { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); } .two { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .ap { padding-top: 100px; } .rules { grid-template-columns: 1fr; }
  .hide-s { display: none; } .tbl td, .tbl th { padding: 12px 10px; }
  .kpis b { font-size: 24px; } .chart { height: 300px; }
}
.tpsl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpsl .inp { padding: 0 10px; gap: 6px; min-width: 0; }
.tpsl .inp span { font-size: 13px; flex: none; }
