*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root,
[data-theme="light"] {
  --black: #0a0a0a;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --green: #22c55e;
  --green-light: #dcfce7;
  --green-dark: #16a34a;
  --green-glow: rgba(34, 197, 94, 0.35);
  --red: #dc2626;
  --amber: #d97706;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --font-en: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ar: 'Thmanyah Sans', 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --header-h: 72px;
  /* Header search pill — tweak these */
  --header-search-max-w: 650px;
  --header-search-pill-h: 48px;
  --page-gutter: clamp(32px, 7vw, 104px);
  --content-max: 1760px;
  --site-inset: max(var(--page-gutter), calc((100vw - var(--content-max)) / 2));

  --bg-page: var(--gray-50);
  --bg-surface: var(--white);
  --bg-elevated: var(--white);
  --bg-input: var(--white);
  --text-primary: var(--black);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --border: var(--gray-200);
  --header-bg: var(--white);
  --header-text: var(--black);
  --nav-bg: var(--white);
  --bukhmara-bg: var(--gray-100);
  --bukhmara-shell: var(--white);
  --bukhmara-toggle-track: var(--gray-100);
  --chip-bg: var(--white);
  --chip-active-bg: var(--black);
}

[data-theme="dark"] {
  --bg-page: #000000;
  --bg-surface: #141414;
  --bg-elevated: #1c1c1c;
  --bg-input: #0d0d0d;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --border: #2a2a2a;
  --header-bg: transparent;
  --header-text: #f5f5f5;
  --nav-bg: #0a0a0a;
  --bukhmara-bg: #1a1a1a;
  --bukhmara-shell: #1a1a1a;
  --bukhmara-toggle-track: #252525;
  --chip-bg: #222222;
  --chip-active-bg: #2d2d2d;
  --gray-100: #1a1a1a;
  --gray-50: #111111;
  --green-light: rgba(34, 197, 94, 0.12);
  --shadow: 0 4px 24px rgba(0,0,0,.4);
}

html[dir="rtl"] body { font-family: var(--font-ar); }
html[dir="ltr"] body { font-family: var(--font-en); }

body {
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100dvh;
  transition: background .25s, color .25s;
}

.profile-dropdown-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.profile-dropdown-item--primary {
  color: var(--green-dark);
  font-weight: 600;
}

.auth-settings-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

.auth-settings-copy h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.auth-settings-copy p,
.auth-settings-note,
.auth-settings-disclaimer,
.auth-user-email {
  color: var(--text-secondary);
}

.auth-settings-status,
.auth-settings-actions,
.auth-settings-meta {
  display: grid;
  gap: 12px;
}

.auth-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-status-badge.is-active {
  background: var(--green-light);
  color: var(--green-dark);
  border-color: rgba(34, 197, 94, 0.3);
}

.auth-status-badge.is-muted {
  background: var(--gray-100);
  color: var(--text-secondary);
}

.auth-user-card {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

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

.google-signin-slot {
  min-height: 44px;
}

.auth-settings-meta {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.auth-settings-warning {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--amber);
  border: 1px solid rgba(217, 119, 6, 0.22);
}

.login-route {
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.16), transparent 32%),
    var(--bg-page);
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 72px);
  min-height: 100dvh;
}

.login-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-shell {
  width: min(100%, 460px);
  display: grid;
  gap: 18px;
  padding: clamp(28px, 4vw, 40px);
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

.login-brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-brand span {
  color: var(--green);
}

.login-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.login-body,
.login-note {
  color: var(--text-secondary);
}

.login-google-slot {
  min-height: 44px;
}

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 500;
}

.auth-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.auth-modal {
  position: fixed;
  inset-inline: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(92vw, 420px);
  padding: 26px;
  border-radius: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 510;
}

.auth-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.auth-modal-card {
  display: grid;
  gap: 16px;
}

.auth-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
}

.auth-modal-body,
.auth-modal-note {
  color: var(--text-secondary);
}

.auth-modal-actions {
  display: grid;
  gap: 12px;
}

.auth-modal-google-slot {
  min-height: 44px;
}

.auth-modal-close {
  justify-self: end;
}

#app { min-height: 100dvh; display: flex; flex-direction: column; }

/* Header */
.header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 16px var(--site-inset);
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background .25s, color .25s, border-color .25s;
  min-height: var(--header-h);
  border-bottom: 1px solid transparent;
}

.header.header--searching {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  border-bottom-color: var(--border);
  padding-top: 14px;
  padding-bottom: 0;
}

.header--searching .header-search-block,
.header--searching .header-search-top {
  display: contents;
}

.header--searching .logo--header-mark {
  grid-column: 1;
  grid-row: 1;
}

.header--searching .header-start {
  grid-column: 2;
  grid-row: 1;
  flex: none;
  width: min(100%, var(--header-search-max-w));
  max-width: var(--header-search-max-w);
  min-width: 0;
}

.header--searching .header-actions {
  grid-column: 3;
  grid-row: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.header--searching .header-search-block .search-type-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.header--searching .search-type-tab {
  padding: 10px 0 8px;
}

@media (min-width: 640px) {
  .header.header--searching {
    padding-top: 22px;
  }

  :root,
  [data-theme="light"] {
    --header-search-pill-h: 56px;
  }
}

.header-search-block {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-search-top {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
}

.logo--header-mark {
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.header-start {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(420px, calc(100% - 200px));
}

.header--searching .header-start .bukhmara--header {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  max-width: none;
}

.header--searching .header-start .bukhmara-header-shell {
  flex: 1;
  width: 100%;
}

.bukhmara-header-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--header-search-pill-h);
  padding: 0 20px;
  border: 2px solid #9333ea;
  border-radius: 999px;
  background: var(--bg-surface);
  outline: none;
  box-shadow: none;
  overflow: hidden;
}

[data-theme="dark"] .bukhmara-header-shell {
  border-color: #a855f7;
  background: var(--bg-elevated);
}

.bukhmara--header .bukhmara-input {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.bukhmara--header .bukhmara-input:focus,
.bukhmara--header .bukhmara-input:focus-visible {
  outline: none;
  box-shadow: none;
}

@media (min-width: 640px) {
  .bukhmara-header-shell {
    padding: 0 22px;
  }

  .bukhmara--header .bukhmara-input {
    font-size: 1.25rem;
  }
}

.logo {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--header-text);
  letter-spacing: -0.02em;
}

.logo span { color: var(--green); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-utilities {
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gray-700);
  color: var(--gray-200);
  white-space: nowrap;
}

.role-badge.admin { background: var(--green-dark); }
.role-badge.provider { background: #1e40af; }
.role-badge.user { background: var(--gray-600); }

/* Profile menu */
.profile-menu {
  position: relative;
}

.profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--header-text);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  text-decoration: none;
}

.profile-btn:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .profile-btn:hover {
  background: #222;
}

.profile-btn.active,
.profile-btn.active:hover,
.profile-menu.open .profile-btn,
.profile-menu.open .profile-btn:hover,
.profile-btn:focus,
.profile-btn:focus-visible {
  border-color: var(--border);
  box-shadow: none;
  outline: none;
}

.profile-btn svg {
  width: 20px;
  height: 20px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 240px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
  padding: 4px 0 6px;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 200;
}

.profile-menu.open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 8px;
  direction: ltr;
}

.profile-dropdown-name {
  flex: 1;
  min-width: 0;
  order: 1;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  text-align: left;
}

html[dir="rtl"] .profile-dropdown-name {
  order: 2;
  text-align: right;
}

html[dir="rtl"] .profile-dropdown-avatar {
  order: 1;
}

.profile-dropdown-body {
  padding: 2px 6px;
}

.profile-dropdown-footer {
  padding: 2px 6px 0;
}

.profile-dropdown-avatar {
  order: 2;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  flex-shrink: 0;
}

.profile-dropdown-avatar svg {
  width: 20px;
  height: 20px;
  display: block;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  text-align: start;
}

