/* Crypto Alert: calm trading desk. Deep ink + mint/coral signals (dark), paper + ink (light). Text: Inter.
   Icons: Lucide (ISC), self-hosted sprite. Numbers use tabular figures so columns line up. */

@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f5f6f8; --bg-2: #eceef2; --surface: #ffffff; --surface-2: #f8f9fb;
  --ink: #12151b; --ink-2: #353a45; --muted: #687080; --faint: #9aa1ad; --line: #e3e6ec; --line-2: #d3d7df;
  --brand: #12151b; --brand-ink: #ffffff; --accent: #a87b2c; --accent-soft: #f6eedf;
  --up: #11845b; --up-soft: #e2f3eb; --down: #c2412f; --down-soft: #f9e5e1;
  --warn: #9a6512; --warn-soft: #f8eedb; --info: #2d5a86; --info-soft: #e3ecf6;
  --shadow: 0 1px 2px rgba(18, 21, 27, .05), 0 10px 28px -16px rgba(18, 21, 27, .18);
  --radius: 16px; --radius-sm: 11px; --tabbar-h: 62px;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11; --bg-2: #11141a; --surface: #151920; --surface-2: #1a1f27;
    --ink: #e9ecf1; --ink-2: #c3c8d1; --muted: #8b93a1; --faint: #636b78; --line: #222833; --line-2: #2c3340;
    --brand: #e9ecf1; --brand-ink: #0b0d11; --accent: #d6b26c; --accent-soft: #2a2416;
    --up: #4cc68e; --up-soft: #12261d; --down: #ef7d6d; --down-soft: #2c1714;
    --warn: #e2b25e; --warn-soft: #2a2212; --info: #8cb8e4; --info-soft: #14212f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; overscroll-behavior: none; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased;
       -webkit-text-size-adjust: 100%; min-height: 100dvh; font-feature-settings: "cv11", "ss01"; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, .price, td, .kpi b { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
      stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 15px; height: 15px; } .ic.lg { width: 22px; height: 22px; }
