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

: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;

  /* 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;
  --text-secondary: #9AA0A6;
  --text-muted:     #6B7177;
  --border:         #2A2F36;
  --border-light:   #232830;
  --bg:             #15181C;
  --bg-alt:         #1E2228;
  --bg-soft:        #181B20;
  --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);
}
:root[data-theme="dark"] .topbar {
  background: linear-gradient(135deg, #1A6FA0 0%, #155A85 100%);
}
: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"] .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 */
}

/* ====== 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-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
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
   ======================================================================== */
.topbar {
  background: linear-gradient(135deg, var(--tg-blue) 0%, var(--tg-blue-dark) 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; height: 64px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; letter-spacing: -0.5px;
  color: #fff; flex-shrink: 0;
  text-decoration: none;
}
.logo__mark {
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
  transition: transform 0.2s ease;
}
.logo:hover .logo__mark { transform: rotate(-6deg) scale(1.06); }
.logo__word { display: inline-flex; align-items: baseline; line-height: 1; }
.logo__word-swift { font-weight: 700; }
.logo__word-deal  { font-weight: 400; opacity: 0.92; }
.logo__word-dot {
  display: inline-block;
  margin: 0 1px;
  font-weight: 700;
  opacity: 0.6;
  transform: translateY(-2px);
}

.location-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 14px; font-weight: 500;
  transition: background 0.15s;
}
.location-btn:hover { background: rgba(255,255,255,0.25); }

/* ====== 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: 560px;
  display: flex; align-items: center;
  background: #fff;
  border-radius: var(--radius-full);
  padding: 0 6px 0 18px; height: 42px;
}
.search input {
  flex: 1; border: none; outline: none;
  font-size: 15px; background: transparent;
  /* Topbar pill bg is hard-coded white in both themes — text stays dark. */
  color: #1F2328;
}
.search input::placeholder { color: #8B95A1; }
.search button {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  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: 8px;
  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: #fff;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.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: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--radius-full);
  transition: background 0.15s, transform 0.15s;
  font-size: 18px;
  line-height: 1;
}
.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}
.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: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
  transition: background 0.15s;
}
.lang-dd__btn:hover { background: rgba(255,255,255,0.25); }
.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: 180px;
  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: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  text-align: left;
  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: 18px; }
.lang-dd__check {
  margin-left: auto;
  color: var(--tg-blue);
  font-size: 14px;
  visibility: hidden;
}
.lang-dd__item.active .lang-dd__check { visibility: visible; }

/* ====== 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: #fff; color: var(--tg-blue-dark); }
.btn--primary:hover { background: var(--tg-blue-light); transform: translateY(-1px); }
.btn--ghost { color: #fff; background: transparent; }
.btn--ghost:hover { background: rgba(255,255,255,0.15); }
.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: #fff;
  border-bottom: 1px solid var(--border-light);
  padding: 12px 0;
  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-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;
}
.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);
}

@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; }

.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; }

/* ========================================================================
   Feature flags
   ======================================================================== */
.flag-row {
  display: grid;
  grid-template-columns: 1fr 260px 60px;
  gap: 16px;
  align-items: center;
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-light);
}
.flag-row:last-child { border-bottom: none; }
.flag-row__name { font-weight: 600; font-size: 14px; }
.flag-row__key  { font-size: 11px; color: var(--text-muted); }
.flag-row__rollout { display: flex; align-items: center; gap: 10px; }
.flag-row__rollout input[type="range"] { flex: 1; accent-color: var(--tg-blue); }
.flag-row__pct { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

.switch {
  position: relative; display: inline-block;
  width: 46px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}
.switch__slider::before {
  content: ''; position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.switch input:checked + .switch__slider { background: var(--tg-blue); }
.switch input:checked + .switch__slider::before { transform: translateX(20px); }

/* ========================================================================
   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-brand__live {
  margin-left: auto;
  font-size: 12px;
  color: #9AA0A6;
}
.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;
  grid-template-columns: repeat(6, 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;
}
.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;
  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); }

.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); }

.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 {
  border-color: var(--tg-blue);
  background: var(--tg-blue-light);
}
.photo-drop__icon { font-size: 40px; margin-bottom: 8px; }

.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;
}
.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;
}
.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;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 9px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.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);
}
.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; }

.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; }
}