.profile-dropdown-item:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .profile-dropdown-item:hover {
  background: #252525;
}

.profile-dropdown-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

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

.profile-dropdown-item.danger {
  color: var(--red);
}

.profile-dropdown-item--logout {
  margin-top: 0;
  padding-top: 10px;
  border-top: none;
  width: 100%;
  background: none;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.profile-dropdown-item--logout svg {
  color: var(--red);
}

/* Pill toggle — Moed (theme) & Lugha (language) */
.moed,
.lugha {
  display: flex;
  align-items: center;
  background: var(--bukhmara-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.moed-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: inherit;
}

.moed-btn--label {
  width: auto;
  min-width: 36px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.moed-btn svg {
  width: 16px;
  height: 16px;
}

.moed-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

[data-theme="dark"] .moed-btn.active {
  background: #333;
}

/* Bookmark utility button */
.bookmark-util {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--header-text);
  text-decoration: none;
  transition: border-color .2s;
}

.bookmark-util:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .bookmark-util:hover {
  background: #222;
}

.bookmark-util.active,
.bookmark-util.active:hover,
.bookmark-util:focus,
.bookmark-util:focus-visible {
  border-color: var(--border);
  box-shadow: none;
  outline: none;
}

.bookmark-util svg {
  width: 18px;
  height: 18px;
}

.bookmark-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Bookmarks slide-in panel */
.bookmarks-backdrop {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 140;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.bookmarks-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.bookmarks-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  left: auto;
  width: min(320px, 88vw);
  height: calc(100dvh - var(--header-h));
  background: var(--bg-page);
  border-left: 1px solid var(--border);
  border-right: none;
  z-index: 150;
  transform: translateX(100%);
  transition: transform .28s ease, visibility .28s;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

html[dir="rtl"] .bookmarks-panel {
  left: 0;
  right: auto;
  border-left: none;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}

.bookmarks-panel.open {
  transform: translateX(0);
  visibility: visible;
}

html[dir="rtl"] .bookmarks-panel.open {
  transform: translateX(0);
}

.bookmarks-panel-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.bookmarks-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.bookmarks-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  text-align: start;
}

.bookmarks-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.bookmarks-panel-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

[data-theme="dark"] .bookmarks-panel-close:hover {
  background: #222;
}

.bookmarks-panel-close svg {
  width: 18px;
  height: 18px;
}

html[dir="rtl"] .bookmarks-panel-close svg {
  transform: scaleX(-1);
}

.bookmarks-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  direction: ltr;
}

.bookmarks-panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.bookmarks-panel-item:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .bookmarks-panel-item:hover {
  background: #141414;
}

.bookmarks-panel-item:last-child {
  border-bottom: none;
}

.bookmarks-panel-label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  direction: ltr;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

html[dir="rtl"] .bookmarks-panel-item .bookmarks-panel-chevron {
  order: 1;
}

html[dir="rtl"] .bookmarks-panel-item .bookmarks-panel-label {
  order: 2;
  flex: 0 1 auto;
  margin-inline-start: auto;
  text-align: end;
}

html[dir="rtl"] .bookmarks-panel-item .result-dot {
  order: 3;
}

.bookmarks-panel-chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.bookmarks-panel-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  direction: rtl;
}

html[dir="ltr"] .bookmarks-panel-empty {
  direction: ltr;
}

body.bookmarks-open {
  overflow: hidden;
}

@media (min-width: 900px) {
  .bookmarks-backdrop.open {
    background: transparent;
    pointer-events: none;
  }

  body.bookmarks-open {
    overflow: auto;
  }
}

/* Listing preview drawer */
.listing-preview-backdrop {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 160;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.listing-preview-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.listing-preview-panel {
  position: fixed;
  top: var(--header-h);
  right: 0;
  left: auto;
  width: min(420px, 92vw);
  height: calc(100dvh - var(--header-h));
  background: var(--bg-page);
  border-left: 1px solid var(--border);
  border-right: none;
  z-index: 170;
  transform: translateX(100%);
  transition: transform .28s ease, visibility .28s;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

html[dir="rtl"] .listing-preview-panel {
  left: 0;
  right: auto;
  border-left: none;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}

.listing-preview-panel.open {
  transform: translateX(0);
  visibility: visible;
}

html[dir="rtl"] .listing-preview-panel.open {
  transform: translateX(0);
}

.listing-preview-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.listing-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/*
  English (panel on the RIGHT):
  [Open Bookmark Share] ........ [Back ›]

  Arabic (panel on the LEFT):
  [‹ رجوع] ........ [Share Bookmark Open]

  Icon strip left→right:
  - EN: Open → Bookmark → Share
  - AR: Share → Bookmark → Open
*/
html[dir="ltr"] .listing-preview-toolbar {
  direction: ltr;
  flex-direction: row-reverse;
}

html[dir="rtl"] .listing-preview-toolbar {
  direction: ltr;
  flex-direction: row;
}

.listing-preview-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 0;
}

/* English: "Back ›" */
html[dir="ltr"] .listing-preview-back {
  flex-direction: row-reverse;
}

html[dir="ltr"] .listing-preview-back svg {
  transform: scaleX(-1);
}

/* Arabic: "‹ رجوع" */
html[dir="rtl"] .listing-preview-back {
  flex-direction: row;
}

html[dir="rtl"] .listing-preview-back svg {
  transform: none;
}

.listing-preview-back svg {
  width: 18px;
  height: 18px;
}

.listing-preview-toolbar-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

/* Default / Arabic: Share → Bookmark → Open */
.listing-preview-toolbar-actions #listing-preview-share {
  order: 1;
}

.listing-preview-toolbar-actions #listing-preview-bookmark {
  order: 2;
}

.listing-preview-toolbar-actions #listing-preview-open {
  order: 3;
}

/* English only: Open → Bookmark → Share */
html[dir="ltr"] .listing-preview-toolbar-actions #listing-preview-open {
  order: 1;
}

html[dir="ltr"] .listing-preview-toolbar-actions #listing-preview-bookmark {
  order: 2;
}

html[dir="ltr"] .listing-preview-toolbar-actions #listing-preview-share {
  order: 3;
}

.listing-preview-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}

.listing-preview-icon-btn svg {
  width: 16px;
  height: 16px;
}

.listing-preview-icon-btn.is-active {
  color: var(--green-dark);
  border-color: var(--border);
}

.listing-preview-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 24px;
}

.listing-preview-scroll[dir="ltr"] .listing-preview-stats,
.listing-preview-scroll[dir="ltr"] .listing-preview-substats,
.listing-preview-scroll[dir="ltr"] .listing-preview-meter-labels {
  direction: ltr;
}

.listing-preview-scroll[dir="rtl"] .listing-preview-stats,
.listing-preview-scroll[dir="rtl"] .listing-preview-substats,
.listing-preview-scroll[dir="rtl"] .listing-preview-meter-labels {
  direction: rtl;
}

.listing-preview-scroll[dir="ltr"] .listing-preview-stat {
  text-align: left;
}

.listing-preview-scroll[dir="rtl"] .listing-preview-stat {
  text-align: right;
}

.listing-preview-scroll[dir="rtl"] .listing-preview-meter-bar {
  flex-direction: row-reverse;
}

.listing-preview-scroll[dir="ltr"] .listing-preview-section-head,
.listing-preview-scroll[dir="ltr"] .listing-preview-title-row,
.listing-preview-scroll[dir="ltr"] .listing-preview-provider {
  direction: ltr;
}

.listing-preview-scroll[dir="rtl"] .listing-preview-section-head,
.listing-preview-scroll[dir="rtl"] .listing-preview-title-row,
.listing-preview-scroll[dir="rtl"] .listing-preview-provider {
  direction: rtl;
}

.listing-preview-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.listing-preview-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gray-400);
  flex-shrink: 0;
}

.listing-preview-status-dot.is-live {
  background: #3b82f6;
}

.listing-preview-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.listing-preview-media {
  margin-bottom: 14px;
}

