/* ============================================================
   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);
}


/* ===== SUBPAGES ===== */
.page.auth-page .topbar .brand,
.page.ad-page .topbar .brand,
.page.post-page .topbar .brand,
.page.profile-page .topbar .brand,
.page.myads-page .topbar .brand,
.page.admin-page .topbar .brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: var(--color-on-primary);
  font-weight: 700;
  font-size: 14px;
}

.brand .title {
  font-weight: 700;
  font-size: 14px;
}

.brand .subtitle {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-shell {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding: clamp(var(--space-32), 6vh, var(--space-64)) clamp(var(--space-16), 4vw, var(--space-32));
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  align-self: stretch;
}

.page.auth-page .auth-card {
  max-width: 480px;
  width: 100%;
  padding: clamp(var(--space-20), 3vw, var(--space-32));
  gap: var(--space-16);
  border-color: rgba(var(--primary-rgb) / 0.2);
  background:
    radial-gradient(360px 180px at 100% 0%, rgba(var(--primary-rgb) / 0.1), transparent 70%), var(--surface);
  box-shadow: var(--shadow-md);
  animation: fadeUp var(--motion-320) var(--motion-ease) both;
}

.page.auth-page .auth-card > h2 {
  font-size: var(--type-24);
  line-height: 1.2;
}

.page.login-page.is-admin-login .auth-card {
  border-color: rgba(var(--primary-rgb) / 0.28);
  background:
    linear-gradient(150deg, rgba(var(--primary-rgb) / 0.12), rgba(var(--surface-rgb) / 0.96) 46%),
    var(--surface);
  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(var(--primary-rgb) / 0.08);
}

.auth-card form {
  display: grid;
  gap: var(--space-12);
}

.auth-card .btn {
  width: 100%;
  min-height: var(--control-44);
  align-self: stretch;
  font-size: var(--type-14);
}

.auth-admin-login {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(var(--primary-rgb) / 0.18);
  border-radius: 14px;
  background: rgba(var(--primary-rgb) / 0.06);
  padding: 0;
  overflow: hidden;
}

.auth-admin-login summary {
  display: block;
  padding: 11px 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
}

.auth-admin-login summary span,
.auth-admin-login summary small {
  padding-left: 0;
}

.auth-admin-login summary span {
  display: inline;
}

.auth-admin-login summary small {
  display: block;
  margin: 2px 0 0 18px;
  color: var(--muted);
  font-size: var(--type-12);
  font-weight: 600;
}

.auth-admin-login label {
  padding: 0 12px 12px;
}

.auth-admin-login[open],
.auth-admin-login.is-admin-context {
  border-color: rgba(var(--primary-rgb) / 0.34);
  background: linear-gradient(180deg, rgba(var(--primary-rgb) / 0.1), rgba(var(--primary-rgb) / 0.04));
}

.auth-admin-login.is-admin-context summary {
  background: rgba(var(--primary-rgb) / 0.1);
}

.auth-panel {
  max-width: 420px;
  width: 100%;
}

.auth-panel form {
  display: grid;
  gap: 8px;
}

.auth-panel .btn {
  align-self: start;
}

.auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: var(--type-12);
}

.auth-link {
  color: var(--primary);
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-status {
  min-height: 20px;
  margin-top: 0;
  font-size: var(--type-12);
  line-height: 1.5;
  font-weight: 600;
  color: var(--color-danger);
}

.auth-status:empty {
  min-height: 0;
}

@media (max-width: 640px) {
  .auth-shell {
    padding: var(--space-24) var(--space-16) var(--space-40);
  }

  .auth-card {
    padding: var(--space-20);
    border-radius: var(--radius-18);
  }
}

.profile-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 26vw, 320px);
  gap: 20px;
  padding: 28px 24px 40px;
  width: min(var(--page-max), 100%);
  margin: 0;
  align-self: flex-start;
}

.page.profile-page .profile-shell {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
}

.profile-main,
.profile-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page.profile-page .profile-main {
  max-width: 760px;
}

.profile-hero {
  background: var(--surface);
  border: 1px solid var(--border);
}

.page.profile-page .profile-hero {
  position: relative;
  overflow: hidden;
  border-color: rgba(var(--primary-rgb) / 0.24);
  background:
    radial-gradient(420px 200px at 0% 0%, rgba(var(--primary-rgb) / 0.16), transparent 58%),
    radial-gradient(380px 180px at 100% 100%, rgba(var(--primary-rgb) / 0.08), transparent 62%), var(--surface);
}

.page.profile-page .profile-hero::after {
  content: "";
  position: absolute;
  inset: auto -20px -26px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb) / 0.12);
  filter: blur(40px);
  pointer-events: none;
}

.profile-hero h1 {
  font-size: 22px;
}

.profile-hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.page.profile-page .auth-panel {
  max-width: 460px;
  border-color: rgba(var(--primary-rgb) / 0.22);
  background:
    linear-gradient(170deg, rgba(var(--primary-rgb) / 0.08), rgba(var(--primary-rgb) / 0.01) 42%), var(--surface);
}

.page.profile-page .auth-panel form {
  gap: 10px;
}

.page.profile-page .auth-panel .btn {
  width: 100%;
  justify-content: center;
}

.login-context {
  border: 1px solid rgba(var(--primary-rgb) / 0.34);
  background: rgba(var(--primary-rgb) / 0.12);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
}

.auth-hint {
  margin-top: -4px;
}

.guest-info {
  border-color: rgba(var(--primary-rgb) / 0.22);
  background:
    radial-gradient(220px 130px at 90% 12%, rgba(var(--primary-rgb) / 0.14), transparent 70%),
    radial-gradient(240px 160px at 0% 100%, rgba(var(--primary-rgb) / 0.08), transparent 75%), var(--surface);
}

.guest-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.guest-feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.guest-feature-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.16);
  flex: 0 0 auto;
}

.page.profile-page.is-guest #accountPanel,
.page.profile-page.is-guest #appearancePanel,
.page.profile-page.is-guest #priceAlertsPanel,
.page.profile-page.is-guest #userPanel,
.page.profile-page.is-guest #profileSummaryPanel {
  display: none;
}

.setting-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.setting-title {
  font-weight: 600;
  font-size: 13px;
}

.setting-stack {
  display: grid;
  gap: 6px;
}

.setting-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.setting-toggle input {
  accent-color: var(--primary);
  cursor: pointer;
}

#appearancePanel .bg-manager {
  gap: 12px;
}

#appearancePanel .bg-manager-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px 14px;
}

#appearancePanel .bg-manager-head > div:first-child {
  min-width: 0;
}

.bg-library-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  width: 100%;
}

.bg-library-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb) / 0.25);
  background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.22), rgba(var(--primary-rgb) / 0.08));
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.bg-limit-note {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245 158 11 / 0.45);
  background: linear-gradient(120deg, rgba(245 158 11 / 0.2), rgba(249 115 22 / 0.12));
  color: var(--ink);
  font-size: 12px;
  padding: 8px 10px;
}

.bg-preview {
  min-height: 96px;
  max-height: 260px;
  aspect-ratio: 16 / 5;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(var(--primary-rgb) / 0.1), transparent 55%), var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  padding: 10px;
  overflow: hidden;
}

.bg-preview img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.bg-preview.has-image {
  border-color: rgba(var(--primary-rgb) / 0.38);
}

.bg-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.bg-library-empty {
  grid-column: 1 / -1;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 12px;
}

.bg-library-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 7px;
  box-shadow: 0 1px 0 rgba(255 255 255 / 0.05) inset;
  transition:
    border-color var(--motion-180) var(--motion-ease), transform var(--motion-180) var(--motion-ease), box-shadow var(--motion-180) var(--motion-ease);
}

.bg-library-card:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--primary-rgb) / 0.35);
}

.bg-library-card.is-active {
  border-color: rgba(var(--primary-rgb) / 0.55);
  box-shadow:
    0 0 0 1px rgba(var(--primary-rgb) / 0.22),
    0 8px 20px rgba(0 0 0 / 0.12);
}

.bg-library-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: none;
  border-radius: 7px;
  padding: 0;
  margin: 0;
  background: rgba(15 23 42 / 0.12);
  overflow: hidden;
  cursor: pointer;
}

.bg-library-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-library-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.bg-library-meta span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bg-library-meta span:last-child {
  white-space: nowrap;
}

.bg-library-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: auto;
}

.bg-library-actions .btn {
  width: 100%;
  min-height: 31px;
  padding-inline: 8px;
  white-space: nowrap;
}

.bg-library-actions .btn.bg-delete-btn {
  border-color: rgba(239 68 68 / 0.35);
  color: #ef4444;
}

.bg-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

#appearancePanel .bg-actions .upload-label {
  min-width: 0;
}

#appearancePanel .bg-actions .upload-label input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 8px;
}

#appearancePanel .bg-actions .upload-label input[type="file"]::file-selector-button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: 6px 10px;
  margin-right: 8px;
  cursor: pointer;
}

#appearancePanel .bg-actions #bgRemoveBtn {
  min-height: 34px;
}

.bg-opacity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.bg-opacity label {
  min-width: 0;
  gap: 8px;
}

