/* ============================================================
   Nova Oglasi - Oglasi
   Clean centered layout, green accent, product cards
   ============================================================ */
:root {
  color-scheme: light;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-display: "Fraunces", serif;
  --ink: #1b1b1f;
  --ink-secondary: #2f2f37;
  --muted: #696974;
  --muted-light: #6d6d78;
  --primary: #0f766e;
  --primary-strong: #0b645d;
  --primary-deep: #064e4a;
  --primary-rgb: 15 118 110;
  --accent: #c2410c;
  --accent-glow: rgba(194, 65, 12, 0.1);
  --red: #e74c3c;
  --green: #15803d;
  --green-rgb: 21 128 61;
  --surface: #fffefc;
  --surface-soft: #f7f1e8;
  --surface-muted: #f0e9de;
  --surface-rgb: 255 254 252;
  --surface-soft-rgb: 247 241 232;
  --surface-muted-rgb: 240 233 222;
  --bg-solid: #f6f2ea;
  --bg-solid-rgb: 246 242 234;
  --bg-canvas: radial-gradient(1000px 700px at 14% 12%, rgba(15, 118, 110, 0.09), transparent 60%), radial-gradient(900px 620px at 86% 18%, rgba(194, 65, 12, 0.06), transparent 58%), linear-gradient(180deg, #f6f2ea 0%, #f2eadd 100%);
  --border: #e7ded2;
  --border-light: #efe6da;
  --shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 10px 28px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 18px 70px rgba(17, 24, 39, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --page-frame-radius: 28px;
  --page-frame-radius-mobile: 22px;
  --glass: #ffffff;
  --card-bg: #fffefc;
  --hero-bg: linear-gradient(135deg, #0b1c1a 0%, #102826 55%, #1b1b1f 100%);
  --hero-border: transparent;
  --topbar-bg: #fffefc;
  --bg-gradient: none;
  --bg-overlay: radial-gradient(1200px 600px at 20% 10%, rgba(255, 254, 252, 0.62), rgba(246, 242, 234, 0.92));
  --bg-image: none;
  --bg-image-opacity: 0.9;
  --bg-overlay-opacity: 1;
  --ui-glass-alpha: 1;
  --ad-a: calc(0.5 + var(--ui-glass-alpha) * 0.5);
  --ad-b: calc(0.7 + var(--ui-glass-alpha) * 0.3);
  --ui-glass-blur: 18px;
  --ui-glass-saturate: 1.35;
  --ui-glass-border: rgba(0, 0, 0, 0.08);
  --ui-glass-highlight: rgba(255, 255, 255, 0.55);
  --glow: rgba(15, 118, 110, 0.14);
  --glow-strong: rgba(15, 118, 110, 0.28);
  --ghost-bg: rgba(15, 118, 110, 0.07);
  --ghost-border: rgba(15, 118, 110, 0.22);
  --ghost-surface: #f7f1e8;
  --btn-hover: #f0e9de;
  --btn-border-hover: #d9cfbf;
  --caret-color: #0b645d;
  --primary-ink: #ffffff;
  --primary-shadow: 0 12px 26px rgba(15, 118, 110, 0.18);
  --chat-me-bg: rgba(15, 118, 110, 0.08);
  --badge-active-bg: rgba(15, 118, 110, 0.1);
  --badge-flagged-bg: rgba(245, 158, 11, 0.1);
  --badge-flagged-fg: #b45309;
  --badge-scheduled-bg: rgba(37, 99, 235, 0.1);
  --badge-scheduled-fg: #1d4ed8;
  --badge-removed-bg: rgba(148, 163, 184, 0.1);
  --badge-removed-fg: #64748b;
  --overlay: rgba(0, 0, 0, 0.35);
  --overlay-strong: rgba(0, 0, 0, 0.6);
  --overlay-ink: #fff;
  --surface-alpha-60: rgba(255, 255, 255, 0.7);
  --surface-alpha-70: rgba(255, 255, 255, 0.85);
  --inset-highlight: rgba(255, 255, 255, 0.5);
  --inset-highlight-soft: rgba(255, 255, 255, 0.3);
  --panel-header-bg: var(--surface);
  --pill-bg: rgba(var(--primary-rgb) / 0.07);
  --chart-bg: var(--surface-soft);
  --chart-track-bg: var(--surface-muted);
  --toast-bg: var(--surface);
  --toast-border: var(--border);
  --dialog-bg: var(--surface);
  --page-max: 1100px;
  --ads-per-row: 6;
  --home-sticky-mobile-radius: 18px;
  --home-sticky-mobile-search-height: 44px;
  --home-sticky-mobile-topbar-padding: 10px 12px 8px;
  --home-sticky-mobile-filterbar-padding: 8px 12px 12px;
  --home-sticky-mobile-topbar-compact-padding: 8px 8px 10px;
  --mobile-bottom-nav-gap: 4px;
  --mobile-bottom-nav-padding-x: 8px;
  --mobile-bottom-nav-padding-y: 6px;
  --mobile-bottom-nav-item-min-height: 52px;
  --mobile-bottom-nav-body-offset: 92px;
  --page-transition-duration-ms: 320;
  --page-transition-ms: var(--motion-320);
  --page-transition-distance: 12px;
  --page-transition-scale: 0.992;
  --filterbar-bg: transparent;
  --filterbar-border: transparent;
  --filterbar-highlight: transparent;
  --filterchip-bg: transparent;
  --filterchip-bg-hover: rgba(27, 27, 31, 0.055);
  --filterchip-bg-active: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(232, 244, 243, 0.94));
  --filterchip-border: transparent;
  --filterchip-border-hover: rgba(27, 27, 31, 0.22);
  --filterchip-border-active: rgba(var(--primary-rgb) / 0.42);
  --filterchip-text: rgba(27, 27, 31, 0.84);
  --filterchip-text-active: #0b3d3a;
  --filterchip-shadow: none;
  --filterchip-shadow-hover: 0 0 0 1px rgba(27, 27, 31, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --filterchip-shadow-active: 0 0 0 1px rgba(var(--primary-rgb) / 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.74), inset 0 -1px 0 rgba(var(--primary-rgb) / 0.18);
  --filterchip-focus-ring: rgba(var(--primary-rgb) / 0.55);
  --filterchip-inner-border: transparent;
  --filterchip-inner-border-active: transparent;
  --filterchip-close-bg: rgba(27, 27, 31, 0.08);
  --filterchip-close-bg-hover: rgba(27, 27, 31, 0.16);
  --filterchip-close-border: rgba(27, 27, 31, 0.2);
  --filterchip-close-bg-active: rgba(var(--primary-rgb) / 0.14);
  --filterchip-close-border-active: rgba(var(--primary-rgb) / 0.28);
}
/* Kriticno: uporabi takoj na zacetku CSS, da "hidden" elementi ne utripnejo ob refreshu. */
.hidden {
  display: none !important;
}

html[data-auth-state="user"] .top-actions :is(#newAdBtn, #myAdsBtn, #profileBtn, #profileLink, #recentLink, #favoritesLink, #priceAlertsLink, #postAdLink, #myAdsLink, #logoutBtn, #messagesBtn).hidden {
  display: inline-flex !important;
}

html[data-auth-state="user"].nova-auth-pending .top-actions :is(#newAdBtn, #myAdsBtn, #profileBtn, #profileLink, #recentLink, #favoritesLink, #priceAlertsLink, #postAdLink, #myAdsLink, #logoutBtn, #messagesBtn),
html[data-auth-state="guest"].nova-auth-pending .top-actions #loginLink {
  visibility: visible;
  pointer-events: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:root[data-motion-speed="fast"] {
  --page-transition-distance: 8px;
  --page-transition-scale: 0.996;
}

:root[data-motion-speed="medium"] {
  --page-transition-distance: 12px;
  --page-transition-scale: 0.992;
}

:root[data-motion-speed="slow"] {
  --page-transition-distance: 18px;
  --page-transition-scale: 0.986;
}

@media (prefers-reduced-motion: no-preference) {
  :root.nova-page-entering .page,
  :root.nova-page-leaving .page {
    backface-visibility: hidden;
    transform-origin: center top;
    will-change: opacity, transform, filter;
  }

  :root.nova-page-entering .page {
    opacity: 0.86;
    filter: blur(1.5px);
    transform: translate3d(0, var(--page-transition-distance), 0) scale(var(--page-transition-scale));
  }

  :root.nova-page-entering.nova-page-entered .page {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
    transition:
      opacity var(--page-transition-ms) var(--motion-ease),
      transform var(--page-transition-ms) var(--motion-ease),
      filter var(--page-transition-ms) var(--motion-ease);
  }

  :root.nova-page-leaving .page {
    opacity: 0.72;
    filter: blur(1.5px);
    transform: translate3d(0, calc(var(--page-transition-distance) * -0.6), 0) scale(0.996);
    transition:
      opacity var(--page-transition-ms) var(--motion-ease),
      transform var(--page-transition-ms) var(--motion-ease),
      filter var(--page-transition-ms) var(--motion-ease);
  }
}

:root.nova-page-transitions-disabled .page {
  opacity: 1;
  transition: none;
  animation: none;
  transform: none;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  :root .page {
    opacity: 1 !important;
    transition: none !important;
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f2ee;
  --ink-secondary: #d5d0c8;
  --muted: #a09a92;
  --muted-light: #a09a92;
  --primary: #2dd4bf;
  --primary-strong: #14b8a6;
  --primary-deep: #0f766e;
  --primary-rgb: 45 212 191;
  --green: #22c55e;
  --green-rgb: 34 197 94;
  --surface: #15151c;
  --surface-soft: #1b1b24;
  --surface-muted: #21212c;
  --bg-solid: #0b0b10;
  --surface-rgb: 21 21 28;
  --surface-soft-rgb: 27 27 36;
  --surface-muted-rgb: 33 33 44;
  --bg-solid-rgb: 11 11 16;
  --bg-canvas: radial-gradient(1100px 760px at 14% 12%, rgba(45, 212, 191, 0.12), transparent 62%), radial-gradient(900px 640px at 86% 18%, rgba(194, 65, 12, 0.08), transparent 58%), linear-gradient(180deg, #0b0b10 0%, #111118 100%);
  --border: #2a2a34;
  --border-light: #23232e;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, 0.45);
  --glass: #15151c;
  --card-bg: #15151c;
  --topbar-bg: #15151c;
  --hero-bg: linear-gradient(135deg, #071312, #12121a);
  --glow: rgba(45, 212, 191, 0.12);
  --glow-strong: rgba(45, 212, 191, 0.22);
  --ghost-bg: rgba(45, 212, 191, 0.1);
  --ghost-border: rgba(45, 212, 191, 0.22);
  --btn-hover: #22222d;
  --btn-border-hover: #353542;
  --caret-color: #5eead4;
  --primary-ink: #071312;
  --primary-shadow: 0 12px 24px rgba(45, 212, 191, 0.14);
  --overlay: rgba(0, 0, 0, 0.6);
  --chat-me-bg: rgba(45, 212, 191, 0.12);
  --toast-bg: #15151c;
  --dialog-bg: #15151c;
  --bg-gradient: none;
  --bg-overlay: radial-gradient(1200px 600px at 20% 10%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.82));
  --ui-glass-border: rgba(255, 255, 255, 0.08);
  --ui-glass-highlight: rgba(255, 255, 255, 0.08);
  --pill-bg: rgba(45, 212, 191, 0.1);
  --chart-bg: #1b1b24;
  --chart-track-bg: #21212c;
  --surface-alpha-60: rgba(21, 21, 28, 0.7);
  --surface-alpha-70: rgba(21, 21, 28, 0.86);
  --inset-highlight: rgba(255, 255, 255, 0.03);
  --badge-active-bg: rgba(45, 212, 191, 0.12);
  --badge-flagged-bg: rgba(245, 158, 11, 0.12);
  --badge-flagged-fg: #fbbf24;
  --badge-scheduled-bg: rgba(96, 165, 250, 0.16);
  --badge-scheduled-fg: #93c5fd;
  --badge-removed-bg: rgba(148, 163, 184, 0.1);
  --badge-removed-fg: #94a3b8;
  --filterbar-bg: transparent;
  --filterbar-border: transparent;
  --filterbar-highlight: transparent;
  --filterchip-bg: transparent;
  --filterchip-bg-hover: rgba(255, 255, 255, 0.08);
  --filterchip-bg-active: linear-gradient(145deg, rgba(11, 17, 30, 0.98), rgba(18, 29, 46, 0.96));
  --filterchip-border: transparent;
  --filterchip-border-hover: rgba(236, 246, 255, 0.22);
  --filterchip-border-active: rgba(236, 246, 255, 0.24);
  --filterchip-text: rgba(233, 242, 250, 0.86);
  --filterchip-text-active: #f8fdff;
  --filterchip-shadow: none;
  --filterchip-shadow-hover: 0 0 0 1px rgba(236, 246, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  --filterchip-shadow-active: 0 0 0 1px rgba(236, 246, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.16), inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  --filterchip-focus-ring: rgba(173, 243, 237, 0.74);
  --filterchip-inner-border: transparent;
  --filterchip-inner-border-active: transparent;
  --filterchip-close-bg: rgba(255, 255, 255, 0.12);
  --filterchip-close-bg-hover: rgba(255, 255, 255, 0.24);
  --filterchip-close-border: rgba(236, 246, 255, 0.34);
  --filterchip-close-bg-active: rgba(5, 63, 78, 0.52);
  --filterchip-close-border-active: rgba(196, 246, 240, 0.6);
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-canvas, var(--bg-solid));
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-320);
}
:root:not(.nova-bg-transition-ready) body::before,
:root:not(.nova-bg-transition-ready) body::after {
  transition: none;
}
body::before {
  z-index: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
}
body::after {
  z-index: 1;
  background-image: var(--bg-overlay);
  background-size: cover;
}
:root.has-custom-bg body::before {
  opacity: var(--bg-image-opacity);
}
:root.has-custom-bg body::after {
  opacity: var(--bg-overlay-opacity);
}
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
h3,
h4 {
  font-family: var(--font-body);
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}
html {
  scroll-behavior: smooth;
}
/* ===== PAGE: simple centered, no sidebars ===== */
/* Outer page frame - rounded white card on gray bg like the design */
.page {
  min-height: calc(100vh - 48px);
  min-height: calc(100dvh - 48px);
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  margin: 24px;
  background: var(--surface);
  border-radius: var(--page-frame-radius);
  box-shadow:
    0 18px 60px rgba(17, 24, 39, 0.08),
    0 0 0 1px rgba(27, 27, 31, 0.06);
  overflow: hidden;
}
.page::before,
.page::after {
  display: none;
}
:root.has-custom-bg .page {
  background: linear-gradient(180deg, rgb(var(--surface-rgb) / 0.62) 0%, rgb(var(--surface-soft-rgb) / 0.52) 100%);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}


/* ===== HOME (TRG-style) LAYOUT ===== */
.page.trg-page {
  /* Teal accent like the reference UI */
  --primary: #0f766e;
  --primary-strong: #0b645d;
  --primary-deep: #064e4a;
  --primary-rgb: 15 118 110;
  --accent: #c2410c;
  --glow: rgba(15, 118, 110, 0.14);
  --glow-strong: rgba(15, 118, 110, 0.28);
  --ghost-bg: rgba(15, 118, 110, 0.07);
  --ghost-border: rgba(15, 118, 110, 0.22);
  --primary-shadow: 0 12px 26px rgba(15, 118, 110, 0.18);
}
/* Subpages: keep content from feeling stretched on wide screens. */
.page.profile-page,
.page.myads-page,
.page.post-page,
.page.admin-page {
  --page-max: 980px;
}
.home-shell {
  flex: 1;
  display: grid;
  grid-template-columns: clamp(204px, 20vw, 248px) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: 0;
  border-radius: inherit;
}
.home-sidebar {
  grid-column: 1;
  grid-row: 1;
  padding: 0 14px 14px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--page-frame-radius) 0 0 var(--page-frame-radius);
}
:root.has-custom-bg .topbar,
:root.has-custom-bg .home-sidebar {
  backdrop-filter: blur(16px) saturate(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.05);
}
:root.has-custom-bg .topbar {
  background: rgb(var(--surface-rgb) / 0.72);
}
:root.has-custom-bg .home-sidebar {
  background: linear-gradient(180deg, rgb(var(--surface-rgb) / 0.74) 0%, rgb(var(--surface-soft-rgb) / 0.66) 100%);
}
@media (min-width: 901px) {
  .page.home-page .home-sidebar {
    position: static;
    top: auto;
    align-self: stretch;
    height: auto;
  }
  .page.home-page .sidebar-nav {
    position: sticky;
    top: 24px;
    flex: 0 0 auto;
    height: auto;
    max-height: calc(100dvh - 48px);
    min-height: 0;
  }
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 54px;
  margin: 0 -14px;
  padding: 0 24px;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(var(--surface-rgb) / 0.96), rgba(var(--surface-rgb) / 0.9));
  border-bottom: 1px solid rgba(var(--primary-rgb) / 0.13);
  border-top-left-radius: var(--page-frame-radius);
  box-shadow:
    0 1px 0 var(--inset-highlight) inset,
    0 6px 18px rgba(8, 14, 24, 0.045);
}
.sidebar-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: grid;
  place-items: center;
}
.sidebar-brand-text {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 20px;
}
.sidebar-brand-dot {
  color: var(--primary);
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 8px 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sidebar-nav::-webkit-scrollbar {
  width: 0;
  height: 0;
}
.sidebar-nav.is-scrolling,
.sidebar-nav:hover {
  scrollbar-width: thin;
}
.sidebar-nav.is-scrolling::-webkit-scrollbar,
.sidebar-nav:hover::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.sidebar-nav.is-scrolling::-webkit-scrollbar-thumb,
.sidebar-nav:hover::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb) / 0.45);
  border-radius: 999px;
}
.sidebar-nav.is-scrolling::-webkit-scrollbar-track,
.sidebar-nav:hover::-webkit-scrollbar-track {
  background: transparent;
}
.home-sidebar .category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
  padding: 11px 12px 11px 14px;
  border-radius: 14px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.home-sidebar .category-item::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: transparent;
}
.home-sidebar .category-item:hover {
  background: var(--surface-alpha-60);
  border-color: var(--border-light);
  color: var(--ink);
}
.home-sidebar .category-item.active {
  background: var(--surface);
  border-color: var(--border-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  color: var(--ink);
  font-weight: 700;
}
.home-sidebar .category-item.active::before {
  background: var(--primary);
}
.home-sidebar .category-item svg {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.sidebar-spacer {
  display: none;
}
.sidebar-help {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 8px 0;
  border-top: 1px solid var(--border-light);
}
.sidebar-help-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition:
    background var(--motion-120) var(--motion-ease),
    color var(--motion-120) var(--motion-ease);
}
.sidebar-help-link:hover {
  background: var(--surface-alpha-70);
  color: var(--ink);
  text-decoration: none;
}
.sidebar-help-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.sidebar-social {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  justify-content: flex-start;
}
.sidebar-social-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--surface-alpha-60);
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    transform var(--motion-120) var(--motion-ease),
    background var(--motion-120) var(--motion-ease),
    color var(--motion-120) var(--motion-ease);
  padding: 0;
}
.sidebar-social-icon:hover {
  transform: translateY(-1px);
  background: var(--surface);
  color: var(--primary);
}
.sidebar-social-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.home-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: 0 var(--page-frame-radius) var(--page-frame-radius) 0;
}
.page.trg-page .topbar {
  padding: 10px 18px;
  border-bottom: 1px solid rgba(var(--primary-rgb) / 0.13);
  border-top-right-radius: var(--page-frame-radius);
  background: linear-gradient(180deg, rgba(var(--surface-rgb) / 0.96), rgba(var(--surface-rgb) / 0.9));
  box-shadow:
    0 1px 0 var(--inset-highlight) inset,
    0 6px 18px rgba(8, 14, 24, 0.045);
}
.page.trg-page .topbar-icon {
  background: var(--ta-bg);
  border-color: var(--ta-b);
  color: var(--ta-c);
  box-shadow: var(--ta-sh);
}
.page.trg-page .topbar-icon:hover {
  background: var(--ta-bg-h);
  color: var(--ta-c-h);
  border-color: var(--ta-b-h);
  box-shadow: var(--ta-sh-h);
}
.page.trg-page .search {
  max-width: 520px;
  height: 38px;
  border-radius: 13px;
  border-color: var(--border-light);
}
.page.trg-page .search:focus-within {
  border-color: rgba(var(--primary-rgb) / 0.55);
}
.page.trg-page .main-wrap {
  padding: 18px 22px 26px;
  gap: 18px;
}
/* Subpages: keep panels compact and left-aligned. */
.page.trg-page .auth-shell,
.page.trg-page .profile-shell,
.page.trg-page .post-shell,
.page.trg-page .myads-shell,
.page.trg-page .ad-shell,
.page.trg-page .admin-shell {
  margin: 0;
}
.page.trg-page .section-heading {
  font-style: normal;
}
.page.home-page .hero-banner {
  min-height: 200px;
  background:
    radial-gradient(900px 280px at 18% 35%, rgba(var(--primary-rgb) / 0.22), transparent 55%),
    radial-gradient(800px 260px at 70% 55%, rgba(var(--primary-rgb) / 0.12), transparent 60%), var(--hero-bg);
}
.page.home-page .hero-banner-text h2 {
  font-style: normal;
  letter-spacing: -0.02em;
}
.hero-banner-media {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}
.hero-asset {
  border-radius: 18px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}
