/* ============================================================
   CityPlatform — Base + Components
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft-2); color: var(--brand-text); }

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 800; line-height: var(--lh-tight); letter-spacing: -0.02em; }

/* lang visibility */
[data-lang="ru"] .i18n-en { display: none; }
[data-lang="en"] .i18n-ru { display: none; }

/* ---------- Scrollbars ---------- */
.scroll-x { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.scroll-x::-webkit-scrollbar { display: none; }

/* ============================================================
   App shell / layout
   ============================================================ */
.app { min-height: 100dvh; padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); }

/* ---- Header ---- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--s-3);
  padding: 0 var(--s-4);
}
.hdr__brand { display: flex; align-items: center; gap: var(--s-2); flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--tc-400), var(--tc-600));
  display: grid; place-items: center; color: #fff;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.25);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); letter-spacing: -0.03em; color: var(--text); }
.brand-name span { color: var(--brand); }

.hdr__search {
  flex: 1; min-width: 0; max-width: 460px;
  display: flex; align-items: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-3);
  background: var(--surface-3); border: 1px solid transparent;
  border-radius: var(--r-pill); color: var(--text-2);
  transition: border-color .15s, background .15s;
}
.hdr__search:focus-within { border-color: var(--brand-ring); background: var(--surface); }
.hdr__search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: var(--fs-md); }
.hdr__search svg { width: 18px; height: 18px; flex-shrink: 0; }

.hdr__actions { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; flex-shrink: 0; }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  display: grid; place-items: center; color: var(--text);
  background: var(--surface-3); transition: background .15s, color .15s;
  position: relative;
}
.icon-btn:hover { background: var(--chip-bg); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--ghost { background: transparent; }
.icon-btn .badge-dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px;
  background: var(--brand); border-radius: 50%; border: 2px solid var(--surface);
}
.icon-btn .badge-num {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; display: grid; place-items: center; border: 2px solid var(--surface);
}
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 2px solid var(--border-2); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }

/* segmented toggles (lang / theme) */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button { padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.seg button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---- Niche tabs (FB-style) ---- */
.tabs {
  position: sticky; top: var(--header-h); z-index: 45;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; gap: var(--s-2); padding: var(--s-2) var(--s-3);
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s;
  will-change: transform;
}
.tabs.tabs--hidden { transform: translateY(calc(-100% - 2px)); opacity: 0; pointer-events: none; }
.tab {
  flex-shrink: 0; display: flex; flex-direction: row; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600; transition: background .15s, color .15s, border-color .15s;
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { border-color: var(--border-2); }
.tab__ico {
  width: 20px; height: 20px; border-radius: 0; box-shadow: none !important;
  display: grid; place-items: center; background: transparent !important;
  color: var(--nc, var(--brand));
  transition: color .15s;
}
.tab.is-on {
  color: color-mix(in srgb, var(--nc, var(--brand)) 78%, var(--text));
  background: color-mix(in srgb, var(--nc, var(--brand)) 13%, var(--surface));
  border-color: color-mix(in srgb, var(--nc, var(--brand)) 42%, var(--border));
}
.tab.is-on .tab__ico { color: var(--nc, var(--brand)); }

/* Per-niche identity, assigned by tab order (Food→Jobs) — colors the
   whole category bar without per-page markup edits. */
.tabs .tab:nth-child(1) { --nc: var(--niche-food); }
.tabs .tab:nth-child(2) { --nc: var(--niche-service); }
.tabs .tab:nth-child(3) { --nc: var(--niche-realty); }
.tabs .tab:nth-child(4) { --nc: var(--niche-health); }
.tabs .tab:nth-child(5) { --nc: var(--niche-shop); }
.tabs .tab:nth-child(6) { --nc: var(--niche-event); }
.tabs .tab:nth-child(7) { --nc: var(--niche-auto); }
.tabs .tab:nth-child(8) { --nc: var(--niche-jobs); }

/* ============================================================
   Main grid (desktop sidebars)
   ============================================================ */
.layout {
  max-width: var(--maxw); margin: 0 auto; padding: var(--s-4);
  display: grid; gap: var(--s-5);
  grid-template-columns: 1fr;
}
.col-left, .col-right { display: none; }
.col-main { min-width: 0; }

@media (min-width: 768px) {
  .layout { grid-template-columns: 1fr minmax(0, var(--col-right)); }
  .col-right { display: block; }
}
@media (min-width: 1080px) {
  .layout { grid-template-columns: var(--col-left) minmax(0, 1fr) var(--col-right); }
  .col-left { display: block; }
}

/* sticky sidebars */
.col-left .sticky-wrap, .col-right .sticky-wrap {
  position: sticky; top: calc(var(--header-h) + var(--tabs-h) + var(--s-4));
  display: flex; flex-direction: column; gap: var(--s-4);
}

/* ---- Left nav ---- */
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-3); border-radius: var(--r-md);
  font-weight: 600; color: var(--text); font-size: var(--fs-md);
  transition: background .15s;
}
.nav-item:hover { background: var(--surface-3); }
.nav-item.is-on { background: var(--brand-soft); color: var(--brand-text); }
.nav-item .ni-ico {
  width: 36px; height: 36px; border-radius: var(--r-sm); flex-shrink: 0;
  display: grid; place-items: center; background: var(--surface); color: var(--brand);
  box-shadow: var(--shadow-sm);
}
.nav-item.is-on .ni-ico { background: var(--brand); color: #fff; box-shadow: none; }
.nav-item .ni-ico svg { width: 19px; height: 19px; }
.nav-count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }

.nav-sep { height: 1px; background: var(--divider); margin: var(--s-3) var(--s-2); }
.nav-label { padding: var(--s-2) var(--s-3) var(--s-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: var(--s-4); }
.card__pad { padding: var(--s-4); }

/* org / listing card */
.org {
  display: flex; flex-direction: column;
}
.org__media { position: relative; aspect-ratio: 16/9; background: var(--surface-3); }
.org__media img { width: 100%; height: 100%; object-fit: cover; }
.org__media::after { content:""; position: absolute; inset: 0; background: var(--img-tint); }
.org__badges { position: absolute; top: var(--s-3); left: var(--s-3); display: flex; gap: var(--s-2); z-index: 2; }
.org__save {
  position: absolute; top: var(--s-3); right: var(--s-3); z-index: 2;
  width: 38px; height: 38px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(8px);
  color: var(--text); box-shadow: var(--shadow-sm);
}
.org__save svg { width: 19px; height: 19px; }
.org__save.is-saved { color: var(--brand); }
.org__save.is-saved svg { fill: currentColor; }

.org__head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4) 0; }
.org__logo { width: 48px; height: 48px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); margin-top: -28px; position: relative; z-index: 3; background: var(--surface); box-shadow: var(--shadow-sm); }
.org__title-row { display: flex; align-items: center; gap: 6px; }
.org__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.01em; }
.org__verify { width: 16px; height: 16px; color: var(--brand); }
.org__meta { font-size: var(--fs-sm); color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 1px; }
.dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.org__body { padding: var(--s-3) var(--s-4); }
.org__desc { font-size: var(--fs-md); color: var(--text); line-height: var(--lh-snug); }
.org__tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-3); }

.org__foot { display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-4) var(--s-4); }

/* rating */
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--fs-sm); }
.rating svg { width: 15px; height: 15px; color: var(--star); fill: var(--star); }
.rating small { color: var(--text-3); font-weight: 500; }