.bg-opacity input[type="range"] {
  width: 100%;
}

#bgStatus {
  min-height: 18px;
}

.range-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.profile-meta {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.profile-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.toggle-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-cache-box {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
}

.price-alerts-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.price-alerts-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.price-alerts-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.price-alert-list,
.price-alert-notification-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.price-alert-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.price-alert-card.is-unread {
  border-color: rgba(var(--primary-rgb) / 0.38);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb) / 0.14);
}

.price-alert-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.price-alert-title {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.price-alert-title:hover {
  text-decoration: underline;
}

.price-alert-chip {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.price-alert-chip.is-hit {
  background: var(--badge-active-bg);
  color: var(--primary);
  border-color: rgba(var(--primary-rgb) / 0.3);
}

.price-alert-chip.is-new {
  background: var(--badge-flagged-bg);
  color: var(--badge-flagged-fg);
  border-color: transparent;
}

.price-alert-chip.is-warning {
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
  border-color: rgba(180, 83, 9, 0.2);
}

.price-alert-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.price-alert-card-meta strong {
  color: var(--ink);
}

.price-alert-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.price-alerts-hero {
  display: grid;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.price-alerts-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.price-alerts-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price-alerts-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.price-alerts-stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.price-alerts-stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 700;
}

.price-alerts-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.price-alerts-layout--page {
  margin-top: 0;
}

.price-alerts-col--wide {
  grid-column: 1 / -1;
}

#pwa-offline-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-emergency, 900);
  background: #b91c1c;
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
  font-family: var(--font-body, system-ui, sans-serif);
}

.price-alert-card.is-selected {
  border-color: rgba(var(--primary-rgb) / 0.42);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb) / 0.15);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(239, 248, 246, 0.88));
}

:root[data-theme="dark"] .price-alert-card.is-selected {
  border-color: rgba(173, 243, 237, 0.34);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.14);
  background: linear-gradient(145deg, rgba(9, 17, 28, 0.98), rgba(14, 27, 35, 0.92));
}

.price-alerts-col {
  display: grid;
  gap: 8px;
  align-content: start;
}

.price-alerts-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.post-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 280px);
  grid-template-rows: auto 1fr;
  gap: 20px;
  padding: 28px 24px 40px;
  width: min(var(--page-max), 100%);
  margin: 0;
  align-self: flex-start;
  justify-self: start;
}

.post-shell .breadcrumbs {
  grid-column: 1 / -1;
  grid-row: 1;
}

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

.post-side {
  grid-column: 2;
  grid-row: 2;
}

.post-main,
.post-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-intro {
  background: var(--surface);
  border: 1px solid var(--border);
}

.post-intro h1 {
  font-size: 22px;
}

.post-locked {
  border-style: dashed;
  background: var(--surface-soft);
}


.post-form {
  background:
    linear-gradient(145deg, rgba(var(--surface-rgb) / 0.98) 0%, rgba(var(--surface-soft-rgb) / 0.82) 100%),
    var(--surface);
  border-color: var(--border-light);
}

.post-form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 10px;
}

.post-wizard {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

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

.wizard-progress-step {
  border: 1px solid var(--border-light);
  background: rgba(var(--surface-rgb) / 0.7);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: var(--ink-secondary);
  cursor: pointer;
  font-family: var(--font-body);
  transition:
    border-color var(--motion-180), background var(--motion-180), transform var(--motion-180), box-shadow var(--motion-180);
}

.wizard-progress-step:hover {
  border-color: rgba(var(--primary-rgb) / 0.34);
  background: rgba(var(--surface-rgb) / 0.95);
  transform: translateY(-1px);
}

.wizard-progress-step.is-active {
  border-color: rgba(var(--primary-rgb) / 0.46);
  background: linear-gradient(145deg, rgba(var(--surface-rgb) / 0.96) 0%, rgba(var(--surface-soft-rgb) / 0.92) 100%);
  box-shadow:
    0 10px 22px rgba(var(--primary-rgb) / 0.14),
    inset 0 1px 0 var(--inset-highlight);
  color: var(--ink);
}

.wizard-progress-step.is-complete {
  border-color: rgba(var(--green-rgb) / 0.4);
}

.wizard-progress-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb) / 0.28);
  background: rgba(var(--primary-rgb) / 0.08);
  color: var(--primary-deep);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.wizard-progress-step.is-active .wizard-progress-index {
  background: var(--primary);
  color: var(--color-on-primary);
  border-color: transparent;
}

.wizard-progress-step.is-complete .wizard-progress-index {
  border-color: rgba(var(--green-rgb) / 0.4);
  background: rgba(var(--green-rgb) / 0.16);
  color: var(--green);
}

.wizard-progress-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb) / 0.16);
  overflow: hidden;
}

.wizard-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width var(--motion-320) var(--motion-ease);
}

.post-form form {
  display: grid;
  gap: 14px;
}

.wizard-stage {
  display: none;
  gap: 12px;
}

.wizard-stage.is-active {
  display: grid;
  animation: wizard-stage-enter var(--motion-180) var(--motion-ease);
}

@keyframes wizard-stage-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-stage-intro {
  display: grid;
  gap: 4px;
}

.wizard-stage-intro h3 {
  font-size: 19px;
  letter-spacing: -0.015em;
}

.post-form form > label,
.post-form form > .form-row,
.post-form label.wizard-block,
.post-form .form-row.wizard-block {
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(var(--surface-rgb) / 0.72);
}

.post-form form > .form-row,
.post-form .form-row.wizard-block {
  gap: 12px;
}

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

.wizard-review {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(var(--surface-rgb) / 0.95) 0%, rgba(var(--surface-soft-rgb) / 0.84) 100%);
}

.wizard-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.wizard-review-item {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: rgba(var(--surface-rgb) / 0.8);
  display: grid;
  gap: 3px;
}

.wizard-review-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.wizard-review-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.wizard-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(var(--primary-rgb) / 0.18);
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(var(--surface-rgb) / 0.98) 0%, rgba(var(--surface-soft-rgb) / 0.9) 100%);
}

.wizard-nav-meta {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.wizard-nav .btn {
  min-width: 122px;
}

.post-schedule {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: rgba(var(--surface-rgb) / 0.72);
}

.schedule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.schedule-toggle input {
  margin: 0;
}

.schedule-fields {
  display: grid;
  gap: 8px;
}

.schedule-fields > label {
  padding: 0;
  border: 0;
  background: transparent;
}

.post-form input,
.post-form textarea,
.post-form select {
  background: rgba(var(--surface-rgb) / 0.88);
}

.post-form .gallery-section {
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(var(--surface-soft-rgb) / 0.34);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.form-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Post editor footer & form actions — base defaults (overridden by post-page.css) */
.post-editor-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-editor-footer .form-status-row {
  justify-content: flex-end;
}

.ad-list {
  display: grid;
  gap: 8px;
}

.ad-item {
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(var(--surface-rgb) / 0.96) 0%, rgba(var(--surface-soft-rgb) / 0.58) 100%);
}

.ad-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--glow);
}

.ad-item-thumb {
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
}

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

.ad-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ad-item-title {
  font-weight: 600;
  font-size: 13px;
}

.ad-item-meta {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.ad-item-price {
  font-weight: 700;
  color: var(--primary);
}

.ad-item-actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page.myads-page .myads-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-20); padding: var(--space-24) var(--space-24) var(--space-48); width: min(100%, var(--width-content)); margin: 0 auto; align-self: flex-start; }
.myads-main,
.myads-side { display: flex; flex-direction: column; gap: var(--space-16); }

.myads-side { align-self: start; position: static; top: 80px; }

.myads-hero {
  padding: var(--space-24);
  border-radius: var(--radius-18);
  background:
    radial-gradient(circle at 92% 8%, rgba(var(--primary-rgb) / 0.12), transparent 34%),
    var(--surface);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.myads-hero::after {
  display: none;
}

.myads-hero-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; }

.myads-hero h1 { font-family: var(--font-display); font-size: var(--type-32); line-height: 1.12; }

.myads-hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-12); margin-top: var(--space-20); align-items: start; }

.myads-stat {
  min-height: 88px;
  padding: var(--space-16);
  border-radius: var(--radius-14);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  display: grid;
  gap: 3px;
}

.myads-stat-value {
  font-weight: 700;
  font-size: var(--type-24);
  color: var(--primary);
}

.myads-stat-label { font-size: var(--type-12); line-height: 1.4; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.myads-collection {
  gap: 14px;
}

.myads-toolbar { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-16); flex-wrap: wrap; }

.myads-filters {
  display: flex;
  gap: var(--space-12);
  flex-wrap: wrap;
  align-items: flex-end;
}

.myads-filter {
  display: grid;
  gap: var(--space-4);
  min-width: 168px;
  font-size: var(--type-14);
  font-weight: 600;
}

.myads-drafts {
  gap: 12px;
}

.myads-drafts-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.myads-draft-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.myads-draft-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.myads-draft-meta {
  font-size: var(--type-12); line-height: 1.4;
  color: var(--muted);
}

.myads-draft-price {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}