.hero-asset--phone {
  transform: rotate(-6deg);
}
.hero-asset--car {
  transform: rotate(4deg);
}
.hero-asset svg {
  display: block;
}
.page.trg-page .ad-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 0 rgba(27, 27, 31, 0.04);
}
.page.trg-page .ad-card:hover {
  box-shadow: var(--shadow-md);
}
.page.trg-page .ad-card .ad-thumb {
  background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface-muted) 100%);
}
.page.trg-page .ad-card .ad-thumb img {
  filter: saturate(1.1) contrast(1.05) brightness(1.03);
}
/* Keep columns deterministic for virtual scroll math. */
.page.trg-page .ad-grid {
  grid-template-columns: repeat(var(--ads-per-row, 6), minmax(0, 1fr));
}
.page.trg-page .skeleton-grid {
  grid-template-columns: repeat(var(--ads-per-row, 6), minmax(0, 1fr));
}
/* Breadcrumbs navigation */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 8px 0;
  grid-column: 1 / -1;
  grid-row: 1;
  margin-bottom: 8px;
}
.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}
.breadcrumbs a:hover {
  text-decoration: underline;
}
.breadcrumbs .sep {
  opacity: 0.5;
}
.breadcrumbs--fullwidth {
  grid-column: 1 / -1;
}
.home-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  background: var(--surface);
  border-top: 1px solid var(--border-light);
}
.home-footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}
.home-footer-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 20px;
}
.home-footer-item + .home-footer-item {
  border-left: 1px solid var(--border-light);
}
.home-footer-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border-light);
  display: grid;
  place-items: center;
  color: var(--ink);
}
.home-footer-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-footer-title {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.home-footer-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-180) var(--motion-ease);
  z-index: var(--z-overlay, 400);
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 901px) {
  .sidebar-overlay {
    display: none;
  }
}
@media (max-width: 900px) {
  .home-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .home-main {
    grid-column: 1;
    border-radius: var(--page-frame-radius-mobile);
  }
  .home-footer {
    grid-column: 1;
  }
  .page.trg-page .topbar {
    padding: 12px 14px;
    border-top-left-radius: var(--page-frame-radius-mobile);
    border-top-right-radius: var(--page-frame-radius-mobile);
  }
  .page.trg-page .main-wrap {
    padding: 14px 12px 22px;
  }
  .filter-bar {
    padding: 8px 10px 14px;
  }
  .hero-banner-media {
    display: none;
  }
  .sidebar-overlay {
    left: min(86vw, 320px);
  }
  /* Off-canvas sidebar */
  .home-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 320px);
    transform: translateX(-110%);
    transition: transform var(--motion-180) var(--motion-ease);
    z-index: var(--z-modal, 500);
    border-right: 1px solid var(--border);
    border-radius: 0 var(--page-frame-radius-mobile) var(--page-frame-radius-mobile) 0;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  }
  .home-sidebar.sidebar-open {
    transform: translateX(0);
  }
  /* Match JS breakpoint */
  .mobile-menu-btn {
    display: flex;
  }
  .home-footer-inner {
    grid-template-columns: 1fr;
  }
  .home-footer-item + .home-footer-item {
    border-left: none;
    border-top: 1px solid var(--border-light);
  }
}
/* Hide the marketing footer strip on the homepage (keep layout clean). */
.page.home-page .home-footer {
  display: none;
}
.page.home-page .home-shell {
  grid-template-rows: 1fr;
}
.page.home-page .main-wrap,
.page.favorites-page .main-wrap,
.page.recent-page .main-wrap,
.page.price-alerts-page .main-wrap {
  max-width: none;
}
/* Home sidebar: hide help + social links (clean left rail). */
.page.home-page .sidebar-help {
  display: none;
}
.page.home-page .sidebar-social {
  display: none;
}
.page.home-page .home-sidebar {
  gap: 10px;
  padding-bottom: 12px;
}
/* ===== GENERAL ANIMATION KEYFRAMES ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 62px;
    flex-wrap: wrap;
    row-gap: 8px;
    align-items: center;
  }
  .topbar .mobile-menu-btn {
    order: 0;
    flex: 0 0 auto;
  }
  .topbar .search {
    order: 1;
    flex: 1 1 220px;
    min-width: 0;
    max-width: none;
  }
  .topbar .top-actions {
    order: 2;
    flex: 1 1 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
  }
  .topbar .top-actions::-webkit-scrollbar {
    display: none;
  }
  .topbar .top-actions .topbar-icon {
    flex: 0 0 auto;
  }
}
/* ===== LIGHT MODE READABILITY TWEAKS ===== */
:root:not([data-theme="dark"]) {
  --muted: #5c5964;
  --muted-light: #6d6d78;
  --border-light: #ddd1c0;
  --ui-glass-border: rgba(27, 27, 31, 0.14);
  --ui-glass-highlight: rgba(255, 255, 255, 0.22);
  --inset-highlight: rgba(27, 27, 31, 0.08);
  --inset-highlight-soft: rgba(27, 27, 31, 0.05);
}
/* cards-controls: no special light-mode overrides needed (uses filterchip tokens) */
:root:not([data-theme="dark"]) .recent-window-divider,
:root:not([data-theme="dark"]) .controls-divider {
  background: linear-gradient(to bottom, transparent, rgba(27, 27, 31, 0.18), transparent);
}
:root.nova-liquid-ui:not([data-theme="dark"]) .ad-card-body {
  background: rgb(var(--surface-rgb) / var(--ad-b));
}
:root:not([data-theme="dark"]) .ad-category-tag {
  color: var(--color-on-primary);
  border-color: transparent;
  background: var(--primary);
}
:root:not([data-theme="dark"]) .ad-card-location {
  color: #4a4f58;
  font-weight: 500;
}
:root:not([data-theme="dark"]) .ad-card-location svg {
  color: #666c77;
}
:root:not([data-theme="dark"]) .ad-fav-btn {
  color: #706d7b;
}
:root.has-custom-bg .filter-bar,
:root.nova-liquid-ui .filter-bar {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:root.has-custom-bg .filter-chip,
:root.nova-liquid-ui.has-custom-bg .filter-chip {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.page.home-page .ad-card-location::before {
  content: none;
}
@media (max-width: 900px) {
  :root:not([data-theme="dark"]) .home-sidebar {
    border-right-color: rgba(27, 27, 31, 0.16);
  }
}

/* Mobile sidebar: make the category drawer feel native on phones. */
@media (max-width: 900px) {
  body.sidebar-menu-open {
    overflow: hidden;
    touch-action: none;
  }

  .sidebar-overlay {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: min(calc(100vw - 8px), 368px) !important;
    background: rgba(8, 14, 24, 0.38);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .home-sidebar {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
    bottom: auto;
    width: min(calc(100vw - 16px), 360px);
    max-height: calc(100dvh - 96px);
    padding: 0;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(var(--primary-rgb) / 0.18);
    border-radius: 24px;
    background:
      linear-gradient(180deg, rgba(var(--surface-rgb) / 0.99) 0%, rgba(var(--surface-soft-rgb) / 0.97) 100%),
      var(--surface);
    box-shadow:
      0 24px 64px rgba(8, 14, 24, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.44);
    transform: translate3d(calc(-100% - 24px), 0, 0);
    transition:
      transform var(--motion-320) var(--motion-ease),
      box-shadow var(--motion-320) var(--motion-ease);
  }

  :root.has-custom-bg .home-sidebar,
  :root.nova-liquid-ui .home-sidebar {
    background:
      linear-gradient(180deg, rgba(var(--surface-rgb) / 0.98) 0%, rgba(var(--surface-soft-rgb) / 0.96) 100%),
      var(--surface);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
  }

  .home-sidebar.sidebar-open {
    transform: translate3d(0, 0, 0);
  }

  .sidebar-brand {
    height: 60px;
    margin: 0;
    padding: 0 16px;
    border-radius: 0;
    border-bottom: 1px solid rgba(var(--primary-rgb) / 0.14);
    background: rgba(var(--surface-rgb) / 0.52);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }

  .sidebar-logo {
    width: 32px;
    height: 32px;
  }

  .sidebar-brand-text {
    font-size: 20px;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    max-height: calc(100dvh - 168px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .home-sidebar .category-item {
    min-height: 72px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    border-radius: 18px;
    border: 1px solid rgba(var(--primary-rgb) / 0.14);
    background: rgba(var(--surface-rgb) / 0.88);
    color: var(--ink-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    box-shadow:
      0 8px 18px rgba(8, 14, 24, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.38);
  }

  .home-sidebar .category-item::before {
    content: none;
  }

  .home-sidebar .category-item[data-category=""] {
    grid-column: 1 / -1;
    min-height: 54px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 16px;
    font-size: 13px;
    text-align: left;
  }

  .home-sidebar .category-item:hover {
    transform: none;
    background: rgba(var(--surface-rgb) / 0.96);
    border-color: rgba(var(--primary-rgb) / 0.24);
  }

  .home-sidebar .category-item.active {
    background: linear-gradient(180deg, rgba(var(--primary-rgb) / 0.16), rgba(var(--surface-rgb) / 0.96));
    border-color: rgba(var(--primary-rgb) / 0.48);
    color: var(--primary-deep);
    box-shadow:
      0 12px 26px rgba(var(--primary-rgb) / 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.46);
  }

  .home-sidebar .category-item.active::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb) / 0.12);
  }

  .home-sidebar .category-item svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    opacity: 0.9;
  }
}

@media (max-width: 380px) {
  .sidebar-overlay {
    left: calc(100vw - 6px) !important;
  }

  .home-sidebar {
    left: 6px;
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 92px);
    border-radius: 22px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .home-sidebar .category-item,
  .home-sidebar .category-item[data-category=""] {
    grid-column: auto;
    min-height: 54px;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0 14px;
    text-align: left;
  }
}


:root {
  --font-mono: "IBM Plex Mono", monospace;
  --text: var(--ink);
  --danger: #b42318;
  --danger-ink: #ffffff;
  --success: var(--green);
  --success-ink: #ffffff;
  --warning: var(--accent);
  --warning-ink: #ffffff;
  --color-canvas: var(--bg-solid);
  --color-surface: var(--surface);
  --color-surface-subtle: var(--surface-soft);
  --color-surface-muted: var(--surface-muted);
  --color-text: var(--ink);
  --color-text-secondary: var(--ink-secondary);
  --color-text-muted: var(--muted);
  --color-text-subtle: var(--muted-light);
  --color-border: var(--border);
  --color-border-subtle: var(--border-light);
  --color-primary: var(--primary);
  --color-primary-hover: var(--primary-strong);
  --color-primary-pressed: var(--primary-deep);
  --color-on-primary: var(--primary-ink);
  --color-danger: var(--danger);
  --color-on-danger: var(--danger-ink);
  --color-success: var(--success);
  --color-on-success: var(--success-ink);
  --color-warning: var(--warning);
  --color-on-warning: var(--warning-ink);
  --space-0: 0px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-64: 64px;
  --type-12: 12px;
  --type-13: 13px;
  --type-14: 14px;
  --type-16: 16px;
  --type-18: 18px;
  --type-24: 24px;
  --type-32: 32px;
  --type-44: 44px;
  --control-32: 32px;
  --control-40: 40px;
  --control-44: 44px;
  --control-52: 52px;
  --radius-6: 6px;
  --radius-10: 10px;
  --radius-14: 14px;
  --radius-18: 18px;
  --radius-24: 24px;
  --radius-pill: 999px;
  --motion-120: 120ms;
  --motion-180: 180ms;
  --motion-320: 320ms;
  --motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-base: 0;
  --z-raised: 10;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-nav: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;
  --z-lightbox: 700;
  --z-emergency: 900;
  --width-shell: 1440px;
  --width-content: 1120px;
  --width-form: 760px;
  --width-auth: 480px;
  --focus-ring: 0 0 0 3px rgba(var(--primary-rgb) / 0.28);
  --filterchip-text-hover: var(--ink);
}

:root[data-theme="dark"] {
  --danger: #f87171;
  --danger-ink: #1f0a0a;
  --success-ink: #052e16;
}

.page.trg-page {
  --primary-ink: #ffffff;
  --color-primary: var(--primary);
  --color-primary-hover: var(--primary-strong);
  --color-primary-pressed: var(--primary-deep);
  --color-on-primary: var(--primary-ink);
  --warning: var(--accent);
  --warning-ink: #ffffff;
  --color-warning: var(--warning);
  --color-on-warning: var(--warning-ink);
  --focus-ring: 0 0 0 3px rgba(var(--primary-rgb) / 0.28);
}


/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 100);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-light);
  box-shadow:
    0 1px 0 var(--inset-highlight) inset,
    0 6px 18px rgba(8, 14, 24, 0.035);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  height: 54px;
  --ta-bg: linear-gradient(145deg, rgba(var(--surface-rgb) / 0.98), rgba(var(--surface-soft-rgb) / 0.94));
  --ta-bg-h: linear-gradient(145deg, rgba(var(--surface-rgb) / 1), rgba(var(--surface-soft-rgb) / 0.98));
  --ta-b: rgba(var(--primary-rgb) / 0.16);
  --ta-b-h: rgba(var(--primary-rgb) / 0.28);
  --ta-sh: inset 1px 1px 0 rgba(255, 255, 255, 0.64), 0 5px 14px rgba(17, 24, 39, 0.055);
  --ta-sh-h: inset 1px 1px 0 rgba(255, 255, 255, 0.78), 0 9px 20px rgba(17, 24, 39, 0.085);
  --ta-c: var(--ink-secondary);
  --ta-c-h: var(--ink);
}

