:root {
  color-scheme: light;
  --bg: #f4f3f0;
  --surface: rgba(255,255,255,.86);
  --surface-solid: #fff;
  --surface-2: #ebe9e4;
  --text: #171717;
  --muted: #72716d;
  --line: rgba(23,23,23,.10);
  --line-strong: rgba(23,23,23,.18);
  --accent: #171717;
  --accent-soft: #eceae5;
  --danger: #c82d2d;
  --danger-soft: #fff0ef;
  --success: #18794e;
  --success-soft: #eaf8f0;
  --warning: #a96800;
  --warning-soft: #fff6df;
  --shadow: 0 18px 55px rgba(35,31,25,.10);
  --radius: 22px;
  --page: min(100%, 760px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10100f;
  --surface: rgba(29,29,27,.90);
  --surface-solid: #1d1d1b;
  --surface-2: #292926;
  --text: #f3f2ee;
  --muted: #a8a69f;
  --line: rgba(255,255,255,.10);
  --line-strong: rgba(255,255,255,.18);
  --accent: #f3f2ee;
  --accent-soft: #2b2b28;
  --danger: #ff6961;
  --danger-soft: rgba(197,45,45,.16);
  --success: #55c892;
  --success-soft: rgba(24,121,78,.18);
  --warning: #ffc261;
  --warning-soft: rgba(169,104,0,.18);
  --shadow: 0 24px 70px rgba(0,0,0,.32);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 7vw, 38px); line-height: 1.02; letter-spacing: -.045em; }
h2 { font-size: 23px; line-height: 1.08; letter-spacing: -.035em; }
h3 { font-size: 16px; line-height: 1.2; }
small { font-size: 11px; }
.muted { color: var(--muted); }

#app { min-height: 100vh; }
.page { width: var(--page); min-height: 100vh; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 14px calc(96px + env(safe-area-inset-bottom)); }
.page.detail { width: min(100%, 760px); padding: 0 0 calc(96px + env(safe-area-inset-bottom)); }
.surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.kicker { display: inline-block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }

.boot-screen, .center-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; text-align: center; }
.brand-mark { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: var(--text); color: var(--bg); font-weight: 900; font-size: 19px; letter-spacing: -.06em; box-shadow: var(--shadow); }
.brand-mark.error { background: var(--danger); color: white; }
.boot-line { width: 130px; height: 4px; overflow: hidden; border-radius: 4px; background: var(--surface-2); }
.boot-line span { display: block; width: 46%; height: 100%; border-radius: inherit; background: var(--text); animation: load 1s ease-in-out infinite alternate; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(220%); } }

.topbar { min-height: 68px; display: flex; align-items: center; gap: 12px; padding: 5px 2px 17px; }
.topbar-title { min-width: 0; flex: 1; display: grid; gap: 5px; }
.topbar-title h1 { overflow: hidden; text-overflow: ellipsis; }
.icon-button { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); color: var(--text); }
.icon-button:active { transform: scale(.96); }

