/* ========================================================================
   Telegram-themed real estate mockup — base styles
   ======================================================================== */

/* Visually hidden but accessible to screen readers. */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link — only visible when focused. */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--tg-blue);
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  z-index: 10000;
  text-decoration: none;
}
.skip-link:focus {
  top: 8px;
}

/* ----- Focus-visible — keyboard-only focus indicator ----- */
/*
 * Browsers strip default outlines on a lot of our custom controls. Restore
 * a visible ring whenever the user is navigating via keyboard. The :focus
 * (no -visible) selector is intentionally NOT styled, so mouse clicks don't
 * leave persistent rings.
 */
:focus-visible {
  outline: 2px solid var(--tg-blue);
  outline-offset: 2px;
}
/* Buttons and chips have backgrounds — outline-offset keeps the ring outside the shape. */
button:focus-visible,
.chip:focus-visible,
.side-act:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.icon-btn-dark:focus-visible,
.filter-trigger:focus-visible,
.chat-item:focus-visible,
.cab-tab:focus-visible,
.subcat:focus-visible,
.op-tab:focus-visible,
.lang-dd__item:focus-visible,
.loc-dd__item:focus-visible {
  outline: 2px solid var(--tg-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(42, 171, 238, 0.18);
}
/* Anchors used as cards — keep the ring close to the rounded corner. */
a.listing:focus-visible,
a.home-cat:focus-visible,
a.home-top-cat:focus-visible {
  outline: 2px solid var(--tg-blue);
  outline-offset: 3px;
}

:root {
  /* Telegram palette */
  --tg-blue:        #2AABEE;
  --tg-blue-dark:   #229ED9;
  --tg-blue-darker: #1E96CC;
  --tg-blue-light:  #EFF7FE;
  --tg-blue-lighter:#F4F9FD;
  --tg-accent:      #54A9EB;

  /* Neutrals */
  --text:           #0F1419;
  --text-secondary: #707579;
  --text-muted:     #A2ACB0;
  --border:         #E5E9EE;
  --border-light:   #F0F3F5;
  --bg:             #FFFFFF;
  --bg-alt:         #F4F4F5;
  --bg-soft:        #FAFBFC;
  /* Page canvas — softer than --bg so elevated surfaces (.section-head,
     .listing, .home-v2 cards) visually "lift" off the page. */
  --bg-canvas:      #E7EBF1;
  --bg-hover:       #D6DDE7;
  --border-soft:    #DDE3EB;
  --header-blur:    rgba(231, 235, 241, 0.78);

  /* Semantic */
  --success: #4DCD5E;
  --warning: #FFA426;
  --danger:  #E53935;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(42, 171, 238, 0.08);
  --shadow-lg: 0 8px 24px rgba(42, 171, 238, 0.12);

  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 999px;
}

/* ====== Dark theme ====== */
:root[data-theme="dark"] {
  --text:           #E8EAED;  /* contrast 14.9:1 on --bg → AAA */
  --text-secondary: #B6BCC4;  /* contrast 8.7:1  on --bg → AAA (was #9AA0A6 = 6.4:1) */
  --text-muted:     #9098A0;  /* contrast 5.4:1  on --bg → AA  (was #6B7177 = 3.5:1, FAIL) */
  --border:         #2A2F36;
  --border-light:   #232830;
  --bg:             #17212B;  /* Telegram-card grey, slightly lifted off the navy canvas */
  --bg-alt:         #1E2A36;
  --bg-soft:        #1C2733;
  --bg-canvas:      #0E1621;  /* Telegram-navy canvas */
  --bg-hover:       #232E3C;
  --border-soft:    #1C2733;
  --header-blur:    rgba(14, 22, 33, 0.78);
  --tg-blue-light:  #1B2A3C;
  --tg-blue-lighter:#1A222C;
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}
/* Dark-theme .topbar background is driven by --header-blur (set above).
   The old blue gradient is intentionally removed to match the translucent
   canvas look. */
:root[data-theme="dark"] .listing,
:root[data-theme="dark"] .item-section,
:root[data-theme="dark"] .item-side,
:root[data-theme="dark"] .filters,
:root[data-theme="dark"] .cab-sidebar,
:root[data-theme="dark"] .cab-card,
:root[data-theme="dark"] .profile-card,
:root[data-theme="dark"] .wizard,
:root[data-theme="dark"] .chat,
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .home-cat,
:root[data-theme="dark"] .home-op,
:root[data-theme="dark"] .modal {
  background: var(--bg);
  border-color: var(--border);
}
:root[data-theme="dark"] .item-side__price { color: var(--text); }
:root[data-theme="dark"] .msg--them .msg__bubble {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}
:root[data-theme="dark"] .chat__msgs { background: #0E1115; }
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .select { background: var(--bg-alt); border-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .filter-chip { background: var(--bg-alt); border-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .stub,
:root[data-theme="dark"] .empty-result { background: var(--bg); border-color: var(--border); }

/* Topbar dropdowns: white panels invisible on dark — swap to themed bg + border. */
:root[data-theme="dark"] .loc-dd__menu,
:root[data-theme="dark"] .lang-dd__menu {
  background: var(--bg);
  box-shadow: 0 16px 40px rgba(0,0,0,0.55), 0 0 0 1px var(--border);
}
:root[data-theme="dark"] .loc-dd__panel--countries { border-right-color: var(--border); }
:root[data-theme="dark"] .loc-dd__divider          { background: var(--border); }
:root[data-theme="dark"] .loc-dd__item.active,
:root[data-theme="dark"] .lang-dd__item.active {
  color: var(--tg-blue);   /* light blue text reads cleanly on dark-blue tint */
}

/* ====== Dark theme: admin surfaces & misc panels ======
   Many admin/cabinet/chat panels have hardcoded `background: #fff` that turn
   into glaring white slabs on a dark page. Route them all to themed bg/border
   so digits, labels and words stay legible in both modes. */
:root[data-theme="dark"] .admin-filters,
:root[data-theme="dark"] .admin-table-wrap,
:root[data-theme="dark"] .admin-login__card,
:root[data-theme="dark"] .tile,
:root[data-theme="dark"] .mod-item,
:root[data-theme="dark"] .cab-listing,
:root[data-theme="dark"] .profile-grid,
:root[data-theme="dark"] .chat,
:root[data-theme="dark"] .chat__input {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}
:root[data-theme="dark"] .admin-table th {
  background: var(--bg-alt);
  color: var(--text-secondary);
  border-bottom-color: var(--border);
}
:root[data-theme="dark"] .admin-table td       { border-bottom-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .admin-table tr:hover td { background: var(--bg-alt); }
:root[data-theme="dark"] .log-row,
:root[data-theme="dark"] .feed-item,
:root[data-theme="dark"] .content-row {
  background: var(--bg-alt);
}
/* Sidebar text is fine on its own dark slab, but the muted #9AA0A6 in
   `--text-muted`-tinted helpers needs a bump for "BANGKOK 02:31" subtitles. */
:root[data-theme="dark"] .admin-link        { color: #C8CDD3; }   /* was #9AA0A6 → 9.5:1 on #1A1F26 */
/* lang-tag in dark mode: #229ED9 on #1B2A3C ≈ 3.4:1 — fails AA for small text.
   Bump text to a lighter blue. */
:root[data-theme="dark"] .lang-tag { color: var(--tg-accent); }

/* Status/risk/log/flag badges: dark-on-light tints fail dark-mode contrast.
   Keep the semantic tint, swap text to a lighter saturated tone. */
:root[data-theme="dark"] .risk--low,
:root[data-theme="dark"] .status--active,
:root[data-theme="dark"] .log-level--info,
:root[data-theme="dark"] .flag-tag--ok {
  background: rgba(77,205,94,0.22);
  color: #7FE38B;   /* ≈ 7.4:1 on dark bg */
}
:root[data-theme="dark"] .risk--med,
:root[data-theme="dark"] .status--pending,
:root[data-theme="dark"] .log-level--warn {
  background: rgba(255,164,38,0.22);
  color: #FFC783;   /* ≈ 9.0:1 on dark bg */
}
:root[data-theme="dark"] .risk--high,
:root[data-theme="dark"] .status--blocked,
:root[data-theme="dark"] .log-level--error,
:root[data-theme="dark"] .flag-tag {
  background: rgba(229,57,53,0.25);
  color: #FF8983;   /* ≈ 6.1:1 on dark bg */
}
/* Verified badge (.vb) in cabinet — green tint inherits hardcoded dark green. */
:root[data-theme="dark"] .vb { color: #7FE38B; }

/* Tiles' value digits use --text by default — already themed, but the delta
   row uses a hardcoded green-success on light tint. Keep a light variant. */
:root[data-theme="dark"] .tile__delta { color: #7FE38B; }

/* Cabinet sidebar and cards already get bg via the top dark-mode block, but
   the listing rows, sessions and similar surfaces with hardcoded #fff need it
   too. The `.cab-listing` already in the block above covers most rows; here
   we cover the rest that were missed. */
:root[data-theme="dark"] .session-item { border-bottom-color: var(--border); }
:root[data-theme="dark"] .chat__head,
:root[data-theme="dark"] .chat__list,
:root[data-theme="dark"] .chat__list-head,
:root[data-theme="dark"] .chat__quick,
:root[data-theme="dark"] .chat-item {
  border-color: var(--border);
}
:root[data-theme="dark"] .chat-item:hover  { background: var(--bg-alt); }
:root[data-theme="dark"] .chat-item.active { background: var(--tg-blue-light); }

/* ====== Light theme: bump badge contrast slightly too ======
   Original tints at 0.15 + #C62828/#B0701A/#2D9D43 on white are ~4.5–5.5:1.
   Strengthen the dark text a notch for better readability on small labels. */
.risk--high,  .status--blocked, .log-level--error, .flag-tag        { color: #A11B19; }
.risk--med,   .status--pending, .log-level--warn                    { color: #8A4A0A; }
.risk--low,   .status--active,  .log-level--info, .flag-tag--ok     { color: #1E7E32; }

/* White ring around avatar online dot + map price markers reads as a glaring
   halo on the dark page. Use the themed bg so the ring blends correctly. */
:root[data-theme="dark"] .online-dot,
:root[data-theme="dark"] .price-marker { border-color: var(--bg); }

/* ====== Reset ====== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.25s ease, color 0.25s ease;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ========================================================================
   Topbar — sw_preview-style: translucent canvas, theme-adaptive text.
   Old Telegram-blue gradient retired so the page flows continuously into
   the hero canvas without a colored band at the top.
   ======================================================================== */
.topbar {
  background: var(--header-blur);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.topbar__inner { display: flex; align-items: center; gap: 16px; height: 64px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; letter-spacing: -0.01em;
  color: var(--text); flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.2s ease;
}
.logo:hover { transform: translateY(-1px); }
.logo__mark {
  width: 34px; height: 34px;
  filter: drop-shadow(0 4px 10px rgba(34,158,217,0.35));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.logo:hover .logo__mark { transform: rotate(-6deg) scale(1.06); }
.logo__word { display: inline-flex; align-items: baseline; line-height: 1; font-weight: 700; }
.logo__word-swift { font-weight: 700; }
.logo__word-deal  { font-weight: 700; color: var(--tg-blue-dark); opacity: 1; }
.logo__word-dot {
  display: inline-block;
  margin: 0 1px;
  font-weight: 700;
  opacity: 0.5;
  transform: translateY(-2px);
}

.location-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--border-soft);
  transition: background 0.15s, border-color 0.15s;
}
.location-btn:hover { background: var(--bg-hover); border-color: var(--border); }

/* ====== Location dropdown (two-panel: country | city) ====== */
.loc-dd { position: relative; }
.loc-dd__chev { font-size: 10px; opacity: 0.75; margin-left: 2px; }
.loc-dd__menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15), 0 0 0 1px var(--border-light);
  padding: 6px;
  display: none;
  z-index: 200;
  /* Two panels side-by-side */
  flex-direction: row;
  gap: 4px;
  width: 460px;
}
.loc-dd.open .loc-dd__menu { display: flex; }

.loc-dd__panel {
  display: flex; flex-direction: column;
  padding: 2px;
  max-height: 64vh;
  overflow-y: auto;
}
.loc-dd__panel--countries {
  width: 200px;
  border-right: 1px solid var(--border-light);
  padding-right: 6px;
}
.loc-dd__panel--cities {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.loc-dd__item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
}
.loc-dd__item:hover { background: var(--tg-blue-light); }
.loc-dd__item.hover { background: var(--tg-blue-light); }  /* highlighted country in left pane */
.loc-dd__item.active {
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  font-weight: 600;
}
.loc-dd__pin { font-size: 14px; opacity: 0.8; min-width: 18px; text-align: center; }
.loc-dd__check {
  margin-left: auto;
  color: var(--tg-blue);
  font-size: 14px;
  visibility: hidden;
}
.loc-dd__item.active .loc-dd__check { visibility: visible; }
.loc-dd__caret { margin-left: auto; color: var(--text-secondary); font-size: 14px; opacity: 0.7; }
.loc-dd__divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 6px;
}

/* Narrow viewport: stack panels (countries on top, cities below) */
@media (max-width: 560px) {
  .loc-dd__menu {
    width: min(92vw, 360px);
    flex-direction: column;
    max-height: 80vh;
  }
  .loc-dd__panel--countries {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-right: 2px;
    padding-bottom: 4px;
    max-height: 32vh;
  }
  .loc-dd__panel--cities { padding-left: 2px; max-height: 38vh; }
}

.search {
  flex: 1; max-width: 520px;
  display: flex; align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 0 6px 0 16px; height: 40px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  background: var(--bg);
  border-color: var(--tg-accent);
  box-shadow: 0 0 0 4px rgba(42,171,238,0.16);
}
.search input {
  flex: 1; border: none; outline: none;
  font-size: 14px; background: transparent;
  color: var(--text);
}
.search input::placeholder { color: var(--text-muted); }
.search button {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: var(--radius-full);
  background: var(--tg-blue); color: #fff;
  transition: background 0.15s;
}
.search button:hover { background: var(--tg-blue-darker); }

.topbar__actions {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
}
.icon-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 5px; min-width: 16px; text-align: center;
  border-radius: var(--radius-full);
}

/* ====== Theme toggle (next to lang dropdown) ====== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  font-size: 18px;
  line-height: 1;
}
.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.theme-toggle:active { transform: scale(0.95); }
.theme-toggle__icon {
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.theme-toggle:hover .theme-toggle__icon {
  transform: rotate(20deg);
}

/* ====== Language dropdown ====== */
.lang-dd { position: relative; }
.lang-dd__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: var(--bg-soft);
  color: var(--text);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  font-size: 13px; font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}
.lang-dd__btn:hover { background: var(--bg-hover); border-color: var(--border); }
.lang-dd__flag { font-size: 16px; line-height: 1; }
.lang-dd__chev { font-size: 10px; opacity: 0.7; margin-left: 2px; }

.lang-dd__menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.15), 0 0 0 1px var(--border-light);
  padding: 6px;
  display: none;
  z-index: 200;
  overflow: hidden;
}
.lang-dd.open .lang-dd__menu { display: block; }
.lang-dd__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.12s;
}
.lang-dd__item:hover { background: var(--tg-blue-light); }
.lang-dd__item.active {
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  font-weight: 600;
}
.lang-dd__item .lang-dd__flag { font-size: 22px; line-height: 1; }
.lang-dd__name { flex: 1; }
.lang-dd__check {
  margin-left: auto;
  color: var(--tg-blue);
  font-size: 14px;
  visibility: hidden;
}
.lang-dd__item.active .lang-dd__check { visibility: visible; }
/* Topbar language code: never hide via :empty — JS always sets it. */
#lang-dd-code { font-weight: 600; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn--primary {
  background: linear-gradient(135deg, #3FB4F5 0%, var(--tg-blue-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(34,158,217,0.28);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(34,158,217,0.36);
}
.btn--ghost { color: var(--text); background: var(--bg-soft); border: 1px solid var(--border-soft); }
.btn--ghost:hover { background: var(--bg-hover); border-color: var(--border); }
.btn--solid { background: var(--tg-blue); color: #fff; }
.btn--solid:hover { background: var(--tg-blue-darker); }
.btn--outline { background: #fff; color: var(--tg-blue-dark); border: 1.5px solid var(--tg-blue); }
.btn--outline:hover { background: var(--tg-blue-light); }
.btn--block { width: 100%; justify-content: center; padding: 12px; }

/* ========================================================================
   Breadcrumbs
   ======================================================================== */
.crumbs {
  background: transparent;
  border-bottom: 0;
  padding: 12px 0 4px;
  font-size: 13px;
}
.crumbs__inner {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  color: var(--text-muted);
}
.crumbs a { color: var(--text-secondary); transition: color 0.15s; }
.crumbs a:hover { color: var(--tg-blue); }
.crumbs .sep { opacity: 0.4; }
.crumbs .current { color: var(--text); font-weight: 500; }

/* ========================================================================
   Section head + subcategories
   ======================================================================== */
.section-head {
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 20px;
}
/* When the subcategory strip is visible it adds its own bottom space, so
   trim the section-head's own padding-bottom to avoid a double gap. */
.section-head:has(.subcats:not([style*="display: none"])) { padding-bottom: 0; }
.section-head h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: var(--text);
}
.section-head .lede {
  color: var(--text-secondary); font-size: 14px; margin-bottom: 16px;
}

.subcats {
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  margin-top: 20px;
}
.subcats::-webkit-scrollbar { display: none; }
.subcat {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  position: relative;
  transition: color 0.15s;
}
.subcat:hover { color: var(--tg-blue); }
.subcat.active { color: var(--tg-blue); }
.subcat.active::after {
  content: ''; position: absolute; bottom: 0; left: 18px; right: 18px;
  height: 3px; background: var(--tg-blue);
  border-radius: 2px 2px 0 0;
}
.subcat .ico {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* ========================================================================
   Operation tabs (Купить / Снять / Сутки)
   ======================================================================== */
.op-tabs {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  margin: 20px 0;
}
.op-tab {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.op-tab.active {
  background: #fff;
  color: var(--tg-blue-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ========================================================================
   Home view (landing page)
   ======================================================================== */
.home-hero {
  background: linear-gradient(135deg, var(--tg-blue) 0%, var(--tg-blue-dark) 60%, var(--tg-blue-darker) 100%);
  border-radius: var(--radius-xl);
  padding: 56px 48px;
  margin: 24px 0 32px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: ''; position: absolute;
  top: -50%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.home-hero__inner { position: relative; z-index: 1; max-width: 680px; }
.home-hero h2 {
  font-size: 40px; line-height: 1.1; font-weight: 700;
  letter-spacing: -1px; margin-bottom: 14px;
}
.home-hero p {
  font-size: 17px; opacity: 0.92;
  margin-bottom: 28px;
}

.home-hero__search {
  display: flex; align-items: center;
  background: #fff;
  border-radius: var(--radius-full);
  padding: 6px 6px 6px 22px;
  max-width: 560px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.home-hero__search input {
  flex: 1; border: none; outline: none;
  font-size: 16px; background: transparent;
  /* Hero pill bg is hard-coded white in both themes — text must stay dark
     so it's visible when the user types. */
  color: #1F2328;
  padding: 12px 0;
}
.home-hero__search input::placeholder { color: #8B95A1; }
.home-hero__search button {
  padding: 12px 24px;
  background: var(--tg-blue);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.home-hero__search button:hover { background: var(--tg-blue-darker); }

.home-section { margin-bottom: 40px; }
.home-section h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.3px;
  margin-bottom: 16px;
}

/* ====== Home marquees (infinite scrolling category strips) ====== */
.home-marquees {
  display: flex; flex-direction: column;
  gap: 14px;
  margin: 24px 0 40px;
}
.marquee {
  position: relative;
  overflow: hidden;
  padding: 6px 0;
  /* Fade edges so cards slide in/out instead of popping. */
  mask-image: linear-gradient(90deg, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
}
.marquee__track {
  display: flex;
  gap: 14px;
  width: max-content;
  will-change: transform;
}
/* Two copies of the cards mean translating -50% returns to start seamlessly. */
.marquee--left  .marquee__track { animation: mq-left  55s linear infinite; }
.marquee--right .marquee__track { animation: mq-right 55s linear infinite; }
@keyframes mq-left  { from { transform: translateX(0); }    to { transform: translateX(-50%); } }
@keyframes mq-right { from { transform: translateX(-50%); } to { transform: translateX(0); }    }
.marquee:hover .marquee__track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none !important; }
}

.mq-card {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 220px;
  max-width: 260px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.mq-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border-color: var(--tg-blue);
}
.mq-card__icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--tg-blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex: 0 0 44px;
}
.mq-card__body { display: flex; flex-direction: column; min-width: 0; }
.mq-card__title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 180px;
}
.mq-card__price {
  font-size: 12px; color: var(--tg-blue-dark); font-weight: 600;
}

:root[data-theme="dark"] .mq-card {
  background: var(--bg);
  border-color: var(--border);
}

.home-ops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.home-op {
  background: #fff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.15s;
  cursor: pointer;
  text-align: left;
}
.home-op:hover {
  border-color: var(--tg-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.home-op__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.home-op__label {
  font-size: 16px; font-weight: 700; color: var(--text);
}

.home-cats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.home-cat {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 8px;
  transition: all 0.18s;
  cursor: pointer;
}
.home-cat:hover {
  border-color: var(--tg-blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.home-cat__icon {
  width: 64px; height: 64px;
  border-radius: var(--radius-lg);
  background: var(--tg-blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin-bottom: 4px;
  transition: background 0.18s;
}
.home-cat:hover .home-cat__icon { background: var(--tg-accent); }
.home-cat__name {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.home-cat__count {
  font-size: 12px; color: var(--text-muted);
}

@media (max-width: 900px) {
  .home-ops { grid-template-columns: 1fr; }
  .home-cats { grid-template-columns: repeat(2, 1fr); }
  .home-hero h2 { font-size: 28px; }
  .home-hero { padding: 36px 24px; }
}

/* ====== Top-level category tiles (home page) ====== */
.home-top-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.home-top-cat {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.home-top-cat:hover {
  border-color: var(--tg-blue);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.home-top-cat__icon {
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--tg-blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  transition: background 0.2s, transform 0.2s;
}
.home-top-cat:hover .home-top-cat__icon { background: var(--tg-blue); transform: scale(1.04); }
.home-top-cat__name {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin-top: 8px;
}
.home-top-cat__sub {
  font-size: 13px; color: var(--text-secondary);
}
.home-top-cat--disabled {
  opacity: 0.7;
}
.home-top-cat--disabled .home-top-cat__sub {
  color: var(--tg-blue);
  font-weight: 600;
}
:root[data-theme="dark"] .home-top-cat {
  background: var(--bg);
  border-color: var(--border);
}

/* ====== Coming-soon placeholder ====== */
.coming-soon {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 80px 24px;
  text-align: center;
  max-width: 560px;
  margin: 40px auto;
}
.coming-soon__icon { font-size: 72px; margin-bottom: 12px; }
.coming-soon__title { font-size: 28px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.coming-soon__text  { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
:root[data-theme="dark"] .coming-soon {
  background: var(--bg);
  border-color: var(--border);
}

@media (max-width: 900px) {
  .home-top-cats { grid-template-columns: 1fr; }
  .home-top-cat { padding: 28px 20px; }
  .coming-soon { padding: 48px 20px; }
}

/* ========================================================================
   List view: layout, filters, listings
   ======================================================================== */
.list-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 16px 0 64px;
}
.filters {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px;
  align-self: start;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.filters h3 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.filters h3 .clear {
  font-size: 12px; font-weight: 500;
  color: var(--tg-blue);
  cursor: pointer;
}
.filter-group { margin-bottom: 18px; }
.filter-group__label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 8px;
}
.input, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus {
  border-color: var(--tg-blue);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.15);
}
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range--triple { grid-template-columns: 1fr 1fr auto; align-items: center; }
.range .input { padding: 9px 10px; font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: #fff;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.chip:hover { border-color: var(--tg-blue); color: var(--tg-blue); }
.chip.active,
:root[data-theme="dark"] .chip.active {
  background: var(--tg-blue);
  border-color: var(--tg-blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(42, 171, 238, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.chip.active:hover { color: #fff; }

/* ----- Filter trigger button (opens a popup for searchable-select / range) ----- */
.filter-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  text-align: left;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.filter-trigger:hover { border-color: var(--tg-blue); }
.filter-trigger__value           { flex: 1; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-trigger__value--empty    { color: var(--text-muted); font-weight: 400; }
.filter-trigger__chev            { color: var(--text-muted); font-size: 12px; }
:root[data-theme="dark"] .filter-trigger { background: var(--bg-alt); border-color: var(--border); }

/* ----- Filter popup modal ----- */
.filter-popup-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fp-fade-in 0.15s ease;
}
@keyframes fp-fade-in { from { opacity: 0; } to { opacity: 1; } }
.filter-popup {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: min(80vh, 640px);
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  animation: fp-pop-in 0.18s ease;
}
@keyframes fp-pop-in { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.filter-popup__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.filter-popup__title { font-weight: 600; font-size: 16px; color: var(--text); }
.filter-popup__close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background 0.15s;
}
.filter-popup__close:hover { background: var(--border); }
.filter-popup__body { padding: 14px 16px; overflow-y: auto; flex: 1; }
.filter-popup__foot {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.filter-popup__foot .btn { flex: 1; padding: 11px 16px; }

/* Search box inside popup */
.filter-popup__search { margin-bottom: 10px; }
.filter-popup__search input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14px;
}
.filter-popup__search input::placeholder { color: var(--text-muted); }
.filter-popup__search input:focus {
  outline: none;
  border-color: var(--tg-blue);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.15);
}

/* Item list */
.filter-popup__list { display: flex; flex-direction: column; gap: 2px; }
.filter-popup__item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  transition: background 0.12s;
}
.filter-popup__item:hover { background: var(--bg-alt); }
.filter-popup__item.selected {
  background: var(--tg-blue);
  color: #fff;
  font-weight: 600;
}
.filter-popup__item.selected:hover { background: var(--tg-blue); }

.check {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.check input { width: 16px; height: 16px; accent-color: var(--tg-blue); cursor: pointer; }

/* ----- Toolbar above listings ----- */
.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.toolbar__count { font-size: 13px; color: var(--text-secondary); }
.toolbar__count strong { color: var(--text); font-weight: 700; }
.toolbar__right { display: flex; align-items: center; gap: 12px; }
.toolbar select.select {
  padding: 8px 32px 8px 12px;
  font-size: 13px; font-weight: 500;
  background: var(--bg-soft);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23707579' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  width: auto;
}
.view-toggle {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-alt);
  border-radius: var(--radius);
}
.view-toggle button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
}
.view-toggle button.active {
  background: #fff;
  color: var(--tg-blue-dark);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ----- Listings grid ----- */
.listings { display: flex; flex-direction: column; gap: 12px; }
.listing {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: grid;
  grid-template-columns: 240px 1fr 180px;
  transition: all 0.18s;
  cursor: pointer;
}
.listing:hover {
  border-color: var(--tg-blue);
  box-shadow: var(--shadow-lg);
}
.listing__photo {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--tg-blue-light) 0%, #DCEFFC 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}
/* Real photo from user wizard upload (or future backend). */
.listing__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.08));
}
.listing__emoji { filter: drop-shadow(0 4px 12px rgba(0,0,0,.08)); }
.listing__photo .badge-tl {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px;
  background: var(--tg-blue);
  color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.listing__photo .badge-tl.urgent { background: var(--danger); }
.listing__photo .badge-tl.top    { background: var(--warning); }
.listing__body {
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 6px;
  min-width: 0;
}
.listing__title {
  font-size: 16px; font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text);
  line-height: 1.3;
}
.listing__params {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 13px;
  color: var(--text-secondary);
}
.listing__params strong { color: var(--text); font-weight: 600; }
.listing__address {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 4px;
}
.listing__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.listing__tag {
  padding: 2px 8px;
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500;
}
.listing__footer {
  display: flex; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.listing__side {
  padding: 16px;
  border-left: 1px solid var(--border-light);
  display: flex; flex-direction: column;
  align-items: flex-end; text-align: right;
  gap: 6px;
}
.listing__price {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.4px;
}
.listing__price-sqm { font-size: 12px; color: var(--text-muted); }

.empty-result {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}

/* ----- Friendly empty state (404, no-listing, error) ----- */
.empty-state {
  max-width: 520px;
  margin: 48px auto;
  padding: 56px 32px;
  text-align: center;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.empty-state__icon {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 16px;
}
.empty-state__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.empty-state__lede {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 15px;
}
.empty-state__hash {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.empty-state__hash code {
  background: var(--bg-alt);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.empty-state__hint {
  margin: -8px 0 24px;
  color: var(--text-secondary);
  font-size: 14px;
}
.empty-state__link {
  color: var(--tg-blue);
  font-weight: 600;
  text-decoration: none;
}
.empty-state__link:hover { text-decoration: underline; }

:root[data-theme="dark"] .empty-state {
  background: var(--bg);
  border: 1px solid var(--border);
}

/* ---- Lazy-load chunk skeleton + error ---- */
.view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: var(--text-muted, #888);
  font-size: 14px;
}
.view-loading::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-right: 10px;
  border: 2px solid var(--border, #ddd);
  border-top-color: var(--primary, #2AABEE);
  border-radius: 50%;
  animation: view-loading-spin 0.8s linear infinite;
}
@keyframes view-loading-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .view-loading::before { animation: none; }
}
.view-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 240px;
  justify-content: center;
  text-align: center;
}
.view-error p {
  color: var(--text-muted, #666);
  max-width: 360px;
  margin: 0;
}
.view-error button {
  appearance: none;
  border: 1px solid var(--border, #ddd);
  background: var(--bg-alt, #f5f5f5);
  color: var(--text, #111);
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
.view-error button:hover {
  border-color: var(--primary, #2AABEE);
}

/* ----- Skeleton loaders ----- */
@keyframes skeleton-shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-alt) 0%,
    var(--border-light) 50%,
    var(--bg-alt) 100%
  );
  background-size: 800px 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 6px;
}
.skeleton-card {
  display: grid;
  grid-template-columns: 200px 1fr 160px;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.skeleton-card__photo { height: 130px; }
.skeleton-card__body  { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.skeleton-card__line  { height: 14px; }
.skeleton-card__line--80 { width: 80%; }
.skeleton-card__line--60 { width: 60%; }
.skeleton-card__line--40 { width: 40%; }
.skeleton-card__side  { display: flex; flex-direction: column; gap: 8px; }
.skeleton-card__price { height: 24px; width: 80%; }

:root[data-theme="dark"] .skeleton-card {
  background: var(--bg);
  border-color: var(--border);
}
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}
@media (max-width: 640px) {
  .skeleton-card { grid-template-columns: 1fr; }
  .skeleton-card__photo { height: 180px; }
}

@media (max-width: 1024px) {
  .list-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
}
@media (max-width: 700px) {
  .listing { grid-template-columns: 1fr; }
  .listing__photo { aspect-ratio: 16/10; }
  .listing__side {
    border-left: none;
    border-top: 1px solid var(--border-light);
    align-items: flex-start;
    text-align: left;
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ========================================================================
   Saved searches bar + modals
   ======================================================================== */
.saved-bar {
  display: flex; gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.btn--mini {
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  font-size: 12px; font-weight: 600;
  transition: background 0.12s;
}
.btn--mini:hover { background: var(--tg-blue); color: #fff; }
.btn--mini-danger {
  background: #FFEAEA; color: var(--danger);
}
.btn--mini-danger:hover { background: var(--danger); color: #fff; }
.btn--mini-danger-armed,
.btn--mini-danger-armed:hover {
  background: var(--danger);
  color: #fff;
  animation: btn-arm-pulse 0.9s ease-in-out infinite alternate;
}
@keyframes btn-arm-pulse {
  from { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  to   { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25); }
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  max-height: 80vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}
.modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal__head h3 { font-size: 17px; font-weight: 700; }
.icon-btn-dark {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn-dark:hover { background: var(--bg-alt); color: var(--text); }
.modal__body { padding: 20px; overflow-y: auto; }

.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.saved-item__name { font-size: 14px; font-weight: 600; color: var(--text); }
.saved-item__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.saved-item__actions { display: flex; gap: 6px; }

/* ========================================================================
   Logs
   ======================================================================== */
.log-list { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 12px;
}
.log-who {
  font-family: monospace;
  font-size: 11px;
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.log-msg { flex: 1; color: var(--text); }
.log-when { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.log-level {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}
.log-level--error { background: rgba(229,57,53,0.15);  color: #C62828; }
.log-level--warn  { background: rgba(255,164,38,0.15); color: #B0701A; }
.log-level--info  { background: rgba(77,205,94,0.15);  color: #2D9D43; }

/* ========================================================================
   Content rows
   ======================================================================== */
.content-list { display: flex; flex-direction: column; gap: 6px; }
.content-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 13px;
}
.content-row > div { display: flex; gap: 6px; }

/* ========================================================================
   Moderation queue
   ======================================================================== */
.mod-queue { display: flex; flex-direction: column; gap: 10px; }
.mod-item {
  display: grid; grid-template-columns: 80px 1fr 200px;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px;
  align-items: center;
  transition: opacity 0.3s;
}
.mod-item__photo {
  aspect-ratio: 1;
  background: var(--tg-blue-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.mod-item__title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-item__meta  { font-size: 12px; color: var(--text-muted); margin: 4px 0 6px; }
.mod-item__flags { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-item__actions { display: flex; flex-direction: column; gap: 6px; }
.mod-item__actions .btn { padding: 8px 12px; font-size: 12px; }

.flag-tag {
  background: rgba(229,57,53,0.12);
  color: #C62828;
  padding: 3px 8px;
  border-radius: var(--radius);
  font-size: 11px; font-weight: 500;
}
.flag-tag--ok { background: rgba(77,205,94,0.12); color: #2D9D43; }

.risk {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.risk--high { background: rgba(229,57,53,0.15);  color: #C62828; }
.risk--med  { background: rgba(255,164,38,0.15); color: #B0701A; }
.risk--low  { background: rgba(77,205,94,0.15);  color: #2D9D43; }

/* ========================================================================
   Admin tables & filters
   ======================================================================== */
.admin-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.admin-filters .input,
.admin-filters .select {
  width: auto; min-width: 160px;
  padding: 8px 12px;
  font-size: 13px;
}
.admin-filters .input { flex: 1; min-width: 240px; }

.admin-table-wrap {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}
.admin-table tr:hover td { background: var(--bg-soft); }
.admin-table tr:last-child td { border-bottom: none; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.lang-tag {
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  font-size: 11px; font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.status {
  display: inline-block;
  padding: 3px 9px;
  font-size: 11px; font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}
.status--active  { background: rgba(77,205,94,0.15);  color: #2D9D43; }
.status--blocked { background: rgba(229,57,53,0.15);  color: #C62828; }
.status--pending { background: rgba(255,164,38,0.15); color: #B0701A; }

/* ========================================================================
   Admin panel
   ======================================================================== */
.admin-login {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}
.admin-login__card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.admin-login__logo { font-size: 56px; margin-bottom: 10px; }
.admin-login__card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  margin: -32px -24px 0;
  min-height: calc(100vh - 64px - 53px - 50px);
}
.admin-sidebar {
  background: #1A1F26;
  color: #E8EAED;
  padding: 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.admin-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 14px;
  flex-wrap: wrap;
}
.admin-brand__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.admin-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: #9AA0A6;
  transition: all 0.12s;
}
.admin-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.admin-link.active {
  background: var(--tg-blue);
  color: #fff;
  font-weight: 600;
}
.admin-link span { font-size: 16px; }
.admin-sidebar__foot {
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.admin-main {
  background: var(--bg-soft);
  padding: 28px 32px;
  overflow-x: auto;
}
.admin-h {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 18px;
  display: flex; align-items: baseline; gap: 12px;
}
.admin-h-sub {
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
}

.admin-tiles {
  display: grid;
  /* 5 tiles after Revenue was removed; fall back to flexible widths so the
     grid still looks tidy if more tiles are added or dropped later. */
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.tile {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.tile--accent {
  background: linear-gradient(135deg, var(--tg-blue) 0%, var(--tg-blue-dark) 100%);
  color: #fff;
  border-color: transparent;
}
.tile__label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.tile--accent .tile__label { color: rgba(255,255,255,0.85); }
.tile__value { font-size: 28px; font-weight: 700; letter-spacing: -0.6px; }
.tile__delta { font-size: 11px; color: var(--success); margin-top: 4px; }
.tile--accent .tile__delta { color: rgba(255,255,255,0.9); }

.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.country-bars { display: flex; flex-direction: column; gap: 10px; }
.country-bar {
  display: grid; grid-template-columns: 140px 1fr 50px;
  gap: 10px; align-items: center;
  font-size: 13px;
}
.country-bar__name { font-weight: 500; }
.country-bar__track {
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}
.country-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--tg-blue) 0%, var(--tg-blue-dark) 100%);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.country-bar__val { font-weight: 700; text-align: right; }

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.feed-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  font-size: 13px;
}
.feed-item__ico { font-size: 16px; }
.feed-item__text { flex: 1; color: var(--text); }
.feed-item__time { font-size: 11px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .admin-tiles { grid-template-columns: repeat(3, 1fr); }
  .admin-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { flex-direction: row; overflow-x: auto; }
  .admin-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================================================
   Calculator tools
   ======================================================================== */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
@media (max-width: 700px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-results {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.calc-big {
  text-align: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.calc-big strong {
  font-size: 36px;
  display: block;
  color: var(--tg-blue-dark);
  letter-spacing: -1px;
}
.calc-big span { font-size: 13px; color: var(--text-secondary); }

.calc-row {
  display: flex; justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
}
.calc-row span { color: var(--text-secondary); }

/* ========================================================================
   Chat
   ======================================================================== */
.chat {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  height: calc(100vh - 240px);
  min-height: 500px;
  overflow: hidden;
}
.chat__list {
  border-right: 1px solid var(--border-light);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.chat__list-head {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}
.chat-item {
  display: flex; gap: 10px; padding: 10px 12px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border-light);
}
.chat-item:hover  { background: var(--bg-soft); }
.chat-item.active { background: var(--tg-blue-light); }
.online-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 11px; height: 11px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid #fff;
}
.chat-item__body { flex: 1; min-width: 0; }
.chat-item__row1 {
  display: flex; justify-content: space-between;
  font-size: 13px;
}
.chat-item__name { font-weight: 700; }
.chat-item__time { color: var(--text-muted); font-size: 11px; }
.chat-item__row2 {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.chat-item__preview {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 180px;
}
.unread-pill {
  background: var(--tg-blue);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.chat__pane { display: flex; flex-direction: column; }
.chat__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}
.chat__msgs {
  flex: 1; overflow-y: auto;
  padding: 18px;
  background: var(--bg-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.msg { display: flex; flex-direction: column; max-width: 70%; }
.msg--me   { align-self: flex-end; align-items: flex-end; }
.msg--them { align-self: flex-start; align-items: flex-start; }
.msg__bubble {
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 14px;
  word-break: break-word;
}
.msg--me .msg__bubble {
  background: var(--tg-blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg--them .msg__bubble {
  background: #fff;
  border: 1px solid var(--border-light);
  border-bottom-left-radius: 4px;
}
.msg__time { font-size: 10px; color: var(--text-muted); margin-top: 2px; padding: 0 6px; }

.chat__quick {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--border-light);
}
.chat__input {
  display: flex; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-light);
  background: #fff;
}
.chat__input .input { flex: 1; }

@media (max-width: 700px) {
  .chat { grid-template-columns: 1fr; }
  .chat__list { display: none; }
}

/* ========================================================================
   Cabinet
   ======================================================================== */
.cab-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 16px 0 64px;
}
.cab-sidebar {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 12px;
  align-self: start;
  position: sticky;
  top: 84px;
  display: flex; flex-direction: column; gap: 2px;
}
.cab-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.12s;
}
.cab-link:hover { background: var(--bg-soft); color: var(--text); }
.cab-link.active {
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  font-weight: 600;
}
.cab-link span { font-size: 18px; }

.cab-main { display: flex; flex-direction: column; gap: 16px; }
.cab-h {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  display: flex; align-items: baseline; gap: 12px;
}
.cab-h-meta { font-size: 14px; color: var(--text-muted); font-weight: 500; }

.cab-tabs {
  display: flex; gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}
.cab-tab {
  padding: 10px 14px;
  font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.cab-tab.active { color: var(--tg-blue); border-color: var(--tg-blue); }

.cab-listings { display: flex; flex-direction: column; gap: 10px; }
.cab-listing {
  display: grid; grid-template-columns: 100px 1fr 200px;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px;
  align-items: center;
}
.cab-listing__photo {
  aspect-ratio: 1;
  background: var(--tg-blue-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  overflow: hidden;
}
.cab-listing__photo img { width: 100%; height: 100%; object-fit: cover; }
.cab-listing__title { font-weight: 700; font-size: 15px; }
.cab-listing__addr  { font-size: 12px; color: var(--text-muted); margin: 2px 0 6px; }
.cab-listing__stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-secondary); }
.cab-listing__side  { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cab-listing__price { font-weight: 700; font-size: 16px; }
.cab-listing__actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.cab-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
}
.cab-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }

.session-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.session-item:last-child { border-bottom: none; }
.session-item small { color: var(--text-muted); }
.session-item__meta { min-width: 0; line-height: 1.5; word-break: break-word; }
.session-current-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary-soft, rgba(42,171,238,.12));
  color: var(--primary, #2AABEE);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}
.session-empty {
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.profile-grid {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.profile-avatar { text-align: center; }
.verified-badges { display: flex; flex-direction: column; gap: 6px; }
.vb {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: rgba(77, 205, 94, 0.12);
  color: #2D9D43;
  border-radius: var(--radius);
  font-size: 11px; font-weight: 600;
}
.vb--pending { background: rgba(255, 164, 38, 0.15); color: #B0701A; }
.vb--off     { background: var(--bg-alt);            color: var(--text-muted); }

/* === Cabinet · Profile card === */
.profile-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.profile-card__head {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.10), rgba(42, 171, 238, 0.02));
  border-bottom: 1px solid var(--border-light);
}
.profile-card__avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tg-blue), #1d8bd1);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; letter-spacing: -0.5px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(42, 171, 238, 0.35);
}
.profile-card__id { flex: 1; min-width: 0; }
.profile-card__name {
  font-size: 18px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-card__sub {
  font-size: 13px; color: var(--text-muted); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-card__photo-btn { white-space: nowrap; flex-shrink: 0; }

.profile-card__badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-soft);
}
.profile-card__form { padding: 22px 24px 8px; }
.profile-card__form .wizard__row { margin-bottom: 16px; }
.profile-card__foot {
  display: flex; justify-content: flex-end;
  padding: 14px 24px 22px;
  border-top: 1px solid var(--border-light);
}
.profile-card__foot .btn { padding: 10px 24px; }

@media (max-width: 600px) {
  .profile-card__head { flex-wrap: wrap; }
  .profile-card__id { flex-basis: calc(100% - 88px); }
  .profile-card__photo-btn { width: 100%; margin-top: 4px; }
  .profile-card__form,
  .profile-card__head,
  .profile-card__badges,
  .profile-card__foot { padding-left: 16px; padding-right: 16px; }
}

.compare-table th {
  padding: 14px 8px;
  text-align: center;
  font-size: 13px;
  border-bottom: 2px solid var(--border);
}
.compare-table td { text-align: center; }

@media (max-width: 800px) {
  .cab-layout { grid-template-columns: 1fr; }
  .cab-sidebar { position: static; flex-direction: row; flex-wrap: wrap; overflow-x: auto; }
  .cab-listing { grid-template-columns: 80px 1fr; }
  .cab-listing__side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .profile-grid { grid-template-columns: 1fr; text-align: center; }
}

/* ========================================================================
   Wizard (create listing)
   ======================================================================== */
.wizard {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin: 16px 0 64px;
  max-width: 880px;
}
.wizard__progress {
  display: flex; align-items: center; gap: 12px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
}
.wizard__progress::-webkit-scrollbar { display: none; }
.step {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.step:not(:last-child)::after {
  content: ''; width: 28px; height: 2px;
  background: var(--border-light);
  margin-left: 8px;
}
.step__circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  transition: all 0.2s;
}
.step__label {
  font-size: 13px; font-weight: 600;
}
.step.done .step__circle { background: var(--tg-blue); color: #fff; }
.step.done.active { color: var(--tg-blue-dark); }
.step.done.active .step__circle { box-shadow: 0 0 0 4px rgba(42,171,238,0.2); }
.step.done:not(:last-child)::after { background: var(--tg-blue); }

.wizard__body { padding: 28px; min-height: 320px; }
.wizard__h {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 18px;
}
.wizard__row { margin-bottom: 18px; }
.wizard__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
@media (max-width: 600px) { .wizard__grid { grid-template-columns: 1fr; } }

textarea.input { resize: vertical; font-family: inherit; }

.photo-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-soft);
  transition: all 0.15s;
}
.photo-drop:hover,
.photo-drop--hover {
  border-color: var(--tg-blue);
  background: var(--tg-blue-light);
}
.photo-drop__icon { font-size: 40px; margin-bottom: 8px; }

/* ----- Photo thumbnails grid ----- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.photo-thumb__emoji {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.photo-thumb__del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.photo-thumb__del:hover { background: var(--danger); }
:root[data-theme="dark"] .photo-thumb { background: var(--bg-soft); border-color: var(--border); }

.wizard__preview {
  background: var(--tg-blue-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  margin-top: 16px;
}

.wizard__nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.wizard__nav .btn:disabled { opacity: 0.5; pointer-events: none; }
.wizard__autosave { font-size: 12px; color: var(--text-muted); }

/* ========================================================================
   Map view
   ======================================================================== */
.map-pane {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  height: calc(100vh - 280px);
  min-height: 500px;
  overflow: hidden;
}
.price-marker-wrap {
  background: transparent !important;
  border: none !important;
}
.price-marker {
  background: var(--tg-blue);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 2px solid #fff;
  cursor: pointer;
  transition: transform 0.15s;
}
.price-marker:hover {
  background: var(--tg-blue-darker);
  transform: scale(1.1);
}
.map-popup {
  display: flex; gap: 12px;
  min-width: 240px;
}
.map-popup__emoji {
  font-size: 40px;
  background: var(--tg-blue-light);
  border-radius: var(--radius);
  width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.map-popup__title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.map-popup__addr  { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.map-popup__price { font-size: 14px; font-weight: 700; color: var(--tg-blue-dark); margin-bottom: 8px; }

/* ========================================================================
   Item detail view
   ======================================================================== */
.item-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  padding: 16px 0 64px;
}
.item-main { display: flex; flex-direction: column; gap: 18px; }
.item-section {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px 22px;
}
.item-section h3 {
  font-size: 16px; font-weight: 700;
  margin-bottom: 14px;
}
.item-title {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}
.item-address { color: var(--text-secondary); margin-bottom: 14px; font-size: 14px; }
.item-desc { font-size: 14px; line-height: 1.6; color: var(--text); }

.gallery {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 14px;
  position: relative;
}
.gallery__main {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--tg-blue-light) 0%, #DCEFFC 100%);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 120px;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery__main img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ----- Lightbox / fullscreen photo viewer ----- */
.lightbox {
  position: fixed; inset: 0;
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}
.lightbox__content {
  position: relative;
  max-width: 95vw; max-height: 95vh;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__img {
  max-width: 95vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  user-select: none;
  pointer-events: auto;
}
.lightbox__counter {
  position: absolute; bottom: -36px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px; font-weight: 500;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.lightbox__nav,
.lightbox__close {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.15s;
}
.lightbox__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; font-size: 32px; line-height: 1; }
.lightbox__nav--prev { left: 16px; }
.lightbox__nav--next { right: 16px; }
.lightbox__close { top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; font-size: 18px; }
.lightbox__nav:hover,
.lightbox__close:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox__nav:focus-visible,
.lightbox__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lightbox__nav[hidden] { display: none; }

@media (max-width: 480px) {
  .lightbox__nav { width: 44px; height: 44px; font-size: 26px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}
.gallery__thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.gallery__thumb {
  aspect-ratio: 1;
  background: var(--bg-alt);
  border: 2px solid transparent;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  cursor: pointer;
  transition: border-color 0.15s;
  padding: 0;
  overflow: hidden;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery__thumb:hover, .gallery__thumb.active { border-color: var(--tg-blue); }
.gallery__count {
  position: absolute; top: 24px; right: 24px;
  padding: 4px 10px;
  background: rgba(15,20,25,0.7);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
  backdrop-filter: blur(4px);
}

.char-table { width: 100%; border-collapse: collapse; }
.char-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.char-table td:first-child { color: var(--text-secondary); width: 45%; }
.char-table tr:last-child td { border-bottom: none; }

.map-stub {
  position: relative;
  aspect-ratio: 16/8;
  background: linear-gradient(135deg, #E8F2EE 0%, #DDECFF 100%);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.map-stub__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,100,150,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,100,150,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-stub__pin {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -100%);
  font-size: 36px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.map-stub__caption {
  position: absolute; bottom: 12px; left: 12px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  backdrop-filter: blur(4px);
}

.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.score {
  background: var(--tg-blue-light);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.score strong { display: block; font-size: 24px; color: var(--tg-blue-dark); }
.score span   { font-size: 12px; color: var(--text-secondary); }

.hist {
  display: flex; align-items: flex-end; gap: 10px;
  height: 160px;
  padding: 12px 0;
}
.hist__bar {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.hist__fill {
  width: 100%;
  background: linear-gradient(180deg, var(--tg-blue) 0%, var(--tg-blue-dark) 100%);
  border-radius: 6px 6px 0 0;
  min-height: 12px;
}
.hist__bar span { font-size: 11px; color: var(--text-muted); }

.item-side {
  position: sticky; top: 84px;
  align-self: start;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.item-side__price {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.6px;
}
.item-side__sqm {
  font-size: 13px; color: var(--text-muted);
  margin-top: -4px;
}
.item-side__seller {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin: 8px 0;
}
.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--tg-blue-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.seller-name { font-size: 14px; font-weight: 600; }
.seller-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.side-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 4px;
}
.side-act {
  padding: 9px 8px;
  background: var(--bg-alt);
  border-radius: var(--radius);
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.side-act:hover { background: var(--tg-blue-light); color: var(--tg-blue-dark); }
.side-act.active { background: #FFEAEA; color: var(--danger); }

.item-side__note {
  font-size: 11px; color: var(--text-muted);
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .item-layout { grid-template-columns: 1fr; }
  .item-side { position: static; }
  .gallery__main { font-size: 80px; }
}

/* ========================================================================
   Toast
   ======================================================================== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 20, 25, 0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: all 0.25s;
  z-index: 1000;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ========================================================================
   Stub views (Phase 1 placeholders)
   ======================================================================== */
.stub {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 48px 32px;
  text-align: center;
  margin: 24px 0 64px;
}
.stub__icon { font-size: 56px; margin-bottom: 12px; }
.stub h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.3px;
  margin-bottom: 8px;
}
.stub p {
  font-size: 14px; color: var(--text-secondary);
  max-width: 520px; margin: 0 auto 16px;
}
.stub .phase-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
}

/* ========================================================================
   Debug panel (state inspector for Phase 1 testing)
   ======================================================================== */
.debug {
  position: fixed; bottom: 16px; right: 16px;
  width: 320px;
  background: rgba(15, 20, 25, 0.92);
  color: #fff;
  border-radius: var(--radius-lg);
  font-size: 12px;
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  z-index: 200;
  overflow: hidden;
  transition: width 0.2s, height 0.2s;
}
.debug__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.debug__head .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.debug__toggle {
  font-size: 16px; line-height: 1;
  padding: 0 4px;
}
.debug__body { padding: 12px 14px; }
.debug__row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.debug__row:last-child { border-bottom: none; }
.debug__key { opacity: 0.6; }
.debug__val { color: var(--tg-blue); font-weight: 600; }
.debug.collapsed .debug__body { display: none; }

/* ========================================================================
   Auth modal · user chip · user menu
   ======================================================================== */
.auth-modal { max-width: 460px; }
.auth-sub {
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-size: 14px;
}
/* Pill-shaped segmented control for Sign in / Register. The container is a
   fully-rounded track; the active option is a solid brand-blue pill so the
   user immediately sees which side is the current choice (and that the other
   side is tappable). */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, transform .1s;
}
.auth-tab:hover {
  color: var(--text);
  background: rgba(42, 171, 238, 0.08);
}
.auth-tab:active { transform: scale(0.98); }
.auth-tab.active {
  background: var(--tg-blue);
  color: #fff;
  box-shadow: 0 2px 6px rgba(42, 171, 238, 0.35);
}
.auth-tab.active:hover { background: var(--tg-blue-dark); }
.auth-pane .wizard__row { margin-bottom: 12px; }
.auth-pane .filter-group__label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.auth-pane .btn--block {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
}
.auth-terms-row {
  margin: 6px 0 14px;
  font-size: 13px;
  color: var(--text-secondary);
}
/* Sub-toggle inside Sign in / Register for picking Email vs Phone. Smaller
   pill so it doesn't outweigh the main top-level Sign in / Register tabs. */
.auth-method {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}
.auth-method__opt {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s, transform .1s;
}
.auth-method__opt:hover {
  color: var(--text);
  background: rgba(42, 171, 238, 0.08);
}
.auth-method__opt:active { transform: scale(0.98); }
.auth-method__opt.active {
  background: var(--tg-blue);
  color: #fff;
  box-shadow: 0 2px 5px rgba(42, 171, 238, 0.30);
}
.auth-method__opt.active:hover { background: var(--tg-blue-dark); }
.auth-phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.auth-phone-cc {
  flex: 0 0 110px;
  font-size: 14px;
  font-weight: 600;
  /* Force the chevron padding so the flag+code is visible on all platforms. */
  padding-right: 24px;
}
.auth-phone-num { flex: 1; min-width: 0; }
.auth-err {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(220, 53, 69, 0.1);
  color: #c0392b;
  font-size: 13px;
  border: 1px solid rgba(220, 53, 69, 0.25);
}
.auth-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}
.auth-switch a {
  color: var(--tg-blue);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover { text-decoration: underline; }

/* Email verification step */
.auth-code-input {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.4em;
  padding-left: 0.4em; /* compensate trailing letter-spacing so digits look centered */
}
.auth-demo-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-secondary);
  background: var(--bg-alt);
  border: 1px dashed var(--warning);
  border-radius: var(--radius);
}
.auth-verify-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 0;
  font-size: 13px;
}
.auth-verify-actions a {
  color: var(--tg-blue);
  font-weight: 600;
  text-decoration: none;
}
.auth-verify-actions a:hover { text-decoration: underline; }
.auth-resend.is-disabled {
  color: var(--text-secondary);
  pointer-events: none;
  cursor: default;
}

.auth-required {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 14px;
  text-align: center;
}
.auth-required__icon { font-size: 56px; }
.auth-required h2 { font-size: 20px; font-weight: 700; }

/* user chip in topbar (replaces "Sign in" when signed in) */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px !important;
}
.user-chip__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tg-blue), #1d8bd1);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-chip__name {
  font-weight: 600;
  font-size: 14px;
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip__chev { font-size: 11px; opacity: 0.6; }

.user-menu {
  position: fixed;
  z-index: 600;
  min-width: 240px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: 0 12px 36px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: user-menu-in 0.12s ease-out;
}
@keyframes user-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-menu__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-light);
}
.user-menu__avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tg-blue), #1d8bd1);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-menu__name { font-weight: 700; font-size: 14px; }
.user-menu__email { font-size: 12px; color: var(--text-muted); }
.user-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.user-menu__item:hover { background: var(--bg-soft); }
.user-menu__item--danger { color: #c0392b; border-top: 1px solid var(--border-light); }

/* ========================================================================
   Responsive
   ======================================================================== */
@media (max-width: 768px) {
  .topbar__inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 8px; }
  .search { order: 10; flex-basis: 100%; max-width: none; }
  .topbar__actions .btn--ghost:not(.user-chip) { display: none; }
  .section-head h1 { font-size: 22px; }
  .debug { width: calc(100% - 32px); }
  .user-chip__name { max-width: 80px; }
}

/* ----- Filters: desktop is a sticky sidebar (CSS above);
        mobile turns the wrap into a bottom-sheet via the rules below. ----- */
.filters-wrap { display: contents; } /* let .filters keep its sidebar role on desktop */
.filters__apply-bar { display: none; } /* visible only on mobile */
.filters-toggle { display: none; }     /* visible only on mobile */
.filters-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 998;
}

/* ----- Small phone (~360px) ----- */
@media (max-width: 480px) {
  /* Bottom-sheet container — filters slide up from below on toggle. */
  .filters-wrap {
    display: block;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 90vh;
    background: var(--bg);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.18);
    transform: translateY(100%);
    transition: transform 0.28s ease;
    z-index: 999;
    display: flex; flex-direction: column;
  }
  .filters-wrap.open { transform: translateY(0); }
  .filters-wrap .filters {
    position: static;
    max-height: none;
    overflow-y: auto;
    flex: 1;
    border: 0;
    border-radius: 0;
  }
  .filters__apply-bar {
    display: block;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg);
  }
  .filters-toggle {
    display: inline-flex;
    align-items: center; gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    background: var(--tg-blue-light);
    color: var(--tg-blue);
    font-weight: 600;
  }
  /* Tighten the topbar so the action row fits without horizontal scroll. */
  .topbar__inner   { gap: 6px; padding: 10px 0; }
  .topbar__actions { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  /* Drop "EN" label — flag + chev are enough at this width. */
  .lang-dd__btn #lang-dd-code { display: none; }
  .lang-dd__btn { padding: 6px 8px; }
  /* Collapse "Post a listing" button to icon-only. */
  .btn--primary#btn-post-ad #btn-post { display: none; }
  .btn--primary#btn-post-ad { padding: 8px; min-width: 40px; justify-content: center; }
  /* Logo wordmark shrinks. */
  .logo__word { font-size: 18px; }
  .location-btn { padding: 6px 10px; font-size: 13px; }
  #location-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Subcats strip — fade right edge so it's discoverable it scrolls. */
  .subcats {
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    /* Fade edge hint */
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent);
  }
  .subcats::-webkit-scrollbar { height: 0; display: none; }
  .subcat { scroll-snap-align: start; }

  /* Toolbar (sort + view-toggle) wraps onto two rows comfortably. */
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar__right { width: 100%; justify-content: space-between; }

  /* Cab/profile grids stack. */
  .profile-grid { grid-template-columns: 1fr; }
  .cab-layout   { grid-template-columns: 1fr; }

  /* Item detail side panel stacks below main. */
  .item-layout { grid-template-columns: 1fr; }
  .item-side   { position: static; }

  /* Wizard buttons row — break onto two rows if needed. */
  .wizard__nav { flex-wrap: wrap; gap: 8px; }

  /* Admin tables: enable horizontal scrolling inside their wrapper. */
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modals fill the screen with a small breathing inset. */
  .modal { width: calc(100% - 24px); max-width: none; }

  /* Empty-state padding reduces. */
  .empty-state { margin: 24px auto; padding: 32px 20px; }
  .empty-state__icon { font-size: 56px; }
  .empty-state__title { font-size: 20px; }

  /* Wizard step indicators: hide labels and tighten connectors so all
     5 circles fit in one screen without horizontal scroll. */
  .wizard__progress { padding: 16px 14px; gap: 6px; }
  .step__label { display: none; }
  .step:not(:last-child)::after { width: 16px; margin-left: 4px; }
  .wizard__body { padding: 20px 16px; }
  .wizard__h { font-size: 18px; margin-bottom: 14px; }

  /* Gallery emoji is dominant on desktop (font-size 120px) — too large
     for a 360px viewport. */
  .gallery__main { font-size: 64px; }
  .gallery__thumbs { grid-template-columns: repeat(4, 1fr); }

  /* Item title shrinks. */
  .item-title { font-size: 20px; }
  .item-section { padding: 14px 16px; }
}

/* ========================================================================
   Home v2 — hero + live ticker + categories + featured + sell-CTA.
   Scoped under .hero-v2 / .home-v2-section / .cats-v2 / .cards-v2 /
   .promo-v2 so it can't collide with the original .home-* / .marquee-*
   styles still used by realty/auto/electronics landings.
   ======================================================================== */

/* ----- Hero ----- */
.hero-v2 {
  position: relative;
  padding: 48px 0 24px;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.hero-v2__bg {
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 360px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 60% at 20% 30%, rgba(63,180,245,0.18) 0%, transparent 60%),
    radial-gradient(50% 50% at 80% 20%, rgba(34,158,217,0.14) 0%, transparent 60%);
  filter: blur(10px);
}
.hero-v2__inner { max-width: 760px; margin: 0 auto; }
.hero-v2__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--tg-blue-light);
  color: var(--tg-blue-dark);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.hero-v2__eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: hero-v2-pulse 1.8s infinite;
}
@keyframes hero-v2-pulse {
  0%   { box-shadow: 0 0 0 0    rgba(77,205,94,0.55); }
  70%  { box-shadow: 0 0 0 8px  rgba(77,205,94,0); }
  100% { box-shadow: 0 0 0 0    rgba(77,205,94,0); }
}
.hero-v2__title {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}
.hero-v2__grad {
  background: linear-gradient(135deg, #3FB4F5, var(--tg-blue-darker));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
  white-space: nowrap;
}
.hero-v2__lead {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0 auto 24px;
  max-width: 540px;
}
.hero-v2__search {
  margin: 0 auto;
  max-width: 640px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 6px 6px 6px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.hero-v2__search:focus-within {
  border-color: var(--tg-accent);
  box-shadow: 0 0 0 4px rgba(42,171,238,0.16), var(--shadow-md);
}
.hero-v2__search-ico { color: var(--text-muted); display: inline-flex; }
.hero-v2__search input {
  border: 0; outline: none; background: transparent;
  font-size: 15px; color: var(--text);
  height: 44px; width: 100%;
  font-family: inherit;
}
.hero-v2__search input::placeholder { color: var(--text-muted); }
.hero-v2__go {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #3FB4F5, var(--tg-blue-dark));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 6px 16px rgba(34,158,217,0.28);
}
.hero-v2__go:hover  { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(34,158,217,0.36); }
.hero-v2__go:active { transform: translateY(0) scale(0.98); }

.hero-v2__chips {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.hero-v2__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.hero-v2__chip:hover {
  border-color: var(--tg-accent);
  color: var(--tg-blue-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ----- Generic section wrapper for home v2 ----- */
.home-v2-section { padding: 32px 0; }
.home-v2-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.home-v2-section__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}
.home-v2-section__sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin: 4px 0 0;
}
.home-v2-section__more {
  color: var(--tg-blue-dark);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.home-v2-section__more:hover { opacity: 0.75; }

/* ----- Ticker (Live feed) ----- */
.tcard-viewport {
  position: relative;
  overflow: hidden;
  padding: 6px 0;
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.tcard-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tcard-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: max-content;
  animation: tcard-scroll var(--row-speed, 60s) linear infinite;
  will-change: transform;
}
.tcard-row--reverse { animation-direction: reverse; }
.tcard-viewport:hover .tcard-row { animation-play-state: paused; }
@keyframes tcard-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 6px)); }
}
.tcard {
  flex: 0 0 auto;
  width: 300px;
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px 10px 10px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tcard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.tcard__media {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--m1, #cfe6f7), var(--m2, #9cc7ec));
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.tcard__media::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 70%; height: 70%;
  background: radial-gradient(closest-side, rgba(255,255,255,0.35), transparent);
  pointer-events: none;
}
.tcard__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tcard__price { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.tcard__title {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcard__meta {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tcard__meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.tcard__live {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--success);
}
.tcard__live::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: hero-v2-pulse 1.8s infinite;
}

/* ----- Placeholder ticker card -----
   Shown when the catalog is empty. Same footprint as a real .tcard so
   the rolling animation reads the same — only the styling shifts to a
   dashed "empty slot" look that invites the visitor to post. */
.tcard--placeholder {
  background: transparent;
  border: 1.5px dashed var(--border);
  box-shadow: none;
}
.tcard--placeholder:hover {
  border-color: var(--tg-blue);
  background: rgba(42, 171, 238, 0.04);
}
.tcard__media--placeholder {
  background: rgba(42, 171, 238, 0.10);
  color: var(--tg-blue);
  font-size: 22px;
  font-weight: 700;
}
.tcard__media--placeholder::after { display: none; }
.tcard__title--placeholder {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
  line-height: 1.25;
}
.tcard__meta--placeholder {
  color: var(--tg-blue);
  font-weight: 600;
}

/* ----- Categories grid (top-level: realty / auto / electronics) ----- */
.cats-v2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.cat-v2 {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.cat-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 100% 0%, var(--cat-glow, rgba(34,158,217,0.10)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.cat-v2:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: var(--shadow-md);
}
.cat-v2:hover::before { opacity: 1; }
.cat-v2__icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center; justify-content: center;
  color: #fff;
  background: var(--cat-color, var(--tg-blue));
  margin-bottom: 12px;
  font-size: 20px;
  transition: transform 0.4s ease;
}
.cat-v2:hover .cat-v2__icon { transform: scale(1.08) rotate(-4deg); }
.cat-v2__name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.cat-v2__count { color: var(--text-muted); font-size: 12px; }

/* ----- Featured listings grid ----- */
.cards-v2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.card-v2 {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card-v2:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card-v2__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-alt);
}
.card-v2__ph {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--m1, #cfe6f7), var(--m2, #9cc7ec));
  display: flex;
  align-items: center; justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.9);
  transition: transform 0.4s ease;
}
.card-v2:hover .card-v2__ph { transform: scale(1.06); }
.card-v2__img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card-v2:hover .card-v2__img { transform: scale(1.04); }
.card-v2__badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  background: rgba(15,22,32,0.6);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 0.04em;
}
.card-v2__fav {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(15,22,32,0.45);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.card-v2__fav:hover  { background: #fff; color: var(--danger); transform: scale(1.08); }
.card-v2__fav.is-active { background: #fff; color: var(--danger); }
.card-v2__body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.card-v2__price { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.card-v2__title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.card-v2__meta {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  padding-top: 4px;
  white-space: nowrap;
  overflow: hidden;
}
.card-v2__meta span { overflow: hidden; text-overflow: ellipsis; }

/* ----- Promo CTA ----- */
.promo-v2 {
  position: relative;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  background: linear-gradient(135deg, #3FB4F5 0%, var(--tg-blue-dark) 60%, var(--tg-blue-darker) 100%);
  color: #fff;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: center;
  isolation: isolate;
}
.promo-v2::before, .promo-v2::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  z-index: -1;
}
.promo-v2::before {
  width: 320px; height: 320px;
  right: -100px; top: -140px;
  background: radial-gradient(closest-side, rgba(255,255,255,0.30), transparent);
}
.promo-v2::after {
  width: 260px; height: 260px;
  right: 100px; bottom: -160px;
  background: radial-gradient(closest-side, rgba(255,255,255,0.18), transparent);
}
.promo-v2__title { margin: 0 0 8px; font-size: clamp(22px, 2.8vw, 28px); letter-spacing: -0.01em; }
.promo-v2__lead  { margin: 0 0 20px; color: rgba(255,255,255,0.9); font-size: 14px; max-width: 460px; }
.promo-v2__cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--tg-blue-dark);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.promo-v2__cta:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0,0,0,0.22); }
.promo-v2__bubbles {
  position: relative;
  height: 180px;
}
.promo-v2__bubble {
  position: absolute;
  background: rgba(255,255,255,0.96);
  color: var(--tg-blue-dark);
  border-radius: 18px 18px 18px 4px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  display: inline-flex;
  align-items: center; gap: 8px;
  animation: promo-v2-float 6s ease-in-out infinite;
}
.promo-v2__bubble:nth-child(1) { top: 0;   left: 4%;  animation-delay: 0s; }
.promo-v2__bubble:nth-child(2) { top: 70px; left: 32%; animation-delay: 1.2s; border-radius: 18px 18px 4px 18px; }
.promo-v2__bubble:nth-child(3) { top: 130px; left: 8%;  animation-delay: 2.4s; }
.promo-v2__tag {
  font-size: 10px;
  color: #fff;
  background: var(--tg-blue-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
}
@keyframes promo-v2-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.home-v2__empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ----- Dark theme tweaks ----- */
:root[data-theme="dark"] .hero-v2__bg {
  background:
    radial-gradient(60% 60% at 20% 30%, rgba(63,180,245,0.18) 0%, transparent 60%),
    radial-gradient(50% 50% at 80% 20%, rgba(34,158,217,0.14) 0%, transparent 60%);
  opacity: 0.5;
}
:root[data-theme="dark"] .hero-v2__eyebrow {
  background: rgba(34,158,217,0.16);
  color: #6ec1ff;
}
:root[data-theme="dark"] .tcard,
:root[data-theme="dark"] .cat-v2,
:root[data-theme="dark"] .card-v2,
:root[data-theme="dark"] .hero-v2__search,
:root[data-theme="dark"] .hero-v2__chip {
  background: var(--bg-alt);
  border-color: var(--border);
}
:root[data-theme="dark"] .hero-v2__chip { color: var(--text-secondary); }

/* ----- Responsive ----- */
@media (max-width: 960px) {
  .cats-v2  { grid-template-columns: repeat(3, 1fr); }
  .cards-v2 { grid-template-columns: repeat(3, 1fr); }
  .promo-v2 { grid-template-columns: 1fr; padding: 28px; }
  .promo-v2__bubbles { height: 160px; }
}
@media (max-width: 720px) {
  .hero-v2 { padding: 28px 0 12px; }
  .hero-v2__search { grid-template-columns: auto 1fr; padding: 6px 6px 6px 12px; }
  .hero-v2__go { display: none; }
  .cats-v2  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cards-v2 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .home-v2-section { padding: 24px 0; }
  .home-v2-section__title { font-size: 18px; }
  .tcard { width: 240px; }
}
@media (max-width: 420px) {
  .cards-v2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .card-v2__price { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .tcard-row, .promo-v2__bubble, .hero-v2__eyebrow .dot, .tcard__live::before { animation: none !important; }
}

/* ========================================================================
   Admin Dashboard (Phase 1) — Production health, Asset audit, Quick links
   ======================================================================== */

.dash-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }

.dash-health { display: grid; grid-template-columns: 180px 1fr; gap: 12px 16px; align-items: baseline; }
.dash-health__label { color: var(--text-secondary); font-size: 13px; }
.dash-health__value { font-size: 14px; }

.dash-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
}
.dash-pill--up   { background: rgba(77,205,94,0.14); color: #1E7E32; }
.dash-pill--down { background: rgba(229,57,53,0.14); color: #A11B19; }
.dash-pill--warn { background: rgba(255,164,38,0.14); color: #8A4A00; }
.dash-pill--mute { background: var(--bg-soft);       color: var(--text-muted); }

.dash-headers { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-headers__chip {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--bg-soft); color: var(--text-muted);
}
.dash-headers__chip--on  { background: rgba(77,205,94,0.14);  color: #1E7E32; }
.dash-headers__chip--off { background: rgba(229,57,53,0.14);  color: #A11B19; }

.dash-asset-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-asset-table th, .dash-asset-table td {
  padding: 6px 10px; border-bottom: 1px solid var(--border-light); text-align: left;
}
.dash-asset-table th { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.dash-asset-table tbody tr:last-child td { border-bottom: none; }
.dash-asset-table code { font-size: 11px; color: var(--text-muted); }
.dash-asset-table td.dash-asset-table__size { font-variant-numeric: tabular-nums; white-space: nowrap; }

.dash-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dash-quick__btn {
  display: block; padding: 14px 12px;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 14px; text-align: center;
  transition: background 0.15s, transform 0.15s;
}
.dash-quick__btn:hover { background: var(--bg-alt); transform: translateY(-1px); }

:root[data-theme="dark"] .dash-pill--up   { background: rgba(77,205,94,0.20);  color: #6FE08C; }
:root[data-theme="dark"] .dash-pill--down { background: rgba(229,57,53,0.20);  color: #FF8A87; }
:root[data-theme="dark"] .dash-pill--warn { background: rgba(255,164,38,0.20); color: #FFC373; }
:root[data-theme="dark"] .dash-headers__chip--on  { background: rgba(77,205,94,0.20);  color: #6FE08C; }
:root[data-theme="dark"] .dash-headers__chip--off { background: rgba(229,57,53,0.20);  color: #FF8A87; }

@media (max-width: 720px) {
  .dash-health { grid-template-columns: 1fr; gap: 4px; }
  .dash-quick  { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================================================
   Admin Catalog editor (Phase 2)
   ======================================================================== */

.cat-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 12px 0 16px;
}
.cat-toolbar__spacer { flex: 1; }
.cat-unsaved {
  font-size: 12px; padding: 4px 10px; border-radius: var(--radius-full);
  font-weight: 600;
}
.cat-unsaved--dirty { background: rgba(255,164,38,0.14); color: #8A4A00; }
.cat-unsaved--clean { background: var(--bg-soft); color: var(--text-muted); }
:root[data-theme="dark"] .cat-unsaved--dirty { background: rgba(255,164,38,0.20); color: #FFC373; }

/* Sidebar dot for unsaved indicator (Listings link). */
.admin-link__dot {
  display: inline-block; width: 8px; height: 8px;
  background: var(--warning, #FFA426);
  border-radius: 50%;
  margin-left: 6px; vertical-align: middle;
}

/* Catalog modal — full-screen overlay with scrollable form. */
.cat-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px; overflow-y: auto;
}
.cat-modal {
  background: var(--bg); color: var(--text);
  width: 100%; max-width: 760px;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  overflow: hidden;
}
.cat-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}
.cat-modal__head h3 { font-size: 17px; font-weight: 700; margin: 0; }
.cat-modal__body { padding: 16px 20px; }
.cat-modal__foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-soft);
}

.cat-section { margin-bottom: 22px; }
.cat-section__head {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--text-muted); letter-spacing: 0.4px;
  margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border-light);
}
.cat-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; align-items: center; margin-bottom: 10px; }
.cat-row__label { font-size: 13px; color: var(--text-secondary); }
.cat-row__field { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-row__field .input,
.cat-row__field .select { flex: 1; min-width: 0; }
.cat-row__field-row { display: flex; gap: 8px; width: 100%; }
.cat-row__field-row .input { flex: 1; min-width: 0; }
.cat-row__err {
  font-size: 11px; color: var(--danger, #E53935);
  margin-top: 2px;
}
.cat-row .input.is-invalid,
.cat-row .select.is-invalid { border-color: var(--danger, #E53935); }

.cat-map {
  height: 280px; border-radius: var(--radius);
  border: 1px solid var(--border-light); overflow: hidden;
  margin-top: 8px;
}
.cat-map-hint { font-size: 12px; color: var(--text-muted); margin: 6px 0 0; }
.cat-geo-status { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.cat-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-checks label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px;
  background: var(--bg-soft); border-radius: var(--radius-full);
  cursor: pointer;
}
.cat-checks input[type="checkbox"] { accent-color: var(--tg-blue); }

@media (max-width: 720px) {
  .cat-row { grid-template-columns: 1fr; }
  .cat-modal { max-width: 100%; }
}

/* ========================================================================
   Static pages — public view (Phase 3)
   ======================================================================== */
.page-layout {
  max-width: 760px; margin: 28px auto 60px; padding: 0 20px;
  color: var(--text); line-height: 1.65;
}
.page-layout h1 { font-size: 32px; font-weight: 700; margin: 0 0 8px; }
.page-layout .page-updated { font-size: 12px; color: var(--text-muted); margin-bottom: 24px; }
.page-body h2 { font-size: 22px; font-weight: 700; margin: 28px 0 10px; }
.page-body h3 { font-size: 17px; font-weight: 600; margin: 22px 0 6px; }
.page-body p  { margin: 0 0 14px; }
.page-body ul { margin: 0 0 14px; padding-left: 24px; }
.page-body li { margin-bottom: 4px; }
.page-body a  { color: var(--tg-blue); }
.page-body a:hover { text-decoration: underline; }
.page-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-soft); padding: 1px 6px; border-radius: 4px; font-size: 0.92em;
}
.page-body strong { font-weight: 700; }
.page-body em { font-style: italic; }

.page-404 { max-width: 480px; margin: 80px auto; text-align: center; }
.page-404__icon { font-size: 64px; margin-bottom: 18px; }
.page-404__title { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.page-404__body { color: var(--text-secondary); margin-bottom: 24px; }

/* ========================================================================
   Admin Content editor (Phase 3)
   ======================================================================== */
.content-section { margin-bottom: 26px; }
.content-section--readonly { opacity: 0.7; }

/* Reuse .cat-toolbar / .cat-unsaved / .cat-modal-* from Phase 2 styles —
   the content editor's layout is identical except for the .content-row__lang
   tabs and per-language editor pane. */

.content-langs {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}
.content-langs__btn {
  padding: 4px 10px;
  background: transparent; border: 1px solid transparent;
  font-size: 13px; cursor: pointer; color: var(--text-secondary);
  border-radius: var(--radius);
}
.content-langs__btn:hover { background: var(--bg-soft); }
.content-langs__btn--active {
  background: var(--bg-soft); color: var(--text);
  border-color: var(--tg-blue);
  font-weight: 600;
}
.content-langs__badge {
  font-size: 11px; margin-left: 4px;
}

.content-row__title-input { width: 100%; }
.content-row__body-input {
  width: 100%; min-height: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; line-height: 1.55;
  padding: 10px 12px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  resize: vertical;
}
.content-preview {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
}
.content-preview__head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-muted); margin-bottom: 8px;
}
.content-preview__body { color: var(--text); }

.content-row--switch { display: flex; align-items: center; gap: 10px; }
.content-row--switch label { font-size: 13px; color: var(--text-secondary); }
.content-row__hint { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

/* ========================================================================
   Admin Translations editor (Phase 4)
   ======================================================================== */
.tr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 12px; }
.tr-toolbar__spacer { flex: 1; }

.tr-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.tr-table th, .tr-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}
.tr-table th {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-soft);
  position: sticky; top: 0; z-index: 1;
}
.tr-table td.tr-cell--key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-muted); font-size: 11px; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tr-table td.tr-cell--val {
  cursor: text;
  position: relative;
  max-width: 240px;
}
.tr-table td.tr-cell--val:hover { background: var(--bg-soft); }
.tr-table td.tr-cell--missing {
  background: rgba(255,164,38,0.08); color: var(--text-muted); font-style: italic;
  display: flex; flex-direction: column; gap: 2px;
}
.tr-table td.tr-cell--modified {
  border-left: 3px solid var(--tg-blue);
  padding-left: 6px;
}
.tr-cell--en-hint { font-size: 11px; color: var(--text-muted, #888); opacity: 0.7; }
.tr-table td.tr-cell--added::before { content: '➕ '; font-size: 11px; }
.tr-table td .tr-cell-edit {
  width: 100%; box-sizing: border-box;
  font-size: 12px; padding: 2px 6px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--tg-blue); border-radius: 4px;
}
.tr-table td .tr-cell-stale { font-size: 10px; margin-left: 4px; }

.tr-table-wrap {
  max-height: 70vh; overflow-y: auto; overflow-x: auto;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  background: var(--bg);
}

.tr-search { flex: 0 0 220px; }
.tr-stats { font-size: 12px; color: var(--text-muted); }

/* Inline edit-mode on the live site */
.admin-edit-mode [data-admin-target]:hover {
  outline: 2px dashed var(--tg-blue);
  cursor: pointer;
}
.admin-edit-mode-banner {
  position: fixed; bottom: 16px; right: 16px; z-index: 1500;
  padding: 10px 14px;
  background: var(--tg-blue); color: #fff;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  cursor: pointer;
}

@media (max-width: 720px) {
  .tr-search { flex: 1; }
  .tr-table-wrap { max-height: 60vh; }
}

/* ============================================================
   Geo autodetect — first-visit confirmation modal
   Re-uses .filter-popup-backdrop for the overlay (already styled).
   ============================================================ */
.geo-detect-popup {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 24px 22px 18px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  animation: fp-pop-in 0.18s ease;
  position: relative;
}
.geo-detect-popup__close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1;
  transition: background 0.15s;
  border: none; cursor: pointer;
}
.geo-detect-popup__close:hover { background: var(--border); }
.geo-detect-popup__flag {
  font-size: 38px; line-height: 1;
  margin-bottom: 10px;
  user-select: none;
}
.geo-detect-popup__title {
  font-size: 18px; font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.geo-detect-popup__body {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 18px;
  line-height: 1.5;
}
.geo-detect-popup__actions {
  display: flex; flex-direction: column;
  gap: 8px;
}
.geo-detect-popup__actions .btn {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
}
@media (prefers-reduced-motion: reduce) {
  .geo-detect-popup,
  .filter-popup-backdrop { animation: none; }
}

/* ========================================================================
   Admin External Integrations (Phase 5)
   ======================================================================== */
.int-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.int-row:last-child { border-bottom: 0; }
.int-row__icon { font-size: 18px; flex: 0 0 24px; text-align: center; }
.int-row__name { flex: 0 0 110px; font-weight: 600; font-size: 13px; }
.int-row__meta { flex: 1; color: var(--text-muted); font-size: 12px; }
.int-row__meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: var(--bg-soft); padding: 1px 4px; border-radius: 3px; }
.int-row__actions { flex: 0 0 auto; }
.int-row--disabled { opacity: 0.5; cursor: not-allowed; }
.int-row--disabled .int-row__meta { font-style: italic; }
.int-row--disabled .btn--mini[disabled] { cursor: not-allowed; }

.int-preview {
  width: 240px; height: 160px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}
.int-preview__err {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--danger, #c0392b);
  background: rgba(255,255,255,0.85);
  text-align: center; padding: 8px;
}

.int-csp-warn {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,164,38,0.08);
  border-left: 3px solid var(--warning);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 720px) {
  .int-preview { width: 100%; height: 140px; }
}