:root[data-theme="dark"] .filter-chip.active {
  color: var(--filterchip-text-active);
  background: var(--filterchip-bg-active);
  border-color: var(--filterchip-border-active);
}

:root[data-theme="dark"] .filter-chip.active .chip-close {
  color: var(--filterchip-text-active);
}

:root[data-theme="dark"] .topbar {
  --ta-bg: linear-gradient(145deg, rgba(38, 46, 58, 0.94), rgba(16, 23, 34, 0.96));
  --ta-bg-h: linear-gradient(145deg, rgba(45, 55, 70, 0.98), rgba(20, 29, 42, 0.98));
  --ta-b: rgba(226, 232, 240, 0.16);
  --ta-b-h: rgba(var(--primary-rgb) / 0.34);
  --ta-sh: inset 1px 1px 0 rgba(255, 255, 255, 0.1), 0 7px 18px rgba(0, 0, 0, 0.26);
  --ta-sh-h: inset 1px 1px 0 rgba(255, 255, 255, 0.16), 0 10px 24px rgba(0, 0, 0, 0.34);
  --ta-c: #eef5f8;
  --ta-c-h: #fff;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.topbar-brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.topbar-brand-text {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.topbar .brand {
  display: none;
}

.search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 7px 13px;
  height: 38px;
  transition:
    border-color var(--motion-180), box-shadow var(--motion-180), background var(--motion-180);
}

.search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
  background: var(--surface);
}

.search input {
  border: none;
  background: transparent;
  flex: 1;
  min-height: 0;
  min-width: 0;
  font-size: 13px;
  color: var(--ink);
  border-radius: 0;
  padding: 0;
  margin: 0;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font-body);
}

.search input:focus,
.search input:focus-visible {
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
}

.search input::-webkit-search-decoration,
.search input::-webkit-search-cancel-button,
.search input::-webkit-search-results-button,
.search input::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

.search input::placeholder {
  color: var(--muted-light);
}

.search .btn {
  display: none;
}

.search-clear-btn {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition:
    background var(--motion-180), color var(--motion-180), transform var(--motion-180);
}

.search-clear-btn:hover {
  background: rgba(var(--primary-rgb) / 0.12);
  color: var(--ink);
}

.search-clear-btn:active {
  transform: scale(0.94);
}

.search-clear-btn:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb) / 0.5);
  outline-offset: 2px;
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.search-icon {
  color: var(--muted);
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.search-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.top-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.topbar-icon {
  height: var(--control-40);
  min-width: var(--control-40);
  padding: 0 13px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--ta-b);
  background: var(--ta-bg);
  color: var(--ta-c);
  box-shadow: var(--ta-sh);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition:
    background var(--motion-180) var(--motion-ease), color var(--motion-180) var(--motion-ease), border-color var(--motion-180) var(--motion-ease), box-shadow var(--motion-180) var(--motion-ease), transform var(--motion-180) var(--motion-ease);
  text-decoration: none;
  position: relative;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.topbar-icon:hover {
  background: var(--ta-bg-h);
  border-color: var(--ta-b-h);
  color: var(--ta-c-h);
  box-shadow: var(--ta-sh-h);
  transform: translateY(-1px);
}

.topbar-icon:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 8px rgba(17, 24, 39, 0.1),
    0 5px 14px rgba(17, 24, 39, 0.07);
}

.topbar-icon.topbar-icon-recent {
  background: linear-gradient(145deg, rgba(var(--surface-rgb) / 0.98), rgba(var(--primary-rgb) / 0.08));
  border-color: rgba(var(--primary-rgb) / 0.24);
  color: var(--ta-c-h);
}

.topbar-icon.topbar-icon-recent:hover {
  background: linear-gradient(145deg, rgba(var(--surface-rgb) / 1), rgba(var(--primary-rgb) / 0.12));
  border-color: rgba(var(--primary-rgb) / 0.34);
}

.topbar-icon.topbar-icon-recent.has-items {
  background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.18), rgba(var(--surface-rgb) / 0.98));
  border-color: rgba(var(--primary-rgb) / 0.38);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.68),
    0 12px 26px rgba(var(--primary-rgb) / 0.16);
}

.topbar-icon.active-green,
.topbar-icon[aria-current="page"] {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--color-on-primary);
  border-color: rgba(var(--primary-rgb) / 0.46);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.26),
    0 12px 28px rgba(var(--primary-rgb) / 0.22);
}

.topbar-icon.active-green:hover,
.topbar-icon[aria-current="page"]:hover {
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  border-color: rgba(var(--primary-rgb) / 0.58);
  color: var(--color-on-primary);
}

.topbar-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-icon:focus-visible {
  outline: 2px solid var(--glow-strong);
  outline-offset: 2px;
}

.topbar-icon-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.topbar-icon.is-icon-only {
  width: var(--control-40);
  min-width: var(--control-40);
  padding: 0;
  border-radius: 999px;
  gap: 0;
}

.topbar-icon.is-icon-only .topbar-icon-label {
  display: none;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 769px) {
  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]) {
    min-width: 108px;
    height: 40px;
    padding: 0 15px;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-rgb) / 0.42);
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.15), rgba(var(--surface-rgb) / 0.94));
    color: var(--primary-deep);
    justify-content: center;
    gap: 8px;
    text-align: center;
    position: relative;
    overflow: visible;
    box-shadow:
      inset 1px 1px 0 rgba(255, 255, 255, 0.68),
      0 7px 18px rgba(var(--primary-rgb) / 0.13);
    transition:
      transform var(--motion-180) var(--motion-ease), box-shadow var(--motion-180) var(--motion-ease), background var(--motion-180) var(--motion-ease), border-color var(--motion-180) var(--motion-ease), color var(--motion-180) var(--motion-ease);
  }

  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"])::before,
  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"])::after {
    content: none;
  }

  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]) svg {
    display: block;
    width: 19px;
    height: 19px;
  }

  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]) .topbar-icon-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
  }

  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]):hover {
    border-color: rgba(var(--primary-rgb) / 0.58);
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.2), rgba(var(--surface-rgb) / 0.98));
    color: var(--primary-deep);
    transform: translateY(-1px);
    box-shadow:
      inset 1px 1px 0 rgba(255, 255, 255, 0.8),
      0 10px 24px rgba(var(--primary-rgb) / 0.18);
  }

  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]):active {
    transform: translateY(0);
    box-shadow:
      inset 0 2px 8px rgba(var(--primary-rgb) / 0.14),
      0 5px 12px rgba(var(--primary-rgb) / 0.12);
  }

  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]):focus-visible {
    outline: 2px solid rgba(98, 102, 112, 0.5);
    outline-offset: 3px;
  }

  :root[data-theme="dark"] .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]) {
    border-color: rgba(var(--primary-rgb) / 0.5);
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.2), rgba(16, 23, 34, 0.96));
    color: #eafffb;
    box-shadow:
      inset 1px 1px 0 rgba(255, 255, 255, 0.16),
      0 9px 22px rgba(var(--primary-rgb) / 0.12),
      0 8px 20px rgba(0, 0, 0, 0.28);
  }

  :root[data-theme="dark"] .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]):hover {
    border-color: rgba(var(--primary-rgb) / 0.64);
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.28), rgba(20, 29, 42, 0.98));
    color: #ffffff;
    box-shadow:
      inset 1px 1px 0 rgba(255, 255, 255, 0.22),
      0 12px 28px rgba(var(--primary-rgb) / 0.16),
      0 10px 26px rgba(0, 0, 0, 0.34);
  }
}