.listing-preview-media .listing-card-media-top {
  display: none;
}

.listing-preview-price {
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.listing-preview-section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.listing-preview-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.listing-preview-section-head svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.listing-preview-section-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.listing-preview-provider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
}

.listing-preview-provider--empty {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.listing-preview-provider-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.listing-preview-provider-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.listing-preview-provider-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.listing-preview-provider-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.listing-preview-provider-chevron svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

html[dir="rtl"] .listing-preview-provider-chevron svg {
  transform: scaleX(-1);
}

.listing-preview-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.listing-preview-contact-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.listing-preview-contact-value {
  font-size: 0.95rem;
  font-weight: 600;
  direction: ltr;
  unicode-bidi: isolate;
  align-self: start;
}

.listing-preview-stats,
.listing-preview-substats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 14px;
}

.listing-preview-stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.listing-preview-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.listing-preview-meter {
  margin-bottom: 14px;
}

.listing-preview-meter-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--gray-100);
}

.listing-preview-meter-fill {
  background: var(--green);
}

.listing-preview-meter-rest {
  background: #ef4444;
}

.listing-preview-meter-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.listing-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.listing-preview-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 139, 34, 0.12);
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 600;
}

[data-theme="dark"] .listing-preview-tag {
  color: var(--green);
}

.listing-preview-meta-line {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.listing-preview-meta-block .listing-meta {
  flex-wrap: wrap;
}

.listing-preview-footer {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.listing-preview-cta {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.listing-preview-cta:hover {
  background: var(--bg-surface);
}

body.listing-preview-open {
  overflow: hidden;
}

@media (min-width: 900px) {
  .listing-preview-backdrop.open {
    background: rgba(0, 0, 0, 0.35);
  }

  body.listing-preview-open {
    overflow: auto;
  }
}

#listing-menu-portal {
  position: fixed;
  inset: 0;
  z-index: 250;
  pointer-events: none;
}

#listing-menu-portal .listing-card-menu-panel {
  pointer-events: auto;
}

.listing-card-menu-panel--floating {
  position: fixed;
  top: auto;
  inset-inline-end: auto;
  z-index: 251;
  display: block;
}

/* Main */
.main {
  flex: 1;
  width: 100%;
  padding: 16px var(--site-inset) 24px;
}

.main.home-main {
  padding-top: 8px;
}

.main.results-main {
  max-width: none;
  padding-top: 16px;
}

.search-query-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.search-query-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.search-query-icon-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.search-query-icon-bar .listing-bookmark-btn,
.search-query-icon-bar .search-query-icon-btn,
.search-query-icon-bar .listing-card-menu-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: #262626;
  color: var(--text-primary);
  flex-shrink: 0;
}

[data-theme="light"] .search-query-icon-bar .listing-bookmark-btn,
[data-theme="light"] .search-query-icon-bar .search-query-icon-btn,
[data-theme="light"] .search-query-icon-bar .listing-card-menu-btn {
  background: var(--gray-200);
  color: var(--text-primary);
}

.search-query-icon-bar .listing-bookmark-btn {
  border: none;
}

.search-query-icon-bar .listing-bookmark-btn.is-active {
  color: var(--green);
  background: transparent;
}

.search-query-icon-bar .listing-bookmark-btn svg,
.search-query-icon-bar .search-query-icon-btn svg,
.search-query-icon-bar .listing-card-menu-btn svg {
  width: 18px;
  height: 18px;
}

.search-query-icon-bar .listing-card-menu-btn:hover,
.search-query-icon-bar .listing-card-menu-btn[aria-expanded="true"],
.search-query-icon-bar .listing-bookmark-btn:hover,
.search-query-icon-btn:hover {
  background: #333;
  color: var(--text-primary);
}

[data-theme="light"] .search-query-icon-bar .listing-card-menu-btn:hover,
[data-theme="light"] .search-query-icon-bar .listing-card-menu-btn[aria-expanded="true"],
[data-theme="light"] .search-query-icon-bar .listing-bookmark-btn:hover,
[data-theme="light"] .search-query-icon-btn:hover {
  background: var(--gray-300);
}

.search-query-icon-bar .listing-card-media-top,
.search-query-icon-bar .listing-detail-top-icons {
  display: contents;
}

.search-query-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border: none;
}

.search-query-text-btn--secondary {
  background: #262626;
  color: var(--text-primary);
}

[data-theme="light"] .search-query-text-btn--secondary {
  background: var(--gray-200);
  color: var(--text-primary);
}

.search-query-text-btn--secondary:hover {
  background: #333;
}

[data-theme="light"] .search-query-text-btn--secondary:hover {
  background: var(--gray-300);
}

.search-query-text-btn.search-query-cta {
  pointer-events: auto;
  cursor: pointer;
}

.search-query-text-btn.search-query-cta.action-green {
  background: var(--green);
  color: var(--white);
}

.search-query-text-btn.search-query-cta.action-green:hover {
  background: var(--green-dark);
}

.search-query-text-btn.search-query-cta.action-amber {
  background: var(--amber);
  color: var(--white);
}

.search-query-text-btn.search-query-cta.action-blue {
  background: #3b82f6;
  color: var(--white);
}

.search-query-text-btn.search-query-cta.action-red,
.search-query-text-btn.search-query-cta.action-gray {
  background: #ef4444;
  color: var(--white);
}

.search-query-text-btn.search-query-cta::after {
  display: none;
}

.search-query-text-btn-arrow {
  font-size: 0.95em;
  line-height: 1;
}

html[dir="rtl"] .search-query-text-btn-arrow {
  transform: scaleX(-1);
}

.search-query-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-query-banner {
  margin-bottom: 12px;
  padding: 0;
}

.search-type-nav {
  display: flex;
  gap: clamp(20px, 4vw, 32px);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.search-type-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 12px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}

.search-type-tab:hover {
  color: var(--text-primary);
}

.search-type-tab.is-active {
  color: var(--text-primary);
}

.search-type-tab--plate .search-type-tab__icon {
  color: #9333ea;
}

.search-type-tab--phone .search-type-tab__icon {
  color: #22c55e;
}

.search-type-tab--plate.is-active {
  border-bottom-color: #9333ea;
}

.search-type-tab--phone.is-active {
  border-bottom-color: #22c55e;
}

.search-type-tab__icon {
  display: flex;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.search-type-tab__icon svg {
  width: 100%;
  height: 100%;
}

.search-type-tab__label {
  white-space: nowrap;
}

.search-query-value {
  margin: 0;
  font-size: clamp(2.25rem, 5.5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  direction: ltr;
  text-align: start;
}

.search-query-value--available {
  color: #22c55e;
}

.search-query-value--premium {
  color: #f59e0b;
}

.search-query-value--open-bid {
  color: #3b82f6;
}

.search-query-value--sold {
  color: #ef4444;
}

[data-theme="dark"] .search-query-value--available {
  color: #4ade80;
}

[data-theme="dark"] .search-query-value--premium {
  color: #fbbf24;
}

[data-theme="dark"] .search-query-value--open-bid {
  color: #60a5fa;
}

[data-theme="dark"] .search-query-value--sold {
  color: #f87171;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* Bottom nav — mobile only */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
}

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

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 4px 8px;
  min-width: 56px;
}

.bottom-nav a.active { color: var(--green); font-weight: 600; }

.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 4px 8px;
  min-width: 56px;
  cursor: pointer;
  font-family: inherit;
}

.bottom-nav-btn.active { color: var(--green); font-weight: 600; }