/* ============================================================
   Chips / tags / badges
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--chip-bg); color: var(--chip-text);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
}
.chip svg { width: 14px; height: 14px; }
.chip--brand { background: var(--brand-soft); color: var(--brand-text); }
.chip--outline { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.chip.is-on { background: var(--brand); color: #fff; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .01em;
  background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(6px);
  color: var(--text); box-shadow: var(--shadow-sm);
}
.badge svg { width: 13px; height: 13px; }
.badge--promo { background: var(--brand); color: #fff; }
.badge--ad { background: color-mix(in srgb, #000 8%, var(--surface)); color: var(--text-2); }
.badge--open { background: rgba(63,125,78,0.16); color: var(--ok); }
[data-theme="dark"] .badge--open { background: rgba(99,180,120,0.18); color: #7FC18E; }

/* niche pill */
.npill { --nc: var(--brand); display:inline-flex; align-items:center; gap:6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; color: var(--nc); background: color-mix(in srgb, var(--nc) 14%, transparent); }
.npill .npill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--nc); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 42px; padding: 0 var(--s-4); border-radius: var(--r-md);
  font-weight: 700; font-size: var(--fs-md); white-space: nowrap;
  transition: transform .06s, background .15s, box-shadow .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--brand); color: var(--text-on-brand); box-shadow: 0 1px 0 rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn--primary:hover { background: var(--brand-strong); }
.btn--soft { background: var(--brand-soft); color: var(--brand-text); }
.btn--soft:hover { background: var(--brand-soft-2); }
.btn--niche { background: var(--nc, var(--brand)); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18); }
[data-theme="dark"] .btn--niche { color: #1c130c; }
.btn--niche-soft { background: color-mix(in srgb, var(--nc, var(--brand)) 15%, transparent); color: color-mix(in srgb, var(--nc, var(--brand)) 72%, var(--text)); }
.btn--niche-soft:hover { background: color-mix(in srgb, var(--nc, var(--brand)) 24%, transparent); }
.btn--neutral { background: var(--surface-3); color: var(--text); }
.btn--neutral:hover { background: var(--chip-bg); }
.btn--outline { background: transparent; border: 1.5px solid var(--border-2); color: var(--text); }
.btn--outline:hover { border-color: var(--brand); color: var(--brand-text); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--block { width: 100%; }
.btn--sm { height: 34px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { height: 50px; padding: 0 var(--s-6); font-size: var(--fs-lg); }

/* ============================================================
   Banner / ad slots
   ============================================================ */
.adslot {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.adslot__label { position: absolute; top: 8px; left: 8px; z-index: 2; }
.adslot__media { position: relative; aspect-ratio: 16/7; }
.adslot__media img { width: 100%; height: 100%; object-fit: cover; }
.adslot__media::after { content:""; position:absolute; inset:0; background: linear-gradient(90deg, rgba(20,10,6,0.78), rgba(20,10,6,0.05)); }
.adslot__overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: var(--s-5); color: #fff; }
.adslot__overlay h4 { font-size: var(--fs-xl); color: #fff; }
.adslot__overlay p { font-size: var(--fs-sm); color: rgba(255,255,255,0.85); }

/* sidebar sponsor block */
.sponsor { padding: var(--s-4); }
.sponsor__head { display:flex; align-items:center; justify-content: space-between; margin-bottom: var(--s-3); }
.sponsor__head h5 { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-family: var(--font-ui); }
.sponsor__item { display: flex; gap: var(--s-3); padding: var(--s-2) 0; }
.sponsor__item img { width: 56px; height: 56px; border-radius: var(--r-md); object-fit: cover; flex-shrink: 0; }
.sponsor__item .si-name { font-weight: 700; font-size: var(--fs-md); }
.sponsor__item .si-meta { font-size: var(--fs-xs); color: var(--text-2); }

/* tip / hint card */
.tip { padding: var(--s-4); }
.tip__head { display:flex; align-items:center; gap: var(--s-2); margin-bottom: var(--s-2); font-weight: 700; font-size: var(--fs-sm); color: var(--brand-text); }
.tip__head svg { width: 18px; height: 18px; }
.tip p { font-size: var(--fs-sm); color: var(--text-2); line-height: var(--lh-snug); }

/* section title */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: var(--s-5) 0 var(--s-3); }
.sec-head h3 { font-size: var(--fs-xl); }
.sec-head a { font-size: var(--fs-sm); font-weight: 600; color: var(--brand-text); }

/* ============================================================
   Sticky bottom dock — Perplexity-style expanding search
   ============================================================ */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
  pointer-events: none;
}
.dock__inner {
  pointer-events: auto;
  width: 100%; max-width: 540px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px) saturate(1.35);
  border: 1px solid var(--border);
  border-radius: var(--r-pill); box-shadow: var(--shadow-md);
  opacity: .93;
  transition: border-radius .2s, box-shadow .2s, opacity .18s, transform .2s;
}
.dock__inner:hover { opacity: 1; box-shadow: var(--shadow-dock); }
.dock.is-open .dock__inner { opacity: 1; box-shadow: var(--shadow-dock); }
.dock__bar { display: flex; align-items: center; gap: var(--s-2); height: var(--dock-h); padding: 0 6px 0 var(--s-4); }
.dock__bar .d-search { flex: 1; display: flex; align-items: center; gap: var(--s-2); color: var(--text-2); min-width: 0; }
.dock__bar .d-search svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--brand); }
.dock__bar .d-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: var(--fs-md); color: var(--text); }
.dock__bar .d-search input::placeholder { color: var(--text-3); }
.dock__nav { display: flex; align-items: center; gap: 2px; }
.dock__nav .icon-btn { width: 42px; height: 42px; }
.dock__send { width: 38px; height: 38px; border-radius: var(--r-pill); background: var(--brand); color: var(--text-on-brand); display: grid; place-items: center; flex-shrink: 0; }
.dock__send svg { width: 18px; height: 18px; }

