html {
  font-size: 16px;
  position: relative;
  min-height: 100%;
}

:root {
  --primary: #1746a3;
  --primary-dark: #0f2d7a;
  --primary-light: #e7efff;
  --secondary: #47c42d;
  --secondary-dark: #2f941d;
  --secondary-light: #edf9e8;
  --accent: #f0b34f;
  --bg: #f7f9fc;
  --white: #ffffff;
  --text: #13213c;
  --text-light: #5f6b85;
  --border: #d9e3f2;
  --success: #47c42d;
  --warning: #f59e0b;
  --error: #ef4444;
  --surface: var(--white);
  --surface-muted: #f2f7ff;
  --shadow-soft: 0 12px 30px rgba(19, 33, 60, 0.07);
  --shadow-card: 0 18px 40px rgba(23, 70, 163, 0.1);
  --radius-sm: 0.85rem;
  --radius-md: 1.15rem;
  --radius-lg: 1.4rem;
  --radius-pill: 999px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  background:
    radial-gradient(circle at top left, rgba(23, 70, 163, 0.1), transparent 28%),
    radial-gradient(circle at top right, rgba(71, 196, 45, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 250, 251, 1)),
    var(--bg);
}

body.loading {
  overflow: hidden;
}

.container {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

p {
  margin-bottom: 0;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  line-height: 1;
}

h1,
h2,
h3,
.navbar-brand {
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 24px;
  line-height: 1.18;
}

h3 {
  font-size: 20px;
  line-height: 1.24;
}

small,
.small {
  font-size: 14px;
}

.lead,
.hero-copy p,
.page-header p,
.listing-card p {
  color: var(--text-light);
  font-size: 16px;
}

.text-muted {
  color: var(--text-light) !important;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.95), 0 0 0 0.35rem rgba(23, 70, 163, 0.18);
}

.navbar-brand {
  font-size: 20px;
  padding-inline: 0.85rem;
}

.navbar-toggler {
  border: none;
  box-shadow: none !important;
}

.navbar-toggler-icon {
  filter: hue-rotate(0deg);
}

.nav-link {
  color: var(--text) !important;
  font-size: 16px;
  font-weight: 600;
  padding: 0.8rem 0.95rem !important;
  border-radius: 0.9rem;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
  background: var(--primary-light);
  color: var(--primary-dark) !important;
}

.header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(23, 70, 163, 0.1);
  box-shadow: 0 12px 30px rgba(19, 33, 60, 0.04);
  backdrop-filter: blur(14px);
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.header .container {
  padding: 0 16px;
}

.header-shell,
.header-user-menu,
.header-secondary-nav,
.site-status-links {
  display: flex;
  align-items: center;
}

.header-shell {
  gap: 1rem;
  justify-content: space-between;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
}

.header-logo-image {
  display: block;
  width: auto;
  height: 72px;
  object-fit: contain;
}

.header-logo:hover,
.header-logo:focus {
  color: var(--text);
}

.header-search {
  flex: 1 1 420px;
  max-width: 560px;
}

.header-search-input {
  min-height: 48px;
}

.header-buy-button,
.header-sell-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.mobile-search-bar,
.mobile-bottom-nav {
  display: none;
}

.site-issue-button {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1015;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  color: var(--white);
  background: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  box-shadow: 0 18px 34px rgba(19, 33, 60, 0.22);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.site-issue-button:hover,
.site-issue-button:focus {
  color: var(--white);
  background: var(--primary-dark);
}

.site-issue-button .material-symbols-outlined {
  font-size: 1.2rem;
}

.header-user-menu {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0.75rem;
  white-space: nowrap;
}

.header-secondary-nav {
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.site-status-links {
  flex-direction: row;
  gap: 0.45rem;
  padding-left: 0;
  margin: 0;
  list-style: none;
  flex-wrap: nowrap;
}

.site-nav-links,
.site-account-panel,
.site-account-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.site-nav-links {
  flex-wrap: wrap;
}

.site-account-panel {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-account-links {
  flex-direction: row;
  padding-left: 0;
  margin: 0;
  list-style: none;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.site-status-links .nav-item,
.site-account-links .nav-item {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.site-account-links .btn-link {
  padding: 0.8rem 0.95rem;
}

.site-account-name {
  color: var(--text-light) !important;
  cursor: default;
}

.role-pill,
.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.1), rgba(71, 196, 45, 0.12));
  color: var(--primary-dark);
  border: 1px solid rgba(23, 70, 163, 0.08);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.btn {
  border-radius: 0.95rem;
  font-size: 16px;
  font-weight: 600;
  padding: 0.78rem 1.15rem;
}

.btn-primary,
.btn-secondary,
.btn-outline {
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-lg {
  padding: 0.92rem 1.35rem;
  font-size: 16px;
}

.btn-dark,
.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 1px solid rgba(15, 45, 122, 0.94);
  box-shadow: none;
}

.btn-dark:hover,
.btn-dark:focus,
.btn-primary:hover,
.btn-primary:focus {
  color: var(--white);
  background: linear-gradient(135deg, #133d92, #0c2463);
  border-color: #0c2463;
}

.btn-secondary {
  background: #f4f7fb;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--primary-light);
  border-color: rgba(23, 70, 163, 0.16);
  color: var(--primary-dark);
}

.btn-outline {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover,
.btn-outline:focus {
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.05), rgba(71, 196, 45, 0.08));
  color: var(--primary-dark);
  border-color: rgba(23, 70, 163, 0.18);
}

.btn-outline-dark {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus {
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.18);
  color: var(--primary-dark);
}

.btn-link {
  text-decoration: none;
}

.input,
.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hero-shell,
.page-shell {
  margin-top: 1.75rem;
}

.workspace-shell {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.75rem;
}

.admin-workspace-shell {
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: 6.8rem;
  display: grid;
  gap: 1rem;
}

.workspace-sidebar-card,
.hero-copy,
.hero-panel,
.filter-card,
.listing-card,
.detail-hero,
.table-card,
.form-card,
.contact-card,
.empty-state,
.metric-card,
.stack-item,
.offer-card,
.seller-panel-card,
.seller-link-card,
.page-loader-shell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.workspace-sidebar-card {
  padding: 1.35rem;
}

.workspace-sidebar-card h2 {
  margin: 0.75rem 0 0.55rem;
}

.workspace-sidebar-card p {
  color: var(--text-light);
}

.display-image {
  position: relative;
  overflow: hidden;
  border-radius: 1.15rem;
  border: 1px solid rgba(23, 70, 163, 0.14);
  background:
    radial-gradient(circle at top left, rgba(23, 70, 163, 0.12), transparent 35%),
    linear-gradient(180deg, rgba(239, 245, 255, 0.96), rgba(248, 251, 254, 0.98));
  box-shadow: var(--shadow-soft);
}

.display-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.display-image-overlay {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
}

.display-image-text,
.display-image-inline-text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.display-image-caption {
  font-size: 0.86rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
}

.display-image-hero {
  min-height: 220px;
}

.display-image-sidebar,
.display-image-banner {
  margin-bottom: 1rem;
}

.display-image-banner {
  aspect-ratio: 16 / 6;
  margin-bottom: 1.5rem;
}

.display-image-hero img,
.display-image-sidebar img,
.display-image-banner img,
.display-image-gallery img,
.display-image-card img {
  aspect-ratio: 4 / 3;
}

.display-image-banner img {
  aspect-ratio: 16 / 6;
}

.display-image-card {
  border-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}

.display-image-card .display-image-overlay {
  inset: auto 0.75rem 0.75rem 0.75rem;
  padding: 0.7rem 0.85rem;
}

.display-image-gallery {
  border: none;
  box-shadow: none;
}

.display-image-gallery .display-image-overlay {
  inset: auto 1.25rem 1.25rem 1.25rem;
}

.display-image-inline {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.display-image-inline img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.display-image-inline-text {
  position: absolute;
  inset: auto 0.5rem 0.5rem 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.65rem;
  text-align: center;
}

.workspace-sidebar-nav {
  display: grid;
  gap: 0.4rem;
}

.workspace-link {
  display: block;
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  transition: all 0.2s ease;
}

.workspace-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  transform: translateX(2px);
}

.workspace-link.is-active {
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.14), rgba(71, 196, 45, 0.14));
  color: var(--primary-dark);
}

.workspace-content {
  min-width: 0;
}

.hero-shell {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.6rem;
  align-items: stretch;
}

.hero-copy {
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.hero-copy > * {
  position: relative;
  z-index: 2;
}

.hero-copy::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -70px;
  bottom: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(23, 70, 163, 0.16), transparent 68%);
  pointer-events: none;
}