.myads-draft-saved {
  font-size: var(--type-12); line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.myads-draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.myads-draft-empty {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.myads-grid {
  display: grid;
  gap: 12px;
}

.myads-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow);
  animation: fadeUp var(--motion-320) var(--motion-ease) both;
}

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

.myads-card-header {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.myads-thumb {
  position: relative;
  height: 92px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
}

.myads-thumb.is-sold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 1;
  pointer-events: none;
}

.myads-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.myads-thumb.is-sold img {
  filter: blur(2.6px) saturate(0.76) brightness(0.78);
  transform: scale(1.06);
}

.myads-info {
  display: grid;
  gap: 8px;
}

.myads-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.myads-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.myads-meta {
  font-size: var(--type-12); line-height: 1.4;
  color: var(--muted);
}

.myads-price {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
}

.myads-restore {
  font-size: var(--type-12); line-height: 1.4;
  color: var(--muted);
  text-transform: uppercase;
}

.myads-schedule {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(var(--primary-rgb) / 0.35);
  background: rgba(var(--primary-rgb) / 0.08);
}

.myads-schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: var(--type-12); line-height: 1.4;
  color: var(--muted);
}

.myads-schedule-row strong {
  font-family: var(--font-mono, "IBM Plex Mono", monospace);
  color: var(--primary);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.myads-schedule-at {
  font-size: var(--type-12); line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.myads-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.myads-analytics {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
}

.myads-analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.myads-analytics-title {
  font-weight: 600;
  font-size: 13px;
}

.myads-analytics-meta {
  font-size: var(--type-12); line-height: 1.4;
  color: var(--muted);
}

.analytics-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  height: 100px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.analytics-bar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 3px;
  align-items: end;
  justify-items: center;
}

.analytics-bar-value {
  font-size: var(--type-12); line-height: 1.4;
  color: var(--muted);
}

.analytics-bar-track {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  border-radius: 6px;
  background: var(--surface-soft);
  padding: 2px;
}

.analytics-bar-fill {
  width: 100%;
  border-radius: 4px;
  background: var(--primary);
  height: 10%;
  transition: height var(--motion-320);
  opacity: 0.7;
}

.analytics-bar-fill.empty {
  background: var(--surface-soft);
  opacity: 0.3;
}

.analytics-bar-fill.highlight {
  opacity: 1;
}

.analytics-bar-label {
  font-size: var(--type-12); line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.page.myads-page .myads-empty {
  padding: 24px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
  display: grid;
  gap: 8px;
  text-align: center;
}

.myads-insights {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.myads-insights strong {
  color: var(--ink);
  font-weight: 600;
}

.page.myads-page :is(.myads-main, .myads-side) h2 { font: 700 var(--type-18)/1.3 var(--font-body); letter-spacing: -0.01em; }
.page.myads-page :is(.myads-hero, .myads-side, .myads-empty) .muted,
.page.myads-page .myads-draft-empty { font-size: var(--type-14); line-height: 1.55; }
.page.myads-page .panel-title { display: grid; gap: 4px; }
.page.myads-page .myads-filter select { min-height: var(--control-40); }
.page.myads-page .myads-empty h3 { font-size: var(--type-16); } .page.myads-page :is(.status-badge, .myads-hero .pill, .myads-side .user-role) { font-size: var(--type-12); }
.page.myads-page :is(.myads-empty, .myads-grid)[aria-busy="true"] { cursor: progress; }
@media (min-width: 1281px) {
  .page.myads-page .myads-shell { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); align-items: start; }
  .page.myads-page .myads-side { position: sticky; top: 80px; }
}
@media (max-width: 640px) {
  .page.myads-page .myads-shell { gap: var(--space-16); padding: var(--space-16) var(--space-12) var(--space-40); }
  .page.myads-page .myads-hero { padding: var(--space-20); }
  .page.myads-page .myads-hero h1 { font-size: var(--type-24); }
  .page.myads-page :is(.myads-hero-header, .myads-toolbar) { display: grid; align-items: stretch; }
  .page.myads-page .myads-filters { display: grid; }
  .page.myads-page .myads-hero-header .pill { justify-self: start; }
  .page.myads-page :is(.myads-filter, .myads-filter select) { min-width: 0; }
  .page.myads-page .myads-filter select { width: 100%; }
  .page.myads-page :is(.myads-filter select, .myads-actions .btn, .myads-draft-actions .btn, .status-badge, .ad-empty-action, .load-more-btn), body:has(.page.myads-page) .status-menu-item { min-height: var(--control-44); }
  .page.myads-page :is(.myads-actions, .myads-draft-actions) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page.myads-page :is(.myads-actions, .myads-draft-actions) .btn { width: 100%; justify-content: center; }
}
@media (max-width: 380px) {
  .page.myads-page :is(.myads-hero-stats, .myads-card-header) { grid-template-columns: minmax(0, 1fr); }
  .page.myads-page .myads-title-row { align-items: stretch; flex-direction: column; }
  .page.myads-page .status-badge { width: 100%; justify-content: center; }
}


.page.ad-page {
  --page-max: 1180px;
  --ad-ambient-strength: 0.58;
  --ad-ambient-top: rgba(var(--primary-rgb) / 0.2);
  --ad-ambient-right: rgba(var(--primary-rgb) / 0.14);
  --ad-ambient-bottom: rgba(194, 65, 12, 0.13);
  --ad-ambient-left: rgba(var(--primary-rgb) / 0.14);
  --ad-ambient-center: rgba(var(--surface-rgb) / 0.22);
}

.page.ad-page::before {
  content: "";
  display: block;
  position: absolute;
  inset: 56px 6px 8px;
  pointer-events: none;
  z-index: 0;
  border-radius: 28px;
  background:
    radial-gradient(64% 44% at 50% 10%, var(--ad-ambient-top), transparent 72%), radial-gradient(42% 72% at 4% 50%, var(--ad-ambient-left), transparent 74%), radial-gradient(42% 72% at 96% 50%, var(--ad-ambient-right), transparent 74%), radial-gradient(62% 42% at 50% 94%, var(--ad-ambient-bottom), transparent 74%), radial-gradient(40% 42% at 50% 50%, var(--ad-ambient-center), transparent 76%);
  filter: blur(18px) saturate(1.18);
  opacity: 0;
  transform: scale(0.985);
  transition:
    opacity var(--motion-320) var(--motion-ease),
    transform var(--motion-320) var(--motion-ease),
    filter var(--motion-320) var(--motion-ease);
}

.page.ad-page.ad-ambient-active::before {
  opacity: var(--ad-ambient-strength);
  transform: scale(1);
}

.page.ad-page.ad-ambient-updating::before {
  opacity: calc(var(--ad-ambient-strength) * 0.38);
  transform: scale(0.992);
  filter: blur(24px) saturate(1.08);
}

.page.ad-page > * {
  position: relative;
  z-index: 1;
}

.page.ad-page .breadcrumbs {
  justify-self: start;
  max-width: min(100%, 720px);
  min-width: 0;
  margin-bottom: 0;
  padding: 4px 9px;
  border: 1px solid rgba(var(--primary-rgb) / 0.22);
  border-radius: 999px;
  background: rgba(var(--surface-rgb) / 0.9);
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.15;
  box-shadow: var(--shadow);
}

.page.ad-page .breadcrumbs a {
  color: var(--primary-strong);
  font-weight: 700;
}

.page.ad-page .breadcrumbs .sep {
  color: var(--muted);
  opacity: 0.9;
}

.page.ad-page #breadcrumbTitle {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 272px);
  column-gap: 18px;
  row-gap: 10px;
  padding: 20px 24px 40px;
  width: min(var(--page-max), 100%);
  margin: 0;
  align-self: flex-start;
  position: relative;
  isolation: isolate;
}

.ad-main,
.ad-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.ad-side {
  align-self: start;
  position: sticky;
  top: 80px;
}

.ad-showcase.ad-showcase--redesign {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ad-showcase--redesign .ad-media {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ad-showcase--redesign .ad-media-frame {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: none;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  min-height: 360px;
  max-height: 580px;
  aspect-ratio: 16 / 10;
  --ad-ambient-edge: rgba(var(--primary-rgb) / 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.ad-showcase--redesign .ad-media-frame::before {
  content: "";
  position: absolute;
  inset: -18% -14% 56%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(120% 120% at 50% 42%, var(--ad-ambient-edge), transparent 76%);
  filter: blur(18px);
  opacity: 0;
  transition:
    opacity var(--motion-320) var(--motion-ease),
    filter var(--motion-320) var(--motion-ease);
}

.ad-showcase--redesign .ad-media-frame.has-ambient::before {
  opacity: 0.54;
}

.ad-showcase--redesign .ad-media-frame.is-ambient-updating::before {
  opacity: 0.22;
  filter: blur(24px);
}

.ad-showcase--redesign .ad-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
  opacity: 1;
  transform: scale(1);
  filter: none;
  transition:
    opacity var(--motion-320) var(--motion-ease),
    transform var(--motion-320) var(--motion-ease),
    filter var(--motion-320) var(--motion-ease);
  will-change: opacity, transform, filter;
}

.ad-showcase--redesign .ad-media-frame.is-sold::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 2;
  pointer-events: none;
}

.ad-showcase--redesign .ad-media-frame.is-sold img {
  filter: blur(4px) saturate(0.74) brightness(0.74);
  transform: scale(1.03);
}

.ad-sold-hero {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%) rotate(-7deg);
  padding: 14px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(12, 18, 28, 0.8);
  color: #fff;
  font-size: clamp(20px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.26);
  pointer-events: none;
  isolation: isolate;
}

.ad-sold-hero::before,
.ad-sold-hero::after {
  content: "\20AC";
  position: absolute;
  top: -32px;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  color: rgba(247, 215, 116, 0.96);
  filter: drop-shadow(0 8px 18px rgba(15, 23, 42, 0.32));
  pointer-events: none;
  white-space: pre;
  z-index: -1;
  animation: sold-money-rain 1.8s linear infinite;
}

.ad-sold-hero::before {
  left: -18px;
  text-shadow:
    -12px 16px 0 rgba(247, 215, 116, 0.9),
    10px 40px 0 rgba(247, 215, 116, 0.76),
    -8px 70px 0 rgba(247, 215, 116, 0.62),
    14px 102px 0 rgba(247, 215, 116, 0.48);
}

.ad-sold-hero::after {
  right: -14px;
  animation-delay: 0.9s;
  text-shadow:
    12px 14px 0 rgba(247, 215, 116, 0.9),
    -8px 36px 0 rgba(247, 215, 116, 0.74),
    10px 68px 0 rgba(247, 215, 116, 0.6),
    -12px 98px 0 rgba(247, 215, 116, 0.46);
}

.ad-showcase--redesign .ad-media-frame.clickable {
  cursor: zoom-in;
}

.ad-showcase--redesign .ad-media-frame.clickable:hover img {
  transform: scale(1.02);
  transition: transform var(--motion-320) var(--motion-ease);
}

.ad-body {
  display: grid;
  gap: 8px;
}

.ad-description {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--ink);
}

.ad-owner {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ad-meta-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.ad-meta-pill:first-child {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: transparent;
}

.ad-showcase--redesign .ad-media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
  font-weight: 600;
  z-index: 2;
}

.ad-badge--overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  background: #3b82f6;
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.ad-badge--overlay.active {
  background: #3b82f6;
  color: #fff;
}

.ad-badge--overlay.sold {
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #fff;
}

.ad-badge--overlay.flagged,
.ad-badge--overlay.hidden {
  background: var(--color-warning);
  color: var(--color-on-warning);
}

.ad-badge--overlay.scheduled {
  background: #8b5cf6;
  color: #fff;
}

.ad-badge--overlay.removed {
  background: var(--color-danger);
  color: var(--color-on-danger);
}

.ad-photo-counter {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.ad-photo-counter svg {
  opacity: 0.85;
}

.ad-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background-color var(--motion-180) var(--motion-ease),
    color var(--motion-180) var(--motion-ease),
    box-shadow var(--motion-180) var(--motion-ease),
    transform var(--motion-180) var(--motion-ease);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  appearance: none;
  padding: 0;
  font-family: inherit;
}

.ad-nav-arrow:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-50%) scale(1.08);
}

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

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