.dock__panel { max-height: 0; opacity: 0; transition: max-height .25s ease, opacity .2s; border-top: 0 solid var(--divider); }
.dock.is-open .dock__inner { border-radius: var(--r-xl); }
.dock.is-open .dock__panel { max-height: 60vh; opacity: 1; border-top: 1px solid var(--divider); overflow-y: auto; }
.dock__panel-pad { padding: var(--s-4); }
.dock__suggest-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--s-2); }
.dock__quick { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.dock__sug { display: flex; align-items: center; gap: var(--s-3); padding: 10px var(--s-2); border-radius: var(--r-md); }
.dock__sug:hover { background: var(--surface-3); }
.dock__sug .ds-ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.dock__sug .ds-ico svg { width: 18px; height: 18px; }
.dock__sug .ds-name { font-weight: 600; }
.dock__sug .ds-meta { font-size: var(--fs-xs); color: var(--text-2); }
.dock__sug svg.ds-arrow { width: 16px; height: 16px; margin-left: auto; color: var(--text-3); }

/* backdrop when dock open */
.dock-backdrop { position: fixed; inset: 0; z-index: 65; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity .2s; }
.dock-backdrop.is-on { opacity: 1; visibility: visible; }

@media (min-width: 768px) {
  .dock__nav .lbl { display: none; }
}

/* hide bottom dock nav icons that duplicate left nav on desktop is fine to keep */

/* ============================================================
   Misc utilities
   ============================================================ */
.muted { color: var(--text-2); }
.meta { font-size: var(--fs-sm); color: var(--text-3); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: var(--s-1);} .gap-2 { gap: var(--s-2);} .gap-3 { gap: var(--s-3);} .gap-4{ gap: var(--s-4);}
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { align-items: center; }
.between { justify-content: space-between; }
.hide-mobile { display: none; }
@media (min-width: 768px){ .hide-mobile { display: revert; } .only-mobile { display: none; } }

/* ============================================================
   CHROME v2 — compact header, account menu, drawer, dock modes
   ============================================================ */

/* ---- Header: dominant centered search, quiet right ---- */
.hdr__ham { flex-shrink: 0; }
.hdr__search--main {
  flex: 1; max-width: 680px; margin: 0 var(--s-2);
  height: 42px;
}
.brand-name--sm { display: none; }
@media (min-width: 600px) { .brand-name--sm { display: inline; } }
@media (max-width: 599px) {
  .hdr { gap: var(--s-2); padding: 0 var(--s-3); }
  .hdr__search--main { margin: 0; }
}

/* ---- Scrims ---- */
.scrim { position: fixed; inset: 0; z-index: 88; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity .22s; }
.scrim.is-on { opacity: 1; visibility: visible; }
.menu-scrim { position: fixed; inset: 0; z-index: 96; background: transparent; visibility: hidden; }
.menu-scrim.is-on { visibility: visible; }

/* ---- Account menu (top-right popover) ---- */
.acct-pop {
  position: fixed; top: calc(var(--header-h) + 6px); right: 10px; z-index: 97;
  width: 290px; max-width: calc(100vw - 20px);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; transform-origin: top right;
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.acct-pop.is-open { opacity: 1; visibility: visible; transform: none; }
.mp__user { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); background: linear-gradient(135deg, var(--brand-soft), transparent); }
.mp__user img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); box-shadow: var(--shadow-sm); }
.mp__user .mp__name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); }
.mp__user .mp__sub { font-size: var(--fs-xs); color: var(--text-2); }
.mp__row { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--s-4); }
.mp__row .mp__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: var(--s-2); }
.mp__row .mp__label svg { width: 17px; height: 17px; }
.mp__sep { height: 1px; background: var(--divider); margin: var(--s-2) 0; }
.mp__link { display: flex; align-items: center; gap: var(--s-3); padding: 11px var(--s-4); font-weight: 600; font-size: var(--fs-md); color: var(--text); }
.mp__link:hover { background: var(--surface-3); }
.mp__link svg { width: 19px; height: 19px; color: var(--text-2); }
.mp__link.is-danger { color: var(--danger); }
.mp__link.is-danger svg { color: var(--danger); }

