/* Контур агентств: вход и кабинет (B2B-HOTELS).
   Цвета, радиусы и тени — токены из b2b.css; здесь только раскладка. */

/* ---------------------------------------------------------------- вход --- */
.agency-split {
  display: flex;
  flex-wrap: wrap;
  min-height: 100vh;
}
/* b2b.css задаёт <main> сетку и ширину бекофиса — здесь они не нужны. */
.agency-form-side {
  flex: 1 1 420px;
  max-width: none;
  margin: 0;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agency-form-box {
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 22px;
}
.agency-brand {
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.agency-brand span { color: var(--primary); }
.agency-title {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 680;
  margin: 0;
}
.agency-lead {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 8px;
}
.agency-form {
  display: grid;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.agency-form label {
  font-size: 13px;
  color: var(--ink-2);
}
.agency-form input[type="text"],
.agency-form input[type="password"] {
  font-size: 16px;            /* 16px — iOS не увеличивает страницу при фокусе */
  padding: 12px 13px;
  min-height: 48px;
}
.agency-form .btn.primary {
  min-height: 48px;
  font-size: 16px;
}
.agency-form label.agency-check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  min-height: 28px;
  cursor: pointer;
}
.agency-check input {
  width: 18px;
  height: 18px;
  padding: 0;
  flex: 0 0 18px;
}
.agency-note {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

.agency-aside {
  flex: 1 1 420px;
  background: #131a24;
  color: #ffffff;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agency-aside-box {
  width: 100%;
  max-width: 460px;
  display: grid;
  gap: 30px;
}
.agency-aside h2 {
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 680;
  margin: 0;
  color: #ffffff;
}
.agency-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}
.agency-steps li {
  display: flex;
  gap: 16px;
}
.agency-step-num {
  flex: 0 0 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #1e2733;
  color: #7ab4ff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agency-step-title { font-weight: 620; font-size: 16px; }
.agency-step-text { color: #b3bdcd; font-size: 14px; line-height: 1.5; }
@media (prefers-color-scheme: dark) {
  .agency-aside { background: #0b1017; }
}

/* ------------------------------------------------------------- кабинет --- */
.agency-who {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
  min-width: 0;
}
.agency-who strong {
  font-weight: 620;
  font-size: 14px;
  max-width: 46vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-who span { color: var(--muted); font-size: 12px; }
.agency-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.agency-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.agency-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ------------------------------------------------------ поиск отелей --- */
.agency-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.agency-nav-item {
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-weight: 560;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.agency-nav-item:hover { background: var(--surface-2); }
.agency-nav-item.active { background: var(--primary-soft); color: var(--primary-deep); }

.agency-searchbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.agency-searchform {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.agency-field {
  display: grid;
  gap: 5px;
  flex: 1 1 160px;
  min-width: 0;
}
.agency-field label,
.agency-fieldset legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.agency-field input,
.agency-field select { min-height: 44px; font-size: 15px; width: 100%; }
.agency-field-wide { flex: 2 1 260px; }
.agency-field-narrow { flex: 0 1 110px; }
.agency-ages { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 100%; }
.agency-search-button { min-height: 44px; padding-left: 28px; padding-right: 28px; font-size: 15px; }

.agency-combo { position: relative; }
.agency-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin: 4px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  min-width: 280px;
}
.agency-suggest-item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agency-suggest-item:hover,
.agency-suggest-item:focus-visible { background: var(--primary-soft); outline: none; }
.agency-suggest-empty { padding: 10px 12px; color: var(--ink-2); font-size: 14px; }
/* Нещодавні пошуки агента під формою: натискання запускає такий самий пошук заново. */
.agency-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.agency-recent-label { color: var(--ink-2); font-size: 12px; }
.agency-recent-list { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.agency-recent-item {
  display: grid;
  gap: 2px;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agency-recent-item:hover,
.agency-recent-item:focus-visible { border-color: var(--primary); background: var(--primary-soft); outline: none; }
.agency-recent-place { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agency-recent-trip { font-size: 12px; color: var(--ink-2); }
.agency-suggest-title { display: block; }
.agency-suggest-note { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.agency-suggest-head {
  padding: 10px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.agency-field input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

.agency-results {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.agency-filters { flex: 1 1 260px; max-width: 300px; }
/* b2b.css задаёт <main> собственную сетку страницы бекофиса. */
.agency-results-main {
  flex: 999 1 520px;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.agency-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.agency-fieldset legend { padding: 0; margin-bottom: 8px; }
.agency-checklist { display: grid; gap: 4px; }
.agency-filters label.agency-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.agency-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.agency-chip {
  min-width: 48px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.agency-chip[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-deep);
}

.agency-cards { display: grid; gap: 14px; }
.agency-hotel { padding: 0; gap: 0; overflow: hidden; }
.agency-hotel-top { display: flex; flex-wrap: wrap; }
.agency-hotel-info {
  flex: 3 1 300px;
  min-width: 0;
  padding: 18px 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.agency-hotel-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.agency-hotel-title h2 { font-size: 17px; }
.agency-stars { color: var(--warn); font-size: 13px; letter-spacing: 1px; }
.agency-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.agency-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.agency-ok { color: var(--ok); font-weight: 560; }
.agency-bad { color: var(--danger); font-weight: 560; }
.agency-hotel-price {
  flex: 1 1 220px;
  padding: 18px 20px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}
.agency-hotel-price .btn { margin-top: 10px; min-height: 44px; }
.agency-price { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.agency-rates {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: 6px 20px 14px;
  overflow-x: auto;
}
.agency-rates table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 14px; }
.agency-rates th {
  text-align: left;
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.agency-rates td { padding: 11px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.agency-rates .agency-right, .agency-right { text-align: right; }
.agency-strong { font-weight: 640; }
.agency-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-weight: 560;
}
.agency-more { justify-self: center; min-height: 44px; padding: 0 24px; }
.agency-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.agency-auto .btn { min-height: 36px; padding: 0 14px; }
.agency-sort { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.agency-sort select { min-height: 40px; padding: 0 10px; max-width: 100%; }
@media (max-width: 640px) {
  .agency-hotel-price { border-left: 0; border-top: 1px solid var(--line); align-items: flex-start; text-align: left; }
  .agency-filters { max-width: none; }
  .agency-nav { order: 3; flex-basis: 100%; }
  .topbar { height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
}

/* ------------------------------------------------- ожидание результатов --- */
/* Объёмный знак Alliance: стопка плоских слоёв (их строит agency-hotels.js),
   повёрнутая в 3D. Цвета знака — из фирменного логотипа, не из палитры кабинета. */
.agency-loader {
  --loader-face: #036686;
  --loader-side: #02465c;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 40px 20px 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
@media (prefers-color-scheme: dark) {
  .agency-loader { --loader-face: #35a9cf; --loader-side: #17667f; }
}
.agency-loader-scene {
  width: 150px;
  height: 152px;
  display: grid;
  justify-items: center;
  align-content: start;
  perspective: 640px;
}
.agency-loader-mark {
  position: relative;
  width: 104px;
  height: 106px;
  margin-top: 8px;
  transform-style: preserve-3d;
  animation: agency-loader-spin 2.8s cubic-bezier(.65, 0, .35, 1) infinite;
}
.agency-loader-mark svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.agency-loader-mark svg.face { fill: var(--loader-face); }
.agency-loader-mark svg.side { fill: var(--loader-side); }
.agency-loader-shadow {
  width: 96px;
  height: 12px;
  margin-top: 18px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(16, 26, 44, .30), rgba(16, 26, 44, 0));
  animation: agency-loader-shadow 2.8s linear infinite;
}
.agency-loader-text { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.agency-loader-hint { margin: 0; font-size: 13px; }
.agency-loader-bar {
  width: min(260px, 70%);
  height: 4px;
  border-radius: 999px;
  background: var(--bg-accent);
  overflow: hidden;
}
/* Оранжевая «бегущая» полоска — та же, что на поиске основного сайта. */
.agency-loader-bar span {
  display: block;
  width: 32%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9720, #d97207);
  animation: agency-loader-slide 1.5s ease-in-out infinite;
}
@keyframes agency-loader-spin {
  from { transform: rotateX(-12deg) rotateY(0deg); }
  to { transform: rotateX(-12deg) rotateY(360deg); }
}
/* Тень сужается, когда знак встаёт ребром (≈36% и ≈64% оборота при этой кривой). */
@keyframes agency-loader-shadow {
  0%, 50%, 100% { transform: scaleX(1); opacity: 1; }
  36%, 64% { transform: scaleX(.36); opacity: .7; }
}
@keyframes agency-loader-slide {
  0% { margin-left: -32%; }
  100% { margin-left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .agency-loader-mark { animation: none; transform: rotateX(-12deg) rotateY(-28deg); }
  .agency-loader-shadow { animation: none; }
  .agency-loader-bar span { animation: none; width: 100%; opacity: .55; }
}

/* ---- Фото, опис і постфільтри (GDS_HOTEL_CONTENT_V1) ---- */
.agency-hotel-photo {
  flex: 0 0 220px;
  min-height: 168px;
  background: var(--surface-2);
  position: relative;
  overflow: hidden;
}
.agency-hotel-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Заглушка вместо отсутствующего или незагрузившегося снимка: знак из двух полос. */
.agency-photo-empty {
  background:
    linear-gradient(135deg, transparent 46%, var(--line-strong) 46%, var(--line-strong) 54%, transparent 54%)
      center / 44px 44px no-repeat,
    var(--surface-2);
}
.agency-tag-accent {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-deep);
}
.agency-perks { font-size: 13px; line-height: 1.45; }
.agency-hotel-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 2px; }
.agency-hotel-links .btn { min-height: 40px; }
.agency-site-link { color: var(--primary-deep); font-weight: 600; font-size: 14px; }
.agency-site-link:hover { text-decoration: underline; }

.agency-details { border-top: 1px solid var(--line); display: grid; gap: 0; }
.agency-gallery {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  background: var(--surface-2);
}
.agency-gallery:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.agency-gallery-item {
  flex: 0 0 auto;
  width: 260px;
  height: 176px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  scroll-snap-align: start;
}
.agency-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agency-gallery-item.agency-photo-empty { display: none; }
.agency-details-text { padding: 16px 20px 20px; display: grid; gap: 8px; max-width: 78ch; }
.agency-details-text h3 { font-size: 15px; margin-top: 8px; }
.agency-details-text p { margin: 0; line-height: 1.55; font-size: 14px; }
.agency-details-note { color: var(--muted); font-style: italic; }
.agency-facility-line strong { font-weight: 650; }

/* fieldset по умолчанию не сжимается уже своего содержимого и распирал панель фильтров. */
.agency-filters .agency-fieldset { min-inline-size: 0; }
.agency-filters > * { min-width: 0; }
.agency-check-text { flex: 1 1 auto; min-width: 0; }
.agency-check-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.agency-more-list > summary,
.agency-facet-group > summary {
  cursor: pointer;
  min-height: 32px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-deep);
}
.agency-facet-group > summary { color: var(--ink); }
.agency-facets { display: grid; gap: 2px; }
.agency-facet-group .agency-checklist { padding: 2px 0 8px 2px; }
.agency-filter-note { font-size: 12px; line-height: 1.45; margin: 0; }

.agency-price-bars {
  height: 56px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  border-bottom: 2px solid var(--line-strong);
}
.agency-price-bars span {
  flex: 1 1 0;
  min-width: 2px;
  background: var(--primary);
  opacity: 0.38;
  border-radius: 2px 2px 0 0;
}
.agency-price-range { display: flex; align-items: center; gap: 8px; }
.agency-price-range input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

/* Карточка подстраивается под ширину КОЛОНКИ выдачи, а не окна: рядом стоит панель фильтров. */
.agency-cards { container-type: inline-size; }
.agency-hotel-top {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(190px, auto);
}
.agency-hotel-photo { min-height: 176px; }
@container (max-width: 700px) {
  .agency-hotel-top { grid-template-columns: 168px minmax(0, 1fr); }
  .agency-hotel-price {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 16px;
    border-left: 0;
    border-top: 1px solid var(--line);
    text-align: left;
    padding: 14px 20px;
  }
  .agency-hotel-price .btn { margin-top: 0; margin-left: auto; }
}
@container (max-width: 460px) {
  .agency-hotel-top { grid-template-columns: minmax(0, 1fr); }
  .agency-hotel-photo { min-height: 190px; }
}
@media (max-width: 720px) {
  .agency-gallery-item { width: 220px; height: 150px; }
  .agency-filters { max-width: none; }
}

/* ---- Мапа готелів і фільтр за областю ---- */
.agency-map-toggle { width: 100%; min-height: 44px; }
.agency-area-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.agency-area-row .btn { min-height: 36px; }
.agency-map-panel { padding: 0; gap: 0; overflow: hidden; }
.agency-map-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.agency-map-bar .btn { min-height: 40px; }
.agency-map-bar .muted { flex: 1 1 180px; min-width: 0; font-size: 13px; }
/* isolation: слои Leaflet (z-index до 1000) не перекрывают шапку и списки подсказок. */
.agency-map { height: min(62vh, 470px); min-height: 300px; background: var(--surface-2); isolation: isolate; }
.agency-map.is-selecting,
.agency-map.is-selecting .leaflet-interactive,
.agency-map.is-selecting .leaflet-marker-icon { cursor: crosshair; }
.agency-map.is-selecting { touch-action: none; }
.agency-pin {
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.agency-pin.is-dim { opacity: 0.32; }
.agency-map-area { stroke: var(--primary); stroke-width: 2; fill: var(--primary); fill-opacity: 0.12; }
.agency-map-draft { stroke-dasharray: 6 4; }
/* Всплывающая карточка Leaflet всегда светлая — текст в ней тёмный в обеих темах. */
.agency-map-card { display: grid; gap: 6px; min-width: 170px; color: #17212b; font-size: 13px; }
.agency-map-card strong { font-size: 14px; }
.agency-map-card .btn { min-height: 36px; justify-self: start; }
.agency-map-card-note { color: #5b6876; }
.agency-hotel-hot { outline: 3px solid var(--primary); outline-offset: 2px; }
@media (max-width: 720px) {
  .agency-map { height: 56vh; }
}

/* ========================================================================== */
/* Редизайн 15.11.2026 (аудит и макеты владельца): фирменная система Alliance.
   Подтверждённые цвета сайта — #036686 и #FF8A0D; остальные токены — расширение
   для интерфейса агента, не брендбук. Шрифт остаётся системным: лицензионных
   файлов Gotham Pro в проекте нет, и он за фирменный не выдаётся.
   Токены действуют только на страницах агента (body.agency): бекофис не меняется. */
html:has(body.agency) { color-scheme: light; }
body.agency {
  color-scheme: light;
  --bg: #f4f7f8;
  --bg-accent: #eaf4f6;
  --surface: #ffffff;
  --surface-2: #f4f7f8;
  --ink: #172f3b;
  --ink-2: #52656d;
  --muted: #5d7078;
  --line: #dce5e8;
  --line-strong: #c3d0d5;
  --primary: #036686;
  --primary-deep: #024e66;
  --primary-soft: #eaf4f6;
  --accent: #ff8a0d;
  --accent-deep: #f07c00;
  --accent-ink: #172f3b;
  --danger: #b42318;
  --danger-soft: rgba(180, 35, 24, 0.08);
  --ok: #0b7a4b;
  --ok-soft: rgba(11, 122, 75, 0.10);
  --warn: #7a4f00;
  --warn-soft: #fff3dc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 47, 59, 0.06), 0 12px 28px -18px rgba(23, 47, 59, 0.30);
  --shadow-soft: 0 1px 2px rgba(23, 47, 59, 0.05);
  background: var(--bg);
  color: var(--ink);
}
body.agency :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
body.agency .muted { color: var(--muted); }
.agency-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Главное действие: оранжевый акцент с тёмной подписью (контраст 5,9:1). */
body.agency .btn.agency-cta {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
body.agency .btn.agency-cta:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
body.agency .btn.agency-cta:disabled { background: #f3e2cd; border-color: #f3e2cd; color: #7a6a58; }

/* ------------------------------------------------------------------ шапка --- */
body.agency .agency-topbar {
  height: 60px;
  gap: 20px;
  background: var(--surface);
  backdrop-filter: none;
  border-bottom: 2px solid var(--primary);
}
.agency-logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; text-decoration: none; }
.agency-logo img { height: 26px; width: auto; display: block; }
.agency-logo-badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.agency-topmenu {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
body.agency .agency-nav { flex: 0 1 auto; gap: 0; }
body.agency .agency-nav-item {
  margin: 0 10px;
  padding: 19px 2px 16px;
  border-radius: 0;
  border-bottom: 3px solid transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}
body.agency .agency-nav-item:hover { background: none; color: var(--primary); }
body.agency .agency-nav-item.active { background: none; color: var(--primary); border-bottom-color: var(--primary); }
.agency-menu-button { display: none; }
.agency-burger, .agency-burger::before, .agency-burger::after {
  display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--ink);
}
.agency-burger { position: relative; }
.agency-burger::before, .agency-burger::after { content: ""; position: absolute; left: 0; }
.agency-burger::before { top: -6px; }
.agency-burger::after { top: 6px; }

/* ------------------------------------------------------------------ поиск --- */
body.agency .agency-searchbar { background: linear-gradient(#ffffff, var(--bg)); border-bottom: 0; }
.agency-searchwrap { max-width: 1240px; margin: 0 auto; padding: 22px 24px 6px; display: grid; gap: 14px; }
.agency-eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.agency-hero-title { margin: 2px 0 0; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
body.agency .agency-searchform {
  max-width: none;
  margin: 0;
  padding: 8px;
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.agency-seg {
  position: relative;
  flex: 1 1 170px;
  gap: 2px;
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  border-radius: 10px;
  align-content: center;
}
.agency-seg:focus-within { box-shadow: inset 0 0 0 2px var(--primary); border-right-color: transparent; }
body.agency .agency-seg label, .agency-seg-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.agency-seg-note { margin-left: 6px; color: var(--primary); font-weight: 700; }
body.agency .agency-seg input[type="text"],
body.agency .agency-seg input[type="date"],
.agency-guests-toggle {
  width: 100%;
  min-height: 30px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
body.agency .agency-seg input:disabled { background: transparent; color: var(--muted); font-weight: 500; }
body.agency .agency-seg input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.agency-seg.agency-dates { flex: 1.6 1 290px; }
.agency-seg.agency-guests { flex: 1 1 190px; }
.agency-dates-row { display: flex; align-items: center; gap: 6px; }
body.agency .agency-dates-row input[type="date"] { flex: 1 1 0; min-width: 118px; font-size: 15px; }
.agency-guests-toggle { cursor: pointer; }
.agency-guests-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(320px, 92vw);
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.agency-guests-row, body.agency .agency-guests-panel .agency-ages { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.agency .agency-guests-panel .agency-field { flex: none; }
body.agency .agency-guests-panel label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
body.agency .agency-guests-panel select { min-height: 44px; font-size: 16px; }
body.agency select.is-missing { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.agency-guests-panel .agency-note { margin: 0; }
body.agency .agency-search-button {
  align-self: center;
  min-height: 52px;
  margin: 4px 4px 4px 12px;
  padding: 0 30px;
  border-radius: 10px;
  font-size: 16px;
}
.agency-search-summary { display: none; }
.agency-intro p { margin: 0; }

/* ----------------------------------------------------------------- выдача --- */
body.agency .agency-results { gap: 24px; padding-top: 18px; }
body.agency .agency-filters { flex: 0 0 264px; max-width: 264px; gap: 16px; padding: 18px; }
body.agency .agency-filters .agency-field label,
body.agency .agency-filters legend { font-size: 13px; font-weight: 700; color: var(--ink); }
body.agency .agency-filters .agency-section-head h2 { font-size: 18px; font-weight: 800; }
body.agency .agency-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #ffffff; }
body.agency .agency-price-bars span { background: var(--primary); opacity: 0.45; }
.agency-sheet-close, .agency-sheet-foot, .agency-toolbar-filters { display: none; }

.agency-summary { display: grid; gap: 10px; }
.agency-summary-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; }
.agency-summary-text { min-width: 0; }
body.agency .agency-summary h1 { font-size: 26px; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; }
.agency-trip { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; font-weight: 500; }
body.agency .agency-summary #hsCounters { margin: 2px 0 0; }
.agency-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.agency .agency-toolbar .btn, body.agency .agency-toolbar select { min-height: 44px; }
body.agency .agency-map-toggle { width: auto; }
body.agency .agency-sort { margin-top: 0; }
body.agency .agency-auto { margin-top: 0; }
.agency-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}
.agency-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.agency-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.agency-active-chip:hover { background: #d9ebef; }
.agency-active-x { font-size: 17px; line-height: 1; }
.agency-active-reset {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.agency-stale { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.agency-stale .btn { min-height: 40px; }
.agency-empty p { margin: 0; }
.agency-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --------------------------------------------------------------- карточка --- */
body.agency .agency-hotel { border-radius: 14px; }
body.agency .agency-hotel-top { grid-template-columns: 248px minmax(0, 1fr) 236px; }
body.agency .agency-hotel-photo { min-height: 188px; margin: 8px 0 8px 8px; border-radius: 10px; }
body.agency .agency-hotel-info { padding: 14px 18px; gap: 7px; }
.agency-hotel-name { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
.agency-hotel-rank { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body.agency .agency-stars { color: var(--accent); font-size: 15px; letter-spacing: 2px; }
.agency-hotel-place { font-size: 14px; }
.agency-offer { display: flex; flex-wrap: wrap; gap: 8px; }
.agency-offer-item {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 500;
}
.agency-cancel { display: grid; gap: 2px; font-size: 14px; font-weight: 600; }
body.agency .agency-cancel .agency-bad { color: #a34700; }
body.agency .agency-perks { color: var(--ink-2); }
body.agency .agency-hotel-price {
  align-items: stretch;
  gap: 2px;
  margin: 12px 0;
  padding: 4px 18px;
  text-align: left;
}
.agency-price-label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
body.agency .agency-price { font-size: 30px; font-weight: 800; color: var(--ink); }
.agency-price-basis { color: var(--ink-2); font-size: 13px; }
body.agency .agency-hotel-price .btn.agency-cta {
  min-height: 46px;
  margin-top: 12px;
  padding: 0 10px;
  font-size: 14px;
  white-space: normal;
  line-height: 1.2;
}
@container (max-width: 700px) {
  body.agency .agency-hotel-top { grid-template-columns: 180px minmax(0, 1fr); }
  body.agency .agency-hotel-price {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 12px 18px 16px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  body.agency .agency-hotel-price .btn.agency-cta { margin-left: 0; }
}
@container (max-width: 460px) {
  body.agency .agency-hotel-top { grid-template-columns: minmax(0, 1fr); }
  body.agency .agency-hotel-photo { min-height: 150px; margin: 0; border-radius: 0; }
  body.agency .agency-hotel-info { padding: 12px 16px; gap: 6px; }
  body.agency .agency-hotel-name { font-size: 18px; }
  body.agency .agency-perks { display: none; }
  body.agency .agency-hotel-price { padding: 10px 16px 14px; }
  .agency-price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  body.agency .agency-price { font-size: 26px; }
  body.agency .agency-hotel-price .btn.agency-cta { margin-top: 8px; }
}

/* Тарифы: строки, а не широкая таблица — на телефоне без горизонтальной прокрутки. */
body.agency .agency-rates { padding: 8px 18px 16px; background: var(--surface); overflow: visible; }
.agency-rates-head, .agency-rate {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.agency-rates-head {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
}
.agency-rate { padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.agency-rate-price { text-align: right; }
.agency-rate-price .agency-strong { font-size: 17px; font-weight: 800; }
.agency-rates-note { margin: 10px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.agency-offers-summary { padding: 6px 0 10px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.agency-offers-loading { padding: 18px; color: var(--ink-2); font-size: 14px; }
.agency-room { margin-top: 10px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.agency-room-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  font-size: 15px;
}
.agency-room .agency-rate:last-child { border-bottom: 0; }
/* Проверка цены выбранного тарифа: кнопка под ценой и блок с ответом поставщика под строкой. */
.agency-quote-btn { min-height: 34px; margin-top: 6px; padding: 4px 12px; font-size: 13px; }
.agency-quote {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--line);
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.45;
}
.agency-quote-ok { border-left-color: #1f8a4c; }
.agency-quote-warn { border-left-color: #c77700; }
.agency-quote-bad { border-left-color: #b3261e; }
.agency-quote-title { margin-bottom: 6px; font-size: 15px; }
.agency-quote-lines { margin: 6px 0; }
.agency-quote-line { display: flex; justify-content: space-between; gap: 16px; padding: 2px 0; }
.agency-quote-note { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; }
.agency-quote-notes-title { margin-top: 8px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.agency-offers-more { width: 100%; min-height: 44px; margin-top: 12px; }
/* Бронирование по проверенной цене: форма туристов под блоком проверки цены и панель состояния заказа. */
.agency-book { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.agency-book-open { min-height: 40px; }
.agency-book-title { font-size: 15px; }
.agency-book-guest { margin-top: 10px; }
.agency-book-guest-title { margin-bottom: 4px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.agency-book-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.agency-book-field { display: flex; flex-direction: column; gap: 3px; color: var(--ink-2); font-size: 12px; }
.agency-book-field input,
.agency-book-field select {
  min-height: 40px; width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 15px;
}
.agency-book-field input:disabled,
.agency-book-field select:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.agency-book-manual { color: #a34700; font-weight: 600; }
.agency-book-error { margin: 8px 0 0; }
.agency-book-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.agency-order { margin-bottom: 16px; padding: 16px; border-left: 4px solid #c77700; }
.agency-order-confirmed { border-left-color: #1f8a4c; }
.agency-order-rejected,
.agency-order-refused { border-left-color: #b3261e; }
.agency-order-title { margin: 0 0 6px; font-size: 18px; }
.agency-order-message { margin: 0 0 8px; }
@container (max-width: 520px) {
  .agency-rates-head { display: none; }
  .agency-rate { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "meal price" "cancel price"; gap: 4px 12px; }
  .agency-rate-meal { grid-area: meal; }
  .agency-rate-cancel { grid-area: cancel; }
  .agency-rate-price { grid-area: price; }
}

/* ---------------------------------------------------------------- загрузка --- */
body.agency .agency-loader {
  grid-template-columns: auto minmax(0, 1fr);
  justify-items: start;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-align: left;
}
body.agency .agency-loader-scene { width: 60px; height: 62px; }
body.agency .agency-loader-mark { width: 44px; height: 45px; margin-top: 8px; }
body.agency .agency-loader-shadow { display: none; }
.agency-loader-copy { display: grid; gap: 8px; justify-items: start; min-width: 0; }
body.agency .agency-loader-bar { width: min(260px, 100%); }
.agency-skeletons { display: none; gap: 14px; }
.agency-loader:not([hidden]) + .agency-skeletons { display: grid; }
.agency-skeleton {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 22px 16px;
  align-content: center;
  gap: 14px 20px;
  height: 150px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.agency-skeleton span { border-radius: 8px; background: var(--bg-accent); animation: agency-skeleton 1.4s ease-in-out infinite; }
.agency-skeleton span:first-child { grid-row: 1 / span 2; height: 124px; align-self: center; }
.agency-skeleton span:nth-child(2) { width: 55%; align-self: end; }
.agency-skeleton span:nth-child(3) { width: 35%; }
@keyframes agency-skeleton { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .agency-skeleton span { animation: none; } }

/* ------------------------------------------------------------------ карта --- */
.agency-pin-price > span {
  display: inline-block;
  transform: translate(-50%, -50%);
  padding: 3px 8px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #036686;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.agency-pin-price.is-dim > span { opacity: 0.35; }

/* ------------------------------------------------------------------- вход --- */
body.agency .agency-aside { background: var(--primary); }
body.agency .agency-step-num { background: rgba(255, 255, 255, 0.16); color: #ffffff; }
body.agency .agency-step-text { color: rgba(255, 255, 255, 0.88); }
.agency-brand-logo { display: flex; align-items: center; gap: 10px; }
.agency-brand-logo img { height: 30px; width: auto; display: block; }

/* --------------------------------------------------------------- телефон --- */
@media (max-width: 760px) {
  body.agency .agency-topbar { height: 56px; flex-wrap: nowrap; padding: 0 16px; }
  .agency-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
  }
  .agency-topmenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 16px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .agency-topbar.is-open .agency-topmenu { display: flex; }
  body.agency .agency-nav { order: 0; flex-direction: column; flex-basis: auto; }
  body.agency .agency-nav-item { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
  body.agency .agency-nav-item.active { border-bottom-color: var(--line); }
  body.agency .topbar-right { justify-content: space-between; }
  body.agency .agency-who { align-items: flex-start; }
  body.agency .agency-who strong { max-width: 60vw; }

  .agency-searchwrap { padding: 14px 16px 4px; }
  .agency-hero-title { font-size: 22px; }
  body.agency .agency-searchform { flex-direction: column; padding: 6px; }
  /* В колонке flex-basis сегментов стал бы высотой — здесь он не нужен. */
  .agency-seg, .agency-seg.agency-dates, .agency-seg.agency-guests {
    flex: 0 0 auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .agency-seg:focus-within { border-radius: 10px; border-bottom-color: transparent; }
  .agency-guests-panel { position: static; width: auto; margin-top: 8px; padding: 12px; box-shadow: none; }
  body.agency .agency-search-button { align-self: stretch; margin: 10px 6px 6px; }
  .agency-searchbar.is-collapsed .agency-searchform,
  .agency-searchbar.is-collapsed .agency-recent,
  .agency-searchbar.is-collapsed .agency-hero { display: none; }
  .agency-searchbar.is-collapsed .agency-search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .agency-search-summary-text { display: grid; min-width: 0; }
  .agency-search-summary-text strong { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .agency-search-summary-text span { color: var(--ink-2); font-size: 13px; }
  .agency-search-summary .btn { min-height: 44px; flex: 0 0 auto; }

  body.agency .agency-results { gap: 12px; padding: 12px 16px 72px; }
  /* Направление и даты уже стоят в сводке поиска над выдачей — второй раз не повторяются. */
  .agency-searchbar.is-collapsed ~ .agency-results .agency-summary h1,
  .agency-searchbar.is-collapsed ~ .agency-results .agency-trip { display: none; }
  body.agency .agency-summary h1 { font-size: 22px; }
  .agency-toolbar { width: 100%; }
  .agency-toolbar > * { flex: 1 1 0; min-width: 0; }
  body.agency .agency-toolbar .agency-sort { order: 3; flex: 1 1 100%; }
  .agency-toolbar-filters { display: inline-flex; align-items: center; justify-content: center; }
  body.agency .agency-sort select { width: 100%; }
  body.agency .agency-map-toggle { width: 100%; }

  /* Фильтры — отдельным экраном: до первого отеля не нужно листать всю панель. */
  body.agency .agency-filters { display: none; }
  body.agency.filters-open { overflow: hidden; }
  body.agency.filters-open .agency-filters {
    display: grid;
    position: fixed;
    inset: 0;
    z-index: 90;
    flex: none;
    max-width: none;
    align-content: start;
    padding: 16px 16px 96px;
    border: 0;
    border-radius: 0;
    overflow-y: auto;
  }
  .agency-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
  }
  .agency-sheet-foot {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 91;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  .agency-sheet-foot .btn { flex: 1 1 auto; min-height: 50px; font-size: 16px; }
  .agency-skeleton { grid-template-columns: 96px minmax(0, 1fr); height: 120px; }
  .agency-skeleton span:first-child { height: 94px; }
}