.ad-showcase--redesign .ad-media-strip {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin-top: 0;
}

.ad-showcase--redesign .ad-media-strip .ad-thumb {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--surface-soft);
  padding: 0;
  width: 64px;
  height: 64px;
  min-width: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color var(--motion-180) var(--motion-ease),
    box-shadow var(--motion-180) var(--motion-ease),
    opacity var(--motion-180) var(--motion-ease),
    transform var(--motion-180) var(--motion-ease);
  font-family: inherit;
  color: inherit;
  position: relative;
  scroll-snap-align: start;
}

.ad-showcase--redesign .ad-media-strip .ad-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-showcase--redesign .ad-media-strip .ad-thumb:hover {
  border-color: var(--primary);
  transform: scale(1.06);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ad-showcase--redesign .ad-media-strip .ad-thumb.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--glow);
}

.ad-showcase--redesign .ad-media-strip .ad-thumb-flagged {
  border-color: rgba(181, 91, 32, 0.45);
  background: rgba(255, 247, 237, 0.94);
  color: #7a3412;
  padding: 6px;
  text-align: left;
  font-size: 12px;
  line-height: 1.15;
}

.ad-showcase--redesign .ad-media-strip .ad-thumb-flagged strong,
.ad-showcase--redesign .ad-media-strip .ad-thumb-flagged span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-showcase--redesign .ad-media-strip .ad-thumb-flagged strong {
  -webkit-line-clamp: 1;
  font-size: 12px;
}

.ad-showcase--redesign .ad-media-strip .ad-thumb-flagged span {
  -webkit-line-clamp: 3;
}

.ad-showcase--redesign .ad-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 24px 20px;
}

.ad-summary-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  min-width: 0;
}

.ad-showcase--redesign .ad-summary h1 {
  font-family: var(--font-body);
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
  flex: 1 1 280px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.ad-price-highlight {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-start;
  padding: 10px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(var(--primary-rgb) / 0.28);
  background: linear-gradient(180deg, rgba(var(--primary-rgb) / 0.14), rgba(var(--primary-rgb) / 0.06)), var(--surface-soft);
  box-shadow: 0 8px 20px rgba(var(--primary-rgb) / 0.18);
}

.ad-price-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.ad-showcase--redesign .ad-summary .ad-price {
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1;
  font-weight: 700;
  color: var(--primary-strong);
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.ad-showcase--redesign .ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.ad-showcase--redesign .ad-owner {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

.ad-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 13px;
}

.ad-info-grid > div {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  min-width: 0;
}

.ad-info-grid > div:last-child {
  border-bottom: none;
}

.ad-info-grid > div .muted {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.ad-info-grid > div > div:last-child:not(.muted) {
  font-weight: 600;
  text-align: right;
  min-width: 0;
  max-width: 100%;
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-price-alert {
  display: grid;
  gap: 8px;
}

.price-alert-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-alert-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.price-alert-actions-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#priceAlertStatus {
  min-height: 18px;
  font-size: 12px;
}

#priceAlertStatus.is-error {
  color: var(--red);
}

#priceAlertStatus.is-success {
  color: var(--green);
}

.page.ad-page :is(.ad-location-map, .ad-similar-header, .ad-error, .ad-body, .ad-side) h2 {
  font-family: var(--font-body);
  letter-spacing: -0.01em;
}
.page.ad-page :is(.ad-location-map, .ad-similar-header, .ad-error) h2 {
  font-size: 1.17em;
}

.ad-location-map h2 {
  margin: 0;
}

.ad-map-container {
  height: 280px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.ad-similar {
  position: relative;
  overflow: hidden;
  padding: 22px;
  gap: 16px;
  isolation: isolate;
}

.ad-similar::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb) / 0.06) 0%, rgba(var(--primary-rgb) / 0) 70%);
  pointer-events: none;
  z-index: -1;
}

.ad-similar::after {
  content: "";
  position: absolute;
  bottom: -80px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb) / 0.04) 0%, rgba(var(--primary-rgb) / 0) 70%);
  pointer-events: none;
  z-index: -1;
}

.ad-similar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 2px;
}

.ad-similar-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-similar-header h2::before {
  content: "";
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.ad-similar-header p {
  margin: 4px 0 0;
  font-size: 12px;
  opacity: 0.7;
}

.ad-similar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb) / 0.28);
  background: rgba(var(--primary-rgb) / 0.06);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color var(--motion-320) var(--motion-ease),
    background var(--motion-320) var(--motion-ease),
    transform var(--motion-320) var(--motion-ease),
    box-shadow var(--motion-320) var(--motion-ease);
}

.ad-similar-link::after {
  content: "\2192";
  line-height: 1;
  font-size: 12px;
  transition: transform var(--motion-320) var(--motion-ease);
}

.ad-similar-link:hover {
  border-color: rgba(var(--primary-rgb) / 0.5);
  background: rgba(var(--primary-rgb) / 0.12);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb) / 0.12);
}

.ad-similar-link:hover::after {
  transform: translateX(2px);
}

.ad-similar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ad-similar-card {
  display: grid;
  grid-template-rows: 130px auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--motion-320) var(--motion-ease),
    border-color var(--motion-320) var(--motion-ease),
    box-shadow var(--motion-320) var(--motion-ease);
  animation: fadeUp var(--motion-320) var(--motion-ease) both;
}

.ad-similar-card:hover {
  transform: translateY(-4px);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.ad-similar-thumb {
  position: relative;
  background: linear-gradient(145deg, var(--surface-soft), var(--surface-muted));
  overflow: hidden;
}

.ad-similar-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.15) 100%);
  pointer-events: none;
  z-index: 1;
  transition: opacity var(--motion-320) var(--motion-ease);
}

.ad-similar-card:hover .ad-similar-thumb::after {
  opacity: 0.6;
}

.ad-similar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--motion-320) var(--motion-ease);
}

.ad-similar-thumb.is-sold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  z-index: 2;
  pointer-events: none;
}