/* Site footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  padding: 48px var(--site-inset) 32px;
}

.site-footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.site-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px 72px;
  margin-bottom: 40px;
}

.site-footer-brand {
  flex: 0 0 auto;
  min-width: 0;
}

.site-footer-logo {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--header-text);
  line-height: 1.2;
}

.site-footer-logo span {
  color: var(--green);
}

.site-footer-nav {
  flex: 1 1 560px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 40px;
  min-width: 0;
  max-width: 720px;
}

.site-footer-col-title {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.site-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer-links a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color .15s;
}

.site-footer-links a:hover {
  color: var(--text-primary);
}

.site-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.site-footer-copy,
.site-footer-meta {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.site-footer-meta {
  flex: 1 1 auto;
  text-align: center;
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .site-footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}

@media (max-width: 768px) {
  .site-footer-nav {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 639px) {
  .site-footer {
    padding: 40px var(--site-inset) calc(32px + 56px + env(safe-area-inset-bottom));
  }

  .site-footer-top {
    flex-direction: column;
    gap: 32px;
    margin-bottom: 28px;
  }

  .site-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .site-footer-meta {
    text-align: start;
  }
}

.info-page {
  max-width: 52ch;
}

.info-page-body {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, transform .1s;
}

.btn:active { opacity: .85; transform: scale(.98); }
.btn-primary { background: var(--green); color: var(--white); }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 10px; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:active { opacity: .9; }

.listing-card { display: flex; flex-direction: column; gap: 8px; }

.listing-card-media {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.listing-card-media-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 32px;
  position: relative;
  z-index: 5;
  isolation: isolate;
}

html[dir="ltr"] .listing-card-media-top--plate {
  direction: rtl;
}

html[dir="rtl"] .listing-card-media-top--plate {
  direction: ltr;
}

/* Phone cards — bookmark right, menu left (mirror page direction like plates) */
html[dir="ltr"] .listing-card-media-top--phone {
  direction: rtl;
}

html[dir="rtl"] .listing-card-media-top--phone {
  direction: ltr;
}

.listing-bookmark-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  transition: color .15s, border-color .15s, transform .15s;
}

.listing-card-menu {
  position: relative;
  flex-shrink: 0;
}

.listing-bookmark-btn svg {
  width: 16px;
  height: 16px;
}

.listing-bookmark-btn:hover {
  color: var(--green);
  transform: scale(1.04);
}

.listing-bookmark-btn.is-active {
  color: var(--green);
  border-color: var(--border);
  background: var(--white);
}

[data-theme="dark"] .listing-bookmark-btn.is-active {
  color: var(--green);
  border-color: var(--border);
  background: var(--bg-elevated);
}

.listing-bookmark-btn.is-active:hover {
  color: var(--green);
  border-color: var(--border);
  background: var(--white);
}

[data-theme="dark"] .listing-bookmark-btn.is-active:hover {
  background: var(--bg-elevated);
}

.listing-card-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  transition: color .15s, border-color .15s, background .15s;
}

.listing-card-menu-btn svg {
  width: 18px;
  height: 18px;
}

.listing-card-menu-btn:hover,
.listing-card-menu-btn[aria-expanded="true"] {
  border-color: var(--border);
  color: var(--text-primary);
  background: var(--gray-100);
}

[data-theme="dark"] .listing-card-menu-btn:hover,
[data-theme="dark"] .listing-card-menu-btn[aria-expanded="true"] {
  background: #222;
}

.listing-card-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  z-index: 30;
}

html[dir="rtl"] .listing-card-menu-panel {
  direction: rtl;
}

html[dir="ltr"] .listing-card-menu-panel {
  direction: ltr;
}

.listing-card-menu-item--lead {
  background: var(--bg-page);
}

.listing-card-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.85rem;
  text-align: start;
  cursor: pointer;
}

.listing-card-menu-item:hover,
.listing-card-menu-item:focus-visible {
  background: var(--bg-page);
}

.listing-card-menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.listing-card-menu-icon svg {
  width: 18px;
  height: 18px;
}

.listing-card-media--phone {
  width: 100%;
}

html[dir="ltr"] .listing-card--phone,
html[dir="ltr"] .listing-row-track .listing-card--phone {
  direction: ltr;
}

html[dir="rtl"] .listing-card--phone,
html[dir="rtl"] .listing-row-track .listing-card--phone,
html[dir="rtl"] .listing-row .listing-card--phone {
  direction: rtl;
}

html[dir="rtl"] .listing-card--phone .listing-card-media--phone {
  direction: rtl;
  align-items: stretch;
}

.listing-card-media--phone .listing-phone {
  margin-top: 0;
  width: 100%;
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  direction: ltr;
  unicode-bidi: plaintext;
  display: block;
}

html[dir="rtl"] .listing-card--phone .listing-phone {
  text-align: right;
}

html[dir="ltr"] .listing-card--phone .listing-phone {
  text-align: left;
}

html[dir="rtl"] .listing-card--phone .listing-card-info {
  direction: rtl;
  align-items: flex-end;
  text-align: right;
}

html[dir="rtl"] .listing-card--carousel.listing-card--phone .listing-card-info {
  width: 100%;
  align-self: stretch;
}

html[dir="ltr"] .listing-card--phone .listing-card-info {
  direction: ltr;
  align-items: flex-start;
  text-align: left;
}

html[dir="rtl"] .listing-card--phone .listing-meta,
html[dir="rtl"] .listing-card--phone .listing-price {
  width: 100%;
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .listing-card--phone .listing-meta {
  justify-content: flex-start;
}

html[dir="ltr"] .listing-card--phone .listing-meta {
  direction: ltr;
  justify-content: flex-start;
}

.listing-card-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: start;
}

html[dir="rtl"] .listing-card-info {
  direction: rtl;
}

html[dir="ltr"] .listing-card-info {
  direction: ltr;
}

/* Saudi license plate — PNG template (1024×236) with text overlay */
.sa-plate {
  width: 100%;
  max-width: 512px;
  line-height: 1;
  user-select: none;
}

.sa-plate--template {
  position: relative;
  display: block;
}

.sa-plate-bg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.sa-plate-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sa-plate-text {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px 4px;
  box-sizing: border-box;
}

.sa-plate-text-fill {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #111;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.sa-plate-ar-num {
  left: 2.34%;
  top: 7.63%;
  width: 47.27%;
  height: 41.53%;
}

.sa-plate-ar-letters {
  left: 50.29%;
  top: 7.63%;
  width: 40.82%;
  height: 41.53%;
  font-family: Tahoma, 'Segoe UI', sans-serif;
}

.sa-plate-lat-num {
  left: 2.34%;
  top: 50.85%;
  width: 47.27%;
  height: 41.53%;
  font-variant-numeric: tabular-nums;
}

.sa-plate-lat-letters {
  left: 50.29%;
  top: 50.85%;
  width: 40.82%;
  height: 41.53%;
  text-transform: uppercase;
}

.sa-plate-ar-num .sa-plate-text-fill,
.sa-plate-lat-num .sa-plate-text-fill {
  font-size: clamp(1rem, 5.4vw, 1.75rem);
}

.sa-plate-ar-letters .sa-plate-text-fill {
  font-size: clamp(0.95rem, 5vw, 1.65rem);
}

.sa-plate-lat-letters .sa-plate-text-fill {
  font-size: clamp(0.9rem, 4.6vw, 1.55rem);
}

/* Classic plate — Arabic only (motorbike template) */
.sa-plate-classic-num {
  left: 8%;
  top: 36%;
  width: 38%;
  height: 52%;
}

.sa-plate-classic-letters {
  left: 56%;
  top: 36%;
  width: 36%;
  height: 52%;
  font-family: Tahoma, 'Segoe UI', sans-serif;
}

.sa-plate-classic-num .sa-plate-text-fill,
.sa-plate-classic-letters .sa-plate-text-fill {
  font-size: clamp(1.05rem, 5.8vw, 1.85rem);
}

.sa-plate--compact.sa-plate--classic .sa-plate-classic-num .sa-plate-text-fill,
.sa-plate--compact.sa-plate--classic .sa-plate-classic-letters .sa-plate-text-fill {
  font-size: clamp(0.8rem, 4.2vw, 1.15rem);
}

.sa-plate--compact {
  max-width: 256px;
}