@media (min-width: 769px) {
  .topbar .top-actions .topbar-icon.is-icon-only,
  .top-actions .topbar-icon:is(#newAdBtn, #postAdLink, [href="/post.html"]).is-icon-only,
  .page.ad-page .top-actions .topbar-icon[href="/post.html"].is-icon-only {
    width: var(--control-40);
    min-width: var(--control-40);
    padding: 0;
    border-radius: 999px;
    gap: 0;
    justify-content: center;
  }
}

@media (max-width: 1280px) and (min-width: 769px) {
  .topbar {
    gap: 12px;
    padding-left: 24px;
    padding-right: 24px;
  }

  .topbar .search {
    max-width: 320px;
  }

  .topbar .top-actions {
    gap: 6px;
  }
}

@keyframes topbar-post-chrome-sheen {
  from {
    transform: translateX(-160%) skewX(-20deg);
  }

  to {
    transform: translateX(280%) skewX(-20deg);
  }
}

.topbar-icon-ico {
  position: relative;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}

.mobile-menu-btn {
  display: none;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mobile-menu-btn:hover {
  background: var(--surface-soft);
  border-color: var(--border);
}

.mobile-menu-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ===== MAIN CONTAINER ===== */
.main-wrap {
  width: 100%;
  max-width: var(--page-max);
  padding: 20px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
  align-self: flex-start;
}

/* ===== HERO BANNER ===== */
.hero-banner {
  background: var(--hero-bg);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
  padding: 0;
  border: none;
  box-shadow: var(--shadow-md);
}

.hero-banner::before {
  display: none;
}

.hero-banner-inner {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 28px 36px;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.hero-banner-text {
  flex: 1;
  color: #fff;
  min-width: 0;
}

.hero-banner-text h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.hero-banner-text .hero-cta {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--color-on-primary);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: background var(--motion-180);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}

.hero-banner-text .hero-cta:hover {
  background: var(--primary-strong);
  text-decoration: none;
}

.hero-banner-img {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.hero-banner-img img {
  height: 140px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}


/* ===== FOOTER ===== */
.site-footer {
  background: transparent;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.footer-inner {
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color var(--motion-180);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-links a:first-child {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: none;
  color: var(--ink-secondary);
  display: grid;
  place-items: center;
  transition: background-color var(--motion-180), color var(--motion-180), transform var(--motion-180);
  cursor: pointer;
  border: none;
  padding: 0;
}

.footer-social-icon:hover {
  color: var(--primary);
}

.footer-social-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer-col,
.footer-col-title,
.footer-brand,
.footer-tagline,
.footer-info-item,
.footer-bottom,
.footer-copy {
  display: none;
}

/* ===== TOOLBAR ===== */
.toolbar-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.toolbar-field > span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  min-width: 32px;
  font-family: var(--font-body);
  font-size: 12px;
}

.toolbar-btn:hover {
  background: var(--btn-hover);
}

.toolbar-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: var(--z-dropdown, 200);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  min-width: 180px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}


:root.nova-liquid-ui .page {
  background: rgb(var(--surface-rgb) / var(--ui-glass-alpha));
}
:root.nova-liquid-ui .home-sidebar {
  background: linear-gradient(180deg, rgb(var(--surface-rgb) / var(--ui-glass-alpha)) 0%, rgb(var(--surface-soft-rgb) / var(--ui-glass-alpha)) 100%);
}
:root.nova-liquid-ui .topbar {
  background: rgb(var(--surface-rgb) / var(--ui-glass-alpha));
  border-bottom-color: var(--ui-glass-border);
}
:root.nova-liquid-ui .topbar-icon:not(.active-green),
:root.nova-liquid-ui .mobile-menu-btn,
:root.nova-liquid-ui .search,
:root.nova-liquid-ui .sidebar-social-icon,
:root.nova-liquid-ui .home-footer-icon,
:root.nova-liquid-ui .help-icon,
:root.nova-liquid-ui .toolbar-btn,
:root.nova-liquid-ui .vw-action-btn,
:root.nova-liquid-ui .vw-back-btn {
  background: rgb(var(--surface-soft-rgb) / var(--ui-glass-alpha));
  border-color: var(--ui-glass-border);
}
:root.nova-liquid-ui .topbar-icon:not(.active-green) {
  background: var(--ta-bg);
  border-color: var(--ta-b);
  box-shadow: var(--ta-sh);
}
:root.nova-liquid-ui .topbar-icon:not(.active-green),
:root.nova-liquid-ui .mobile-menu-btn {
  border: 1px solid var(--ta-b, var(--ui-glass-border));
}
:root.nova-liquid-ui .panel,
:root.nova-liquid-ui .toolbar-field,
:root.nova-liquid-ui .toolbar-menu,
:root.nova-liquid-ui .chat,
:root.nova-liquid-ui .drawer-card,
:root.nova-liquid-ui .status-menu,
:root.nova-liquid-ui .nova-toast,
:root.nova-liquid-ui .nova-dialog,
:root.nova-liquid-ui .ad-showcase,
:root.nova-liquid-ui .myads-card {
  background: rgb(var(--surface-rgb) / var(--ui-glass-alpha));
  border-color: var(--ui-glass-border);
}
:root.nova-liquid-ui .ad-card,
:root.nova-liquid-ui .myads-stat,
:root.nova-liquid-ui .ad-meta-pill:not(:first-child),
:root.nova-liquid-ui .viewer-thumb {
  background: rgb(var(--surface-soft-rgb) / var(--ad-a));
  border-color: var(--ui-glass-border);
}
:root.nova-liquid-ui .ad-card {
  border: 1px solid var(--ui-glass-border);
}
:root.nova-liquid-ui .panel,
:root.nova-liquid-ui .myads-card,
:root.nova-liquid-ui .ad-showcase {
  box-shadow:
    0 1px 0 var(--ui-glass-highlight) inset,
    var(--shadow);
}
:root.nova-liquid-ui .nova-toast,
:root.nova-liquid-ui .nova-dialog,
:root.nova-liquid-ui .chat,
:root.nova-liquid-ui .drawer-card,
:root.nova-liquid-ui .status-menu,
:root.nova-liquid-ui .toolbar-menu {
  box-shadow:
    0 1px 0 var(--ui-glass-highlight) inset,
    var(--shadow-lg);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root.nova-liquid-ui .home-sidebar,
  :root.nova-liquid-ui .topbar,
  :root.nova-liquid-ui .panel,
  :root.nova-liquid-ui .toolbar-field,
  :root.nova-liquid-ui .toolbar-menu,
  :root.nova-liquid-ui .chat,
  :root.nova-liquid-ui .drawer-card,
  :root.nova-liquid-ui .status-menu,
  :root.nova-liquid-ui .nova-toast,
  :root.nova-liquid-ui .nova-dialog,
  :root.nova-liquid-ui .topbar-icon,
  :root.nova-liquid-ui .mobile-menu-btn,
  :root.nova-liquid-ui .search,
  :root.nova-liquid-ui .sidebar-social-icon,
  :root.nova-liquid-ui .home-footer-icon,
  :root.nova-liquid-ui .help-icon,
  :root.nova-liquid-ui .toolbar-btn,
  :root.nova-liquid-ui .vw-action-btn,
  :root.nova-liquid-ui .vw-back-btn,
  :root.nova-liquid-ui .ad-card,
  :root.nova-liquid-ui .myads-card,
  :root.nova-liquid-ui .ad-showcase {
  }
}

@media (hover: none) and (pointer: coarse) {
  :root {
    --ui-glass-blur: 0px;
    --ui-glass-saturate: 1;
    --page-transition-ms: var(--motion-180);
    --page-transition-distance: 6px;
    --page-transition-scale: 1;
  }
  :root.has-custom-bg :is(.page, .topbar, .home-sidebar),
  :root.nova-liquid-ui :is(.home-sidebar, .topbar, .panel, .toolbar-field, .toolbar-menu, .chat, .drawer-card, .status-menu, .nova-toast, .nova-dialog, .topbar-icon, .mobile-menu-btn, .search, .sidebar-social-icon, .home-footer-icon, .help-icon, .toolbar-btn, .vw-action-btn, .vw-back-btn, .ad-card, .myads-card, .ad-showcase) {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  :root.nova-page-entering .page,
  :root.nova-page-leaving .page {
    filter: none;
    will-change: opacity, transform;
  }
}

.mobile-sidebar-close {
  display: none;
}

.mobile-menu-glyph {
  display: grid;
  width: 20px;
  gap: 4px;
}

.mobile-menu-glyph > span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition:
    width var(--motion-180) var(--motion-ease),
    opacity var(--motion-180) var(--motion-ease),
    transform var(--motion-180) var(--motion-ease);
}

.mobile-menu-glyph > span:nth-child(1) {
  width: 20px;
}

.mobile-menu-glyph > span:nth-child(2) {
  width: 14px;
}

.mobile-menu-glyph > span:nth-child(3) {
  width: 17px;
}

.mobile-menu-btn[aria-expanded="true"] .mobile-menu-glyph > span:nth-child(1) {
  width: 20px;
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] .mobile-menu-glyph > span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn[aria-expanded="true"] .mobile-menu-glyph > span:nth-child(3) {
  width: 20px;
  transform: translateY(-6px) rotate(-45deg);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .page.ad-page .ad-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .page.ad-page .ad-side {
    position: static;
  }

  .ad-showcase--redesign .ad-summary-top {
    gap: 6px;
  }

  .ad-similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .post-shell,
  .profile-shell,
  .myads-shell,
  .ad-shell {
    grid-template-columns: 1fr;
  }

  .post-main {
    grid-column: 1;
    grid-row: 2;
  }

  .post-side {
    grid-column: 1;
    grid-row: 3;
  }

  .page.profile-page .profile-shell {
    grid-template-columns: 1fr;
  }

  .page.profile-page .profile-main {
    max-width: none;
  }

  .price-alerts-layout {
    grid-template-columns: 1fr;
  }

  .ad-side,
  .myads-side {
    position: static;
  }
}

@media (max-width: 900px) {
  .topbar,
  .page.trg-page .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    gap: 8px 10px;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 10px 12px;
  }

  .topbar .mobile-menu-btn {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .topbar .search {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 40px;
  }

  .topbar .top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex: none;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 0 4px;
    margin: 0;
  }

  .topbar .top-actions:empty {
    display: none;
    min-height: 0;
    padding: 0;
  }

  .topbar .top-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar .top-actions .topbar-icon {
    flex: 0 0 var(--control-44);
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    padding: 0;
    border-radius: 999px;
    gap: 0;
  }

  .topbar .top-actions .topbar-icon .topbar-icon-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body.sidebar-menu-open {
    overflow: hidden;
    touch-action: pan-y;
  }

  body.sidebar-menu-open .page.trg-page {
    z-index: auto;
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    perspective: none !important;
    contain: none !important;
    will-change: auto !important;
    transition: none !important;
  }

  body.sidebar-menu-open .sidebar-overlay.active {
    position: fixed;
    inset: 0 !important;
    background: rgba(7, 12, 20, 0.52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
    z-index: var(--z-overlay, 400);
  }

  .page.trg-page .home-sidebar {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: min(86vw, 344px);
    height: auto;
    max-height: none;
    padding: 0;
    gap: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(var(--primary-rgb) / 0.2);
    border-radius: 26px;
    background:
      linear-gradient(180deg, rgba(var(--surface-rgb) / 0.98), rgba(var(--surface-soft-rgb) / 0.98)), var(--surface);
    box-shadow:
      0 28px 72px rgba(4, 10, 18, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.46);
    transform: translate3d(calc(-100% - 24px), 0, 0);
    transition:
      visibility 0s linear var(--motion-320),
      opacity var(--motion-180) var(--motion-ease),
      transform var(--motion-320) var(--motion-ease);
    z-index: var(--z-modal, 500);
  }

  .page.trg-page .home-sidebar.sidebar-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
  }

  body.sidebar-menu-open .page.trg-page .home-sidebar .sidebar-brand {
    display: flex;
  }

  .page.trg-page .home-sidebar .sidebar-brand {
    min-height: 72px;
    margin: 0;
    padding: 0 72px 0 18px;
    border: 0;
    border-bottom: 1px solid rgba(var(--primary-rgb) / 0.14);
    border-radius: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.12), transparent 72%);
    box-shadow: none;
  }

  .page.trg-page .home-sidebar .sidebar-logo {
    width: 38px;
    height: 38px;
  }

  .page.trg-page .home-sidebar .sidebar-brand-text {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  .page.trg-page .mobile-sidebar-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(var(--primary-rgb) / 0.2);
    border-radius: 15px;
    background: rgba(var(--surface-rgb) / 0.82);
    color: var(--ink-secondary);
    box-shadow:
      0 8px 20px rgba(7, 12, 20, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.44);
    cursor: pointer;
  }

  .page.trg-page .mobile-sidebar-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .page.trg-page .mobile-sidebar-close:hover {
    border-color: rgba(var(--primary-rgb) / 0.38);
    background: rgba(var(--primary-rgb) / 0.12);
    color: var(--primary-deep);
  }

  .page.trg-page .home-sidebar .sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    grid-template-columns: none;
    gap: 6px;
    max-height: none;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .page.trg-page .home-sidebar .category-item,
  .page.trg-page .home-sidebar .category-item[data-category=""] {
    grid-column: auto;
    min-height: 50px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: var(--ink-secondary);
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
  }

  .page.trg-page .home-sidebar .category-item:hover {
    border-color: rgba(var(--primary-rgb) / 0.15);
    background: rgba(var(--primary-rgb) / 0.08);
  }

  .page.trg-page .home-sidebar .category-item.active {
    border-color: rgba(var(--primary-rgb) / 0.34);
    background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.2), rgba(var(--surface-rgb) / 0.78));
    color: var(--primary-deep);
    box-shadow: inset 3px 0 0 var(--primary);
  }

  .page.trg-page .home-sidebar .category-item.active::after {
    content: none;
  }

  .page.trg-page .home-sidebar .category-item svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    opacity: 0.9;
  }

  .page.trg-page .mobile-menu-btn {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.13), rgba(var(--surface-rgb) / 0.9));
    box-shadow:
      0 9px 22px rgba(5, 12, 20, 0.11),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .page.trg-page .mobile-menu-btn[aria-expanded="true"] {
    border-color: rgba(var(--primary-rgb) / 0.52);
    background: rgba(var(--primary-rgb) / 0.18);
    color: var(--primary-deep);
    box-shadow:
      0 0 0 3px rgba(var(--primary-rgb) / 0.11),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
}

@media (max-width: 768px) {
  .page {
    margin: 12px;
    min-height: calc(100vh - 24px);
    min-height: calc(100dvh - 24px);
    border-radius: var(--page-frame-radius-mobile);
    box-shadow: none;
  }

  .topbar {
    padding: 10px 16px;
  }

  .topbar-icon {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    padding: 0;
    border-radius: 50%;
  }

  .main-wrap {
    padding: 14px 12px 30px;
    gap: 16px;
  }

  .profile-shell {
    padding: 14px 12px 28px;
    gap: 12px;
  }

  .profile-hero-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ad-shell {
    padding: 12px 12px 28px;
    gap: 10px;
  }

  .page.ad-page .ad-shell {
    padding: var(--space-12) var(--space-12) var(--space-32);
    gap: var(--space-12);
  }

  .page.ad-page::before {
    inset: 50px 0 0;
    border-radius: 0;
    filter: blur(16px) saturate(1.3);
  }

  .ad-showcase--redesign {
    border-radius: var(--radius);
  }

  .ad-showcase--redesign .ad-media-frame {
    min-height: 240px;
    max-height: 360px;
  }

  .page.ad-page .ad-showcase--redesign .ad-media-frame {
    min-height: 240px;
    max-height: none;
  }

  .ad-showcase--redesign .ad-media-strip {
    padding: 10px 14px;
    gap: 6px;
  }

  .ad-showcase--redesign .ad-media-strip .ad-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }

  .ad-showcase--redesign .ad-summary {
    padding: 18px 16px 16px;
  }

  .ad-showcase--redesign .ad-summary h1 {
    font-size: 21px;
  }

  .ad-price-highlight {
    padding: 10px 12px;
  }

  .ad-showcase--redesign .ad-summary .ad-price {
    font-size: 32px;
  }

  .ad-nav-arrow {
    width: 34px;
    height: 34px;
  }

  .page.ad-page .ad-nav-arrow {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
  }

  .ad-nav-prev {
    left: 10px;
  }

  .ad-nav-next {
    right: 10px;
  }

  .ad-map-container {
    height: 240px;
  }

  .ad-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .ad-card .ad-thumb {
    height: 168px;
  }

  .category-item {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 12px;
  }

  .hero-banner-inner {
    flex-direction: column;
    padding: 20px;
    text-align: center;
  }

  .hero-banner-text h2 {
    font-size: 20px;
  }

  .hero-banner-img {
    display: none;
  }

  .site-footer .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .footer-social {
    justify-content: center;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .wizard-progress {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    margin: 0 -2px;
    scrollbar-width: thin;
  }

  .wizard-progress-step {
    flex: 1 0 148px;
  }

  .wizard-progress-text {
    white-space: normal;
    line-height: 1.2;
  }

  .wizard-review-grid {
    grid-template-columns: 1fr;
  }

  .wizard-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .wizard-nav-meta {
    grid-column: 1 / -1;
    order: 3;
  }

  .wizard-nav .btn {
    width: 100%;
    min-width: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .post-form form > .form-row > label,
  .post-form .form-row.wizard-block > label {
    padding: 0;
  }

  .schedule-row {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .post-schedule {
    padding: 10px;
    gap: 8px;
  }

  .schedule-toggle {
    width: 100%;
  }

  .schedule-row .btn.small {
    width: 100%;
    justify-content: center;
  }

  .schedule-fields input[type="datetime-local"] {
    width: 100%;
    min-height: 40px;
  }

  .myads-schedule-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .myads-schedule {
    padding: 10px;
  }

  .myads-schedule-row strong {
    font-size: 13px;
    letter-spacing: 0.02em;
  }

  .myads-actions .btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .post-editor-footer {
    position: static;
    margin-top: 10px;
    box-shadow: none;
  }

  .form-actions-bottom {
    justify-content: flex-start;
  }

  .post-form .form-actions-bottom {
    padding: 8px;
  }

  .post-form .form-actions-bottom .btn {
    flex: 1 1 180px;
    min-width: 0;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
  }

  #appearancePanel .bg-manager-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .bg-library-top {
    justify-content: space-between;
  }

  .bg-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bg-actions {
    grid-template-columns: 1fr;
  }

  #appearancePanel .bg-actions #bgRemoveBtn {
    width: 100%;
  }

  .bg-opacity {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .bg-opacity .pill {
    justify-self: flex-start;
  }

  .range-inline {
    width: 100%;
    min-width: 0;
  }

  .range-inline input[type="range"] {
    flex: 1;
    width: auto;
  }

  .myads-hero-stats {
    grid-template-columns: 1fr;
  }

  .myads-card-header {
    grid-template-columns: 1fr;
  }

  .ad-info-grid {
    grid-template-columns: 1fr;
  }

  .ad-similar {
    padding: 14px;
  }

  .ad-similar-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ad-similar-link {
    align-self: flex-start;
  }

  .ad-similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    padding-bottom: 0;
    margin-right: 0;
    scroll-snap-type: none;
  }

  .ad-similar-card {
    scroll-snap-align: none;
    grid-template-rows: 115px auto;
  }

  .chat {
    width: calc(100vw - 16px);
    right: 8px;
    right: calc(8px + env(safe-area-inset-right));
  }

  .search {
    max-width: none;
  }

  .price-alerts-stats {
    grid-template-columns: 1fr;
  }

  .price-alert-input-row {
    flex-direction: column;
    align-items: stretch;
  }

  .price-alert-actions-row {
    justify-content: flex-start;
  }

  .desktop-only {
    display: none;
  }
}

