/* ==========================================================================
   PRIMEX — black & bright-green terminal
   Gaming-platform energy (black ground, neon green signal, HUD grid) crossed
   with old-money serif display type. Restrained ornament: flat surfaces,
   hairlines, one loud colour. Token names unchanged — gold aliases now map to
   the green signal so every screen re-skins from the root.
   ========================================================================== */

:root {
  /* Ground */
  --px-bg: #060806;
  --px-bg-elev: #0a0d0a;
  --px-surface: #0d120e;
  --px-surface-2: #151c16;
  --px-line: rgba(57, 255, 107, 0.10);
  --px-line-strong: rgba(57, 255, 107, 0.45);

  /* Ink */
  --px-text: #eaf5ec;
  --px-text-muted: #a7b8ab;
  --px-text-dim: #64766a;

  /* Signal green — THE accent (gold token names kept for compatibility). */
  --px-accent: #39ff6b;
  --px-gold: #39ff6b;
  --px-gold-bright: #a9ffc9;
  --px-gold-deep: #0f8a3d;
  --px-gold-ink: #041708;
  --px-gold-soft: rgba(57, 255, 107, 0.12);
  --px-gold-grad: linear-gradient(135deg, #12b344 0%, #39ff6b 50%, #7dffab 100%);

  /* Market */
  --px-up: #52ff8a;
  --px-up-soft: rgba(82, 255, 138, 0.12);
  --px-down: #ff4d5e;
  --px-down-soft: rgba(255, 77, 94, 0.12);
  --px-warn: #ffc94d;

  /* Type — old-money serif for display, clean sans for UI, mono for data */
  --px-font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --px-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, "Roboto Mono", Menlo, Monaco, Consolas, monospace;
  --px-font-serif: "Playfair Display", "Times New Roman", Georgia, serif;

  /* Geometry & motion — a touch sharper than before */
  --px-r-sm: 6px;
  --px-r-md: 10px;
  --px-r-lg: 14px;
  --px-r-xl: 18px;
  /* Telegram safe-area insets — device notch + Telegram's own header/footer
     controls. tg.js sets these from the WebApp API; env() is the browser fallback. */
  --tg-safe-top: env(safe-area-inset-top, 0px);
  --tg-safe-bottom: env(safe-area-inset-bottom, 0px);
  --px-ease: cubic-bezier(0.22, 0.68, 0.2, 1);
  --px-fast: 130ms;
  --px-med: 260ms;

  --px-card-face: linear-gradient(180deg, rgba(57, 255, 107, 0.028) 0%, rgba(57, 255, 107, 0) 60%), #0b100c;
  --px-card-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ----- Reset & base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, #root {
  margin: 0; padding: 0;
  background: var(--px-bg);
  color: var(--px-text);
  font-family: var(--px-font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  min-height: 100vh; min-height: 100dvh;
}
button { font: inherit; cursor: pointer; border: none; background: transparent; color: inherit; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 1px solid var(--px-accent); outline-offset: 1px; }
a { color: var(--px-accent); text-decoration: none; }
::selection { background: rgba(57, 255, 107, 0.28); color: #04170a; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: rgba(57, 255, 107, 0.3); border-radius: 3px; }

/* ----- Typography helpers ------------------------------------------------- */
.px-mono { font-family: var(--px-font-mono); font-feature-settings: "tnum", "zero"; letter-spacing: -0.01em; }
.px-serif { font-family: var(--px-font-serif); font-weight: 500; letter-spacing: 0.005em; }
.px-up { color: var(--px-up); }
.px-down { color: var(--px-down); }

/* ----- Animations --------------------------------------------------------- */
@keyframes pxFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pxBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes pxGlowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(82, 255, 138, 0.5); } 50% { box-shadow: 0 0 0 5px rgba(82, 255, 138, 0); } }

.px-stagger > * { animation: pxFadeUp var(--px-med) var(--px-ease) both; }
.px-stagger > *:nth-child(1) { animation-delay: 0ms; }
.px-stagger > *:nth-child(2) { animation-delay: 40ms; }
.px-stagger > *:nth-child(3) { animation-delay: 80ms; }
.px-stagger > *:nth-child(4) { animation-delay: 120ms; }
.px-stagger > *:nth-child(5) { animation-delay: 160ms; }
.px-stagger > *:nth-child(6) { animation-delay: 200ms; }
.px-stagger > *:nth-child(7) { animation-delay: 240ms; }

/* ----- Frame — invisible editorial column --------------------------------- */
.px-frame { position: relative; background: transparent; border: none; border-radius: 0; padding: 4px 2px; }
.px-frame::before, .px-frame::after, .px-frame > .cbl, .px-frame > .cbr { display: none; }

/* ----- Cards — flat black plates with a green breath ----------------------- */
.px-card {
  background: var(--px-card-face);
  border: 1px solid var(--px-line);
  border-radius: var(--px-r-lg);
  padding: 14px;
  box-shadow: var(--px-card-shadow);
}
.px-card-accent { border-color: var(--px-line-strong); box-shadow: var(--px-card-shadow), 0 0 20px rgba(57, 255, 107, 0.08); }

/* ----- Screen header ----------------------------------------------------- */
.px-screen-header { display: flex; align-items: center; gap: 10px; padding: 4px 8px; margin-bottom: 16px; }
.px-screen-header-back {
  font-size: 18px; color: var(--px-text-dim);
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--px-r-sm);
  border: 1px solid transparent;
  transition: color var(--px-fast) var(--px-ease), border-color var(--px-fast) var(--px-ease);
}
.px-screen-header-back:hover { color: var(--px-accent); border-color: var(--px-line); }
.px-screen-header-title { flex: 1; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--px-accent); font-weight: 600; margin: 0; }