.sa-plate--compact .sa-plate-ar-num .sa-plate-text-fill,
.sa-plate--compact .sa-plate-lat-num .sa-plate-text-fill {
  font-size: clamp(0.75rem, 4vw, 1.1rem);
}

.sa-plate--compact .sa-plate-ar-letters .sa-plate-text-fill {
  font-size: clamp(0.7rem, 3.6vw, 1rem);
}

.sa-plate--compact .sa-plate-lat-letters .sa-plate-text-fill {
  font-size: clamp(0.65rem, 3.2vw, 0.95rem);
}

.listing-card .sa-plate,
.review-item .sa-plate {
  align-self: stretch;
}

.listing-plate {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  direction: ltr;
  text-align: start;
}

.listing-phone {
  font-size: 1.25rem;
  font-weight: 700;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

.listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.listing-price {
  width: 100%;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-align: start;
}

.listing-price .price-value {
  color: var(--green-dark);
  font-weight: 700;
}

.listing-price .price-amount .riyal-symbol {
  color: var(--green-dark);
}

[data-theme="dark"] .listing-price .price-value,
[data-theme="dark"] .listing-price .price-amount .riyal-symbol {
  color: var(--green);
}

.price-line {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.35em;
  max-width: 100%;
}

html[dir="rtl"] .listing-card-info .price-line {
  direction: rtl;
  justify-content: flex-start;
}

html[dir="ltr"] .listing-card-info .price-line {
  direction: ltr;
  justify-content: flex-start;
}

.price-label {
  color: var(--text-primary);
  font-weight: 700;
  flex-shrink: 0;
}

.price-amount {
  display: inline-flex;
  align-items: baseline;
  flex-direction: row;
  gap: 0.14em;
  unicode-bidi: isolate;
  white-space: nowrap;
  flex-shrink: 0;
}

.riyal-symbol {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 1;
}

.riyal-symbol svg {
  width: 0.82em;
  height: 0.92em;
  display: block;
}

.info-item .price-amount .riyal-symbol svg {
  width: 0.9em;
  height: 1em;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-green { background: var(--green-light); color: var(--green-dark); }
.badge-gray { background: var(--gray-100); color: var(--text-secondary); }
.badge-amber { background: #fef3c7; color: var(--amber); }
.badge-red { background: #fee2e2; color: var(--red); }
.badge-black { background: #0a0a0a; color: #fff; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }

[data-theme="dark"] .badge-black { background: #0a0a0a; color: #fff; }
[data-theme="dark"] .badge-blue { background: rgba(59,130,246,.2); color: #93c5fd; }
[data-theme="dark"] .badge-purple { background: rgba(126,34,206,.22); color: #d8b4fe; }
[data-theme="dark"] .badge-green { background: rgba(34,197,94,.18); color: #86efac; }

[data-theme="dark"] .badge-amber { background: rgba(217,119,6,.2); color: #fbbf24; }
[data-theme="dark"] .badge-red { background: rgba(220,38,38,.2); color: #f87171; }

/* ─── Home hero ─── */
.hero {
  text-align: center;
  padding: 40px 0 28px;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-primary);
}

.hero p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

/* ─── Bukhmara search bar ─── */
.bukhmara.bukhmara--header {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
  max-width: none;
  margin: 0;
}

.bukhmara {
  background: var(--bukhmara-shell);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-width: 860px;
  margin: 0 auto;
}

.bukhmara-body {
  min-width: 0;
}

.bukhmara-back {
  display: none;
}

.bukhmara-input-wrap {
  padding: 20px 20px 8px;
}

.bukhmara-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.5;
  resize: none;
  min-height: 28px;
  outline: none;
}

.bukhmara-input::placeholder {
  color: var(--text-muted);
}

.bukhmara-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 12px;
  background: transparent;
}

.bukhmara-type {
  flex-shrink: 0;
  background: var(--bukhmara-toggle-track);
}

.bukhmara-submit {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 0 0 0 var(--green-glow);
}

.bukhmara-submit:hover {
  background: var(--green-dark);
  box-shadow: 0 0 16px var(--green-glow);
}

.bukhmara-submit svg {
  width: 18px;
  height: 18px;
}

/* Home — horizontal listing rows */
.home-section {
  margin-top: 36px;
}

.listing-rows {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.listing-rows-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--text-secondary);
}

.listing-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.listing-row-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.listing-row-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
}

.listing-row-see-all {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background .12s, transform .12s;
}

.listing-row-see-all:hover {
  background: var(--gray-200);
}

.listing-row-see-all svg {
  width: 14px;
  height: 14px;
}

[dir="rtl"] .listing-row-see-all svg {
  transform: scaleX(-1);
}

.listing-row-nav {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.listing-row-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--gray-100);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background .12s, opacity .12s;
}

.listing-row-arrow svg {
  width: 14px;
  height: 14px;
}

[dir="rtl"] .listing-row-arrow svg {
  transform: scaleX(-1);
}

.listing-row-arrow:hover:not(:disabled) {
  background: var(--gray-200);
}

.listing-row-arrow:disabled {
  opacity: 0.35;
  cursor: default;
  color: var(--gray-400);
}

.listing-row-scroller {
  overflow: visible;
  width: 100%;
}

.listing-row-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scroll-padding-inline: 0 var(--site-inset);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 6px;
  direction: ltr;
}

html[dir="rtl"] .listing-row-track {
  direction: rtl;
}

.listing-row-track-end {
  flex: 0 0 var(--site-inset);
  min-width: var(--site-inset);
  height: 1px;
  pointer-events: none;
  scroll-snap-align: end;
}

.listing-row-track::-webkit-scrollbar {
  display: none;
}

.listing-row-item {
  flex: 0 0 clamp(228px, 24vw, 280px);
  scroll-snap-align: start;
  min-width: 0;
  overflow: visible;
}

.listing-row-card {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  position: relative;
}

.listing-row-card:active {
  opacity: .92;
}

.listing-card--carousel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.07);
  overflow: visible;
}

[data-theme="dark"] .listing-card--carousel {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 6px 20px rgba(0, 0, 0, 0.35);
}

.listing-card--carousel .sa-plate {
  max-width: none;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

.listing-card--carousel .listing-meta {
  margin-top: 0;
}

.listing-card--carousel .listing-price {
  margin-top: 0;
  font-size: 0.85rem;
}

.bukhmara--compact + .listing-rows {
  margin-top: 24px;
}

.browse-back {
  margin-bottom: 12px;
}

.browse-title {
  margin-bottom: 4px;
}

.browse-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.listing-browse-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Legacy search (results page) */
.search-box { display: flex; flex-direction: column; gap: 10px; }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.chip.active {
  background: var(--chip-active-bg);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Forms */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--bg-input);
  color: var(--text-primary);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: -1px;
}

textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}

.stat-value { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  font-size: 0.85rem;
}

.data-row:last-child { border-bottom: none; }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.detail-header { text-align: center; padding: 20px 0; }
.detail-value { font-size: 2rem; font-weight: 800; direction: ltr; }

.main.listing-detail-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.listing-detail-page {
  width: 100%;
  max-width: 880px;
}

.listing-detail {
  padding: clamp(20px, 3vw, 28px);
}

.listing-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.listing-detail-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
  min-width: 0;
}

.listing-detail-stat-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-dark);
}

.listing-detail-stat-icon svg {
  width: 22px;
  height: 22px;
}

.listing-detail-stat-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.listing-detail-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.listing-detail-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.listing-detail-stat-hot {
  font-size: 0.85rem;
}

.listing-detail-countdown {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.listing-detail-countdown-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: start;
}

.listing-detail-countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.listing-detail-countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-page);
}

.listing-detail-countdown-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  direction: ltr;
}

.listing-detail-countdown-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.listing-detail-share {
  margin-top: 12px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--green-dark);
}

.listing-detail-share svg {
  width: 16px;
  height: 16px;
}

.listing-detail-bid-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.listing-detail-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}

.listing-detail-stepper-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.listing-detail-stepper-value {
  font-size: 1.1rem;
  font-weight: 700;
  direction: ltr;
}

