:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: var(--tg-theme-bg-color, #f5f7fb);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #758099;
  --accent: #356df3;
  --surface: var(--tg-theme-secondary-bg-color, #fff);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--tg-theme-bg-color, #f5f7fb);
  color: var(--tg-theme-text-color, #172033);
}

button,
input,
select {
  font: inherit;
}

.app {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 2px 24px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(25px, 7vw, 32px);
  letter-spacing: -.04em;
}

.logo {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 15px;
  background: #e8efff;
  color: var(--accent);
  font-size: 27px;
  font-weight: 700;
}

.filters {
  padding: 17px;
  border: 1px solid rgba(33, 48, 78, .07);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(34, 49, 79, .05);
}

.route-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid #e6eaf1;
  border-radius: 12px;
  outline: none;
  background: var(--tg-theme-bg-color, #f8f9fc);
  color: var(--tg-theme-text-color, #172033);
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(53, 109, 243, .12);
}

.search-button,
.more-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.search-button:disabled,
.more-button:disabled {
  opacity: .65;
  cursor: wait;
}

.results {
  margin-top: 27px;
}

.results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

h2 {
  margin-bottom: 12px;
  font-size: 19px;
}

#result-count,
.status,
.listing-meta,
.listing-comment {
  color: var(--muted);
  font-size: 13px;
}

.status {
  margin: 0 0 13px;
}

.contact-quota {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(53, 109, 243, .08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.contact-privacy {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.listings {
  display: grid;
  gap: 12px;
}

.listing {
  padding: 16px;
  border: 1px solid rgba(33, 48, 78, .07);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: 0 5px 15px rgba(34, 49, 79, .035);
}

.listing-top,
.listing-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.listing-kind {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.boosted {
  color: #df8b16;
  font-size: 12px;
  font-weight: 700;
}

.listing-route {
  justify-content: flex-start;
  margin: 10px 0 8px;
  font-size: 17px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.arrow {
  flex: 0 0 auto;
  color: var(--accent);
}

.listing-title {
  margin: 10px 0 0;
  font-size: 16px;
}

.listing-meta {
  margin: 0 0 8px;
  line-height: 1.5;
}

.listing-details {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.detail-chip {
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(53, 109, 243, .08);
  color: var(--tg-theme-text-color, #33415f);
  font-size: 12px;
}

.listing-comment {
  margin: 11px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.contact-button {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.contact-button:disabled {
  background: #edf1f8;
  color: var(--muted);
  cursor: default;
}

.more-button {
  margin-top: 14px;
  background: #e8efff;
  color: var(--accent);
}

[hidden] {
  display: none !important;
}

@media (max-width: 390px) {
  .app {
    padding-right: 13px;
    padding-left: 13px;
  }

  .filters {
    padding: 14px;
  }

  .route-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