.ad-similar-thumb.is-sold img {
  filter: blur(2.8px) saturate(0.78) brightness(0.8);
  transform: scale(1.05);
}

.ad-similar-card:hover .ad-similar-thumb img {
  transform: scale(1.07);
}

.ad-similar-card:hover .ad-similar-thumb.is-sold img {
  transform: scale(1.08);
}

.ad-similar-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.6;
}

.ad-similar-body {
  display: grid;
  gap: 6px;
  padding: 12px 13px 14px;
}

.ad-similar-price {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.ad-similar-title {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--motion-180) var(--motion-ease);
}

.ad-similar-card:hover .ad-similar-title {
  color: var(--primary-deep);
}

.ad-similar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.ad-similar-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb) / 0.08);
  border: 1px solid rgba(var(--primary-rgb) / 0.2);
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition:
    background var(--motion-180) var(--motion-ease),
    border-color var(--motion-180) var(--motion-ease);
}

.ad-similar-card:hover .ad-similar-chip {
  background: rgba(var(--primary-rgb) / 0.12);
  border-color: rgba(var(--primary-rgb) / 0.32);
}

.ad-similar-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ad-similar-location::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb) / 0.5);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb) / 0.12);
}


.page.ad-page .ad-shell {
  grid-template-columns: minmax(0, 1fr) clamp(220px, 22vw, 272px);
  column-gap: var(--space-16);
  row-gap: var(--space-12);
}

.page.ad-page .ad-main,
.page.ad-page .ad-side {
  gap: var(--space-12);
}

.page.ad-page .breadcrumbs {
  font-size: var(--type-12);
}

.page.ad-page .ad-showcase.ad-showcase--redesign {
  border-radius: var(--radius-14);
  box-shadow: var(--shadow-md);
}

.page.ad-page .ad-showcase--redesign .ad-media-frame {
  min-height: 0;
  max-height: none;
  aspect-ratio: 16 / 10;
}

.page.ad-page .ad-summary-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-16);
}

.page.ad-page .ad-showcase--redesign .ad-summary h1 {
  flex: none;
  font-family: var(--font-display);
  font-size: clamp(var(--type-24), 2.4vw, var(--type-32));
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.page.ad-page .ad-price-label,
.page.ad-page .ad-meta-pill,
.page.ad-page .ad-badge--overlay,
.page.ad-page #priceAlertStatus {
  font-size: var(--type-12);
}

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

.page.ad-page .ad-body {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-20);
}

.page.ad-page .ad-body h2 {
  font-size: var(--type-18);
}

.page.ad-page .ad-description {
  font-size: var(--type-14);
}

.page.ad-page .ad-side > .panel {
  padding: var(--space-16);
  gap: var(--space-12);
  border-radius: var(--radius-14);
  box-shadow: var(--shadow);
}

.page.ad-page .ad-side h2 {
  font-size: var(--type-16);
  line-height: 1.3;
}

.page.ad-page .ad-side .muted {
  font-size: var(--type-12);
  line-height: 1.5;
}

.page.ad-page .ad-side .btn {
  width: 100%;
  min-height: var(--control-40);
}


/* Dark mode: lift cards off the panel for contrast */
:root[data-theme="dark"] .ad-similar-card {
  background: var(--surface-soft);
  border-color: var(--border);
}

:root[data-theme="dark"] .ad-similar-card:hover {
  border-color: rgba(var(--primary-rgb) / 0.25);
}

:root[data-theme="dark"] .ad-similar-link {
  color: var(--primary);
}

:root[data-theme="dark"] .ad-similar-chip {
  color: var(--primary);
}

:root[data-theme="dark"] .ad-similar-card:hover .ad-similar-title {
  color: var(--primary);
}

.ad-edit-form {
  display: grid;
  gap: 10px;
}

.ad-edit {
  border-style: dashed;
  background: var(--surface-soft);
}

.ad-error {
  align-self: start;
}

.ad-badge {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
}

button.ad-badge {
  appearance: none;
  cursor: pointer;
}

.ad-badge.active {
  background: var(--primary);
  color: var(--color-on-primary);
  border-color: transparent;
}

.ad-badge.sold {
  background: linear-gradient(135deg, #0f172a, #334155);
  color: #fff;
  border-color: transparent;
}

.ad-badge.flagged,
.ad-badge.hidden {
  background: var(--badge-flagged-bg);
  color: var(--badge-flagged-fg);
}

.ad-badge.scheduled {
  background: var(--badge-scheduled-bg);
  color: var(--badge-scheduled-fg);
}

.ad-badge.removed {
  background: var(--badge-removed-bg);
  color: var(--badge-removed-fg);
  border-style: dashed;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
}

.status-badge::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
}

.status-badge:hover {
  transform: translateY(-1px);
}

.status-menu {
  position: fixed;
  z-index: var(--z-dropdown, 200);
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: 4px;
}

.status-menu-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 4px 5px;
}

.status-menu-info {
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px 2px;
}

.status-menu-empty {
  font-size: 12px;
  color: var(--muted);
  padding: 5px 4px;
}

.status-menu-item {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
}

.status-menu-item:hover {
  background: var(--surface-soft);
}

.status-menu-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.status-menu-dot.active {
  background: var(--green);
  border-color: var(--green);
}

.status-menu-dot.sold {
  background: #0f172a;
  border-color: #0f172a;
}

.status-menu-dot.hidden,
.status-menu-dot.flagged {
  background: var(--color-warning);
  border-color: var(--color-warning);
}

.status-menu-dot.scheduled {
  background: var(--badge-scheduled-fg);
  border-color: var(--badge-scheduled-fg);
}

.status-menu-dot.removed {
  background: #94a3b8;
  border-color: #94a3b8;
}

.status-menu-text {
  font-weight: 600;
  font-size: 13px;
}

.status-menu-current {
  font-size: 12px;
  color: var(--muted);
}

.scroll {
  max-height: 140px;
  overflow: auto;
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}

.scroll.tall {
  max-height: 240px;
}

.users-hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.users-hub-subtitle {
  margin: 4px 0 0;
  max-width: 72ch;
  line-height: 1.4;
}

.users-search-form {
  display: grid;
  grid-template-columns: minmax(300px, 1.7fr) repeat(3, minmax(128px, 1fr)) minmax(190px, auto);
  gap: 8px 10px;
  align-items: center;
}

.users-search-form > select {
  min-height: 40px;
}

.users-search-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.users-search-actions .btn {
  width: 100%;
  min-height: 38px;
  justify-content: center;
}

.users-search-main {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.users-search-main input {
  width: 100%;
  height: 100%;
  min-height: 42px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 12px 0 38px;
  font-size: 13px;
  line-height: 1.2;
}

.users-search-main input:focus,
.users-search-main input:focus-visible {
  box-shadow: none;
}

.users-search-main:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb) / 0.12);
}

.users-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  pointer-events: none;
}

.users-search-icon svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.users-summary {
  font-size: 12px;
  line-height: 1.4;
  padding-inline: 2px;
}

.users-table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
  background: var(--surface-alpha-70);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.users-table {
  width: 100%;
  min-width: 960px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
  width: 21%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
  width: 10%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
  width: 15%;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
  width: 11%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
  width: 12%;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
  width: 31%;
}

.users-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 10px 12px;
  background: rgba(var(--surface-soft-rgb), 0.94);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.users-table td {
  font-size: 12px;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.users-table tbody tr:last-child td {
  border-bottom: 0;
}

.users-table tbody tr:hover td {
  background: var(--surface-soft);
}

.users-table tbody tr:nth-child(even) td {
  background: rgba(var(--surface-soft-rgb), 0.42);
}

.users-ident {
  display: grid;
  gap: 2px;
}

.users-ident strong {
  line-height: 1.2;
  word-break: break-word;
}

.users-status-stack {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.users-row-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-items: stretch;
}

.users-row-actions .btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 12px;
  width: 100%;
  justify-content: center;
  text-align: center;
}

.user-self-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
}

.user-ip-code {
  font-size: 12px;
  white-space: nowrap;
}

.user-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.user-activity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-activity-pill.online {
  background: rgba(16, 185, 129, 0.14);
  color: #0f766e;
  border-color: rgba(16, 185, 129, 0.38);
}

.user-activity-pill.recent {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.34);
}

.user-activity-pill.offline {
  background: rgba(148, 163, 184, 0.16);
  color: #64748b;
  border-color: rgba(148, 163, 184, 0.32);
}

.user-status-pill.active {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.25);
}

.user-status-pill.quarantined {
  background: rgba(245, 158, 11, 0.14);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.34);
}

.user-status-pill.shadowbanned {
  background: rgba(59, 130, 246, 0.14);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.3);
}

.user-status-pill.blocked {
  background: rgba(239, 68, 68, 0.13);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.3);
}

.user-status-pill.unknown {
  background: var(--surface-muted);
  color: var(--muted);
  border-color: var(--border);
}

:root[data-theme="dark"] .user-status-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
}

:root[data-theme="dark"] .user-status-pill.quarantined {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.46);
}

:root[data-theme="dark"] .user-status-pill.shadowbanned {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.46);
}

:root[data-theme="dark"] .user-status-pill.blocked {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.46);
}

