/* Colour scope: same classic UI, repainted in the new app's black/gold palette. */
.fpc {
  --primary-bg:        #000000;
  --secondary-bg:      #0B0E11;
  --card-bg:           #1E2329;
  --accent-blue:       #F0B90B;
  --accent-light-blue: #FCD535;
  --text-primary:      #EAECEF;
  --text-secondary:    #848E9C;
  --border-color:      #2B3139;

  --overlay-1: rgba(255,255,255,0.04);
  --overlay-2: rgba(255,255,255,0.08);
  --overlay-3: rgba(255,255,255,0.14);
  --overlay-fade: rgba(255,255,255,0.04);

  --surface-elevated: #2B3139;
  --surface-pressed:  rgba(255,255,255,0.06);

  --shadow-small:  0 2px 8px rgba(0,0,0,0.30);
  --shadow-medium: 0 4px 16px rgba(0,0,0,0.40);
  --shadow-large:  0 8px 32px rgba(0,0,0,0.50);

  --color-success: #0ECB81;
  --color-warning: #F0B90B;
  --color-danger:  #F6465D;
  --color-info:    #F0B90B;
  --color-ton:     #0098EA;
  --color-usdt:    #26A17B;
  --color-stars:   #F0B90B;

  --btn-secondary-bg:       #2B3139;
  --btn-secondary-bg-hover: #3D4551;
  --btn-secondary-border:   #434C5A;

  --radius-small: 10px;
  --radius-medium: 16px;
  --radius-large: 24px;
  --border-radius: 16px;
  --border-radius-small: 10px;
  --transition: .2s ease;
  --safe-area-top: env(safe-area-inset-top, 0px);
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --tg-viewport-height: 100dvh;

  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
}

