/* MPL1 · DealOS Marketplace, buyer site. Ledger tokens, mobile first. */
:root {
  --paper:#F4F3EF; --card:#FFFFFF; --panel:#F7F6F2; --ink:#1B2530; --mut:#5B6066; --dim:#7A7D80; --line:#E3E1DA; --hair:#EFEDE7;
  --accent:#17694E; --accent2:#125640; --accentbg:#E7F1EC; --red:#B34747; --amber:#C99117; --blue:#3D74C4;
  --r:12px; --r2:10px; --sh:0 10px 30px rgba(27,37,48,.10);
  --font:'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --head:'Archivo', var(--font); --mono:'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--paper); color:var(--ink); font:15px/1.5 var(--font); min-height:100vh; padding-bottom:env(safe-area-inset-bottom); }
a { color:var(--accent); }
button, input, select, textarea { font:inherit; color:inherit; }
h1, h2, h3 { font-family:var(--head); letter-spacing:-.01em; margin:0; }
h1 { font-size:26px; line-height:1.15; } h2 { font-size:20px; line-height:1.2; } h3 { font-size:15px; }
.mono { font-family:var(--mono); }
.loading, .empty { padding:40px 16px; text-align:center; color:var(--mut); }
.empty b { display:block; color:var(--ink); margin-bottom:4px; }

