.ffm-app { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

.ffm-empty { text-align: center; color: #777; padding: 40px 0; }

/* ---------- Tab Rejyon (Maketplas) ---------- */

.ffm-region-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.ffm-region-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 999px;
    border: 2px solid #ddd;
    background: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    color: #555 !important;
    white-space: nowrap;
}

.ffm-region-btn.active {
    border-color: #b0121f;
    background: #b0121f;
    color: #fff !important;
}

/* ---------- Rejyon select (fòm poste) ---------- */

.ffm-region-select-row { display: flex; gap: 8px; }

.ffm-region-select-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: #fff;
    font-weight: 700;
    cursor: pointer;
    color: #333 !important;
}

.ffm-region-select-btn.active {
    border-color: #b0121f;
    background: #fdecec;
    color: #b0121f !important;
}

/* ---------- Shell / Tabs ---------- */

.ffm-shell {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ffm-locked-top {
    background: #1a1a2e;
    color: #fff !important;
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
}
.ffm-locked-top strong { color: #ffd700 !important; }

.ffm-tabs-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 22px;
    position: relative;
    padding-bottom: 9px;
}

.ffm-tabs-scroll-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.75) !important;
    border: 1px solid rgba(255,255,255,0.12);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}
.ffm-tabs-scroll-btn svg { width: 13px; height: 13px; }
.ffm-tabs-scroll-btn:hover { background: rgba(176,18,31,0.7); border-color: transparent; }

/* ---------- Scrollbar horizontal premium des tabs ---------- */
.ffm-tabs-scrollbar {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 0;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    overflow: hidden;
    pointer-events: auto;
    cursor: ew-resize;
    touch-action: none;
}

.ffm-tabs-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    min-width: 34px;
    width: 30%;
    border-radius: 999px;
    background: #b0121f;
    box-shadow: 0 0 8px rgba(176,18,31,0.45);
    transition: left .12s ease, width .12s ease;
}

.ffm-tabs-scrollbar-arrow { display: none; }

/* Rejyon yo ka glise horizontalman sou mobile san yo pa kraze layout la. */
.ffm-region-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.ffm-region-tabs::-webkit-scrollbar { display: none; }
.ffm-region-btn { flex: 0 0 auto; }