.fpc, .fpc * , .fpc *::before, .fpc *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.fpc.modal-overlay { z-index: 100100; }
.fpc .mat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.22em;
  flex: 0 0 1.15em;
  line-height: 1;
}
.fpc .mat-icon svg { width: 100%; height: 100%; display: block; }
.fpc .mat-icon--crisis { color: #ff5252; }
.fpc .mat-icon--warn   { color: #F0B90B; }
.fpc .mat-icon--shield { color: #0ECB81; }
.fpc .mat-icon--check  { color: #0ECB81; }
.fpc .mat-icon--cancel { color: #ff5252; }
.fpc .mat-icon--money  { color: #F0B90B; }
.fpc .mat-icon--lock   { color: var(--accent-blue); }

/* Classic create-deal UI copied 1:1 from the old app, scoped to .fpc */
.fpc button, .fpc .btn, .fpc .tab-button, .fpc .choice-btn, .fpc .owner-action, .fpc [data-action], .fpc [data-share], .fpc .btn-close, .fpc .copy-btn, .fpc a.btn {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.fpc .page-header .btn-back {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    margin: 0;
}
.fpc .page-header:has(.btn-back) .page-title {
    padding-left: 48px;
}
.fpc .balance-item.hidden { display: none; }
.fpc .currency-icon, .fpc .currency-icon-img, .fpc .currency-icon-svg, .fpc .cur-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.fpc .currency-icon-svg svg, .fpc .cur-icon {
    display: block;
}
.fpc .currency-icon.small, .fpc .currency-icon-img.small, .fpc .currency-icon-svg.small, .fpc .cur-icon.cur-icon-sm {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
}
.fpc .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    min-height: 52px;
    border: none;
    border-radius: var(--radius-medium);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    /* Earlier this was `transition: all 0.2s ease` which animated
       transform, box-shadow, color, padding — everything. When the
       JS toggled `.active` while the user's tap was still triggering
       `:active` (scale(.96)), the simultaneous transform + bg-color
       transitions clashed → "залития голубым мигает и дергает" (blue
       fill flashing/jerking on STARS recipient switch). Scoping the
       transition to only the colour properties keeps the press feel
       crisp while the colour swap stays smooth. */
    transition: background-color 0.18s ease,
                border-color 0.18s ease,
                color 0.18s ease,
                box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.fpc .btn:active {
    transform: scale(0.96);
    /* The press transform is INSTANT — separate from the colour
       transition above so the two never compete on the same axis. */
    transition: transform 0.08s ease, background-color 0.18s ease,
                border-color 0.18s ease, color 0.18s ease;
}
.fpc .btn-primary {
    background: linear-gradient(180deg, #F2E6B0 0%, #D4AF37 45%, #B8922A 100%);
    color: #1A1408;
    font-weight: 600;
    border: 1px solid rgba(232, 212, 139, 0.45);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.38),
        0 2px 10px rgba(184, 146, 42, 0.28);
}
.fpc .btn-primary:hover {
    background: linear-gradient(180deg, #F7EDC4 0%, #E0C04A 45%, #C9A227 100%);
    color: #1A1408;
}
.fpc .btn-success {
    background: var(--color-success);
    color: white;
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.35);
}
@media (hover: hover) and (pointer: fine) {
  .fpc .btn-success:hover {
        filter: brightness(0.92);
    }
}
.fpc .btn-secondary {
    /* Use a TINTED surface (not pure card-bg) so the button is
       visibly different from the modal/card behind it. In the
       light theme card-bg, secondary-bg AND the surrounding card
       are ALL #FFFFFF, so a button using `--card-bg` literally
       blended into the background and looked like text floating
       on white — exactly the "кнопки сливаются" bug. The new
       `--btn-secondary-bg` resolves to #181A20 on light (matches
       iOS HIG secondary surface) and a slightly raised mid-gray
       on dark; either way the button is clearly a button. */
    background: var(--btn-secondary-bg, #181A20);
    color: var(--text-primary);
    border: 1px solid var(--btn-secondary-border, rgba(0,0,0,0.18));
}
@media (hover: hover) and (pointer: fine) {
  .fpc .btn-secondary:hover {
        background: var(--btn-secondary-bg-hover, #E5E5EA);
    }
}
.fpc .btn-secondary.active {
    background: linear-gradient(180deg, #F2E6B0 0%, #D4AF37 45%, #B8922A 100%);
    color: #1A1408;
    border-color: rgba(232, 212, 139, 0.45);
    font-weight: 600;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        0 2px 8px rgba(184, 146, 42, 0.22);
}
.fpc .btn svg {
    flex-shrink: 0;
}
.fpc .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.fpc .btn-icon:hover {
    background: var(--secondary-bg);
    transform: scale(1.05);
}
.fpc .btn-icon:active {
    transform: scale(0.95);
}
@media (min-width: 640px) {
  .fpc .order-detail-overlay, .fpc .transactions-overlay, .fpc .reviews-overlay, .fpc.modal-overlay, .fpc #fp-banned-overlay, .fpc #pk-banned-overlay {
        left: max(0px, calc(50% - 215px)) !important;
        right: auto !important;
        width: min(430px, 100vw) !important;
    }
  .fpc .modal, .fpc.modal-overlay > .modal-content {
        max-width: none;
    }
}
.fpc.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    opacity: 0;
    animation: fpc-fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.fpc.modal-overlay.closing {
    animation: fpc-fadeOut 0.15s cubic-bezier(0.4, 0, 1, 1) forwards;
}
.fpc .modal, .fpc.modal-overlay > .modal-content {
    width: 100%;
    max-width: min(420px, calc(100vw - 32px));
    max-height: min(88dvh, calc(var(--tg-viewport-height, 100dvh) - 32px));
    margin: 0 auto;
    background: var(--secondary-bg);
    border-radius: 24px;
    padding: 20px 18px 22px;
    transform: scale(0.96) translateY(8px);
    opacity: 0;
    animation: fpc-modalCenterIn 0.22s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    will-change: transform, opacity;
    box-sizing: border-box;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}
.fpc.modal-overlay.closing .modal, .fpc.modal-overlay.closing > .modal-content {
    animation: fpc-modalCenterOut 0.18s cubic-bezier(0.4, 0, 1, 1) forwards;
}
/* centered on all sizes — see .fpc.modal-overlay above */

.fpc .modal > .modal-content {
    transform: translateY(20px);
    opacity: 0;
    animation: fpc-slideUpFade 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0.05s forwards;
    will-change: transform, opacity;
}
.fpc .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.fpc .modal-title {
    font-size: 22px;
    font-weight: 700;
}
.fpc .modal-close, .fpc .btn-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--overlay-1);
    border: 1.5px solid var(--overlay-2);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.fpc .modal-close:hover, .fpc .btn-close:hover {
    background: var(--overlay-2);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}
.fpc .modal-close:active, .fpc .btn-close:active {
    transform: scale(0.95);
}
.fpc .modal-close svg, .fpc .btn-close svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}
.fpc .modal-body {
    padding-top: 4px;
}
.fpc .btn-block { width: 100%; }
.fpc .btn-sm { padding: 8px 16px; font-size: 14px; min-height: 36px; }
.fpc .form-text {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}
.fpc .modal-actions, .fpc .modal-footer {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}
.fpc .modal-actions > .btn, .fpc .modal-footer  > .btn {
    flex: 1;
}
.fpc .form {
    width: 100%;
}
.fpc .form-step {
    animation: fpc-fadeIn 0.3s ease;
}
.fpc .form-step.hidden {
    display: none;
}
.fpc .form-step-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    text-align: center;
}
.fpc .back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    transition: opacity 0.2s ease;
}
.fpc .back-btn:hover {
    opacity: 0.7;
}
.fpc .button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.fpc .choice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    min-height: 56px;
    background: var(--overlay-1);
    border: 2px solid var(--overlay-2);
    border-radius: var(--radius-medium);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.fpc .choice-btn:hover {
    background: var(--overlay-2);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}
.fpc .choice-btn svg {
    width: 24px;
    height: 24px;
}
.fpc .currency-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: min(52dvh, 380px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: 4px;
    margin: 0 -2px;
    padding-left: 2px;
    padding-right: 2px;
}
.fpc .currency-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    min-height: 96px;
    background: var(--overlay-1);
    border: 2px solid var(--overlay-2);
    border-radius: var(--radius-medium);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.fpc .currency-btn:hover {
    background: var(--overlay-2);
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}
.fpc .form-group {
    margin-bottom: 20px;
    position: relative;
}
.fpc .form-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.fpc .form-group > label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.005em;
    line-height: 1.3;
}
.fpc .form-input, .fpc .form-select, .fpc .form-textarea, .fpc .form-control, .fpc input[type="text"], .fpc input[type="number"], .fpc input[type="email"], .fpc select {
    width: 100%;
    padding: 14px 16px;
    padding-right: 60px; /* Room for .input-currency */
    background: var(--secondary-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-appearance: none;
    appearance: none;
}
.fpc .form-input:focus, .fpc .form-select:focus, .fpc .form-textarea:focus, .fpc .form-control:focus, .fpc input[type="text"]:focus, .fpc input[type="number"]:focus, .fpc input[type="email"]:focus, .fpc select:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(252,213,53, 0.1);
}
.fpc .form-input::placeholder, .fpc .form-control::placeholder, .fpc input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}
.fpc .form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
.fpc .input-currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}
.fpc .order-summary {
    background: var(--overlay-1);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
}
.fpc .summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--overlay-2);
}
.fpc .summary-item:last-child {
    border-bottom: none;
}
.fpc .summary-item span:first-child {
    color: var(--text-secondary);
}
.fpc .summary-item span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}
.fpc .btn-disconnect {
    width: 100%;
    padding: 10px 16px;
    background: rgba(255, 59, 48, 0.15);
    color: var(--color-danger);
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.fpc .btn-disconnect:hover {
    background: rgba(255, 59, 48, 0.25);
}
.fpc .btn-disconnect:active {
    transform: scale(0.96);
}
.fpc .btn-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: rgba(252,213,53, 0.15);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--accent-blue);
    flex-shrink: 0;
}
.fpc .btn-icon:hover {
    background: rgba(252,213,53, 0.25);
    transform: scale(1.1);
}
.fpc .btn-icon svg {
    width: 20px;
    height: 20px;
}
.fpc .form-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.fpc .btn-back {
    width: 36px;
    height: 36px;
    background: rgba(252,213,53, 0.1);
    border: 1.5px solid rgba(252,213,53, 0.2);
    border-radius: 12px;
    padding: 0;
    margin-right: 12px;
    cursor: pointer;
    color: var(--accent-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}
.fpc .btn-back:hover {
    background: rgba(252,213,53, 0.15);
    border-color: rgba(252,213,53, 0.3);
    transform: translateX(-2px);
}
.fpc .btn-back:active {
    transform: translateX(-2px) scale(0.95);
}
.fpc .btn-back svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}
.fpc .language-modal .modal-content {
    max-width: 400px;
}
.fpc .theme-toggle.hidden { display: none; }
@media (hover: none) {
  .fpc .btn-primary:hover { background: var(--accent-blue); }
  .fpc .btn-secondary:not(.active):hover { background: var(--btn-secondary-bg, var(--card-bg)); }
  .fpc .btn-icon:hover { background: var(--card-bg); transform: none; }
  .fpc .modal-close:hover, .fpc .btn-close:hover { background: var(--overlay-1); }
  .fpc .back-btn:hover { background: transparent; }
  .fpc .choice-btn:hover { background: var(--overlay-1); border-color: var(--overlay-2); }
  .fpc .currency-btn:hover { background: var(--overlay-1); border-color: var(--overlay-2); transform: none; }
  .fpc .btn-disconnect:hover { background: var(--card-bg); }
}
.fpc button:focus, .fpc .btn:focus, .fpc .tab-button:focus {
    outline: none;
}
.fpc button:focus-visible, .fpc .btn:focus-visible, .fpc .tab-button:focus-visible {
    outline: 2px solid rgba(252,213,53,0.5);
    outline-offset: 2px;
}
.fpc .form-step-help {
    background: rgba(252,213,53,0.06);
    border: 1px solid rgba(252,213,53,0.18);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}
