/* ═══════════════════════════════════════════════════════════════
   crated — the web version. Sits on top of site.css (tokens, nav,
   pills, chart, box, ledger). Wide layout: main panel + sticky side
   panel, cards on the pale field, modals instead of sheets.
   ═══════════════════════════════════════════════════════════════ */
.appw { padding-top: 112px; min-height: 100vh; }
.nav nav a { padding: 8px 4px; position: relative; transition: color .2s; }
.nav nav a.on { color: var(--ink); font-weight: 600; }
.nav nav a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--ink); }
.wal i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); }
.wal.on { background: rgba(255,255,255,.75); color: var(--ink); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(23,12,34,.08); }
.wal.on i { background: var(--up-2); box-shadow: 0 0 0 3px rgba(28,192,109,.18); }

.view { display: none; }
.view.on { display: block; animation: vin .5s var(--ease); }
@keyframes vin { from { opacity: 0; transform: translateY(10px); } }

.pg-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin: 10px 0 28px; }
.pg-h h1 { font-size: clamp(36px, 4vw, 56px); letter-spacing: -.045em; line-height: 1; font-weight: 600; }
.pg-h p { max-width: 400px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }

.card { background: #fff; border-radius: 26px; padding: 22px; box-shadow: 0 24px 50px -36px rgba(90,30,140,.45), 0 0 0 1px rgba(23,12,34,.03); }
.lay { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.side { position: sticky; top: 92px; }
.wide { width: 100%; }
.pill[disabled] { opacity: .4; pointer-events: none; }

/* ── explore detail ── */
.det { padding: 24px 0 8px; }
.det-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 0 24px; }
.det-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.det-id h2 { font-size: 26px; letter-spacing: -.035em; font-weight: 600; }
.det-id small { font-size: 13.5px; color: var(--mut); }
.det-lv { text-align: right; }
.det-lv b { display: block; font-size: 40px; font-weight: 650; letter-spacing: -.045em; line-height: 1; }
.det-lv small { font-size: 13px; font-weight: 600; }
.det-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px 0; }
.rsel { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--soft); }
.rsel button { height: 30px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 550; color: var(--mut); }
.rsel button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); }
.hdate { font-size: 13px; color: var(--mut); }
.chart.big { height: 330px; margin-top: 6px; cursor: crosshair; }
.chart .tip { position: absolute; pointer-events: none; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: var(--ink); color: #fff; transform: translate(-50%, -120%); opacity: 0; white-space: nowrap; }
.chart.hov .tip { opacity: 1; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 14px 24px 0; border-radius: 18px; overflow: hidden; background: var(--line); }
.stats div { background: #fff; padding: 14px 16px; }
.stats small { display: block; font-size: 12px; color: var(--mut); }
.stats b { display: block; margin-top: 4px; font-size: 18px; letter-spacing: -.025em; font-weight: 600; }
.stats a { color: var(--blue); }
table.legs { width: calc(100% - 48px); margin: 14px 24px 12px; border-collapse: collapse; font-size: 14.5px; }
.legs th { text-align: left; font-size: 12px; font-weight: 500; color: var(--mut); padding: 10px 0; border-bottom: 1px solid var(--line); }
.legs td { padding: 11px 0; border-bottom: 1px solid var(--line); }
.legs tr:last-child td { border-bottom: 0; }
.legs th:not(:first-child), .legs td:not(:first-child) { text-align: right; }
.legs .nm { display: flex; align-items: center; gap: 12px; }
.legs .nm img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.legs .nm b { font-weight: 600; } .legs .nm small { display: block; color: var(--mut); font-size: 12px; }
.wbar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 9px; background: var(--soft); margin-right: 10px; position: relative; overflow: hidden; }
.wbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 9px; }
.stack .more { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; margin-left: -9px; background: var(--soft); display: grid; place-items: center; font-size: 10.5px; font-weight: 650; color: var(--ink-2); }