.listing-detail-projected {
  text-align: center;
  padding: 20px 12px;
  border-radius: var(--radius);
  background: var(--bg-page);
}

.listing-detail-projected-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.listing-detail-projected-value {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
}

.listing-detail-projected-value .price-value,
.listing-detail-projected-value .price-amount .riyal-symbol {
  color: var(--green-dark);
}

.listing-detail-back {
  margin-bottom: 12px;
}

.listing-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: clamp(24px, 4vw, 40px);
  align-items: start;
}

.listing-detail-primary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.listing-detail-price-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: start;
}

.listing-detail-price-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.listing-detail-price-value {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  color: var(--text-primary);
}

.listing-detail-price-value .price-value,
.listing-detail-price-value .price-amount .riyal-symbol {
  color: var(--green-dark);
}

[data-theme="dark"] .listing-detail-price-value .price-value,
[data-theme="dark"] .listing-detail-price-value .price-amount .riyal-symbol {
  color: var(--green);
}

.listing-detail-media {
  width: fit-content;
  max-width: 100%;
}

.listing-detail-media .listing-card-media-top,
.listing-detail-media .sa-plate {
  width: min(100%, 360px);
  max-width: 360px;
  margin-inline: 0;
}

.sa-plate--detail {
  width: min(100%, 360px);
  max-width: 360px;
}

.sa-plate--detail .sa-plate-bg {
  width: 100%;
  height: auto;
  display: block;
}

.sa-plate--detail .sa-plate-ar-num .sa-plate-text-fill,
.sa-plate--detail .sa-plate-lat-num .sa-plate-text-fill {
  font-size: clamp(0.95rem, 3.8vw, 1.35rem);
}

.sa-plate--detail .sa-plate-ar-letters .sa-plate-text-fill {
  font-size: clamp(0.9rem, 3.5vw, 1.25rem);
}

.sa-plate--detail .sa-plate-lat-letters .sa-plate-text-fill {
  font-size: clamp(0.85rem, 3.2vw, 1.15rem);
}

.sa-plate--detail.sa-plate--classic .sa-plate-classic-num .sa-plate-text-fill,
.sa-plate--detail.sa-plate--classic .sa-plate-classic-letters .sa-plate-text-fill {
  font-size: clamp(1rem, 4vw, 1.4rem);
}

.listing-detail-meta .listing-meta {
  margin-top: 4px;
}

.listing-detail-phone {
  font-size: 1.75rem;
  padding: 4px 0;
}

.listing-detail-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
}

.listing-detail-side-block {
  width: 100%;
}

.listing-detail-side-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.listing-detail-card-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.listing-detail-top-icons {
  width: 100%;
}

html[dir="ltr"] .listing-detail-top-icons.listing-card-media-top--plate,
html[dir="ltr"] .listing-detail-top-icons.listing-card-media-top--phone {
  direction: rtl;
}

html[dir="rtl"] .listing-detail-top-icons.listing-card-media-top--plate,
html[dir="rtl"] .listing-detail-top-icons.listing-card-media-top--phone {
  direction: ltr;
}

.listing-detail-card-top-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.listing-detail-contact-slot {
  flex-shrink: 0;
}

.listing-detail-reveal-btn {
  white-space: nowrap;
}

.listing-detail-card-top + .listing-detail-stats {
  margin-top: 0;
}

.listing-detail-status {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 760px) {
  .listing-detail-layout {
    grid-template-columns: 1fr;
  }

  .listing-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-detail-side {
    order: 2;
  }
}

.detail-header .sa-plate {
  max-width: 100%;
  margin-bottom: 4px;
}
.detail-section { margin-top: 16px; }

.detail-section h3 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.info-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.info-item span:first-child { color: var(--text-secondary); }

.contact-reveal {
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  margin-top: 12px;
}

.contact-reveal .phone {
  font-size: 1.25rem;
  font-weight: 700;
  direction: ltr;
  color: var(--green-dark);
}

.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--black);
  color: var(--white);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  animation: toast-in .3s ease;
  pointer-events: auto;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab.active { color: var(--green); border-bottom-color: var(--green); }

.review-item { border-left: 3px solid var(--amber); }
html[dir="rtl"] .review-item { border-left: none; border-right: 3px solid var(--amber); }
.review-item.clean { border-color: var(--green); }
.review-item.needs-fix { border-color: var(--red); }

.section-links { display: grid; gap: 8px; margin-top: 12px; }

.section-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9rem;
}

.section-link:hover { border-color: var(--green); }
.section-link .arrow { color: var(--text-muted); }

.scrape-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--gray-100);
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  animation: pulse 1s infinite;
}

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

/* ─── Availability results (instant search) ─── */

.bukhmara--compact {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  margin-bottom: 8px;
}

.bukhmara--compact .bukhmara-input-wrap {
  padding: 14px 16px 6px;
}

.bukhmara--compact .bukhmara-toolbar {
  padding: 6px 10px 10px;
}

.availability-view {
  margin-top: 0;
}

.search-empty-view {
  padding-top: 8px;
}

.search-empty-title {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.search-empty-subtitle {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.search-empty-section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.search-empty-section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.search-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 20px;
}

.search-placeholder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 0;
}

.search-placeholder-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-400);
}

[data-theme="dark"] .search-placeholder-dot {
  background: #525252;
}

.search-placeholder-bar {
  flex: 1;
  min-width: 0;
  height: 28px;
  border-radius: 8px;
  background: var(--gray-100);
}

[data-theme="dark"] .search-placeholder-bar {
  background: #262626;
}

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

@media (max-width: 480px) {
  .search-placeholder-grid {
    grid-template-columns: 1fr;
  }
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-bottom: 0;
  flex-wrap: nowrap;
}

.results-meta-left {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.results-meta-rule {
  flex: 1 1 auto;
  height: 1px;
  min-width: 20px;
  background: var(--border);
}

[data-theme="dark"] .results-meta-rule {
  background: #2a2a2a;
}

.results-meta-right {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.results-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
}

.results-filters__icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.results-filters__icon svg {
  width: 18px;
  height: 18px;
}

.results-taken-track {
  display: flex;
  flex: 0 0 auto;
  width: 96px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
}

.results-taken-seg {
  display: block;
  height: 100%;
  min-width: 0;
}

.results-taken-seg--available {
  background: var(--green);
}

.results-taken-seg--taken {
  background: #ef4444;
}

.results-meta-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.results-meta-query {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-meta-count {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.results-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gray-100);
  white-space: nowrap;
}

[data-theme="dark"] .stat-pill {
  background: #262626;
}

.stat-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.stat-pill.dot-green::before { background: var(--green); }
.stat-pill.dot-amber::before { background: var(--amber); }
.stat-pill.dot-blue::before { background: #3b82f6; }
.stat-pill.dot-red::before { background: var(--red); }

.results-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
}

.results-primary-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.results-primary-value {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 800;
  color: #ef4444;
  text-decoration: none;
  direction: ltr;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

[data-theme="dark"] .results-primary-value {
  color: #f87171;
}

.results-primary-value:hover {
  text-decoration: underline;
}

.results-primary-city {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.results-primary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.results-lookup-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: #ef4444;
  border: none;
  white-space: nowrap;
  transition: background .15s, transform .1s;
}

.results-lookup-btn:hover {
  background: #dc2626;
}

[data-theme="dark"] .results-lookup-btn {
  background: #ef4444;
}

[data-theme="dark"] .results-lookup-btn:hover {
  background: #f87171;
}

.demo-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.results-cards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.results-mobile-primary,
.results-mobile-list {
  display: none;
}

.results-cards-item {
  min-width: 0;
}

.results-cards-item .listing-row-card,
.results-cards-item .card-link {
  height: 100%;
  cursor: pointer;
}

.results-cards-item--taken {
  opacity: 0.48;
}

.results-cards-item--taken:hover {
  opacity: 0.62;
}

.results-cards-item--primary .listing-card--carousel {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .results-cards-item--primary .listing-card--carousel {
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.25),
    0 10px 28px rgba(0, 0, 0, 0.4);
}

@media (min-width: 640px) {
  .results-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .results-cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.result-cell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  background: var(--bg-surface);
  text-decoration: none;
  color: inherit;
  transition: background .12s, opacity .12s;
}

.result-cell--taken {
  opacity: 0.42;
}

.result-cell--taken:hover {
  opacity: 0.55;
}

.result-cell:hover {
  background: var(--gray-100);
}

[data-theme="dark"] .result-cell:hover {
  background: #1c1c1c;
}

.result-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.result-dot.dot-green { background: var(--green); }
.result-dot.dot-amber { background: var(--amber); }
.result-dot.dot-blue { background: #3b82f6; }
.result-dot.dot-red { background: var(--red); }
.result-dot.dot-gray { background: var(--gray-400); }

.result-cell-label {
  font-weight: 600;
  font-size: 0.9rem;
  direction: ltr;
  text-align: start;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
  pointer-events: none;
}

.result-action-btn::after {
  content: '▾';
  font-size: 0.65rem;
  opacity: 0.55;
  line-height: 1;
}

.result-action-btn.action-green {
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--green-dark);
  background: var(--green-light);
}

.result-action-btn.action-amber {
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--amber);
  background: rgba(217, 119, 6, 0.1);
}

.result-action-btn.action-blue {
  border-color: rgba(59, 130, 246, 0.35);
  color: #2563eb;
  background: rgba(59, 130, 246, 0.1);
}

.result-action-btn.action-red {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--red);
  background: rgba(220, 38, 38, 0.08);
}

