/* ───────── App shell (app.html, coin.html, docs.html) ───────── */
[hidden] { display: none !important; }
.app-body { background: radial-gradient(900px 500px at 85% -10%, #dcece7 0%, transparent 60%), radial-gradient(700px 500px at -10% 20%, #f6eadf 0%, transparent 60%), var(--bg); background-attachment: fixed; }
.app-body .nav__links { margin-left: 32px; margin-right: auto; }
.nav__links a[aria-current="page"] { color: var(--ink); background: #ffffff; box-shadow: var(--shadow-soft); }
.app-body .nav__x { margin-left: -12px; } /* no burger on app pages: keep it hugging the main button */
.wallet-btn.is-connected { background: #ffffff; color: var(--ink); box-shadow: var(--shadow-soft); font-family: var(--f-mono); font-size: 13px; }
.app-main { padding: 36px 0 80px; min-height: 70vh; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.center { display: flex; justify-content: center; margin-top: 28px; }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.back { display: inline-block; margin-bottom: 18px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.back:hover { color: var(--ink); }

.net-banner { width: min(var(--container), 100% - 32px); margin: 14px auto 0; padding: 12px 18px; border-radius: 14px; background: #fff4e0; border: 1px solid #84d0c9; color: #143532; font-size: 14px; }
.net-banner a { color: #3d9088; font-weight: 600; text-decoration: underline; }
.net-banner--local { background: #eef4ff; border-color: #c9dbff; color: #23407a; }

.app-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.app-head h1 { font-size: clamp(30px, 4vw, 44px); }
.app-head .sub { margin-top: 10px; }

.tabs, .seg { display: inline-flex; padding: 5px; gap: 4px; border-radius: 999px; background: #ffffff; box-shadow: var(--shadow-soft); }
.tabs button, .seg button { border: 0; background: none; padding: 10px 18px; border-radius: 999px; font: 600 14px var(--f-body); color: var(--ink-2); cursor: pointer; transition: background-color .2s, color .2s; }
.tabs button[aria-selected="true"], .seg button[aria-selected="true"] { background: var(--grad); color: #ffffff; box-shadow: 0 6px 16px -8px rgba(92, 193, 184, .8); }
#trade[data-side="sell"] .seg button[aria-selected="true"] { background: linear-gradient(120deg, #3d3340, #182322); box-shadow: none; }

.list-head { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 14px; }

/* ── coin cards ── */
.coin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.coin { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--r-md); transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
a.coin:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(15, 33, 31,.04), 0 24px 44px -16px rgba(30, 66, 63,.22); }
.coin__top { display: flex; align-items: center; gap: 12px; }
.coin__id { min-width: 0; }
.coin__id b { display: block; font: 600 17px var(--f-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin__id span { font-size: 13px; color: var(--ink-3); }
.coin__desc { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.coin__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coin__stats div { background: #ffffff; border-radius: 12px; padding: 10px 12px; }
.coin__stats small { display: block; font-size: 12px; color: var(--ink-3); }
.coin__stats b { font-size: 15px; }
.coin__floor { color: var(--ink-3); font-size: 12.5px; }
.coin__floor b { color: var(--ink); }
.floorbar { height: 6px; border-radius: 6px; background: #f0e6e8; overflow: hidden; }
.floorbar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--orange), var(--sun)); }
.is-skeleton { min-height: 230px; background: linear-gradient(100deg, rgba(255, 255, 255,.5) 30%, rgba(255, 255, 255,.95) 50%, rgba(255, 255, 255,.5) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

.avatar { position: relative; flex: none; width: var(--s); height: var(--s); border-radius: calc(var(--s) * .3); display: grid; place-items: center; overflow: hidden; color: #ffffff; font: 700 calc(var(--s) * .4) var(--f-display); box-shadow: inset 0 1px 0 rgba(255, 255, 255,.5), 0 8px 18px -10px rgba(25, 65, 62, .6); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.empty { grid-column: 1 / -1; padding: 48px 24px; border-radius: var(--r-md); text-align: center; display: grid; gap: 8px; justify-items: center; }
.empty b { font: 600 20px var(--f-display); }
.empty p { color: var(--ink-2); }
.empty a { color: #3d9088; font-weight: 600; }
.empty .btn { margin-top: 10px; }

/* ── launch ── */
.launch { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.launch__preview { grid-template-columns: minmax(0, 1fr); }
/* long unbroken names/tickers must wrap instead of widening the grid on phones */
.launch > *, .coin-grid2 > *, .coin__id, .coin-head__id { min-width: 0; }
.coin__id b, .coin-head h1, #pv-name { overflow-wrap: anywhere; }
.launch__form { padding: 30px; border-radius: var(--r-lg); display: grid; gap: 16px; }
.launch__form h2 { font-size: 26px; }
.launch__form .sub { margin-top: -6px; font-size: 15px; }
.launch__preview { position: sticky; top: 100px; display: grid; gap: 4px; }
.row2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.input { display: grid; gap: 7px; }
.input > span { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.input em { font-style: normal; font-weight: 500; color: var(--ink-3); }
.input input, .input textarea {
  width: 100%; border: 1px solid var(--line); background: #ffffff; border-radius: 14px; padding: 13px 15px;
  font: 500 15px var(--f-body); color: var(--ink); resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.input input:focus, .input textarea:focus, .amount input:focus { outline: none; border-color: #8dd4ce; box-shadow: 0 0 0 4px rgba(84, 190, 181, .12); }
.facts { list-style: none; margin: 4px 0; padding: 16px 18px; border-radius: 14px; background: var(--grad-soft); display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.facts b { color: var(--ink); }
.fine a { color: #3d9088; }

/* ── coin page ── */
.coin-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.coin-head h1 { font-size: clamp(26px, 3.4vw, 38px); }
.coin-head h1 span { color: var(--ink-3); font-size: .6em; font-weight: 500; }
.coin-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.coin-head__meta a { color: #3d9088; font-weight: 600; }
.coin-head__desc { margin-top: 12px; color: var(--ink-2); max-width: 720px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; background: #ffffff; box-shadow: var(--shadow-soft); border-radius: 999px; padding: 6px 12px; font: 500 13px var(--f-mono); color: var(--ink-2); cursor: pointer; }
.chip:hover { color: var(--ink); }
.copy-ic { width: 11px; height: 11px; border: 1.6px solid currentColor; border-radius: 3px; box-shadow: 3px -3px 0 -1.6px #ffffff, 3px -3px 0 0 currentColor; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: #ffffff; border-radius: var(--r-md); padding: 18px 20px; box-shadow: var(--shadow-soft); display: grid; gap: 4px; }
.stat small { font-size: 12.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.stat b { font: 600 22px var(--f-display); letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--ink-3); }
.stat--brand { background: var(--grad); color: #ffffff; box-shadow: var(--shadow-glow); }
.stat--brand small, .stat--brand span { color: rgba(255, 255, 255,.85); }

.floor-meter { margin: 12px 0 28px; padding: 14px 18px; border-radius: var(--r-md); display: grid; gap: 8px; }
.floor-meter__bar { height: 8px; border-radius: 8px; background: #f0e6e8; overflow: hidden; }
.floor-meter__bar span { display: block; height: 100%; width: 1%; border-radius: 8px; background: linear-gradient(90deg, var(--orange), var(--sun)); transition: width .8s cubic-bezier(.2,.8,.2,1); }

.coin-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.col { display: grid; gap: 16px; }
.panel { border-radius: var(--r-lg); padding: 22px; display: grid; gap: 14px; }
.panel h3 { font-size: 17px; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.slip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.slip input { width: 58px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font: 500 13px var(--f-mono); text-align: right; background: #ffffff; }
.amount { display: flex; align-items: center; gap: 10px; background: #ffffff; border-radius: 18px; padding: 6px 18px 6px 6px; box-shadow: inset 0 0 0 1px var(--line); }
.amount input { flex: 1; min-width: 0; border: 0; background: none; padding: 14px 12px; font: 600 26px var(--f-display); color: var(--ink); border-radius: 14px; }
.amount input::placeholder { color: #cfc4cc; }
.amount span { font: 600 15px var(--f-body); color: var(--ink-2); }
.amount__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .chip { font-family: var(--f-body); font-weight: 600; padding: 5px 10px; }
.quote { min-height: 44px; display: grid; align-content: center; gap: 2px; font-size: 15px; }
.quote b { font-family: var(--f-display); font-weight: 600; }
.quote small { color: var(--ink-3); font-size: 12.5px; }
.positions { display: grid; gap: 8px; }
.pos { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pos:last-child { border-bottom: 0; }
.pos small { color: var(--ink-3); }
.pos span { width: 100%; text-align: right; font-size: 13px; color: var(--ink-3); }
.creator__row { display: flex; justify-content: space-between; align-items: center; }
.creator__row b { font: 600 22px var(--f-display); }
.trades { display: grid; gap: 2px; font-size: 14px; }
.trade-row { display: grid; grid-template-columns: 56px 1fr 1.3fr 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.trade-row:last-child { border-bottom: 0; }
.trade-row a { color: inherit; }
.pill-side { font-size: 12px; font-weight: 700; padding: 3px 0; border-radius: 999px; text-align: center; }
.pill-side.is-buy { background: #e5f7ec; color: #18864b; }
.pill-side.is-sell { background: #ffe8ec; color: #358c84; }
.how ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); font-size: 14.5px; }
.how a { color: #3d9088; font-weight: 600; font-size: 14px; }

/* ── toasts / spinner ── */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); }
.toast { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #182322; color: #ffffff; font-size: 14px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0,.35); animation: toast-in .35s cubic-bezier(.2,.8,.2,1); transition: opacity .5s, transform .5s; }
.toast--ok { background: linear-gradient(120deg, #1f8f55, #18864b); }
.toast--error { background: linear-gradient(120deg, #358c84, #2b726b); }
.toast a { color: #ffffff; font-weight: 700; text-decoration: underline; }
.toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255,.4); border-top-color: #ffffff; animation: spin .7s linear infinite; }
.btn--ghost .spinner { border-color: rgba(24, 35, 34,.2); border-top-color: var(--ink); }

.footer--app { padding-top: 0; }
.footer--app .footer__fine { border-top: 1px solid var(--line); }
.footer__fine a { color: inherit; text-decoration: underline; }

@media (max-width: 960px) {
  .app-body .nav__links { display: flex; margin-left: auto; margin-right: 0; }
  .app-body .nav .btn--sm { display: inline-flex; }
  .app-body .nav__burger { display: none; }
  .launch, .coin-grid2 { grid-template-columns: minmax(0, 1fr); }
  .launch__preview { position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  /* phones: page links drop to a second row under the logo instead of disappearing */
  .app-body .nav__inner { flex-wrap: wrap; row-gap: 8px; }
  .app-body .nav__links { order: 3; width: 100%; margin: 0; gap: 4px; overflow-x: auto; }
  .app-body .nav__links a { padding: 6px 12px; font-size: 14px; }
  .app-body .nav .btn--sm { margin-left: auto; }
  .app-head { align-items: stretch; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; }
  .row2 { grid-template-columns: 1fr; }
  .launch__form { padding: 22px; }
  .stat b { font-size: 18px; }
  .coin-head { gap: 14px; }
  .trade-row { grid-template-columns: 48px 1fr 1fr; }
  .trade-row span:nth-child(4), .trade-row span:nth-child(5) { display: none; }
}

/* ───────── Onyx demo app additions ───────── */
.ticker-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 4px; padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 22px; }
.ticker-strip div { display: grid; gap: 2px; padding: 4px 8px; }
.ticker-strip small { font-size: 12px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.ticker-strip b { font: 600 20px var(--f-display); letter-spacing: -.02em; }
.list-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.search input { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 11px 18px; font: 500 14px var(--f-body); width: min(280px, 100%); color: var(--ink); }
.search input:focus { outline: none; border-color: #8fc4b8; box-shadow: 0 0 0 4px rgba(62,124,124,.12); }
.coin { position: relative; }
.coin.is-flash-buy { box-shadow: 0 0 0 2px rgba(47,182,122,.55), var(--shadow-soft); }
.coin.is-flash-sell { box-shadow: 0 0 0 2px rgba(194,42,75,.4), var(--shadow-soft); }
.tag--mine { margin-left: auto; background: var(--ink); color: #fbe7dc; }
.pairs { display: flex; flex-wrap: wrap; gap: 8px; }
.pairs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font: 600 14px var(--f-body); color: var(--ink-2); cursor: pointer; }
.pairs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fbe7dc; }
.clone-check { margin: -6px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; }
.clone-check.is-ok { background: #e6f4ef; color: #1d6b55; }
.clone-check.is-bad { background: #fde8ea; color: #a5243f; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(10, 43, 42, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal__box { width: min(420px, 100%); padding: 26px; border-radius: var(--r-lg); display: grid; gap: 18px; background: rgba(255,255,255,.92); }
.modal__box h3 { font-size: 20px; }
.progress { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.progress li { position: relative; padding-left: 34px; color: var(--ink-3); font-size: 15px; transition: color .3s; }
.progress li::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #d6e2df; box-sizing: border-box; }
.progress li.is-active { color: var(--ink); font-weight: 600; }
.progress li.is-active::before { border-color: #3e7c7c; border-top-color: transparent; animation: spin .7s linear infinite; }
.progress li.is-done { color: var(--ink-2); }
.progress li.is-done::before { background: #3e7c7c; border-color: #3e7c7c; }
.progress li.is-done::after { content: ""; position: absolute; left: 7px; top: 5px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wallets { display: grid; gap: 8px; }
.wallets button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font: 600 15px var(--f-body); color: var(--ink); cursor: pointer; transition: border-color .2s, transform .2s; }
.wallets button:hover { border-color: #8fc4b8; transform: translateY(-1px); }
.wallets .spinner { margin-left: auto; }
.w-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.spinner--dark { border-color: rgba(10,43,42,.2); border-top-color: var(--ink); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: #e6f4ef; color: #1d6b55; }
.pchart { width: 100%; height: 220px; }
.pchart path.l { fill: none; stroke: #0a3a3a; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.pchart path.a { fill: url(#pfill); }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #1d6b55; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fb67a; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.pill-side.is-burn { background: #0a3a3a; color: #fbe7dc; }
.trade-row.ledger-row { grid-template-columns: 56px .8fr 1fr 1fr 1fr auto; }
.ledger-row a { font-weight: 600; }
.trade-row { grid-template-columns: 56px 1fr 1.3fr 1fr auto; }
.nav__links a[aria-current] { color: var(--ink); background: #fff; box-shadow: var(--shadow-soft); }
@media (max-width: 640px) {
  .trade-row.ledger-row { grid-template-columns: 48px 1fr 1fr; }
  .ledger-row > :nth-child(n+5) { display: none; }
}

.ledger-row.is-onyx { background: linear-gradient(90deg, rgba(62,124,124,.08), transparent); }
.ledger-row.is-onyx .pill-side { background: #3e7c7c; }

/* let the coin page columns shrink to the screen on phones */
.col, .panel, .panel > *, .amount { min-width: 0; }
.amount input { width: 100%; }
.trade-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  #sort { width: 100%; overflow-x: auto; scrollbar-width: none; }
  #sort button { flex: 1; padding: 9px 10px; font-size: 13px; white-space: nowrap; }
  .search, .search input { width: 100%; }
}
@media (max-width: 640px) { .app-body .nav .nav__x { display: none; } }
img.w-ic { display: block; padding: 0; overflow: hidden; }