.hero-copy h1 {
  font-size: clamp(32px, 4vw, 52px);
  margin: 0.85rem 0 1.1rem;
}

.hero-actions,
.form-actions,
.favorite-actions,
.offer-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-search {
  margin-top: 1.5rem;
}

.hero-search-grid,
.search-price-grid,
.search-results-toolbar,
.pagination-shell,
.search-layout,
.stats-grid,
.offer-grid,
.seller-summary-grid,
.seller-ops-grid,
.seller-link-grid,
.seller-breakdown-grid,
.seller-kpi-row {
  display: grid;
  gap: 1rem;
}

.hero-search-grid {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.hero-panel {
  padding: 1.6rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin: 1.15rem 0;
}

.metric-card {
  padding: 1.35rem 1.4rem;
}

.metric-card span,
.seller-kpi-row span,
.seller-link-card span,
.offer-meta,
.offer-note,
.offer-history-item p,
.page-loader-shell span {
  color: var(--text-light);
}

.metric-card strong {
  font-size: 32px;
  font-weight: 600;
}

.page-header,
.section-heading,
.footer-shell,
.listing-meta,
.listing-footer,
.chat-summary-top,
.offer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-header {
  margin-bottom: 1.15rem;
}

.filter-card,
.table-card,
.form-card,
.contact-card,
.detail-hero,
.empty-state {
  padding: 1.65rem;
}

.search-form,
.search-filter-section,
.chat-thread,
.stack-list,
.offer-history-list,
.seller-shell {
  display: grid;
  gap: 1rem;
}

.search-filter-section,
.offer-panel {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.15rem;
  margin-top: 1.15rem;
}

.listing-grid > * {
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.search-results-grid {
  margin-top: 0;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.search-layout {
  grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
  align-items: start;
}

.search-results-shell {
  display: grid;
  gap: 1.15rem;
}

.search-filters-panel {
  position: sticky;
  top: 6.8rem;
  display: grid;
  gap: 1.1rem;
  align-self: start;
}

.search-panel-heading {
  align-items: flex-start;
}

.search-panel-heading h2 {
  margin: 0.7rem 0 0;
}

.search-price-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.search-filter-group {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(23, 70, 163, 0.08);
  border-radius: 1rem;
  background:
    radial-gradient(circle at top right, rgba(23, 70, 163, 0.05), transparent 42%),
    rgba(255, 255, 255, 0.82);
}

.search-filter-title {
  margin: 0;
  font-size: 1rem;
}

.search-results-panel {
  overflow: hidden;
}

.search-results-toolbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.search-sort-form {
  display: grid;
  gap: 0.55rem;
  min-width: 220px;
}

.pagination-shell {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.pagination-label,
.detail-price,
.profile-grid dt {
  color: var(--primary-dark);
  font-weight: 600;
}

.listing-card {
  overflow: hidden;
  padding: 0;
  transition: all 0.2s ease;
}

.listing-card:hover,
.seller-link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(17, 24, 39, 0.1);
  border-color: rgba(23, 70, 163, 0.18);
}

.listing-card-media-link {
  display: block;
  overflow: hidden;
}

.listing-card img,
.listing-card .display-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  display: block;
  background: #eff6ff;
  transition: all 0.2s ease;
}

.listing-card:hover img,
.listing-card:focus-within img,
.listing-card:hover .display-image img,
.listing-card:focus-within .display-image img {
  transform: scale(1.03);
}

.listing-card-body {
  display: grid;
  gap: 0.8rem;
  padding: 1.35rem;
}

.listing-card h3,
.detail-hero h1,
.detail-hero h2,
.offer-card-head h2,
.seller-panel-card h2 {
  margin: 0;
}

.price {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
}

.location {
  margin: 0;
  color: var(--text-light);
  font-size: 0.98rem;
}

.listing-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 16px;
}

.listing-footer {
  margin-top: 1.4rem;
  align-items: end;
}

.favorite-actions form {
  margin: 0;
}

.btn-favorite,
.btn-favorite-active,
.badge,
.status {
  border-radius: var(--radius-pill);
  padding: 0.55rem 0.85rem;
  font-weight: 600;
}

.btn-favorite {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.btn-favorite:hover,
.btn-favorite:focus {
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.16);
  color: #92400e;
}

.btn-favorite-active {
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.btn-favorite-active:hover,
.btn-favorite-active:focus {
  border-color: var(--secondary);
  background: rgba(16, 185, 129, 0.18);
  color: #065f46;
}

.category-child-badge {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  border: 1px solid rgba(23, 70, 163, 0.16);
  border-radius: var(--radius-pill);
  padding: 0.45rem 0.75rem;
  background: rgba(231, 239, 255, 0.88);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.category-child-badge:hover,
.category-child-badge:focus {
  border-color: rgba(23, 70, 163, 0.3);
  background: rgba(231, 239, 255, 1);
  color: var(--primary-dark);
}

.detail-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.listing-detail-shell,
.listing-detail-sections,
.listing-gallery-strip,
.listing-summary-meta,
.listing-detail-highlights {
  display: grid;
  gap: 1rem;
}

.listing-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.listing-gallery-card,
.listing-summary-card,
.listing-seller-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.listing-gallery-card,
.listing-summary-card {
  padding: 1.4rem;
}

.listing-gallery-hero {
  overflow: hidden;
  border-radius: 1.15rem;
  background:
    radial-gradient(circle at top left, rgba(23, 70, 163, 0.1), transparent 38%),
    linear-gradient(180deg, #eff5ff, #f8fafc);
  border: 1px solid rgba(23, 70, 163, 0.08);
}

.listing-gallery-hero img,
.listing-gallery-thumb img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.listing-gallery-hero img {
  aspect-ratio: 4 / 3;
}

.listing-gallery-hero .display-image {
  height: 100%;
}

.listing-gallery-strip {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-top: 1rem;
}

.listing-gallery-thumb {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: #fff;
}

.listing-gallery-thumb.is-primary {
  border-color: rgba(23, 70, 163, 0.28);
  box-shadow: 0 10px 24px rgba(23, 70, 163, 0.12);
}

.listing-gallery-thumb img {
  aspect-ratio: 1 / 1;
}

.listing-summary-card {
  display: grid;
  gap: 1.2rem;
}

.listing-summary-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.listing-summary-top h2,
.listing-seller-card h3 {
  margin: 0.8rem 0 0;
}

.listing-summary-price {
  font-size: clamp(2rem, 3vw, 2.6rem);
}

.listing-summary-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  color: var(--text-light);
  font-size: 0.98rem;
}

.listing-summary-meta span,
.listing-seller-stats span {
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.05), rgba(71, 196, 45, 0.08));
  border: 1px solid rgba(23, 70, 163, 0.08);
}

.listing-summary-actions {
  margin-top: 0;
}

.listing-summary-actions > * {
  flex: 1 1 180px;
}

.listing-summary-actions .btn,
.listing-summary-actions form,
.listing-summary-actions a,
.listing-summary-actions button {
  width: 100%;
}

.listing-detail-highlights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.listing-detail-highlights div {
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid var(--border);
}

.listing-detail-highlights span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-light);
  font-size: 0.9rem;
}