.result-action-btn.action-gray {
  color: var(--text-muted);
}

.results-primary .result-action-btn {
  pointer-events: auto;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 0.8rem;
}

.results-primary .result-action-btn::after {
  display: none;
}

@media (min-width: 640px) {
  .main { padding: 24px var(--site-inset) 40px; }
  .hero { padding-top: 56px; padding-bottom: 32px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .results-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ─── Mobile (reference layout) ─── */
@media (max-width: 639px) {
  .header.header--searching {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    padding-top: 10px;
    padding-bottom: 0;
  }

  .header--searching .header-search-block,
  .header--searching .header-search-top {
    display: flex;
  }

  .header--searching .header-search-block {
    flex: 1 1 100%;
    flex-direction: column;
    max-width: none;
    order: 2;
  }

  .header--searching .header-search-top {
    width: 100%;
  }

  .header--searching .logo--header-mark,
  .header--searching .header-start,
  .header--searching .header-actions,
  .header--searching .header-search-block .search-type-nav {
    grid-column: auto;
    grid-row: auto;
  }

  .header--searching .header-search-block .header-start {
    flex: 1 1 auto;
    max-width: none;
  }

  .header--searching .header-search-block .bukhmara--header {
    max-width: none;
  }

  .header--searching .header-actions {
    flex: 1 1 auto;
    order: 1;
    margin-inline-start: auto;
  }

  :root {
    --page-gutter: 16px;
  }

  .header {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header-utilities .moed,
  .header-utilities .lugha,
  .header-utilities .bookmark-util {
    display: none;
  }

  .main {
    padding-top: 12px;
  }

  .hero {
    text-align: start;
    padding: 20px 0 16px;
    max-width: none;
  }

  html[dir="rtl"] .hero {
    text-align: right;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.25rem);
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 22px;
    color: var(--text-secondary);
  }

  .home-section .listing-rows {
    display: none;
  }

  /* Wallet keeps carousel rows on mobile */
  .wallet-section .listing-rows {
    display: block;
  }

  .bukhmara {
    border: 2px solid #9333ea;
    border-radius: 16px;
    box-shadow: 0 0 24px rgba(147, 51, 234, 0.12);
    max-width: none;
  }

  [data-theme="dark"] .bukhmara {
    border-color: #a855f7;
    box-shadow: 0 0 28px rgba(168, 85, 247, 0.18);
  }

  .bukhmara-input-wrap {
    padding: 20px 16px 8px;
  }

  .bukhmara-input {
    font-size: 1.05rem;
  }

  .bukhmara-toolbar {
    padding: 8px 10px 12px;
  }

  .bukhmara-submit {
    display: none;
  }

  .bukhmara--compact {
    display: flex;
    align-items: stretch;
    gap: 10px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 4px;
  }

  .bukhmara--compact .bukhmara-body {
    flex: 1;
    border: 2px solid #9333ea;
    border-radius: 14px;
    background: var(--bukhmara-shell);
    overflow: hidden;
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.1);
  }

  [data-theme="dark"] .bukhmara--compact .bukhmara-body {
    border-color: #a855f7;
  }

  .bukhmara-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    align-self: stretch;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bukhmara-shell);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
  }

  .bukhmara-back svg {
    width: 20px;
    height: 20px;
  }

  html[dir="rtl"] .bukhmara-back svg {
    transform: scaleX(-1);
  }

  .results-meta {
    flex-wrap: wrap;
    row-gap: 10px;
    margin-bottom: 14px;
  }

  .results-meta-rule {
    display: none;
  }

  .results-meta-left {
    flex: 1 1 100%;
  }

  .results-meta-right {
    flex: 1 1 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .results-meta-right::-webkit-scrollbar {
    display: none;
  }

  .results-stats {
    display: flex;
    flex-wrap: nowrap;
  }

  .results-taken-track {
    width: 72px;
  }

  .results-cards-grid {
    display: none;
  }

  .results-mobile-primary {
    display: block;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
  }

  .results-mobile-primary .results-primary-value {
    display: block;
    margin-bottom: 12px;
  }

  .results-mobile-primary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }

  .results-mobile-primary-actions .result-action-btn {
    pointer-events: auto;
  }

  .results-mobile-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--border);
    gap: 1px;
  }

  .results-mobile-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 12px;
    background: var(--bg-surface);
    text-decoration: none;
    color: inherit;
  }

  .results-mobile-row--taken {
    opacity: 0.45;
  }

  .results-mobile-row-label {
    font-weight: 600;
    font-size: 0.88rem;
    direction: ltr;
    text-align: start;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .results-mobile-row .result-action-btn {
    pointer-events: none;
    font-size: 0.68rem;
    padding: 5px 8px 5px 10px;
  }
}

/* ─── Profile / account settings ─── */
body.profile-route .header,
body.profile-route .bottom-nav {
  display: none;
}

.main.profile-main {
  padding: 0;
  max-width: none;
}

.profile-settings-page {
  min-height: calc(100dvh - env(safe-area-inset-bottom));
  background: var(--bg-page);
}

.profile-settings-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px var(--site-inset);
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.profile-settings-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.profile-settings-done {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
}

.profile-settings-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) var(--site-inset) 48px;
}

.profile-settings-nav-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--text-primary);
}

.profile-settings-email-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

.profile-settings-email-banner-icon {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.profile-settings-email-banner-icon svg {
  width: 20px;
  height: 20px;
}

.profile-settings-email-banner-body {
  flex: 1;
  min-width: 0;
}

.profile-settings-email-banner-body p {
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.profile-settings-email-banner-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.profile-settings-email-banner-close svg {
  width: 16px;
  height: 16px;
}

.profile-settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .15s;
}

.profile-settings-nav-item:hover {
  background: var(--bg-page);
}

.profile-settings-nav-item.is-active {
  background: var(--bg-page);
  font-weight: 700;
}

.profile-settings-nav-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.profile-settings-nav-icon svg {
  width: 20px;
  height: 20px;
}

.profile-settings-nav-item--footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.profile-settings-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
  padding: 12px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--red);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
  transition: background .15s;
}

.profile-settings-logout:hover {
  background: rgba(220, 38, 38, 0.08);
}

.profile-settings-logout .profile-settings-nav-icon {
  color: var(--red);
}