:root[data-theme="dark"] .user-status-pill.unknown {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.36);
}

:root[data-theme="dark"] .user-activity-pill.online {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
}

:root[data-theme="dark"] .user-activity-pill.recent {
  background: rgba(96, 165, 250, 0.2);
  color: #bfdbfe;
  border-color: rgba(147, 197, 253, 0.44);
}

:root[data-theme="dark"] .user-activity-pill.offline {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.36);
}

.users-empty {
  padding: 2px 2px 6px;
}

.users-pagination {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.users-page-info {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}


#userDetailPanel {
  gap: 10px;
}

#userDetailMeta {
  line-height: 1.45;
}

.user-intel {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-soft);
  display: grid;
  gap: 8px;
}

.user-intel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-intel-head h4 {
  margin: 0;
}

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

.user-intel-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 8px;
  display: grid;
  gap: 6px;
}

.user-intel-card h5 {
  margin: 0;
  font-size: 12px;
}

.user-intel-list {
  max-height: 220px;
}

.user-intel-item {
  display: grid;
  gap: 2px;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.user-intel-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

#userDetailActions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#userDetailActions .btn {
  width: 100%;
  justify-content: center;
}

#userDetailRoleRow {
  display: grid;
  grid-template-columns: minmax(150px, 220px) auto;
  gap: 8px;
  align-items: center;
}

#userDetailRoleRow .btn {
  justify-content: center;
}

#userActionForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#userActionForm .toggle-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#userActionForm .toggle-row .btn {
  width: 100%;
  justify-content: center;
}

.user-block-controls {
  display: grid;
  grid-template-columns: minmax(170px, 220px) repeat(3, auto);
  gap: 8px;
  align-items: end;
}

.user-block-controls label {
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.user-block-controls input {
  width: 100%;
}

@media (max-width: 1280px) {
  .users-search-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .users-search-main {
    grid-column: 1 / -1;
  }

  .users-search-actions {
    grid-column: 3 / -1;
  }
}

@media (max-width: 1100px) {
  .page.admin-page .admin-shell {
    padding: 18px 14px 30px;
  }

  .users-search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .users-search-main {
    grid-column: 1 / -1;
  }

  .users-search-actions {
    grid-column: 1 / -1;
  }

  .user-block-controls {
    grid-template-columns: 1fr 1fr;
  }

  .user-block-controls label {
    grid-column: 1 / -1;
  }

  #userDetailActions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #userActionForm .toggle-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-intel-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .users-table {
    min-width: 0;
  }

  .users-table thead {
    display: none;
  }

  .users-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .users-table tbody tr {
    display: grid;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 10px;
  }

  .users-table tbody td {
    border: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(96px, 112px) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    background: transparent;
  }

  .users-table tbody td::before {
    content: attr(data-label);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
    line-height: 1.3;
    padding-top: 2px;
  }

  .users-table tbody td[data-label="Akcije"] {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .users-row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .user-self-pill {
    width: 100%;
  }

  .users-row-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .user-ip-code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .users-pagination {
    border-top: 1px dashed var(--border);
    padding-top: 8px;
  }
}

@media (max-width: 768px) {
  .page.admin-page .admin-shell {
    padding: 14px 10px 24px;
  }

  .users-hub-head {
    align-items: flex-start;
  }

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

  .users-search-actions {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .users-pagination {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .users-page-info {
    text-align: center;
  }

  .user-block-controls {
    grid-template-columns: 1fr;
  }

  .user-block-controls .btn {
    width: 100%;
  }

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

  #userDetailActions,
  #userDetailRoleRow,
  #userActionForm,
  #userActionForm .toggle-row {
    grid-template-columns: 1fr;
  }

  .user-intel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.flag-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(var(--primary-rgb) / 0.1);
  background: rgba(var(--surface-rgb) / 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.flag-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.flag-filters {
  display: grid;
  gap: 5px;
}

.flag-filters label {
  font-size: 12px;
  color: var(--muted);
}

.flag-filters select {
  width: 100%;
}

.flag-bulk {
  display: grid;
  gap: 5px;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--surface-soft);
}

.flag-bulk-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.flag-select {
  display: flex;
  align-items: center;
  gap: 5px;
}

.backup-download-card {
  max-width: 580px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  background:
    radial-gradient(560px 220px at -8% -20%, rgba(var(--primary-rgb), 0.18), transparent 68%),
    radial-gradient(460px 240px at 110% 120%, rgba(56, 189, 248, 0.14), transparent 68%),
    linear-gradient(180deg, rgba(var(--surface-soft-rgb), 0.94), var(--surface));
}

.factory-reset-card {
  border-color: rgba(239, 68, 68, 0.26);
  background:
    radial-gradient(560px 220px at -8% -20%, rgba(239, 68, 68, 0.18), transparent 68%),
    radial-gradient(420px 220px at 110% 120%, rgba(245, 158, 11, 0.14), transparent 68%),
    linear-gradient(180deg, rgba(var(--surface-soft-rgb), 0.96), var(--surface));
}

.restore-progress-card {
  border-color: rgba(var(--primary-rgb), 0.24);
  background:
    radial-gradient(560px 220px at -8% -20%, rgba(var(--primary-rgb), 0.16), transparent 68%),
    radial-gradient(420px 220px at 110% 120%, rgba(34, 197, 94, 0.12), transparent 68%),
    linear-gradient(180deg, rgba(var(--surface-soft-rgb), 0.96), var(--surface));
}

.backup-download-phase {
  margin-top: 2px;
  margin-bottom: 10px;
  font-size: 12px;
}

.backup-download-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: rgba(var(--surface-muted-rgb), 0.9);
  overflow: hidden;
}

.backup-download-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.9), rgba(56, 189, 248, 0.92));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16) inset,
    0 4px 14px rgba(var(--primary-rgb), 0.25);
  transition: width 0.18s linear;
}

.backup-download-track.indeterminate .backup-download-fill {
  width: 35%;
  animation: backup-download-shimmer 1.1s linear infinite;
}

@keyframes backup-download-shimmer {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(320%);
  }
}

.backup-download-percent {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.backup-download-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.backup-download-stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(var(--surface-soft-rgb), 0.92);
  padding: 8px 9px;
  display: grid;
  gap: 4px;
}

.backup-download-stat span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-light);
}

.backup-download-stat strong {
  font-size: 12px;
  line-height: 1.2;
}

.backup-download-note {
  margin-top: 10px;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .backup-download-card {
    max-width: 96vw;
  }

  .backup-download-stats {
    grid-template-columns: 1fr;
  }
}

.log-output {
  background: #1a1a2e;
  color: #eaecf0;
  padding: 8px;
  border-radius: 8px;
  max-height: 140px;
  overflow: auto;
  font-size: 12px;
  white-space: pre-wrap;
  font-family: monospace;
}


.help-icon {
  width: var(--control-32);
  height: var(--control-32);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background-color var(--motion-180),
    color var(--motion-180),
    transform var(--motion-180);
}

.help-icon:hover {
  background: var(--primary);
  color: var(--color-on-primary);
  border-color: transparent;
}

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

.help-card {
  max-width: 600px;
}

.help-body {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.5;
}


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


/* ===== EMPTY / SKELETON ===== */
.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-weight: 700;
  font-size: 16px;
}

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

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

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  animation: pulse 1.4s ease-in-out infinite;
}

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

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

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

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

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

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

  50% {
    opacity: 0.5;
  }
}

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

.load-more-btn {
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  transition:
    background-color var(--motion-180),
    border-color var(--motion-180),
    color var(--motion-180),
    box-shadow var(--motion-180),
    transform var(--motion-180);
}

.load-more-btn:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: transparent;
}

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

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

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

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

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
}

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

.btn.danger {
  background: var(--color-danger);
  color: var(--color-on-danger);
  border: none;
}

.danger-title {
  color: #ef4444;
}

.danger-btn {
  border-color: #ef4444;
  color: #ef4444;
}

.btn.ghost.toggle-active,
.btn.toggle-active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: transparent;
}

.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 {
  outline: 2px solid var(--glow-strong);
  outline-offset: 2px;
}

.btn-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--color-danger);
  color: var(--color-on-danger);
}

/* Badge for topbar icon buttons */
.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);
}

