:root {
  --bg: #0d0f14;
  --bg-elev: #141821;
  --bg-elev2: #1b2130;
  --bg-elev3: #222a3b;
  --border: #272f41;
  --border-soft: #1e2431;
  --text: #e9edf5;
  --muted: #8b95a9;
  --accent: #ff7a1a;
  --accent-2: #ffb020;
  --teal: #21d4c4;
  --own: #8b7bff;
  --danger: #ff4d5e;
  --grad: linear-gradient(135deg, #ff7a1a, #ffb020);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --topbar-h: 64px;
  --rail-w: 82px;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 0.6em; line-height: 1.2; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.hide-sm { display: inline; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2b3446; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: var(--bg-elev2); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600;
  transition: 0.16s ease; white-space: nowrap; cursor: pointer;
}
.btn:hover { border-color: #39435a; transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn--primary { background: var(--grad); border-color: transparent; color: #1c1206; box-shadow: 0 6px 18px rgba(255, 122, 26, 0.28); }
.btn--primary:hover { box-shadow: 0 8px 24px rgba(255, 122, 26, 0.4); }
.btn--ghost { background: transparent; }
.btn--danger { background: rgba(255, 77, 94, 0.12); border-color: rgba(255, 77, 94, 0.4); color: #ff8b97; }
.btn--sm { padding: 6px 12px; font-size: 0.82rem; }
.btn--block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--bg-elev2); color: var(--text);
  transition: 0.15s; cursor: pointer;
}
.icon-btn:hover { border-color: #39435a; background: var(--bg-elev3); }
.icon-btn--danger { color: #ff8b97; }
.icon-btn--danger:hover { background: rgba(255, 77, 94, 0.14); }

/* Layout */
.app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: rgba(17, 20, 28, 0.92); border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px); z-index: 1200;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.18rem; font-weight: 700; letter-spacing: -0.02em; }
.brand__text b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topsearch {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 9px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; padding: 0 16px; color: var(--muted);
}
.topsearch input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); padding: 10px 0; font-size: 0.92rem; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.usermenu { position: relative; }
.usermenu__trigger { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 0.9rem; }
.usermenu__drop {
  position: absolute; right: 0; top: calc(100% + 10px); background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px; min-width: 190px; display: none; flex-direction: column;
  box-shadow: var(--shadow); z-index: 100;
}
.usermenu__drop::before {
  content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px;
}
.usermenu:hover .usermenu__drop, .usermenu__drop:hover { display: flex; }
.usermenu__drop a, .usermenu__drop button {
  text-align: left; padding: 9px 12px; border-radius: 8px; border: none; background: transparent;
  color: var(--text); font-size: 0.88rem; cursor: pointer;
}
.usermenu__drop a:hover, .usermenu__drop button:hover { background: var(--bg-elev3); }

.shell { flex: 1; display: flex; min-height: 0; }
.rail {
  width: var(--rail-w); flex-shrink: 0; background: var(--bg-elev); border-right: 1px solid var(--border-soft);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto;
}
.rail__item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px;
  border-radius: var(--radius-sm); color: var(--muted); font-size: 0.68rem; font-weight: 600; text-align: center; transition: 0.15s;
}
.rail__item:hover { background: var(--bg-elev2); color: var(--text); }
.rail__item.is-active { background: rgba(255, 122, 26, 0.12); color: var(--accent); }
.rail__item--accent { color: var(--accent); }
.rail__dot {
  position: absolute; top: 6px; right: 12px; background: var(--danger); color: #fff; font-size: 0.62rem;
  font-style: normal; font-weight: 700; border-radius: 999px; padding: 1px 5px;
}
.content { flex: 1; min-width: 0; min-height: 0; overflow: auto; position: relative; }