@media (max-width: 640px) {
  .bg-preview {
    aspect-ratio: 16 / 9;
    max-height: none;
  }

  .bg-library {
    grid-template-columns: 1fr;
  }

  .ad-grid {
    grid-template-columns: 1fr;
  }

  .ad-similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ad-media-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ad-card .ad-thumb {
    height: 220px;
  }

  .nova-progress-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .page,
  .home-main,
  .main-wrap,
  .ad-shell,
  .ad-main,
  .panel,
  .ad-showcase--redesign {
    max-width: 100%;
    min-width: 0;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 900px) {
    html,
    body {
      overflow-x: hidden;
    }
  }
}

@media (max-width: 640px) {
  .page.ad-page .ad-summary-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .page.ad-page .ad-price-highlight {
    width: min(100%, 220px);
    max-width: 100%;
    justify-self: start;
  }

  .page.ad-page .ad-showcase--redesign .ad-summary .ad-price {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .page.ad-page .ad-similar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .page.ad-page .ad-similar-card {
    min-width: 0;
    grid-template-rows: minmax(108px, 34vw) auto;
    border-radius: 16px;
  }

  .page.ad-page .ad-similar-body {
    gap: 6px;
    padding: 10px 10px 11px;
  }

  .page.ad-page .ad-similar-price {
    font-size: 17px;
  }

  .page.ad-page .ad-similar-title {
    font-size: 12px;
    line-height: 1.32;
  }

  .page.ad-page .ad-similar-meta {
    gap: 5px;
  }

  .page.ad-page .ad-similar-chip {
    padding: 3px 7px;
    font-size: 12px;
  }

  .page.ad-page .ad-similar-location {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}


/* ===== 1. ENHANCED HERO SECTION ===== */

.hero-search-section {
  position: relative;
  width: 100%;
  background: var(--hero-bg);
  padding: 48px 24px;
  border-radius: var(--radius-xl);
  text-align: center;
  overflow: hidden;
  z-index: 1;
}

.hero-search-section::before {
  content: "";
  position: absolute;
  top: -40px;
  left: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb) / 0.18);
  filter: blur(50px);
  animation: none;
  pointer-events: none;
  z-index: 0;
}

.hero-search-section::after {
  content: "";
  position: absolute;
  bottom: -50px;
  right: -20px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb) / 0.12);
  filter: blur(60px);
  animation: none;
  pointer-events: none;
  z-index: 0;
}

@keyframes heroFloat {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(20px, -15px) scale(1.12);
  }
}

.hero-search-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}

.hero-search-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 28px;
  position: relative;
  z-index: 1;
}

.hero-search-bar {
  display: flex;
  align-items: center;
  max-width: 620px;
  height: 54px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.hero-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: var(--font-body);
  padding: 0 20px;
  height: 100%;
  background: transparent;
  color: #1b1b1f;
  caret-color: #1b1b1f;
}

.hero-search-bar input::placeholder {
  color: var(--muted);
}

.hero-search-bar input:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(var(--primary-rgb) / 0.28);
}

.hero-search-bar .btn {
  border-radius: 999px;
  height: 42px;
  padding: 0 24px;
  margin-right: 6px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
}

.hero-quick-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.hero-quick-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition:
    background var(--motion-180), border-color var(--motion-180);
  text-decoration: none;
}

.hero-quick-cat:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.32);
}

.hero-quick-cat svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

@media (max-width: 640px) {
  .hero-search-section {
    padding: 32px 16px;
    border-radius: var(--radius-lg);
  }

  .hero-search-title {
    font-size: 26px;
  }

  .hero-search-bar {
    height: 48px;
  }

  .hero-quick-cats {
    gap: 8px;
  }

  .hero-quick-cat {
    font-size: 12px;
    padding: 6px 14px;
  }
}


/* ===== 5. SIDEBAR ENHANCEMENTS ===== */

.category-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  font-weight: 400;
  opacity: 0.75;
}

.category-item {
  position: relative;
  transition:
    background var(--motion-180),
    color var(--motion-180),
    transform var(--motion-180);
}

.category-item::before {
  transition:
    background var(--motion-320),
    transform var(--motion-320);
}

.category-item:hover {
  transform: scale(1.01);
}

.category-item.active::before {
  background: var(--primary);
  transform: scaleY(1);
}

/* ===== 7. MOBILE BOTTOM NAVIGATION ===== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-nav, 300);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: none;
  justify-content: space-around;
  align-items: center;
  height: 56px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  transition: color var(--motion-180);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item .icon-badge {
  top: 3px;
  right: 12px;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active svg {
  stroke-width: 2;
}

.mobile-overlay-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 500);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--motion-320) var(--motion-ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-overlay-menu.is-open {
  transform: translateY(0);
}

.pull-refresh-indicator {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 8px;
  height: 48px;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin: 0 auto -48px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(var(--surface-rgb) / 0.88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  position: relative;
  z-index: 4;
}

.pull-refresh-indicator.is-visible {
  display: flex;
}

@media (max-width: 900px) {
  .bottom-nav {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* ===== HOME: STICKY SEARCH + FILTER STRIP ===== */
.page.home-page .search-filter-sticky {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 100);
  isolation: isolate;
  border-top-right-radius: var(--page-frame-radius);
  background: linear-gradient(
    180deg,
    rgba(var(--surface-rgb) / 0.92) 0%,
    rgba(var(--surface-rgb) / 0.9) 72%,
    rgba(var(--surface-rgb) / 0.84) 100%
  );
  border-bottom: 1px solid rgba(var(--primary-rgb) / 0.14);
  box-shadow: 0 8px 20px rgba(8, 14, 24, 0.05);
}

/* Sticky support on home without clipping artifacts. */
.page.home-page {
  overflow: visible;
}

.page.home-page .home-shell {
  overflow: clip;
}

.page.home-page .search-filter-sticky {
  contain: none;
}

@supports not (overflow: clip) {
  .page.home-page .home-shell {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .page.home-page .home-shell {
    overflow: visible;
  }

  .page.home-page .home-main {
    overflow: clip;
  }
}

@supports not (overflow: clip) {
  @media (max-width: 900px) {
    .page.home-page .home-main {
      overflow: hidden;
    }
  }
}

.page.home-page {
  --home-feed-grid-gap: var(--space-16);
  --home-feed-mobile-grid-gap: var(--space-4);
  overflow-anchor: none;
}

html:has(.page.home-page),
body:has(.page.home-page) {
  overflow-anchor: none;
}

.page.home-page .ad-grid {
  gap: var(--home-feed-grid-gap);
  align-items: stretch;
  contain: layout style paint;
  overflow-anchor: none;
}

.page.home-page .ad-grid > .ad-card {
  contain: layout style paint;
  content-visibility: visible;
  contain-intrinsic-size: none;
  overflow-anchor: none;
}

.page.home-page .ad-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.page.home-page .ad-grid.ad-grid-single-card {
  grid-template-columns: minmax(0, min(100%, 640px));
  justify-content: start;
}

.page.home-page .ad-grid.ad-grid-single-card > .ad-card {
  width: 100%;
  border-radius: 18px;
  box-shadow:
    0 12px 26px rgba(17, 24, 39, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.page.home-page .ad-grid.ad-grid-single-card > .ad-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(17, 24, 39, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.56) inset;
}

.page.home-page .ad-grid.ad-grid-single-card > .ad-card .ad-thumb {
  height: 220px;
}

.page.home-page .search-filter-sticky::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent);
  opacity: 0.04;
  pointer-events: none;
}

body.is-window-scrolling .page.home-page .search-filter-sticky {
  transition: none;
}

body.is-window-scrolling .page.home-page .search-filter-sticky::after {
  opacity: 0;
}

body.is-window-scrolling .page.home-page .ad-card,
body.is-window-scrolling .page.home-page .ad-card .ad-thumb img {
  transition: none;
}

body.is-window-scrolling .page.home-page .ad-card {
  filter: none;
}

body.is-window-scrolling .page.home-page .ad-card:hover,
body.is-window-scrolling .page.home-page .ad-grid.ad-grid-single-card > .ad-card:hover {
  transform: none;
}

body.is-window-scrolling .page.home-page .ad-card:hover .ad-thumb img,
body.is-window-scrolling .page.home-page .ad-card .ad-thumb img {
  transform: none;
  filter: none;
}

body.is-window-scrolling .page.home-page .search-filter-sticky .search,
body.is-window-scrolling .page.home-page .search-filter-sticky .filter-chip,
body.is-window-scrolling .page.home-page .search-filter-sticky .top-actions .topbar-icon {
  transition: none;
}

.page.home-page .search-filter-sticky .topbar {
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  padding-bottom: 8px;
}

.page.home-page .search-filter-sticky .search {
  height: 40px;
  border-radius: 14px;
  border-color: rgba(var(--primary-rgb) / 0.18);
  background: rgba(var(--surface-rgb) / 0.94);
  box-shadow: 0 3px 11px rgba(7, 16, 24, 0.045);
}

.page.home-page .search-filter-sticky .search:focus-within {
  border-color: rgba(var(--primary-rgb) / 0.44);
  box-shadow:
    0 0 0 3px rgba(var(--primary-rgb) / 0.12),
    0 8px 18px rgba(7, 16, 24, 0.08);
}

.page.home-page .search-filter-sticky .filter-bar {
  position: static;
  gap: 7px;
  padding: 5px 16px 9px;
  background: transparent;
  border-bottom: 0;
}

.page.home-page .search-filter-sticky .filter-chip {
  overflow: hidden;
  min-height: 30px;
  border-radius: 999px;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  border: 1px solid rgba(var(--primary-rgb) / 0.12);
  background: rgba(var(--surface-rgb) / 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.54),
    0 3px 10px rgba(8, 14, 24, 0.045);
}

.page.home-page .search-filter-sticky .filter-chip::before {
  content: none;
}

.page.home-page .search-filter-sticky .filter-chip .chip-label {
  line-height: 1;
  letter-spacing: 0;
}

.page.home-page .search-filter-sticky .filter-chip svg {
  width: 12px;
  height: 12px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb) / 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
  opacity: 0.86;
  flex-shrink: 0;
}

.page.home-page .search-filter-sticky .filter-chip:hover {
  border-color: rgba(var(--primary-rgb) / 0.22);
  background: rgba(var(--surface-rgb) / 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.64),
    0 6px 14px rgba(8, 14, 24, 0.07);
}