.fpc .form-step-help p { margin: 0 0 8px; }
.fpc .form-step-help p:last-child { margin-bottom: 0; }
.fpc .form-step-help b { color: var(--text-primary); }
.fpc .form-step-help code, .fpc .form-step-help pre {
    background: var(--overlay-1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--accent-light-blue, #5DC0FF);
}
.fpc .form-step-help pre {
    display: block;
    padding: 8px 10px;
    margin: 6px 0;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}
.fpc .handover-confirm .modal-content, .fpc .handover-confirm {
    max-width: 420px;
}
.fpc .action-stack > .btn { margin: 0; }
.fpc .action-buttons .btn { flex: 1; min-width: 0; }
.fpc .action-buttons .btn-secondary.active {
    background: linear-gradient(180deg, #F2E6B0 0%, #D4AF37 45%, #B8922A 100%);
    color: #1A1408;
    border-color: rgba(232, 212, 139, 0.45);
    font-weight: 600;
}
.fpc .action-buttons--orders .btn {
    flex: none;
    width: 100%;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 18px;
    background: #1E2329;
    color: #EAECEF;
    border: 1px solid #2B3139;
    box-shadow: none;
    font-weight: 600;
}
.fpc .action-buttons--orders .btn:hover, .fpc .action-buttons--orders .btn:active {
    background: #2B3139;
    color: #EAECEF;
}
.fpc .action-buttons--orders .btn-primary, .fpc .action-buttons--orders .btn-secondary, .fpc .action-buttons--orders .btn-reviews, .fpc .action-buttons--orders .btn-secondary.active {
    background: #1E2329 !important;
    color: #EAECEF !important;
    border: 1px solid #2B3139 !important;
    box-shadow: none !important;
}
.fpc .action-buttons--orders .btn-secondary.active {
    border-color: rgba(252,213,53,0.45) !important;
    background: #252A33 !important;
}
.fpc .btn-lottie {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease, filter 0.18s ease;
}
.fpc .btn-lottie.is-ready {
    opacity: 1;
}
.fpc .btn-lottie canvas, .fpc .btn-lottie svg {
    display: block;
    width: 30px !important;
    height: 30px !important;
}
.fpc .action-buttons--orders .btn .btn-lottie.is-ready {
    filter: brightness(0) saturate(100%) invert(72%) sepia(45%) saturate(620%) hue-rotate(7deg) brightness(92%) contrast(92%);
}
.fpc .action-buttons--orders .btn:active .btn-lottie.is-ready {
    transform: scale(1.08);
}
.fpc #reviews-btn.btn-reviews {
    position: relative;
    overflow: hidden;
}
.fpc.safety-warning-overlay { z-index: 4900; }
.fpc .safety-warning {
    /* Slightly tighter than the default modal so the warning text feels
       focused rather than sprawling. */
    padding: 20px 18px calc(var(--safe-area-bottom) + 18px) !important;
    /* Lock the sheet inside the viewport. We block BOTH horizontal
       scroll (the "можно листать вправо и влево" bug) AND any child
       from exceeding the modal's intrinsic content width. */
    box-sizing: border-box;
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
    /* Touch-action prevents iOS pull-to-scroll horizontally even
       when content tries to overflow — belt-and-braces with the
       overflow-x:hidden above. */
    touch-action: pan-y;
}
.fpc .safety-warning-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--overlay-1);
    /* Allow the title block to shrink for long localized titles. */
    min-width: 0;
    max-width: 100%;
    /* IMPORTANT: NO overflow:hidden here. The badge's outer glow
       ring extends ~17px outside the badge perimeter on every side,
       and clipping it at the head's left edge made the icon look
       cut-off / "вылазит за границу". The parent `.safety-warning`
       already has `overflow-x: hidden` so any real overflow is still
       contained at modal level. */
}
.fpc .safety-warning-pulse {
    position: relative;
    width: 44px; height: 44px;
    border-radius: 50%;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #ff5252 0%, #d23030 100%);
    /* Soft alpha-pulse on the glow ring — opacity-only so the badge
       doesn't change SIZE (no overflow clipping). The pulse is
       slow + subtle so it conveys urgency without being noisy. */
    box-shadow:
        0 0 0 3px rgba(255, 82, 82, 0.20),
        0 0 14px rgba(255, 82, 82, 0.30);
    animation: fpc-safetyPulseGlow 2.2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .fpc .safety-warning-pulse { animation: none; }
}
.fpc .safety-warning-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.2;
    /* Long titles wrap at word boundaries when possible. We only
       use `overflow-wrap: break-word`, NOT `anywhere` or
       `word-break: break-all` — those broke words letter-by-letter
       which made Russian/Ukrainian text read like a typewriter
       glitch. break-word only splits a word when there's literally
       no other way to fit it. */
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}
.fpc .safety-warning-body {
    max-height: 56vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    /* No padding-right — used to push the scrollbar slightly off
       the edge, but on iOS it gave the impression the content
       could scroll sideways. */
    padding-right: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    -webkit-overflow-scrolling: touch;
    /* Word-break protection at the BODY level only. Inner elements
       inherit the wrapping behavior naturally. We deliberately do
       NOT cascade `word-break: break-word` to every descendant
       (which made every <p>, <b>, <li> break by letters) — only
       `overflow-wrap: break-word` here is enough for natural,
       readable text in any of the 5 languages. */
    overflow-wrap: break-word;
    word-wrap: break-word;
    /* Hard width cap. The modal sheet has its own padding so this
       value matches the available content width and nothing inside
       can overflow horizontally. */
    max-width: 100%;
    box-sizing: border-box;
    /* Block horizontal touch-pan ourselves too — some browsers
       respect this even when overflow-x:hidden is set. */
    touch-action: pan-y;
}
.fpc .safety-warning-body pre, .fpc .safety-warning-body code {
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: pre-wrap;
    max-width: 100%;
}
.fpc .safety-warning-body p { margin: 0 0 10px; }
.fpc .safety-warning-body .safety-headline {
    font-weight: 700;
    color: #ff5252;
    font-size: 14px;
    letter-spacing: 0.02em;
}
.fpc .safety-warning-body .safety-callout {
    background: rgba(255, 82, 82, 0.10);
    border-left: 3px solid #ff5252;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px 0 14px;
    font-weight: 600;
}
.fpc [dir="rtl"] .safety-warning-body .safety-callout {
    border-left: none;
    border-right: 3px solid #ff5252;
}
.fpc .safety-warning-body .safety-section-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 14px;
}
.fpc .safety-warning-body ul.safety-list {
    list-style: none;
    margin: 6px 0 12px;
    padding: 0;
}
.fpc .safety-warning-body ul.safety-list li {
    /* IMPORTANT: NOT `display: flex`. Earlier this was flex with
       gap:8px, which turned every text run + every <b> element
       inside the <li> into an *anonymous flex item*. Each one
       then got an 8px gap around it, scattering the sentence
       across the line: "Передавайте  ТОЛЬКО  на  @Binance helper
       подарок  аккаунт" — exactly the screenshot bug.
       The icon now floats absolutely in a left gutter and the
       text flows as normal inline content. No more anonymous
       flex children, words wrap normally. */
    display: block;
    position: relative;
    padding: 8px 10px 8px 36px;
    margin-bottom: 6px;
    background: var(--overlay-1);
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
}
.fpc [dir="rtl"] .safety-warning-body ul.safety-list li {
    padding: 8px 36px 8px 10px;
    text-align: right;
}
.fpc .safety-warning-body ul.safety-list li > .mat-icon {
    position: absolute;
    left: 10px;
    top: 10px;
}
.fpc [dir="rtl"] .safety-warning-body ul.safety-list li > .mat-icon {
    left: auto;
    right: 10px;
}
.fpc .safety-warning-body ul.safety-list .ok { color: #49df64; flex: 0 0 18px; }
.fpc .safety-warning-body ul.safety-list .bad { color: #ff5252; flex: 0 0 18px; }
.fpc .safety-warning-body ul.safety-list .warn { color: #ffcc33; flex: 0 0 18px; }
.fpc .mat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.22em;
    flex: 0 0 1.15em;
    line-height: 1;
}
.fpc .mat-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.fpc .mat-icon--crisis { color: #ff5252; }
.fpc .mat-icon--warn { color: #ffcc33; }
.fpc .mat-icon--shield { color: #49df64; }
.fpc .mat-icon--check { color: #49df64; }
.fpc .mat-icon--cancel { color: #ff5252; }
.fpc .mat-icon--money { color: #ffcc33; }
.fpc .mat-icon--lock { color: var(--accent-blue); }
.fpc .safety-warning-body .safety-headline .mat-icon { width: 1.3em; height: 1.3em; flex: 0 0 1.3em; }
.fpc .safety-warning-body .safety-callout  .mat-icon { width: 1.25em; height: 1.25em; flex: 0 0 1.25em; }
.fpc .safety-warning-body .safety-section-title .mat-icon { width: 1.2em; height: 1.2em; flex: 0 0 1.2em; }
.fpc .safety-warning-body ul.safety-list li .mat-icon { width: 1.2em; height: 1.2em; flex: 0 0 1.2em; }
.fpc .safety-warning-body .safety-footer .mat-icon { width: 1.2em; height: 1.2em; flex: 0 0 1.2em; }
@media (prefers-reduced-motion: reduce) {
  .fpc .mat-icon { animation: none !important; }
}
.fpc .safety-warning-body ul.safety-list--punish li {
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.18);
}
.fpc .safety-warning-confirm {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 15px 18px;
    border: 1px solid rgba(255, 82, 82, 0.35);
    border-radius: 14px;
    background: rgba(255, 82, 82, 0.08);
    color: rgba(255, 82, 82, 0.78);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: not-allowed;
    font-variant-numeric: tabular-nums;
    transition:
        background 0.20s ease,
        color      0.20s ease,
        border     0.20s ease,
        transform  0.10s ease;
}
.fpc .safety-warning-confirm:disabled {
    cursor: not-allowed;
    opacity: 0.82;
}
.fpc .safety-warning-confirm--ready {
    cursor: pointer;
    background: linear-gradient(135deg, #ff5252 0%, #d23030 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow:
        0 8px 22px rgba(255, 82, 82, 0.40),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
    animation: fpc-safetyReadyIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.fpc .safety-warning-confirm--ready:active {
    transform: scale(0.985);
    box-shadow:
        0 4px 12px rgba(255, 82, 82, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
@media (prefers-reduced-motion: reduce) {
  .fpc .safety-warning-confirm--ready { animation: none; }
}
.fpc .safety-warning-body .safety-mgr, .fpc .safety-warning-body a.safety-mgr {
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(252,213,53, 0.10);
    padding: 1px 6px;
    border-radius: 6px;
    text-decoration: none;
    /* Keep it inline so it doesn't break the surrounding sentence
       layout; whitespace preserves the natural reading flow. */
    white-space: nowrap;
}
.fpc .safety-warning-body a.safety-mgr:active {
    background: rgba(252,213,53, 0.20);
}
.fpc .safety-warning-body .safety-footer {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--overlay-1);
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
}
.fpc .safety-warning-confirm {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 16px;
    border: none;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #b03030 0%, #7a1f1f 100%);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: not-allowed;
    opacity: 0.62;
    transition: opacity 0.25s ease, background 0.25s ease, transform 0.12s ease;
}
.fpc .safety-warning-confirm:not([disabled]):hover { opacity: 1; }
.fpc .safety-warning-confirm--ready {
    background: linear-gradient(135deg, #ff5252 0%, #d23030 100%);
    box-shadow:
        0 6px 18px rgba(255, 82, 82, 0.32),
        inset 0 1px 0 rgba(255,255,255,0.18);
    cursor: pointer;
    opacity: 1 !important;
}
.fpc .safety-warning-confirm--ready:active { transform: scale(0.985); }
@media (prefers-reduced-motion: reduce) {
  .fpc .skeleton, .fpc .progress-dot.active::before, .fpc .progress-line-fill.active::after, .fpc .safety-warning-pulse, .fpc .safety-warning-pulse svg, .fpc .balance-skeleton, .fpc .tab-indicator {
        animation: none !important;
    }
}
.fpc [dir="rtl"] body, .fpc [dir="rtl"] .page, .fpc [dir="rtl"] .modal-content {
    text-align: right;
}
.fpc [dir="rtl"] .back-btn svg, .fpc [dir="rtl"] .btn-back svg {
    transform: scaleX(-1);
}
.fpc [dir="rtl"] .modal-actions {
    flex-direction: row-reverse;
}
.fpc .owner-action.btn-primary .owner-action__icon {
    background: rgba(24,26,32,0.12);
    color: #181A20;
}
.fpc .owner-modal .modal-content {
    max-width: 480px;
    width: 100%;
}
.fpc .owner-modal .modal-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.fpc .owner-modal .btn-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fpc [dir="rtl"] .info-card .copy-btn, .fpc [dir="rtl"] .info-card .btn-icon {
    /* Copy/edit buttons inside info-cards (USDT addresses, deposit
     * card number, TON address etc.). Were flush-right in LTR; flip
     * to flush-left under RTL via margin-inline. */
    margin-inline-start: 0;
    margin-inline-end: 8px;
}
.fpc [dir="rtl"] .modal-actions {
    /* Confirm/cancel button pair — already had row-reverse rule in
     * upstream CSS for the safety modal, but the generic
     * `.modal-actions` (used by withdraw-cancel, disconnect-wallet)
     * was missed. */
    flex-direction: row-reverse;
}
.fpc .deals-banner__caption, .fpc .deals-banner__dot, .fpc.modal-overlay, .fpc .glass, .fpc [class*="glass"] {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}
@keyframes fpc-appSplashSpin {
    to { -webkit-transform: rotate(360deg); }
}
@keyframes fpc-appSplashSpin {
    to { transform: rotate(360deg); }
}
@keyframes fpc-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes fpc-fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
@keyframes fpc-slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fpc-slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}
@keyframes fpc-leadersHaloIn {
    to { opacity: 1; }
}
@keyframes fpc-leadersSparkle {
    0%, 100% { opacity: 0; transform: scale(0.6); }
    50%      { opacity: 1; transform: scale(1.2); }
}
@keyframes fpc-leadersAvatarPop {
    from { opacity: 0.6; transform: translateY(8px) scale(0.85); }
    to   { opacity: 1;   transform: translateY(0) scale(1); }
}
@keyframes fpc-leadersMedalBounce {
    0%   { opacity: 0; transform: scale(0); }
    60%  { opacity: 1; transform: scale(1.4); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes fpc-medalShineGold {
    0%   { transform: translateX(-130%); }
    50%  { transform: translateX(130%); }
    100% { transform: translateX(130%); }
}
@keyframes fpc-medalShineSilver {
    0%   { transform: translateX(-130%); }
    55%  { transform: translateX(130%); }
    100% { transform: translateX(130%); }
}
@keyframes fpc-medalShineBronze {
    0%   { transform: translateX(-130%); }
    55%  { transform: translateX(130%); }
    100% { transform: translateX(130%); }
}
@keyframes fpc-leadersNameIn {
    from { opacity: 0.5; transform: translateY(4px); }
    to   { opacity: 1;   transform: translateY(0); }
}
@keyframes fpc-leadersBlockRise {
    0%   { transform: scaleY(0.92); opacity: 0.85; }
    100% { transform: scaleY(1); opacity: 1; }
}
@keyframes fpc-leadersWinnerBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px); }
}
@keyframes fpc-leadersRowIn {
    from { opacity: 0.4; transform: translateY(8px); }
    to   { opacity: 1;   transform: translateY(0); }
}
@keyframes fpc-leadersSplashFade {
    to { opacity: 1; }
}
@keyframes fpc-leadersSparkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50%      { opacity: 0.75; transform: scale(1); }
}
@keyframes fpc-leadersTrophyIn {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fpc-leadersTrophyFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
@keyframes fpc-leadersSplashFadeUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fpc-leadersCdTick {
    0%   { opacity: 0.4; transform: translateY(-4px); }
    100% { opacity: 1;   transform: translateY(0); }
}
@keyframes fpc-leadersBonusHalo {
    0%, 100% { opacity: 0.7; transform: translate(-30%, -50%) scale(1); }
    50%      { opacity: 1;   transform: translate(-30%, -50%) scale(1.08); }
}
@keyframes fpc-leadersBonusShine {
    0%   { transform: translateX(-100%); }
    50%  { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}
@keyframes fpc-leadersBonusIconPulse {
    0%, 100% { transform: scale(1)   rotate(0deg); }
    50%      { transform: scale(1.06) rotate(2deg); }
}
@keyframes fpc-leadersRaffleShake {
    0%, 88%, 100% { transform: rotate(0deg); }
    91% { transform: rotate(-6deg); }
    94% { transform: rotate(6deg); }
    97% { transform: rotate(-3deg); }
}
@keyframes fpc-leadersSkelPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.85; }
}
@keyframes fpc-slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes fpc-slideDownIn {
    /* unused — kept for future top-dropdown animations. Renamed to avoid
       colliding with the modal-overlay close keyframe of the same name. */
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes fpc-skel-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}
@keyframes fpc-seg-fade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fpc-ton-connect-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes fpc-ton-connect-spin {
    to { transform: rotate(360deg); }
}
@keyframes fpc-progress-pulse-halo {
    0%, 100% { transform: scale(1);   opacity: 0.6; }
    50%      { transform: scale(1.8); opacity: 0;   }
}
@keyframes fpc-progress-shimmer {
    0%   { transform: translate(-130%); }
    100% { transform: translate(130%); }
}
@keyframes fpc-progress-reveal {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(var(--line-fill, 0)); }
}
@keyframes fpc-safetyPulseGlow {
    0%, 100% {
        box-shadow:
            0 0 0 3px rgba(255, 82, 82, 0.18),
            0 0 12px rgba(255, 82, 82, 0.28);
    }
    50% {
        box-shadow:
            0 0 0 4px rgba(255, 82, 82, 0.42),
            0 0 18px rgba(255, 82, 82, 0.55);
    }
}
@keyframes fpc-safetyReadyIn {
    0%   { opacity: 0.7; transform: translateY(4px); }
    100% { opacity: 1;   transform: translateY(0); }
}
@keyframes fpc-bncDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate3d(6%, -4%, 0) scale(1.08) rotate(0.4deg); }
    100% { transform: translate3d(-4%, 6%, 0) scale(1.04) rotate(-0.2deg); }
}
@keyframes fpc-bncSheen {
    0%   { transform: translateX(-45%); opacity: 0; }
    20%  { opacity: 0.7; }
    50%  { opacity: 1; }
    80%  { opacity: 0.7; }
    100% { transform: translateX(15%); opacity: 0; }
}


/* —— Mobile polish (Telegram Mini App) —— */
.fpc.modal-overlay {
  z-index: 100100 !important;
  overscroll-behavior: none;
  touch-action: none;
}
.fpc.modal-overlay .modal {
  touch-action: pan-y;
}
.fpc .form-input,
.fpc .form-textarea {
  font-size: 16px !important; /* stop iOS input zoom */
  border-radius: var(--radius-medium);
}
.fpc .choice-btn:active,
.fpc .currency-btn:active {
  transform: scale(0.98);
  border-color: var(--accent-blue);
  background: rgba(240, 185, 11, 0.10);
}
.fpc .safety-warning {
  max-height: min(92dvh, calc(var(--tg-viewport-height, 100dvh) - 12px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--safe-area-bottom) + 20px) !important;
}
.fpc .safety-warning-confirm {
  border-radius: var(--radius-medium) !important;
  min-height: 52px;
  margin-top: 8px;
}
@keyframes fpc-slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}


@keyframes fpc-modalCenterIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fpc-modalCenterOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.96) translateY(8px); }
}

/* Safety warning also centered like create-deal */
.fpc.safety-warning-overlay {
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}
.fpc .safety-warning,
.fpc.safety-warning-overlay > .modal-content.safety-warning {
  width: 100% !important;
  max-width: min(420px, calc(100vw - 32px)) !important;
  max-height: min(88dvh, calc(var(--tg-viewport-height, 100dvh) - 32px)) !important;
  border-radius: 24px !important;
  margin: 0 auto !important;
  transform: none !important;
  animation: fpc-modalCenterIn 0.22s cubic-bezier(0.32, 0.72, 0, 1) forwards !important;
}
