/* ==========================================================================
   FiveMRides AI Ped Creator ([fivem_ai_ped_creator]) - scoped to .fap
   Shared Studio components (top bar, buttons, cards, segmented fields, viewport frame, toasts)
   come from fmr-studio-ui.css (.fsu-*), loaded first: same look as the Livery, Tattoo and Map Studios.
   This sheet keeps the layout only: left = pictures + settings, centre = 3D preview,
   right = My peds + how to test in game.
   ========================================================================== */

html.fap-lock, html.fap-lock body { overflow: hidden !important; }
/* the app is a full screen layer: the theme chrome (sticky header, promo bar, admin bar, mini cart) must not sit on top of it */
html.fap-lock .site-header, html.fap-lock #masthead, html.fap-lock .neon-promo-bar, html.fap-lock #wpadminbar, html.fap-lock .fro-mini-cart { display: none !important; }
html.fap-lock { margin-top: 0 !important; }
html.fap-lock body.has-promo-bar { padding-top: 0 !important; }

.fap {
    position: fixed; inset: 0; z-index: 2147483000; height: 100vh; height: 100dvh;
    color: var(--fsu-text); font: 500 13px/1.45 var(--fsu-font);
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(168, 85, 247, .10), transparent 60%),
        radial-gradient(900px 500px at 100% 120%, rgba(0, 240, 255, .06), transparent 60%),
        var(--fsu-bg);
    isolation: isolate; -webkit-font-smoothing: antialiased; text-align: left;
}
.fap *, .fap *::before, .fap *::after { box-sizing: border-box; }
.fap [hidden] { display: none !important; }
:where(.fap) button, :where(.fap) input, :where(.fap) select, :where(.fap) textarea { font: inherit; color: inherit; }
.fap button { text-transform: none; letter-spacing: normal; text-shadow: none; min-height: 0; min-width: 0; margin: 0; line-height: 1.2; }
.fap button:focus { outline: none; }
.fap button:focus-visible, .fap [role=button]:focus-visible, .fap .fap-slot:focus-visible { outline: 2px solid rgba(0, 240, 255, .7); outline-offset: 2px; }
.fap a, .fap a:hover, .fap a.fap-home, .fap a.fap-credits { color: var(--fsu-cyan); text-decoration: none !important; }
.fap a.fsu-btn { color: var(--fsu-text); }
.fap a.fsu-btn-primary { color: #fff; }
.fap h1, .fap h2, .fap h3, .fap h4 { margin: 0; color: var(--fsu-text); letter-spacing: 0; text-transform: none; }
.fap p { margin: 0; }
.fap code { font: 600 11px/1.4 var(--fsu-mono); color: #bff6ff; background: rgba(0, 240, 255, .06); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.fap-admin-flag { position: fixed; z-index: 2147483100; left: 50%; top: 14px; transform: translateX(-50%); margin: 0; padding: 4px 12px; max-width: 30vw; line-height: 1.25; border: 1px dashed #ff2f9e; border-radius: 8px; background: rgba(8, 10, 17, .9); color: #ffd0e8; font-size: 12px; }
/* moved into the top bar by ai-ped.js (before "All Studio tools"), so it never covers the step bar */
.fap-top .fap-admin-flag { position: static; transform: none; max-width: none; flex: none; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; cursor: help; }
@media (max-width: 1500px) { .fap-top .fap-admin-more { display: none; } }

.fap-app { height: 100%; display: flex; flex-direction: column; }
.fap-top { gap: 10px; }
.fap-top .fsu-steps { margin-left: 14px; }
.fap-credits { text-decoration: none; }
.fap-home { color: var(--fsu-muted) !important; font-size: 12px; text-decoration: none; }
.fap-home:hover { color: var(--fsu-text) !important; }

.fap-body {
    flex: 1; min-height: 0; display: grid; gap: 10px; padding: 10px;
    grid-template-columns: clamp(290px, 23vw, 350px) minmax(0, 1fr) clamp(280px, 22vw, 350px);
}
.fap-left, .fap-right { min-height: 0; }
.fap-stage { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

/* fields */
.fap-field { display: grid; gap: 5px; min-width: 0; }
.fap-field > span { color: var(--fsu-muted); font-size: 11.5px; font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.fap-field > span b { color: var(--fsu-text); font: 700 11.5px var(--fsu-mono); }
.fap input[type=text], .fap textarea {
    width: 100%; padding: 0 10px; border-radius: 9px; border: 1px solid var(--fsu-line2); background: var(--fsu-bg2);
    color: var(--fsu-text); outline: none; font-size: 12.5px; box-shadow: none; margin: 0;
}
.fap input[type=text] { height: 34px; font-family: var(--fsu-mono); }
.fap textarea { padding: 8px 10px; min-height: 84px; resize: vertical; line-height: 1.45; }
.fap input[type=text]:focus, .fap textarea:focus { border-color: rgba(0, 240, 255, .55); box-shadow: 0 0 0 3px rgba(0, 240, 255, .1); }
.fap input.is-bad { border-color: rgba(248, 113, 113, .7); }
.fap input[type=range] { width: 100%; accent-color: #ff2f9e; height: 22px; margin: 0; background: transparent; }
.fap-msg { font-size: 11.5px; line-height: 1.4; color: var(--fsu-dim); }
.fap-msg.is-bad { color: #ff9aa8; }
.fap-msg.is-ok { color: #7ee8b0; }
.fap .fsu-seg { width: 100%; }
.fap .fsu-seg button { flex: 1; justify-content: center; }

/* pictures */
.fap-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fap-slot {
    position: relative; aspect-ratio: 5 / 6; border-radius: 12px; border: 1.5px dashed var(--fsu-line2); background: var(--fsu-bg2);
    display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s, transform .15s;
    padding: 6px;
}
.fap-slot:hover { border-color: rgba(0, 240, 255, .5); background: rgba(0, 240, 255, .04); }
.fap-slot.is-over { border-color: var(--fsu-cyan); background: rgba(0, 240, 255, .09); transform: scale(1.02); }
.fap-slot.is-bad { border-color: rgba(248, 113, 113, .8); }
.fap-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #05070c; }
.fap-slot .fap-slot-ph { display: grid; gap: 4px; justify-items: center; color: var(--fsu-muted); font-size: 11.5px; pointer-events: none; }
.fap-slot .fap-slot-ph .fsu-i { width: 24px; height: 24px; color: var(--fsu-dim); }
.fap-slot .fap-slot-ph b { color: var(--fsu-text); font: 700 12.5px var(--fsu-display); letter-spacing: .04em; }
.fap-slot .fap-slot-ph em { font-style: normal; color: var(--fsu-pink); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.fap-slot .fap-slot-tag { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 99px; background: rgba(8, 10, 17, .82); border: 1px solid var(--fsu-line2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #cfd7e3; pointer-events: none; }
.fap-slot .fap-slot-x { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--fsu-line2); background: rgba(8, 10, 17, .85); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.fap-slot .fap-slot-x:hover { background: rgba(248, 113, 113, .35); }
.fap-slot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fap-tips { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; color: var(--fsu-muted); font-size: 11.5px; }
.fap-tips li { display: flex; gap: 7px; align-items: flex-start; }
.fap-tips li::before { content: ""; flex: none; width: 5px; height: 5px; margin-top: 6px; border-radius: 50%; background: var(--fsu-cyan); opacity: .8; }
.fap-tips li.is-no::before { background: var(--fsu-pink); }

/* describe */
.fap-ex { display: flex; flex-wrap: wrap; gap: 5px; }
.fap-ex .fsu-chip { height: 24px; font-size: 11px; }
.fap-refs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fap-refs figure { margin: 0; position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; border: 1px solid var(--fsu-line2); background: #fff; }
.fap-refs img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fap-refs figcaption { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 99px; background: rgba(8, 10, 17, .82); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #cfd7e3; }

.fap-check { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--fsu-muted); line-height: 1.4; }

/* build: always in reach at the bottom of the left column */
.fap-left #fap-buildbox { position: sticky; bottom: 0; z-index: 3; background: var(--fsu-panel); box-shadow: 0 -14px 24px rgba(6, 8, 14, .85), 0 4px 22px rgba(0, 0, 0, .25); }

.fap-build { height: 46px; font-size: 14.5px; font-weight: 800; letter-spacing: .01em; }
.fap-build-note { text-align: center; }
.fap-reedit { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(0, 240, 255, .35); background: rgba(0, 240, 255, .06); font-size: 12px; }
.fap-reedit b { color: #bff6ff; }

/* centre: viewport */
.fap-view { flex: 1; min-height: 0; position: relative; display: grid; }
.fap-view.fsu-viewport { display: grid; }
.fap-split { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr; }
.fap-split.is-split { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); }
.fap-pic { display: none; position: relative; background: #05070c; border-right: 1px solid var(--fsu-line2); min-width: 0; }
.fap-split.is-split .fap-pic, .fap-split.is-pic .fap-pic { display: grid; place-items: center; }
.fap-split.is-pic { grid-template-columns: 1fr; }
.fap-split.is-pic .fap-3d { display: none; }
.fap-pic img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.fap-pic .fap-pic-tag, .fap-3d .fap-pic-tag { position: absolute; left: 12px; top: 12px; z-index: 2; }
.fap-3d { position: relative; min-width: 0; min-height: 0; }
.fap-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; outline: none; touch-action: none; }
.fap-pill { padding: 5px 11px; border-radius: 999px; background: rgba(8, 10, 17, .72); border: 1px solid var(--fsu-line2); backdrop-filter: blur(10px); font-size: 11.5px; font-weight: 600; color: #cfd7e3; white-space: nowrap; }
.fap-pill b { color: var(--fsu-cyan); font-family: var(--fsu-mono); }
.fap-pill.is-mock { color: #ffd37a; border-color: rgba(255, 190, 70, .55); background: rgba(60, 40, 0, .6); }
.fap-pill.is-warn { color: #ffd37a; border-color: rgba(255, 190, 70, .45); }
.fap-topbar { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 3; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; pointer-events: none; }
.fap-topbar > * { pointer-events: auto; }
.fap-topbar .fap-left-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.fap-motions { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; display: flex; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(8, 10, 17, .74); border: 1px solid var(--fsu-line2); backdrop-filter: blur(12px); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); max-width: calc(100% - 24px); overflow-x: auto; }
.fap-motion { display: grid; justify-items: center; gap: 3px; width: 62px; padding: 7px 0 6px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--fsu-muted); cursor: pointer; transition: all .15s; flex: none; }
.fap-motion svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fap-motion span { font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.fap-motion:hover:not(:disabled) { color: var(--fsu-text); background: rgba(255, 255, 255, .06); }
.fap-motion.is-on { color: #fff; background: linear-gradient(135deg, rgba(255, 47, 158, .32), rgba(168, 85, 247, .32)); border-color: rgba(255, 47, 158, .55); box-shadow: 0 0 16px rgba(255, 47, 158, .22); }
.fap-motion:disabled { opacity: .35; cursor: not-allowed; }
.fap-motion-tools { display: flex; align-items: center; gap: 4px; padding-left: 6px; border-left: 1px solid var(--fsu-line2); }
.fap-note3d { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 3; }

.fap-empty { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; padding: 24px; pointer-events: none; }
.fap-empty h2 { font: 700 clamp(22px, 2.4vw, 34px)/1.1 var(--fsu-display); }
.fap-empty p { color: var(--fsu-muted); max-width: 440px; }
.fap-empty .fap-silh { width: 96px; height: 96px; opacity: .5; color: var(--fsu-purple); }

/* progress */
.fap-progress { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(6, 8, 14, .78); backdrop-filter: blur(6px); padding: 20px; }
.fap-progress-card { width: min(540px, 100%); display: grid; gap: 14px; padding: 22px; border-radius: 18px; border: 1px solid var(--fsu-line2); background: rgba(14, 18, 27, .92); box-shadow: 0 20px 80px rgba(0, 0, 0, .6); }
.fap-progress-card h2 { font: 700 20px/1.2 var(--fsu-display); }
.fap-bar { height: 8px; border-radius: 99px; background: var(--fsu-panel3); overflow: hidden; }
.fap-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--fsu-grad); transition: width .6s var(--fsu-ease); }
.fap-stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.fap-stages li { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fsu-dim); }
.fap-stages li i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--fsu-line2); flex: none; display: grid; place-items: center; font-style: normal; }
.fap-stages li.is-done { color: var(--fsu-muted); }
.fap-stages li.is-done i { background: rgba(0, 240, 255, .18); border-color: transparent; color: var(--fsu-cyan); font-size: 9px; }
.fap-stages li.is-done i::before { content: "\2713"; }
.fap-stages li.is-on { color: #fff; font-weight: 700; }
.fap-stages li.is-on i { border-color: var(--fsu-pink); border-top-color: transparent; animation: fsu-spin .8s linear infinite; }
.fap-progress-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--fsu-muted); font-size: 12px; }

/* right column */
.fap-peds { display: grid; gap: 6px; max-height: 360px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a3448 transparent; }
.fap-fam { border: 1px solid var(--fsu-line); border-radius: 12px; background: rgba(255, 255, 255, .02); overflow: hidden; }
.fap-ver { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 9px; padding: 7px 9px; cursor: pointer; border-top: 1px solid var(--fsu-line); }
.fap-ver:first-child { border-top: 0; }
.fap-ver:hover { background: rgba(255, 255, 255, .04); }
.fap-ver.is-on { background: linear-gradient(120deg, rgba(255, 47, 158, .14), rgba(168, 85, 247, .14)); box-shadow: inset 2px 0 0 var(--fsu-pink); }
.fap-ver img, .fap-ver .fap-th { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: #05070c; border: 1px solid var(--fsu-line2); }
.fap-ver .fap-th { display: grid; place-items: center; color: var(--fsu-dim); font-size: 10px; }
.fap-ver b { display: block; font: 700 12.5px var(--fsu-mono); color: var(--fsu-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fap-ver small { color: var(--fsu-dim); font-size: 10.5px; }
.fap-badge { padding: 2px 7px; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--fsu-line2); color: var(--fsu-muted); }
.fap-badge.is-done { color: #7ee8b0; border-color: rgba(126, 232, 176, .4); }
.fap-badge.is-run { color: var(--fsu-cyan); border-color: rgba(0, 240, 255, .4); }
.fap-badge.is-fail { color: #ff9aa8; border-color: rgba(255, 154, 168, .4); }
.fap-badge.is-unpaid { color: #ffd37a; border-color: rgba(255, 190, 70, .45); }
.fap-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.fap-actions .fsu-btn { justify-content: center; }
.fap-actions .fap-wide { grid-column: 1 / -1; }
.fap-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11.5px; color: var(--fsu-muted); }
.fap-facts dt { color: var(--fsu-dim); }
.fap-facts dd { margin: 0; color: var(--fsu-text); font-family: var(--fsu-mono); font-size: 11px; }
.fap-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; counter-reset: s; }
.fap-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 12px; color: var(--fsu-muted); counter-increment: s; }
.fap-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; background: var(--fsu-grad); }
.fap-steps b { color: var(--fsu-text); }
.fap-code { position: relative; margin-top: 5px; padding: 9px 38px 9px 10px; border-radius: 9px; background: #05070c; border: 1px solid var(--fsu-line2); font: 600 11px/1.5 var(--fsu-mono); color: #bff6ff; white-space: pre-wrap; word-break: break-all; }
.fap-code button { position: absolute; right: 5px; top: 5px; }
.fap-warn { padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 190, 70, .4); background: rgba(60, 40, 0, .35); color: #ffd9a0; font-size: 11.5px; }
.fap-err { padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(248, 113, 113, .45); background: rgba(80, 10, 20, .35); color: #ffb3bd; font-size: 12px; }

/* modal */
.fap-modal { position: fixed; inset: 0; z-index: 2147483300; display: grid; place-items: center; background: rgba(4, 6, 12, .72); backdrop-filter: blur(6px); padding: 16px; }
.fap-modal-card { width: min(440px, 100%); display: grid; gap: 14px; padding: 22px; border-radius: 18px; border: 1px solid var(--fsu-line2); background: var(--fsu-panel); box-shadow: 0 20px 80px rgba(0, 0, 0, .7); }
.fap-modal-card h3 { font: 700 18px var(--fsu-display); }
.fap-modal-card .fap-row { display: flex; justify-content: flex-end; gap: 8px; }
.fap-price { font: 800 28px/1 var(--fsu-display); color: #fff; }
.fap-price small { font: 600 12px var(--fsu-font); color: var(--fsu-muted); margin-left: 6px; }

@media (max-width: 1100px) {
    .fap { position: static; height: auto; min-height: 100vh; }
    html.fap-lock, html.fap-lock body { overflow: auto !important; }
    .fap-app { height: auto; }
    .fap-body { grid-template-columns: 1fr; padding: 10px 16px 24px; }
    .fap-stage { order: -1; }
    .fap-view { min-height: 62vh; }
    .fap-peds { max-height: none; }
    .fap-top .fsu-steps { display: none; }
    .fap-admin-flag { position: static; transform: none; max-width: none; margin: 8px 16px; }
    .fap-top .fap-admin-flag { margin: 0; }
}
@media (max-width: 560px) {
    .fap-top { gap: 8px; padding: 0 10px; }
    .fap-top .fap-admin-flag { padding: 3px 7px; font-size: 10.5px; }
    .fap-motion { width: 54px; }
    .fap-stages { grid-template-columns: 1fr; }
}
