:root {
  color-scheme: dark;
  --bg: #090a0c;
  --elevated: #111318;
  --fill: #17191e;
  --line: #24262b;
  --text: #f5f6f7;
  --secondary: #a3a9b3;
  --tertiary: #6b717b;
  --accent: #e5383b;
  --accent-soft: rgba(229, 56, 59, 0.14);
  --star: #f5b83d;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: inherit; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(9,10,12,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.nav { max-width: 1080px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: flex-end; gap: 3px; font-weight: 900; font-size: 22px; letter-spacing: -0.6px; text-decoration: none; }
.brand-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); margin-bottom: 6px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { white-space: nowrap; text-decoration: none; color: var(--secondary); font-size: 14px; font-weight: 600; padding: 8px 10px; border-radius: 10px; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--fill); }
.nav-links a.cta { color: #fff; background: var(--accent); }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
.narrow { max-width: 620px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .inner { max-width: 1080px; margin: 0 auto; padding: 22px 16px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--tertiary); font-size: 13px; }
.site-footer a { color: var(--secondary); text-decoration: none; }

/* Type */
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.6px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -0.2px; }
.muted { color: var(--secondary); }
.small { font-size: 13px; }
.page-head { margin-bottom: 18px; }

/* Buttons */
.btn { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer; font-weight: 700; font-size: 15px; text-decoration: none; background: var(--fill); color: var(--text); }
.btn:hover { filter: brightness(1.12); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 11px; font-size: 14px; }

/* Inputs */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; height: 50px; border-radius: 14px; border: 1px solid transparent; background: var(--fill); padding: 0 14px; font-size: 16px; outline: none; }
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: #3a3d44; }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr 1fr; } .row > :first-child { grid-column: span 2; } }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; background: var(--fill); color: var(--secondary); height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--text); color: #0b0c0e; }
.tag { display: inline-block; background: var(--fill); color: var(--secondary); font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* Search */
.search { position: relative; margin: 14px 0 12px; }
.search .input { padding-left: 42px; }
.search svg { position: absolute; left: 14px; top: 15px; color: var(--tertiary); }

/* Shop grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
.card { display: block; background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: border-color .15s; }
.card:hover { border-color: #3a3d44; }
.thumbs { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; height: 180px; background: var(--fill); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs img:first-child { grid-row: span 2; }
.thumbs.one img:first-child { grid-column: span 2; }
.thumbs.empty { display: flex; align-items: center; justify-content: center; color: var(--tertiary); font-size: 13px; }
.card-body { padding: 14px; }
.shop-line { display: flex; align-items: center; gap: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--fill); object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--secondary); }
.avatar.lg { width: 84px; height: 84px; font-size: 30px; }
.shop-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--secondary); font-size: 13px; margin-top: 2px; }
.stars { color: var(--star); font-weight: 700; }
.card .tags { margin-top: 10px; }
.from { margin-top: 10px; font-size: 13px; color: var(--secondary); }
.from strong { color: var(--text); }

/* Shop page */
.shop-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; }
@media (max-width: 520px) { .shop-hero { align-items: flex-start; } .avatar.lg { width: 68px; height: 68px; } h1 { font-size: 25px; } }
.bio { white-space: pre-line; color: var(--secondary); margin: 0 0 14px; }
.prices { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.price { background: var(--fill); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.price strong { display: block; font-size: 15px; }
.actions { display: flex; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.actions .btn { flex: 1; min-width: 140px; }
.app-banner .btn { flex: none; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 22px 0 14px; }
.tab { background: none; border: 0; padding: 10px 12px; font-weight: 700; color: var(--secondary); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.work { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.work a { position: relative; aspect-ratio: 1; background: var(--fill); overflow: hidden; border-radius: 4px; }
.work img { width: 100%; height: 100%; object-fit: cover; }
.work .vid { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; color: #fff; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.work .noimg { display: flex; align-items: center; justify-content: center; height: 100%; padding: 8px; text-align: center; font-size: 12px; color: var(--secondary); }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review p { margin: 6px 0 0; white-space: pre-line; }

/* Post page */
.media { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 0; border-radius: var(--radius); background: #000; scrollbar-width: none; }
.media::-webkit-scrollbar { display: none; }
.media > * { flex: none; width: 100%; scroll-snap-align: center; max-height: 78vh; object-fit: contain; background: #000; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 0; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--tertiary); }
.dots span.on { background: var(--text); }
.post-text { margin-top: 16px; }
.post-text p { white-space: pre-line; color: var(--secondary); }
.shop-card-mini { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; margin-top: 18px; }

/* Panels / forms */
.panel { background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg button { flex: 1; height: 38px; border: 0; border-radius: 10px; background: none; font-weight: 700; color: var(--secondary); cursor: pointer; }
.seg button.on { background: var(--text); color: #0b0c0e; }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; background: var(--fill); }
.notice.error { background: rgba(229,56,59,.14); color: #ffb3b4; }
.notice.ok { background: rgba(52,199,89,.14); color: #a8f0bd; }
.legal { font-size: 12px; color: var(--secondary); text-align: center; margin: 12px 0 0; }
.legal a { color: var(--text); }
.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photo { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--fill); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.add-photo { width: 76px; height: 76px; border-radius: 12px; border: 1.5px dashed #3a3d44; background: none; color: var(--secondary); cursor: pointer; font-size: 12px; }
.shop-pill { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }

/* Messages */
.inbox { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 190px); min-height: 460px; }
@media (max-width: 760px) { .inbox { grid-template-columns: 1fr; height: auto; } .inbox.thread-open .convos { display: none; } .inbox:not(.thread-open) .thread { display: none; } }
.convos, .thread { background: var(--elevated); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.convo { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); width: 100%; }
.convo.on, .convo:hover { background: var(--fill); }
.convo .last { color: var(--secondary); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.convo-list { overflow-y: auto; flex: 1; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.back { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; padding: 0 6px 0 0; }
@media (max-width: 760px) { .back { display: block; } .thread { height: calc(100dvh - 140px); min-height: 420px; } }
@media (max-width: 400px) { .nav-links a { padding: 8px 7px; font-size: 13px; } .brand { font-size: 20px; } }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 18px; background: var(--fill); white-space: pre-line; word-wrap: break-word; font-size: 15px; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble img, .bubble video { border-radius: 12px; max-height: 280px; margin-top: 4px; }
.bubble .when { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.qcard { border: 1px solid rgba(255,255,255,.18); border-radius: 12px; padding: 10px 12px; margin-top: 6px; font-size: 14px; }
.qcard strong { display: block; }
.qstatus { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; opacity: .8; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.14); }
.qactions { display: flex; gap: 8px; margin-top: 10px; }
.qactions .btn { flex: 1; height: 42px; font-size: 14px; }
.btn-light { background: #fff; color: #0b0c0e; }
.btn-outline { background: none; border: 1px solid #3a3d44; }
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-back { align-items: center; } }
.modal { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: var(--elevated); border: 1px solid var(--line); border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.modal-close { background: var(--fill); border: 0; width: 32px; height: 32px; border-radius: 50%; color: var(--text); font-size: 18px; cursor: pointer; }
.sum { display: flex; justify-content: space-between; font-size: 14px; color: var(--secondary); margin: 4px 0; }
.sum strong { color: var(--text); }
#payment-element { margin: 16px 0; min-height: 120px; }
.composer { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.composer .input { height: 44px; }
.empty-state { text-align: center; color: var(--secondary); padding: 48px 16px; }
.app-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin-top: 24px; font-size: 14px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--fill); border-top-color: var(--text); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
