/* —— Anti-zoom (Telegram mobile) —— */
html, body {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  overscroll-behavior-x: none;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
input, textarea, select, button {
  font-size: 16px; /* prevent iOS focus-zoom */
  touch-action: manipulation;
}

/* Binance Mini App enhancements (classic UX polish) */

:root {
  --fp-gold: #f0b90b;
  --fp-gold-dim: rgba(240, 185, 11, .14);
  --fp-ink: #eaecef;
  --fp-muted: #848e9c;
  --fp-panel: #12161c;
  --fp-line: rgba(255, 255, 255, .08);
  --fp-ok: #0ecb81;
  --fp-err: #f6465d;
}

/* —— Toasts —— */
.fp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 99999;
  transform: translate(-50%, 12px);
  max-width: min(92vw, 360px);
  padding: 11px 16px;
  border-radius: 12px;
  background: #1e2329;
  border: 1px solid var(--fp-line);
  color: var(--fp-ink);
  font: 500 13px/1.35 "IBM Plex Sans", system-ui, sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.fp-toast.show { opacity: 1; transform: translate(-50%, 0); }
.fp-toast-top {
  top: calc(12px + env(safe-area-inset-top, 0px));
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -12px);
  background: rgba(14, 203, 129, .95);
  color: #04140c;
  border: none;
  font-weight: 700;
  z-index: 100200;
  box-shadow: 0 8px 28px rgba(14, 203, 129, .35);
}
.fp-toast-top.show { transform: translate(-50%, 0); }
.fp-toast.ok { border-color: rgba(14, 203, 129, .45); }
.fp-toast.err { border-color: rgba(246, 70, 93, .45); }
.fp-toast.gold { border-color: rgba(240, 185, 11, .5); }