.ffm-tabs {
    display: flex;
    gap: 6px;
    background: #14141f;
    border-radius: 12px;
    padding: 6px;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ffm-tabs::-webkit-scrollbar { display: none; }

.ffm-tab-btn {
    flex: 0 0 auto;
    padding: 12px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    color: rgba(255,255,255,0.55) !important;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
.ffm-tab-btn svg { flex-shrink: 0; }

.ffm-tab-btn:hover { color: rgba(255,255,255,0.85) !important; }

.ffm-tab-btn.active {
    background: #b0121f;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(176,18,31,0.4);
}

.ffm-market-header {
    display: flex;
    margin-bottom: 14px;
}

.ffm-market-badge {
    background: #b0121f;
    color: #fff !important;
    font-weight: 800;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(176,18,31,0.35);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ffm-tab-panel { animation: ffm-fade-in 0.2s ease; }

@keyframes ffm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ffm-expire-note {
    font-size: 12px;
    color: #b45309;
    background: #fff8e1;
    border: 1px solid #ffe08a;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0 14px;
}

/* ---------- Badj mesaj ki pa li ---------- */

.ffm-unread-badge {
    display: inline-block;
    background: #ffd700;
    color: #1a1a2e !important;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 3px;
}

/* ---------- Balans ---------- */

.ffm-balance-panel { display: flex; flex-direction: column; gap: 16px; max-width: 560px; margin: 0 auto; }

.ffm-balance-hero {
    background: linear-gradient(135deg, #7a0d18 0%, #b0121f 55%, #8a0e1c 100%);
    border-radius: 14px;
    padding: 22px 24px;
    color: #fff !important;
    box-shadow: 0 6px 18px rgba(176,18,31,0.3);
}

.ffm-balance-hero-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,0.85) !important; margin-bottom: 6px; }
.ffm-balance-hero-amount { font-size: 32px; font-weight: 800; color: #fff !important; }
.ffm-balance-hero-note { font-size: 12px; color: rgba(255,255,255,0.7) !important; margin-top: 4px; }

.ffm-balance-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.ffm-stat-card {
    border-radius: 12px;
    padding: 14px 16px;
    color: #fff !important;
}

.ffm-stat-amount { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.ffm-stat-label { font-size: 11px; display: flex; align-items: center; gap: 5px; opacity: 0.9; }

.ffm-stat-green  { background: #146c3a; }
.ffm-stat-orange { background: #a35a08; }
.ffm-stat-red    { background: #7a0d18; }
.ffm-stat-blue   { background: #14315e; }

.ffm-wallet-section {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ffm-wallet-section-dark {
    background: #14141f;
    border-color: #14141f;
}
.ffm-wallet-section-dark .ffm-field label { color: rgba(255,255,255,0.85) !important; display: flex; align-items: center; gap: 5px; }
.ffm-wallet-section-dark .ffm-field input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: #fff !important;
}
.ffm-wallet-section-dark .ffm-post-section-title { color: #fff !important; }

.ffm-withdraw-method-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8) !important;
    font-weight: 700;
    cursor: pointer;
}
.ffm-withdraw-method-btn.active { border-color: #b0121f; background: #b0121f; color: #fff !important; }

.ffm-quick-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.ffm-quick-amount-btn {
    padding: 10px 4px;
    border-radius: 8px;
    border: none;
    background: #b0121f;
    color: #fff !important;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    opacity: 0.85;
}

.ffm-quick-amount-btn.active,
.ffm-quick-amount-btn:hover { opacity: 1; }

/* ---------- Profil ---------- */

#ffm-tab-profile {
    position: relative;
}
#ffm-tab-profile::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    height: 220px;
    background: radial-gradient(ellipse at top, rgba(176,18,31,0.16) 0%, rgba(176,18,31,0) 70%);
    pointer-events: none;
    z-index: 0;
}

.ffm-profile-panel { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }

.ffm-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.ffm-profile-header img {
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.ffm-profile-name { font-weight: 800; font-size: 16px; color: #111; }
.ffm-profile-email { font-size: 12px; color: #888; }

/* ---------- Chat / Mesaj ---------- */

.ffm-chat-app {
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.ffm-conversation-list { padding: 4px; }

.ffm-conversation-item {
    position: relative;
    padding: 12px 40px 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}
.ffm-conversation-item:hover { background: #fafafa; }
.ffm-conversation-item.unread { background: #fff8e1; }

.ffm-conv-name { font-weight: 700; font-size: 13px; color: #111; }
.ffm-conv-listing { font-weight: 400; color: #888; font-size: 11px; }
.ffm-conv-last { font-size: 12px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ffm-conv-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    background: #b0121f;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
}

.ffm-thread-panel { display: flex; flex-direction: column; height: 480px; }

.ffm-thread-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #1a1a2e;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
}

.ffm-thread-back {
    background: none;
    border: none;
    color: #fff !important;
    cursor: pointer;
    font-size: 12px;
}

.ffm-thread-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9f9;
}

.ffm-msg-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eee;
    font-size: 13px;
    color: #111 !important;
    align-self: flex-start;
}

.ffm-msg-bubble.mine {
    background: #b0121f;
    color: #fff !important;
    border-color: #b0121f;
    align-self: flex-end;
}

.ffm-thread-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
}

.ffm-thread-input-row input {
    flex: 1;
    padding: 10px;
    border-radius: 999px;
    border: 2px solid #ddd;
    font-size: 13px;
}

.ffm-thread-input-row button {
    background: #b0121f;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 700;
    cursor: pointer;
}

.ffm-contact-btn {
    margin-top: 6px;
    width: 100%;
    background: #1a1a2e;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 9px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ---------- Grid & Kat ---------- */

#ffm-tab-market {
    background: linear-gradient(180deg, #fdf1f1 0%, #fdf6f6 100%);
    border-radius: 14px;
    padding: 16px;
}

.ffm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.ffm-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.ffm-card-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
    position: relative;
}

.ffm-available-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #16a34a;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    padding: 3px 9px;
    border-radius: 999px;
}

.ffm-photo-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff !important;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ffm-card-body { padding: 12px; display: flex; flex-direction: column; gap: 5px; }

.ffm-card-title { font-weight: 700; color: #111 !important; font-size: 14px; }
.ffm-card-meta { font-size: 12px; color: #666 !important; }
.ffm-card-stars { font-size: 12px; color: #f5b800 !important; }

.ffm-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.ffm-tag {
    background: #f5e5e6;
    color: #8a0e1c !important;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}
.ffm-stars-note { color: #999 !important; font-size: 11px; }
.ffm-card-desc { font-size: 12px; color: #888 !important; line-height: 1.4; }

.ffm-card-price { font-weight: 800; color: #b0121f !important; font-size: 18px; margin-top: 2px; }

.ffm-card-seller-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2px;
}

.ffm-card-seller { font-size: 12px; color: #666 !important; display: inline-flex; align-items: center; gap: 4px; }

.ffm-like-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
    color: #666 !important;
}

.ffm-like-btn .ffm-like-icon { color: #ccc; }
.ffm-like-btn.liked { border-color: #b0121f; color: #b0121f !important; }
.ffm-like-btn.liked .ffm-like-icon { color: #b0121f; }

.ffm-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 6px;
    margin-top: 6px;
}

.ffm-view-btn {
    background: #f0f0f0;
    color: #333 !important;
    border: none;
    border-radius: 8px;
    padding: 10px 6px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

.ffm-buy-btn {
    background: #b0121f;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 10px 6px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

.ffm-share-btn {
    background: #f0f0f0;
    color: #333 !important;
    border: none;
    border-radius: 8px;
    width: 36px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ffm-report-link {
    background: none;
    border: none;
    color: #999 !important;
    font-size: 11px;
    text-align: left;
    padding: 4px 0 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.ffm-report-link:hover { color: #b0121f !important; }

/* ---------- Modal "Gade Kont lan" ---------- */

.ffm-view-modal-content { max-width: 760px; width: 100%; text-align: left; }
.ffm-view-modal-content h3 { text-align: left; }

.ffm-gallery {
    position: relative;
    margin-bottom: 10px;
}

.ffm-gallery-main {
    width: 100%;
    height: 360px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
    touch-action: pan-y;
    user-select: none;
    cursor: zoom-in;
}

@media (max-width: 640px) {
    .ffm-gallery-main { height: 260px; }
}

.ffm-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(20,20,31,0.55);
    color: #fff;
    border: none;
    backdrop-filter: blur(2px);
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s ease;
}
.ffm-gallery-nav svg { width: 15px; height: 15px; }
.ffm-gallery-nav:hover { background: rgba(176,18,31,0.85); }

.ffm-gallery-prev { left: 10px; }
.ffm-gallery-next { right: 10px; }

.ffm-gallery-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 14px;
}

.ffm-gallery-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.65;
}

.ffm-gallery-thumb.active {
    border-color: #b0121f;
    opacity: 1;
}

.ffm-view-desc { font-size: 13px; color: #555; line-height: 1.5; white-space: pre-wrap; }


/* ---------- Modal (achte / siksè) ---------- */

.ffm-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.ffm-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 26px 22px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    max-height: 85vh;
    overflow-y: auto;
}

.ffm-modal-content h3 { color: #111; margin-top: 0; }

.ffm-primary-btn {
    width: 100%;
    background: #b0121f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.ffm-primary-btn:disabled { opacity: 0.6; }

.ffm-modal-close {
    width: 100%;
    margin-top: 8px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
}

.ffm-message { min-height: 18px; font-size: 13px; color: #b0121f; margin: 6px 0; }

.ffm-cred-note { font-size: 13px; color: #666; }

.ffm-cred-row {
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
    font-size: 13px;
    margin: 6px 0;
    flex-wrap: wrap;
}

.ffm-cred-row code {
    background: #f2f2f2;
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
    flex: 1;
}

.ffm-copy-btn {
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
}

.ffm-success-icon { width: 76px; height: 76px; margin: 0 auto 10px; }
.ffm-success-svg { width: 100%; height: 100%; }
.ffm-success-circle {
    stroke: #16a34a; stroke-width: 3; stroke-linecap: round;
    stroke-dasharray: 157; stroke-dashoffset: 157;
    animation: ffm-draw-circle 0.5s cubic-bezier(0.65,0,0.45,1) forwards;
}
.ffm-success-check {
    stroke: #16a34a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 34; stroke-dashoffset: 34;
    animation: ffm-draw-check 0.35s 0.45s cubic-bezier(0.65,0,0.45,1) forwards;
}
@keyframes ffm-draw-circle { to { stroke-dashoffset: 0; } }
@keyframes ffm-draw-check { to { stroke-dashoffset: 0; } }

/* ---------- Fòm Poste ---------- */

.ffm-post-app { max-width: 560px; margin: 0 auto; }

.ffm-title { color: #111; text-align: center; }

.ffm-post-hero {
    background: linear-gradient(135deg, #7a0d18 0%, #b0121f 55%, #8a0e1c 100%);
    color: #fff !important;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 17px;
    box-shadow: 0 4px 14px rgba(176,18,31,0.3);
}

.ffm-commission-note {
    background: #fff8e1;
    border: 1px solid #ffe08a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #7a5b00;
    margin-bottom: 18px;
}

.ffm-post-section {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ffm-post-section-dark {
    background: #14141f;
    border-color: #14141f;
}
.ffm-post-section-dark .ffm-field label { color: rgba(255,255,255,0.85) !important; }
.ffm-post-section-dark .ffm-field input {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.15);
    color: #fff !important;
}

.ffm-post-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px;
    color: #111;
    font-size: 14px;
    font-weight: 800;
}
.ffm-post-section-dark .ffm-post-section-title { color: #fff !important; }

.ffm-post-section-note { font-size: 12px; color: #999 !important; margin: 0 0 14px; }
.ffm-post-section-dark .ffm-post-section-note { color: rgba(255,255,255,0.55) !important; }

.ffm-private-tag {
    background: #b0121f;
    color: #fff !important;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: auto;
}

.ffm-required-tag {
    background: #fdeaec;
    color: #b0121f !important;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}

.ffm-section-title { margin-top: 18px; color: #111; font-size: 15px; }

.ffm-field { margin-bottom: 14px; text-align: left; }
.ffm-field label { display: block; font-weight: 600; font-size: 13px; color: #111 !important; margin-bottom: 5px; }

.ffm-field input[type="text"],
.ffm-field input[type="number"],
.ffm-field select,
.ffm-field textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    color: #111;
}

.ffm-credential-input.ffm-credential-red { color: #b0121f !important; font-weight: 700; }
.ffm-credential-input.ffm-credential-blue { color: #1456b8 !important; font-weight: 700; }
.ffm-credential-input::placeholder { color: #9aa0a6 !important; font-weight: 400; }

.ffm-id-verify-row { display: flex; gap: 8px; }
.ffm-id-verify-row input { flex: 1; }

.ffm-verify-btn {
    flex-shrink: 0;
    background: #1a1a2e;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.ffm-verify-btn.verified { background: #146c3a; }

.ffm-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ffm-image-preview { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

.ffm-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
    border: 2px solid transparent;
}

.ffm-thumb-loading { animation: ffm-pulse 1s infinite; }
.ffm-thumb-error { background-color: #fdecec; color: #c81e1e; }

.ffm-thumb-star {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}
.ffm-thumb-star:hover { background: rgba(0,0,0,.7); }
.ffm-thumb-primary { border-color: #f5b301; box-shadow: 0 0 0 2px rgba(245,179,1,.35); }
.ffm-thumb-primary .ffm-thumb-star { background: #f5b301; color: #1a1a2e; }
.ffm-thumb-primary::after {
    content: "Prensipal";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(245,179,1,.92);
    color: #1a1a2e;
    font-size: 8.5px;
    font-weight: 800;
    text-align: center;
    padding: 2px 0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}

@keyframes ffm-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---------- Anons Mwen / Acha Mwen ---------- */

.ffm-my-listings, .ffm-my-purchases { max-width: 800px; margin: 0 auto; }

.ffm-locked-box {
    background: #1a1a2e;
    color: #fff;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    font-size: 14px;
}
.ffm-locked-box strong { color: #ffd700 !important; }

.ffm-history-scroll {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ffm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ffm-table th, .ffm-table td { border: 1px solid #eee; padding: 8px; text-align: left; color: #333; }
.ffm-table th { background: #1a1a2e; color: #fff !important; position: sticky; top: 0; }
.ffm-table tbody tr:nth-child(even) { background: #fafafa; }

.ffm-purchase-card {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.ffm-purchase-title { font-weight: 700; color: #111; margin-bottom: 8px; }
.ffm-purchase-date { font-size: 11px; color: #999; margin-top: 6px; }

/* ---------- Mobil: fòse 2 kolòn pou kat yo ---------- */

@media (max-width: 640px) {
    .ffm-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ffm-card-img { height: 110px; }
    .ffm-card-body { padding: 8px; gap: 4px; }
    .ffm-card-title { font-size: 12px; }
    .ffm-card-meta, .ffm-card-desc { font-size: 10px; }
    .ffm-card-price { font-size: 14px; }
    .ffm-card-seller { font-size: 10px; }
    .ffm-like-btn { font-size: 10px; padding: 2px 7px; }

    .ffm-card-actions {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "view buy" "share share";
    }
    .ffm-view-btn { grid-area: view; font-size: 10px; padding: 8px 4px; }
    .ffm-buy-btn { grid-area: buy; font-size: 10px; padding: 8px 4px; }
    .ffm-share-btn { grid-area: share; width: 100%; }

    .ffm-contact-btn, .ffm-report-link { font-size: 10px; }

    .ffm-tabs-scroll-btn { display: none; }
    .ffm-view-modal-content { max-width: calc(100vw - 20px); width: 100%; }
}

/* ---------- Lightbox (foto plen ekran) ---------- */

.ffm-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ffm-lightbox-img {
    width: 100%;
    height: 100%;
    max-width: 900px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.ffm-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}

.ffm-lightbox .ffm-gallery-nav { top: 50%; }
.ffm-lightbox .ffm-gallery-prev { left: 16px; }
.ffm-lightbox .ffm-gallery-next { right: 16px; }

/* ---------- Gallery arrows + tab progress control ---------- */
.ffm-gallery-nav {
    width: 40px;
    height: 40px;
    background: rgba(20,20,31,0.72);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.ffm-gallery-nav:hover { background: #b0121f; transform: translateY(-50%) scale(1.04); }
.ffm-gallery-nav svg { width: 18px; height: 18px; }
.ffm-tabs-scrollbar-thumb { cursor: grab; }
.ffm-tabs-scrollbar-thumb:active { cursor: grabbing; }

/* ---------- Tab menu (Maket/Vann/Mesaj/Balans/Profil) - vèsyon mobil, konsolide ---------- */
@media (max-width: 767px) {
    .ffm-tabs-wrap {
        position: relative;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding-bottom: 12px;
    }

    .ffm-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        width: max-content !important;
        min-width: 100% !important;
        gap: 6px !important;
        padding: 5px 6px !important;
        overflow: hidden !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    .ffm-tabs::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    .ffm-tab-btn {
        flex: 0 0 auto !important;
        width: 82px !important;
        min-width: 82px !important;
        max-width: 82px !important;
        min-height: 38px !important;
        padding: 8px 7px !important;
        font-size: 12px !important;
        line-height: 1.1 !important;
        justify-content: center !important;
        text-align: center !important;
        white-space: nowrap !important;
        box-sizing: border-box !important;
    }

    .ffm-tabs-scroll-btn {
        display: none !important;
    }

    /* Ba wouj la (#ffm-tabs-scrollbar) se sèl kontwòl scroll ki vizib sou mobil. */
    .ffm-tabs-scrollbar {
        left: 0;
        right: 0;
        height: 6px;
    }
}

/* View-account gallery arrows */
.ffm-gallery {
    position: relative;
}
.ffm-gallery-nav {
    position: absolute;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(20,20,28,.88);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.ffm-gallery-nav:hover {
    background: #c9152b;
}
.ffm-gallery-prev { left: 10px; }
.ffm-gallery-next { right: 10px; }


/* ==========================================================
   FIX - Idantifyan Kont lan: tèks klè sou input blan
   ========================================================== */
.ffm-post-section-dark .ffm-field input[type="text"],
.ffm-post-section-dark .ffm-field input[type="password"],
.ffm-post-section-dark .ffm-field input[type="number"],
.ffm-post-section-dark .ffm-field textarea,
.ffm-post-section-dark .ffm-field select {
    background: #ffffff !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    border: 1px solid #d9d9df !important;
}

.ffm-post-section-dark .ffm-field label {
    color: #ffffff !important;
}

.ffm-post-section-dark .ffm-field input::placeholder,
.ffm-post-section-dark .ffm-field textarea::placeholder {
    color: #8a8f98 !important;
    -webkit-text-fill-color: #8a8f98 !important;
    opacity: 1 !important;
}

/* Kenbe koulè espesyal pou enfòmasyon kont yo */
.ffm-post-section-dark .ffm-field input.ffm-credential-input.ffm-credential-red {
    color: #b0121f !important;
    -webkit-text-fill-color: #b0121f !important;
    font-weight: 700 !important;
}

.ffm-post-section-dark .ffm-field input.ffm-credential-input.ffm-credential-blue {
    color: #1456b8 !important;
    -webkit-text-fill-color: #1456b8 !important;
    font-weight: 700 !important;
}

.ffm-post-section-dark .ffm-field input:focus,
.ffm-post-section-dark .ffm-field textarea:focus,
.ffm-post-section-dark .ffm-field select:focus {
    outline: none !important;
    border-color: #b0121f !important;
    box-shadow: 0 0 0 3px rgba(176,18,31,0.10) !important;
}

/* ---------- View counter ---------- */
.ffm-card-seller-row { align-items: center; }
.ffm-view-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    color: #777;
    font-size: 12px;
    font-weight: 600;
}
.ffm-view-count svg { width: 14px; height: 14px; }