/* ----- Buttons ----------------------------------------------------------- */
.px-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 16px;
  border-radius: var(--px-r-md);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--px-surface);
  color: var(--px-text);
  border: 1px solid var(--px-line);
  transition: border-color var(--px-fast) var(--px-ease), transform var(--px-fast) var(--px-ease), box-shadow var(--px-fast) var(--px-ease), background var(--px-fast) var(--px-ease);
}
.px-btn:hover { border-color: var(--px-line-strong); background: var(--px-surface-2); }
.px-btn:active { transform: scale(0.98); }
.px-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Primary = solid signal green. Flat, loud, glowing. */
.px-btn-primary {
  background: var(--px-accent);
  color: var(--px-gold-ink); border-color: var(--px-accent);
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(57, 255, 107, 0.28);
}
.px-btn-primary:hover { background: #5cff86; border-color: #5cff86; box-shadow: 0 8px 26px rgba(57, 255, 107, 0.38); }
.px-btn-ghost { background: transparent; color: var(--px-text-dim); border-color: var(--px-line); box-shadow: none; }
.px-btn-ghost:hover { color: var(--px-accent); border-color: var(--px-line-strong); background: transparent; }
.px-btn-active { background: var(--px-gold-soft); color: var(--px-accent); border-color: var(--px-line-strong); }
.px-btn-sm { height: 30px; padding: 0 12px; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; }
.px-btn-icon { width: 38px; height: 38px; padding: 0; font-size: 16px; }

/* ----- Form controls ----------------------------------------------------- */
.px-input, .px-select {
  width: 100%; height: 44px; padding: 0 14px;
  background: #090c09;
  border: 1px solid var(--px-line);
  border-radius: var(--px-r-md);
  color: var(--px-text); font-size: 13.5px;
  transition: border-color var(--px-fast) var(--px-ease), box-shadow var(--px-fast) var(--px-ease);
}
.px-input::placeholder { color: var(--px-text-dim); }
.px-input:hover, .px-select:hover { border-color: var(--px-line-strong); }
.px-input:focus, .px-select:focus {
  outline: none; border-color: var(--px-accent);
  box-shadow: 0 0 0 3px rgba(57, 255, 107, 0.14);
}
.px-input-mono { font-family: var(--px-font-mono); letter-spacing: 0.05em; }

/* ----- Status / pills / badges ------------------------------------------ */
.px-status { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--px-text-dim); font-weight: 600; }
.px-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--px-up); animation: pxBlink 2.4s ease-in-out infinite, pxGlowPulse 2.4s ease-in-out infinite; }
.px-status-accent::before { background: var(--px-accent); animation: pxBlink 2.4s ease-in-out infinite; }