/* ===== MUNICIPALITY PICKER ===== */
.municipality-menu {
  position: fixed;
  z-index: var(--z-dropdown, 200);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.municipality-option {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  user-select: none;
}

.municipality-option:hover,
.municipality-option.active {
  background: rgba(var(--primary-rgb), 0.1);
}

.municipality-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* ===== PANELS ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel h3,
.panel h4 {
  margin: 0;
}

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

/*
  Uporabniski (prijavljeni) elementi morajo biti skriti, dokler auth
  ni potrjeno v stanje "user".
  S tem odstranimo kratkotrajen "flash" gumbov/sekcij ob osvezevanju.
*/
html:not([data-auth-state="user"]) #newAdBtn,
html:not([data-auth-state="user"]) #myAdsBtn,
html:not([data-auth-state="user"]) #profileBtn,
html:not([data-auth-state="user"]) #profileLink,
html:not([data-auth-state="user"]) #recentLink,
html:not([data-auth-state="user"]) #favoritesLink,
html:not([data-auth-state="user"]) #priceAlertsLink,
html:not([data-auth-state="user"]) #postAdLink,
html:not([data-auth-state="user"]) #myAdsLink,
html:not([data-auth-state="user"]) #logoutBtn,
html:not([data-auth-state="user"]) #messagesBtn,
html:not([data-auth-state="user"]) #adminPageBtn,
html:not([data-auth-state="user"]) #goToAdminBtn,
html:not([data-auth-state="user"]) #goToGlobalThemeBtn,
html:not([data-auth-state="user"]) #userPanel,
html:not([data-auth-state="user"]) #accountPanel,
html:not([data-auth-state="user"]) #appearancePanel,
html:not([data-auth-state="user"]) #globalAppearancePanel,
html:not([data-auth-state="user"]) #profileSummaryPanel,
html:not([data-auth-state="user"]) #priceAlertsPanel,
html:not([data-auth-state="user"]) #adEditor,
html:not([data-auth-state="user"]) #myAdsPanel,
html:not([data-auth-state="user"]) #insightsPanel,
html:not([data-auth-state="user"]) #adminPanel,
html:not([data-auth-state="user"]) #accessPanel,
html:not([data-auth-state="user"]) #priceAlertPanel,
html:not([data-auth-state="user"]) #similarAdsPanel,
html:not([data-auth-state="user"]) #ownerPanel,
html:not([data-auth-state="user"]) .top-actions a[href="/post.html"],
html:not([data-auth-state="user"]) .top-actions a[href="/my-ads.html"],
html:not([data-auth-state="user"]) .top-actions a[href="/profile.html"]:not(#loginLink),
html:not([data-auth-state="user"]) .top-actions a[href="/recent.html"],
html:not([data-auth-state="user"]) .top-actions a[href="/favorites.html"],
html:not([data-auth-state="user"]) .top-actions a[href="/price-alerts.html"],
html:not([data-auth-state="user"]) .vw-topbar-actions a[href="/favorites.html"],
html:not([data-auth-state="user"]) .vw-topbar-actions a[href="/price-alerts.html"],
html:not([data-auth-state="user"]) .bottom-nav a[href="/favorites.html"],
html:not([data-auth-state="user"]) .bottom-nav a[href="/price-alerts.html"] {
  display: none;
}

/*
  Prepreci kratkotrajen prikaz nepravih auth elementov med osvezevanjem,
  dokler se /auth/me ne zakljuci.
*/
html.nova-auth-pending #newAdBtn,
html.nova-auth-pending #myAdsBtn,
html.nova-auth-pending #profileLink,
html.nova-auth-pending #loginLink,
html.nova-auth-pending #recentLink,
html.nova-auth-pending #favoritesLink,
html.nova-auth-pending #priceAlertsLink,
html.nova-auth-pending #postAdLink,
html.nova-auth-pending #myAdsLink,
html.nova-auth-pending #logoutBtn,
html.nova-auth-pending #messagesBtn,
html.nova-auth-pending #adminPageBtn,
html.nova-auth-pending #authPanel,
html.nova-auth-pending #userPanel,
html.nova-auth-pending #accountPanel,
html.nova-auth-pending #appearancePanel,
html.nova-auth-pending #guestInfoPanel,
html.nova-auth-pending #profileSummaryPanel,
html.nova-auth-pending #priceAlertsPanel,
html.nova-auth-pending #goToAdminBtn,
html.nova-auth-pending #goToGlobalThemeBtn,
html.nova-auth-pending #loginNotice,
html.nova-auth-pending #similarAdsPanel,
html.nova-auth-pending #adEditor,
html.nova-auth-pending #myAdsPanel,
html.nova-auth-pending #insightsPanel,
html.nova-auth-pending #adminPanel,
html.nova-auth-pending #globalAppearancePanel,
html.nova-auth-pending #accessPanel,
html.nova-auth-pending #chatCtaPanel,
html.nova-auth-pending #priceAlertPanel,
html.nova-auth-pending #ownerPanel {
  visibility: hidden;
  pointer-events: none;
}

/*
  Topbar povezave, ki so namenjene prijavljenim uporabnikom.
  Med auth preverjanjem jih zakrijemo, za goste pa skrijemo v celoti.
*/
html.nova-auth-pending .top-actions a[href="/post.html"],
html.nova-auth-pending .top-actions a[href="/my-ads.html"],
html.nova-auth-pending .top-actions a[href="/profile.html"],
html.nova-auth-pending .top-actions a[href="/recent.html"],
html.nova-auth-pending .top-actions #newAdBtn,
html.nova-auth-pending .top-actions #myAdsBtn,
html.nova-auth-pending .top-actions #profileBtn,
html.nova-auth-pending .top-actions #profileLink,
html.nova-auth-pending .top-actions #recentLink,
html.nova-auth-pending .top-actions #postAdLink,
html.nova-auth-pending .top-actions #myAdsLink {
  visibility: hidden;
  pointer-events: none;
}

html[data-auth-state="guest"] .top-actions a[href="/post.html"],
html[data-auth-state="guest"] .top-actions a[href="/my-ads.html"],
html[data-auth-state="guest"] .top-actions a[href="/profile.html"]:not(#loginLink),
html[data-auth-state="guest"] .top-actions a[href="/recent.html"],
html[data-auth-state="guest"] .top-actions a[href="/favorites.html"],
html[data-auth-state="guest"] .top-actions a[href="/price-alerts.html"],
html[data-auth-state="guest"] .top-actions #newAdBtn,
html[data-auth-state="guest"] .top-actions #myAdsBtn,
html[data-auth-state="guest"] .top-actions #profileBtn,
html[data-auth-state="guest"] .top-actions #profileLink,
html[data-auth-state="guest"] .top-actions #recentLink,
html[data-auth-state="guest"] .top-actions #favoritesLink,
html[data-auth-state="guest"] .top-actions #priceAlertsLink,
html[data-auth-state="guest"] .top-actions #postAdLink,
html[data-auth-state="guest"] .top-actions #myAdsLink {
  display: none;
}

html[data-auth-state="user"] #loginLink,
html[data-auth-state="user"] .top-actions a[href="/login.html"] {
  display: none;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-name {
  font-weight: 600;
}

.user-role {
  font-size: 12px;
  color: var(--muted);
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--border);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}


/* ===== FORM ===== */
input:where(:not([type]), [type="text"], [type="search"], [type="email"], [type="password"], [type="number"], [type="tel"], [type="url"], [type="date"], [type="time"], [type="datetime-local"]),
select,
textarea {
  min-height: var(--control-40);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  background: var(--surface);
  color: var(--ink);
  transition:
    border-color var(--motion-180),
    box-shadow var(--motion-180);
  caret-color: var(--caret-color);
}

input:where(
    :not([type]),
    [type="text"],
    [type="search"],
    [type="email"],
    [type="password"],
    [type="number"],
    [type="tel"],
    [type="url"],
    [type="date"],
    [type="time"],
    [type="datetime-local"]
  ):where(:not(:disabled)),
textarea:not(:disabled),
[contenteditable="true"]:not([aria-disabled="true"]) {
  cursor: text;
}

input:where(
    :not([type]),
    [type="text"],
    [type="search"],
    [type="email"],
    [type="password"],
    [type="number"],
    [type="tel"],
    [type="url"],
    [type="date"],
    [type="time"],
    [type="datetime-local"]
  ):where(:focus),
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}

input:where(
    :not([type]),
    [type="text"],
    [type="search"],
    [type="email"],
    [type="password"],
    [type="number"],
    [type="tel"],
    [type="url"],
    [type="date"],
    [type="time"],
    [type="datetime-local"]
  )::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

input:where(
    :not([type]),
    [type="text"],
    [type="search"],
    [type="email"],
    [type="password"],
    [type="number"],
    [type="tel"],
    [type="url"],
    [type="date"],
    [type="time"],
    [type="datetime-local"]
  ):where(:is(:disabled, [aria-disabled="true"])),
select:is(:disabled, [aria-disabled="true"]),
textarea:is(:disabled, [aria-disabled="true"]) {
  opacity: 0.66;
  cursor: not-allowed;
}

input:where(
    :not([type]),
    [type="text"],
    [type="search"],
    [type="email"],
    [type="password"],
    [type="number"],
    [type="tel"],
    [type="url"],
    [type="date"],
    [type="time"],
    [type="datetime-local"]
  ):where([aria-invalid="true"]),
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

@media (max-width: 768px) {
  input:where(:not([type]), [type="text"], [type="search"], [type="email"], [type="password"], [type="number"], [type="tel"], [type="url"], [type="date"], [type="time"], [type="datetime-local"]),
  select,
  textarea {
    min-height: var(--control-44);
  }
}

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}


/* ===== DRAWER ===== */
.drawer {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: var(--z-modal, 500);
}

.drawer.active {
  display: flex;
}

.drawer-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: var(--surface-soft);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 16px;
}