.page.home-page .search-filter-sticky .filter-chip.active {
  color: var(--primary-deep);
  border-color: rgba(var(--primary-rgb) / 0.3);
  background: rgba(var(--primary-rgb) / 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 5px 14px rgba(var(--primary-rgb) / 0.1);
}

.page.home-page .search-filter-sticky .filter-chip.active svg {
  background: rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  color: var(--primary-deep);
}

.page.home-page .search-filter-sticky .filter-chip.active:hover {
  border-color: rgba(var(--primary-rgb) / 0.36);
  background: rgba(var(--primary-rgb) / 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 7px 16px rgba(var(--primary-rgb) / 0.12);
  transform: translateY(-1px);
}

.page.home-page .search-filter-sticky #clearFiltersBtn {
  min-height: 30px;
  padding: 5px 10px;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  border-color: rgba(var(--primary-rgb) / 0.12);
  background: rgba(var(--surface-rgb) / 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 3px 10px rgba(8, 14, 24, 0.045);
}

.page.home-page .search-filter-sticky #clearFiltersBtn svg {
  width: 11px;
  height: 11px;
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky {
  background: linear-gradient(
    180deg,
    rgba(var(--surface-rgb) / 0.92) 0%,
    rgba(var(--surface-rgb) / 0.9) 72%,
    rgba(var(--surface-rgb) / 0.86) 100%
  );
  border-bottom-color: rgba(var(--primary-rgb) / 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky .search {
  border-color: rgba(var(--primary-rgb) / 0.22);
  background: rgba(var(--surface-soft-rgb) / 0.95);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip {
  border-color: rgba(var(--primary-rgb) / 0.16);
  background: rgba(21, 24, 34, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 4px 12px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip svg {
  background: rgba(var(--primary-rgb) / 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip.active {
  color: #eafffb;
  border-color: rgba(var(--primary-rgb) / 0.36);
  background: rgba(var(--primary-rgb) / 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 16px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip.active svg {
  background: rgba(255, 255, 255, 0.1);
  color: #eafffb;
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky #clearFiltersBtn {
  border-color: rgba(var(--primary-rgb) / 0.16);
  background: rgba(21, 24, 34, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 4px 12px rgba(0, 0, 0, 0.18);
}

@media (max-width: 900px) {
  .page.home-page .search-filter-sticky {
    border-top-left-radius: var(--page-frame-radius-mobile);
    border-top-right-radius: var(--page-frame-radius-mobile);
    border-bottom-left-radius: var(--home-sticky-mobile-radius);
    border-bottom-right-radius: var(--home-sticky-mobile-radius);
  }

  .page.home-page .search-filter-sticky .topbar {
    padding: var(--home-sticky-mobile-topbar-padding);
  }

  .page.home-page .search-filter-sticky .search {
    height: var(--home-sticky-mobile-search-height);
  }

  .page.home-page .search-filter-sticky .filter-bar {
    padding: var(--home-sticky-mobile-filterbar-padding);
  }
}

@media (max-width: 768px) {
  .page.home-page .search-filter-sticky .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 10px;
    row-gap: 8px;
    align-items: start;
    height: auto;
    padding: var(--home-sticky-mobile-topbar-compact-padding) !important;
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn {
    grid-column: 1;
    grid-row: 1;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(var(--surface-rgb) / 0.92);
    border-color: rgba(var(--primary-rgb) / 0.14);
    box-shadow: 0 6px 16px rgba(8, 14, 24, 0.06);
  }

  .page.home-page .search-filter-sticky .search {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    min-width: 0;
  }

  .page.home-page .search-filter-sticky .top-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    justify-items: center;
    overflow: visible;
    padding: 2px 0 6px;
    margin: 0;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    padding: 0;
    border-radius: 999px;
    gap: 0;
    margin: 0 auto;
    background: var(--ta-bg);
    border-color: var(--ta-b);
    color: var(--ta-c);
    box-shadow: var(--ta-sh);
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon:hover,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon:active {
    transform: none;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon svg,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon-ico {
    width: 19px;
    height: 19px;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon#newAdBtn,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon#postAdLink,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon[href="/post.html"] {
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.18) 0%, rgba(var(--surface-rgb) / 0.92) 100%);
    border-color: rgba(var(--primary-rgb) / 0.4);
    color: var(--primary-deep);
    box-shadow:
      inset 1px 1px 0 rgba(255, 255, 255, 0.62),
      0 10px 24px rgba(var(--primary-rgb) / 0.16);
  }

  :root[data-theme="dark"] .page.home-page .search-filter-sticky .top-actions .topbar-icon#newAdBtn,
  :root[data-theme="dark"] .page.home-page .search-filter-sticky .top-actions .topbar-icon#postAdLink,
  :root[data-theme="dark"] .page.home-page .search-filter-sticky .top-actions .topbar-icon[href="/post.html"] {
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.2), rgba(16, 23, 34, 0.96));
    border-color: rgba(var(--primary-rgb) / 0.5);
    color: #eafffb;
    box-shadow:
      inset 1px 1px 0 rgba(255, 255, 255, 0.14),
      0 12px 28px rgba(var(--primary-rgb) / 0.14),
      0 10px 24px rgba(0, 0, 0, 0.3);
  }

  .page.home-page .search-filter-sticky .filter-bar {
    padding-top: 8px;
  }
}

@media (max-width: 380px) {
  .page.home-page .search-filter-sticky .top-actions {
    gap: 4px;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    border-radius: 13px;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon svg,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon-ico {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 640px) {
  .page.home-page .search-filter-sticky .filter-chip {
    min-height: 38px;
    padding: 8px 13px;
  }
}

/* ===== QUICK POLISH: APR 2026 ===== */

.admin-tabs .btn.toggle-active {
  color: var(--primary-deep);
  border-color: rgba(var(--primary-rgb) / 0.28);
  background: linear-gradient(180deg, rgba(var(--primary-rgb) / 0.17) 0%, rgba(var(--primary-rgb) / 0.08) 100%);
  box-shadow:
    0 8px 18px rgba(var(--primary-rgb) / 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.status-badge {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(var(--surface-rgb) / 0.92);
  color: var(--ink-secondary);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
}

.ad-empty,
.myads-empty,
.bg-library-empty,
.myads-draft-empty,
.users-empty,
.ad-error {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(var(--primary-rgb) / 0.18);
  background: linear-gradient(180deg, rgba(var(--surface-rgb) / 0.94) 0%, rgba(var(--surface-soft-rgb) / 0.86) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.page.home-page .search-filter-sticky {
  background: linear-gradient(
    180deg,
    rgba(var(--surface-rgb) / 0.9) 0%,
    rgba(var(--surface-rgb) / 0.88) 72%,
    rgba(var(--surface-rgb) / 0.84) 100%
  );
  border-bottom: 1px solid rgba(var(--primary-rgb) / 0.11);
  box-shadow: 0 4px 14px rgba(8, 14, 24, 0.04);
}

.page.home-page .search-filter-sticky::after {
  opacity: 0.025;
}

.page.home-page .search-filter-sticky .search {
  box-shadow: 0 3px 10px rgba(7, 16, 24, 0.045);
}

.page.home-page .search-filter-sticky .search:focus-within {
  box-shadow:
    0 0 0 3px rgba(var(--primary-rgb) / 0.1),
    0 6px 14px rgba(7, 16, 24, 0.06);
}

.page.home-page .search-filter-sticky .filter-chip {
  border-color: rgba(var(--primary-rgb) / 0.12);
  background: rgba(var(--surface-rgb) / 0.78);
}

.page.home-page .search-filter-sticky .filter-chip svg {
  background: rgba(var(--primary-rgb) / 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.page.home-page .search-filter-sticky .filter-chip:hover {
  border-color: rgba(var(--primary-rgb) / 0.22);
}

@media (max-width: 900px) {
  .bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: var(--mobile-bottom-nav-gap);
    padding: var(--mobile-bottom-nav-padding-y) var(--mobile-bottom-nav-padding-x)
      calc(var(--mobile-bottom-nav-padding-y) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-light);
    background: rgba(var(--surface-rgb) / 0.96);
    backdrop-filter: blur(10px) saturate(1.02);
    -webkit-backdrop-filter: blur(10px) saturate(1.02);
    box-shadow: 0 -12px 28px rgba(17, 24, 39, 0.08);
  }

  .bottom-nav-item {
    flex: 1 1 0;
    min-height: var(--mobile-bottom-nav-item-min-height);
    justify-content: center;
    border-radius: 14px;
  }

  .bottom-nav-item.active {
    background: rgba(var(--primary-rgb) / 0.1);
  }

  html:has(#bottomNav) {
    scroll-padding-bottom: calc(var(--mobile-bottom-nav-body-offset) + env(safe-area-inset-bottom));
  }

  body:has(#bottomNav) {
    padding-bottom: calc(var(--mobile-bottom-nav-body-offset) + env(safe-area-inset-bottom));
  }

  .page {
    margin: 12px;
    min-height: calc(100dvh - 24px);
    border-radius: var(--page-frame-radius-mobile);
  }
}

:root[data-theme="dark"] .admin-tabs .btn.toggle-active {
  color: #eafffb;
  box-shadow:
    0 10px 20px rgba(var(--primary-rgb) / 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .status-badge {
  background: rgba(var(--surface-soft-rgb) / 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .ad-empty,
:root[data-theme="dark"] .myads-empty,
:root[data-theme="dark"] .bg-library-empty,
:root[data-theme="dark"] .myads-draft-empty,
:root[data-theme="dark"] .users-empty,
:root[data-theme="dark"] .ad-error {
  border-color: rgba(var(--primary-rgb) / 0.16);
  background: linear-gradient(180deg, rgba(var(--surface-soft-rgb) / 0.9) 0%, rgba(var(--surface-rgb) / 0.88) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip {
  background: rgba(var(--surface-soft-rgb) / 0.9);
}

:root[data-theme="dark"] .bottom-nav {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: rgba(var(--surface-rgb) / 0.94);
}

/* Keep the uploaded page background visible through the large home surfaces. */
:root.has-custom-bg .page.home-page .search-filter-sticky {
  background: linear-gradient(
    180deg,
    rgba(var(--surface-rgb) / 0.72) 0%,
    rgba(var(--surface-rgb) / 0.66) 72%,
    rgba(var(--surface-soft-rgb) / 0.6) 100%
  );
  backdrop-filter: blur(16px) saturate(1.06);
  -webkit-backdrop-filter: blur(16px) saturate(1.06);
  border-bottom-color: rgba(var(--primary-rgb) / 0.16);
  box-shadow: 0 10px 24px rgba(8, 14, 24, 0.08);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .search {
  background: rgba(var(--surface-rgb) / 0.72);
  border-color: rgba(var(--primary-rgb) / 0.2);
  box-shadow: 0 6px 16px rgba(8, 14, 24, 0.07);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .search:focus-within {
  box-shadow:
    0 0 0 3px rgba(var(--primary-rgb) / 0.12),
    0 8px 20px rgba(8, 14, 24, 0.08);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .filter-chip {
  border-color: rgba(var(--primary-rgb) / 0.18);
  background: linear-gradient(180deg, rgba(var(--surface-rgb) / 0.76) 0%, rgba(var(--surface-soft-rgb) / 0.68) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 8px 18px rgba(8, 14, 24, 0.08);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .filter-chip svg {
  background: rgba(var(--primary-rgb) / 0.12);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .filter-chip:hover {
  border-color: rgba(var(--primary-rgb) / 0.24);
  background: linear-gradient(180deg, rgba(var(--surface-rgb) / 0.8) 0%, rgba(var(--surface-soft-rgb) / 0.72) 100%);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .filter-chip.active {
  background: linear-gradient(180deg, rgba(var(--primary-rgb) / 0.26) 0%, rgba(var(--primary-rgb) / 0.14) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 10px 22px rgba(var(--primary-rgb) / 0.16);
}

:root.has-custom-bg .page.home-page .search-filter-sticky .mobile-menu-btn,
:root.has-custom-bg
  .page.home-page
  .search-filter-sticky
  .top-actions
  .topbar-icon:not(.is-feed-active, #newAdBtn, #postAdLink, [href="/post.html"]) {
  background: var(--ta-bg);
  border-color: var(--ta-b);
  box-shadow: var(--ta-sh);
}


/* ===== HOME MOBILE GEOMETRY (critical owner) ===== */
/* ===== MOBILE OGLASNIKI: reference gallery style ===== */
@media (max-width: 900px) {
  .page.home-page .search-filter-sticky .topbar {
    min-height: 0;
    height: auto;
    padding: 8px 8px 10px;
    gap: 8px;
    row-gap: 8px;
  }

  .page.home-page .search-filter-sticky .topbar .top-actions {
    display: grid;
  }

  .page.home-page .search-filter-sticky .search {
    height: 40px;
  }

  .page.home-page .search-filter-sticky .search input {
    font-size: 14px;
  }

  .page.home-page .search-filter-sticky .filter-bar {
    gap: 4px;
    padding: 8px 8px 8px;
  }

  .page.home-page .search-filter-sticky .filter-chip {
    min-height: 31px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: none;
  }

  .page.home-page .search-filter-sticky .filter-chip .chip-label {
    display: block;
    line-height: 1;
  }

  .page.home-page .search-filter-sticky .filter-chip .chip-close {
    width: 14px;
    height: 14px;
    font-size: 12px;
    margin-left: 2px;
  }

  .page.home-page .search-filter-sticky .filter-chip svg {
    display: none;
  }

  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] {
    width: 34px;
    min-width: 34px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }

  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] svg {
    display: block;
    width: 14px;
    height: 14px;
    opacity: 0.95;
  }

  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] .chip-label,
  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] .chip-close {
    display: none;
  }

  .page.home-page #clearFiltersBtn {
    min-height: 32px;
    padding: 6px 10px;
    gap: 4px;
    flex: 0 0 auto;
  }

  .page.home-page #clearFiltersBtn span {
    display: none;
  }

  .page.home-page #clearFiltersBtn::after {
    content: "Počisti";
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  .page.home-page .search-filter-sticky .filter-chip:hover,
  .page.home-page .search-filter-sticky .filter-chip.active:hover {
    transform: none;
    box-shadow: none;
  }

  :root:not([data-theme="dark"]) .page.home-page .search-filter-sticky .filter-chip {
    background: #f2f5f7;
    border-color: #c9d4de;
    color: #233340;
  }

  :root:not([data-theme="dark"]) .page.home-page .search-filter-sticky .filter-chip.active {
    background: #dff3ee;
    border-color: rgba(var(--primary-rgb) / 0.5);
    color: #0c5b55;
  }

  :root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip {
    background: #1b2330;
    border-color: #2f3b4f;
    color: #e6edf8;
  }

  :root[data-theme="dark"] .page.home-page .search-filter-sticky .filter-chip.active {
    background: #0f5a56;
    border-color: #1a8780;
    color: #f3fffd;
  }

  .page.home-page .main-wrap {
    padding: 0;
  }

  .page.home-page .cards {
    gap: 0;
  }

  .page.home-page .cards-header {
    display: none;
  }
}

/* ===== MOBILE HOME POLISH: APR 2026 ===== */
@media (max-width: 900px) {
  .page.home-page {
    margin: 6px;
    min-height: calc(100dvh - 12px);
    border-radius: 24px;
    overflow: clip;
  }

  .page.home-page .search-filter-sticky {
    margin: 0;
    border-radius: 24px 24px 18px 18px;
    border-bottom: 1px solid rgba(var(--primary-rgb) / 0.16);
    background:
      linear-gradient(180deg, rgba(var(--surface-rgb) / 0.88) 0%, rgba(var(--surface-rgb) / 0.76) 100%),
      rgba(var(--surface-rgb) / 0.72);
    backdrop-filter: blur(18px) saturate(1.16);
    -webkit-backdrop-filter: blur(18px) saturate(1.16);
    box-shadow:
      0 12px 30px rgba(8, 14, 24, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }

  .page.home-page .search-filter-sticky .topbar {
    display: grid;
    grid-template-columns: var(--control-44) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .topbar {
    grid-template-columns: var(--control-44) minmax(0, 1fr) var(--control-44);
    grid-template-rows: auto;
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    border-radius: 15px;
    border: 1px solid rgba(var(--primary-rgb) / 0.18);
    background: rgba(var(--surface-rgb) / 0.78);
    color: var(--ink-secondary);
    box-shadow:
      0 8px 18px rgba(8, 14, 24, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn {
    display: flex;
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn {
    grid-column: 1;
    grid-row: 1;
  }

  .page.home-page .search-filter-sticky .search {
    grid-column: 2;
    grid-row: 1;
    height: var(--control-44);
    border-radius: 17px;
    border-color: rgba(var(--primary-rgb) / 0.2);
    background: rgba(var(--surface-rgb) / 0.86);
    box-shadow:
      0 8px 20px rgba(8, 14, 24, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.46);
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .top-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .top-actions .topbar-icon:not(#loginLink) {
    display: none !important;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .top-actions #loginLink {
    display: inline-flex !important;
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    margin: 0;
    padding: 0;
    border-radius: 15px;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon .topbar-icon-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .page.home-page .search-filter-sticky .top-actions .topbar-icon svg,
  .page.home-page .search-filter-sticky .top-actions .topbar-icon-ico,
  .page.home-page .search-filter-sticky .mobile-menu-btn svg {
    width: 19px;
    height: 19px;
  }

  .page.home-page .search-filter-sticky .filter-bar {
    gap: 6px;
    padding: 8px 10px 10px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-padding-inline: 10px;
  }

  .page.home-page .search-filter-sticky .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .page.home-page .search-filter-sticky .filter-chip,
  .page.home-page #clearFiltersBtn {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border-color: rgba(var(--primary-rgb) / 0.2);
    background: rgba(var(--surface-rgb) / 0.78);
    color: var(--ink-secondary);
    box-shadow:
      0 8px 18px rgba(8, 14, 24, 0.07),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
  }

  .page.home-page .search-filter-sticky .filter-chip.active {
    border-color: rgba(var(--primary-rgb) / 0.48);
    background: linear-gradient(180deg, rgba(var(--primary-rgb) / 0.18), rgba(var(--surface-rgb) / 0.86));
    color: var(--primary-deep);
    box-shadow:
      0 10px 22px rgba(var(--primary-rgb) / 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.48);
  }

  .bottom-nav {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    height: auto;
    min-height: 62px;
    border: 1px solid rgba(var(--primary-rgb) / 0.16);
    border-radius: 22px;
    background: rgba(var(--surface-rgb) / 0.9);
    box-shadow:
      0 -10px 30px rgba(8, 14, 24, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .bottom-nav-item {
    border-radius: 17px;
    min-height: var(--mobile-bottom-nav-item-min-height);
    padding: 6px 8px;
    color: var(--ink-secondary);
  }

  .bottom-nav-item.active {
    background: rgba(var(--primary-rgb) / 0.12);
    color: var(--primary-deep);
  }

  html:has(#bottomNav) {
    scroll-padding-bottom: calc(var(--mobile-bottom-nav-body-offset) + env(safe-area-inset-bottom));
  }

  body:has(#bottomNav) {
    padding-bottom: calc(var(--mobile-bottom-nav-body-offset) + env(safe-area-inset-bottom));
  }
}

@media (max-width: 768px) {
  .page.home-page .main-wrap {
    padding: 0 0 18px;
  }

  .page.home-page .cards {
    gap: 0;
  }
}

@media (max-width: 380px) {
  .page.home-page {
    margin: 4px;
    border-radius: 22px;
  }

  .page.home-page .search-filter-sticky .topbar {
    gap: 7px;
    padding: 8px;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .topbar {
    grid-template-columns: var(--control-44) minmax(0, 1fr) var(--control-44);
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn,
  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .top-actions #loginLink {
    width: var(--control-44);
    min-width: var(--control-44);
    height: var(--control-44);
    border-radius: 14px;
  }

  .page.home-page .search-filter-sticky .search {
    height: var(--control-44);
    border-radius: 15px;
  }
}

/* Osnovna mobile scroll geometrija mora biti prisotna ze ob prvem izrisu. */
@media (max-width: 768px) {
  .page.home-page .search-filter-sticky {
    --home-scroll-expanded-shell-height: 174px;
    --home-scroll-actions-overlay-top: 60px;
    --home-scroll-filter-overlay-top: 116px;
    min-height: var(--home-scroll-expanded-shell-height);
    overflow: visible;
  }

  .page.home-page .search-filter-sticky .topbar {
    position: relative;
    row-gap: 8px;
  }

  .page.home-page .search-filter-sticky .top-actions,
  .page.home-page .search-filter-sticky .filter-bar {
    position: absolute;
    right: 8px;
    left: 8px;
    z-index: 3;
  }

  .page.home-page .search-filter-sticky .top-actions {
    top: var(--home-scroll-actions-overlay-top);
    grid-row: auto;
    grid-column: auto;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky {
    --home-scroll-expanded-shell-height: 124px;
    --home-scroll-filter-overlay-top: 68px;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky .top-actions {
    top: 8px;
    left: auto;
    width: var(--control-44);
    min-width: var(--control-44);
  }

  .page.home-page .search-filter-sticky .filter-bar {
    top: var(--home-scroll-filter-overlay-top);
  }
}

@media (min-width: 1101px) {
  .page.home-page .home-shell {
    width: 100%;
    max-width: var(--width-shell);
    margin-inline: auto;
  }

  .page.home-page .main-wrap {
    width: 100%;
    max-width: var(--width-content);
    align-self: stretch;
    margin-inline: auto;
  }
}


/* Kriticni stil za domov: zgornji del, filtri, skeleton in prvi viewport oglasov. */

.page.home-page #searchSuggestions {
  display: none;
}

.ad-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 32px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ad-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ghost-bg);
  display: grid;
  place-items: center;
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--primary);
}

.ad-empty-title {
  font-size: 16px;
  font-weight: 700;
}

.ad-empty-text {
  max-width: 300px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(var(--ads-per-row, 6), minmax(0, 1fr));
  gap: var(--home-feed-grid-gap, var(--space-16));
  align-items: stretch;
}

.skeleton-card {
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-14);
  background: var(--surface);
  animation: home-critical-pulse 1.4s ease-in-out infinite;
}

.skeleton-thumb {
  height: 170px;
  background: var(--surface-soft);
}

.skeleton-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.skeleton-line.short {
  width: 55%;
}

.skeleton-line.tiny {
  width: 35%;
  height: 10px;
}

@keyframes home-critical-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: var(--z-emergency, 900);
  padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-100% - 18px));
  transition:
    opacity var(--motion-120) var(--motion-ease),
    transform var(--motion-120) var(--motion-ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-40);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: none;
  transition:
    background-color var(--motion-180),
    border-color var(--motion-180),
    color var(--motion-180),
    box-shadow var(--motion-180),
    transform var(--motion-180);
}

.btn:hover {
  background: var(--btn-hover);
  border-color: var(--btn-border-hover);
}

.btn.primary {
  border-color: transparent;
  background: var(--color-primary);
  color: var(--color-on-primary);
  box-shadow: var(--primary-shadow);
}

.btn.primary:hover {
  background: var(--primary-strong);
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  background: var(--ghost-bg);
  border-color: var(--ghost-border);
  color: var(--primary);
}

.btn.small {
  min-height: var(--control-32);
  padding: 5px 10px;
  font-size: 12px;
}

.btn:is(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.filter-chip:focus-visible {
  outline: 2px solid var(--glow-strong);
  outline-offset: 2px;
}

.icon-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-danger);
  color: var(--color-on-danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

@media (max-width: 768px) {
  .page.home-page .mobile-bottom-duplicate {
    --home-top-action-display: none;
    display: none;
  }
}

html[data-auth-state="user"] .page.home-page .top-actions #newAdBtn.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #myAdsBtn.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #profileLink.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #recentLink.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #favoritesLink.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #priceAlertsLink.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #messagesBtn.hidden,
html[data-auth-state="user"] .page.home-page .top-actions #logoutBtn.hidden {
  display: var(--home-top-action-display, inline-flex);
}

html[data-auth-state="user"] .page.home-page .top-actions #loginLink,
html[data-auth-state="user"] .page.home-page .top-actions #loginLink.hidden {
  display: none;
}

html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #newAdBtn,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #myAdsBtn,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #profileLink,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #recentLink,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #favoritesLink,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #priceAlertsLink,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #messagesBtn,
html[data-auth-state="user"].nova-auth-pending .page.home-page .top-actions #logoutBtn,
html[data-auth-state="guest"].nova-auth-pending .page.home-page .top-actions #loginLink {
  visibility: visible;
  pointer-events: auto;
}

.page.home-page .top-actions .topbar-icon.is-feed-active {
  border-color: rgba(var(--primary-rgb) / 0.48);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--color-on-primary);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.28),
    0 14px 32px rgba(var(--primary-rgb) / 0.26);
  transform: translateY(-1px);
}

.page.home-page .top-actions .topbar-icon.is-feed-active:hover {
  border-color: rgba(var(--primary-rgb) / 0.6);
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  color: var(--color-on-primary);
}

.page.home-page .top-actions .topbar-icon.is-feed-active .icon-badge {
  border: 2px solid var(--primary);
}

:root[data-theme="dark"] .page.home-page .top-actions .topbar-icon.is-feed-active {
  color: var(--color-on-primary);
}

:root[data-theme="dark"] .page.home-page .top-actions .topbar-icon.is-feed-active:hover {
  color: var(--color-on-primary);
}

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  caret-color: var(--caret-color);
  transition:
    border-color var(--motion-180),
    box-shadow var(--motion-180);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

.section-heading {
  padding: 4px 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

.cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cards-header h2 {
  font-size: 20px;
}

.cards-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  padding: 4px;
  border: 1px solid rgba(var(--primary-rgb) / 0.22);
  border-radius: 999px;
  background: rgba(var(--surface-rgb) / 0.9);
  box-shadow: var(--shadow);
}

.cards-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-secondary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.cards-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
  flex: 0 0 auto;
}

.clear-btn {
  min-height: 42px;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--filterchip-border);
  background: var(--filterchip-bg);
  color: var(--filterchip-text);
  box-shadow: var(--filterchip-shadow);
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  background: none;
  color: var(--ink-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--motion-180),
    border-color var(--motion-180),
    color var(--motion-180),
    box-shadow var(--motion-180),
    transform var(--motion-180);
}

.category-item:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.category-item.active {
  color: var(--ink);
  font-weight: 600;
}

.category-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
}

.category-item.active svg,
.category-item:hover svg {
  opacity: 1;
}

.ad-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--home-feed-grid-gap, var(--space-16));
  align-items: stretch;
  contain: layout style;
}

@media (min-width: 901px) {
  .page.home-page .ad-grid {
    grid-template-columns: repeat(auto-fit, minmax(max(172px, calc((100% - 5 * var(--home-feed-grid-gap, var(--space-16))) / 6)), 1fr));
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .page.home-page .cards-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page.home-page .cards-controls {
    width: auto;
    max-width: 100%;
    justify-content: flex-start;
  }
}


.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  padding: 0 0 4px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--filterchip-border);
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  background: var(--filterchip-bg);
  color: var(--filterchip-text);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: var(--filterchip-shadow);
  transition:
    background var(--motion-180) var(--motion-ease),
    color var(--motion-180) var(--motion-ease),
    border-color var(--motion-180) var(--motion-ease),
    box-shadow var(--motion-180) var(--motion-ease),
    transform var(--motion-180) var(--motion-ease);
}

.filter-chip:hover {
  background: var(--filterchip-bg-hover);
  border-color: var(--filterchip-border-hover);
  color: var(--filterchip-text-hover);
  transform: translateY(-1px);
}

.filter-chip.active {
  border-color: rgba(var(--primary-rgb) / 0.38);
  background: rgba(var(--primary-rgb) / 0.16);
  color: var(--primary-deep);
}

.filter-chip .chip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  line-height: 1;
}


.page.home-page .ad-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-light);
  height: 100%;
  border-radius: var(--radius-14);
  background: var(--card-bg);
  box-shadow: 0 1px 0 rgba(27, 27, 31, 0.04);
  cursor: pointer;
  contain: layout style paint;
  content-visibility: auto;
  contain-intrinsic-size: 280px;
  transition:
    transform var(--motion-180) var(--motion-ease),
    box-shadow var(--motion-180) var(--motion-ease),
    border-color var(--motion-180) var(--motion-ease);
}

.ad-card:hover,
.ad-card:focus-within {
  transform: translateY(-1px);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.ad-card.ad-card-open-source {
  transform: translateY(-2px) scale(0.992);
  border-color: rgba(var(--primary-rgb) / 0.38);
  box-shadow: 0 8px 28px rgba(var(--primary-rgb) / 0.16);
}

.ad-card-open-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox, 700);
  pointer-events: none;
  background: radial-gradient(circle at 50% 46%, rgba(var(--primary-rgb) / 0.13), rgba(15, 23, 42, 0));
  transform: translate3d(0, 0, 0);
  will-change: opacity, transform;
  animation: ad-card-open-backdrop var(--motion-320) var(--motion-ease) forwards;
}

.ad-card.ad-card-open-flight {
  position: fixed;
  z-index: calc(var(--z-lightbox, 700) + 1);
  margin: 0;
  pointer-events: none;
  display: flex;
  transform-origin: center;
  transform: translate3d(0, 0, 0) scale(1);
  content-visibility: visible;
  contain: layout style paint;
  isolation: isolate;
  animation: ad-card-open-flight var(--motion-320) var(--motion-ease) forwards;
  will-change: transform, opacity;
  backface-visibility: hidden;
  border-color: rgba(var(--primary-rgb) / 0.48);
  box-shadow:
    0 36px 90px rgba(15, 23, 42, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

@keyframes ad-card-open-backdrop {
  0% {
    opacity: 0;
  }
  36% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes ad-card-open-flight {
  0% {
    opacity: 1;
    transform: perspective(900px) translate3d(0, 0, 0) scale(1);
  }
  12% {
    opacity: 1;
    transform: perspective(900px) translate3d(var(--ad-open-dx-10), var(--ad-open-dy-10-lift), 22px)
      scale(var(--ad-open-scale-10));
  }
  24% {
    opacity: 1;
    transform: perspective(900px) translate3d(var(--ad-open-dx-20), var(--ad-open-dy-20-lift), 70px)
      scale(var(--ad-open-scale-24));
  }
  38% {
    opacity: 1;
    transform: perspective(900px) translate3d(var(--ad-open-dx-44), var(--ad-open-dy-44-lift), 97px)
      scale(var(--ad-open-scale-44));
  }
  54% {
    opacity: 0.99;
    transform: perspective(900px) translate3d(var(--ad-open-dx-64), var(--ad-open-dy-64-lift), 141px)
      scale(var(--ad-open-scale-64));
  }
  70% {
    opacity: 0.94;
    transform: perspective(900px) translate3d(var(--ad-open-dx-82), var(--ad-open-dy-82), 150px)
      scale(var(--ad-open-scale-80));
  }
  84% {
    opacity: 0.54;
    transform: perspective(900px) translate3d(var(--ad-open-dx-93), var(--ad-open-dy-93), 205px)
      scale(var(--ad-open-scale-93));
  }
  100% {
    opacity: 0;
    transform: perspective(900px) translate3d(var(--ad-open-dx), var(--ad-open-dy), 220px)
      scale(var(--ad-open-end-scale));
  }
}

.ad-card .ad-thumb {
  position: relative;
  display: grid;
  place-items: center;
  height: 180px;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface-muted) 100%);
}

.ad-card .ad-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ad-thumb-placeholder {
  font-size: 36px;
  opacity: 0.12;
}

.ad-card-body {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
}

.ad-title {
  display: -webkit-box;
  min-height: 2.7em;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ad-title:is(a) {
  text-decoration: none;
}

.ad-title:is(a):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .ad-card {
    transition: none;
  }

  .ad-card:hover,
  .ad-card:focus-within {
    transform: none;
  }

  .ad-card.ad-card-open-source {
    transform: none;
    box-shadow: var(--shadow-md);
  }

  .ad-card-open-backdrop,
  .ad-card.ad-card-open-flight {
    display: none;
    animation: none;
  }
}

.ad-card-price {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.ad-card-loc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.ad-card-location {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.ad-card-views {
  padding: 2px 7px;
  border: 1px solid rgba(var(--primary-rgb) / 0.28);
  border-radius: 999px;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.ad-meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ad-fav-btn {
  border: none;
  background: none;
  color: var(--muted-light);
  cursor: pointer;
  padding: 2px;
}

.ad-fav-btn.is-active {
  color: var(--red);
}

.ad-fav-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.ad-card .ad-badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  border-radius: 999px;
  background: var(--color-success);
  color: var(--color-on-success);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

html[data-auth-state="guest"] .ad-card .ad-badge-new,
html:not([data-auth-state="user"]) .ad-badge-new {
  display: none;
}

.page.home-page .ad-card {
  border-color: rgba(var(--primary-rgb) / 0.16);
  background: linear-gradient(
    180deg,
    rgb(var(--surface-rgb) / var(--ad-a)),
    rgb(var(--surface-soft-rgb) / var(--ad-a))
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 34px rgba(0, 0, 0, 0.18);
}

:root:not([data-theme="dark"]) .page.home-page .ad-card {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 14px 30px rgba(17, 24, 39, 0.09);
}

.page.home-page .ad-card:hover,
.page.home-page .ad-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(var(--primary-rgb) / 0.34);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 18px 38px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(var(--primary-rgb) / 0.08);
}

:root:not([data-theme="dark"]) .page.home-page .ad-card:hover,
:root:not([data-theme="dark"]) .page.home-page .ad-card:focus-within {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.76) inset,
    0 20px 38px rgba(17, 24, 39, 0.13),
    0 0 0 1px rgba(var(--primary-rgb) / 0.08);
}

.page.home-page .ad-card .ad-thumb {
  border-bottom-color: rgba(var(--primary-rgb) / 0.1);
  background: linear-gradient(135deg, rgba(var(--surface-muted-rgb) / 0.96), rgba(var(--surface-soft-rgb) / 0.84));
}

.page.home-page .ad-card .ad-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 44%, rgba(0, 0, 0, 0.2));
  opacity: 0.72;
  pointer-events: none;
}

:root:not([data-theme="dark"]) .page.home-page .ad-card .ad-thumb::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 48%, rgba(0, 0, 0, 0.1));
}

.page.home-page .ad-card .ad-thumb img {
  transform: scale(1.01);
}

.page.home-page .ad-card:hover .ad-thumb img {
  transform: scale(1.035);
  filter: saturate(1.1) contrast(1.04) brightness(1.03);
}

.page.home-page .ad-card-body {
  flex: 1 1 auto;
  gap: 7px;
  padding: 15px 16px 16px;
  background: linear-gradient(
    180deg,
    rgb(var(--surface-rgb) / var(--ad-b)),
    rgb(var(--surface-soft-rgb) / var(--ad-b))
  );
}

:root.nova-liquid-ui:not([data-theme="dark"]) .page.home-page .ad-card-body {
  background: linear-gradient(
    180deg,
    rgb(var(--surface-rgb) / var(--ad-b)),
    rgb(var(--surface-soft-rgb) / var(--ad-b))
  );
}

.page.home-page .ad-title {
  min-height: 2.64em;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: 0;
}

.page.home-page .ad-card-price {
  margin-top: 0;
  color: var(--primary);
  font-size: 18px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.page.home-page .ad-card-loc-row {
  align-items: flex-end;
  gap: 10px;
  margin-top: 2px;
}

.page.home-page .ad-meta-row {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--control-52);
  gap: 7px;
  align-content: flex-start;
  flex-wrap: wrap;
}

.page.home-page .ad-category-tag {
  padding: 5px 10px;
  border-color: rgba(var(--primary-rgb) / 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: var(--color-on-primary);
  box-shadow: 0 8px 16px rgba(var(--primary-rgb) / 0.14);
  letter-spacing: 0;
}

.page.home-page .ad-card-location {
  display: flex;
  align-items: center;
  flex: 1 0 100%;
  gap: 4px;
  min-width: 0;
  overflow: visible;
  opacity: 0.88;
  text-overflow: clip;
  white-space: normal;
}

.page.home-page .ad-card-location::before {
  content: none;
}

.page.home-page .ad-card-location svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  opacity: 0.82;
}

.page.home-page .ad-fav-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  padding: 0;
  border: 1px solid rgba(var(--primary-rgb) / 0.12);
  border-radius: 999px;
  background: rgba(var(--surface-muted-rgb) / 0.58);
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.page.home-page .ad-fav-btn:hover {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.12);
}

.page.home-page .ad-fav-btn.is-active,
.page.home-page .ad-fav-btn[aria-pressed="true"] {
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.14);
  color: var(--red);
}

.page.home-page .ad-fav-btn.is-active svg,
.page.home-page .ad-fav-btn[aria-pressed="true"] svg {
  fill: currentColor;
  stroke: currentColor;
}

.page.home-page .ad-card .ad-badge-new {
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  letter-spacing: 0;
}

.ad-load-more-wrap,
.load-more-wrap {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.view-toggle-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 12px;
  border-color: rgba(var(--primary-rgb) / 0.18);
  background: rgba(var(--surface-soft-rgb) / 0.72);
  color: var(--ink-secondary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.view-toggle-btn:hover {
  border-color: rgba(var(--primary-rgb) / 0.34);
  background: rgba(var(--primary-rgb) / 0.1);
  color: var(--ink);
}


@media (max-width: 900px) {
  .skeleton-grid,
  .ad-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .cards-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .cards-controls {
    width: auto;
    max-width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .page.home-page .ad-grid,
  .page.home-page .skeleton-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--home-feed-mobile-grid-gap, var(--space-4));
  }

  .page.home-page .ad-grid > .ad-card,
  .page.home-page .skeleton-grid > .skeleton-card {
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .page.home-page.trg-page .main-wrap {
    padding-right: 0;
    padding-left: 0;
  }

  .page.home-page.trg-page .cards {
    gap: 0;
  }

  .page.home-page.trg-page .ad-grid,
  .page.home-page.trg-page .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--home-feed-mobile-grid-gap, var(--space-4));
    padding: 0 0 12px;
    background: transparent;
  }

  .page.home-page.trg-page .ad-card,
  .page.home-page.trg-page .skeleton-card {
    border: 1px solid rgba(var(--primary-rgb) / 0.1);
    border-radius: 14px;
    background: rgba(var(--surface-rgb) / 0.96);
    box-shadow:
      0 5px 13px rgba(8, 14, 24, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.42);
    overflow: hidden;
    isolation: isolate;
  }

  .page.home-page.trg-page .ad-card:hover,
  .page.home-page.trg-page .ad-card:focus-within {
    transform: none;
    box-shadow:
      0 7px 16px rgba(8, 14, 24, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.44);
  }

  .page.home-page.trg-page .ad-card .ad-thumb,
  .page.home-page.trg-page .skeleton-thumb {
    order: 1;
    height: auto;
    aspect-ratio: 1 / 0.98;
    border-bottom: 1px solid rgba(var(--primary-rgb) / 0.08);
  }

  .page.home-page.trg-page .ad-card-body {
    order: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: center;
    position: static;
    gap: 2px;
    min-height: 50px;
    padding: 7px 8px 8px;
    border-top: 0;
    background: rgba(var(--surface-rgb) / 0.98);
  }

  .page.home-page.trg-page .ad-card-price {
    order: 1;
    max-width: 100%;
    margin-top: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page.home-page.trg-page .ad-card-price::after {
    content: "";
  }

  .page.home-page.trg-page .ad-title {
    order: 2;
    width: 100%;
    min-height: 14px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .page.home-page.trg-page .ad-card-loc-row {
    order: 3;
    display: block;
    width: 0;
    height: 0;
    min-height: 0;
    margin: 0;
    overflow: visible;
  }

  .page.home-page.trg-page .ad-meta-row,
  .page.home-page.trg-page .ad-category-tag,
  .page.home-page.trg-page .ad-card-location,
  .page.home-page.trg-page .ad-card-views,
  .page.home-page.trg-page .ad-badge-new {
    display: none;
  }

  .page.home-page.trg-page .ad-fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4;
    display: grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: #e11d48;
    box-shadow:
      0 8px 18px rgba(8, 14, 24, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  .page.home-page.trg-page .ad-fav-btn svg {
    width: 17px;
    height: 17px;
  }
}


/* ===== MOBILE HOME REFINEMENT: JUL 2026 ===== */
.mobile-sidebar-close {
  display: none;
}

.mobile-menu-glyph {
  display: grid;
  width: 20px;
  gap: 4px;
}

.mobile-menu-glyph > span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition:
    width var(--motion-180) var(--motion-ease),
    opacity var(--motion-180) var(--motion-ease),
    transform var(--motion-180) var(--motion-ease);
}

.mobile-menu-glyph > span:nth-child(1) {
  width: 20px;
}

.mobile-menu-glyph > span:nth-child(2) {
  width: 14px;
}

.mobile-menu-glyph > span:nth-child(3) {
  width: 17px;
}

.mobile-menu-btn[aria-expanded="true"] .mobile-menu-glyph > span:nth-child(1) {
  width: 20px;
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] .mobile-menu-glyph > span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-btn[aria-expanded="true"] .mobile-menu-glyph > span:nth-child(3) {
  width: 20px;
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
  body.sidebar-menu-open {
    overflow: hidden;
    touch-action: pan-y;
  }

  body.sidebar-menu-open .page.home-page {
    z-index: auto;
    transform: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    perspective: none !important;
    contain: none !important;
    will-change: auto !important;
    transition: none !important;
  }

  body.sidebar-menu-open .sidebar-overlay.active {
    position: fixed;
    inset: 0 !important;
    background: rgba(7, 12, 20, 0.52);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    pointer-events: auto;
    z-index: var(--z-overlay, 400);
  }

  .page.home-page .home-sidebar {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    width: min(86vw, 344px);
    height: auto;
    max-height: none;
    padding: 0;
    gap: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(var(--primary-rgb) / 0.2);
    border-radius: 26px;
    background:
      linear-gradient(180deg, rgba(var(--surface-rgb) / 0.98), rgba(var(--surface-soft-rgb) / 0.98)), var(--surface);
    box-shadow:
      0 28px 72px rgba(4, 10, 18, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.46);
    transform: translate3d(calc(-100% - 24px), 0, 0);
    transition:
      visibility 0s linear var(--motion-320),
      opacity var(--motion-180) var(--motion-ease),
      transform var(--motion-320) var(--motion-ease);
    z-index: var(--z-modal, 500);
  }

  .page.home-page .home-sidebar.sidebar-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
  }

  body.sidebar-menu-open .page.home-page .home-sidebar .sidebar-brand {
    display: flex;
  }

  .page.home-page .home-sidebar .sidebar-brand {
    min-height: 72px;
    margin: 0;
    padding: 0 72px 0 18px;
    border: 0;
    border-bottom: 1px solid rgba(var(--primary-rgb) / 0.14);
    border-radius: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.12), transparent 72%);
    box-shadow: none;
  }

  .page.home-page .home-sidebar .sidebar-logo {
    width: 38px;
    height: 38px;
  }

  .page.home-page .home-sidebar .sidebar-brand-text {
    font-size: 20px;
    letter-spacing: -0.02em;
  }

  .page.home-page .mobile-sidebar-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(var(--primary-rgb) / 0.2);
    border-radius: 15px;
    background: rgba(var(--surface-rgb) / 0.82);
    color: var(--ink-secondary);
    box-shadow:
      0 8px 20px rgba(7, 12, 20, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.44);
    cursor: pointer;
  }

  .page.home-page .mobile-sidebar-close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
  }

  .page.home-page .mobile-sidebar-close:hover {
    border-color: rgba(var(--primary-rgb) / 0.38);
    background: rgba(var(--primary-rgb) / 0.12);
    color: var(--primary-deep);
  }

  .page.home-page .home-sidebar .sidebar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    grid-template-columns: none;
    gap: 6px;
    max-height: none;
    padding: 12px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .page.home-page .home-sidebar .category-item,
  .page.home-page .home-sidebar .category-item[data-category=""] {
    grid-column: auto;
    min-height: 50px;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: var(--ink-secondary);
    box-shadow: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    white-space: normal;
  }

  .page.home-page .home-sidebar .category-item:hover {
    border-color: rgba(var(--primary-rgb) / 0.15);
    background: rgba(var(--primary-rgb) / 0.08);
  }

  .page.home-page .home-sidebar .category-item.active {
    border-color: rgba(var(--primary-rgb) / 0.34);
    background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.2), rgba(var(--surface-rgb) / 0.78));
    color: var(--primary-deep);
    box-shadow: inset 3px 0 0 var(--primary);
  }

  .page.home-page .home-sidebar .category-item.active::after {
    content: none;
  }

  .page.home-page .home-sidebar .category-item svg {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    opacity: 0.9;
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn {
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.13), rgba(var(--surface-rgb) / 0.9));
    box-shadow:
      0 9px 22px rgba(5, 12, 20, 0.11),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
  }

  .page.home-page .search-filter-sticky .mobile-menu-btn[aria-expanded="true"] {
    border-color: rgba(var(--primary-rgb) / 0.52);
    background: rgba(var(--primary-rgb) / 0.18);
    color: var(--primary-deep);
    box-shadow:
      0 0 0 3px rgba(var(--primary-rgb) / 0.11),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }

  .page.home-page .search-filter-sticky .filter-bar {
    gap: 7px;
  }

  .page.home-page .search-filter-sticky .filter-chip,
  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"],
  .page.home-page #clearFiltersBtn {
    width: auto;
    min-width: auto;
    min-height: 40px;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  .page.home-page .search-filter-sticky .filter-chip svg,
  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] svg {
    display: block;
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 0.9;
  }

  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] .chip-label {
    display: block;
  }

  body:has(.page.home-page) .bottom-nav {
    bottom: max(8px, env(safe-area-inset-bottom));
    align-items: center;
    box-sizing: border-box;
    width: auto;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    padding: 5px 7px;
    overflow: hidden;
  }

  body:has(.page.home-page) .bottom-nav-item {
    box-sizing: border-box;
    height: 52px;
    min-height: 52px;
    max-height: 52px;
    padding: 5px 4px;
    gap: 3px;
    line-height: 1;
  }
}

@media (max-width: 768px) {
  .page.home-page .search-filter-sticky {
    --home-scroll-expanded-shell-height: 230px;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky {
    --home-scroll-expanded-shell-height: 182px;
  }

  .page.home-page .search-filter-sticky:has(#clearFiltersBtn:not(.hidden)) {
    --home-scroll-expanded-shell-height: 282px;
  }

  html:not([data-auth-state="user"]) .page.home-page .search-filter-sticky:has(#clearFiltersBtn:not(.hidden)) {
    --home-scroll-expanded-shell-height: 234px;
  }

  html[data-auth-state="user"] .page.home-page .search-filter-sticky .top-actions {
    padding: 4px 6px;
    border: 1px solid rgba(var(--primary-rgb) / 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(var(--surface-soft-rgb) / 0.78), rgba(var(--surface-rgb) / 0.68));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 8px 20px rgba(8, 14, 24, 0.06);
  }

  html[data-auth-state="user"] .page.home-page .search-filter-sticky .top-actions .topbar-icon {
    border-radius: 14px;
    background: rgba(var(--surface-rgb) / 0.7);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  }

  .page.home-page .search-filter-sticky .filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    overflow: visible;
  }

  .page.home-page .search-filter-sticky .filter-chip,
  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] {
    width: 100%;
    min-width: 0;
    min-height: var(--control-44);
    justify-content: center;
    padding-inline: 7px;
  }

  .page.home-page #clearFiltersBtn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  :root[data-theme="dark"][data-auth-state="user"] .page.home-page .search-filter-sticky .top-actions {
    border-color: rgba(var(--primary-rgb) / 0.18);
    background: linear-gradient(180deg, rgba(24, 29, 40, 0.9), rgba(16, 20, 29, 0.82));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.06),
      0 10px 22px rgba(0, 0, 0, 0.22);
  }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .page.home-page .search-filter-sticky {
    --home-scroll-expanded-shell-height: 182px;
    --home-scroll-actions-overlay-top: 60px;
    --home-scroll-filter-overlay-top: 116px;
    min-height: var(--home-scroll-expanded-shell-height);
    overflow: visible;
  }

  .page.home-page .search-filter-sticky .topbar {
    position: relative;
    grid-template-rows: auto;
  }

  .page.home-page .search-filter-sticky .top-actions,
  .page.home-page .search-filter-sticky .filter-bar {
    position: absolute;
    right: 8px;
    left: 8px;
    z-index: 3;
  }

  html[data-auth-state="user"] .page.home-page .search-filter-sticky .top-actions {
    top: var(--home-scroll-actions-overlay-top);
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(var(--control-44), 1fr);
    min-height: 0;
    padding: 2px 4px;
    overflow: visible;
  }

  html[data-auth-state="user"] .page.home-page .search-filter-sticky .top-actions .topbar-icon {
    justify-self: center;
  }

  html[data-auth-state="user"] .page.home-page .search-filter-sticky .top-actions .mobile-bottom-duplicate {
    --home-top-action-display: none;
    display: none;
  }

  .page.home-page .search-filter-sticky .filter-bar {
    top: var(--home-scroll-filter-overlay-top);
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .page.home-page .search-filter-sticky .filter-chip,
  .page.home-page .search-filter-sticky .filter-chip[data-filter="sort"] {
    width: auto;
    min-width: max-content;
    flex: 0 0 auto;
  }

  .page.home-page #clearFiltersBtn {
    grid-column: auto;
    width: auto;
    flex: 0 0 auto;
  }
}