.px-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--px-surface-2); color: var(--px-text-dim);
  font-weight: 500; font-size: 11px; letter-spacing: 0.04em;
  flex-shrink: 0;
}
.px-avatar-self {
  background: var(--px-bg-elev);
  border: 1px solid var(--px-line-strong); color: var(--px-accent);
  box-shadow: 0 0 16px rgba(57, 255, 107, 0.18);
}

.px-progress { height: 3px; background: var(--px-surface-2); border-radius: 2px; overflow: hidden; }
.px-progress-fill { height: 100%; background: var(--px-accent); transition: width var(--px-med) var(--px-ease); }
.px-progress-fill-down { background: var(--px-down); }

.px-pill { display: inline-flex; padding: 3px 8px; font-size: 9px; letter-spacing: 0.09em; text-transform: uppercase; font-weight: 700; border-radius: var(--px-r-sm); font-family: var(--px-font-mono); }
.px-pill-buy { background: var(--px-up-soft); color: var(--px-up); border: 1px solid rgba(82, 255, 138, 0.3); }
.px-pill-sell { background: var(--px-down-soft); color: var(--px-down); border: 1px solid rgba(255, 77, 94, 0.3); }

/* ----- Section labels — micro-caps with a fading green rule --------------- */
.px-section-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--px-text-dim); font-weight: 600; margin: 0 0 12px;
}
.px-section-label::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(57, 255, 107, 0.35), transparent 85%);
}

.px-stat { background: var(--px-card-face); border: 1px solid var(--px-line); border-radius: var(--px-r-lg); padding: 13px; box-shadow: var(--px-card-shadow); }
.px-stat-label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--px-text-dim); margin: 0 0 6px; font-weight: 600; }
.px-stat-value { font-size: 23px; font-family: var(--px-font-mono); font-weight: 600; letter-spacing: -0.02em; color: var(--px-text); margin: 0; }
.px-stat-delta { font-size: 11px; font-family: var(--px-font-mono); margin: 4px 0 0; }

.px-step-marker { font-size: 10px; letter-spacing: 0.14em; color: var(--px-accent); text-align: center; margin: 0 0 16px; font-weight: 600; }
.px-step-arrow { text-align: center; color: var(--px-text-dim); font-family: var(--px-font-mono); font-size: 11px; letter-spacing: 0.3em; margin: 0; }

/* ----- App shell — black with a green HUD grid ---------------------------- */
.px-app {
  height: 100vh; height: 100dvh;
  padding-top: var(--tg-safe-top);   /* clear the notch + Telegram header buttons */
  display: flex; flex-direction: column; position: relative;
  background:
    radial-gradient(110% 45% at 50% -10%, rgba(57, 255, 107, 0.09), transparent 60%),
    linear-gradient(rgba(57, 255, 107, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 107, 0.03) 1px, transparent 1px),
    var(--px-bg);
  background-size: auto, 40px 40px, 40px 40px, auto;
}