/* ---- Left drawer (hamburger nav) ---- */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 90;
  width: 312px; max-width: 86vw;
  background: var(--surface); border-right: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(-102%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer__head { position: sticky; top: 0; background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding: var(--s-4); border-bottom: 1px solid var(--divider); z-index: 2; }
.drawer__body { padding: var(--s-3) var(--s-3) var(--s-6); }
.drawer__label { padding: var(--s-4) var(--s-3) var(--s-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.niche-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-1); }
.niche-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: var(--s-2) 4px; border-radius: var(--r-md); font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); text-align: center; }
.niche-tile:hover { background: var(--surface-3); }
.niche-tile .nt-ico { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; background: color-mix(in srgb, var(--nc) 15%, var(--surface-3)); color: var(--nc); }
.niche-tile .nt-ico svg { width: 21px; height: 21px; }

/* ---- Dock modes + chat ---- */
.dock__modes { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4) 0; }
.dock__seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.dock__seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.dock__seg button svg { width: 16px; height: 16px; }
.dock__seg button.is-on { background: var(--surface); color: var(--brand-text); box-shadow: var(--shadow-sm); }
.dock__view { display: none; }
.dock__view.is-on { display: block; }

.chat { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-2) 0; }
.bubble-row { display: flex; gap: var(--s-2); align-items: flex-end; max-width: 88%; }
.bubble-row--me { align-self: flex-end; flex-direction: row-reverse; }
.bot-ava { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, var(--tc-400), var(--tc-600)); box-shadow: var(--shadow-sm); }
.bot-ava svg { width: 17px; height: 17px; }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: var(--fs-md); line-height: var(--lh-snug); }
.bubble--bot { background: var(--surface-3); color: var(--text); border-bottom-left-radius: 6px; }
.bubble--me { background: var(--brand); color: var(--text-on-brand); border-bottom-right-radius: 6px; }
.chat__hint { font-size: var(--fs-xs); color: var(--text-3); text-align: center; padding: var(--s-2) 0; }

/* ============================================================
   SOCIAL FEED — 2-up mobile tiles, FB-style actions
   ============================================================ */
.feed2 { columns: 2; column-gap: var(--s-3); }
.feed2 > * { break-inside: avoid; margin-bottom: var(--s-3); display: inline-block; width: 100%; }
@media (min-width: 760px) { .feed2 { columns: 3; } }
@media (min-width: 1080px) { .feed2 { columns: 2; } }
@media (min-width: 1240px) { .feed2 { columns: 3; } }

