:root{
  --market-green:#16a34a;
  --market-green2:#22c55e;
  --market-dark:#0f172a;
  --market-muted:#526174;
  --market-line:#dfe9e2;
  --market-soft:#f0fdf4;
  --market-warn:#fff7ed;
  --market-danger:#fef2f2;
}
*{box-sizing:border-box}
body.market-page{margin:0;background:linear-gradient(180deg,#f4faf6,#fff);color:var(--market-dark);font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;padding-bottom:86px}
.market-wrap{width:min(1120px,calc(100% - 28px));margin:0 auto;padding:18px 0 42px}
.market-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px;flex-wrap:wrap}
.market-brand{font-weight:950;color:#15803d;text-decoration:none;font-size:18px}
.market-back{font-weight:800;text-decoration:none;color:#334155}
.market-hero{padding:24px;border:1px solid rgba(34,197,94,.22);border-radius:26px;background:linear-gradient(135deg,#ecfdf3,#fff);box-shadow:0 18px 42px rgba(15,23,42,.07);margin-bottom:18px}
.market-hero h1{margin:0 0 8px;font-size:clamp(28px,5vw,44px);line-height:1.08}
.market-hero p{margin:0;color:var(--market-muted);font-size:17px;line-height:1.55}
.market-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.market-btn{appearance:none;border:0;border-radius:14px;padding:12px 16px;font-size:15px;font-weight:900;text-decoration:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:linear-gradient(135deg,var(--market-green),var(--market-green2));color:#fff;box-shadow:0 10px 22px rgba(34,197,94,.2)}
.market-btn.secondary{background:#fff;color:#166534;border:1px solid rgba(34,197,94,.25);box-shadow:none}
.market-btn.warn{background:#f97316}
.market-btn.danger{background:#dc2626}
.market-btn.dark{background:#334155}
.market-btn:disabled{opacity:.55;cursor:not-allowed}
.market-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.market-card{background:#fff;border:1px solid var(--market-line);border-radius:22px;padding:16px;box-shadow:0 12px 30px rgba(15,23,42,.055)}
.market-card h2,.market-card h3{margin:0 0 10px}.market-card p{color:var(--market-muted);line-height:1.5}
.market-form{display:grid;gap:14px}
.market-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.market-field label{display:block;font-weight:850;font-size:13px;margin:0 0 6px;color:#334155}
.market-field input,.market-field select,.market-field textarea{width:100%;border:1px solid #d7e2da;border-radius:13px;background:#fff;padding:12px 13px;font:inherit;outline:none}
.market-field textarea{min-height:120px;resize:vertical}
.market-field input:focus,.market-field select:focus,.market-field textarea:focus{border-color:rgba(34,197,94,.7);box-shadow:0 0 0 4px rgba(34,197,94,.12)}
.market-note{padding:12px 14px;border-radius:14px;background:#f8fafc;border:1px solid #e2e8f0;color:#475569;line-height:1.5;font-size:14px}
.market-note.ok{background:var(--market-soft);border-color:#bbf7d0;color:#166534}
.market-note.warn{background:var(--market-warn);border-color:#fed7aa;color:#9a3412}
.market-note.bad{background:var(--market-danger);border-color:#fecaca;color:#991b1b}
.market-hidden{display:none!important}
.market-toolbar{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:14px 0}
.market-toolbar input,.market-toolbar select{min-height:44px;border:1px solid #dbe5de;border-radius:13px;padding:10px 12px;background:#fff;font:inherit}
.market-product{display:flex;flex-direction:column;height:100%}
.market-product img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:16px;background:#eef5f0;margin-bottom:12px}
.market-product h3{font-size:20px;margin:0 0 6px}.market-product .desc{font-size:14px;color:#526174;line-height:1.5;white-space:pre-wrap;flex:1}
.market-price{font-weight:950;font-size:19px;color:#166534;margin:12px 0 6px}
.market-meta{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0}.market-pill{display:inline-flex;padding:6px 9px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:12px;font-weight:850}
.market-status{display:inline-flex;width:max-content;padding:7px 10px;border-radius:999px;font-size:12px;font-weight:900}.market-status.pending{background:#fff7ed;color:#9a3412}.market-status.live{background:#ecfdf3;color:#166534}.market-status.seller{background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe}.market-status.rejected{background:#fef2f2;color:#991b1b}.market-status.disabled{background:#f1f5f9;color:#475569}
.market-empty{text-align:center;padding:30px;border:1px dashed #b9d8c2;border-radius:20px;background:#fbfffc;color:#52705b}
.market-images-preview{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.market-images-preview img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:12px;border:1px solid #dce8df}.market-preview-item{position:relative;min-width:0}.market-preview-remove{position:absolute;top:6px;right:6px;width:32px;height:32px;border:0;border-radius:999px;background:rgba(15,23,42,.82);color:#fff;font-size:24px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 12px rgba(15,23,42,.28)}.market-preview-remove:hover{background:#dc2626}.market-preview-remove:focus-visible{outline:3px solid rgba(34,197,94,.4);outline-offset:2px}
.market-admin-row{display:grid;grid-template-columns:140px 1fr;gap:14px}.market-admin-row img{width:140px;height:120px;object-fit:cover;border-radius:14px;background:#eef4f0}
.market-small{font-size:13px;color:#64748b}.market-seller{font-size:13px;font-weight:900;color:#1e3a8a;margin:0 0 4px}.market-sep{height:1px;background:#e6eee8;margin:14px 0}
@media(max-width:860px){.market-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.market-admin-row{grid-template-columns:1fr}.market-admin-row img{width:100%;height:220px}}
@media(max-width:640px){.market-wrap{width:min(100% - 18px,1120px);padding-top:10px}.market-hero{padding:18px;border-radius:20px}.market-grid,.market-two{grid-template-columns:1fr}.market-actions .market-btn{width:100%}.market-images-preview{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V113: display all uploaded product photos */
.market-gallery{display:grid;gap:8px;margin-bottom:12px}
.market-gallery-main{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:16px;background:#eef5f0;cursor:zoom-in;margin:0!important}
.market-gallery-thumbs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.market-gallery-thumb{width:100%!important;aspect-ratio:1/1!important;object-fit:cover;border-radius:10px!important;margin:0!important;border:2px solid transparent;cursor:pointer;background:#eef5f0}
.market-gallery-thumb.active{border-color:#22c55e;box-shadow:0 0 0 2px rgba(34,197,94,.16)}
.market-admin-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;align-content:start}
.market-admin-gallery img{width:100%!important;height:auto!important;aspect-ratio:1/1;object-fit:cover;border-radius:12px;background:#eef4f0;cursor:zoom-in}
.market-admin-gallery img:first-child:nth-last-child(3){grid-row:span 2;aspect-ratio:auto;height:100%!important;min-height:160px}
.market-seller-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:12px}
.market-seller-gallery img{width:100%!important;aspect-ratio:1/1!important;object-fit:cover;border-radius:11px!important;margin:0!important;background:#eef5f0;cursor:zoom-in}
.market-photo-lightbox{position:fixed;inset:0;z-index:99999;background:rgba(2,6,23,.88);display:flex;align-items:center;justify-content:center;padding:18px}
.market-photo-lightbox img{max-width:min(1100px,96vw);max-height:90vh;object-fit:contain;border-radius:14px;box-shadow:0 24px 80px rgba(0,0,0,.45)}
.market-photo-lightbox button{position:absolute;top:16px;right:18px;width:44px;height:44px;border:0;border-radius:999px;background:#fff;color:#0f172a;font-size:30px;line-height:1;cursor:pointer}
@media(max-width:860px){.market-admin-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}.market-admin-gallery img:first-child:nth-last-child(3){grid-row:auto;height:auto!important;min-height:0;aspect-ratio:1/1}}