.spin { animation: spin 1s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; } .up { color: var(--up); }
.down { color: var(--down); } .warnc { color: var(--warn); } .center { text-align: center; }
h1 { font: 700 26px/1.15 var(--sans); letter-spacing: -.02em; margin: 0; }
h2 { font: 650 18px/1.25 var(--sans); letter-spacing: -.01em; margin: 0; }
h3 { font: 650 12px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
p { margin: 0; }

/* layout */
.main { max-width: 760px; margin: 0 auto;
        padding: calc(14px + env(safe-area-inset-top)) 16px calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }
.stack { display: grid; gap: 14px; } .stack.tight { gap: 8px; } .row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.topbar .title { flex: 1; min-width: 0; } .topbar .title p { color: var(--muted); font-size: 13px; }
.back { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; margin-left: -10px; }
.back:active { background: var(--bg-2); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 14px; }
.card.flat { box-shadow: none; } .card.tap:active { transform: scale(.995); background: var(--surface-2); }
.card h3 + * { margin-top: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px -4px; }
.list { display: grid; } .list > * + * { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 2px; min-height: 52px; }
.li .grow p { color: var(--muted); font-size: 13px; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
       border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 15px;
       cursor: pointer; white-space: nowrap; transition: transform .06s, filter .15s, background .15s; }
.btn:active { transform: translateY(1px); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.buy { background: var(--up); border-color: var(--up); color: #fff; }
.btn.sell { background: var(--down); border-color: var(--down); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.block { width: 100%; min-height: 52px; font-size: 16px; } .btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 44px; padding: 0; }
.field { display: grid; gap: 6px; } .field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input { min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); width: 100%;
         background: var(--surface); outline: none; font-size: 16px; }   /* 16px: iOS doesn't zoom */
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { padding: 12px 14px; min-height: 90px; resize: vertical; line-height: 1.4; }
.input-unit { position: relative; } .input-unit .input { padding-right: 64px; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { min-height: 40px; border: 0; background: transparent; border-radius: 9px; font-weight: 600; font-size: 14px;
              color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg.buy button.on { color: var(--up); } .seg.sell button.on { color: var(--down); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
        font-size: 14px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
                      background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--up); } .switch input:checked + span::after { transform: translateX(20px); }

/* badges, labels */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px;
         font-weight: 650; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge.up { background: var(--up-soft); color: var(--up); } .badge.down { background: var(--down-soft); color: var(--down); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.gold { background: var(--accent-soft); color: var(--accent); }
.coin-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px;
           letter-spacing: -.02em; flex: none; color: #fff; }
.coin-BTC { background: #f7931a; } .coin-ETH { background: #627eea; } .coin-SOL { background: linear-gradient(135deg, #9945ff, #14f195); }
.coin-BNB { background: #f0b90b; color: #1e2026; } .coin-ADA { background: #0033ad; } .coin-XRP { background: #23292f; }
.coin-POT, .coin-MARKET { background: var(--ink-2); }
@media (prefers-color-scheme: dark) { .coin-XRP { background: #3a434d; } }

/* banners */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.banner .ic { margin-top: 1px; } .banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.down { background: var(--down-soft); color: var(--down); } .banner.up { background: var(--up-soft); color: var(--up); }
.banner.info { background: var(--info-soft); color: var(--info); } .banner b { font-weight: 650; }
.banner .grow > * + * { margin-top: 4px; } .banner p { color: inherit; opacity: .92; }

/* pot */
.pot { padding: 18px; } .pot .big { font: 750 32px/1.1 var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .kpis.two { grid-template-columns: repeat(2, 1fr); }
.kpi { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.kpi span { display: block; font-size: 12px; color: var(--muted); } .kpi b { display: block; font-size: 17px; font-weight: 700;
            margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* coin card */
.coin-card { display: grid; gap: 10px; }
.coin-card .head { display: flex; align-items: center; gap: 12px; } .coin-card .px { text-align: right; }
.coin-card .px b { display: block; font-size: 16px; } .coin-card .px span { font-size: 13px; }
.gauge { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--down-soft), var(--bg-2) 50%, var(--up-soft)); }
.gauge i { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface);
           transform: translateX(-50%); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.gauge::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line-2); }
.score-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score-num { font: 750 20px/1 var(--sans); font-variant-numeric: tabular-nums; }

/* parts */
.parts { display: grid; gap: 9px; }
.part { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.part .bar { position: relative; height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.part .bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.part .bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.part b { text-align: right; font-variant-numeric: tabular-nums; }

/* tables */
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 9px 12px; font-size: 14px; align-items: start; }
.kv > span:nth-child(odd) { color: var(--muted); } .kv > span:nth-child(even) { text-align: right; font-weight: 600;
           font-variant-numeric: tabular-nums; }
.kv .sub { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { padding: 8px 4px; border-bottom: 1px solid var(--line); } td.r, th.r { text-align: right; }
.scroll-x { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }

/* checks */
.checks { display: grid; gap: 8px; }
.ck { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border-radius: 11px; }
.ck.block { background: var(--down-soft); color: var(--down); } .ck.warn { background: var(--warn-soft); color: var(--warn); }
.ck.info { background: var(--info-soft); color: var(--info); } .ck.ok { background: var(--up-soft); color: var(--up); }

/* lists */
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; }
.alert-row .grow b { display: block; font-weight: 650; font-size: 15px; }
.alert-row .grow p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; }
.news-row { display: grid; gap: 4px; padding: 12px 2px; }
.news-row b { font-weight: 600; font-size: 15px; line-height: 1.35; }
.news-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.sev { display: inline-flex; gap: 2px; } .sev i { width: 4px; height: 10px; border-radius: 2px; background: var(--line-2); }
.sev i.on { background: currentColor; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty .ic { width: 28px; height: 28px; color: var(--faint); }
.skeleton { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2));
            background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* chart */
.chart { width: 100%; height: 210px; display: block; } .chart text { font-size: 10px; fill: var(--muted); font-family: var(--sans); }
.ranges { display: grid; gap: 10px; }
.range { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: center; font-size: 13px; }
.range .rb { position: relative; height: 26px; border-radius: 8px; background: var(--bg-2); }
.range .rb i { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: var(--info-soft); border: 1px solid var(--info); }
.range .rb em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); font-style: normal; }
.range .rb span { position: absolute; top: 5px; font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* order screen */
.summary { display: grid; gap: 8px; }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 5;
                  display: grid; gap: 8px; padding: 10px; margin: 0 -6px; border-radius: 18px;
                  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
                  -webkit-backdrop-filter: blur(16px); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* tab bar: pinned to the very bottom edge; the safe-area padding is inside it, so nothing floats */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
          height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
          background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(18px);
          -webkit-backdrop-filter: saturate(1.4) blur(18px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint);
            font-size: 11px; font-weight: 600; position: relative; min-height: var(--tabbar-h); }
.tabbar a .ic { width: 23px; height: 23px; } .tabbar a.on { color: var(--ink); } .tabbar a.on .ic { color: var(--accent); }
.tabbar a b { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
              background: var(--down); color: #fff; font-size: 11px; display: grid; place-items: center; }

/* toast, sheet */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); transform: translate(-50%, 16px);
         opacity: 0; pointer-events: none; z-index: 60; background: var(--brand); color: var(--brand-ink); padding: 12px 18px;
         border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .2s, transform .2s;
         max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.bad { background: var(--down); color: #fff; }
.toast.good { background: var(--up); color: #fff; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(6, 8, 11, .55); display: grid; place-items: end center; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 18px 16px
         calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; max-height: 88dvh; overflow-y: auto; }
.result-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 4px auto; }
.result-ic .ic { width: 32px; height: 32px; } .result-ic.ok { background: var(--up-soft); color: var(--up); }
.result-ic.bad { background: var(--down-soft); color: var(--down); }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 18px; }
.login-card .brand { display: flex; align-items: center; gap: 12px; } .login-card .brand img { width: 52px; height: 52px; border-radius: 14px; }
.form-error { color: var(--down); font-size: 14px; min-height: 20px; }
.splash { min-height: 100dvh; display: grid; place-items: center; color: var(--muted); }

@media (min-width: 900px) { .main { padding-top: 28px; } }