.profile-settings-reset-demo {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 14px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* wallet uses .home-section listing row styles */

.wallet-row-empty {
  margin: 0;
  padding: 8px 0 4px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.wallet-add-card-link {
  height: 100%;
}

.wallet-add-card {
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 168px;
  border: 1.5px dashed var(--border-strong, rgba(0, 0, 0, 0.18));
  background: transparent;
  box-shadow: none;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

[data-theme="dark"] .wallet-add-card {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.wallet-add-card-link:hover .wallet-add-card,
.wallet-add-card-link:focus-visible .wallet-add-card {
  border-color: var(--accent, #111);
  background: var(--bg-surface);
}

.wallet-add-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  color: var(--text-primary);
}

.wallet-add-card-icon svg {
  width: 22px;
  height: 22px;
}

.wallet-add-card-label {
  margin: 0;
  max-width: 14em;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.wallet-section--chat {
  margin-top: 8px;
}

.wallet-chat-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wallet-chat-header {
  margin-bottom: 0;
}

.wallet-chat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-chat-see-more {
  align-self: flex-start;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ─── Messages inbox (Airbnb-style) ─── */
body.messages-route {
  background: var(--white);
  --text-primary: var(--black);
  --text-secondary: var(--gray-500);
  --text-muted: var(--gray-400);
  --border: var(--gray-200);
}

body.messages-route .header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  color: var(--black);
  --header-text: var(--black);
}

body.messages-route .bottom-nav {
  display: none;
}

.main.messages-main {
  padding: 0;
  max-width: none;
  background: var(--white);
}

.messages-page {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  min-height: calc(100dvh - var(--header-h, 64px));
  background: var(--white);
}

.messages-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-inline-end: 1px solid var(--border);
  background: var(--white);
}

.messages-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}

.messages-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.messages-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.messages-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.messages-icon-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

.messages-icon-btn svg {
  width: 20px;
  height: 20px;
}

.messages-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 0 20px 16px;
}

.messages-filter-all {
  position: relative;
}

.messages-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.messages-pill.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--white);
}

[data-theme="light"] .messages-pill.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

[data-theme="dark"] body.messages-route .messages-pill.active {
  background: #111;
  border-color: #111;
  color: #fff;
}

.messages-pill-chevron svg {
  width: 14px;
  height: 14px;
}

.messages-pill.active .messages-pill-chevron {
  opacity: 0.9;
}

.messages-category-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 30;
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.messages-category-menu[hidden] {
  display: none;
}

.messages-category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.messages-category-item:hover {
  background: var(--bg-muted, rgba(0, 0, 0, 0.04));
}

.messages-category-item.active {
  border-color: var(--text-primary);
  font-weight: 600;
}

.messages-category-icon {
  display: flex;
  flex: 0 0 24px;
  color: var(--text-primary);
}

.messages-category-icon svg {
  width: 22px;
  height: 22px;
}

.messages-sidebar-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.messages-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-block-end: 1px solid var(--border);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s ease;
}

.messages-item:hover,
.messages-item.active {
  background: var(--white);
  opacity: 0.92;
}

.messages-item.active {
  opacity: 1;
  box-shadow: inset 3px 0 0 var(--text-primary);
}

html[dir="rtl"] .messages-item.active {
  box-shadow: inset -3px 0 0 var(--text-primary);
}

.messages-item.unread .messages-item-name,
.messages-item.unread .messages-item-preview {
  font-weight: 700;
  color: var(--text-primary);
}

.messages-item-avatar {
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--text-secondary);
}

.messages-item-avatar svg {
  width: 24px;
  height: 24px;
}

.messages-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.messages-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.messages-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.messages-item-time {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.messages-item-listing {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.messages-item-preview {
  font-size: 0.86rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.messages-item-unread {
  flex: 0 0 auto;
  min-width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--text-primary);
}

.messages-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 28px;
  text-align: center;
}

.messages-empty-icon {
  display: flex;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.messages-empty-icon svg {
  width: 48px;
  height: 48px;
}

.messages-empty-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.messages-empty-text {
  margin: 0;
  max-width: 18em;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.messages-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--white);
}

.messages-main-empty {
  flex: 1;
  background: var(--white);
}

.messages-thread {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--white);
}

.messages-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
}

.messages-thread-back {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
}

.messages-thread-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.messages-thread-listing {
  margin: 2px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
}

a.messages-thread-listing:hover {
  text-decoration: underline;
}

.messages-thread-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--white);
}

.messages-bubble {
  max-width: min(75%, 420px);
  padding: 10px 14px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.messages-bubble p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.messages-bubble time {
  font-size: 0.68rem;
  opacity: 0.72;
}

.messages-bubble--out {
  align-self: flex-end;
  background: var(--text-primary);
  color: var(--bg-page);
}

[data-theme="light"] .messages-bubble--out {
  background: #111;
  color: #fff;
}

.messages-bubble--in {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.messages-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.messages-compose-input {
  flex: 1;
}

.messages-compose-send {
  flex: 0 0 auto;
  white-space: nowrap;
}

.messages-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
}

.messages-modal {
  width: min(100%, 400px);
  padding: 8px 0 12px;
  border-radius: 20px;
  background: var(--bg-surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.messages-modal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 16px 48px;
  border-bottom: 1px solid var(--border);
}

.messages-modal-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.messages-modal-head .messages-icon-btn {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.messages-modal-list {
  padding: 8px 0;
}

.messages-modal-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: background 0.15s ease;
}

.messages-modal-item:hover {
  background: var(--bg-muted, rgba(0, 0, 0, 0.04));
}

.messages-modal-item-icon {
  display: flex;
  color: var(--text-primary);
}

.messages-modal-item-icon svg {
  width: 22px;
  height: 22px;
}

@media (max-width: 767px) {
  .messages-page {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - var(--header-h, 56px));
  }

  .messages-page.messages-page--thread .messages-sidebar {
    display: none;
  }

  .messages-page:not(.messages-page--thread) .messages-main {
    display: none;
  }

  .messages-thread-back {
    display: inline-flex;
  }
}

.wallet-chat-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 4px 16px rgba(0, 0, 0, 0.07);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

[data-theme="dark"] .wallet-chat-item {
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 6px 20px rgba(0, 0, 0, 0.35);
}

.wallet-chat-item:hover {
  transform: translateY(-1px);
}

.wallet-chat-avatar {
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-muted, rgba(0, 0, 0, 0.06));
  color: var(--text-secondary);
}

.wallet-chat-avatar svg {
  width: 20px;
  height: 20px;
}

.wallet-chat-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wallet-chat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.wallet-chat-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.wallet-chat-time {
  flex: 0 0 auto;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.wallet-chat-listing {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.wallet-chat-preview {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallet-chat-unread {
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--text-primary);
  color: var(--bg-page);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.profile-settings-content-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  margin: 0 0 28px;
  color: var(--text-primary);
}

.profile-settings-rows {
  border-top: 1px solid var(--border);
}

.profile-settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.profile-settings-row-main {
  flex: 1;
  min-width: 0;
}

.profile-settings-row-label {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.profile-settings-row-value {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.profile-settings-row-value--ltr {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: start;
}

.profile-settings-row-hint {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.profile-settings-row-extra {
  margin-top: 10px;
}

.profile-settings-inline-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-settings-row-action {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  white-space: nowrap;
}

.profile-settings-placeholder {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 52ch;
}

@media (max-width: 760px) {
  .profile-settings-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 20px;
  }

  .profile-settings-nav-title {
    font-size: 1.15rem;
    margin-bottom: 14px;
  }

  .profile-settings-nav-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .profile-settings-nav-item {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .profile-settings-nav-item--footer {
    display: flex;
  }

  .profile-settings-logout {
    display: flex;
  }

  .profile-settings-reset-demo {
    display: none;
  }

  .profile-settings-row {
    flex-direction: column;
    gap: 12px;
    padding: 20px 0;
  }

  .profile-settings-row-action {
    align-self: flex-start;
  }
}
