/* Fliply app: the coin list, launch and coin pages. Same paper, ink and type as the landing page. */
:root {
  --bg: #F1F0EB;
  --paper: #FCFBF8;
  --ink: #0C0C0D;
  --ink-2: #2A2A2C;
  --muted: #6B6964;
  --faint: #A29F98;
  --line: #E1DFD8;
  --line-2: #CFCDC5;
  --long: #10B46A;
  --short: #EF4146;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --wrap: 1200px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; background-image: var(--grain); background-size: 220px; opacity: .45; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
img { display: block; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.mono { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.up { color: var(--long); }
.down { color: var(--short); }
.muted { color: var(--muted); }

/* ---------- nav ---------- */
.anav { position: sticky; top: 0; z-index: 20; background: rgba(241, 240, 235, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.anav-in { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; font-size: 19px; letter-spacing: -.035em; }
.brand img { width: 28px; height: 28px; }
.anav nav { display: flex; gap: 4px; }
.anav nav a { text-decoration: none; font-size: 14px; color: var(--muted); padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.anav nav a:hover { color: var(--ink); }
.anav nav a.on { color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.anav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--long); }
.chip b { font-family: var(--mono); font-weight: 500; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; font-size: 14.5px; font-weight: 500; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s, box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #26262A; }
.btn-line { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn-sm { height: 36px; padding: 0 15px; font-size: 13.5px; }
.btn-block { width: 100%; height: 52px; font-size: 15.5px; }
.btn:disabled, .btn:disabled:hover { background: var(--line) !important; color: var(--faint); cursor: default; transform: none; box-shadow: none; }
.btn.busy { opacity: .7; cursor: progress; }
.btn-buy { background: var(--long); color: #fff; }
.btn-buy:hover { background: #0E9F5E; }
.btn-sell { background: var(--short); color: #fff; }
.btn-sell:hover { background: #DB363B; }
.wallet .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.wallet.on .dot { background: var(--long); }
.wallet.wrong .dot { background: var(--short); }

/* ---------- cards and bits ---------- */
.card { background: var(--paper); border-radius: 22px; box-shadow: 0 0 0 1px var(--line), 0 18px 44px -32px rgba(20, 20, 18, .28); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; text-decoration: none; color: var(--ink-2); }
a.pill:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.coinpic { border-radius: 50%; object-fit: cover; background: var(--line); box-shadow: 0 0 0 1px rgba(12, 12, 13, .08); flex: none; }
.mono-pic { display: grid; place-items: center; border-radius: 50%; flex: none; color: #fff; font-weight: 600; letter-spacing: -.03em; background: linear-gradient(180deg, #9DB4BF, #2E4A58); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; font-size: 13px; color: var(--muted); cursor: pointer; transition: all .2s var(--ease); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), inset 0 0 0 1px var(--line); }
.empty { text-align: center; padding: 64px 20px; color: var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; line-height: 1.45; transition: all .35s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #fff; }

/* ---------- coin list ---------- */
.lhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 44px 0 26px; }
.lhead h1 { margin: 0; font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -.055em; font-weight: 500; }
.lstats { display: flex; gap: 28px; margin-top: 20px; }
.lstats div { display: grid; gap: 3px; }
.lstats b { font-size: 22px; font-weight: 500; letter-spacing: -.03em; }
.lstats span { font-size: 12.5px; color: var(--muted); }
.ltools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1; min-width: 200px; max-width: 340px; height: 40px; padding: 0 14px 0 38px; border-radius: 999px; border: 0; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B6964' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") 14px center no-repeat; box-shadow: inset 0 0 0 1px var(--line); outline: 0; font-size: 14px; }
.search:focus { box-shadow: inset 0 0 0 1px var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; padding-bottom: 72px; }
.ccard { display: grid; gap: 14px; padding: 18px; text-decoration: none; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.ccard:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-2), 0 24px 48px -30px rgba(20, 20, 18, .35); }
.ctop { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ctop .names { min-width: 0; }
.ctop b { display: block; font-size: 16px; font-weight: 500; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctop span { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.cspark { height: 46px; width: 100%; }
.crow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.crow .cap { font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.crow .chg { font-family: var(--mono); font-size: 13px; }
.cfoot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.firstcoin { position: relative; overflow: hidden; border-radius: 26px; min-height: 380px; display: grid; place-items: center; text-align: center; color: var(--ink); margin-bottom: 72px; }
.firstcoin img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; filter: saturate(1.08) contrast(1.12) brightness(.98); }
.firstcoin .dawn { position: absolute; inset: 0; background: linear-gradient(180deg, #F6CDB6 0%, #F3CDBB 30%, rgba(225, 214, 222, .5) 60%, rgba(225, 214, 222, 0) 85%); mix-blend-mode: multiply; }
.firstcoin .in { position: relative; padding: 40px 20px; }
.firstcoin h2 { margin: 0; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.05em; font-weight: 500; line-height: 1; }
.firstcoin p { margin: 14px auto 24px; max-width: 420px; font-size: 16px; line-height: 1.5; color: var(--ink-2); }

/* ---------- launch ---------- */
.page-h { padding: 40px 0 24px; }
.page-h h1 { margin: 0; font-size: clamp(36px, 5vw, 56px); letter-spacing: -.05em; font-weight: 500; line-height: 1; }
.page-h p { margin: 12px 0 0; color: var(--ink-2); font-size: 16px; }
.lgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; padding-bottom: 72px; }
.form { padding: 24px; display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.field input, .field textarea { width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; outline: 0; font-size: 15px; transition: border-color .2s; }
.field textarea { height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus { border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.drop { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: center; padding: 16px; border-radius: 18px; border: 1px dashed var(--line-2); background: #fff; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--ink); }
.drop .ph { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--faint); overflow: hidden; }
.drop .ph img { width: 100%; height: 100%; object-fit: cover; }
.drop b { font-weight: 500; }
.drop p { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.amount { position: relative; }
.amount input { width: 100%; height: 52px; padding: 0 76px 0 14px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff; outline: 0; font-family: var(--mono); font-size: 18px; transition: border-color .2s; }
.amount input:focus { border-color: var(--ink); }
.amount span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-family: var(--mono); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-family: var(--mono); cursor: pointer; }
.quick button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.rows { border-top: 1px solid var(--line); }
.rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-family: var(--mono); font-size: 13px; text-align: right; }
.side { position: sticky; top: 84px; display: grid; gap: 14px; }
.preview { padding: 22px; display: grid; gap: 16px; justify-items: center; text-align: center; }
.preview .big { width: 168px; height: 168px; }
.preview h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; font-weight: 500; word-break: break-word; }
.preview .tk { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.note { font-size: 13px; line-height: 1.5; color: var(--muted); min-height: 1.5em; }
.note.err { color: var(--short); }
.note a { text-underline-offset: 2px; }

/* ---------- coin page ---------- */
.chead { display: flex; align-items: center; gap: 18px; padding: 32px 0 20px; flex-wrap: wrap; }
.chead .who { min-width: 0; flex: 1; }
.chead h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.045em; font-weight: 500; line-height: 1.05; word-break: break-word; }
.chead .sub { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); align-items: center; }
.chead .sub a { text-underline-offset: 2px; }
.chead .links { display: flex; gap: 6px; flex-wrap: wrap; }
.cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; padding-bottom: 72px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats > div { padding: 18px 20px; border-left: 1px solid var(--line); display: grid; gap: 4px; }
.stats > div:first-child { border-left: 0; }
.stats b { font-size: 21px; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; }
.stats span { font-size: 12.5px; color: var(--muted); }
.chartcard { margin-top: 14px; padding: 18px 18px 12px; }
.chartbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.chartbar .now { font-size: 28px; font-weight: 500; letter-spacing: -.04em; }
.chartbar .now small { font-size: 14px; margin-left: 8px; font-family: var(--mono); letter-spacing: 0; }
.chart { position: relative; height: 380px; }
.charttools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.charttools .seg button { height: 30px; padding: 0 11px; font-family: var(--mono); font-size: 12px; }
.ohlc { min-height: 18px; margin: 0 0 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ohlc b { font-weight: 500; color: var(--ink-2); }
.ohlc b.up, .ohlc span.up { color: var(--long); }
.ohlc b.down, .ohlc span.down { color: var(--short); }
.chart canvas { width: 100%; height: 100%; display: block; }
.tip { position: absolute; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 12px; font-family: var(--mono); white-space: nowrap; transform: translate(-50%, -120%); opacity: 0; transition: opacity .15s; }
.about { margin-top: 14px; padding: 20px 22px; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.tcard { margin-top: 14px; overflow: hidden; }
.tcard h3 { margin: 0; padding: 18px 20px 12px; font-size: 16px; font-weight: 500; letter-spacing: -.02em; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 400; color: var(--muted); font-size: 12px; padding: 8px 20px; border-top: 1px solid var(--line); }
td { padding: 11px 20px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
td a { text-underline-offset: 2px; }
.trade { padding: 18px; display: grid; gap: 14px; }
.trade #side { width: 100%; }
.trade #side button { flex: 1; height: 38px; font-size: 14px; }
.trade #side button.on.b { color: var(--long); }
.trade #side button.on.s { color: var(--short); }
.bal { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.bal b { font-family: var(--mono); font-weight: 500; color: var(--ink-2); }
.slip { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.slip .seg button { height: 26px; padding: 0 10px; font-size: 12px; }
.lev { display: grid; gap: 8px; }
.levtop { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.levtop b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 15px; }
.lev input[type=range] { width: 100%; accent-color: var(--ink); height: 22px; }
.perpstrip { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); }
.perpstrip > div { padding: 14px 20px; border-left: 1px solid var(--line); display: grid; gap: 3px; }
.perpstrip > div:first-child { border-left: 0; }
.perpstrip span { font-size: 12px; color: var(--muted); }
.perpstrip b { font-size: 16px; font-weight: 500; font-family: var(--mono); white-space: nowrap; }
.position { padding: 18px; display: grid; gap: 12px; }
.poshead { display: flex; justify-content: space-between; align-items: center; }
.poshead h3 { margin: 0; font-size: 15px; font-weight: 500; }
.tag { font-size: 12px; font-family: var(--mono); padding: 4px 10px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); }
.tag.up { color: var(--long); }
.tag.down { color: var(--short); }
.pnl { font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.posbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.addm { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.addm .amount input { height: 40px; font-size: 15px; }
.creator { padding: 18px; display: grid; gap: 12px; }
.creator h3 { margin: 0; font-size: 15px; font-weight: 500; }
.creator .owed { font-size: 26px; font-weight: 500; letter-spacing: -.03em; }

@media (max-width: 960px) {
  .lgrid, .cgrid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .perpstrip { grid-template-columns: 1fr 1fr; }
  .perpstrip > div:nth-child(3) { border-left: 0; }
  .perpstrip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .lhead { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .anav nav { display: none; }
  .anav .chip { display: none; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .lstats { gap: 18px; flex-wrap: wrap; }
  .drop { grid-template-columns: 84px minmax(0, 1fr); }
  .drop .ph { width: 84px; height: 84px; }
  .chart { height: 300px; }
  .chartbar { flex-wrap: wrap; }
  .charttools { justify-content: flex-start; }
  .hide-sm { display: none; }
  td, th { padding-left: 14px; padding-right: 14px; }
}
