/*
 * АС МАСТЕР 0.4 · guest-only legacy presentation adapter.
 * PHP must add both body classes only after the legacy-shell gate passes.
 * Existing templates, form fields, actions and body-level modals stay in place.
 * No selectors target .hp-icon, body-level .hp-modal or authenticated accounts.
 */

/* Contain the confirmed theme wrappers, including its narrow-screen widths. */
body.am-interface-page.am-legacy-page > .site-container,
body.am-interface-page.am-legacy-page #content.site-content {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.am-interface-page.am-legacy-page > .site-container {
  padding-right: 0 !important;
  padding-left: 0 !important;
  background: var(--am-surface);
}

body.am-interface-page.am-legacy-page #content.site-content {
  padding: 28px 0 40px !important;
  background: var(--am-surface);
  color: var(--am-ink);
  font-family: var(--am-font);
  font-size: 15px;
  line-height: 1.6;
}

body.am-interface-page.am-legacy-page #content.site-content > .container,
body.am-interface-page.am-legacy-page > .site-container > .site-header > .container_cat_header,
body.am-interface-page.am-legacy-page > footer.site-footer > .container {
  box-sizing: border-box;
  float: none !important;
  width: 100% !important;
  max-width: var(--am-content-width) !important;
  min-width: 0 !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding-right: 32px !important;
  padding-left: 32px !important;
}

body.am-interface-page.am-legacy-page #content > .container > .content-area,
body.am-interface-page.am-legacy-page #content > .container > .page__text,
body.am-interface-page.am-legacy-page #content .content-area > .hp-page.site-main {
  box-sizing: border-box;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

/* Hide only confirmed obsolete brand/menu leaves, never the actions ancestor. */
body.am-interface-page.am-legacy-page > .site-container > .site-header .logo_dest,
body.am-interface-page.am-legacy-page > .site-container > .site-header .logo_txtlg > .header-navbar__start,
body.am-interface-page.am-legacy-page > .site-container > .site-header .text_header_navbar_center,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__burger,
body.am-interface-page.am-legacy-page > .site-container > .site-header nav.header-navbar__menu,
body.am-interface-page.am-legacy-page > footer.site-footer .footer_flex_item1 .header_logo_box {
  display: none !important;
}

/* Native add action, utility links and advanced GET search remain visible. */
body.am-interface-page.am-legacy-page > .site-container > header.site-header {
  position: static !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 18px 0 0 !important;
  border: 0;
  background: var(--am-surface);
  box-shadow: none;
  color: var(--am-ink);
  font-family: var(--am-font);
}