.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.post__head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); }
.post__head img.pa { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.post__head .pn { font-weight: 700; font-size: var(--fs-sm); line-height: 1.1; }
.post__head .pm { font-size: 11px; color: var(--text-3); }
.post__media { position: relative; }
.post__media img { width: 100%; display: block; }
.post__media .org__save { top: var(--s-2); right: var(--s-2); width: 32px; height: 32px; }
.post__media .org__save svg { width: 16px; height: 16px; }
.post__npill { position: absolute; left: var(--s-2); bottom: var(--s-2); z-index: 2; }
.post__body { padding: var(--s-3); }
.post__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); line-height: var(--lh-snug); letter-spacing: -.01em; }
.post__meta { font-size: var(--fs-xs); color: var(--text-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.post__text { font-size: var(--fs-sm); color: var(--text-2); line-height: var(--lh-snug); margin-top: 6px; }

/* counters strip */
.post__stats { display: flex; align-items: center; gap: var(--s-2); padding: 6px var(--s-3); font-size: 11px; color: var(--text-3); border-top: 1px solid var(--divider); }
.post__stats .heart-mini { width: 15px; height: 15px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-grid; place-items: center; }
.post__stats .heart-mini svg { width: 9px; height: 9px; }

/* action bar */
.actions { display: flex; align-items: stretch; border-top: 1px solid var(--divider); }
.act { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); transition: background .12s, color .12s; }
.act:hover { background: var(--surface-3); }
.act svg { width: 17px; height: 17px; }
.act .act-lbl { display: none; }
@media (min-width: 420px) { .act .act-lbl { display: inline; } }
.act.is-on { color: var(--brand); }
.act.is-on svg { fill: color-mix(in srgb, var(--brand) 22%, transparent); }
.act.like.is-on { color: var(--brand); }
.act.dislike.is-on { color: var(--info); }
.act + .act { border-left: 1px solid var(--divider); }

/* ============================================================
   BOTTOM SHEET (filters / comments) — mobile-first
   ============================================================ */
.sheet-scrim { position: fixed; inset: 0; z-index: 98; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity .25s; }
.sheet-scrim.is-on { opacity: 1; visibility: visible; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 99;
  background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(101%); transition: transform .3s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column; max-height: 90vh;
  margin: 0 auto; max-width: 560px;
}
.sheet.is-open { transform: none; }
.sheet__grip { width: 40px; height: 4px; border-radius: 99px; background: var(--border-2); margin: 10px auto 4px; flex-shrink: 0; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-2) var(--s-4) var(--s-3); border-bottom: 1px solid var(--divider); }
.sheet__head h3 { font-size: var(--fs-xl); }
.sheet__body { overflow-y: auto; padding: var(--s-4); -webkit-overflow-scrolling: touch; }
.sheet__foot { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--divider); background: var(--surface); }

.fgroup { margin-bottom: var(--s-5); }
.fgroup > .flabel { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: var(--fs-md); margin-bottom: var(--s-3); font-family: var(--font-display); }
.fgroup .flabel .fval { font-size: var(--fs-sm); font-weight: 700; color: var(--brand-text); font-family: var(--font-ui); }
.choices { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.choice {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: var(--r-md);
  background: var(--surface-3); border: 1.5px solid transparent; color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; transition: background .12s, border-color .12s, color .12s;
}
.choice svg { width: 16px; height: 16px; }
.choice.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-text); }
.choice.is-on svg { color: var(--brand); }

/* price segmented */
.priceseg { display: flex; gap: var(--s-2); }
.priceseg .choice { flex: 1; justify-content: center; font-family: var(--font-display); font-weight: 800; }

/* sort segmented full */
.sortseg { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }

/* range slider */
.range-wrap { padding: var(--s-1) 2px; }
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) var(--p,50%), var(--surface-3) var(--p,50%), var(--surface-3) 100%);
  outline: none;
}
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); box-shadow: var(--shadow-md); cursor: pointer; }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); box-shadow: var(--shadow-md); cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) 0; }
.switch-row .sr-label { display: flex; align-items: center; gap: var(--s-3); font-weight: 600; }
.switch-row .sr-label .sr-ico { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.switch-row .sr-label .sr-ico svg { width: 18px; height: 18px; }
.switch { width: 48px; height: 28px; border-radius: 99px; background: var(--border-2); position: relative; flex-shrink: 0; transition: background .18s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s; }
.switch.is-on { background: var(--brand); }
.switch.is-on::after { transform: translateX(20px); }

.fsep { height: 1px; background: var(--divider); margin: var(--s-4) 0; }

/* filter trigger row (page) */
.filterrow { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; }
.filterrow .scroll-x { display: flex; gap: var(--s-2); }
.fbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--brand); color: var(--text-on-brand); font-weight: 700; font-size: var(--fs-sm); flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.fbtn svg { width: 17px; height: 17px; }
.fbtn .fbtn-count { background: color-mix(in srgb, #000 18%, var(--brand)); border-radius: 99px; padding: 0 7px; font-size: 11px; min-width: 18px; text-align: center; }

/* comments */
.cmt { display: flex; gap: var(--s-2); padding: var(--s-3) 0; border-bottom: 1px solid var(--divider); }
.cmt img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cmt__bubble { background: var(--surface-3); border-radius: var(--r-md); padding: 8px 12px; }
.cmt__name { font-weight: 700; font-size: var(--fs-sm); }
.cmt__text { font-size: var(--fs-sm); color: var(--text); line-height: var(--lh-snug); }
.cmt__meta { display: flex; gap: var(--s-3); font-size: 11px; color: var(--text-3); font-weight: 600; padding: 5px 4px 0; }
.cmt-composer { display: flex; align-items: center; gap: var(--s-2); width: 100%; }
.cmt-composer input { flex: 1; min-width: 0; height: 42px; padding: 0 var(--s-4); border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid transparent; outline: none; font-size: var(--fs-md); }
.cmt-composer input:focus { border-color: var(--brand-ring); background: var(--surface); }

/* ============================================================
   PERPLEXITY-STYLE inline answer (generated on the page)
   ============================================================ */
.answers { display: flex; flex-direction: column; gap: var(--s-3); margin-bottom: var(--s-4); }
.answer { background: var(--surface); border: 1.5px solid var(--brand-ring); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; animation: answerIn .32s cubic-bezier(.2,.7,.2,1); }
@keyframes answerIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.answer__head { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-4) var(--s-4) var(--s-3); }
.answer__head .bot-ava { width: 36px; height: 36px; }
.answer__head .bot-ava svg { width: 20px; height: 20px; }
.answer__q { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.01em; line-height: var(--lh-snug); }
.answer__src { font-size: var(--fs-xs); color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 7px; }
.answer__src .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.answer__close { margin-left: auto; width: 32px; height: 32px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--text-3); flex-shrink: 0; }
.answer__close:hover { background: var(--surface-3); color: var(--text); }
.answer__close svg { width: 17px; height: 17px; }
.answer__body { padding: 0 var(--s-4) var(--s-4); }
.answer__text { font-size: var(--fs-md); line-height: var(--lh-normal); color: var(--text); }
.answer__text b { color: var(--brand-text); font-weight: 700; }
.answer__places { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-3); }
.aplace { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-2); border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); transition: border-color .12s, background .12s; }
.aplace:hover { border-color: var(--brand-ring); }
.aplace img { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.aplace .ap-name { font-weight: 700; font-size: var(--fs-md); }
.aplace .ap-meta { font-size: var(--fs-xs); color: var(--text-2); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.aplace .ap-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.answer__foot { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); align-items: center; }
.answer__dots { display: inline-flex; gap: 4px; padding: var(--s-2) 0; }
.answer__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); opacity: .4; animation: adot 1s infinite; }
.answer__dots i:nth-child(2){ animation-delay: .15s; } .answer__dots i:nth-child(3){ animation-delay: .3s; }
@keyframes adot { 0%,100%{ opacity:.3; transform: translateY(0);} 50%{ opacity:1; transform: translateY(-3px);} }

/* dock mode descriptor */
.dock__seg button .seg-sub { display: none; }
.dock__modehint { font-size: var(--fs-xs); color: var(--text-3); padding: 2px var(--s-4) 0; }