.listing-detail-highlights strong {
  display: block;
  font-size: 1rem;
}

.listing-detail-section {
  padding: 1.65rem;
}

.listing-detail-description {
  white-space: pre-line;
  color: var(--text);
}

.listing-seller-card {
  display: grid;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
}

.listing-seller-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.detail-hero-single {
  grid-template-columns: 1fr;
}

.detail-price {
  font-size: 32px;
}

.contact-card dl,
.profile-grid {
  display: grid;
  gap: 0.8rem 1rem;
  margin: 0;
}

.contact-card dl {
  grid-template-columns: auto 1fr;
}

.profile-grid {
  grid-template-columns: minmax(140px, auto) 1fr;
}

.profile-grid dd,
.contact-card dd {
  margin: 0;
  color: var(--text-light);
}

.contact-card dt {
  font-weight: 600;
}

.form-control,
.form-select,
textarea.form-control {
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  padding: 0.9rem 1rem;
  font-size: 16px;
  color: var(--text);
}

.form-control::placeholder,
.form-select::placeholder {
  color: #9ca3af;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.55rem;
  color: var(--text);
}

.table-card .table {
  margin-bottom: 0;
}

.table-responsive {
  overflow-x: auto;
}

.table > :not(caption) > * > * {
  padding: 1rem 0.9rem;
  background: transparent;
  border-bottom-color: var(--border);
  vertical-align: middle;
}

.table thead th {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tbody tr:hover {
  background: rgba(37, 99, 235, 0.035);
}

.status {
  border: none;
}

.status-draft {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.status-pendingapproval {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary-dark);
}

.status-approved,
.status-published,
.alert-success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.status-paused {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.status-sold {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

.status-rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.status-deleted {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.stack-item,
.offer-history-item {
  padding: 1rem 1.05rem;
  border-radius: var(--radius-md);
}

.empty-state {
  text-align: center;
  min-height: 240px;
  display: grid;
  place-items: center;
}

.alert {
  border: none;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}

.site-footer {
  margin-top: auto;
  padding: 2.2rem 0 2.6rem;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.03), rgba(37, 99, 235, 0.08)),
    rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(229, 231, 235, 0.96);
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 1.4rem;
  padding: 1.6rem 1.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 250, 251, 0.98));
  box-shadow: var(--shadow-card);
}

.footer-brand strong,
.footer-links h3 {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 20px;
  color: var(--text);
  font-weight: 600;
}

.footer-brand p,
.footer-links a,
.footer-bottom {
  color: var(--text-light);
}

