:root {
  --bg: #f5f6fb;
  --surface: rgba(255, 255, 255, 0.76);
  --surface-strong: #ffffff;
  --ink: #11141d;
  --muted: #697181;
  --line: rgba(213, 218, 230, 0.86);
  --black: #050507;
  --accent: #d4a35f;
  --gold: #a77c43;
  --blue: #e5ebfb;
  --shadow: 0 18px 46px rgba(17, 24, 39, 0.105);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tg-viewport-height: 100vh;
  --telegram-chrome-top: 78px;
}

* { box-sizing: border-box; }
html { width: 100%; scroll-behavior: smooth; background: var(--bg); min-height: 100%; }
body {
  width: 100%;
  margin: 0;
  min-width: 320px;
  min-height: var(--tg-viewport-height);
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(225, 195, 151, 0.42), transparent 30%),
    radial-gradient(circle at 96% 0%, rgba(220, 227, 244, 0.92), transparent 34%),
    linear-gradient(180deg, #fbfbfe 0%, #f2f4fb 56%, #fbfcff 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
body.telegram-ready { overscroll-behavior-y: none; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #f9faff, #eef3ff);
  transition: opacity 0.42s ease, visibility 0.42s ease;
}
.loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-card {
  width: min(292px, 84vw);
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 30px 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}
.loader-card img { width: 176px; height: auto; }
.loader-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; }
.loader-bar { width: 132px; height: 3px; overflow: hidden; border-radius: 999px; background: #d9e1f3; }
.loader-bar span { display: block; width: 42%; height: 100%; border-radius: inherit; background: var(--black); animation: loading 1.1s ease-in-out infinite; }
@keyframes loading { from { transform: translateX(-120%); } to { transform: translateX(260%); } }

.app {
  width: min(100%, 460px);
  min-height: var(--tg-viewport-height);
  margin: 0 auto;
  padding: calc(var(--safe-top) + var(--telegram-chrome-top)) 14px calc(var(--safe-bottom) + 108px);
}
.topbar {
  position: sticky;
  top: calc(var(--safe-top) + 76px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 16px 34px rgba(17,24,39,.075), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(26px) saturate(170%);
}
.brand-mark {
  width: 92px;
  height: 38px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.brand-mark img { width: 92px; height: auto; display: block; }
.profile { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  overflow: hidden; border-radius: 50%;
  background: var(--black); color: #fff;
  font-size: 13px; font-weight: 900;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile p { margin: 0; }
.profile .kicker { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.profile .name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 900; }
.icon-btn {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(247,248,252,.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.hero { padding: 12px 2px 18px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .16em;
}
h1, h2, h3, p { margin: 0; }
h1 {
  max-width: 360px;
  font-size: 33px;
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 900;
}
h2 { font-size: 19px; line-height: 1.15; letter-spacing: -.025em; font-weight: 900; }
.search {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 12px 28px rgba(17,24,39,.055), inset 0 1px 0 rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
}
.search svg { width: 18px; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-trigger {
  width: 100%;
  color: var(--muted);
  text-align: left;
}
.search-trigger span {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chips { display: flex; gap: 9px; overflow-x: auto; margin: 0 -14px; padding: 14px 14px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .cards::-webkit-scrollbar, .destination-strip::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.84);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.chip.active { background: var(--black); color: #fff; border-color: var(--black); box-shadow: 0 10px 22px rgba(5,5,7,.16); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.stats-row div {
  min-height: 74px;
  padding: 12px 10px;
  border: 1px solid rgba(213,218,230,.74);
  border-radius: 18px;
  background: rgba(255,255,255,.64);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
  backdrop-filter: blur(18px);
}
.stats-row span { display: block; font-size: 17px; font-weight: 950; letter-spacing: -.02em; }
.stats-row p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.25; font-weight: 750; }

.spotlight {
  position: relative;
  min-height: 212px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--black);
  box-shadow: 0 20px 48px rgba(17,24,39,.14);
}
.spotlight img { width: 100%; height: 250px; object-fit: cover; }
.spotlight::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 26%, rgba(0,0,0,.78)); pointer-events: none; }
.spotlight-content { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 16px; color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--black); font-size: 10px; font-weight: 900; }
.spotlight h2 { margin-top: 10px; max-width: 300px; color: #fff; font-size: 28px; line-height: .98; font-family: "EB Garamond", serif; }
.spotlight-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: rgba(255,255,255,.88); font-size: 13px; font-weight: 700; }

.section { margin-top: 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.text-btn { background: transparent; color: var(--muted); font-size: 12px; font-weight: 900; }
.cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 82%;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
  scroll-padding: 2px;
  scrollbar-width: none;
}
.tour-card {
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: 0 16px 36px rgba(17,24,39,.09);
  transform: translateZ(0);
}
.tour-card img { width: 100%; height: 178px; object-fit: cover; }
.tour-body { padding: 13px; }
.tour-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tour-title { font-size: 18px; font-family: "EB Garamond", serif; font-weight: 800; letter-spacing: -.02em; }
.tour-price { font-size: 13px; font-weight: 900; }
.tour-desc { color: var(--muted); font-size: 12px; line-height: 1.45; }
.tour-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.tour-facts span {
  padding: 6px 8px;
  border-radius: 999px;
  background: #f1f3f8;
  color: #4c5566;
  font-size: 10px;
  font-weight: 850;
}
.tour-included {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.tour-included li {
  position: relative;
  padding-left: 14px;
  color: #5e6676;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 650;
}
.tour-included li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.tour-actions { display: grid; grid-template-columns: 1fr 42px; gap: 8px; margin-top: 12px; }
.primary-btn, .secondary-btn {
  height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 900;
}
.primary-btn { background: var(--black); color: #fff; box-shadow: 0 12px 24px rgba(5,5,7,.14); }
.secondary-btn { background: var(--bg); color: var(--ink); }
.secondary-btn.saved, .save-btn.saved { background: #fff4e6; color: #a36522; }
.secondary-btn.wide { width: 100%; padding: 0 16px; }

.ai-card {
  margin-top: 22px;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(212,163,95,.28), transparent 32%),
    linear-gradient(180deg, #171b25, #050507);
  color: #fff;
  box-shadow: var(--shadow);
}
.ai-stars { color: #f1c884; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .14em; }
.ai-card h2 { margin-top: 14px; max-width: 260px; font-size: 26px; font-family: "EB Garamond", serif; color: #fff; }
.ai-card p { margin-top: 8px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.55; }
.ai-card .primary-btn { margin-top: 16px; padding: 0 16px; background: #fff; color: var(--black); }

.destination-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 132px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.destination {
  position: relative;
  height: 166px;
  overflow: hidden;
  scroll-snap-align: start;
  border-radius: 20px;
  color: #fff;
  background: transparent;
  box-shadow: 0 14px 26px rgba(17,24,39,.08);
}
.destination img { width: 100%; height: 100%; object-fit: cover; }
.destination::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.72)); }
.destination span { position: absolute; z-index: 2; left: 10px; bottom: 10px; right: 10px; font-size: 13px; font-weight: 900; }

.collections { display: grid; gap: 10px; }
.collection {
  display: grid;
  grid-template-columns: 68px 1fr 24px;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 26px rgba(17,24,39,.055), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(18px);
}
.collection img { width: 68px; height: 54px; object-fit: cover; border-radius: 13px; }
.collection h3 { font-size: 14px; font-weight: 900; }
.collection p { margin-top: 3px; color: var(--muted); font-size: 11px; }

.bottom-nav {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 12px);
  width: min(430px, calc(100vw - 18px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr 58px 1fr 1fr;
  align-items: center;
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 27px;
  background: rgba(255,255,255,.58);
  box-shadow: 0 -18px 42px rgba(17,24,39,.12), inset 0 1px 0 rgba(255,255,255,.86);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
}
.nav-item {
  height: 46px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 17px;
  background: transparent;
  color: #7a8191;
  font-size: 9px;
  font-weight: 800;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item.active { color: var(--black); background: rgba(255,255,255,.42); }
.nav-item:active { transform: scale(.95); }
.nav-item.concierge {
  height: 52px;
  width: 52px;
  margin: -18px auto 0;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  box-shadow: 0 14px 28px rgba(5,5,7,.24);
}
.nav-item.concierge img {
  width: 34px;
  height: auto;
  filter: invert(1) brightness(6);
}

.search-page { padding-top: 8px; }
.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quick-grid button {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.95), rgba(238,242,252,.74));
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(17,24,39,.06);
}
.compact { margin-top: 18px; }
.search-results {
  display: grid;
  gap: 12px;
}
.result-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 30px rgba(17,24,39,.065), inset 0 1px 0 rgba(255,255,255,.9);
}
.result-card > img {
  width: 118px;
  height: 156px;
  object-fit: cover;
  border-radius: 16px;
}
.result-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.result-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.result-top b {
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
.result-body h3 {
  margin-top: 7px;
  font-size: 17px;
  line-height: 1.05;
  font-weight: 950;
}
.result-body p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}
.result-actions {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.result-actions .primary-btn,
.result-actions .secondary-btn {
  height: 38px;
}
.empty-state, .profile-card {
  padding: 24px 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.78);
  text-align: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(24px);
}
.empty-state > p:last-child, .profile-card > p:last-child, #profileMeta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #fff4e6;
  color: #a36522;
}
.empty-icon svg { width: 24px; height: 24px; }
.avatar.large {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  font-size: 22px;
}
.profile-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.bonus-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.24), transparent 28%),
    linear-gradient(135deg, #151923, #050507);
  color: #fff;
  text-align: left;
  box-shadow: 0 18px 36px rgba(5,5,7,.18);
}
.bonus-card p {
  margin: 0 0 4px;
  color: rgba(255,255,255,.66);
  font-size: 11px;
  font-weight: 800;
}
.bonus-card strong {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -.02em;
}
.bonus-card span {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #f1c884;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.profile-grid button {
  min-height: 74px;
  border-radius: 18px;
  background: #f3f5fb;
  color: var(--ink);
}
.profile-grid b {
  display: block;
  font-size: 18px;
  font-weight: 950;
}
.profile-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.profile-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  text-align: left;
}
.profile-list div {
  padding: 12px;
  border-radius: 16px;
  background: #f7f8fc;
}
.profile-list span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.profile-list b {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.details {
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow-y: auto;
  background: #f8f9ff;
}
.details-panel {
  width: 100%;
  max-width: 460px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: calc(var(--safe-bottom) + 22px);
  background: linear-gradient(180deg, #f8f9ff, #fff);
}
.back { position: fixed; z-index: 3; top: calc(var(--safe-top) + 74px); left: max(12px, calc((100vw - 460px) / 2 + 12px)); background: rgba(255,255,255,.78); backdrop-filter: blur(18px); }
.details-hero { position: relative; height: 330px; overflow: hidden; }
.details-hero img { width: 100%; height: 100%; object-fit: cover; }
.details-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(0,0,0,.7)); }
.details-title { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 18px; color: #fff; }
.details-title h1 { max-width: 310px; color: #fff; font-family: "EB Garamond", serif; font-size: 36px; }
.details-content { padding: 18px 14px; }
.quote { margin: 10px 0 18px; font-family: "EB Garamond", serif; font-style: italic; font-size: 22px; line-height: 1.1; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.feature { padding: 12px 8px; border-radius: 16px; background: var(--surface-strong); text-align: center; box-shadow: 0 8px 18px rgba(17,24,39,.06); }
.feature b { display: block; font-size: 11px; }
.feature span { color: var(--muted); font-size: 12px; }
.details-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 20px;
  padding: 0;
  list-style: none;
}
.details-list li {
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  color: #555d6e;
  box-shadow: 0 8px 18px rgba(17,24,39,.05);
  font-size: 13px;
  line-height: 1.35;
}
.timeline { margin-top: 18px; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--black); color: #fff; font-size: 11px; font-weight: 900; }
.step p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.reserve { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; padding: 12px 14px calc(var(--safe-bottom) + 12px); background: rgba(255,255,255,.8); backdrop-filter: blur(20px); }

@media (prefers-reduced-motion: no-preference) {
  .tour-card, .destination, .collection, .ai-card, .spotlight { transition: transform .22s ease, box-shadow .22s ease; }
  .tour-card:active, .destination:active, .collection:active { transform: scale(.985); }
}

@supports (height: 100svh) {
  :root { --tg-viewport-height: 100svh; }
}

@media (max-width: 380px) {
  h1 { font-size: 30px; }
  .app { padding-left: 12px; padding-right: 12px; }
  .bottom-nav { grid-template-columns: 1fr 1fr 54px 1fr 1fr; }
  .nav-item { font-size: 8px; }
  .brand-mark { width: 78px; }
  .brand-mark img { width: 78px; }
  .profile .name { max-width: 88px; }
}