/* Floating "report a bug" button */
.px-fab {
  position: absolute; right: 16px;
  bottom: calc(86px + var(--tg-safe-bottom));
  z-index: 30;
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--px-surface); color: var(--px-text-dim);
  border: 1px solid var(--px-line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font-size: 20px; cursor: pointer; transition: transform 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.px-fab:hover { color: var(--px-accent); border-color: var(--px-line-strong); }
.px-fab:active { transform: scale(0.93); }

/* Pre-launch banner */
.px-beta-banner {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 7px 14px; text-align: center;
  background: rgba(57, 255, 107, 0.06);
  border-bottom: 1px solid rgba(57, 255, 107, 0.2);
}
.px-beta-tag {
  font-size: 10px; font-weight: 800; letter-spacing: 0.18em;
  background: var(--px-accent); color: var(--px-gold-ink);
  padding: 2px 8px; border-radius: var(--px-r-sm);
}
.px-beta-sub { font-size: 11.5px; font-weight: 500; letter-spacing: 0.03em; color: var(--px-accent); opacity: 0.85; }

.px-app-content {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 14px; max-width: 480px; width: 100%; margin: 0 auto;
}

@media (min-width: 768px) {
  body {
    background:
      radial-gradient(55% 40% at 50% 0%, rgba(57, 255, 107, 0.07), transparent 60%),
      #030503;
  }
  .px-app {
    height: calc(100dvh - 48px); max-width: 440px; margin: 24px auto;
    border: 1px solid rgba(57, 255, 107, 0.25); border-radius: 26px; overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 44px rgba(57, 255, 107, 0.08);
  }
  .px-app-content { padding: 20px 18px; }
}

/* ----- Generic layout helpers -------------------------------------------- */
.px-row { display: flex; align-items: center; gap: 10px; }
.px-col { display: flex; flex-direction: column; }
.px-spread { display: flex; align-items: center; justify-content: space-between; }
.px-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.px-divider { height: 1px; background: var(--px-line); margin: 12px 0; border: 0; }
.px-dim { color: var(--px-text-dim); }
.px-muted { color: var(--px-text-muted); }

/* ----- Bottom navigation — dark HUD dock ---------------------------------- */
.px-bottom-nav {
  flex-shrink: 0; z-index: 20;
  width: calc(100% - 32px); max-width: 420px;
  margin: 10px auto calc(12px + var(--tg-safe-bottom));
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
  padding: 6px;
  background: rgba(8, 11, 8, 0.92);
  border: 1px solid rgba(57, 255, 107, 0.18);
  border-radius: var(--px-r-xl);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}
.px-tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 7px; border-radius: var(--px-r-md);
  color: var(--px-text-dim); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--px-fast) var(--px-ease), background var(--px-fast) var(--px-ease);
}
.px-tab i { font-size: 19px; }
.px-tab:hover { color: var(--px-text-muted); }
.px-tab.active {
  color: var(--px-accent);
  background: var(--px-gold-soft);
  box-shadow: inset 0 0 0 1px rgba(57, 255, 107, 0.25), 0 0 14px rgba(57, 255, 107, 0.12);
}

/* ----- Segmented filter control ------------------------------------------ */
.px-segmented {
  display: flex; gap: 4px; width: 100%;
  background: #090c09; border: 1px solid var(--px-line);
  border-radius: var(--px-r-md); padding: 4px;
}
.px-segmented button {
  flex: 1; height: 30px; border-radius: var(--px-r-sm);
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 700;
  color: var(--px-text-dim);
  transition: color var(--px-fast) var(--px-ease), background var(--px-fast) var(--px-ease);
}
.px-segmented button:hover { color: var(--px-text-muted); }
.px-segmented button.active { background: var(--px-gold-soft); color: var(--px-accent); box-shadow: inset 0 0 0 1px rgba(57, 255, 107, 0.35); }

/* ----- Toggle switch ------------------------------------------------------ */
.px-toggle {
  position: relative; width: 48px; height: 27px; flex-shrink: 0;
  border-radius: 999px; background: #090c09; border: 1px solid var(--px-line);
  transition: background var(--px-med) var(--px-ease), border-color var(--px-med) var(--px-ease), box-shadow var(--px-med) var(--px-ease);
}
.px-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--px-text-dim);
  transition: transform var(--px-med) var(--px-ease), background var(--px-med) var(--px-ease);
}
.px-toggle.on { background: var(--px-gold-soft); border-color: var(--px-line-strong); box-shadow: 0 0 12px rgba(57, 255, 107, 0.22); }
.px-toggle.on::after { transform: translateX(21px); background: var(--px-accent); }

/* ----- Tags --------------------------------------------------------------- */
.px-tag {
  display: inline-flex; align-items: center; padding: 2px 8px;
  font-size: 10px; letter-spacing: 0.03em; border-radius: var(--px-r-sm);
  background: var(--px-surface-2); color: var(--px-text-muted);
  border: 1px solid var(--px-line);
}

