.ffem-app{max-width:980px;margin:24px auto;padding:0 14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#20252b}
.ffem-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-radius:16px;background:#20252b;color:#fff;margin-bottom:14px}
.ffem-brand{font-size:20px;font-weight:800}.ffem-sub{opacity:.75;font-size:13px;margin-top:2px}
.ffem-mode{padding:7px 10px;border-radius:999px;font-size:11px;font-weight:800}.ffem-mode.test{background:#f4b942;color:#111}.ffem-mode.prod{background:#6aa84f}
.ffem-warning{padding:14px 16px;border-radius:12px;background:#fff4cf;border:1px solid #e1c65c;margin-bottom:14px}
.ffem-card{background:#fff;border:1px solid #dfe3e7;border-radius:16px;padding:20px;margin:14px 0;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.ffem-card h2{font-size:18px;margin:0 0 16px}.ffem-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ffem-grid .full{grid-column:1/-1}
.ffem-card label{display:flex;flex-direction:column;gap:6px;font-weight:650;font-size:13px}
.ffem-card input[type=text],.ffem-card input[type=date],.ffem-card input[type=time],.ffem-card input[type=number],.ffem-card input[type=password],.ffem-card select,.ffem-card textarea,#ffem-title,#ffem-editor{width:100%;box-sizing:border-box;border:1px solid #cfd5db;border-radius:10px;padding:12px;font:inherit;background:#fff}
.ffem-card textarea{resize:vertical;min-height:140px}.ffem-card small,.ffem-hint{font-weight:400;color:#68717b}
.ffem-vehicle-groups{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:14px}
.ffem-vehicle-groups fieldset{border:1px solid #e0e4e8;border-radius:12px;padding:10px}.ffem-vehicle-groups legend{font-weight:800;font-size:13px;padding:0 4px}
.ffem-check{display:flex!important;flex-direction:row!important;align-items:center;gap:8px;padding:8px 4px;border-radius:8px;font-weight:600!important}
.ffem-check input{width:20px;height:20px}.ffem-check span{flex:1}
.ffem-orgs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 18px;margin-bottom:14px}
.ffem-actions{display:flex;gap:10px;flex-wrap:wrap;margin:14px 0}.ffem-btn{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;border-radius:10px;border:1px solid #c8ced4;background:#fff;color:#20252b;text-decoration:none;cursor:pointer;font-weight:750;font-size:14px}
.ffem-btn.primary{background:#20252b;color:#fff;border-color:#20252b}.ffem-btn:disabled{opacity:.55;cursor:wait}.ffem-btn.busy{opacity:.6}
#ffem-title{font-size:19px;font-weight:750;margin-bottom:10px}.ffem-editor-wrap textarea{min-height:360px}
.ffem-preview{border:1px solid #dfe3e7;border-radius:12px;padding:20px;margin-top:16px;background:#fff}.ffem-preview p{line-height:1.65}
.ffem-photo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:14px}.ffem-photo{position:relative;border:1px solid #dfe3e7;border-radius:12px;overflow:hidden;background:#f6f7f8}.ffem-photo img{display:block;width:100%;height:150px;object-fit:cover}.ffem-star{display:block;width:100%;border:0;background:#fff;padding:9px;font-weight:700;cursor:pointer}.ffem-star.selected{background:#20252b;color:#fff}.ffem-remove{position:absolute;right:6px;top:6px;width:30px;height:30px;border:0;border-radius:50%;background:#fff;font-size:20px;cursor:pointer}
.ffem-result{padding:18px;border-radius:14px;border:1px solid #bfc7ce;background:#f7f9fa;margin:18px 0}.ffem-result h3{margin-top:0}.ffem-url{width:100%;box-sizing:border-box;padding:11px;border:1px solid #cfd5db;border-radius:9px;margin:8px 0}
.ffem-login{text-align:center;max-width:520px;margin:60px auto;padding:30px;border:1px solid #ddd;border-radius:16px}.ffem-login .ffem-btn{margin-top:10px}
@media(max-width:720px){
 .ffem-app{margin:10px auto;padding:0 9px}.ffem-head{padding:15px}.ffem-grid{grid-template-columns:1fr}.ffem-grid .full{grid-column:auto}
 .ffem-vehicle-groups{grid-template-columns:1fr}.ffem-orgs{grid-template-columns:1fr}.ffem-card{padding:15px;border-radius:13px}
 .ffem-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ffem-photo img{height:120px}
 .ffem-actions{position:relative}.ffem-btn{flex:1 1 100%}.ffem-head .ffem-btn{flex:0}
}

/* Public gallery / lightbox */
.ffem-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:18px 0}
.ffem-gallery[data-count="1"]{grid-template-columns:minmax(0,520px)}
.ffem-gallery[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
.ffem-gallery-item{display:flex;align-items:center;justify-content:center;border:0;padding:0;background:#f1f2f3;border-radius:10px;overflow:hidden;cursor:pointer;min-width:0;aspect-ratio:4/3}
.ffem-gallery-item img{display:block;width:100%;height:100%;object-fit:contain;background:#f1f2f3;transition:transform .15s ease}
.ffem-gallery-item:hover img{transform:scale(1.02)}
.ffem-gallery-item:focus-visible{outline:3px solid #2d6cdf;outline-offset:2px}
.ffem-lightbox{position:fixed;inset:0;z-index:999999;background:rgba(0,0,0,.94);display:flex;align-items:center;justify-content:center;padding:48px 55px;box-sizing:border-box}
.ffem-lightbox[hidden]{display:none}
.ffem-public-lightbox-img{max-width:92vw;max-height:88vh;width:auto;height:auto;object-fit:contain;display:block}
.ffem-lightbox-close,.ffem-lightbox-prev,.ffem-lightbox-next{position:absolute;border:0;background:rgba(255,255,255,.15);color:#fff;width:46px;height:46px;border-radius:50%;font-size:30px;cursor:pointer}
.ffem-lightbox-close{right:18px;top:18px}.ffem-lightbox-prev{left:18px;top:50%;transform:translateY(-50%)}.ffem-lightbox-next{right:18px;top:50%;transform:translateY(-50%)}
.ffem-public-lightbox-counter{position:absolute;bottom:15px;left:0;right:0;text-align:center;color:#fff;font-size:14px}
body.ffem-no-scroll{overflow:hidden}
@media(max-width:720px){
 .ffem-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .ffem-gallery[data-count="1"],.ffem-gallery[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}
 .ffem-gallery-item{aspect-ratio:1/1}
 .ffem-lightbox{padding:38px 8px 42px}
 .ffem-public-lightbox-img{max-width:96vw;max-height:84vh}
 .ffem-lightbox-prev,.ffem-lightbox-next{width:40px;height:40px;font-size:26px;background:rgba(0,0,0,.25)}
 .ffem-lightbox-prev{left:6px}.ffem-lightbox-next{right:6px}
}
/* V1.0.10 layout refinements */
input[name="number"]{width:110px!important;min-width:110px!important}
.ffem-crew{display:block!important;margin:0 0 14px!important;max-width:420px}
.ffem-crew input{width:110px!important;min-width:110px!important}
.ffem-vehicle-groups{margin-top:4px}
.ffem-gallery-item{display:flex;align-items:center;justify-content:center;text-decoration:none}

/* V1.0.11 public gallery sizing and button reset */
.ffem-gallery{max-width:900px;margin:22px auto}
.ffem-gallery-item{width:100%;max-height:280px;appearance:none;-webkit-appearance:none;font:inherit}
.ffem-gallery-item img{max-height:280px}
@media(max-width:720px){.ffem-gallery{max-width:100%;margin:14px 0}.ffem-gallery-item{max-height:220px}.ffem-gallery-item img{max-height:220px}}

/* Real visual report preview */
.ffem-preview{background:#fff;border:1px solid #d7dadd;border-radius:14px;padding:28px;margin-top:16px;box-shadow:0 2px 8px rgba(0,0,0,.06)}
.ffem-preview-head{font-size:28px;font-weight:800;line-height:1.2;margin:0 0 18px;padding-bottom:18px;border-bottom:1px solid #cfd3d7;text-align:center}
.ffem-preview-content{font-size:16px;line-height:1.65;color:#30343a}
.ffem-preview-content p{margin:0 0 18px}.ffem-preview-content p:last-child{margin-bottom:0}
.ffem-preview-gallery{margin-top:24px}
.ffem-preview-gallery .ffem-gallery-item{max-height:260px}
.ffem-preview-gallery .ffem-gallery-item img{max-height:260px}
@media(max-width:720px){.ffem-preview{padding:16px}.ffem-preview-head{font-size:22px}.ffem-preview-content{font-size:15px}.ffem-preview-gallery .ffem-gallery-item,.ffem-preview-gallery .ffem-gallery-item img{max-height:210px}}

/* V1.0.12: inferred unit selection + cleaner gallery controls */
.ffem-org-check[title]{cursor:help}
.ffem-gallery-item{background:transparent!important}
.ffem-gallery-item img{background:transparent!important}
.ffem-lightbox-close,.ffem-lightbox-prev,.ffem-lightbox-next{display:flex!important;align-items:center;justify-content:center;padding:0;line-height:1!important;text-align:center}
.ffem-lightbox-prev,.ffem-lightbox-next{font-family:Arial,sans-serif;font-weight:400}


/* V1.0.13: visible progress feedback for mobile/slow operations */
.ffem-busy{position:fixed;inset:0;z-index:1000000;background:rgba(0,0,0,.62);display:flex;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}
.ffem-busy[hidden]{display:none}
.ffem-busy-box{width:min(430px,100%);box-sizing:border-box;background:#fff;border-radius:16px;padding:24px 22px;text-align:center;box-shadow:0 12px 40px rgba(0,0,0,.28)}
.ffem-busy-spinner{width:34px;height:34px;margin:0 auto 14px;border:4px solid #dfe3e7;border-top-color:#20252b;border-radius:50%;animation:ffem-spin .8s linear infinite}
.ffem-busy-title{font-size:18px;font-weight:800;color:#20252b}
.ffem-busy-text{margin-top:7px;color:#68717b;font-size:14px;line-height:1.45}
.ffem-progress{height:7px;margin-top:18px;background:#e7eaed;border-radius:999px;overflow:hidden}
.ffem-progress span{display:block;width:38%;height:100%;border-radius:999px;background:#20252b;animation:ffem-progress 1.15s ease-in-out infinite}
body.ffem-busy-active{overflow:hidden}
@keyframes ffem-spin{to{transform:rotate(360deg)}}
@keyframes ffem-progress{0%{transform:translateX(-120%)}100%{transform:translateX(340%)}}
@media(max-width:720px){.ffem-busy{padding:14px}.ffem-busy-box{padding:22px 18px;border-radius:14px}.ffem-busy-title{font-size:17px}.ffem-busy-text{font-size:13px}}

/* V1.0.14: Never show the lightbox close button while the lightbox is hidden. */
#ffem-lightbox[hidden]{display:none!important;visibility:hidden!important;pointer-events:none!important}

/* V1.0.15: Lightbox controls are hidden unless the lightbox is explicitly active.
   This prevents an isolated close button from being visible due to theme/plugin CSS. */
.ffem-lightbox .ffem-lightbox-close,
.ffem-lightbox .ffem-lightbox-prev,
.ffem-lightbox .ffem-lightbox-next,
.ffem-lightbox .ffem-public-lightbox-counter {display:none!important}
.ffem-lightbox.ffem-active .ffem-lightbox-close,
.ffem-lightbox.ffem-active .ffem-lightbox-prev,
.ffem-lightbox.ffem-active .ffem-lightbox-next,
.ffem-lightbox.ffem-active .ffem-public-lightbox-counter {display:flex!important}
.ffem-lightbox.ffem-active .ffem-public-lightbox-counter {display:block!important}