.footer-links {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.footer-links a {
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0 0.2rem;
  font-size: 14px;
}

.chat-summary-top {
  align-items: flex-start;
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.chat-sidebar,
.chat-main-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.chat-sidebar {
  position: sticky;
  top: 6.8rem;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.chat-sidebar-header,
.chat-list-item-top,
.chat-main-header,
.chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.chat-sidebar-header {
  align-items: flex-start;
}

.chat-sidebar-header h2,
.chat-main-header h2,
.chat-list-item h3 {
  margin: 0;
}

.chat-sidebar-count,
.chat-unread-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
}

.chat-sidebar-count {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
}

.chat-unread-pill {
  background: #111827;
  color: #fff;
}

.chat-list {
  display: grid;
  gap: 0.85rem;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.chat-list-item {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: 1.2rem;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.07), transparent 36%),
    #ffffff;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.chat-list-item:hover,
.chat-list-item:focus {
  color: var(--text);
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 16px 32px rgba(17, 24, 39, 0.08);
}

.chat-list-item.is-active {
  border-color: rgba(37, 99, 235, 0.28);
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.12);
}

.chat-list-item p {
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  color: var(--text-light);
  font-size: 0.92rem;
}

.chat-main-shell {
  min-width: 0;
}

.chat-main-card {
  padding: 1.35rem;
  display: grid;
  gap: 1.25rem;
  min-height: 42rem;
}

.chat-main-header {
  align-items: flex-start;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.chat-main-header p {
  color: var(--text-light);
}

.chat-message-stream {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  min-height: 24rem;
}

.chat-message-row {
  display: flex;
  justify-content: flex-start;
}

.chat-message-row.is-mine {
  justify-content: flex-end;
}

.message {
  max-width: min(680px, 100%);
  background: #F3F4F6;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.chat-message-row.is-mine .message {
  background: linear-gradient(180deg, rgba(219, 234, 254, 1), rgba(239, 246, 255, 1));
  border-color: rgba(37, 99, 235, 0.12);
}

.chat-message-meta {
  align-items: flex-start;
  margin-bottom: 0.45rem;
  color: var(--text-light);
  font-size: 0.85rem;
}

.message p {
  margin: 0;
  white-space: pre-line;
  color: var(--text);
}

.chat-main-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.chat-reference-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.06);
}

.chat-empty-panel {
  min-height: 100%;
}

.chat-summary-card,
.chat-bubble,
.offer-card,
.offer-history-item,
.offer-thread-item {
  border: 1px solid var(--border);
}

.chat-thread {
  display: flex;
  flex-direction: column;
}

.chat-bubble {
  max-width: 100%;
  border-radius: 1.2rem;
  padding: 1rem 1.1rem;
}

.chat-bubble-mine {
  background: rgba(37, 99, 235, 0.06);
  margin-left: 2rem;
}

.chat-bubble-other {
  background: var(--white);
  margin-right: 2rem;
}

.chat-thread-card {
  min-height: 26rem;
}

.offer-card {
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.offer-card-head {
  align-items: flex-start;
}

.offer-card-head h2 {
  font-size: 20px;
}

.offer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1rem;
  font-size: 16px;
}

.offer-note {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: #f8fafc;
}

.offer-form-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
  align-items: end;
}

.offer-form-note {
  grid-column: span 2;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.dashboard-sidebar-card,
.dashboard-nav-link {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.dashboard-sidebar {
  position: sticky;
  top: 6.8rem;
}

.dashboard-sidebar-card {
  padding: 1.3rem;
  display: grid;
  gap: 1rem;
}

.dashboard-sidebar-card h2,
.dashboard-nav-link strong,
.dashboard-nav-link span {
  margin: 0;
}

.dashboard-nav {
  display: grid;
  gap: 0.85rem;
}

.dashboard-nav-link {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 1.05rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.dashboard-nav-link span {
  color: var(--text-light);
}

.dashboard-nav-link:hover,
.dashboard-nav-link:focus {
  transform: translateY(-2px);
  color: var(--text);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.1);
}

.dashboard-nav-link.is-active {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(239, 246, 255, 0.98), rgba(255, 255, 255, 0.98));
  border-color: rgba(37, 99, 235, 0.24);
}

.dashboard-content {
  display: grid;
  gap: 1rem;
}

.seller-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.seller-ops-grid {
  grid-template-columns: 1.3fr 1fr;
}

.seller-link-grid,
.seller-breakdown-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.seller-panel-card,
.seller-link-card {
  border-radius: var(--radius-lg);
}

.seller-panel-card {
  padding: 1.55rem;
}

.seller-panel-card-highlight {
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 253, 248, 0.98));
}

.seller-kpi-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1rem 0 1.2rem;
}

.seller-kpi-row div {
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
}

.seller-kpi-row strong,
.seller-link-card strong {
  display: block;
  font-weight: 600;
}

.seller-link-card {
  padding: 1.15rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
}

.seller-link-card:hover {
  color: var(--primary-dark);
}

.seller-profile-shell,
.seller-profile-header,
.seller-profile-identity,
.seller-profile-copy,
.seller-profile-actions,
.seller-profile-meta,
.seller-rating-section,
.seller-rating-score,
.seller-rating-list {
  display: grid;
  gap: 1rem;
}

.seller-profile-shell {
  gap: 1.15rem;
}

.seller-profile-header,
.seller-rating-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.seller-profile-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 1.8rem;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 255, 0.98));
}

.seller-profile-identity {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
}

.seller-profile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(16, 185, 129, 0.18)),
    #eff6ff;
  color: var(--primary-dark);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.14);
}

.seller-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seller-profile-avatar .display-image-inline {
  border-radius: 50%;
  overflow: hidden;
}

.seller-profile-copy h1,
.seller-rating-card h2 {
  margin: 0;
}

.seller-profile-meta {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.seller-profile-meta span,
.seller-rating-list div {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(37, 99, 235, 0.08);
  color: var(--text-light);
}

.seller-profile-actions {
  justify-items: end;
  align-content: center;
}

.seller-profile-actions .btn {
  min-width: 220px;
}

.seller-rating-section {
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(220px, 1fr));
}

.seller-rating-card {
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
}

.seller-rating-card-primary {
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 235, 0.98));
}

.seller-rating-score {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  margin-top: 0.8rem;
}

.seller-rating-score strong {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
}

.seller-rating-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  color: rgba(17, 24, 39, 0.16);
  font-size: 1.4rem;
}

.seller-rating-stars .is-filled {
  color: #f59e0b;
}

.seller-rating-score p,
.seller-rating-card p,
.seller-rating-list dd {
  margin: 0;
  color: var(--text-light);
}

.seller-rating-list {
  margin: 1rem 0 0;
}

.seller-rating-list div {
  display: grid;
  gap: 0.35rem;
}

.seller-rating-list dt {
  color: var(--primary-dark);
  font-weight: 600;
}

.seller-profile-listing-grid .listing-card {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.05), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.page-loader {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.18);
  backdrop-filter: blur(8px);
  z-index: 2000;
}

.page-loader.is-visible {
  display: flex;
}

.page-loader-shell {
  min-width: 220px;
  padding: 1.4rem 1.5rem;
  text-align: center;
  display: grid;
  gap: 0.45rem;
}