.drawer-close:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.drawer-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.gallery-section {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery-header h4 {
  margin: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--surface-soft);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color var(--motion-180) var(--motion-ease), border-color var(--motion-180) var(--motion-ease), color var(--motion-180) var(--motion-ease), box-shadow var(--motion-180) var(--motion-ease), transform var(--motion-180) var(--motion-ease);
  position: relative;
}

.gallery-item:hover {
  border-color: var(--primary);
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.gallery-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--glow);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item-order {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(12, 17, 26, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.gallery-item-primary {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 48px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0.02em;
}

.gallery-item-controls {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity var(--motion-180) var(--motion-ease), transform var(--motion-180) var(--motion-ease);
}

.gallery-item:hover .gallery-item-controls,
.gallery-item:focus-within .gallery-item-controls {
  opacity: 1;
  transform: translateY(0);
}

.gallery-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(12, 17, 26, 0.8);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gallery-action-btn.primary {
  background: rgba(15, 118, 110, 0.92);
  border-color: rgba(204, 251, 241, 0.45);
}

.gallery-action-btn:hover:not(:disabled) {
  background: rgba(12, 17, 26, 0.92);
  border-color: rgba(255, 255, 255, 0.42);
}

.gallery-action-btn.primary:hover:not(:disabled) {
  background: rgba(13, 148, 136, 0.96);
  border-color: rgba(204, 251, 241, 0.65);
}

.gallery-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gallery-action-btn.danger {
  background: rgba(127, 29, 29, 0.86);
  border-color: rgba(254, 202, 202, 0.45);
}

.gallery-action-btn.danger:hover:not(:disabled) {
  background: rgba(153, 27, 27, 0.95);
}

.gallery-item.pending > .gallery-action-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
}

.gallery-item.pending .gallery-item-controls {
  grid-template-columns: repeat(2, 1fr);
}

.gallery-item.pending.has-upload-progress {
  border-color: rgba(var(--primary-rgb) / 0.35);
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb) / 0.08), rgba(255, 255, 255, 0.4)),
    var(--surface-soft);
}

.gallery-item-upload-progress {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 32px;
  z-index: 3;
  display: grid;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(var(--primary-rgb) / 0.18);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.gallery-item-upload-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  line-height: 1.15;
  color: var(--ink-secondary);
  font-weight: 700;
}

.gallery-item-upload-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item-upload-copy strong {
  flex: 0 0 auto;
  color: var(--primary-strong);
  font-size: 12px;
}

.gallery-item-upload-track {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(var(--primary-rgb) / 0.12);
}

.gallery-item-upload-track span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #14b8a6);
  transition: width var(--motion-180) var(--motion-ease);
}

.gallery-item.pending.upload-error,
.gallery-item.pending.upload-failed {
  border-color: rgba(180, 83, 9, 0.42);
}

.gallery-item.pending.upload-error .gallery-item-upload-progress,
.gallery-item.pending.upload-failed .gallery-item-upload-progress {
  border-color: rgba(180, 83, 9, 0.22);
  background: rgba(255, 251, 235, 0.95);
}

.gallery-item.pending.upload-error .gallery-item-upload-copy strong,
.gallery-item.pending.upload-failed .gallery-item-upload-copy strong {
  color: #92400e;
}

.gallery-item-heic-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb) / 0.12), rgba(255, 255, 255, 0.72)), var(--surface-soft);
  color: var(--ink);
  text-align: center;
}

.gallery-item-heic-placeholder strong,
.gallery-item-heic-placeholder span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item-heic-placeholder strong {
  font-size: 12px;
  font-weight: 700;
}

.gallery-item-heic-placeholder span {
  font-size: 12px;
  color: var(--muted);
}

.gallery-item-heic-badge {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 44px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--primary-strong);
  border: 1px solid rgba(var(--primary-rgb) / 0.22);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gallery-item-controls.gallery-item-controls-single {
  grid-template-columns: 1fr;
}

.gallery-item.is-rejected {
  place-items: stretch;
  padding: 10px;
  cursor: default;
  border-color: rgba(180, 83, 9, 0.22);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 244, 214, 0.92)), var(--surface-soft);
  color: var(--ink);
}

.gallery-item.is-rejected:hover {
  transform: none;
  border-color: rgba(180, 83, 9, 0.34);
  box-shadow: 0 10px 22px rgba(180, 83, 9, 0.12);
}

.gallery-item-rejected {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 100%;
}

.gallery-item-rejected-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.14);
  color: #92400e;
  border: 1px solid rgba(180, 83, 9, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-item-rejected-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.gallery-item-rejected-reason {
  font-size: 12px;
  line-height: 1.38;
  color: var(--ink-secondary);
}

.gallery-item-rejected-meta {
  margin-top: auto;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.gallery-issues {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(180, 83, 9, 0.18);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.98), rgba(255, 247, 237, 0.9)), var(--surface-soft);
}

.gallery-issues-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-issues-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.gallery-issues-copy {
  font-size: 12px;
  color: var(--ink-secondary);
}

.gallery-issues-list {
  display: grid;
  gap: 8px;
}

.gallery-issue-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(180, 83, 9, 0.12);
  background: rgba(255, 255, 255, 0.7);
}

.gallery-issue-row strong {
  color: var(--ink);
  font-size: 12px;
}

.gallery-issue-row span {
  color: var(--ink-secondary);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-item-controls {
    opacity: 1;
    transform: none;
  }
}

/* Dodatne slike indikator */
.gallery-item.more-indicator {
  background: linear-gradient(135deg, var(--surface-soft), var(--surface-muted));
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.gallery-upload {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}


/* ===== SCROLL-TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: 20px;
  right: calc(20px + env(safe-area-inset-right));
  z-index: var(--z-sticky, 100);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: var(--color-on-primary);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--primary-shadow);
  transition: background-color var(--motion-180), color var(--motion-180), box-shadow var(--motion-180), opacity var(--motion-180), transform var(--motion-180);
}

.scroll-top.hidden {
  opacity: 0;
  pointer-events: none;
  display: grid !important;
  visibility: hidden;
}

.scroll-top:hover {
  background: var(--primary-strong);
  transform: translateY(-2px);
}

/* Avoid overlap with the floating chat panel. */
.chat.active ~ .scroll-top {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

@media (max-width: 900px) {
  .scroll-top {
    bottom: calc(var(--mobile-bottom-nav-body-offset, 92px) + 22px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
    width: 46px;
    height: 46px;
  }
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: var(--z-emergency, 900);
  padding: 8px 16px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  transition: top var(--motion-180);
}

.skip-link:focus {
  top: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 0;
}

.breadcrumbs a {
  color: var(--primary);
  font-weight: 600;
}

.breadcrumbs .sep {
  color: var(--border);
}

.page.favorites-page .breadcrumbs,
.page.recent-page .breadcrumbs {
  width: fit-content;
  max-width: min(100%, 360px);
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(var(--primary-rgb) / 0.22);
  border-radius: 999px;
  background: rgba(var(--surface-rgb) / 0.94);
  color: var(--ink-secondary);
  line-height: 1;
  box-shadow:
    0 5px 14px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);


}

.page.favorites-page .breadcrumbs a,
.page.recent-page .breadcrumbs a {
  color: var(--primary-strong);
  font-weight: 700;
  text-decoration: none;
}

.page.favorites-page .breadcrumbs .sep,
.page.recent-page .breadcrumbs .sep {
  color: rgba(var(--primary-rgb) / 0.55);
  font-weight: 700;
}

.page.favorites-page .breadcrumbs span:not(.sep):last-child,
.page.recent-page .breadcrumbs span:not(.sep):last-child {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme="dark"] .page.favorites-page .breadcrumbs,
:root[data-theme="dark"] .page.recent-page .breadcrumbs {
  border-color: rgba(var(--primary-rgb) / 0.34);
  background: rgba(var(--surface-rgb) / 0.9);
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.flag-mini {
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 12px;
  background: var(--surface-soft);
  color: var(--muted-light);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color var(--motion-180), color var(--motion-180), transform var(--motion-180);
}

.flag-mini:hover {
  color: var(--red);
  background: var(--surface-muted);
}


/* ===== OSNUTKI (DRAFTS) ===== */
.drafts-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.drafts-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.drafts-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.draft-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  transition:
    background var(--motion-180), border-color var(--motion-180);
  max-width: 160px;
}

.draft-chip:hover {
  background: var(--surface-muted);
  border-color: var(--primary);
}

.draft-chip.active {
  background: var(--primary);
  color: var(--color-on-primary);
  border-color: var(--primary);
}

.draft-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-chip-close {
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  cursor: pointer;
  padding: 0 2px;
}

.draft-chip-close:hover {
  opacity: 1;
}

.draft-chip.active .draft-chip-close {
  opacity: 0.8;
}

.form-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 20px;
}

#autoSaveIndicator {
  font-size: 12px;
  color: var(--primary);
}


/* ===== 3. SKELETON LOADING (shimmer) ===== */

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

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  animation: none;
}

.skeleton-thumb,
.skeleton-body,
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: var(--surface-soft);
}

.skeleton-thumb::after,
.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(var(--surface-rgb) / 0.55) 40%,
    rgba(var(--surface-rgb) / 0.55) 60%,
    transparent 100%
  );
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}
