:root {
  --am-ink: #16202a;
  --am-muted: #647180;
  --am-line: #dce3e8;
  --am-surface: #ffffff;
  --am-soft: #f4f7f8;
  --am-accent: #0f766e;
  --am-accent-dark: #0b5d57;
}

.am-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 64px;
  color: var(--am-ink);
}

.am-hero {
  margin-bottom: 24px;
}

.am-hero h1,
.am-detail h1,
.am-chat h1 {
  margin: 10px 0;
  line-height: 1.15;
}

.am-back,
.am-card a,
.am-panel a,
.am-facets a {
  color: var(--am-accent-dark);
}

.am-filters {
  padding: 20px;
  margin-bottom: 28px;
  border: 1px solid var(--am-line);
  border-radius: 16px;
  background: var(--am-surface);
  box-shadow: 0 8px 28px rgba(22, 32, 42, 0.06);
}

.am-filters__main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.am-filters label,
.am-chat__form label,
.am-actions label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

.am-filters input,
.am-filters select,
.am-chat textarea,
.am-chat input,
.am-actions select,
.am-actions textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #bac6ce;
  border-radius: 9px;
  color: var(--am-ink);
  background: #fff;
}

.am-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 15px;
  border: 1px solid var(--am-accent);
  border-radius: 9px;
  color: var(--am-accent-dark);
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.am-button--primary {
  color: #fff !important;
  background: var(--am-accent);
}

.am-button--primary:hover {
  background: var(--am-accent-dark);
}

.am-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

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

.am-card,
.am-panel,
.am-message {
  border: 1px solid var(--am-line);
  border-radius: 15px;
  background: var(--am-surface);
  box-shadow: 0 6px 22px rgba(22, 32, 42, 0.05);
}

.am-card {
  overflow: hidden;
}

.am-card__media {
  display: grid;
  min-height: 210px;
  place-items: center;
  color: var(--am-muted);
  background: var(--am-soft);
}

.am-card__media img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.am-card__body {
  padding: 18px;
}

.am-card h2 {
  margin: 5px 0 12px;
  font-size: 1.2rem;
}

.am-card__link {
  font-weight: 700;
}

.am-kicker,
.am-muted,
.am-location {
  color: var(--am-muted);
}

.am-kicker {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.am-price {
  font-size: 1.25rem;
  font-weight: 800;
}

.am-empty {
  grid-column: 1 / -1;
  padding: 40px;
  border-radius: 14px;
  text-align: center;
  background: var(--am-soft);
}

.am-notice {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 9px;
}

.am-notice--error {
  color: #8b1e1e;
  background: #fff0f0;
}

.am-pagination,
.am-facets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 22px 0;
}

.am-pagination a,
.am-facets a {
  padding: 8px 12px;
  border: 1px solid var(--am-line);
  border-radius: 999px;
  text-decoration: none;
  background: #fff;
}

.am-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.85fr);
  gap: 24px;
  margin-top: 20px;
}

.am-detail__aside {
  align-self: start;
  position: sticky;
  top: 18px;
}

.am-panel {
  padding: 22px;
  margin-bottom: 20px;
}

.am-panel h2 {
  margin-top: 0;
}

.am-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.am-gallery figure {
  margin: 0;
}

.am-gallery__cover {
  grid-column: 1 / -1;
}

.am-gallery img {
  display: block;
  width: 100%;
  height: 230px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--am-soft);
}

.am-gallery__cover img {
  height: min(520px, 55vw);
}

.am-data {
  margin: 0;
}

.am-data > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--am-line);
}

.am-data dt {
  color: var(--am-muted);
}

.am-data dd {
  margin: 0;
  font-weight: 650;
}

.am-actions form,
.am-actions details {
  margin-top: 14px;
}

.am-actions details form {
  display: grid;
  gap: 12px;
}

.am-chat {
  max-width: 850px;
}

.am-chat__messages {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.am-message {
  width: min(78%, 620px);
  padding: 15px;
}

.am-message--own {
  justify-self: end;
  background: #eaf7f5;
}

.am-message header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--am-muted);
  font-size: 0.85rem;
}

.am-message img {
  display: block;
  max-width: 100%;
  max-height: 460px;
  border-radius: 10px;
}

.am-chat__form {
  display: grid;
  gap: 10px;
}

.am-form-status {
  min-height: 1.4em;
  color: var(--am-muted);
}

@media (max-width: 850px) {
  .am-grid,
  .am-filters__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .am-detail__layout {
    grid-template-columns: 1fr;
  }

  .am-detail__aside {
    position: static;
  }
}

@media (max-width: 560px) {
  .am-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 22px;
  }

  .am-grid,
  .am-filters__main,
  .am-gallery {
    grid-template-columns: 1fr;
  }

  .am-gallery__cover {
    grid-column: auto;
  }

  .am-card__media,
  .am-card__media img {
    min-height: 185px;
    height: 185px;
  }

  .am-message {
    width: 88%;
  }
}