.page-loader-spinner {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.35rem;
  border: 3px solid rgba(37, 99, 235, 0.16);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 991.98px) {
  .header {
    padding-inline: 16px;
  }

  .header-shell {
    flex-wrap: wrap;
  }

  .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .hero-shell,
  .detail-hero,
  .listing-detail-main,
  .search-layout,
  .chat-layout,
  .dashboard-layout,
  .admin-workspace-shell,
  .seller-summary-grid,
  .seller-ops-grid,
  .seller-rating-section,
  .seller-profile-header {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding: 2rem;
  }

  .page-header,
  .section-heading,
  .footer-shell,
  .listing-footer,
  .search-results-toolbar,
  .offer-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-shell {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-sidebar {
    position: static;
  }

  .search-filters-panel {
    position: static;
  }

  .chat-sidebar {
    position: static;
  }

  .dashboard-sidebar {
    position: static;
  }

  .seller-profile-actions {
    justify-items: start;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .btn,
  .btn-lg,
  .favorite-actions,
  .favorite-actions form,
  .search-sort-form {
    width: 100%;
  }

  .btn {
    justify-content: center;
  }

  .hero-search-grid,
  .search-price-grid,
  .pagination-shell,
  .offer-form-inline,
  .chat-main-footer {
    grid-template-columns: 1fr;
  }

  .listing-summary-meta,
  .listing-detail-highlights,
  .listing-seller-stats {
    grid-template-columns: 1fr;
  }

  .offer-form-note {
    grid-column: auto;
  }

  .site-account-panel {
    justify-content: flex-start;
  }

  .header-user-menu {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: 6.5rem;
  }

  .header {
    padding-inline: 12px;
  }

  .container {
    padding-inline: 12px;
  }

  .hero-copy,
  .hero-panel,
  .filter-card,
  .listing-card,
  .detail-hero,
  .table-card,
  .form-card,
  .contact-card,
  .empty-state,
  .workspace-sidebar-card,
  .footer-shell {
    border-radius: 1.2rem;
  }

  .footer-shell {
    grid-template-columns: 1fr;
    padding: 1.3rem;
  }

  .site-nav-links,
  .site-account-panel,
  .site-account-links,
  .site-status-links,
  .header-user-menu {
    align-items: stretch;
  }

  .header-shell {
    align-items: stretch;
  }

  .header-logo,
  .header-buy-button,
  .header-sell-button,
  .header-search {
    width: 100%;
    max-width: none;
  }

  .header-search,
  .header-secondary-nav,
  .header-user-menu .role-pill,
  .header-user-menu .site-status-links,
  .footer-shell,
  .footer-bottom,
  .page-header p,
  .hero-copy p,
  .metric-card p,
  .home-category-card p,
  .home-trust-card p,
  .search-results-toolbar p,
  .empty-state p,
  .chat-list-item p,
  .listing-card p {
    display: none;
  }

  .header-shell {
    gap: 0.75rem;
  }

  .header-logo {
    font-size: 1.35rem;
  }

  .header-buy-button,
  .header-sell-button,
  .site-account-links .nav-link,
  .site-account-links .btn-link,
  .mobile-bottom-link,
  .mobile-search-button,
  .form-actions .btn,
  .favorite-actions .btn,
  .offer-actions .btn {
    min-height: 3.25rem;
  }

  .mobile-search-bar {
    display: block;
    margin-top: 0.75rem;
  }

  .mobile-search-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 0.65rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
    backdrop-filter: blur(12px);
  }

  .mobile-search-input {
    min-height: 3.25rem;
    border-radius: 0.9rem;
  }

.mobile-search-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-inline: 1.1rem;
}

  .header-secondary-nav {
    gap: 0.15rem;
  }

  .profile-grid,
  .contact-card dl {
    grid-template-columns: 1fr;
  }

  .seller-profile-identity,
  .seller-rating-score {
    grid-template-columns: 1fr;
  }

  .seller-profile-avatar {
    width: 88px;
    height: 88px;
  }

  .seller-profile-actions .btn {
    min-width: 0;
  }

  .listing-summary-top {
    flex-direction: column;
  }

  .chat-summary-top {
    flex-direction: column;
  }

  .chat-sidebar,
  .chat-main-card {
    padding: 1rem;
  }

  .chat-main-header,
  .chat-list-item-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-bubble-mine,
  .chat-bubble-other {
    margin-left: 0;
    margin-right: 0;
  }

  .home-hero {
    margin-top: 1rem;
  }

  .home-hero-points,
  .stats-grid,
  .listing-grid,
  .search-results-grid,
  .search-layout,
  .listing-detail-shell,
  .listing-detail-main,
  .listing-detail-sections,
  .home-category-grid,
  .home-trust-grid,
  .chat-layout,
  .dashboard-layout,
  .seller-summary-grid,
  .seller-ops-grid,
  .seller-breakdown-grid,
  .seller-kpi-row,
  .admin-workspace-shell,
  .hero-shell,
  .page-header,
  .section-heading,
  .search-results-toolbar,
  .listing-footer,
  .offer-card-head,
  .footer-shell {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .page-header,
  .section-heading,
  .search-results-toolbar,
  .listing-footer,
  .offer-card-head {
    align-items: stretch;
  }

  .hero-copy,
  .hero-panel,
  .filter-card,
  .listing-card,
  .detail-hero,
  .table-card,
  .form-card,
  .contact-card,
  .empty-state,
  .workspace-sidebar-card,
  .chat-sidebar,
  .chat-main-card {
    padding: 1rem;
  }

  .page-header {
    margin-bottom: 0.75rem;
  }

  .page-header h1,
  .page-header h2,
  .hero-copy h1,
  .hero-copy h2,
  .listing-summary-top h2,
  .chat-main-header h2 {
    margin-bottom: 0;
    font-size: clamp(1.5rem, 6vw, 1.9rem);
  }

  .hero-actions,
  .form-actions,
  .favorite-actions,
  .offer-actions,
  .listing-summary-actions,
  .search-sort-form {
    width: 100%;
    gap: 0.75rem;
  }

  .search-filters-panel,
  .workspace-sidebar,
  .chat-sidebar,
  .dashboard-sidebar {
    position: static;
    top: auto;
  }

  .search-form,
  .search-filter-section,
  .stack-list,
  .offer-history-list,
  .seller-shell,
  .chat-message-stream {
    gap: 0.85rem;
  }

  .search-filter-group,
  .listing-meta,
  .listing-summary-meta,
  .listing-detail-highlights,
  .listing-seller-stats,
  .chat-list-item-meta {
    gap: 0.65rem;
  }

  .search-results-panel .eyebrow,
  .search-filters-panel .eyebrow,
  .metric-card span,
  .home-category-label,
  .home-category-meta,
  .home-hero-points span {
    font-size: 0.75rem;
  }

  .listing-grid,
  .search-results-grid,
  .home-category-grid,
  .home-trust-grid {
    margin-top: 0.85rem;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.4rem;
    padding: 0.75rem 0.65rem calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -14px 35px rgba(17, 24, 39, 0.08);
    backdrop-filter: blur(12px);
  }

  .site-issue-button {
    right: 0.75rem;
    bottom: calc(5.8rem + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
  }

  .site-issue-button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .mobile-bottom-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.7rem 0.35rem;
    border-radius: 1rem;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    background: transparent;
  }

  .mobile-bottom-link.is-active {
    color: var(--primary-dark);
    background: var(--primary-light);
  }

  .mobile-bottom-link .material-symbols-outlined {
    font-size: 1.25rem;
  }

  .mobile-bottom-link-primary {
    color: var(--white);
    background: var(--primary);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
  }

  .mobile-bottom-link-primary.is-active {
    color: var(--white);
    background: var(--primary-dark);
  }
}

.home-hero {
  margin-top: 2rem;
}

.home-hero-copy {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(239, 246, 255, 0.18));
}