/* ----- Pressable list card ------------------------------------------------ */
.px-press { transition: border-color var(--px-fast) var(--px-ease), box-shadow var(--px-fast) var(--px-ease), transform var(--px-fast) var(--px-ease); }
.px-press:hover { border-color: var(--px-line-strong); box-shadow: var(--px-card-shadow), 0 0 18px rgba(57, 255, 107, 0.07); }
.px-press:active { transform: scale(0.99); }

/* ----- Reaction chips ----------------------------------------------------- */
.px-react {
  display: inline-flex; align-items: center; gap: 5px;
  height: 27px; padding: 0 10px;
  border-radius: 999px; font-size: 12px;
  background: var(--px-surface-2); border: 1px solid var(--px-line);
  color: var(--px-text-muted);
  transition: border-color var(--px-fast) var(--px-ease), background var(--px-fast) var(--px-ease), color var(--px-fast) var(--px-ease);
}
.px-react:hover { border-color: var(--px-line-strong); }
.px-react.active { border-color: var(--px-line-strong); color: var(--px-accent); background: var(--px-gold-soft); }
.px-react .px-react-n { font-family: var(--px-font-mono); font-size: 11px; }

/* ----- Empty state -------------------------------------------------------- */
.px-empty { text-align: center; padding: 36px 16px; color: var(--px-text-dim); }
.px-empty i { font-size: 28px; display: block; margin-bottom: 10px; color: rgba(57, 255, 107, 0.4); }

/* ==========================================================================
   Signature surfaces
   ========================================================================== */

/* Signal plate: black card with a green keyline + soft interior glow.
   (Same structure as before: .px-plate-gold > .px-plate-inner) */
.px-plate-gold {
  position: relative;
  border-radius: var(--px-r-xl);
  padding: 1px;
  background: linear-gradient(180deg, rgba(57, 255, 107, 0.55), rgba(57, 255, 107, 0.12));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 30px rgba(57, 255, 107, 0.09);
}
.px-plate-gold > .px-plate-inner {
  position: relative; overflow: hidden;
  border-radius: calc(var(--px-r-xl) - 1px);
  background:
    radial-gradient(110% 80% at 80% -10%, rgba(57, 255, 107, 0.12), transparent 55%),
    #080b08;
  padding: 22px 18px;
}

/* Serif display headline for hero surfaces. */
.px-display {
  font-family: var(--px-font-serif);
  font-weight: 500; line-height: 1.12; letter-spacing: 0.002em;
  margin: 0;
}
.px-display em, .px-display .gold { font-style: italic; color: var(--px-accent); }

/* Green CTA — flat, loud, arcade-confident. */
.px-gold-cta {
  position: relative;
  width: 100%; border: 1px solid var(--px-accent); cursor: pointer;
  border-radius: var(--px-r-md);
  background: var(--px-accent);
  color: var(--px-gold-ink); font-weight: 800; font-size: 14px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 15px 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 8px 28px rgba(57, 255, 107, 0.3);
  transition: transform var(--px-fast) var(--px-ease), box-shadow var(--px-fast) var(--px-ease), background var(--px-fast) var(--px-ease);
}
.px-gold-cta:hover { background: #5cff86; box-shadow: 0 10px 32px rgba(57, 255, 107, 0.4); }
.px-gold-cta:active { transform: scale(0.985); }
.px-gold-cta:disabled { opacity: 0.6; }

/* Hairline ledger rows */
.px-ledger-row { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; border-top: 1px solid var(--px-line); }
.px-ledger-row:first-child { border-top: none; }

/* ----- Range slider (deposit / lot / horizon scrollers) ------------------- */
.px-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px; background: transparent; cursor: pointer;
}
.px-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--px-accent) 0%, var(--px-accent) var(--fill, 50%), var(--px-surface-2) var(--fill, 50%));
}
.px-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -8px; border-radius: 50%;
  background: var(--px-accent); border: 3px solid #0b100c;
  box-shadow: 0 0 12px rgba(57, 255, 107, 0.5);
}
.px-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--px-surface-2); }
.px-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--px-accent); }
.px-range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--px-accent); border: 3px solid #0b100c;
  box-shadow: 0 0 12px rgba(57, 255, 107, 0.5);
}

