header,
main {
  max-width: 1380px;
}

.category-grid a::before {
  content: none;
}

.category-grid a {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 112px;
}

.category-grid a strong { font-size: 14px; }
.category-grid a small { color: var(--muted); font-weight: 500; }
.category-grid a:hover small { color: #c5d0d4; }
.category-grid.home-category-grid {
  grid-template-columns: repeat(6, minmax(156px, 1fr));
  overflow-x: auto;
  padding: 4px;
}

.home-category-grid a {
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  justify-items: start;
  min-height: 100px;
  gap: 10px;
  padding: 12px;
  border-color: #e4e4e4;
  border-radius: 18px;
  color: #171717;
  text-align: start;
}

.home-category-label {
  display: grid;
  gap: 3px;
  overflow-wrap: anywhere;
}

.home-category-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  background: #f5f5f5;
  color: #171717;
}

.home-category-grid a:hover,
.home-category-grid a:focus-visible {
  border-color: #171717;
  background: #171717;
  color: #fff;
  transform: none;
  box-shadow: none;
}

.home-category-grid a:hover small,
.home-category-grid a:focus-visible small {
  color: #e0e0e0;
}

.home-category-grid a:focus-visible {
  outline: 2px solid #171717;
  outline-offset: 2px;
}
.listing-modal-trigger { white-space: nowrap; }

.listing-modal {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 26px;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 80px #11192355;
  color: var(--ink);
}

.listing-modal::backdrop { background: #071116aa; backdrop-filter: blur(5px); }
.listing-modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.listing-modal-heading span { color: var(--brand-dark); font-size: 13px; font-weight: 700; }
.listing-modal-heading h2 { margin: 4px 0 0; }
.listing-modal-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #edf2f4; color: var(--ink); font-size: 26px; cursor: pointer; }
.listing-modal-form { display: grid; gap: 13px; margin-top: 20px; }
.listing-modal-form label { display: grid; gap: 7px; font-size: 14px; }
.listing-modal-form input,
.listing-modal-form textarea,
.listing-modal-form select { width: 100%; padding: 11px; border: 1px solid #cdd9df; border-radius: 9px; background: #fff; font: inherit; }
.listing-modal-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.listing-modal-actions { display: flex; gap: 10px; margin-top: 5px; }
body:has(.listing-modal[open]) { overflow: hidden; }

@media (max-width: 900px) {
  header { height: auto; min-height: 76px; gap: 16px; padding-block: 10px; }
  header nav { justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; }
}

@media (max-width: 650px) {
  header { align-items: flex-start; }
  .brand img { max-width: 115px; }
  header:not(.market-header) nav > a:not(.btn), header .welcome { display: none; }
  .hero { padding: 30px 20px; border-radius: 20px; }
  .hero h1 { font-size: clamp(28px, 9vw, 38px); }
  .heading { align-items: flex-start; gap: 14px; }
  .heading h2 { font-size: 21px; }
  .account { margin-block: 24px; padding: 22px; }
  .listing-modal { padding: 20px; }
  .listing-modal-fields { grid-template-columns: 1fr; }
  .listing-modal-actions > * { flex: 1; }
  .card img { height: 180px; }
}

@media (max-width: 390px) {
  header, main, footer { padding-inline: 12px; }
  .category-grid { grid-template-columns: 1fr 1fr; }
  .category-grid a { padding-inline: 6px; }
  .listing-modal-trigger { padding: 9px 11px; }
}
.listing-card-actions.primary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-radius: 11px;
}

.listing-card-actions > a {
  display: grid;
  place-items: center;
  padding: 11px 6px;
  color: inherit;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: center;
}

.listing-card-actions > a:is(:hover, :focus-visible) {
  text-decoration: underline;
}

.listing-card-actions > a:first-child {
  justify-items: start;
  padding-inline-start: 12px;
  text-align: start;
}

.listing-card-actions > a:last-child {
  justify-items: end;
  padding-inline-end: 12px;
  text-align: end;
}