.home-hero-copy::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, 0.58) 0%, rgba(15, 23, 42, 0.34) 48%, rgba(255, 255, 255, 0.08) 100%);
  pointer-events: none;
  z-index: 1;
}

.home-search-grid {
  grid-template-columns: minmax(0, 1fr) 140px;
}

.home-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.home-hero-points span,
.home-listing-badge,
.home-category-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
}

.home-hero-points span {
  color: var(--primary-dark);
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.home-hero-panel {
  display: grid;
  gap: 1rem;
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 253, 250, 0.98));
}

.home-hero-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.home-hero-slide.is-active {
  opacity: 1;
}

.home-hero-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.home-hero-copy-inner {
  position: relative;
  z-index: 2;
}

.home-hero-copy .eyebrow,
.home-hero-copy h1,
.home-hero-copy p {
  color: #ffffff;
}

.home-hero-copy .eyebrow {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.home-search {
  padding: 0.85rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(10px);
}

.home-search .form-control {
  background: rgba(255, 255, 255, 0.96);
}

.home-hero-slider-dots {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.home-hero-slider-dots button {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  transition: transform 0.2s ease, background 0.2s ease;
}

.home-hero-slider-dots button.is-active {
  background: #ffffff;
  transform: scale(1.14);
}

.home-metric-card {
  min-height: 0;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.82);
}

.home-metric-card p {
  margin-top: 0.55rem;
  color: var(--text-light);
}

.home-section {
  margin-top: 2rem;
}

.home-category-grid,
.home-trust-grid {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.15rem;
}

.home-category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-category-card,
.home-trust-card {
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
}

.home-category-card {
  display: grid;
  gap: 0.75rem;
  padding: 1.35rem;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.home-category-card:hover,
.home-category-card:focus {
  color: var(--primary-dark);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px rgba(17, 24, 39, 0.08);
  border-color: rgba(23, 70, 163, 0.22);
}

.home-category-card h3,
.home-trust-card h3 {
  margin: 0;
}

.home-category-card p,
.home-trust-card p {
  color: var(--text-light);
}

.home-category-label {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-category-meta {
  justify-self: center;
  color: var(--secondary-dark);
  background: rgba(71, 196, 45, 0.12);
  border: 1px solid rgba(71, 196, 45, 0.18);
}

.home-listing-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.home-listing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.home-listing-badge {
  color: #92400e;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.home-listing-badge-fresh {
  color: #065f46;
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.2);
}

.home-trust-section {
  background:
    radial-gradient(circle at top right, rgba(23, 70, 163, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(237, 249, 232, 0.82));
  border-radius: var(--radius-lg);
  padding: 1.6rem;
}

.home-trust-header {
  margin-bottom: 0;
}

.home-trust-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.home-trust-card {
  padding: 1.35rem;
}

@media (max-width: 991.98px) {
  .home-search-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .home-trust-section {
    padding: 1.2rem;
  }

  .home-listing-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Strict spacing system: 8 / 16 / 24 / 40 */
.container {
  padding-block: var(--space-16);
  padding-inline: 8px;
}

.header {
  padding-block: var(--space-8);
  padding-inline: 8px;
}

.header .container {
  padding-block: 0;
  padding-inline: 8px;
}

.header-shell,
.header-user-menu,
.site-status-links,
.site-nav-links,
.site-account-panel,
.site-account-links,
.hero-actions,
.form-actions,
.favorite-actions,
.offer-actions,
.hero-search-grid,
.search-price-grid,
.search-results-toolbar,
.pagination-shell,
.search-layout,
.stats-grid,
.offer-grid,
.seller-summary-grid,
.seller-ops-grid,
.seller-link-grid,
.seller-breakdown-grid,
.seller-kpi-row,
.search-form,
.search-filter-section,
.chat-thread,
.stack-list,
.offer-history-list,
.seller-shell,
.listing-detail-shell,
.listing-detail-sections,
.listing-gallery-strip,
.listing-summary-meta,
.listing-detail-highlights,
.seller-profile-shell,
.seller-profile-header,
.seller-profile-identity,
.seller-profile-copy,
.seller-profile-actions,
.seller-profile-meta,
.seller-rating-section,
.seller-rating-score,
.seller-rating-list,
.home-hero-panel {
  gap: var(--space-16);
}

.header-secondary-nav,
.workspace-sidebar-nav,
.search-sort-form,
.dashboard-nav,
.home-hero-points,
.home-category-card,
.home-listing-top {
  gap: var(--space-8);
}

.site-account-links .btn-link,
.nav-link,
.workspace-link,
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-lg,
.input,
.form-control,
.form-select,
textarea.form-control,
.table > :not(caption) > * > *,
.stack-item,
.offer-history-item,
.alert,
.dashboard-nav-link,
.seller-profile-meta span,
.seller-rating-list div,
.listing-summary-meta span,
.listing-seller-stats span,
.listing-detail-highlights div,
.search-filter-group,
.mobile-bottom-link,
.home-hero-points span,
.home-listing-badge,
.home-category-meta {
  padding: var(--space-16);
}

.role-pill,
.eyebrow,
.btn-favorite,
.btn-favorite-active,
.badge,
.status,
.chat-list-item-badge,
.mobile-search-shell {
  padding: var(--space-8) var(--space-16);
}

.workspace-sidebar-card,
.metric-card,
.listing-card-body,
.listing-seller-card,
.offer-card,
.dashboard-sidebar-card,
.seller-link-card,
.home-category-card,
.home-trust-card,
.home-trust-section,
.page-loader-shell {
  padding: var(--space-24);
}

.hero-copy {
  padding: var(--space-40);
}

.hero-panel,
.filter-card,
.table-card,
.form-card,
.contact-card,
.detail-hero,
.empty-state,
.listing-gallery-card,
.listing-summary-card,
.listing-detail-section,
.footer-shell,
.chat-sidebar,
.chat-main-card,
.seller-panel-card,
.seller-rating-card {
  padding: var(--space-24);
}

.hero-shell,
.workspace-shell,
.listing-grid,
.search-results-shell,
.seller-profile-shell,
.home-category-grid,
.home-trust-grid {
  gap: var(--space-24);
}

.hero-shell,
.page-shell,
.workspace-shell,
.home-hero,
.home-section {
  margin-top: var(--space-24);
}

.page-header,
.search-results-grid,
.listing-grid,
.home-category-grid,
.home-trust-grid,
.hero-actions,
.form-actions,
.favorite-actions,
.offer-actions,
.hero-search,
.home-hero-points,
.seller-rating-list {
  margin-top: var(--space-24);
}

.page-header {
  margin-bottom: var(--space-24);
}

.listing-footer,
.search-filter-section,
.offer-panel {
  margin-top: var(--space-24);
}

.site-footer {
  padding: var(--space-24) 0 var(--space-40);
}

.footer-shell {
  gap: var(--space-24);
}

.footer-links,
.footer-brand {
  display: grid;
  gap: var(--space-8);
}

.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo-image {
  display: block;
  width: auto;
  height: 84px;
  object-fit: contain;
}

.mobile-search-bar {
  margin-top: var(--space-8);
}

.mobile-bottom-nav {
  gap: var(--space-8);
  padding: var(--space-8) var(--space-8) calc(var(--space-8) + env(safe-area-inset-bottom));
}

.mobile-bottom-link {
  gap: var(--space-8);
}

@media (max-width: 767.98px) {
  .header-logo-image {
    height: 58px;
  }

  .footer-logo-image {
    height: 72px;
  }

  .header {
    padding-inline: 6px;
  }

  .container {
    padding-inline: 6px;
  }

  .header-shell,
  .hero-actions,
  .form-actions,
  .favorite-actions,
  .offer-actions,
  .search-form,
  .search-filter-section,
  .stack-list,
  .offer-history-list,
  .seller-shell,
  .chat-message-stream,
  .search-filter-group,
  .listing-meta,
  .listing-summary-meta,
  .listing-detail-highlights,
  .listing-seller-stats,
  .chat-list-item-meta,
  .home-hero-points {
    gap: var(--space-8);
  }

  .hero-copy,
  .hero-panel,
  .filter-card,
  .listing-card,
  .detail-hero,
  .table-card,
  .form-card,
  .contact-card,
  .empty-state,
  .workspace-sidebar-card,
  .chat-sidebar,
  .chat-main-card,
  .footer-shell,
  .home-trust-section,
  .home-category-card,
  .home-trust-card {
    padding: var(--space-16);
  }

  .page-header,
  .listing-grid,
  .search-results-grid,
  .home-category-grid,
  .home-trust-grid {
    margin-top: var(--space-16);
    margin-bottom: 0;
  }
}

/* Final design rules enforcement: clean cards, consistent spacing, strong hierarchy, clear CTAs, mobile-first, visible trust indicators */
:root {
  --font-size-sm: 14px;
  --control-height: 48px;
}

.page-header p,
.hero-copy p,
.search-results-toolbar p,
.seller-panel-card p,
.listing-detail-description,
.chat-bubble p {
  max-width: 62ch;
}

.eyebrow,
.role-pill,
.metric-card span,
.home-category-label,
.home-category-meta,
.home-hero-points span,
.mobile-bottom-link span:last-child,
.small,
small {
  font-size: var(--font-size-sm);
}

.btn,
.btn-dark,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-outline-dark,
.btn-outline-secondary,
.btn-danger,
.btn-favorite,
.btn-favorite-active {
  min-height: var(--control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.1rem;
  border-radius: 1rem;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
}

.btn-secondary {
  background: #f8fafc;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.08), rgba(71, 196, 45, 0.1));
  color: var(--text);
  border-color: rgba(23, 70, 163, 0.18);
}

.btn-outline-dark,
.btn-outline-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline-dark:hover,
.btn-outline-dark:focus,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.07), rgba(71, 196, 45, 0.08));
  color: var(--primary-dark);
  border-color: rgba(23, 70, 163, 0.22);
}

.btn-danger {
  background: #dc2626;
  border-color: #dc2626;
  color: var(--white);
}

.btn-danger:hover,
.btn-danger:focus {
  background: #b91c1c;
  border-color: #b91c1c;
  color: var(--white);
}

.form-control,
.form-select {
  min-height: 52px;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 16px;
}

textarea.form-control {
  min-height: 120px;
}

.page-header,
.search-results-toolbar,
.listing-footer {
  align-items: flex-end;
}

.search-filter-group {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.search-filter-group .form-label,
.search-sort-form .form-label {
  margin-bottom: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.listing-card,
.filter-card,
.table-card,
.form-card,
.contact-card,
.seller-profile-header,
.seller-rating-card,
.chat-sidebar,
.chat-main-card,
.dashboard-sidebar-card,
.dashboard-nav-link,
.home-category-card,
.home-trust-card {
  border-radius: 1.25rem;
}

.listing-card {
  border-color: rgba(17, 24, 39, 0.08);
}

.listing-card-body {
  gap: 1rem;
}

.listing-card h3 {
  font-size: 1.2rem;
  line-height: 1.3;
}

.price {
  font-size: 1.35rem;
}

.listing-meta,
.listing-summary-meta,
.listing-detail-highlights,
.seller-profile-meta,
.listing-seller-stats,
.chat-list-item-meta {
  gap: 0.75rem;
}

.listing-meta span,
.listing-summary-meta span,
.listing-detail-highlights div,
.seller-profile-meta span,
.listing-seller-stats span,
.chat-reference-card,
.chat-list-item-meta span {
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(248, 250, 252, 0.94);
  border-radius: 1rem;
  padding: 0.7rem 0.85rem;
  color: var(--text);
}

.listing-footer {
  gap: 1rem;
}

.favorite-actions,
.offer-actions {
  margin-top: 0;
}

.favorite-actions .btn,
.offer-actions .btn,
.hero-actions .btn,
.form-actions .btn {
  min-width: 132px;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(23, 70, 163, 0.14);
  background: linear-gradient(135deg, rgba(239, 245, 255, 0.9), rgba(237, 249, 232, 0.88));
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 600;
}

.search-trust-strip {
  margin-bottom: 0.25rem;
}

.favorites-trust-strip {
  margin-bottom: 1rem;
}

.app-dialog-modal .modal-dialog {
  width: min(620px, calc(100vw - 1.5rem));
}

.app-dialog-content {
  overflow: hidden;
  border: 1px solid rgba(23, 70, 163, 0.14);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(23, 70, 163, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.99));
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
}

.app-dialog-header,
.app-dialog-footer {
  border-color: rgba(17, 24, 39, 0.08);
  padding: 1.1rem 1.25rem;
}

.app-dialog-header {
  align-items: flex-start;
}

.app-dialog-title {
  margin: 0.45rem 0 0;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.app-dialog-eyebrow {
  min-height: 0;
}

.app-dialog-body {
  padding: 0;
}

.app-dialog-message {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 1.35rem;
}

.app-dialog-message strong,
.app-dialog-message p {
  grid-column: 2;
}

.app-dialog-message p {
  color: var(--text-light);
}

.app-dialog-icon {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  color: var(--primary-dark);
  background: linear-gradient(135deg, rgba(23, 70, 163, 0.1), rgba(71, 196, 45, 0.12));
  border: 1px solid rgba(23, 70, 163, 0.14);
  font-size: 1.35rem;
  font-weight: 700;
}

.app-dialog-icon.is-danger {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.18);
}

.records-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(23, 70, 163, 0.1);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(239, 245, 255, 0.78), rgba(237, 249, 232, 0.72));
}

.records-summary {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
}

.records-size-control {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.records-size-control .form-select {
  min-height: 42px;
  width: auto;
  padding: 0.55rem 2.25rem 0.55rem 0.8rem;
  border-radius: 0.8rem;
}

.records-scroll {
  max-height: min(70vh, 980px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 0.25rem;
}

.table-card.records-scroll {
  padding-right: calc(var(--space-24) - 0.25rem);
}

.records-scroll::-webkit-scrollbar {
  width: 0.75rem;
}

.records-scroll::-webkit-scrollbar-thumb {
  border: 0.18rem solid transparent;
  border-radius: 999px;
  background: rgba(23, 70, 163, 0.35);
  background-clip: content-box;
}

.records-scroll::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 991.98px) {
  .page-header,
  .search-results-toolbar,
  .listing-footer,
  .seller-profile-header {
    align-items: stretch;
  }

  .hero-actions,
  .form-actions,
  .favorite-actions,
  .offer-actions {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .page-header,
  .search-results-toolbar,
  .listing-footer {
    flex-direction: column;
  }

  .hero-actions .btn,
  .form-actions .btn,
  .favorite-actions .btn,
  .offer-actions .btn,
  .listing-summary-actions .btn,
  .chat-main-header .btn {
    width: 100%;
  }

  .search-filter-group,
  .trust-strip span,
  .listing-meta span,
  .listing-summary-meta span,
  .seller-profile-meta span,
  .listing-seller-stats span,
  .chat-reference-card,
  .chat-list-item-meta span {
    padding: 0.8rem 0.9rem;
  }

  .records-toolbar,
  .records-size-control {
    align-items: stretch;
    flex-direction: column;
  }

  .records-size-control .form-select {
    width: 100%;
  }

}

/* Metric cards: separate labels from values so counts read as deliberate badges. */
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.metric-card {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: 0.85rem;
  min-height: 126px;
  overflow: hidden;
  border-color: rgba(23, 70, 163, 0.12);
  background:
    radial-gradient(circle at top right, rgba(23, 70, 163, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 0.28rem;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  opacity: 0.9;
}

.metric-card::after {
  content: "";
  position: absolute;
  width: 7rem;
  height: 7rem;
  right: -3.5rem;
  bottom: -3.8rem;
  z-index: -1;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
}

.metric-card span {
  display: block;
  max-width: calc(100% - 4.65rem);
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.metric-card strong {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.65rem;
  height: 3.65rem;
  border: 1px solid rgba(23, 70, 163, 0.18);
  border-radius: 50%;
  color: #0f172a;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.98), transparent 42%),
    linear-gradient(135deg, rgba(231, 239, 255, 0.96), rgba(237, 249, 232, 0.92));
  box-shadow: 0 14px 28px rgba(23, 70, 163, 0.16);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
}

.metric-card p {
  margin: 0;
  padding-right: 0.5rem;
  color: var(--text-light);
  line-height: 1.55;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(23, 70, 163, 0.22);
  box-shadow: 0 22px 46px rgba(17, 24, 39, 0.1);
}

.listing-preview-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.listing-preview-stats .metric-card {
  min-height: 118px;
  padding: 1.2rem 1.25rem;
}

.listing-preview-stats .metric-card span {
  max-width: none;
}

.listing-preview-stats .metric-card strong {
  position: static;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-align: left;
}

.listing-media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
}

.listing-media-tile {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.08);
}

.listing-media-tile.is-primary {
  border-color: rgba(23, 70, 163, 0.36);
}

.listing-media-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f8fafc;
}

.listing-media-tile figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.8rem 0.85rem;
  color: var(--text-light);
  font-size: 0.86rem;
}

.listing-media-tile figcaption strong {
  color: var(--text);
  font-size: 0.92rem;
}

.stats-grid .metric-card:nth-child(3n + 2)::before {
  background: linear-gradient(180deg, var(--secondary), var(--accent));
}

.stats-grid .metric-card:nth-child(3n)::before {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

.home-metric-card {
  min-height: 146px;
  align-content: center;
  border-color: rgba(71, 196, 45, 0.18);
  background:
    radial-gradient(circle at top right, rgba(71, 196, 45, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
}

.home-metric-card p {
  max-width: 36rem;
}

.home-metric-card:nth-child(2)::before {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

.home-metric-card:nth-child(3)::before {
  background: linear-gradient(180deg, var(--secondary), var(--primary));
}

@media (max-width: 767.98px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 116px;
  }

  .metric-card span {
    max-width: calc(100% - 4rem);
    font-size: 0.74rem;
  }

  .metric-card strong {
    width: 3.1rem;
    height: 3.1rem;
    font-size: 1.35rem;
  }
}
