/* PACT Brain — on-brand styling.
   Brand palette (sourced from pactfoundation.com / gov.pactfoundation.com design tokens):
     --pact-purple  #AB48DA   primary brand / CTA
     --pact-indigo  #121668   deep indigo (headings)
     --pact-navy    #0B0C2B   near-black navy (bg base)
     --pact-muted   #66677D   muted text
   Telegram themeParams are still read (app.js) for hint/link niceties, but the
   PACT brand identity is applied deliberately so the app looks on-brand in any
   Telegram theme (light or dark). */
:root {
  /* Brand */
  --pact-purple: #AB48DA;
  --pact-purple-2: #7C3AED;      /* deeper violet for gradients */
  --pact-purple-soft: rgba(171, 72, 218, .16);
  --pact-indigo: #121668;
  --pact-navy: #0B0C2B;
  --pact-muted: #9698b5;

  /* Applied surface (dark, on-brand) */
  --bg: #0B0C2B;
  --bg-elev: #14163a;            /* elevated cards */
  --bg-elev-2: #1b1e4a;
  --text: #ffffff;
  --hint: var(--pact-muted);
  --link: #b98cff;
  --accent: var(--pact-purple);
  --accent-text: #ffffff;
  --hairline: rgba(255,255,255,.08);

  --radius: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 480px at 50% -10%, rgba(171,72,218,.28), transparent 60%),
    radial-gradient(700px 360px at 100% 0%, rgba(124,58,237,.18), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "General Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 8px;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand .logo { width: 26px; height: 26px; display: block; }
.brand .wordmark { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.brand .wordmark .thin { font-weight: 500; color: var(--hint); }
.user {
  font-size: 12.5px; color: #fff; font-weight: 600;
  background: var(--pact-purple-soft);
  border: 1px solid rgba(171,72,218,.35);
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
}
.user:empty { display: none; }

.screen { flex: 1; padding: 8px 16px 24px; }

.footer { padding: 12px 16px 20px; text-align: center; }
.muted { color: var(--hint); font-size: 12px; }

.loading { color: var(--hint); text-align: center; padding: 48px 0; }

/* ---- Hero price card ---- */
.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(171,72,218,.14), rgba(171,72,218,0) 42%),
    var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px 18px 18px;
  margin-bottom: 14px;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--pact-purple), var(--pact-purple-2));
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: #d9bff2;
  background: var(--pact-purple-soft);
  border: 1px solid rgba(171,72,218,.3);
  padding: 4px 9px; border-radius: 999px; margin-bottom: 12px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pact-purple); box-shadow: 0 0 8px var(--pact-purple); }

.price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price { font-size: 38px; font-weight: 700; letter-spacing: -.5px; line-height: 1.05; }
.sym { color: var(--hint); font-weight: 600; font-size: 15px; }

.changes { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip {
  padding: 6px 11px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.05); border: 1px solid var(--hairline);
}
.chip .lbl { color: var(--hint); font-weight: 500; margin-right: 5px; }
.up { color: #02c07d; }   /* PACT brand green */
.down { color: #f94343; } /* PACT brand red */

.stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-top: 18px; background: var(--hairline);
  border: 1px solid var(--hairline); border-radius: var(--radius-sm); overflow: hidden;
}
.stat { background: var(--bg-elev); padding: 12px 13px; }
.stat .k { color: var(--hint); font-size: 11.5px; letter-spacing: .3px; }
.stat .v { font-weight: 700; font-size: 15.5px; margin-top: 3px; }

/* ---- Actions ---- */
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; text-align: center;
  padding: 14px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px; border: 1px solid var(--hairline); cursor: pointer;
  background: var(--bg-elev-2); color: var(--text);
  text-decoration: none; transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn.primary {
  background: linear-gradient(135deg, var(--pact-purple), var(--pact-purple-2));
  color: #fff; border: none;
  box-shadow: 0 8px 22px -8px rgba(171,72,218,.7);
}
.btn.primary:active { filter: brightness(1.05); }
.btn.ghost { background: transparent; border: 1px solid rgba(255,255,255,.14); color: #cfd0e6; }
.btn .ic { width: 16px; height: 16px; opacity: .9; }

.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--hint); margin: 18px 2px 10px;
}

.error { color: #f94343; text-align: center; padding: 34px 0; }
.retry { margin-top: 14px; }

/* Footer brand line */
.footbrand { display: inline-flex; align-items: center; gap: 6px; opacity: .8; }
.footbrand .logo { width: 14px; height: 14px; }