body.am-interface-page.am-legacy-page > .site-container > .site-header > .container_cat_header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar,
body.am-interface-page.am-legacy-page > .site-container > .site-header .logo_txtlg,
body.am-interface-page.am-legacy-page > .site-container > .site-header .tx_logo_nav,
body.am-interface-page.am-legacy-page > .site-container > .site-header .user_nav,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__end {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  box-sizing: border-box;
  flex: 0 1 auto;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .online_users {
  position: static !important;
  inset: auto !important;
  flex: 0 1 auto;
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  height: auto !important;
  margin: 0 !important;
  color: var(--am-muted);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  margin: 0 !important;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions > a,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions > button,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions > div.hp-menu.hp-menu--site-header.hp-menu--main > button.hp-menu__item.hp-menu__item--listing-submit.button.button--secondary,
body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form button[type="submit"],
body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form input[type="submit"] {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 10px 16px;
  border: 1px solid var(--am-blue);
  border-radius: 11px;
  background: var(--am-blue);
  color: var(--am-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions > div.hp-menu.hp-menu--site-header.hp-menu--main {
  width: auto !important;
  max-width: 100%;
  min-width: 0;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions > div.hp-menu.hp-menu--site-header.hp-menu--main > button.hp-menu__item.hp-menu__item--listing-submit.button.button--secondary {
  width: auto !important;
  min-width: 0 !important;
  min-height: 44px !important;
  white-space: normal !important;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__actions > div.hp-menu.hp-menu--site-header.hp-menu--main > button.hp-menu__item.hp-menu__item--listing-submit.button.button--secondary span {
  display: inline !important;
  white-space: normal;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__center {
  display: flex !important;
  flex: 1 1 300px;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 16px;
  box-sizing: border-box;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  border: 0 !important;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  transform: none !important;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__center a {
  color: var(--am-blue) !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-underline-offset: 3px;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header_navbar_center_item {
  box-sizing: border-box;
  display: inline-flex !important;
  flex: 0 1 auto !important;
  align-items: center;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  transform: none !important;
  color: var(--am-blue) !important;
  text-align: left;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__center::before,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__center::after,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header_navbar_center_item::before,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header_navbar_center_item::after {
  display: none !important;
  content: none !important;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .home_search_section {
  box-sizing: border-box;
  flex: 1 1 100%;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 10px;
  border: 1px solid var(--am-line);
  border-radius: 14px;
  background: var(--am-white);
}

body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form > :not(input[type="hidden"]) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form .search-form-wrapper,
body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form .search-form-wrapper {
  box-sizing: border-box;
  display: flex !important;
  flex: 1 1 100%;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form input[name="s"] {
  flex: 1 1 280px;
  width: auto !important;
  min-width: 0 !important;
  min-height: 44px;
  margin: 0;
  padding: 10px 13px;
  border: 1px solid #dce4ee;
  border-radius: 10px;
  background: #fafbfd;
  color: var(--am-heading);
  font-family: var(--am-font);
  font-size: 16px;
  line-height: 1.5;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title {
  box-sizing: border-box;
  width: 100% !important;
  max-width: var(--am-content-width) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 24px auto 0 !important;
  padding: 0 32px !important;
  background: transparent;
  color: var(--am-heading);
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title h1,
body.am-interface-page.am-legacy-page #content h1.hp-page__title,
body.am-interface-page.am-legacy-page #content h1.hp-listing__title {
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--am-heading);
  font-family: var(--am-font);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.9px;
  overflow-wrap: anywhere;
}

/* The confirmed native title has its own nested Bootstrap containers/offset. */
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title > .header-hero__content,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title > .header-hero__content > .container,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title > .header-hero__content > .container > .row,
body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title > .header-hero__content > .container > .row > .col-sm-8.col-sm-offset-2.col-xs-12 {
  box-sizing: border-box;
  float: none !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title h1.page__title.entry-title {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  margin-right: 0 !important;
  margin-left: 0 !important;
  text-align: left !important;
}

/* Catalog: adapt the confirmed card grid, keeping links/favourites intact. */
body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-page--categories-by-mode,
body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-page--categories-by-mode > .container {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listings_grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding: 0;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listings_grid > .hp-category-card {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0;
  border: 1px solid var(--am-line);
  border-radius: 18px;
  background: var(--am-white);
  box-shadow: none;
  color: var(--am-ink);
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__image {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 17px 17px 0 0;
  background: #edf2f8;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__image img {
  display: block;
  max-width: 100%;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__image .listing-category-badge {
  max-width: calc(100% - 28px);
  border-radius: 8px;
  background: var(--am-blue) !important;
  color: var(--am-white) !important;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listing-favorite a.favorite-toggle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__content {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 20px;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__title {
  margin: 0 0 12px;
  color: var(--am-heading);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__title a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__title a:hover {
  color: var(--am-blue);
  text-decoration: underline;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
  margin-bottom: 10px;
  color: var(--am-muted);
  font-size: 13px;
  line-height: 1.5;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listing-excerpt {
  min-width: 0;
  margin-bottom: 0;
  color: var(--am-muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card .author-link,
body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card .listing-excerpt a {
  color: var(--am-blue) !important;
}

/* Native listing columns remain native; surfaces and widths are bounded. */
body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-page.site-main > .hp-row.hp-listing--view-page {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing--view-page > .hp-page__content,
body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing--view-page > .hp-page__sidebar {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing__attributes--primary.widget,
body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing__actions--primary.widget,
body.am-interface-page.am-legacy-page.am-legacy-listing #content article.hp-vendor--view-block,
body.am-interface-page.am-legacy-page.am-legacy-listing #content article.hp-listing--view-block {
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid var(--am-line);
  border-radius: 16px;
  background: var(--am-white);
  box-shadow: none;
  color: var(--am-ink);
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing__attributes--primary.widget,
body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing__actions--primary.widget {
  padding: 20px;
}

body.am-interface-page.am-legacy-page.am-legacy-listing #content h2.title.title--center,
body.am-interface-page.am-legacy-page.am-legacy-listing #content h2.hp-section__title {
  color: var(--am-heading);
  font-family: var(--am-font);
  font-size: 25px;
  font-weight: 680;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Native HivePress guest login only; preserve its fields, messages and actions. */
body.am-interface-page.am-legacy-page.am-legacy-login #content .hp-page.site-main > .hp-row {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.am-interface-page.am-legacy-page.am-legacy-login #content .hp-page__content.hp-col-sm-4.hp-col-sm-offset-4.hp-col-xs-12 {
  box-sizing: border-box;
  float: none !important;
  flex: 0 1 520px;
  width: 100% !important;
  max-width: 520px !important;
  min-width: 0 !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding: 28px;
  border: 1px solid var(--am-line);
  border-radius: 18px;
  background: var(--am-white);
}

body.am-interface-page.am-legacy-page.am-legacy-login #content form.hp-form--user-login {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0;
}

body.am-interface-page.am-legacy-page #content form.hp-form .hp-form__field {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body.am-interface-page.am-legacy-page #content form.hp-form .hp-form__field > label,
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form .login-username > label,
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form .login-password > label {
  display: block;
  margin-bottom: 7px;
  color: var(--am-heading);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

body.am-interface-page.am-legacy-page #content form.hp-form input.hp-field:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"]),
body.am-interface-page.am-legacy-page #content form.hp-form textarea.hp-field,
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="text"],
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="password"] {
  box-sizing: border-box;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 48px;
  height: auto;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #dce4ee;
  border-radius: 12px;
  background: #fafbfd;
  box-shadow: none;
  color: var(--am-heading);
  font-family: var(--am-font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: normal;
  scroll-margin-top: 120px;
  scroll-margin-bottom: calc(var(--am-mobile-height) + 24px + env(safe-area-inset-bottom));
}

body.am-interface-page.am-legacy-page #content form.hp-form textarea.hp-field {
  min-height: 120px;
  resize: vertical;
}

body.am-interface-page.am-legacy-page #content form.hp-form input.hp-field:is([type="text"], [type="email"], [type="password"], [type="search"], [type="tel"], [type="url"], [type="number"]):focus,
body.am-interface-page.am-legacy-page #content form.hp-form textarea.hp-field:focus,
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="text"]:focus,
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="password"]:focus {
  border-color: var(--am-blue);
  background: var(--am-white);
}

body.am-interface-page.am-legacy-page #content form.hp-form input.hp-field[aria-invalid="true"],
body.am-interface-page.am-legacy-page #content form.hp-form textarea.hp-field[aria-invalid="true"] {
  border-color: #b42318;
}

body.am-interface-page.am-legacy-page #content form.hp-form input[type="checkbox"],
body.am-interface-page.am-legacy-page #content form.hp-form input[type="radio"],
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="checkbox"] {
  accent-color: var(--am-blue);
}

body.am-interface-page.am-legacy-page #content form.hp-form button[type="submit"],
body.am-interface-page.am-legacy-page #content form.hp-form input[type="submit"],
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="submit"] {
  box-sizing: border-box;
  min-height: 46px;
  max-width: 100%;
  padding: 11px 18px;
  border: 1px solid var(--am-blue);
  border-radius: 11px;
  background: var(--am-blue);
  box-shadow: none;
  color: var(--am-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: normal;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
}

body.am-interface-page.am-legacy-page #content form.hp-form :is(button, input)[type="submit"]:disabled,
body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="submit"]:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

body.am-interface-page.am-legacy-page #content :focus-visible,
body.am-interface-page.am-legacy-page > .site-container > .site-header :focus-visible,
body.am-interface-page.am-legacy-page > footer.site-footer :focus-visible {
  outline: 3px solid var(--am-blue);
  outline-offset: 3px;
}

/* Better Messages guest form: its native POST and redirect remain untouched. */
body.am-interface-page.am-legacy-page.am-legacy-chat #content .bm-login-form {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 520px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 28px !important;
  border: 1px solid var(--am-line) !important;
  border-radius: 18px;
  background: var(--am-white) !important;
  color: var(--am-ink);
}

body.am-interface-page.am-legacy-page.am-legacy-chat #content .bm-login-text {
  margin: 0 0 22px;
  color: var(--am-heading);
  font-size: 17px;
  line-height: 1.5;
}

body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form {
  width: 100%;
  min-width: 0;
  margin: 0;
}

body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form > p {
  margin: 0 0 18px;
}

body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form > .login-submit {
  margin-bottom: 0;
}

body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form .login-remember label {
  color: var(--am-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Native search has its own body form as well as the retained header form. */
body.am-interface-page.am-legacy-page.am-legacy-search #content main.search-page,
body.am-interface-page.am-legacy-page.am-legacy-search #content main.search-page > .container,
body.am-interface-page.am-legacy-page.am-legacy-search #content main.search-page > .home_search_section,
body.am-interface-page.am-legacy-page.am-legacy-search #content main.search-page > .home_search_section > .container {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content main.search-page > .home_search_section {
  margin-top: 0;
  margin-bottom: 24px;
  background: transparent;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--am-line);
  border-radius: 14px;
  background: var(--am-white);
}

body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form > :not(input[type="hidden"]) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form input[name="s"] {
  box-sizing: border-box;
  flex: 1 1 280px;
  width: auto !important;
  min-width: 0 !important;
  min-height: 46px;
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #dce4ee;
  border-radius: 11px;
  background: #fafbfd;
  color: var(--am-heading);
  font-family: var(--am-font);
  font-size: 16px;
  line-height: 1.5;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form button[type="submit"],
body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form input[type="submit"] {
  box-sizing: border-box;
  min-height: 46px;
  max-width: 100%;
  margin: 0;
  padding: 11px 18px;
  border: 1px solid var(--am-blue);
  border-radius: 11px;
  background: var(--am-blue);
  color: var(--am-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-page h1.page-title {
  margin: 0 0 16px;
  color: var(--am-heading);
  font-family: var(--am-font);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-info {
  margin-bottom: 22px;
  color: var(--am-muted);
  font-size: 14px;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content article.search-result-card {
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0;
  border: 1px solid var(--am-line);
  border-radius: 18px;
  background: var(--am-white);
  box-shadow: none;
  color: var(--am-ink);
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-image {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 17px 17px 0 0;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-image img {
  display: block;
  max-width: 100%;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-image .post-type-badge {
  max-width: calc(100% - 28px);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-content {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 20px;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-title {
  margin: 0 0 12px;
  color: var(--am-heading);
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-title a {
  color: inherit;
  text-underline-offset: 3px;
}

body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-meta {
  color: var(--am-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* Preserve the native footer menu, copyright, social links and contacts. */
body.am-interface-page.am-legacy-page > footer.site-footer {
  box-sizing: border-box;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 26px 0 !important;
  border-top: 1px solid var(--am-line);
  background: var(--am-white);
  color: var(--am-muted);
  font-family: var(--am-font);
  font-size: 13px;
  line-height: 1.6;
}

body.am-interface-page.am-legacy-page > footer.site-footer .footer_flex {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px 30px;
  min-width: 0;
}

body.am-interface-page.am-legacy-page > footer.site-footer .footer_flex_item1,
body.am-interface-page.am-legacy-page > footer.site-footer .footer_flex_item2 {
  box-sizing: border-box;
  flex: 1 1 280px;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0;
  overflow-wrap: anywhere;
}

body.am-interface-page.am-legacy-page > footer.site-footer .footer-navbar > ul,
body.am-interface-page.am-legacy-page > footer.site-footer .footer-navbar > div > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

body.am-interface-page.am-legacy-page > footer.site-footer a {
  max-width: 100%;
  color: var(--am-blue);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* A parent section is a location, not the current page's exact URL. */
body.am-interface-page.am-legacy-page .am-nav-link[aria-current="location"] {
  color: var(--am-blue);
}

body.am-interface-page.am-legacy-page .am-desktop-nav .am-nav-link[aria-current="location"] {
  border-bottom-color: var(--am-blue);
  font-weight: 650;
}

body.am-interface-page.am-legacy-page .am-sections-panel .am-nav-link[aria-current="location"] {
  background: var(--am-blue-soft);
  color: var(--am-blue);
}

/* Existing shell handles mobile navigation; do not overlay a second panel. */
@media (max-width: 900px) {
  body.am-interface-page.am-legacy-page .am-mobile-nav .am-nav-link[aria-current="location"] {
    background: #f4f8ff;
    color: var(--am-blue);
  }

  body.am-interface-page.am-legacy-page .am-mobile-nav .am-nav-link[aria-current="location"]::before {
    position: absolute;
    top: 0;
    left: calc(50% - 9px);
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--am-blue);
    content: "";
  }

  body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listings_grid,
  body.am-interface-page.am-legacy-page.am-legacy-search #content .search-results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 600px) {
  body.am-interface-page.am-legacy-page #content.site-content > .container,
  body.am-interface-page.am-legacy-page > .site-container > .site-header > .container_cat_header,
  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title,
  body.am-interface-page.am-legacy-page > footer.site-footer > .container {
    padding-right: 16px !important;
    padding-left: 16px !important;
  }

  body.am-interface-page.am-legacy-page #content.site-content {
    padding-top: 22px !important;
    padding-bottom: 28px !important;
    font-size: 14px;
  }

  body.am-interface-page.am-legacy-page > .site-container > header.site-header {
    padding-top: 14px !important;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header > .container_cat_header {
    gap: 12px;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar,
  body.am-interface-page.am-legacy-page > .site-container > .site-header .logo_txtlg,
  body.am-interface-page.am-legacy-page > .site-container > .site-header .tx_logo_nav,
  body.am-interface-page.am-legacy-page > .site-container > .site-header .user_nav,
  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__end {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-navbar__center {
    flex-basis: 100%;
    gap: 7px 13px;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form {
    padding: 8px;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header form.advanced-search-form input[name="s"] {
    flex-basis: 100%;
    width: 100% !important;
  }

  body.am-interface-page.am-legacy-page.am-legacy-search #content form.advanced-search-form input[name="s"] {
    flex-basis: 100%;
    width: 100% !important;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title {
    margin-top: 22px !important;
  }

  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title h1,
  body.am-interface-page.am-legacy-page #content h1.hp-page__title,
  body.am-interface-page.am-legacy-page #content h1.hp-listing__title {
    font-size: 30px;
    letter-spacing: -0.6px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listings_grid,
  body.am-interface-page.am-legacy-page.am-legacy-search #content .search-results-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-catalog #content .listings_grid > .hp-category-card,
  body.am-interface-page.am-legacy-page.am-legacy-search #content article.search-result-card {
    border-radius: 15px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__image,
  body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-image {
    border-radius: 14px 14px 0 0;
  }

  body.am-interface-page.am-legacy-page.am-legacy-catalog #content .hp-category-card__content,
  body.am-interface-page.am-legacy-page.am-legacy-search #content .search-result-content {
    padding: 18px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-search #content .search-page h1.page-title {
    font-size: 28px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing--view-page > .hp-page__content,
  body.am-interface-page.am-legacy-page.am-legacy-listing #content .hp-listing--view-page > .hp-page__sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  body.am-interface-page.am-legacy-page.am-legacy-listing #content h2.title.title--center,
  body.am-interface-page.am-legacy-page.am-legacy-listing #content h2.hp-section__title {
    font-size: 23px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-login #content .hp-page__content.hp-col-sm-4.hp-col-sm-offset-4.hp-col-xs-12,
  body.am-interface-page.am-legacy-page.am-legacy-chat #content .bm-login-form {
    padding: 22px 18px !important;
    border-radius: 15px;
  }

  body.am-interface-page.am-legacy-page.am-legacy-login #content form.hp-form--user-login button[type="submit"],
  body.am-interface-page.am-legacy-page.am-legacy-chat #content #bm-login-form input[type="submit"] {
    width: 100%;
  }

  body.am-interface-page.am-legacy-page > footer.site-footer {
    padding-top: 22px !important;
    padding-bottom: 22px !important;
  }
}

@media (max-width: 365px) {
  body.am-interface-page.am-legacy-page #content.site-content > .container,
  body.am-interface-page.am-legacy-page > .site-container > .site-header > .container_cat_header,
  body.am-interface-page.am-legacy-page > .site-container > .site-header .header-hero--title,
  body.am-interface-page.am-legacy-page > footer.site-footer > .container {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }
}

@media (forced-colors: active) {
  body.am-interface-page.am-legacy-page .am-nav-link[aria-current="location"] {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }
}