/* header */
.top { position:sticky; top:0; z-index:20; background:var(--card); border-bottom:1px solid var(--line); display:flex; align-items:center; gap:10px; padding:10px 16px; min-height:54px; }
.brand { display:flex; align-items:center; gap:8px; font-family:var(--head); font-weight:800; font-size:16px; color:var(--ink); text-decoration:none; }
.brand .mark { width:26px; height:26px; border-radius:7px; background:var(--accent); color:#fff; display:grid; place-items:center; font-size:14px; }
.brand small { font-weight:600; color:var(--dim); font-size:12px; }
.top .nav { display:none; gap:4px; margin-left:12px; }
.top .nav a { color:var(--mut); text-decoration:none; padding:7px 10px; border-radius:8px; font-weight:500; font-size:14px; }
.top .nav a.on, .top .nav a:hover { color:var(--ink); background:var(--panel); }
.top .sp { flex:1; }
.top .acts { display:flex; gap:8px; align-items:center; }
@media (min-width: 820px) { .top .nav { display:flex; } }

/* bottom tabs on phones */
.tabs { position:fixed; left:0; right:0; bottom:0; z-index:20; background:var(--card); border-top:1px solid var(--line); display:grid; grid-auto-flow:column; padding:6px 6px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { text-decoration:none; color:var(--dim); font-size:11px; font-weight:600; display:grid; justify-items:center; gap:2px; padding:4px 0; border-radius:8px; }
.tabs a svg { width:22px; height:22px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.tabs a.on { color:var(--accent); }
@media (min-width: 820px) { .tabs { display:none !important; } }
body.tabbed { padding-bottom:calc(70px + env(safe-area-inset-bottom)); }

/* layout */
.view { max-width:1100px; margin:0 auto; padding:16px; }
.narrow { max-width:520px; margin:0 auto; }
.card { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:18px; }
.card + .card { margin-top:14px; }
.stack { display:grid; gap:12px; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.sp { flex:1; }
.muted { color:var(--mut); font-size:13.5px; }
.tiny { color:var(--dim); font-size:12px; }
.err { color:var(--red); font-size:13.5px; min-height:1em; }

/* buttons */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--line); background:var(--card); color:var(--ink); border-radius:var(--r2); padding:11px 16px; font-weight:600; cursor:pointer; text-decoration:none; font-size:15px; min-height:44px; }
.btn:hover { border-color:var(--accent); }
.btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; } .btn.primary:hover { background:var(--accent2); }
.btn.danger { color:var(--red); }
.btn.sm { padding:7px 12px; font-size:13.5px; min-height:36px; }
.btn.block { width:100%; }
.btn:disabled { opacity:.55; cursor:default; }
.btn.on { background:var(--accentbg); border-color:var(--accent); color:var(--accent); }
.iconbtn { border:1px solid var(--line); background:var(--card); border-radius:50%; width:40px; height:40px; display:inline-grid; place-items:center; cursor:pointer; }
.iconbtn svg { width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.iconbtn.on { color:var(--accent); background:var(--accentbg); border-color:var(--accent); } .iconbtn.on svg { fill:currentColor; }

/* forms */
.f { display:grid; gap:12px; }
.f label { display:grid; gap:5px; font-size:13px; font-weight:600; color:var(--mut); }
.f input, .f select, .f textarea { border:1px solid var(--line); border-radius:var(--r2); background:var(--card); padding:11px 12px; font-size:16px; min-height:44px; width:100%; }
.f input:focus, .f select:focus, .f textarea:focus { outline:2px solid var(--accent); outline-offset:0; border-color:var(--accent); }
.f .two { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.checks { display:flex; flex-wrap:wrap; gap:8px; }
.chk { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:99px; padding:7px 12px; cursor:pointer; font-weight:500; font-size:14px; background:var(--card); }
.chk input { margin:0; width:16px; height:16px; min-height:0; accent-color:var(--accent); }
.chk.on { border-color:var(--accent); background:var(--accentbg); }
.consent { display:flex; gap:10px; align-items:flex-start; font-size:13.5px; color:var(--mut); font-weight:400; }
.consent input { width:18px; height:18px; min-height:0; margin-top:2px; accent-color:var(--accent); flex:0 0 auto; }
.switch { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--hair); }
.switch:last-child { border-bottom:0; }
.switch b { display:block; font-weight:600; } .switch span { color:var(--mut); font-size:13px; }
.switch input { width:44px; height:26px; accent-color:var(--accent); flex:0 0 auto; }
.captcha { min-height:0; }

/* landing */
.hero { padding:36px 0 16px; display:grid; gap:14px; }
.hero h1 { font-size:34px; }
.hero p { font-size:17px; color:var(--mut); margin:0; max-width:560px; }
.hero .row { margin-top:6px; }
.pts { display:grid; gap:10px; margin:22px 0; }
.pt { background:var(--card); border:1px solid var(--line); border-radius:var(--r); padding:14px 16px; }
.pt b { display:block; margin-bottom:2px; } .pt span { color:var(--mut); font-size:14px; }
@media (min-width: 820px) { .hero { padding:60px 0 20px; } .hero h1 { font-size:46px; } .pts { grid-template-columns:repeat(3, 1fr); } }

/* browse */
.filters { display:flex; gap:8px; overflow-x:auto; padding:2px 0 8px; margin:0 -16px; padding-left:16px; padding-right:16px; scrollbar-width:none; }
.filters::-webkit-scrollbar { display:none; }
.filters select, .filters input { border:1px solid var(--line); border-radius:99px; background:var(--card); padding:8px 12px; font-size:14px; min-height:38px; flex:0 0 auto; }
.filters input { width:150px; }
.count { display:flex; align-items:center; gap:8px; margin:4px 0 10px; color:var(--mut); font-size:13.5px; }
.grid { display:grid; gap:14px; grid-template-columns:1fr; }
@media (min-width: 560px) { .grid { grid-template-columns:1fr 1fr; } }
@media (min-width: 900px) { .grid { grid-template-columns:repeat(3, 1fr); } }
.lcard { background:var(--card); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; display:block; color:inherit; text-decoration:none; }
.lcard:hover { box-shadow:var(--sh); }
.lcard .img { aspect-ratio:4/3; background:var(--panel) center/cover no-repeat; position:relative; display:grid; place-items:center; color:var(--dim); font-size:12px; }
.lcard .img .tags { position:absolute; left:8px; top:8px; display:flex; gap:4px; }
.lcard .b { padding:10px 12px 12px; }
.lcard .p { font-family:var(--head); font-weight:800; font-size:18px; }
.lcard .a { font-weight:600; margin-top:2px; }
.lcard .m { color:var(--mut); font-size:13px; margin-top:2px; }
.tag { display:inline-block; font-size:11px; font-weight:700; padding:2px 8px; border-radius:99px; background:var(--card); color:var(--ink); border:1px solid var(--line); }
.tag.green { background:var(--accent); color:#fff; border-color:var(--accent); } .tag.amber { background:#FFF3D6; color:#7A5A0E; border-color:#F2D98C; } .tag.blue { background:#E8F0FA; color:#1B4B8F; border-color:#C9D9F0; } .tag.gray { background:var(--panel); color:var(--mut); }
.mapwrap { height:260px; border-radius:var(--r); overflow:hidden; border:1px solid var(--line); margin-bottom:12px; }
@media (min-width: 900px) { .browse { display:grid; grid-template-columns:1fr 380px; gap:16px; align-items:start; } .mapwrap { height:calc(100vh - 170px); position:sticky; top:70px; margin:0; } }
.mapwrap.hidden { display:none; }
.more { text-align:center; margin:16px 0; }

/* listing page */
.gal { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; gap:6px; margin:0 -16px; padding:0 16px; scrollbar-width:none; }
.gal::-webkit-scrollbar { display:none; }
.gal .ph { flex:0 0 100%; scroll-snap-align:start; aspect-ratio:4/3; background:var(--panel) center/cover no-repeat; border-radius:var(--r); }
@media (min-width: 820px) { .gal .ph { flex-basis:calc(66% - 3px); } }
.galc { text-align:right; color:var(--dim); font-size:12px; margin-top:4px; }
.lhead { display:grid; gap:4px; margin:14px 0 10px; }
.lhead .p { font-family:var(--head); font-size:30px; font-weight:800; }
.lhead .a { font-size:18px; font-weight:600; } .lhead .m { color:var(--mut); }
.facts { display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 12px; }
.fact { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:6px 10px; font-size:13.5px; }
.fact b { font-weight:700; }
.acts { display:flex; gap:8px; align-items:center; margin:12px 0; position:sticky; bottom:calc(74px + env(safe-area-inset-bottom)); z-index:5; }
@media (min-width: 820px) { .acts { position:static; } }
.acts .btn.primary { flex:1; }
.sec { margin:16px 0; } .sec h3 { margin-bottom:8px; }
.desc { white-space:pre-wrap; }
.hl { display:grid; gap:6px; } .hl div { padding-left:18px; position:relative; } .hl div::before { content:''; position:absolute; left:4px; top:9px; width:7px; height:7px; border-radius:50%; background:var(--accent); }
.kv { display:grid; grid-template-columns:140px 1fr; gap:6px 12px; font-size:14px; } .kv span:nth-child(odd) { color:var(--dim); }
.seller { display:flex; gap:12px; align-items:center; }
.seller .logo { width:52px; height:52px; border-radius:10px; background:var(--panel) center/contain no-repeat; border:1px solid var(--line); flex:0 0 auto; }
.docs a { display:flex; justify-content:space-between; padding:9px 0; border-bottom:1px solid var(--hair); text-decoration:none; }
.hist { font-size:13.5px; color:var(--mut); }
.disc { font-size:12.5px; color:var(--dim); border-top:1px solid var(--hair); padding-top:10px; }
.yours { background:#FFF3D6; border:1px solid #F2D98C; color:#7A5A0E; border-radius:var(--r2); padding:10px 12px; font-size:14px; }

/* modal + toast */
.scrim { position:fixed; inset:0; background:rgba(27,37,48,.45); display:none; z-index:40; }
.scrim.on { display:block; }
.modal { position:fixed; left:0; right:0; bottom:0; z-index:41; background:var(--card); border-radius:16px 16px 0 0; padding:18px 16px calc(18px + env(safe-area-inset-bottom)); display:none; max-height:88vh; overflow:auto; }
.modal.on { display:block; }
@media (min-width: 640px) { .modal { left:50%; right:auto; bottom:auto; top:50%; transform:translate(-50%, -50%); width:480px; border-radius:16px; } }
.modal h2 { margin-bottom:10px; }
.toast { position:fixed; left:50%; bottom:calc(84px + env(safe-area-inset-bottom)); transform:translateX(-50%) translateY(20px); background:var(--ink); color:#fff; padding:10px 16px; border-radius:99px; font-size:14px; opacity:0; transition:.2s; z-index:50; pointer-events:none; max-width:92vw; }
.toast.on { opacity:1; transform:translateX(-50%); }
@media (min-width: 820px) { .toast { bottom:24px; } }
.legal h2 { margin:18px 0 6px; } .legal p { color:var(--mut); }
.verify { text-align:center; padding:30px 0; display:grid; gap:12px; justify-items:center; }
.verify .mark { width:56px; height:56px; border-radius:16px; background:var(--accentbg); color:var(--accent); display:grid; place-items:center; font-size:26px; }
.leaflet-container { font:inherit; }