/* —— Loading skeletons —— */
.app-shell > .loading,
main.app-shell .loading {
  display: grid !important;
  gap: 12px;
  width: 100%;
  padding: 8px 0 24px;
  color: transparent !important;
  font-size: 0 !important;
}
.app-shell > .loading::before,
main.app-shell .loading::before {
  content: "";
  display: block;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(90deg, #12161c 0%, #1c2128 45%, #12161c 100%);
  background-size: 200% 100%;
  animation: fp-shimmer 1.2s ease-in-out infinite;
}
.app-shell > .loading::after,
main.app-shell .loading::after {
  content: "";
  display: grid;
  gap: 10px;
  height: 220px;
  border-radius: 14px;
  background:
    linear-gradient(#12161c 0 56px, transparent 56px 68px) 0 0 / 100% 68px,
    linear-gradient(#12161c 0 88px, transparent 88px) 0 78px / 100% 88px,
    linear-gradient(#12161c 0 88px, transparent 88px) 0 176px / 100% 88px;
  background-repeat: no-repeat;
  mask-image: linear-gradient(90deg, #000 40%, rgba(0,0,0,.35) 50%, #000 60%);
  animation: fp-shimmer 1.2s ease-in-out infinite;
}
@keyframes fp-shimmer {
  0% { background-position: 100% 0; opacity: .85; }
  100% { background-position: -100% 0; opacity: 1; }
}

/* —— Share modal —— */
.fp-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  animation: fp-fade .18s ease;
}
.fp-overlay.closing { animation: fp-fade-out .18s ease forwards; }
@keyframes fp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fp-fade-out { to { opacity: 0; } }
.fp-sheet {
  width: min(100%, 420px);
  max-height: min(86vh, 640px);
  overflow: auto;
  border-radius: 18px 18px 14px 14px;
  background: #0b0e11;
  border: 1px solid var(--fp-line);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: fp-up .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fp-up { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }
.fp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.fp-sheet-head h2 {
  margin: 0;
  font: 600 17px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--fp-ink);
}
.fp-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #1e2329;
  color: var(--fp-muted);
  cursor: pointer;
}
.fp-preview {
  padding: 14px;
  border-radius: 12px;
  background: #12161c;
  border: 1px solid var(--fp-line);
  color: var(--fp-ink);
  font: 400 13px/1.5 "IBM Plex Sans", system-ui, sans-serif;
  margin-bottom: 14px;
  word-break: break-word;
}
.fp-preview a { color: var(--fp-gold); }
.fp-actions { display: grid; gap: 8px; }
.fp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 600 14px/1 "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}
.fp-btn-primary {
  background: var(--fp-gold);
  color: #0b0e11;
}
.fp-btn-secondary {
  background: #1e2329;
  color: var(--fp-ink);
  border-color: var(--fp-line);
}

/* —— Deal mini progress —— */
.fp-deal-progress {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(240, 185, 11, .06);
  border: 1px solid rgba(240, 185, 11, .18);
}
.fp-deal-progress .fp-hint {
  margin: 0 0 8px;
  color: var(--fp-ink);
  font: 500 12px/1.35 "IBM Plex Sans", system-ui, sans-serif;
}
.fp-bar {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.fp-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0b90b, #fcd535);
  transition: width .35s ease;
}
.deal-card .fp-deal-progress { margin-top: 2px; }

/* —— Wallet requisites —— */
.fp-req {
  margin: 14px 0 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--fp-panel);
  border: 1px solid var(--fp-line);
}
.fp-req-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.fp-req-head h3 {
  margin: 0;
  font: 600 14px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--fp-ink);
}
.fp-req-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.fp-req-tabs::-webkit-scrollbar { display: none; }
.fp-chip {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--fp-line);
  background: #0b0e11;
  color: var(--fp-muted);
  font: 600 12px/1 "IBM Plex Sans", system-ui, sans-serif;
  cursor: pointer;
}
.fp-chip.active {
  color: #0b0e11;
  background: var(--fp-gold);
  border-color: var(--fp-gold);
}
.fp-req-row {
  display: grid;
  gap: 8px;
}
.fp-req-label {
  color: var(--fp-muted);
  font: 500 11px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.fp-req-value {
  color: var(--fp-ink);
  font: 500 13px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  word-break: break-all;
}
.fp-req-value.empty { color: var(--fp-muted); }
.fp-req-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.fp-req-btns .fp-btn { min-height: 38px; flex: 1; font-size: 13px; }

/* —— Live reviews —— */
.fp-reviews {
  display: grid;
  gap: 12px;
}
.fp-reviews-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--fp-panel);
  border: 1px solid var(--fp-line);
}
.fp-reviews-summary strong {
  display: block;
  font: 700 28px/1 "IBM Plex Sans", system-ui, sans-serif;
  color: var(--fp-gold);
}
.fp-reviews-summary span {
  color: var(--fp-muted);
  font: 400 12px/1.3 "IBM Plex Sans", system-ui, sans-serif;
}
.fp-review {
  padding: 12px 14px;
  border-radius: 12px;
  background: #0f1318;
  border: 1px solid var(--fp-line);
}
.fp-review-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.fp-review-top strong { color: var(--fp-ink); font: 600 13px/1.2 "IBM Plex Sans", system-ui, sans-serif; }
.fp-stars { color: var(--fp-gold); letter-spacing: 1px; font-size: 12px; }
.fp-review p {
  margin: 0;
  color: #b7bdc6;
  font: 400 13px/1.45 "IBM Plex Sans", system-ui, sans-serif;
}
.fp-review small {
  display: block;
  margin-top: 8px;
  color: var(--fp-muted);
  font-size: 11px;
}
.fp-write {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--fp-panel);
  border: 1px solid var(--fp-line);
}
.fp-write textarea,
.fp-write input,
.fp-write select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--fp-line);
  background: #0b0e11;
  color: var(--fp-ink);
  font: 400 13px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  resize: vertical;
}
.fp-write textarea { min-height: 72px; }

