:root {
  --bg: #f2f4f1; --surface: #ffffff; --ink: #17201b; --muted: #56635b; --line: #d9dfd9;
  --accent: #a84d22; --accent-ink: #ffffff; --green: #1f6b45; --green-soft: #e2efe7;
  --amber: #7a4d00; --amber-soft: #fbefd6; --red: #a33a2c; --red-soft: #f8e3df;
  --hero: #1c2a23; --hero-ink: #eef3ef; --hero-muted: #b6c6bb;
  --f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121815; --surface: #1a221e; --ink: #e7ede9; --muted: #9caba2; --line: #2c3732;
    --accent: #e08a5c; --accent-ink: #1a0f09; --green: #6fcf98; --green-soft: #1d3428;
    --amber: #e8b250; --amber-soft: #3a2d12; --red: #ef9282; --red-soft: #3d221d;
    --hero: #0c110e; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--f-body); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 26px; font-weight: 800; font-stretch: 108%; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; font-family: var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* Shell */
.top { position: sticky; top: 0; z-index: 5; background: var(--hero); color: var(--hero-ink);
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); }
.top-in { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.brand { font-family: var(--f-display); font-weight: 900; font-stretch: 115%; font-size: 22px; color: var(--hero-ink); text-decoration: none; margin-right: auto; }
.brand b { color: #e08a5c; }
.brand span { font-weight: 600; font-stretch: 100%; font-size: 15px; color: var(--hero-muted); }
.top a.link { color: var(--hero-ink); font-weight: 600; font-size: 14px; text-decoration: none; }
main { max-width: 960px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 96px max(16px, env(safe-area-inset-left)); display: grid; gap: 16px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a.on { color: var(--accent); }
.tabbar svg { width: 22px; height: 22px; }

/* Blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px; min-width: 0; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 200px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* Forms */
label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; font-weight: 400; }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { font-size: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: 10px 12px; display: grid; gap: 8px; }
legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 10px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: progress; }
.err { color: var(--red); font-size: 14px; }
.ok { color: var(--green); font-size: 14px; }

/* Browse */
.search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 19px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px; text-decoration: none; color: inherit; }
.item:hover { border-color: var(--accent); }
.thumb { width: 96px; height: 96px; border-radius: 8px; background: var(--green-soft); object-fit: cover; display: block; }
.item h3 { font-size: 15px; }
.price { font-family: var(--f-mono); font-size: 15px; font-weight: 500; }
.price span { font-family: var(--f-body); color: var(--muted); font-size: 12px; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 10px;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.pill.good { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.warn { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.empty { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 28px 18px; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }

/* Listing */
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r); background: var(--green-soft); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; display: block; max-width: 100%; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.stat small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat b { font-family: var(--f-mono); font-weight: 500; font-size: 16px; }
.plan { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 400; cursor: pointer; }
.plan:has(input:checked) { border: 2px solid var(--accent); padding: 9px 11px; }
.plan:has(input:disabled) { opacity: .5; }
.plan input { margin-top: 4px; accent-color: var(--accent); }
.lines { display: grid; gap: 6px; font-size: 14px; }
.lines div { display: flex; justify-content: space-between; gap: 12px; }
.lines .tot { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; font-size: 16px; }
.notice { background: var(--amber-soft); color: var(--amber); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.notice.good { background: var(--green-soft); color: var(--green); }
.code { font-family: var(--f-mono); font-size: 34px; letter-spacing: .3em; color: var(--accent); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.timeline { display: grid; gap: 8px; font-size: 13.5px; }
.timeline div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; }

/* Admin */
.admin main { max-width: 1200px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kycimgs { display: flex; gap: 8px; flex-wrap: wrap; }
.kycimgs img { width: 220px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 20; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); }
.tight { gap: 4px; }
.row.tight { gap: 6px; }
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar div { height: 8px; width: 0; background: var(--accent); }
a.chip { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.err:empty { display: none; }