/* Brand logo — breathing green glow (loading / hero) */
@keyframes pxLogoPulse {
  0%, 100% { opacity: 0.82; filter: drop-shadow(0 0 5px rgba(57, 255, 107, 0.22)); transform: scale(1); }
  50%      { opacity: 1;    filter: drop-shadow(0 0 24px rgba(57, 255, 107, 0.55)); transform: scale(1.035); }
}
.px-logo-pulse { animation: pxLogoPulse 1.9s ease-in-out infinite; will-change: opacity, transform, filter; }


/* Inline spinner (web login "waiting for Telegram" state). */
@keyframes pxSpin { to { transform: rotate(360deg); } }
.px-spin { display: inline-block; animation: pxSpin 0.9s linear infinite; }

/* ===== Desktop web shell (CRM-style) ======================================
   Applies ONLY to the browser build (html.px-web, set by tg.js) at wide
   viewports. Layout language follows the PrimeX CRM — fixed left rail with
   icon nav rows and a glowing active bar, wide content pane — rendered in
   Breakout's green brand. Telegram and narrow browsers keep the phone shell
   (sidebar stays display:none there). */
.px-sidenav { display: none; }

@media (min-width: 1024px) {
  html.px-web body { background: #030503; }

  /* Undo the phone-frame treatment from the 768px block — but only for the
     full app shell. Login / paywall / wizard have no sidebar and keep the
     centered phone-frame card (reads as a focused auth/checkout step). */
  html.px-web .px-app:has(.px-sidenav) {
    height: 100dvh; max-width: none; margin: 0;
    border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  }

  /* Shell grid: rail spans both rows; banner + content in the main column. */
  html.px-web .px-app:has(.px-sidenav) {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  html.px-web .px-app:has(.px-sidenav) .px-beta-banner { grid-column: 2; grid-row: 1; }
  html.px-web .px-app:has(.px-sidenav) .px-app-content {
    grid-column: 2; grid-row: 2;
    max-width: 880px; margin: 0 auto; width: 100%;
    padding: 30px 40px 40px;
  }

  html.px-web .px-sidenav {
    display: flex; flex-direction: column;
    grid-column: 1; grid-row: 1 / 3;
    background: rgba(5, 8, 5, 0.96);
    border-right: 1px solid rgba(57, 255, 107, 0.14);
    padding: 20px 12px 16px;
    overflow-y: auto;
  }
  html.px-web .px-side-brand { padding: 2px 10px 18px; }
  html.px-web .px-side-brand img { width: 150px; max-width: 100%; height: auto; display: block; }

  html.px-web .px-side-label {
    font-size: 9.5px; font-weight: 700; letter-spacing: 0.22em;
    color: var(--px-text-dim); margin: 14px 12px 6px;
  }
  html.px-web .px-side-item {
    display: flex; align-items: center; gap: 11px; width: calc(100% - 4px);
    padding: 9px 12px; margin: 1px 2px; border-radius: 8px;
    background: none; border: 1px solid transparent; cursor: pointer;
    color: var(--px-text-muted); font-size: 13px; font-weight: 500;
    text-align: left; position: relative;
    transition: all 0.18s ease;
  }
  html.px-web .px-side-item i { font-size: 17px; width: 20px; text-align: center; }
  html.px-web .px-side-item:hover { background: rgba(57, 255, 107, 0.05); color: var(--px-text); }
  html.px-web .px-side-item.active {
    background: linear-gradient(90deg, rgba(57, 255, 107, 0.13), rgba(57, 255, 107, 0.04));
    border-color: rgba(57, 255, 107, 0.18);
    color: var(--px-accent);
  }
  html.px-web .px-side-item.active::before {
    content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
    width: 2px; height: 18px; border-radius: 0 2px 2px 0;
    background: var(--px-accent); box-shadow: 0 0 8px rgba(57, 255, 107, 0.55);
  }

  html.px-web .px-side-user {
    margin-top: auto; padding: 12px 10px 2px;
    display: flex; align-items: center; gap: 10px;
    border-top: 1px solid rgba(57, 255, 107, 0.12);
  }
  html.px-web .px-side-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(57, 255, 107, 0.12); border: 1px solid rgba(57, 255, 107, 0.3);
    color: var(--px-accent); font-size: 12px; font-weight: 700;
  }
  html.px-web .px-side-name {
    margin: 0; font-size: 12.5px; font-weight: 600; color: var(--px-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  html.px-web .px-side-handle { margin: 0; font-size: 10.5px; color: var(--px-text-dim); }
  html.px-web .px-side-logout {
    background: none; border: 0; cursor: pointer; padding: 6px;
    color: var(--px-text-dim); font-size: 16px; border-radius: 6px;
  }
  html.px-web .px-side-logout:hover { color: var(--px-down, #ff5c5c); background: rgba(255, 92, 92, 0.08); }

  /* Phone chrome off on desktop: dock + bug FAB live in the sidebar now. */
  html.px-web .px-app:has(.px-sidenav) .px-bottom-nav,
  html.px-web .px-app:has(.px-sidenav) .px-fab { display: none; }

  /* Give two-column helper grids room to breathe in the wide pane. */
  html.px-web .px-app:has(.px-sidenav) .px-grid-2 { gap: 14px; }
}

/* ===== Login screen ========================================================
   Mobile / Telegram: stacked column inside the phone shell. Desktop web
   (html.px-web ≥1024px): CRM-style split panel — brand + steps left,
   sign-in card right — on a full-bleed background. */
.px-login { padding-top: 24px; }
.px-login-panel { display: flex; flex-direction: column; gap: 22px; }
.px-login-logo { width: 170px; max-width: 58%; height: auto; margin-bottom: 16px; }
.px-login-brand { text-align: center; }
.px-login-title { font-size: 24px; margin: 0 0 6px; }
.px-login-sub { font-size: 13px; line-height: 1.5; color: var(--px-text-dim); margin: 0 0 22px; }
.px-login-step { gap: 12px; align-items: flex-start; margin-bottom: 14px; text-align: left; }
.px-login-step-icon {
  width: 34px; height: 34px; border-radius: var(--px-r-md); flex-shrink: 0;
  border: 1px solid var(--px-line); background: var(--px-bg);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--px-text-dim); font-size: 17px;
}
.px-login-auth { text-align: center; }
.px-login-auth-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.2em;
  color: var(--px-accent); margin: 0 0 8px;
}
.px-login-admin { margin: 26px 0 0; font-size: 11px; }
.px-login-admin a { color: var(--px-text-dim); opacity: 0.75; }
.px-login-admin a:hover { color: var(--px-accent); opacity: 1; }

@media (min-width: 1024px) {
  /* Full-bleed page (no phone frame) whenever the login screen is showing. */
  html.px-web .px-app:has(.px-login) {
    height: 100dvh; max-width: none; margin: 0;
    border: 0; border-radius: 0; box-shadow: none; overflow: visible;
  }
  html.px-web .px-app:has(.px-login) .px-app-content {
    max-width: none; display: flex; align-items: center; justify-content: center;
    padding: 40px;
  }
  html.px-web .px-login { padding: 0; width: 100%; max-width: 920px; }
  html.px-web .px-login-panel {
    display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 0;
    background: rgba(8, 11, 8, 0.95);
    border: 1px solid rgba(57, 255, 107, 0.22);
    border-radius: 18px; overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 44px rgba(57, 255, 107, 0.07);
  }
  html.px-web .px-login-brand {
    text-align: left; padding: 42px 40px;
    background:
      radial-gradient(90% 60% at 0% 0%, rgba(57, 255, 107, 0.08), transparent 60%),
      rgba(5, 8, 5, 0.6);
    border-right: 1px solid rgba(57, 255, 107, 0.12);
  }
  html.px-web .px-login-logo { margin-bottom: 22px; }
  html.px-web .px-login-title { font-size: 28px; }
  html.px-web .px-login-auth {
    padding: 42px 38px; display: flex; flex-direction: column; justify-content: center;
  }
}
