:root{
  --ink:#1A1A2E; --ink2:#3A3950; --muted:#5C5A70; --line:#ECE5DC; --line2:#D9D1C7;
  --bg:#FAF7F3; --card:#FFFFFF; --accent:#D1430F; --accent-dark:#B83A0C; --accent-soft:#FFF1E9;
  --green:#0F7B5F; --green-soft:#E9F5F0; --red:#A3300B;
  --radius:16px; --nav-h:64px; --top-safe:env(safe-area-inset-top,0px); --bottom-safe:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;color:var(--ink);background:var(--bg);line-height:1.45;padding-bottom:calc(var(--nav-h) + var(--bottom-safe))}
a{color:var(--accent-dark)}
img{display:block;max-width:100%}
button{font:inherit;color:inherit}
input,select,textarea{font:inherit;font-size:16px;color:var(--ink)}
.display{font-family:'Bricolage Grotesque',sans-serif;font-weight:800;letter-spacing:-.02em}
[hidden]{display:none !important}
.skip{position:absolute;left:-9999px}.skip:focus{left:12px;top:12px;z-index:100;background:#fff;padding:8px 12px;border-radius:8px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
:focus-visible{outline:3px solid var(--ink);outline-offset:2px}
.wrap{max-width:1180px;margin:0 auto;padding:0 16px}

/* Top bar */
.topbar{position:sticky;top:0;z-index:20;background:#fff;border-bottom:1px solid var(--line);padding-top:var(--top-safe)}
.topbar .row{display:flex;align-items:center;gap:12px;min-height:60px}
.logo{font-family:'Bricolage Grotesque',sans-serif;font-weight:800;font-size:24px;letter-spacing:-1px;color:var(--ink);text-decoration:none;flex:none}
.logo span{color:var(--accent)}
.loc{display:inline-flex;align-items:center;gap:4px;min-height:44px;padding:0 6px;min-width:0;border:0;background:none;font-weight:600;font-size:15px;cursor:pointer;border-radius:12px;max-width:60vw}
.loc:hover{background:var(--bg)}
.loc .pin{color:var(--accent)}
.loc .txt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}
.top-search{flex:1;display:none}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.lang{display:inline-flex;background:#F0EBE4;border-radius:20px;padding:3px}
.lang button{min-width:40px;min-height:36px;border:0;border-radius:18px;background:none;font-size:13px;font-weight:700;cursor:pointer}
.lang button[aria-pressed="true"]{background:var(--ink);color:#fff}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:0 22px;border-radius:24px;border:0;background:var(--accent);color:#fff;font-weight:600;font-size:16px;text-decoration:none;cursor:pointer}
.btn:hover{background:var(--accent-dark);color:#fff}
.btn[disabled]{opacity:.6;cursor:default}
.btn.dark{background:var(--ink)}.btn.dark:hover{background:#000}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line2)}.btn.ghost:hover{background:var(--bg)}
.btn.green{background:var(--green)}.btn.green:hover{background:#0B5E48}
.btn.block{width:100%}
.btn.sm{min-height:40px;padding:0 16px;font-size:14px}
.desk{display:none}

/* Search box */
.search{display:flex;align-items:center;gap:10px;background:#fff;border:1.5px solid var(--line2);border-radius:14px;padding:0 6px 0 14px;min-height:52px}
.search:focus-within{border-color:var(--ink)}
.search input{flex:1;min-width:0;border:0;outline:0;background:none;height:48px}
.search .go{border:0;background:var(--ink);color:#fff;border-radius:10px;min-height:40px;padding:0 14px;font-weight:600;cursor:pointer}

/* Sections */
.section{margin:22px 0}
.section-h{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:0 0 12px}
.section-h h2{margin:0;font-size:22px}
.muted{color:var(--muted)}
.small{font-size:13px}

/* Categories */
.cats{display:flex;gap:14px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.cats::-webkit-scrollbar{display:none}
.cat{flex:none;width:84px;display:flex;flex-direction:column;align-items:center;gap:8px;text-decoration:none;color:var(--ink);font-size:13px;text-align:center;scroll-snap-align:start}
.cat .ic{width:68px;height:68px;border-radius:50%;background:var(--accent-soft);display:flex;align-items:center;justify-content:center;color:var(--accent)}
.cat[aria-current="true"] .ic{background:var(--accent);color:#fff}

/* Listing cards */
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.card{position:relative;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column}
.card a.cover{position:absolute;inset:0;z-index:1}
.card .ph{aspect-ratio:4/3;background:#EFE8DF;object-fit:cover;width:100%}
.card .body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:3px}
.card .price{font-family:'Bricolage Grotesque',sans-serif;font-weight:800;font-size:18px}
.card .title{font-size:14px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:2.6em}
.rate-line{display:flex;align-items:center;gap:4px;font-size:12px}
.card .meta{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fav{position:absolute;top:8px;right:8px;z-index:2;width:40px;height:40px;border-radius:50%;border:0;background:rgba(255,255,255,.92);display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--ink)}
.fav[aria-pressed="true"]{color:var(--accent)}
.badge{display:inline-block;font-size:11px;font-weight:700;padding:2px 8px;border-radius:10px}
.badge.new{background:#DDF1E9;color:#0B5E48}
.badge.used{background:#F1E7DD;color:#6E3B12}
.badge.sold{background:var(--ink);color:#fff}
.tag-row{position:absolute;left:8px;top:8px;z-index:2;display:flex;gap:6px}

/* Empty / hero */
.empty{background:#fff;border:2px dashed var(--line2);border-radius:var(--radius);padding:28px 20px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:12px}
.hero{background:var(--ink);color:#fff;border-radius:20px;padding:22px;display:flex;flex-wrap:wrap;gap:16px;align-items:center;justify-content:space-between;margin-top:16px}
.hero h1{margin:0;font-size:26px;line-height:1.1}
.hero h1 span{color:#FF8A5B}
.hero p{margin:6px 0 0;color:#D8D6E3;font-size:14px}

/* Chips & filters */
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:6px}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;min-height:40px;padding:0 14px;border-radius:20px;border:1px solid var(--line2);background:#fff;font-weight:600;font-size:14px;cursor:pointer;display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.chip[aria-pressed="true"]{background:var(--ink);color:#fff;border-color:var(--ink)}

/* Forms */
.form{display:flex;flex-direction:column;gap:18px}
.field{display:flex;flex-direction:column;gap:6px}
.field>label,.legend{font-weight:600}
.input,.select,.textarea{width:100%;height:52px;padding:0 14px;border:1px solid var(--line2);border-radius:12px;background:#fff}
.textarea{height:auto;min-height:120px;padding:12px 14px;resize:vertical}
.input:focus,.select:focus,.textarea:focus{outline:2px solid var(--ink);outline-offset:0;border-color:var(--ink)}
.tel{display:flex;border:1px solid var(--line2);border-radius:12px;overflow:hidden;background:#fff}
.tel:focus-within{outline:2px solid var(--ink)}
.tel span{display:flex;align-items:center;padding:0 12px;background:#F3EEE7;font-weight:600;color:var(--ink2);white-space:nowrap}
.tel input{border:0;outline:0;flex:1;min-width:0;height:52px;padding:0 12px}
.two{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px}
.hint{font-size:13px;color:var(--muted)}
.err{background:#FDECE6;color:#8F2D09;border-radius:12px;padding:12px 14px;font-weight:600}
.ok{background:var(--green-soft);color:#0B4A39;border-radius:12px;padding:12px 14px;font-weight:600}
.check{display:flex;gap:10px;align-items:center;min-height:44px;cursor:pointer}
.check input{width:22px;height:22px;accent-color:var(--accent);margin:0}
.panel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:20px}
.page-title{font-size:28px;margin:20px 0 6px}

/* Photo picker */
.photos{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.photo-slot{position:relative;aspect-ratio:1;border-radius:12px;overflow:hidden;background:#EFE8DF}
.photo-slot img{width:100%;height:100%;object-fit:cover}
.photo-slot .x{position:absolute;top:4px;right:4px;width:32px;height:32px;border-radius:50%;border:0;background:rgba(26,26,46,.85);color:#fff;cursor:pointer;font-size:18px;line-height:1}
.photo-slot .first{position:absolute;left:4px;bottom:4px;background:var(--ink);color:#fff;font-size:11px;font-weight:700;padding:2px 6px;border-radius:8px}
.photo-add{aspect-ratio:1;border:2px dashed var(--accent);border-radius:12px;background:var(--accent-soft);color:var(--accent-dark);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-weight:600;font-size:13px;cursor:pointer;text-align:center}
.photo-slot.loading::after{content:'';position:absolute;inset:0;background:rgba(255,255,255,.6)}

/* Item page */
.gallery{position:relative;background:#111;border-radius:0 0 20px 20px;overflow:hidden;margin:0 -16px}
.gallery .track{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.gallery .track::-webkit-scrollbar{display:none}
.gallery img{flex:none;width:100%;aspect-ratio:4/3;object-fit:contain;scroll-snap-align:center;background:#111}
.gallery .count{position:absolute;right:12px;bottom:12px;background:rgba(0,0,0,.6);color:#fff;font-size:13px;padding:4px 10px;border-radius:12px}
.item-head{display:flex;flex-direction:column;gap:6px;margin:16px 0}
.item-price{font-family:'Bricolage Grotesque',sans-serif;font-weight:800;font-size:32px}
.item-title{font-size:20px;font-weight:600;margin:0}
.dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0}
.dl dt{color:var(--muted);font-size:13px}.dl dd{margin:2px 0 0;font-weight:600}
.seller{display:flex;align-items:center;gap:12px}
.avatar{width:48px;height:48px;border-radius:50%;background:#E3DDF2;display:flex;align-items:center;justify-content:center;font-weight:700;flex:none}
.contact-bar{position:fixed;left:0;right:0;bottom:calc(var(--nav-h) + var(--bottom-safe));z-index:15;background:#fff;border-top:1px solid var(--line);padding:10px 16px;display:flex;gap:10px}
.contact-bar .btn{flex:1}
.safety{background:var(--green-soft);color:#0B4A39;border-radius:14px;padding:14px;font-size:14px}

/* Bottom nav */
.bottomnav{position:fixed;left:0;right:0;bottom:0;z-index:30;background:#fff;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(5,1fr);height:calc(var(--nav-h) + var(--bottom-safe));padding-bottom:var(--bottom-safe)}
.bottomnav a{white-space:nowrap;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-decoration:none;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}
.bottomnav a[aria-current="page"]{color:var(--ink)}
.bottomnav .sell{position:relative}
.bottomnav .sell .plus{width:54px;height:54px;border-radius:50%;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;margin-top:-26px;box-shadow:0 4px 12px rgba(209,67,15,.35);border:4px solid #fff}

/* Sheet (modal) */
.sheet-backdrop{position:fixed;inset:0;z-index:50;background:rgba(26,26,46,.5);display:flex;align-items:flex-end;justify-content:center}
.sheet{background:#fff;width:100%;max-width:560px;max-height:88vh;overflow:auto;border-radius:20px 20px 0 0;padding:20px 16px calc(20px + var(--bottom-safe))}
.sheet h2{margin:0 0 14px;font-size:22px}
.sheet .close{position:sticky;top:0;float:right;width:44px;height:44px;border-radius:50%;border:0;background:var(--bg);cursor:pointer;font-size:20px}
.opt{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:52px;padding:0 14px;border:1px solid var(--line);border-radius:12px;background:#fff;cursor:pointer;text-align:left;margin-bottom:8px;font-size:16px}
.opt[aria-pressed="true"]{border:2px solid var(--accent);background:#FFF6F1}
.opt[disabled]{opacity:.55;cursor:default}
.soon{font-size:12px;font-weight:700;background:#F0EBE4;color:var(--ink2);padding:3px 8px;border-radius:10px}

.toast{position:fixed;left:50%;bottom:calc(var(--nav-h) + var(--bottom-safe) + 16px);transform:translateX(-50%) translateY(20px);opacity:0;pointer-events:none;background:var(--ink);color:#fff;padding:12px 18px;border-radius:12px;font-weight:600;z-index:60;transition:.2s;max-width:90vw}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.spinner{width:28px;height:28px;border:3px solid var(--line2);border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;margin:40px auto}
@keyframes spin{to{transform:rotate(360deg)}}
.skeleton{background:linear-gradient(90deg,#EFE8DF,#F7F2EC,#EFE8DF);background-size:200% 100%;animation:sk 1.2s infinite}
@keyframes sk{to{background-position:-200% 0}}
.list-row{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:14px;padding:10px;margin-bottom:10px}
.list-row img,.list-row .noimg{width:84px;height:84px;border-radius:10px;object-fit:cover;flex:none;background:#EFE8DF}
.list-row .info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.list-row .actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.menu a,.menu button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:56px;padding:0 16px;border:0;border-bottom:1px solid var(--line);background:#fff;text-decoration:none;color:var(--ink);font-size:16px;cursor:pointer;text-align:left}
.menu{border:1px solid var(--line);border-radius:16px;overflow:hidden}

/* Phones: compact like OLX — more on screen */
@media (max-width:719px){
  .section{margin:14px 0}
  .section-h{margin-bottom:8px}
  .section-h h2{font-size:18px}
  .search{min-height:44px;border-radius:12px;padding-left:12px}
  .search input{height:42px;font-size:15px}
  .search .go{min-height:34px;padding:0 12px;font-size:14px}
  .hero{padding:14px 16px;border-radius:16px;margin-top:10px;gap:10px;flex-wrap:nowrap}
  .hero h1{font-size:18px}
  .hero p{font-size:12px;margin-top:3px}
  .hero .btn{min-height:40px;padding:0 14px;font-size:14px;white-space:nowrap;flex:none}
  .cats{gap:6px;padding-bottom:6px}
  .cat{width:66px;font-size:11.5px;gap:5px;line-height:1.2}
  .cat .ic{width:54px;height:54px}
  .cat .ic svg{width:24px;height:24px}
  .grid{gap:10px}
  .card .body{padding:8px 10px 10px}
  .card .price{font-size:16px}
  .card .title{font-size:13px}
  .rate-line{display:flex;align-items:center;gap:4px;font-size:12px}
.card .meta{font-size:11px}
  .fav{width:34px;height:34px;top:6px;right:6px}
  .fav svg{width:18px;height:18px}
  .page-title{font-size:24px;margin-top:14px}
  .bottomnav a{font-size:10px}
  .list-row .actions .btn{min-height:36px;padding:0 12px;font-size:13px}
}
@media (min-width:720px){
  .grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
  .hero{padding:32px}.hero h1{font-size:34px}
}
@media (min-width:1000px){
  body{padding-bottom:0}
  .bottomnav{display:none}
  .desk{display:inline-flex}
  .top-search{display:block}
  .mob{display:none}
  .logo{font-size:28px}
  .grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .contact-bar{position:static;padding:0;border:0;background:none;margin:16px 0}
  .item-layout{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:28px;align-items:start}
  .gallery{margin:16px 0 0;border-radius:20px}
  .toast{bottom:24px}
  .sheet-backdrop{align-items:center}
  .sheet{border-radius:20px}
}