.ui-icon { position: relative; display: inline-block; width: 21px; height: 21px; color: currentColor; }
.i-home::before { content: ""; position: absolute; left: 4px; top: 8px; width: 13px; height: 10px; border: 2px solid currentColor; border-top: 0; border-radius: 2px 2px 4px 4px; }
.i-home::after { content: ""; position: absolute; left: 5px; top: 3px; width: 11px; height: 11px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); border-radius: 2px; }
.i-chat::before { content: ""; position: absolute; inset: 3px 2px 5px; border: 2px solid currentColor; border-radius: 7px; }
.i-chat::after { content: ""; position: absolute; left: 6px; bottom: 2px; width: 7px; height: 7px; border-left: 2px solid currentColor; transform: skew(-28deg); }
.i-plus::before, .i-plus::after { content: ""; position: absolute; left: 4px; top: 9px; width: 13px; height: 3px; border-radius: 3px; background: currentColor; }
.i-plus::after { transform: rotate(90deg); }
.i-bag::before { content: ""; position: absolute; left: 3px; top: 7px; width: 15px; height: 12px; border: 2px solid currentColor; border-radius: 4px; }
.i-bag::after { content: ""; position: absolute; left: 7px; top: 3px; width: 7px; height: 7px; border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; }
.i-user::before { content: ""; position: absolute; left: 7px; top: 2px; width: 7px; height: 7px; border: 2px solid currentColor; border-radius: 50%; }
.i-user::after { content: ""; position: absolute; left: 3px; bottom: 1px; width: 15px; height: 9px; border: 2px solid currentColor; border-bottom: 0; border-radius: 10px 10px 0 0; }
.i-search::before { content: ""; position: absolute; left: 3px; top: 3px; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
.i-search::after { content: ""; position: absolute; right: 2px; bottom: 3px; width: 8px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.i-back::before { content: ""; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.i-back::after { content: ""; position: absolute; left: 5px; top: 10px; width: 13px; height: 2px; background: currentColor; }
.i-close::before, .i-close::after { content: ""; position: absolute; left: 4px; top: 10px; width: 14px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.i-close::after { transform: rotate(-45deg); }
.i-camera::before { content: ""; position: absolute; left: 2px; top: 6px; width: 17px; height: 12px; border: 2px solid currentColor; border-radius: 5px; }
.i-camera::after { content: ""; position: absolute; left: 8px; top: 9px; width: 5px; height: 5px; border: 2px solid currentColor; border-radius: 50%; box-shadow: -2px -6px 0 -1px currentColor; }
.i-chevron::before { content: ""; position: absolute; left: 7px; top: 5px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.i-send::before { content: ""; position: absolute; left: 2px; top: 3px; border-left: 17px solid currentColor; border-top: 8px solid transparent; border-bottom: 8px solid transparent; transform: rotate(-15deg); }
.i-send::after { content: ""; position: absolute; left: 5px; top: 10px; width: 10px; height: 2px; background: var(--surface-solid); transform: rotate(-15deg); }
.i-refresh::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.i-refresh::after { content: ""; position: absolute; right: 1px; top: 2px; border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transform: rotate(20deg); }

.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, #d7d2c8, #f6f3ec); color: #1d1d1d; font-size: 13px; font-weight: 900; letter-spacing: -.04em; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-avatar { background: linear-gradient(145deg, #d62f2f, #8d1717); color: white; }

.bottom-nav { position: fixed; z-index: 80; left: 50%; bottom: 0; width: min(100%,760px); transform: translateX(-50%); display: grid; grid-template-columns: repeat(5,1fr); padding: 8px 7px max(8px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(28px); }
.nav-item { min-width: 0; min-height: 57px; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.nav-item.active { color: var(--text); }
.nav-icon-shell { width: 42px; height: 42px; display: grid; place-items: center; margin-top: -24px; border: 5px solid var(--bg); border-radius: 15px; background: var(--text); color: var(--bg); box-shadow: 0 10px 24px rgba(0,0,0,.20); }
.nav-item.sell > span:last-child { margin-top: 2px; }

.primary-button, .secondary-button, .danger-button, .search-button { min-height: 50px; border-radius: 15px; padding: 0 16px; border: 0; font-weight: 830; transition: transform .14s ease, opacity .14s ease; }
.primary-button { background: var(--text); color: var(--bg); }
.secondary-button { border: 1px solid var(--line-strong); background: var(--surface-solid); color: var(--text); }
.danger-button { background: var(--danger); color: white; }
.search-button { min-height: 48px; background: var(--text); color: var(--bg); }
.primary-button:active, .secondary-button:active, .danger-button:active, .search-button:active { transform: scale(.985); }
.compact { min-height: 42px; }
.button-link { display: grid; place-items: center; }
.button-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }

.search-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-bottom: 12px; }
.input-shell { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 0 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); }
.input-shell .ui-icon { width: 18px; height: 18px; color: var(--muted); }
.input-shell input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.feed-note, .location-lock { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.feed-note strong, .location-lock strong { font-size: 13px; }
.feed-note span, .location-lock span { color: var(--muted); font-size: 12px; text-align: right; }

.product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.product-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-solid); transition: transform .16s ease, box-shadow .16s ease; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.product-card.promoted { border-color: rgba(169,104,0,.34); box-shadow: 0 14px 40px rgba(169,104,0,.10); }
.product-photo { position: relative; aspect-ratio: 1/1.05; overflow: hidden; background: var(--surface-2); }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; background: linear-gradient(145deg,var(--surface-2),var(--surface-solid)); }
.price-pill { position: absolute; left: 9px; bottom: 9px; padding: 6px 9px; border-radius: 10px; background: rgba(18,18,18,.86); color: white; font-size: 13px; font-weight: 850; backdrop-filter: blur(12px); }
.product-copy { display: grid; gap: 7px; padding: 11px; }
.product-copy h3 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 11px; }
.meta-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.seller-mini { display: flex; justify-content: space-between; gap: 7px; color: var(--muted); font-size: 11px; }
.seller-mini span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.top-label { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-height: 22px; padding: 0 8px; border-radius: 6px; background: #d5ff4f; color: #1b2100; font-size: 10px; font-weight: 950; letter-spacing: .06em; }
.top-label.card { position: absolute; top: 9px; left: 9px; }

.floating-bar { position: absolute; z-index: 30; top: max(12px,env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.floating-bar > * { pointer-events: auto; }
.hero { width: 100%; min-height: 310px; max-height: 62vh; aspect-ratio: 1/1; overflow: hidden; background: var(--surface-2); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-placeholder { min-height: 340px; }
.detail-copy { display: grid; gap: 18px; padding: 22px 15px 24px; }
.detail-title { display: grid; gap: 7px; }
.detail-price { font-size: 30px; letter-spacing: -.045em; }
.description { color: var(--text); font-size: 15px; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; }
.seller-row { min-width: 0; display: grid; grid-template-columns: auto 1fr 22px; align-items: center; gap: 12px; padding: 13px; box-shadow: none; }
.seller-main { min-width: 0; display: grid; gap: 4px; }
.seller-main > div { min-height: 22px; }
.seller-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seller-main span { color: var(--muted); font-size: 12px; }
.trust-note { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 15px; border-radius: 18px; background: var(--success-soft); color: var(--success); }
.trust-note p { margin-top: 4px; color: var(--text); font-size: 12px; line-height: 1.45; }
.trust-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--success); color: white; font-weight: 900; }
.sticky-cta { position: fixed; z-index: 70; left: 50%; bottom: 0; width: min(100%,760px); transform: translateX(-50%); display: grid; gap: 8px; padding: 10px 13px max(10px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb,var(--bg) 92%,transparent); backdrop-filter: blur(28px); }
.sticky-cta.two { grid-template-columns: 1fr 1fr; }

.form-card { display: grid; gap: 15px; padding: 16px; }
.field { display: grid; gap: 8px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 15px; padding: 13px 14px; outline: 0; background: var(--surface-solid); color: var(--text); resize: vertical; }
.field textarea { min-height: 110px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.helper { color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-error { padding: 11px 12px; border-radius: 13px; background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.4; white-space: pre-line; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.check-row input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--text); }
.link-button { display: inline; padding: 0; border: 0; background: transparent; color: var(--text); font-weight: 800; text-decoration: underline; }
.photo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.photo-preview, .photo-add { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 17px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview button { position: absolute; top: 6px; right: 6px; width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(15,15,15,.76); color: white; }
.photo-preview .ui-icon { width: 17px; height: 17px; }
.photo-add { display: grid; place-items: center; align-content: center; gap: 4px; border: 1px dashed var(--line-strong); background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 11px; }
.photo-add input { display: none; }
.warning-card { display: grid; gap: 4px; padding: 13px 14px; margin-bottom: 12px; border: 1px solid rgba(169,104,0,.28); border-radius: 16px; background: var(--warning-soft); color: var(--warning); }
.warning-card span { font-size: 12px; }

.list { display: grid; gap: 10px; }
.deal-row { display: flex; align-items: center; gap: 11px; padding: 11px; box-shadow: none; }
.deal-thumb { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 15px; background: var(--surface-2); font-weight: 900; }
.deal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.deal-main { min-width: 0; flex: 1; display: grid; gap: 3px; }
.deal-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-title strong { min-width: 0; }
.status { color: var(--muted); font-size: 12px; }
.status.disputed { color: var(--danger); font-weight: 800; }
.status.completed { color: var(--success); font-weight: 800; }
.deal-side { display: grid; justify-items: end; gap: 8px; white-space: nowrap; font-size: 13px; }

.profile-hero { display: flex; align-items: center; gap: 14px; padding: 7px 2px 16px; }
.profile-main { min-width: 0; display: grid; gap: 5px; }
.profile-main h1 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.profile-main > span { color: var(--muted); font-size: 12px; }
.user-badge { display: inline-flex; align-items: center; width: fit-content; min-height: 20px; padding: 0 7px; border-radius: 6px; font-size: 9px; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; }
.user-badge.admin { background: var(--danger); color: white; }
.user-badge.trusted { background: var(--success); color: white; }
.user-badge.steady { background: var(--success-soft); color: var(--success); }
.user-badge.new { background: var(--surface-2); color: var(--muted); }
.trust-meter { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 14px; padding: 15px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-solid); }
.trust-meter > div { --score:0; width: 72px; height: 72px; display: grid; place-content: center; justify-items: center; border-radius: 50%; background: radial-gradient(circle at center,var(--surface-solid) 60%,transparent 61%), conic-gradient(var(--success) calc(var(--score)*1%),var(--surface-2) 0); }
.trust-meter strong { font-size: 21px; }
.trust-meter span { color: var(--muted); font-size: 10px; }
.trust-meter p { display: grid; gap: 5px; }
.trust-meter p span { font-size: 12px; line-height: 1.4; }
.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 13px; }
.stat { min-height: 98px; display: grid; align-content: space-between; padding: 13px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); }
.stat strong { font-size: 19px; letter-spacing: -.035em; }
.stat span { color: var(--muted); font-size: 11px; }
.menu { overflow: hidden; box-shadow: none; }
.menu-row { min-height: 56px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.menu-row:last-child { border-bottom: 0; }
.menu-row strong { font-size: 13px; }
.admin-menu { background: var(--danger-soft); color: var(--danger); }
.ok-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.legal { color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; }

.public-profile { display: flex; align-items: center; gap: 16px; padding: 16px; margin-bottom: 11px; box-shadow: none; }
.public-profile > div { min-width: 0; display: grid; gap: 6px; }
.public-profile p { color: var(--muted); font-size: 12px; }
.rating-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rating-line span { color: var(--muted); font-size: 12px; }
.stars { color: #d69b00; font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
.profile-facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 18px; }
.profile-facts div { display: grid; justify-items: center; gap: 3px; padding: 12px 5px; border-radius: 15px; background: var(--surface-2); }
.profile-facts strong { font-size: 18px; }
.profile-facts span { color: var(--muted); font-size: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 20px 2px 10px; }
.section-head span { color: var(--muted); font-size: 12px; }
.reviews-list { display: grid; gap: 9px; }
.review-card { display: grid; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-solid); }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-head a { min-width: 0; display: flex; align-items: center; gap: 9px; }
.review-head a span { min-width: 0; display: grid; gap: 2px; }
.review-head small { color: var(--muted); }
.review-card p { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }

.my-product { overflow: hidden; box-shadow: none; }
.my-product > a { display: grid; grid-template-columns: auto 1fr 20px; align-items: center; gap: 11px; padding: 11px; }
.my-product > a > div:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.my-product > a strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.my-product > a span { color: var(--muted); font-size: 11px; }
.product-status { width: fit-content; padding: 3px 7px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.product-status.active { background: var(--success-soft); color: var(--success); }
.product-status.reserved { background: var(--warning-soft); color: var(--warning); }
.product-status.sold, .product-status.hidden { background: var(--surface-2); color: var(--muted); }
.my-product-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 0 11px 11px; }

.rules-lock { margin: 0 0 12px; }
.rules-list { display: grid; gap: 9px; }
.rule-card { display: grid; grid-template-columns: 46px 1fr; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-solid); }
.rule-card > span { width: 42px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 900; }
.rule-card div { display: grid; gap: 5px; }
.rule-card strong { font-size: 13px; }
.rule-card p { color: var(--muted); font-size: 12px; line-height: 1.45; }

.deal-screen { min-height: 100vh; padding-bottom: 82px; }
.deal-head { position: sticky; z-index: 45; top: 0; display: flex; align-items: center; gap: 10px; padding: max(9px,env(safe-area-inset-top)) 12px 9px; border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--bg) 92%,transparent); backdrop-filter: blur(25px); }
.deal-head-title { min-width: 0; flex: 1; display: grid; gap: 2px; }
.deal-head-title strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.deal-head-title span { color: var(--muted); font-size: 11px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 5px var(--warning-soft); }
.status-dot.disputed, .status-dot.payment_rejected { background: var(--danger); box-shadow: 0 0 0 5px var(--danger-soft); }
.status-dot.completed { background: var(--success); box-shadow: 0 0 0 5px var(--success-soft); }
.participants { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,220px),1fr)); gap: 8px; padding: 11px 12px 2px; }
.participants > a { min-width: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-solid); }
.participants > a > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.participants small { color: var(--muted); }
.participants strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.participants .user-badge { max-width: 90px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.participants .admin-person { border-color: rgba(200,45,45,.3); background: var(--danger-soft); }
.deal-summary { margin: 11px 12px; padding: 13px; box-shadow: none; }
.deal-product { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.deal-product-copy { min-width: 0; display: grid; gap: 4px; }
.deal-product-copy strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.deal-product-copy span { color: var(--muted); font-size: 12px; }
.deal-state { display: grid; gap: 4px; padding-top: 12px; }
.deal-state span { color: var(--muted); font-size: 11px; }
.action-card { display: grid; gap: 11px; margin: 0 12px 11px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); }
.success-card { display: grid; gap: 5px; margin: 0 12px 11px; padding: 13px; border: 1px solid rgba(24,121,78,.22); border-radius: 17px; background: var(--success-soft); color: var(--success); }
.success-card p { color: var(--text); font-size: 12px; line-height: 1.4; }
.review-done { margin-top: 0; }
.payment-panel { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface-2); word-break: break-word; }
.payment-panel > span { color: var(--muted); font-size: 11px; }
.payment-panel strong { font-size: 20px; }
.payment-panel p { color: var(--text); font-size: 12px; line-height: 1.45; }
.chat-block { padding: 0 12px; }
.chat-label { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 18px 1px 11px; }
.chat-label span { font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.chat-label small { color: var(--muted); }
.messages { display: grid; gap: 8px; }
.message-row { display: flex; align-items: flex-end; gap: 7px; }
.message-row.own { justify-content: flex-end; }
.bubble { max-width: min(82%,520px); padding: 9px 11px 7px; border: 1px solid var(--line); border-radius: 17px 17px 17px 5px; background: var(--surface-solid); }
.message-row.own .bubble { border-color: transparent; border-radius: 17px 17px 5px 17px; background: var(--text); color: var(--bg); }
.bubble p { line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.bubble small { display: block; margin-top: 4px; opacity: .58; font-size: 9px; text-align: right; }
.bubble-name { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 800; }
.admin-bubble { border-color: rgba(200,45,45,.28); background: var(--danger-soft); color: var(--text); }
.admin-tag { display: inline-flex; margin-bottom: 4px; padding: 3px 6px; border-radius: 5px; background: var(--danger); color: white; font-size: 8px; font-weight: 950; letter-spacing: .05em; }
.system-message { justify-self: center; max-width: 94%; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 10px; line-height: 1.4; text-align: center; }
.system-message.arbitration-open { padding: 10px; border: 1px solid rgba(200,45,45,.28); background: var(--danger-soft); color: var(--danger); }
.system-message.arbitration-closed { padding: 10px; border: 1px solid rgba(24,121,78,.24); background: var(--success-soft); color: var(--success); }
.system-message .arbitration-label { margin: 0 auto 6px; }
.chat-composer { position: fixed; z-index: 60; left: 50%; bottom: 0; width: min(100%,760px); transform: translateX(-50%); display: grid; grid-template-columns: 1fr 46px; gap: 8px; padding: 8px 10px max(8px,env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb,var(--bg) 94%,transparent); backdrop-filter: blur(25px); }
.chat-composer input { min-width: 0; border: 1px solid var(--line-strong); border-radius: 15px; padding: 11px 13px; outline: 0; background: var(--surface-solid); color: var(--text); }
.chat-composer button { width: 46px; height: 46px; display: grid; place-items: center; border: 0; border-radius: 15px; background: var(--text); color: var(--bg); }
.inline-error { margin: 0 12px 10px; }
.dispute-button { width: 100%; margin-top: 14px; }
.arbitration-label { display: inline-flex; align-items: center; width: fit-content; min-height: 20px; padding: 0 7px; border-radius: 5px; font-size: 9px; font-weight: 950; letter-spacing: .06em; }
.arbitration-label.active { background: var(--danger); color: white; }
.arbitration-label.resolved { background: var(--success); color: white; }
.arbitration-banner { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; margin: 11px 12px; padding: 13px; border-radius: 17px; }
.arbitration-banner.open { border: 1px solid rgba(200,45,45,.3); background: var(--danger-soft); }
.arbitration-banner.resolved { border: 1px solid rgba(24,121,78,.26); background: var(--success-soft); }
.arbitration-banner div { display: grid; gap: 4px; }
.arbitration-banner p { color: var(--text); font-size: 12px; line-height: 1.4; }

.admin-tabs { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; padding: 5px; margin-bottom: 12px; border-radius: 16px; background: var(--surface-2); }
.admin-tabs button { min-width: 0; min-height: 48px; display: grid; place-items: center; gap: 2px; padding: 4px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); }
.admin-tabs button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.admin-tabs button strong { font-size: 15px; }
.admin-tabs button.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 5px 14px rgba(0,0,0,.06); }
.admin-card { display: grid; gap: 10px; padding: 13px; box-shadow: none; }
.admin-card-main { display: flex; justify-content: space-between; gap: 11px; }
.admin-card-main > div { min-width: 0; display: grid; gap: 4px; }
.admin-card-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-card-main small { color: var(--muted); }