/* ── trade panel ── */
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--soft); }
.tabs2 button { height: 40px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--mut); }
.tabs2 button.on.b { background: linear-gradient(180deg, var(--up-2), var(--up)); color: #fff; box-shadow: 0 6px 14px -8px rgba(23,160,90,.7); }
.tabs2 button.on.s { background: linear-gradient(180deg, var(--down-2), var(--down)); color: #fff; box-shadow: 0 6px 14px -8px rgba(224,70,74,.7); }
.t-lbl { display: flex; justify-content: space-between; margin: 20px 2px 6px; font-size: 12.5px; color: var(--mut); }
.amt { display: flex; align-items: baseline; gap: 4px; padding: 6px 16px; border-radius: 18px; background: var(--soft); }
.amt span { font-size: 28px; font-weight: 550; color: var(--mut-2); }
.amt input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 36px; font-weight: 600; letter-spacing: -.045em; background: none; color: var(--ink); padding: 4px 0; }
.chips { display: flex; gap: 6px; margin: 10px 0 6px; }
.chips button { flex: 1; height: 34px; border-radius: 999px; background: var(--soft); font-size: 13px; font-weight: 550; }
.chips button.on { background: var(--ink); color: #fff; }
.split { margin: 6px 0 14px; }
.sp { display: grid; grid-template-columns: 28px 1fr auto 18px; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.sp:last-child { border-bottom: 0; }
.sp img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.sp b { font-weight: 600; } .sp small { color: var(--mut); font-size: 12px; }
.sp .q { text-align: right; color: var(--ink-2); font-size: 12.5px; }
.st { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.st.wait { box-shadow: inset 0 0 0 2px var(--line); }
.st.spin { border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.st.ok { background: var(--up); }
.st.ok::after { content: ''; width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.st.fail { background: var(--down); }
.st.fail::after { content: '!'; color: #fff; font-size: 11px; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.go { width: 100%; height: 52px; border-radius: 999px; font-size: 15.5px; font-weight: 600; color: #fff; transition: transform .2s var(--spring), opacity .2s; }
.go:active { transform: scale(.98); }
.go.b { background: linear-gradient(180deg, var(--up-2), var(--up)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 24px -12px rgba(23,160,90,.7); }
.go.s { background: linear-gradient(180deg, var(--down-2), var(--down)); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 24px -12px rgba(224,70,74,.7); }
.go.k { background: linear-gradient(180deg, #2e1d40, #140a1f); }
.go[disabled], .go.busy { opacity: .55; pointer-events: none; }
.t-note { margin-top: 12px; font-size: 12.5px; line-height: 1.5; color: var(--mut); }
.t-note a { color: var(--blue); }

/* ── crate grid (from site.css .cr) ── */
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin: 56px 2px 16px; }
.sec-h h2 { font-size: 28px; letter-spacing: -.035em; }
.sec-h span { font-size: 13.5px; color: var(--mut); }
.cr { cursor: pointer; text-align: left; width: 100%; font: inherit; color: inherit; }
.cr.sel { box-shadow: 0 0 0 2px var(--blue), 0 24px 50px -36px rgba(90,30,140,.5); }
.empty-row { grid-column: 1 / -1; padding: 28px; text-align: center; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); background: #fff; border-radius: 22px; box-shadow: 0 20px 40px -32px rgba(90,30,140,.45); }
.empty-row a, .empty-row button { color: var(--blue); font-weight: 600; }

/* ── create ── */
.picker { padding: 18px; }
.pk-h { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.srch { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 999px; background: var(--soft); }
.srch svg { width: 18px; height: 18px; fill: none; stroke: var(--mut); stroke-width: 2; stroke-linecap: round; }
.srch input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); }
.count { font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: #fcf9fe; text-align: left; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s, transform .2s var(--spring); }
.tile:hover { background: #fff; box-shadow: inset 0 0 0 1px rgba(23,12,34,.16), 0 10px 20px -16px rgba(90,30,140,.5); }
.tile:active { transform: scale(.98); }
.tile.on { background: #fff; box-shadow: inset 0 0 0 2px var(--ink), 0 10px 20px -16px rgba(90,30,140,.5); }
.tile img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.tile b { display: block; font-size: 15px; font-weight: 600; }
.tile small { display: block; font-size: 12px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .px { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.tile .chk { position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; }
.tile .chk svg { width: 14px; height: 14px; }
.tile.on .chk { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--ink); }
.tile.on .chk svg { stroke: #fff; stroke-dashoffset: 0; }
.tiles .none { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--mut); }

.builder { padding: 0; overflow: hidden; }
.stage { position: relative; isolation: isolate; height: 220px; display: grid; place-items: center; overflow: hidden; }
.stage .scene { transform: translateY(16px); }
.b-body { padding: 18px 20px 20px; }
.lbl { display: block; font-size: 12.5px; color: var(--mut); margin-bottom: 12px; }
.lbl input { display: block; width: 100%; margin-top: 6px; height: 46px; padding: 0 14px; border: 0; outline: 0; border-radius: 14px; background: var(--soft); font: inherit; font-size: 16px; color: var(--ink); }
.symw { display: flex; align-items: center; margin-top: 6px; border-radius: 14px; background: var(--soft); padding-left: 14px; font-size: 16px; color: var(--ink); }
.symw input { margin: 0; padding-left: 4px; text-transform: uppercase; background: none; }
.symw input::placeholder { text-transform: none; }
.lbl input:focus, .symw:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink); }
.hint { font-size: 12.5px; color: var(--mut); line-height: 1.5; margin: 0 2px 10px; }
.hint.bad { color: var(--down); }
.hint a { color: var(--blue); }
.alloc-h { margin-top: 6px; }
.alloc { max-height: 300px; overflow-y: auto; margin: 0 -4px 10px; padding: 0 4px; }
.al-h img { width: 30px; height: 30px; }
.bt { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--mut); margin: 4px 2px 12px; }
.bt b { color: var(--ink); font-size: 14px; }
.done { text-align: center; padding: 10px 0 4px; }
.done .tick { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%; background: linear-gradient(180deg, var(--up-2), var(--up)); display: grid; place-items: center; }
.done .tick svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done b { font-size: 20px; letter-spacing: -.03em; }
.done p { color: var(--mut); font-size: 14px; margin: 6px 0 14px; line-height: 1.5; }
.done .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── swap ── */
.swapw { max-width: 500px; margin: 0 auto; }
.swap { position: relative; }
.sw-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-radius: 20px; background: var(--soft); }
.sw-row + .flip + .sw-row { margin-top: 6px; }
.sw-l { min-width: 0; flex: 1; }
.sw-l small { font-size: 12.5px; color: var(--mut); }
.sw-l input, .sw-l .out { display: block; width: 100%; border: 0; outline: 0; font: inherit; font-size: 32px; font-weight: 600; letter-spacing: -.04em; margin-top: 4px; background: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-l em { display: block; font-family: var(--sans); font-style: normal; font-size: 12.5px; color: var(--mut); min-height: 16px; }
.sw-r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.max { font-size: 12px; color: var(--mut); } .max span { color: var(--ink-2); font-weight: 550; }
.tok { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px 0 5px; border-radius: 999px; background: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 0 0 1px var(--line); }
.tok img { width: 32px; height: 32px; border-radius: 50%; }
.tok::after { content: ''; width: 7px; height: 7px; border-right: 1.8px solid var(--ink-2); border-bottom: 1.8px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); margin-left: 2px; }
.flip { position: relative; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; margin: -14px auto; border-radius: 14px; background: #fff; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line); }
.flip svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kv { margin: 14px 4px 16px; }
.kv div { display: flex; justify-content: space-between; height: 34px; align-items: center; font-size: 13.5px; }
.kv dt { color: var(--mut); } .kv dd { font-weight: 600; }
.note { margin: 16px 6px 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); text-align: center; }

/* ── portfolio ── */
.pf-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr .8fr; gap: 14px; margin-bottom: 16px; }
.ps { display: block; text-align: left; font: inherit; color: inherit; }
.pf-stats small { display: block; font-size: 12.5px; color: var(--mut); }
.pf-stats b { display: block; margin-top: 8px; font-size: 26px; letter-spacing: -.04em; font-weight: 600; }
.pf-stats .big b { font-size: 38px; }
.pf-stats .add { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .2s var(--spring); }
.pf-stats .add:active { transform: scale(.97); }
.pf-stats .add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pft { width: 100%; margin: 0; }
.pft td button { height: 32px; padding: 0 12px; border-radius: 999px; background: var(--soft); font-size: 12.5px; font-weight: 600; margin-left: 4px; }
.pft td button.hot { background: var(--ink); color: #fff; }
.pft .emp { text-align: center !important; color: var(--ink-2); padding: 34px 0; line-height: 1.6; }
.pft .emp a, .pft .emp button { color: var(--blue); font-weight: 600; background: none; padding: 0; height: auto; margin: 0; }
aside.bars { position: sticky; top: 92px; height: 360px; margin: 0; border-radius: 26px; padding: 22px 18px 16px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.bars .b i { display: block; width: 30px; max-width: 70%; border-radius: 9px; background: var(--c); height: var(--h); transform: none; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleY(0); } }
.bars .b small { font-size: 10.5px; color: rgba(255,255,255,.85); font-weight: 550; }
.bars .b span { font-size: 10.5px; color: rgba(255,255,255,.6); }
.bars .none { width: 100%; align-self: center; text-align: center; color: rgba(255,255,255,.55); font-size: 13.5px; line-height: 1.5; }

/* ── account ── */
.acc { grid-template-columns: 1fr 1fr; }
.acct .who { display: flex; align-items: center; gap: 12px; }
.acct .av { width: 48px; height: 48px; border-radius: 50%; }
.acct .who b { display: block; font-size: 17px; }
.acct .who small { font-size: 12.5px; color: var(--mut); }
.acct .bal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 14px; }
.acct .bal div { background: var(--soft); border-radius: 16px; padding: 12px 14px; }
.acct .bal small { display: block; font-size: 12px; color: var(--mut); }
.acct .bal b { font-size: 19px; letter-spacing: -.03em; }
.acct .acts { display: flex; gap: 8px; }
.acct .acts button, .acct .acts a { flex: 1; height: 44px; border-radius: 999px; background: var(--soft); font-size: 14px; font-weight: 550; display: grid; place-items: center; }
.row-h { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin-top: 12px; border-radius: 999px; background: var(--soft); }
.seg3 button { height: 38px; border-radius: 999px; font-size: 14px; color: var(--mut); }
.seg3 button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 2px 6px -2px rgba(0,0,0,.15); }
.plain ul { list-style: none; margin: 8px 0 12px; }
.plain li { position: relative; padding: 12px 0 12px 70px; font-size: 14px; line-height: 1.55; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.plain li b { position: absolute; left: 0; top: 13px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 99px; }
.plain li.y b { background: #e5f6ec; color: var(--up); }
.plain li.n b { background: var(--soft); color: var(--ink-2); }

/* ── modal & toast ── */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.m-bg { position: absolute; inset: 0; background: rgba(90,30,140,.3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.m-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 28px; padding: 24px; box-shadow: 0 40px 80px -30px rgba(90,30,140,.5); opacity: 0; transform: translateY(14px) scale(.98); transition: .35s var(--ease); }
.modal.on { pointer-events: auto; }
.modal.on .m-bg { opacity: 1; }
.modal.on .m-card { opacity: 1; transform: none; }
.m-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--soft); font-size: 20px; line-height: 1; color: var(--ink-2); }
.m-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding-right: 36px; }
.m-h b { display: block; font-size: 19px; letter-spacing: -.03em; }
.m-h small { font-size: 13px; color: var(--mut); }
.wl { display: grid; gap: 8px; }
.wl button { display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 16px; border-radius: 18px; background: var(--soft); font-weight: 600; font-size: 16px; }
.wl img { width: 30px; height: 30px; border-radius: 8px; }
.tl { max-height: 56vh; overflow-y: auto; }
.tl .tile { width: 100%; margin-bottom: 6px; grid-template-columns: 36px 1fr auto; }
.tl .tile img { width: 36px; height: 36px; }
.toast { position: fixed; left: 50%; top: 90px; z-index: 100; transform: translate(-50%, -16px); opacity: 0; pointer-events: none; max-width: min(520px, calc(100% - 32px)); padding: 12px 18px; border-radius: 16px; background: rgba(23,12,34,.92); color: #fff; font-size: 14px; line-height: 1.45; text-align: center; transition: .35s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { text-decoration: underline; }

@media (max-width: 1000px) {
  .lay, .acc { grid-template-columns: 1fr; }
  .side, aside.bars { position: static; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .pf-stats { grid-template-columns: 1fr 1fr; }
  .pg-h { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 640px) {
  .appw { padding-top: 92px; }
  .nav nav { display: flex; position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; justify-content: space-around; height: 52px; border-radius: 999px; background: rgba(255,255,255,.8); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 0 0 1px rgba(23,12,34,.06), 0 14px 30px -16px rgba(90,30,140,.45); gap: 0; font-size: 13px; align-items: center; }
  .nav nav a.on::after { bottom: 2px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .det-h { flex-direction: column; } .det-lv { text-align: left; }
  .chart.big { height: 240px; }
  .foot { padding-bottom: 90px; }
}
aside.bars:has(.none) { height: 196px; }