/* Cards */
.card {
  display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: var(--radius); overflow: hidden; transition: 0.16s ease; flex: 0 0 auto;
}
.card:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow); }
.card--selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card--own { border-color: rgba(139, 123, 255, 0.55); }
.card--own:hover { border-color: var(--own); }
.card__media { position: relative; aspect-ratio: 16 / 10; background: var(--bg-elev2); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 2rem; }
.card__placeholder--offer { background: radial-gradient(circle at 30% 20%, rgba(255, 122, 26, 0.22), transparent 60%), var(--bg-elev2); }
.card__placeholder--request { background: radial-gradient(circle at 30% 20%, rgba(33, 212, 196, 0.2), transparent 60%), var(--bg-elev2); }
.card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; }
.card__price { font-size: 1.12rem; font-weight: 800; color: var(--accent-2); }
.card__title { margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; background: rgba(255, 122, 26, 0.14); color: var(--accent-2); border: 1px solid rgba(255, 122, 26, 0.24); }
.tag--muted { background: var(--bg-elev2); color: var(--muted); border-color: var(--border-soft); }
.card__meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--muted); }
.card__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.card__distance { color: var(--teal); margin-left: 4px; }
.card__owner { display: flex; align-items: center; gap: 7px; padding-top: 8px; border-top: 1px solid var(--border-soft); font-size: 0.8rem; }
.card__owner-name { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge--offer { background: rgba(255, 122, 26, 0.16); color: #ffa451; }
.badge--request { background: rgba(33, 212, 196, 0.16); color: var(--teal); }
.badge--urgent { background: rgba(255, 77, 94, 0.18); color: #ff8b97; }
.badge--closed { background: #2a3040; color: var(--muted); }
.badge--own { background: rgba(139, 123, 255, 0.18); color: var(--own); }
.card__media .badge { position: absolute; top: 9px; left: 9px; backdrop-filter: blur(6px); }
.card__media .badge--urgent { left: auto; right: 9px; }
.card__media .badge--own { top: auto; bottom: 9px; left: 9px; }

/* Stars */
.stars { display: inline-flex; align-items: center; gap: 2px; color: #ffb020; }
.star { border: none; background: none; padding: 0; color: #3b4356; display: inline-flex; font-size: 0.95rem; line-height: 1; }
.star--on { color: #ffb020; }
.stars--interactive .star { cursor: pointer; }
.stars__value { margin-left: 5px; font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.stars__count { font-weight: 400; }

/* Avatar */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar--text { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; border: 1px solid; }

/* Filters */
.filters { padding: 14px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; flex-shrink: 0; max-height: 62%; border-bottom: 1px solid var(--border-soft); }
.filters__search { display: flex; align-items: center; gap: 9px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; color: var(--muted); }
.filters__search input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); padding: 10px 0; font-size: 0.88rem; }
.segmented { display: flex; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.segmented button { flex: 1; border: none; background: transparent; color: var(--muted); padding: 7px 4px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; }
.segmented button.is-active { background: var(--bg-elev3); color: var(--text); }
.filters__group { display: flex; flex-direction: column; gap: 7px; }
.filters__group--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters__label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.filters__label b { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted); padding: 5px 10px; border-radius: 999px; font-size: 0.76rem; transition: 0.14s; }
.chip:hover { border-color: #39435a; color: var(--text); }
.chip--on { background: rgba(255, 122, 26, 0.16); border-color: rgba(255, 122, 26, 0.5); color: #ffa451; }
.filters__price { display: flex; align-items: center; gap: 8px; }
.filters__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filters__actions .is-dirty { border-color: var(--accent); color: var(--accent); }
.filters__count { font-size: 0.82rem; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--border-soft); }
.filters__count b { color: var(--text); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea,
.filters input, .filters select, .filters__price input {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 9px 11px; font-size: 0.86rem; outline: none; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
input[type='range'] { accent-color: var(--accent); width: 100%; }

/* Explorer (map page) */
.explorer { height: 100%; display: flex; }
.explorer__side { width: 372px; flex-shrink: 0; border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; background: var(--bg); min-height: 0; }
.explorer__results { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.explorer__results > * { flex-shrink: 0; }
.explorer__map { flex: 1; position: relative; min-width: 0; }
.map { width: 100%; height: 100%; }
.map-wrap { position: relative; width: 100%; height: 100%; }
.map-attribution {
  position: absolute; right: 6px; bottom: 6px; z-index: 500; font-size: 10px; color: var(--muted);
  background: rgba(13, 15, 20, 0.6); padding: 2px 6px; border-radius: 6px; pointer-events: none;
}
.map--clickable { cursor: crosshair; }
.map-fab {
  position: absolute; left: 14px; bottom: 24px; z-index: 500; display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text); padding: 9px 14px;
  border-radius: 999px; font-size: 0.84rem; font-weight: 600; box-shadow: var(--shadow); cursor: pointer;
}
.map-fab:hover { border-color: var(--accent); }
/* Leaflet markers */
.pmp-marker-wrap { cursor: pointer; }
.pmp-marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.pmp-marker__label { background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text); font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45); }
.pmp-marker__pin { width: 15px; height: 15px; margin-top: -3px; background: var(--accent); border: 2px solid #0d0f14; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.pmp-marker--request .pmp-marker__pin { background: var(--teal); }
.pmp-marker.is-own .pmp-marker__pin { background: var(--own); box-shadow: 0 0 0 2px rgba(139, 123, 255, 0.45), 0 6px 16px rgba(0, 0, 0, 0.5); }
.pmp-marker.is-own .pmp-marker__label { border-color: var(--own); }
.pmp-marker.is-selected .pmp-marker__label { background: var(--accent); color: #1c1206; border-color: transparent; }
.pmp-marker.is-selected .pmp-marker__pin { transform: rotate(-45deg) scale(1.25); }
.pmp-pin { width: 22px; height: 22px; background: var(--accent); border: 3px solid #0d0f14; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5); }

.maplibregl-map { font-family: inherit; background: #0a0c10; }
.maplibregl-popup-content {
  background: var(--bg-elev2); color: var(--text); border-radius: 12px;
  border: 1px solid var(--border); box-shadow: var(--shadow); padding: 12px 14px;
}
.maplibregl-popup-tip { border-top-color: var(--bg-elev2) !important; border-bottom-color: var(--bg-elev2) !important; }
.maplibregl-popup-close-button { color: var(--muted) !important; font-size: 18px; padding: 2px 6px; }
.popup { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.popup__title { font-size: 0.92rem; line-height: 1.25; }
.popup__price { color: var(--accent-2); font-weight: 800; }
.popup__row { display: flex; gap: 8px; font-size: 0.76rem; color: var(--muted); }
.popup__btn { margin-top: 4px; }

/* List page */
.list-page { display: flex; min-height: 100%; }
.list-page__side { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border-soft); background: var(--bg-elev); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.list-page__side .filters { max-height: none; border-bottom: none; }
.list-page__results { flex: 1; padding: 20px 24px 60px; min-width: 0; }
.list-page__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.skeleton-card { height: 300px; flex: 0 0 auto; border-radius: var(--radius); background: linear-gradient(100deg, var(--bg-elev) 30%, var(--bg-elev2) 50%, var(--bg-elev) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-list { display: flex; flex-direction: column; gap: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty--page { height: 70vh; justify-content: center; }
.page-loading { padding: 60px; text-align: center; color: var(--muted); }

/* Forms */
.form-page { padding: 24px; display: flex; justify-content: center; }
.listing-form { width: 100%; max-width: 820px; display: flex; flex-direction: column; gap: 18px; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted); text-align: left; transition: 0.15s; }
.type-card b { color: var(--text); font-size: 1.02rem; }
.type-card span { font-size: 0.82rem; }
.type-card:hover { border-color: #39435a; }
.type-card.is-active { border-color: var(--accent); background: rgba(255, 122, 26, 0.08); box-shadow: 0 0 0 1px var(--accent); }
.form-section { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.form-section h2 { color: var(--accent-2); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-bottom: 40px; }
.form-error { background: rgba(255, 77, 94, 0.12); border: 1px solid rgba(255, 77, 94, 0.4); color: #ff8b97; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.86rem; }
.hint { font-size: 0.76rem; color: var(--muted); margin: 0; }

/* Uploader */
.uploader__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.uploader__item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.uploader__item img { width: 100%; height: 100%; object-fit: cover; }
.uploader__remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 7px; border: none; background: rgba(0, 0, 0, 0.65); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.uploader__add { aspect-ratio: 1; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 0.78rem; cursor: pointer; }
.uploader__add:hover { border-color: var(--accent); color: var(--accent); }

/* Location picker */
.locpicker { display: flex; flex-direction: column; gap: 10px; }
.locpicker__search { position: relative; display: flex; align-items: center; gap: 9px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; color: var(--muted); }
.locpicker__search input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); padding: 10px 0; font-size: 0.86rem; }
.locpicker__suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; list-style: none; margin: 0; padding: 6px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm); z-index: 800; max-height: 240px; overflow-y: auto; box-shadow: var(--shadow); }
.locpicker__suggest button { width: 100%; text-align: left; border: none; background: transparent; color: var(--text); padding: 8px 10px; border-radius: 7px; font-size: 0.82rem; cursor: pointer; }
.locpicker__suggest button:hover { background: var(--bg-elev3); }
.locpicker__map { position: relative; height: 320px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; padding: 24px; max-width: 1200px; margin: 0 auto; }
.detail__main { min-width: 0; }
.detail__head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.detail__views { margin-left: auto; font-size: 0.78rem; color: var(--muted); }
.detail__title { font-size: 1.7rem; margin-bottom: 8px; }
.detail__price { font-size: 1.7rem; font-weight: 800; color: var(--accent-2); margin-bottom: 18px; }
.gallery { margin-bottom: 20px; }
.gallery__main { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border-soft); background: var(--bg-elev); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: flex; gap: 9px; margin-top: 10px; overflow-x: auto; }
.gallery__thumbs button { width: 78px; height: 60px; border-radius: 9px; overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--bg-elev); flex-shrink: 0; cursor: pointer; }
.gallery__thumbs button.is-active { border-color: var(--accent); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail__specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.detail__specs > div { display: flex; flex-direction: column; gap: 3px; }
.detail__specs span { font-size: 0.74rem; color: var(--muted); }
.detail__specs b { font-size: 0.9rem; }
.detail__description, .detail__location { margin-bottom: 20px; }
.detail__description p { color: #c7cede; line-height: 1.6; white-space: pre-wrap; }
.detail__location h2 { display: flex; align-items: center; gap: 7px; }
.detail__location p { color: var(--muted); margin: 0 0 10px; }
.detail__side { display: flex; flex-direction: column; gap: 16px; }
.owner-card { display: flex; align-items: center; gap: 14px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; }
.owner-card__info { display: flex; flex-direction: column; gap: 4px; }
.owner-card__name { font-weight: 700; font-size: 1.05rem; }
.respond, .owner-actions, .reviews-block { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.respond textarea { width: 100%; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px; font-family: inherit; font-size: 0.88rem; resize: vertical; outline: none; }
.respond textarea:focus { border-color: var(--accent); }
.reviews-block__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reviews-block__head h3 { margin: 0; }
.review { display: flex; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.review:first-of-type { border-top: none; padding-top: 0; }
.review__top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.review p { margin: 0 0 3px; font-size: 0.86rem; color: #c7cede; line-height: 1.45; }
.review span.muted { font-size: 0.72rem; }
.review--wide { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px; }
.review-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.review-form textarea { width: 100%; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 10px 12px; font-family: inherit; resize: vertical; outline: none; }
.detail__similar { grid-column: 1 / -1; margin-top: 10px; }

/* Profile */
.profile { padding: 24px; max-width: 1000px; margin: 0 auto; }
.profile__head { display: flex; gap: 20px; align-items: flex-start; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.profile__info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.profile__info h1 { margin: 0; }
.profile__meta { display: flex; gap: 16px; font-size: 0.82rem; color: var(--muted); }
.profile__meta span { display: inline-flex; align-items: center; gap: 5px; }
.profile__bio { margin: 4px 0 0; color: #c7cede; line-height: 1.5; }
.profile__phone { margin: 0; color: var(--teal); font-weight: 600; }
.profile__edit { background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border-soft); margin-bottom: 18px; }
.tabs button { border: none; background: transparent; color: var(--muted); padding: 10px 14px; font-size: 0.9rem; font-weight: 600; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button.is-active { color: var(--text); border-bottom-color: var(--accent); }
.reviews-list { display: flex; flex-direction: column; gap: 12px; }

/* Messages */
.messages { display: flex; height: 100%; }
.messages__list { width: 320px; flex-shrink: 0; border-right: 1px solid var(--border-soft); overflow-y: auto; padding: 14px; }
.messages__list h2 { margin: 6px 4px 14px; }
.convo { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-sm); transition: 0.14s; }
.convo:hover { background: var(--bg-elev); }
.convo.is-active { background: var(--bg-elev2); }
.convo__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.convo__top { display: flex; align-items: center; gap: 8px; }
.convo__badge { margin-left: auto; background: var(--accent); color: #1c1206; font-size: 0.68rem; font-weight: 800; font-style: normal; border-radius: 999px; padding: 1px 7px; }
.convo__listing { font-size: 0.72rem; color: var(--accent-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo__last { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages__thread { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread__head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.thread__listing { display: block; font-size: 0.78rem; color: var(--accent-2); }
.thread__messages { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble { align-self: flex-start; max-width: 72%; background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: 14px 14px 14px 4px; padding: 9px 13px; font-size: 0.88rem; line-height: 1.45; }
.bubble--mine { align-self: flex-end; background: rgba(255, 122, 26, 0.14); border-color: rgba(255, 122, 26, 0.3); border-radius: 14px 14px 4px 14px; }
.bubble__price { margin-top: 6px; font-weight: 700; color: var(--accent-2); }
.bubble__time { display: block; margin-top: 4px; font-size: 0.68rem; color: var(--muted); text-align: right; }
.thread__form { display: flex; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--border-soft); }
.thread__form input { flex: 1; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); padding: 10px 13px; outline: none; font-size: 0.88rem; }
.thread__form input:focus { border-color: var(--accent); }
.thread__price { max-width: 90px; flex: none !important; }

/* My listings */
.my-listings { padding: 24px; max-width: 1000px; margin: 0 auto; }
.my-list { display: flex; flex-direction: column; gap: 10px; }
.my-list__row { display: flex; align-items: center; gap: 14px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px 16px; }
.my-list__row.is-closed { opacity: 0.6; }
.my-list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.my-list__title { font-weight: 600; }
.my-list__title:hover { color: var(--accent); }
.my-list__body .muted { font-size: 0.78rem; }
.my-list__actions { display: flex; align-items: center; gap: 8px; }
.status { font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.status--active { background: rgba(33, 212, 196, 0.14); color: var(--teal); }
.status--closed { background: #2a3040; color: var(--muted); }

/* Auth */
.auth { min-height: 100%; display: grid; grid-template-columns: 1fr 1fr; }
.auth__brand { background: radial-gradient(circle at 20% 20%, rgba(255, 122, 26, 0.2), transparent 55%), radial-gradient(circle at 80% 80%, rgba(33, 212, 196, 0.14), transparent 50%), var(--bg-elev); display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 60px; border-right: 1px solid var(--border-soft); }
.auth__brand h1 { font-size: 2.4rem; }
.auth__brand h1 b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__brand p { color: var(--muted); max-width: 340px; line-height: 1.5; }
.auth__form { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 60px; max-width: 460px; width: 100%; margin: 0 auto; }
.auth__form h2 { font-size: 1.5rem; }
.auth__hint { font-size: 0.8rem; color: var(--muted); background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
.auth__switch { font-size: 0.86rem; color: var(--muted); text-align: center; }
.auth__switch a { color: var(--accent); font-weight: 600; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(5, 7, 11, 0.7); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 3000; padding: 20px; }
.modal { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; box-shadow: var(--shadow); max-height: 90vh; display: flex; flex-direction: column; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.modal__head h3 { margin: 0; }
.modal__body { padding: 18px; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border-soft); }

.validation-message { color: #ff8b97; font-size: 0.78rem; }

/* Responsive */
@media (max-width: 1080px) {
  .detail { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .hide-sm { display: none; }
  .rail { width: 62px; }
  .rail__item span { font-size: 0.6rem; }
  .explorer { flex-direction: column; }
  .explorer__side { width: 100%; max-height: 48%; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .explorer__map { min-height: 300px; }
  .list-page { flex-direction: column; }
  .list-page__side { width: 100%; height: auto; position: static; }
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .messages__list { width: 120px; }
  .messages__list .convo__last, .messages__list .convo__listing { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .my-list__row { flex-wrap: wrap; }
}