.onboarding { min-height: 100vh; width: min(100%,520px); margin: 0 auto; display: grid; align-content: center; gap: 17px; padding: 28px 16px; }
.onboarding-copy { line-height: 1.48; }

.empty { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 24px; color: var(--muted); text-align: center; }
.empty-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 16px; background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 950; }
.empty strong { color: var(--text); }
.empty span { max-width: 280px; font-size: 12px; line-height: 1.4; }

#overlay-root { position: relative; z-index: 200; }
.modal-backdrop { position: fixed; inset: 0; display: grid; align-items: end; padding: 12px; background: rgba(7,7,7,.42); backdrop-filter: blur(8px); animation: fadeIn .18s ease; }
.modal-sheet { width: min(100%,520px); max-height: min(88vh,760px); overflow: auto; margin: 0 auto max(0px,env(safe-area-inset-bottom)); padding: 17px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface-solid); box-shadow: 0 26px 90px rgba(0,0,0,.30); animation: sheetIn .24s cubic-bezier(.2,.9,.2,1); }
.modal-sheet.wide { width: min(100%,680px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.modal-head > div { display: grid; gap: 6px; }
.modal-head p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.modal-actions { display: grid; gap: 8px; margin-top: 14px; }
.modal-scroll { max-height: 58vh; overflow: auto; padding-right: 2px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(28px); opacity: .6; } }
.toast-stack { position: fixed; z-index: 300; left: 50%; top: max(12px,env(safe-area-inset-top)); width: min(calc(100% - 22px),520px); transform: translateX(-50%); display: grid; gap: 7px; pointer-events: none; }
.toast { padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow); font-size: 12px; animation: toastIn .2s ease; }
.toast.error { border-color: rgba(200,45,45,.28); color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

@media (min-width: 680px) {
  .page:not(.detail) { padding-left: 20px; padding-right: 20px; }
  .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .hero { border-radius: 0 0 28px 28px; }
  .detail-copy { padding-left: 24px; padding-right: 24px; }
  .participants { padding-left: 18px; padding-right: 18px; }
  .deal-summary, .action-card, .success-card, .arbitration-banner { margin-left: 18px; margin-right: 18px; }
  .chat-block { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 370px) {
  .page { padding-left: 10px; padding-right: 10px; }
  .product-grid { gap: 8px; }
  .product-copy { padding: 9px; }
  .product-copy h3 { font-size: 14px; }
  .price-pill { font-size: 12px; }
  .search-row { grid-template-columns: 1fr; }
  .search-button { min-height: 44px; }
  .button-row, .sticky-cta.two { grid-template-columns: 1fr; }
  .admin-tabs { grid-template-columns: repeat(2,1fr); }
  .public-profile { align-items: flex-start; }
}

@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled), .menu-row:hover, .deal-row:hover { filter: brightness(.97); }
}