/* —— Deal list cleanup (classic flow) —— */
.deal-card .action-row {
  display: none !important;
}
.deal-card .deal-info-button {
  display: none !important;
}
/* info button hidden → 2-col grid, no empty third cell */
.deal-card.fp-card-tappable .deal-card-summary {
  grid-template-columns: auto minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: start !important;
}
.deal-card.fp-card-tappable .deal-card-copy {
  min-width: 0 !important;
  max-width: 100%;
  overflow: hidden;
}
.deal-card.fp-card-tappable .deal-top {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  gap: 6px 8px !important;
}
.deal-card.fp-card-tappable .deal-ref {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.deal-card.fp-card-tappable .deal-state {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal !important;
  text-align: left;
  line-height: 1.25 !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.deal-card.fp-card-tappable .deal-description {
  margin: 8px 0 !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.deal-card.fp-card-tappable .deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.deal-card.fp-card-tappable .deal-amount {
  overflow-wrap: anywhere;
}
.deal-card.fp-card-tappable {
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
  overflow: hidden;
}
.deal-card.fp-card-tappable:active {
  transform: scale(.985);
}
.fp-open-hint {
  margin-top: 8px;
  color: var(--fp-muted);
  font: 500 11px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* —— Full deal detail (classic substance, Binance skin) —— */
.fp-deal-detail {
  position: fixed;
  z-index: 100050;
  inset: 0;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  color: var(--fp-ink);
  background: #050608;
  animation: deal-status-in .22s ease both;
}
.fp-deal-detail.closing {
  animation: fp-fade-out .18s ease forwards;
}
.fp-deal-detail__shell {
  box-sizing: border-box;
  width: 100%;
  max-width: 620px;
  min-height: 100%;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 94% 3%, rgba(240, 185, 11, .09), transparent 26%), #050608;
}
.fp-deal-detail__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
}
.fp-deal-back,
.fp-deal-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  color: #b7bdc6;
  border: 1px solid rgba(255, 255, 255, .09);
  background: #15171c;
  cursor: pointer;
  font: 700 13px/1 "IBM Plex Sans", system-ui, sans-serif;
  flex-shrink: 0;
}
.fp-deal-back {
  gap: 6px;
  padding: 0 12px 0 10px;
  border-radius: 12px;
  max-width: calc(100% - 56px);
}
.fp-deal-x {
  width: 40px;
  border-radius: 50%;
}
.fp-deal-detail__ref {
  margin: 18px 0 14px;
  font-size: clamp(22px, 7vw, 34px);
  line-height: 1.1;
  letter-spacing: -.04em;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fp-deal-card {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 10px;
  padding: 14px 12px;
  border: 1px solid rgba(240, 185, 11, .19);
  border-radius: 16px;
  background: linear-gradient(145deg, #181b21, #0d0f13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 14px 34px rgba(0, 0, 0, .3);
  overflow: hidden;
}
.fp-deal-card.is-exception {
  border-color: rgba(246, 70, 93, .35);
}
.fp-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--fp-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.fp-deal-card > strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-weight: 650;
}
.fp-deal-card > strong b {
  color: var(--fp-gold);
}
.fp-deal-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 18px;
  gap: 2px;
}
.fp-deal-track:before,
.fp-deal-track:after {
  content: "";
  position: absolute;
  top: 7px;
  left: 10%;
  width: 80%;
  height: 3px;
  border-radius: 99px;
  pointer-events: none;
}
.fp-deal-track:before { background: #34373d; }
.fp-deal-track:after {
  width: var(--deal-progress, 0%);
  max-width: 80%;
  background: var(--fp-gold);
}
.fp-stage {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
}
.fp-stage span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2b2f36;
  border: 2px solid #3a3f47;
  box-sizing: border-box;
}
.fp-stage.is-complete span {
  background: var(--fp-gold);
  border-color: var(--fp-gold);
}
.fp-stage small {
  display: none; /* labels collide on phones; step name is in title */
  color: var(--fp-muted);
  font-size: 9px;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-stage.is-complete small { color: var(--fp-ink); }
.fp-protected {
  margin: 12px 0 0;
  color: #b7bdc6;
  font: 500 12px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.fp-amount {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}
.fp-amount > span {
  flex: 0 0 auto;
  max-width: 72px;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(240, 185, 11, .12);
  color: var(--fp-gold);
  font: 700 11px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fp-amount > div {
  flex: 1 1 auto;
  min-width: 0;
}
.fp-amount strong {
  display: block;
  font-size: clamp(17px, 5.2vw, 22px);
  line-height: 1.25;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fp-amount p {
  margin: 0;
  color: #b7bdc6;
  font: 400 13px/1.45 "IBM Plex Sans", system-ui, sans-serif;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fp-facts {
  display: grid;
  gap: 10px;
  margin: 0 0 10px;
}
.fp-facts > div {
  display: grid;
  grid-template-columns: minmax(72px, 38%) minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
}
.fp-facts dt {
  margin: 0;
  color: var(--fp-muted);
  font: 500 12px/1.35 "IBM Plex Sans", system-ui, sans-serif;
}
.fp-facts dd {
  margin: 0;
  color: var(--fp-ink);
  font: 600 13px/1.35 "IBM Plex Sans", system-ui, sans-serif;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fp-guide__title {
  margin-bottom: 6px;
  color: var(--fp-gold);
  font: 700 12px/1.25 "IBM Plex Sans", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.fp-guide__body {
  color: #eaecef;
  font: 400 14px/1.5 "IBM Plex Sans", system-ui, sans-serif;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.fp-deal-actions {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.fp-deal-actions .fp-btn {
  box-sizing: border-box;
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}
.fp-btn-danger {
  background: rgba(246, 70, 93, .14);
  color: #f6465d;
  border: 1px solid rgba(246, 70, 93, .35);
}
.fp-pay-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #12161c;
  border: 1px solid rgba(240, 185, 11, .22);
  overflow: hidden;
}
.fp-pay-summary > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
  color: var(--fp-muted);
  font: 500 12px/1.35 "IBM Plex Sans", system-ui, sans-serif;
}
.fp-pay-summary > div span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.fp-pay-summary strong {
  color: var(--fp-ink);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}
.fp-status-card {
  padding: 14px;
  border-radius: 14px;
  text-align: center;
  font: 600 14px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  overflow-wrap: anywhere;
}
.fp-status-card.ok {
  background: rgba(14, 203, 129, .12);
  color: #0ecb81;
  border: 1px solid rgba(14, 203, 129, .3);
}
.fp-status-card.bad {
  background: rgba(246, 70, 93, .12);
  color: #f6465d;
  border: 1px solid rgba(246, 70, 93, .3);
}

/* Raise share overlay above deal detail */
.fp-overlay { z-index: 100060; }
.fp-sheet {
  box-sizing: border-box;
  max-width: min(100%, 420px);
}
.fp-preview {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 420px) {
  .fp-stage small {
    display: block;
  }
  .fp-deal-card > strong {
    font-size: 17px;
  }
  .fp-deal-detail__shell {
    padding-left: 18px;
    padding-right: 18px;
  }
}


/* —— Create deal wizard (classic mechanics, Binance skin) —— */
.fp-cd-overlay {
  position: fixed;
  inset: 0;
  z-index: 100080;
  background: rgba(0, 0, 0, .72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .22s ease;
}
.fp-cd-overlay.open { opacity: 1; }
.fp-cd-overlay.closing { opacity: 0; }

.fp-cd-sheet {
  width: 100%;
  max-width: 440px;
  max-height: min(92vh, 720px);
  overflow: auto;
  background: linear-gradient(180deg, #1a1f26 0%, #0b0e11 100%);
  border: 1px solid var(--fp-line);
  border-bottom: none;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  transform: translateY(18px);
  transition: transform .22s ease;
  color: var(--fp-ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}
.fp-cd-overlay.open .fp-cd-sheet { transform: translateY(0); }
.fp-cd-overlay.closing .fp-cd-sheet { transform: translateY(24px); }

.fp-cd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fp-line);
}
.fp-cd-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--fp-ink);
}
.fp-cd-x {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  color: var(--fp-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.fp-cd-x:active { background: rgba(240,185,11,.16); color: var(--fp-gold); }

.fp-cd-step.hidden { display: none; }
.fp-cd-step-title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: var(--fp-ink);
}

.fp-cd-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--fp-gold);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 0 12px;
  cursor: pointer;
}
.fp-cd-back svg { stroke: currentColor; }

.fp-cd-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fp-cd-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(240,185,11,.22);
  background: rgba(240,185,11,.06);
  color: var(--fp-ink);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.fp-cd-choice:active {
  transform: translateY(1px);
  border-color: var(--fp-gold);
  background: rgba(240,185,11,.14);
}
.fp-cd-choice svg { stroke: var(--fp-gold); }

.fp-cd-currency-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  padding-bottom: 4px;
}
.fp-cd-currency {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border-radius: 14px;
  border: 1px solid var(--fp-line);
  background: rgba(255,255,255,.03);
  color: var(--fp-ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.fp-cd-currency:active {
  border-color: rgba(240,185,11,.55);
  background: var(--fp-gold-dim);
}
.fp-cd-cur-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  color: var(--fp-ink);
}
.fp-cd-cur-icon.ton { color: #0098ea; background: rgba(0,152,234,.14); }
.fp-cd-cur-icon.usdt { color: #26a17b; background: rgba(38,161,123,.14); }
.fp-cd-cur-icon.stars { color: var(--fp-gold); background: var(--fp-gold-dim); }

.fp-cd-amount-wrap {
  position: relative;
  margin-bottom: 14px;
}
.fp-cd-input,
.fp-cd-textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid var(--fp-line);
  background: #0b0e11;
  color: var(--fp-ink);
  font: 500 16px/1.35 "IBM Plex Sans", system-ui, sans-serif;
  padding: 14px 16px;
  outline: none;
}
.fp-cd-input { padding-right: 72px; }
.fp-cd-input:focus,
.fp-cd-textarea:focus {
  border-color: rgba(240,185,11,.55);
  box-shadow: 0 0 0 3px rgba(240,185,11,.12);
}
.fp-cd-amount-cur {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fp-gold);
  font-weight: 700;
  font-size: 13px;
}
.fp-cd-textarea { resize: vertical; min-height: 110px; margin-bottom: 12px; }

.fp-cd-help {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(240,185,11,.07);
  border: 1px solid rgba(240,185,11,.18);
  color: var(--fp-muted);
  font-size: 13px;
  line-height: 1.45;
}
.fp-cd-help p { margin: 0 0 8px; }
.fp-cd-help p:last-child { margin-bottom: 0; }
.fp-cd-help b { color: var(--fp-ink); }
.fp-cd-help pre,
.fp-cd-help code {
  display: block;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.35);
  color: #fcd535;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.fp-cd-help code { display: inline; padding: 2px 6px; }

.fp-cd-summary {
  margin-bottom: 14px;
  border-radius: 14px;
  border: 1px solid var(--fp-line);
  background: rgba(255,255,255,.03);
  overflow: hidden;
}
.fp-cd-sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--fp-line);
  font-size: 14px;
}
.fp-cd-sum-row:last-child { border-bottom: none; }
.fp-cd-sum-row > span:first-child { color: var(--fp-muted); flex-shrink: 0; }
.fp-cd-sum-row > span:last-child {
  color: var(--fp-ink);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.fp-cd-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: #0b0e11;
  background: linear-gradient(90deg, #f0b90b, #fcd535);
  box-shadow: 0 8px 24px rgba(240,185,11,.22);
}
.fp-cd-primary:active { filter: brightness(.95); }

/* Safety warning */
.fp-cd-safety-overlay { z-index: 100090; opacity: 1; }
.fp-cd-safety {
  max-height: min(94vh, 760px);
}
.fp-cd-safety-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fp-line);
}
.fp-cd-safety-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.fp-cd-safety-pulse {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff5252 0%, #d23030 100%);
  box-shadow: 0 0 0 3px rgba(255,82,82,.2), 0 0 14px rgba(255,82,82,.3);
  animation: fpCdPulse 2.2s ease-in-out infinite;
}
@keyframes fpCdPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,82,82,.18), 0 0 12px rgba(255,82,82,.28); }
  50% { box-shadow: 0 0 0 4px rgba(255,82,82,.42), 0 0 18px rgba(255,82,82,.55); }
}
.fp-cd-safety-body {
  color: var(--fp-muted);
  font-size: 14px;
  line-height: 1.5;
  max-height: 55vh;
  overflow: auto;
  margin-bottom: 16px;
}
.fp-cd-safety-body p { margin: 0 0 10px; }
.fp-cd-safety-headline {
  color: #ff6b6b !important;
  font-weight: 700;
  font-size: 14px;
}
.fp-cd-safety-callout {
  color: #fcd535 !important;
  font-weight: 600;
}
.fp-cd-safety-section {
  color: var(--fp-ink) !important;
  font-weight: 700;
  margin-top: 12px !important;
}
.fp-cd-safety-list {
  margin: 0 0 10px;
  padding-left: 18px;
}
.fp-cd-safety-list li { margin: 6px 0; }
.fp-cd-safety-list.punish li { color: #f6465d; }
.fp-cd-safety-footer {
  color: var(--fp-ink) !important;
  font-weight: 600;
}
.fp-cd-mgr {
  color: var(--fp-gold);
  text-decoration: none;
  font-weight: 700;
}
.fp-cd-safety-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: not-allowed;
  color: #848e9c;
  background: rgba(255,255,255,.06);
  transition: background .2s, color .2s;
}
.fp-cd-safety-btn.ready {
  cursor: pointer;
  color: #0b0e11;
  background: linear-gradient(90deg, #f0b90b, #fcd535);
  box-shadow: 0 8px 24px rgba(240,185,11,.22);
}
.fp-cd-safety-btn:disabled { opacity: .85; }

@media (min-width: 480px) {
  .fp-cd-overlay { align-items: center; padding: 24px; }
  .fp-cd-sheet {
    border-radius: 18px;
    border-bottom: 1px solid var(--fp-line);
    max-height: 86vh;
  }
}


/* (old reviews block removed) */

/* —— Deal menu: stack Active above History (full width) —— */
.deals-page .deal-menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.deals-page .deal-menu-create {
  order: 1;
  grid-column: 1 / -1;
}
/* DOM order: 1=create, 2=history, 3=active → reorder to create → active → history */
.deals-page .deal-menu-grid > .deal-menu-card:nth-child(3) {
  order: 2;
}
.deals-page .deal-menu-grid > .deal-menu-card:nth-child(2) {
  order: 3;
}
.deals-page .deal-menu-card:not(.deal-menu-create) {
  min-height: 72px;
  padding: 14px 16px;
}


/* Animated deal progress (classic-style fill) */
.fp-deal-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 18px;
  padding-top: 0;
}
.fp-deal-track:before,
.fp-deal-track:after { display: none !important; }
.fp-deal-track__fill {
  position: absolute;
  left: 8%;
  right: auto;
  top: 11px;
  height: 3px;
  width: 0;
  max-width: 84%;
  border-radius: 99px;
  background: linear-gradient(90deg, #0ecb81, #f0b90b);
  box-shadow: 0 0 12px rgba(14, 203, 129, .45);
  transition: width .55s cubic-bezier(.32,.72,0,1);
  z-index: 0;
}
.fp-deal-track--animated::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 11px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
  z-index: 0;
}
.fp-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.fp-stage span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2b3139;
  border: 2px solid #3a4149;
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease, transform .35s ease;
}
.fp-stage.is-complete span {
  background: #0ecb81;
  border-color: #0ecb81;
  box-shadow: 0 0 0 4px rgba(14,203,129,.18);
}
.fp-stage.is-active span {
  transform: scale(1.12);
  background: #f0b90b;
  border-color: #f0b90b;
  box-shadow: 0 0 0 5px rgba(240,185,11,.22);
  animation: fpStagePulse 1.6s ease-in-out infinite;
}
@keyframes fpStagePulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(240,185,11,.18); }
  50% { box-shadow: 0 0 0 7px rgba(240,185,11,.32); }
}