.favorite-flight {
  position: fixed;
  z-index: var(--z-toast, 600);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  color: #f43f67;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 7px 12px rgba(244, 63, 103, 0.32));
}

@media (min-width: 1101px) {
  .page.home-page .home-shell {
    max-width: none;
    margin-inline: 0;
  }

  .page.home-page .main-wrap {
    max-width: none;
    margin-inline: 0;
  }
}

.favorite-flight svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: #ffffff;
  stroke-width: 1.4;
}

.favorite-flight.is-flying {
  animation: favorite-flight-to-nav 720ms cubic-bezier(0.2, 0.78, 0.22, 1) forwards;
}

body:has(.page.home-page) .bottom-nav-item.favorite-arrived {
  animation: favorite-nav-arrival 480ms cubic-bezier(0.18, 0.9, 0.28, 1);
}

body:has(.page.home-page) .bottom-nav-item.favorite-arrived svg {
  color: #f43f67;
  fill: rgba(244, 63, 103, 0.22);
}

@keyframes favorite-flight-to-nav {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.72) rotate(-12deg);
  }

  14% {
    opacity: 1;
  }

  54% {
    opacity: 1;
    transform: translate3d(var(--favorite-flight-mid-x), var(--favorite-flight-mid-y), 0) scale(1.18) rotate(8deg);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--favorite-flight-x), var(--favorite-flight-y), 0) scale(0.58) rotate(0);
  }
}

@keyframes favorite-nav-arrival {
  0%,
  100% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.13);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-glyph > span,
  .page.home-page .home-sidebar,
  .favorite-flight,
  body:has(.page.home-page) .bottom-nav-item.favorite-arrived {
    animation: none;
    transition: none;
  }
}
