:root {
  --bg: #F6F7F5;
  --white: #FFFFFF;
  --ink: #101512;
  --muted: #69716D;
  --line: #E3E7E3;
  --soft: #EEF2EF;
  --green: #0E5A43;
  --green-soft: #E3F0EA;
  --orange: #FF6B2C;
  --orange-soft: #FFF0E7;
  --wa: #1F8A4C;
  --danger: #B3321F;
  --font: "Urbanist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side: 248px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; font-weight: 500; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; text-decoration: none; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 1rem; }

.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--white); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; z-index: 30;
}
.side .brand { padding: 0 8px; }
.side-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; color: var(--muted); }
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--green-soft); color: var(--green); font-weight: 700; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; }
.who:hover { background: var(--soft); }
.who b { display: block; font-size: .95rem; line-height: 1.2; }
.who small { color: var(--muted); font-size: .8rem; }

.av { width: 38px; height: 38px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; text-decoration: none; flex: none; }
.av-lg { width: 72px; height: 72px; font-size: 1.7rem; }

.main { margin-left: var(--side); min-height: 100vh; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 14px 28px; background: rgba(246, 247, 245, .9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.brand-m { display: none; }
.search { flex: 1; max-width: 620px; display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.search:focus-within { border-color: var(--green); }
.search .ic { color: var(--muted); width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; outline: none; }
.search input::placeholder { color: #9AA19D; }
.top-right { margin-left: auto; display: flex; align-items: center; }
.wrap { max-width: 1160px; padding: 8px 28px 60px; }
.tabbar { display: none; }

@media (max-width: 899px) {
  .side { display: none; }
  .main { margin-left: 0; }
  .top { flex-wrap: wrap; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; gap: 10px; background: var(--white); border-bottom: 1px solid var(--line); }
  .brand-m { display: flex; }
  .search { order: 3; flex-basis: 100%; max-width: none; background: var(--bg); border-color: transparent; }
  .wrap { padding: 12px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--white);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar .nav-item { flex: 1; flex-direction: column; gap: 3px; padding: 6px 0; font-size: .75rem; border-radius: 10px; background: none; }
  .tabbar .nav-item[aria-current="page"] { background: none; color: var(--green); }
  .tabbar .nav-item[aria-current="page"] .ic { stroke-width: 2.3; }
  .tabbar .is-sell .ic { color: var(--orange); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 18px; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--green); color: #fff;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.accent { background: var(--orange); }
.btn.ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn.ghost.danger { color: var(--danger); }
.btn.wa { background: var(--wa); }
.btn.light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.btn.small { padding: 8px 14px; font-size: .92rem; }
.btn.big { padding: 15px 22px; font-size: 1.02rem; }
.btn.full { width: 100%; }
.more { display: flex; margin: 28px auto 0; }

/* ---------- home ---------- */
.promo {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  background: var(--orange-soft); border-radius: 18px; padding: 22px 24px; margin: 8px 0 20px;
}
.promo h1 { margin: 0; font-size: clamp(1.35rem, 3.5vw, 1.8rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.promo p { margin: 4px 0 0; color: #7A4A2E; }
.pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.pills::-webkit-scrollbar { display: none; }
.pill { flex: none; text-decoration: none; background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.pill:hover { border-color: var(--ink); }
.pill[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 14px; }
.sec-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
.select { border: 1px solid var(--line); background: var(--white); border-radius: 10px; padding: 8px 10px; font-weight: 600; cursor: pointer; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 26px 18px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.tile { display: block; text-decoration: none; }
.ph { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--soft); }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.tile:hover .ph img { transform: scale(1.03); }
.badge { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.sold { background: var(--ink); color: #fff; }
.badge.static { position: static; display: inline-block; background: var(--green-soft); color: var(--green); }
.badge.static.sold { background: var(--ink); color: #fff; }
.t-price { margin-top: 9px; font-weight: 800; font-size: 1.05rem; }
.t-title { font-weight: 600; font-size: .93rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.t-meta { color: var(--muted); font-size: .82rem; }

/* ---------- page headers ---------- */
.page-head { margin: 10px 0 20px; }
.page-head h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.sub { font-size: 1.1rem; font-weight: 800; margin: 28px 0 12px; }

/* ---------- item ---------- */
.back { display: inline-flex; align-items: center; gap: 2px; margin: 6px 0 14px; color: var(--muted); font-weight: 600; text-decoration: none; }
.item { display: grid; gap: 22px; }
@media (min-width: 980px) { .item { grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: start; } .info { position: sticky; top: 90px; } }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 18px; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 18px; scroll-snap-align: start; background: var(--soft); }
.gallery-hint { text-align: center; color: var(--muted); font-size: .85rem; margin: 8px 0 0; }
.info h1 { margin: 10px 0 0; font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.price-lg { margin: 6px 0 0; font-size: 1.9rem; font-weight: 800; color: var(--green); }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 18px 0; }
.specs div { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.specs span { display: block; color: var(--muted); font-size: .8rem; }
.specs b { font-size: .95rem; }
.desc { white-space: pre-wrap; line-height: 1.65; margin: 0 0 18px; }
.seller { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.seller b { display: block; }
.seller small { color: var(--muted); }
.actions { display: grid; gap: 10px; margin-top: 18px; }
.notice { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: .9rem; margin: 14px 0 0; }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; max-width: 620px; }
.field { display: grid; gap: 6px; }
.lbl { font-weight: 700; font-size: .92rem; }
.lbl small { font-weight: 500; color: var(--muted); margin-left: 4px; }
.form input, .form select, .form textarea { width: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 1rem; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.form textarea { min-height: 110px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--danger); font-weight: 700; min-height: 1.2em; margin: 0; }
.switch { color: var(--muted); margin: 0; text-align: center; }
.switch a { color: var(--green); font-weight: 700; }
.auth { max-width: 440px; margin: 20px auto 0; }
.photos { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.thumb, .add-photo { flex: none; width: 96px; height: 120px; border-radius: 12px; }
.thumb { position: relative; overflow: hidden; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .cover { position: absolute; left: 6px; bottom: 6px; background: var(--ink); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.thumb button { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--white); cursor: pointer; font-weight: 800; line-height: 1; }
.add-photo { border: 1.5px dashed #B8C2BC; background: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--green); cursor: pointer; }
.add-photo:hover { border-color: var(--green); }
.add-photo input { display: none; }

/* ---------- wallet ---------- */
.balance { background: var(--green); color: #fff; border-radius: 20px; padding: 24px; display: grid; gap: 18px; max-width: 620px; }
.bal-main span, .bal-row span { display: block; opacity: .75; font-size: .9rem; }
.bal-main strong { font-size: clamp(2.2rem, 7vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.bal-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.18); }
.bal-row b { font-size: 1.15rem; }
.balance .btn { justify-self: start; }
.soon { max-width: 620px; margin-top: 18px; background: var(--orange-soft); border-radius: 14px; padding: 14px 16px; }
.soon p { margin: 4px 0 0; color: #7A4A2E; font-size: .92rem; }
.steps { list-style: none; padding: 0; margin: 14px 0 0; max-width: 620px; display: grid; gap: 4px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; }
.steps li + li { border-top: 1px solid var(--line); }
.steps .ic { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--green-soft); color: var(--green); }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: .92rem; }

/* ---------- profile ---------- */
.me { display: flex; align-items: center; gap: 16px; margin: 10px 0 18px; }
.me-text h1 { margin: 0; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.me-text p { margin: 2px 0 0; color: var(--muted); }
.nums { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: 1px solid var(--line); border-radius: 16px; max-width: 620px; }
.nums div { padding: 14px; text-align: center; }
.nums div + div { border-left: 1px solid var(--line); }
.nums b { display: block; font-size: 1.4rem; font-weight: 800; }
.nums span { color: var(--muted); font-size: .85rem; }
.seg { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; margin: 24px 0 16px; }
.seg button { border: 0; background: none; padding: 8px 18px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.menu { background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; max-width: 620px; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none; text-decoration: none; font-weight: 600; cursor: pointer; text-align: left; }
.menu > * + * { border-top: 1px solid var(--line); }
.menu span { flex: 1; }
.menu .ic:first-child { color: var(--green); }
.menu .ic:last-child { color: var(--muted); width: 18px; height: 18px; }
.menu a:hover, .menu button:hover { background: var(--soft); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 48px 16px; }
.empty h2 { margin: 0 0 4px; font-size: 1.25rem; }
.empty p { color: var(--muted); margin: 0 0 14px; }
.empty.slim { padding: 24px 16px; background: var(--white); border: 1px dashed var(--line); border-radius: 16px; max-width: 620px; }
.empty.slim p { margin: 0; }
.empty.slim .btn { margin-top: 12px; }
.loading { color: var(--muted); padding: 40px 0; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; z-index: 50; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 700; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast, .ph img { transition: none; } .tile:hover .ph img { transform: none; } }