/* Reviews: iframe is the ONLY scroll surface */
.reviews-page.section-page {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
  display: block !important;
  height: calc(100dvh - 88px) !important;
  max-height: calc(100dvh - 88px) !important;
  overflow: hidden !important;
}
.fp-classic-reviews {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
}
.fp-reviews-frame {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  border: 0;
  background: #000;
  color-scheme: dark;
  /* Let the iframe document scroll; contain overscroll so TG doesn't close */
  touch-action: pan-y !important;
  overscroll-behavior: contain !important;
}
/* Lock parent page scroll only — iframe still scrolls internally */
html.fp-reviews-open,
body.fp-reviews-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  height: 100% !important;
}
html.fp-reviews-open .app-shell {
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
}
html.fp-reviews-open .topbar,
html.fp-reviews-open .page-stage > *:not(.reviews-page) {
  /* keep topbar if present, but reviews use full bleed */
}
.reviews-page.section-page {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
.fp-classic-reviews,
.fp-reviews-frame {
  width: 100% !important;
}

/* Leaders prize on two lines */
.leader-promo-prize,
.fp-prize-line1,
.fp-prize-line2 {
  display: block;
  text-align: center;
  line-height: 1.05;
}
.fp-prize-line1 { font-size: 1.05em; }
.fp-prize-line2 { font-size: 1.05em; letter-spacing: .02em; }
.leader-promo strong {
  display: inline-block;
  max-width: 100%;
}
.fp-leader-pad {
  opacity: .92;
}


/* —— Anti-flash: hide native React pages until our overlays mount —— */
.wallets-page.section-page,
.reviews-page.section-page {
  animation: none !important;
}
/* Hide ALL native children immediately; only our overlays stay visible */
.wallets-page > *:not(.fpw-classic) {
  display: none !important;
}
.reviews-page > *:not(.fp-classic-reviews) {
  display: none !important;
}
/* Soft placeholder while wallet overlay mounts (avoids empty jump) */
.wallets-page:not(:has(.fpw-classic))::after {
  content: "";
  display: block;
  height: 220px;
  margin: 8px 0;
  border-radius: 18px;
  background: linear-gradient(90deg, #14181f 0%, #1e2329 50%, #14181f 100%);
  background-size: 200% 100%;
  animation: fpwShimmer 1.1s ease-in-out infinite;
}
@keyframes fpwShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.fpw-classic {
  animation: fpwFadeIn .18s ease both;
}
@keyframes fpwFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Wallet classic — full-width stacked buttons like classic app */
.fpw-classic {
  padding: 4px 4px 32px;
  color: #eaecef;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.fpw-head { margin: 0 0 10px; }
.fpw-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #eaecef;
}
.fpw-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px;
  margin: 0 0 4px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
}
.fpw-strip::-webkit-scrollbar { display: none; }
.fpw-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid #2b3139;
  background: #1e2329;
  color: #eaecef;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fpw-chip:active { transform: scale(0.97); }
.fpw-chip.is-active {
  background: rgba(240,185,11,.18);
  border-color: #f0b90b;
  color: #f0b90b;
}
.fpw-chip .cur-icon,
.fpw-chip svg {
  width: 22px !important;
  height: 22px !important;
  flex-shrink: 0;
}
.fpw-chip-label { white-space: nowrap; }

.fpw-balance {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
  padding: 18px 16px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1e2329 0%, #0b0e11 100%);
  border: 1px solid rgba(240,185,11,.32);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.fpw-balance-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fpw-balance-icon .cur-icon,
.fpw-balance-icon svg {
  width: 44px !important;
  height: 44px !important;
}
.fpw-balance-meta { min-width: 0; flex: 1; }
.fpw-balance-label {
  color: #848e9c;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}
.fpw-balance-val {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  word-break: break-word;
}
.fpw-balance-cur {
  font-size: 15px;
  font-weight: 600;
  color: #f0b90b;
  margin-left: 4px;
}

.fpw-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 22px;
  width: 100%;
}
.fpw-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100% !important;
  min-height: 54px;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  overflow: visible;
  line-height: 1.2;
}
.fpw-btn svg { flex-shrink: 0; width: 20px; height: 20px; }
.fpw-btn span { white-space: nowrap; overflow: visible; }
.fpw-btn:active { transform: scale(0.98); opacity: 0.92; }

.fpw-btn--deposit {
  background: linear-gradient(90deg, #f0b90b 0%, #fcd535 100%);
  color: #0b0e11;
  box-shadow: 0 4px 16px rgba(240,185,11,.28);
}
.fpw-btn--withdraw {
  background: #1e2329;
  color: #eaecef;
  border: 1px solid #2b3139;
}

.fpw-rates { margin-top: 4px; }
.fpw-rates-head h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: #848e9c;
}
.fpw-rates-list {
  border-radius: 16px;
  background: #12161c;
  border: 1px solid #1e2329;
  overflow: hidden;
}
.fpw-rate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.fpw-rate-row:last-child { border-bottom: 0; }
.fpw-rate-row--loading {
  color: #848e9c;
  font-size: 13px;
  justify-content: center;
}
.fpw-rate-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  color: #eaecef;
  font-size: 15px;
}
.fpw-rate-left .cur-icon,
.fpw-rate-left svg {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
}
.fpw-rate-right { text-align: right; display: grid; gap: 2px; }
.fpw-rate-usd { font-weight: 600; font-size: 15px; color: #eaecef; }
.fpw-rate-rub { color: #848e9c; font-size: 12px; }
.fpw-hint {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(240,185,11,.08);
  border: 1px solid rgba(240,185,11,.22);
  color: #c7ccd3;
  font-size: 13px;
  line-height: 1.4;
}
.fpw-link { color: #f0b90b; font-weight: 700; text-decoration: none; }


/* Profile worker + admin panels — classic layout, Binance palette */
.fp-profile-panels {
  display: grid;
  gap: 14px;
  padding: 8px 0 28px;
  width: 100%;
}
.fp-worker-card,
.fp-owner-card {
  border-radius: 18px;
  background: linear-gradient(160deg, #1a1f26 0%, #0c0e12 100%);
  border: 1px solid rgba(240,185,11,.28);
  padding: 16px 14px 14px;
  color: #eaecef;
  box-shadow: 0 6px 22px rgba(0,0,0,.28);
}
.fp-card-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #f0b90b;
  letter-spacing: -0.01em;
}
.fp-kv { display: grid; gap: 8px; margin-bottom: 10px; }
.fp-kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #848e9c;
}
.fp-kv-row strong { color: #eaecef; font-weight: 700; font-size: 14px; }
.fp-kv-gold { color: #f0b90b !important; }
.fp-kv-section {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #848e9c;
}
.fp-owner-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.fp-owner-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.fp-owner-stat__val {
  font-size: 16px;
  font-weight: 700;
  color: #f0b90b;
}
.fp-owner-stat__key {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #848e9c;
  text-align: center;
}
.fp-ow-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.fp-ow-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  line-height: 1.2;
}
.fp-ow-btn:active { transform: scale(0.98); opacity: .92; }
.fp-ow-btn--primary {
  background: linear-gradient(90deg, #f0b90b, #fcd535);
  color: #0b0e11;
  box-shadow: 0 4px 14px rgba(240,185,11,.22);
}
.fp-ow-btn--secondary {
  background: #1e2329;
  color: #eaecef;
  border: 1px solid #2b3139;
}
.fp-ow-list { display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.fp-ow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.fp-ow-sub { font-size: 12px; color: #848e9c; margin-top: 2px; }
.fp-ow-empty { text-align: center; color: #848e9c; padding: 20px 8px; font-size: 13px; }
.fp-ow-mini {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #2b3139;
  background: #1e2329;
  color: #eaecef;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
