:root {
  --blue: #254a72;
  --teal: #007c91;
  --cyan: #01aeed;
  --ink: #17324d;
  --muted: #6d7f91;
  --line: #d7e7ef;
  --soft: #f3f9fc;
  --white: #ffffff;
  --danger: #b94141;
  --shadow: 0 14px 35px rgba(24, 60, 90, 0.12);
  --shadow-soft: 0 10px 28px rgba(24, 60, 90, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f7fbfd;
}

.topbar {
  min-height: 78px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand img {
  width: 132px;
  height: auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 22px;
}

.eyebrow {
  color: var(--teal);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.status {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.status.ok {
  color: var(--teal);
  background: #edf9fb;
}

.status.error {
  color: var(--danger);
  background: #fff4f4;
}

.layout {
  display: grid;
  grid-template-columns: minmax(360px, 450px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  max-width: 1680px;
  margin: 0 auto;
}

.results-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 0;
  align-self: start;
  position: sticky;
  top: 96px;
  overflow: hidden;
  max-height: calc(100vh - 112px);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(1, 174, 237, 0.11), rgba(255, 255, 255, 0) 190px),
    var(--white);
  border: 1px solid #cce8f2;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel form {
  display: grid;
  gap: 14px;
  padding: 18px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.search-panel::before {
  content: "Маркетинговый поиск";
  display: block;
  padding: 16px 18px 12px;
  color: var(--blue);
  font-size: 18px;
  font-weight: 800;
  border-bottom: 1px solid rgba(215, 231, 239, 0.85);
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(8px);
}

.results-panel {
  padding: 20px;
  min-height: calc(100vh - 116px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(215, 231, 239, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field-wide {
  padding: 12px;
  margin-bottom: 0;
  border: 1px solid rgba(1, 174, 237, 0.18);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.field span,
.section-title {
  font-size: 13px;
  color: var(--blue);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfe0e8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  outline: none;
}

select {
  padding-right: 34px;
  text-overflow: ellipsis;
  font-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  border-color: rgba(1, 174, 237, 0.32);
  background:
    linear-gradient(180deg, rgba(243, 249, 252, 0.7), #fff 52px);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(1, 174, 237, 0.12);
}

.scenario-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid rgba(215, 231, 239, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
}

.scenario,
.chip {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--blue);
  border-radius: 8px;
  min-height: 38px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.scenario {
  position: relative;
  min-height: 46px;
  padding-left: 14px;
  padding-right: 28px;
  line-height: 1.18;
  box-shadow: 0 4px 12px rgba(24, 60, 90, 0.05);
}

.scenario::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.55;
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
}

.scenario:hover,
.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(1, 174, 237, 0.45);
  box-shadow: 0 8px 18px rgba(24, 60, 90, 0.08);
}

.scenario.active,
.chip.active {
  color: var(--white);
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 9px 20px rgba(0, 124, 145, 0.22);
}

.scenario.active::after {
  background: #ffffff;
  opacity: 1;
}

.chips-block {
  margin-top: 0;
  padding: 12px;
  border: 1px solid rgba(215, 231, 239, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  min-height: 34px;
  font-size: 13px;
  text-align: center;
  background: #f8fcfe;
}

.actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 2px -18px -18px;
  padding: 12px 18px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), #ffffff);
  border-top: 1px solid rgba(215, 231, 239, 0.86);
  backdrop-filter: blur(8px);
}

.actions .primary,
.actions .secondary {
  min-height: 48px;
}

.actions .primary {
  box-shadow: 0 12px 24px rgba(1, 174, 237, 0.24);
}

button,
.link {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  background: linear-gradient(135deg, var(--cyan), #008caf);
  color: var(--white);
  flex: 1;
}

.primary:hover {
  filter: brightness(0.98);
}

.secondary,
.link {
  background: #edf5f9;
  color: var(--blue);
  border: 1px solid var(--line);
}

.secondary:hover,
.link:hover {
  border-color: rgba(1, 174, 237, 0.45);
}

.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.search-summary {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.loader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  color: var(--muted);
}

.hidden {
  display: none;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #d6edf6;
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty {
  padding: 42px 0;
  color: var(--muted);
  text-align: center;
}

.cards {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.tour-card {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.tour-image {
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
  background: var(--soft);
}

.tour-body {
  padding: 18px;
}

.tour-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.tour-card h3 {
  color: var(--blue);
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 6px;
}

.location {
  color: var(--teal);
  font-weight: 700;
}

.price {
  color: var(--teal);
  background: #e9f9fb;
  border-radius: 8px;
  padding: 10px 14px;
  height: fit-content;
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.badge {
  background: var(--soft);
  color: var(--blue);
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 700;
  font-size: 13px;
}

.description {
  color: #34536d;
  line-height: 1.45;
  margin-bottom: 16px;
}

.insights {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.insights strong {
  display: block;
  color: var(--blue);
  margin-bottom: 8px;
}

.insights ul {
  margin: 0;
  padding-left: 18px;
}

.insights li,
.idea {
  color: #34536d;
  line-height: 1.45;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 45, 70, 0.45);
}

.modal-sheet {
  position: absolute;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 28px));
  max-height: 92vh;
  overflow: auto;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 80px rgba(12, 40, 70, 0.24);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.modal-content {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.detail-tile,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px;
}

.detail-tile span,
.detail-section span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.detail-tile strong {
  color: var(--blue);
}

.detail-section {
  line-height: 1.45;
  color: #34536d;
}

.detail-section ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.detail-link {
  color: var(--teal);
  font-weight: 700;
  word-break: break-word;
}

.reviews-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.review-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--blue);
  font-weight: 700;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.review-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
}

.review-text {
  color: #34536d;
  line-height: 1.45;
}

.review-meta {
  color: var(--muted);
  font-size: 12px;
}

.review-original {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.review-original summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 700;
  font-size: 13px;
}

.review-original p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .search-panel {
    position: static;
    max-height: none;
    overflow: visible;
    display: block;
  }

  .search-panel form {
    overflow: visible;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    padding: 10px;
  }

  .form-grid,
  .scenario-grid,
  .tour-card,
  .insights,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .tour-image {
    height: 220px;
  }

  .tour-topline {
    flex-direction: column;
  }
}
