:root {
  --lapis: #14365C; --lapis-2: #1E4775; --saffron: #E9A23B; --saffron-soft: #FBEBCF; --glaze: #F3F6F6;
  --fair: #0B6E6E; --fair-soft: #DDF0EE; --high: #9A5B00; --high-soft: #FBEBCF; --vhigh: #A52A3A; --vhigh-soft: #F8E1E1; --vhigh-ink: #7E1D2B;
  --ink: #10202F; --muted: #4E5D6B; --line: #C9D3DA; --chip: #E3E9EE; --card: #FFFFFF;
  --r: 20px; --r-sm: 12px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--glaze); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--lapis); }
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 96px; background: var(--glaze); }
.app.no-nav { padding-bottom: 24px; }
.page { padding: 28px 18px 8px; }
h1 { font-size: 30px; line-height: 1.12; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 0 0 6px; font-weight: 750; line-height: 1.2; }
h3 { font-size: 17px; margin: 0 0 4px; font-weight: 700; }
p { margin: 0; line-height: 1.45; }
.sub { color: var(--muted); font-size: 16px; line-height: 1.4; }
.small { font-size: 14px; color: var(--muted); line-height: 1.4; }
.label { font-weight: 650; font-size: 16px; margin: 20px 0 10px; display: block; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.grid2 > * { min-width: 0; }
/* iPhone Safari: date inputs ignore width:100% and overflow into the next field */
input[type="date"].input { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; height: 54px; line-height: normal; text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="number"].input { height: 54px; }
.stack > * + * { margin-top: 12px; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mt-l { margin-top: 24px; }
.hidden { display: none !important; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; color: var(--lapis); letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; }
.on-dark .brand { color: #fff; }
.pill { font-size: 13px; font-weight: 650; padding: 5px 12px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--muted); background: var(--glaze); white-space: nowrap; }
.tag-ok { color: var(--fair); font-weight: 700; font-size: 15px; }

/* cards */
.card { background: var(--card); border-radius: var(--r); padding: 20px; }
.card.dark { background: var(--lapis); color: #fff; }
.card.dark .small, .card.dark .sub { color: #D5DEE8; }
.card.outline { border: 2.5px solid var(--lapis); }
.card.press { cursor: pointer; transition: transform .08s; }
.card.press:active { transform: scale(.985); }
.tile { background: var(--card); border-radius: var(--r); padding: 18px; min-height: 104px; cursor: pointer; border: 0; text-align: left; }
.tile h3 { font-size: 18px; line-height: 1.2; }
.tile p { color: var(--muted); font-size: 15px; }

/* inputs */
.input, select.input, textarea.input { color: var(--ink); width: 100%; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; padding: 14px 16px; font-size: 17px; outline: none; }
.input:focus { border-color: var(--lapis); box-shadow: 0 0 0 1px var(--lapis); }
.input.big { font-size: 26px; font-weight: 700; border: 2.5px solid var(--lapis); padding: 14px 18px; }
textarea.input { min-height: 90px; resize: vertical; }
.field-label { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: block; }
.card.dark .field-label { color: #fff; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-sm); padding: 14px 18px; font-size: 17px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.block { width: 100%; }
.btn.primary { background: var(--lapis); color: #fff; }
.btn.saffron { background: var(--saffron); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--lapis); }
.btn.line { background: transparent; color: var(--lapis); border: 1.5px solid var(--line); }
.btn.soft { background: var(--chip); color: var(--lapis); font-size: 15px; padding: 10px 14px; }
.btn.big { padding: 18px; font-size: 20px; border-radius: 16px; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 16px; }
.card.dark .linkbtn { color: #fff; }

/* option buttons and chips */
.opts { display: grid; gap: 12px; }
.opts.c2 { grid-template-columns: 1fr 1fr; } .opts.c3 { grid-template-columns: 1fr 1fr 1fr; }
.opt { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 15px 10px; font-size: 18px; font-weight: 600; cursor: pointer; }
.opt.on { background: var(--lapis); color: #fff; border-color: var(--lapis); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 12px 18px; font-size: 17px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--lapis); color: #fff; border-color: var(--lapis); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -18px; margin-right: -18px; padding: 0 18px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--chip); border-radius: 14px; padding: 5px; gap: 4px; }
.seg button { border: 0; background: transparent; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 17px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); }
.seg.dark-on button.on { background: var(--lapis); color: #fff; }

/* header band */
.band { background: var(--lapis); color: #fff; padding: 26px 18px 64px; }
.band h1 { color: #fff; margin-top: 22px; }
.band .sub { color: #D5DEE8; }
.lift { margin-top: -44px; }

/* progress */
.bar { height: 10px; background: #E3E9EE; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--lapis); border-radius: 99px; }

/* steps */
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .dot { flex: 0 0 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; border: 2px solid #8897A5; color: #6B7A88; background: #fff; }
.step .dot.ok { background: var(--fair); border-color: var(--fair); color: #fff; }
.step .dot.now { background: var(--lapis); border-color: var(--lapis); color: #fff; }
.step h3 { font-size: 19px; }
.step p { color: var(--muted); font-size: 16px; }

/* prices */
.range { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; border-radius: 12px; overflow: hidden; }
.range div { background: #EDF1F4; text-align: center; padding: 12px 4px; }
.range div:nth-child(2) { background: #DDE5EC; }
.range span { display: block; color: var(--muted); font-size: 15px; }
.range b { font-size: 22px; letter-spacing: -0.01em; }
.verdict { border-radius: 16px; padding: 16px 20px; }
.verdict h2 { font-size: 26px; margin-bottom: 4px; }
.verdict.fair { background: var(--fair-soft); color: var(--fair); }
.verdict.high { background: var(--high-soft); color: var(--high); }
.verdict.very_high { background: var(--vhigh-soft); color: var(--vhigh-ink); }
.verdict.cheap { background: var(--high-soft); color: var(--high); }
.verdict.stale { background: #EDF1F4; color: var(--muted); }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 4px; border-bottom: 1px solid #E3E9EE; cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--fair); }
.status-dot.soon { background: var(--saffron); } .status-dot.expired { background: var(--vhigh); }

/* city */
.place { display: flex; gap: 16px; }
.arch { flex: 0 0 92px; height: 112px; border-radius: 46px 46px 10px 10px; }
.arch.saffron { background: var(--saffron); } .arch.fair { background: var(--fair); } .arch.lapis { background: var(--lapis); } .arch.vhigh { background: var(--vhigh); }
.place h3 { font-size: 20px; } .place p { color: var(--muted); font-size: 16px; margin: 4px 0 8px; }
.eyebrow { color: var(--saffron); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.eyebrow.dark { color: var(--high); }

/* guides */
.avatar { flex: 0 0 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 22px; background: var(--lapis); }
.avatar.fair { background: var(--fair); } .avatar.saffron { background: var(--saffron); color: var(--ink); }
.rate { text-align: right; } .rate b { font-size: 22px; } .rate span { display: block; color: var(--muted); font-size: 14px; }

/* help */
.sos { background: var(--vhigh); color: #fff; border-radius: var(--r); padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; text-decoration: none; }
.sos b { font-size: 46px; letter-spacing: -0.02em; } .sos h2 { color: #fff; margin: 0; } .sos span { color: #F7DADD; }
.num { background: #fff; border-radius: 16px; padding: 14px 6px; text-align: center; text-decoration: none; color: var(--ink); display: block; }
.num b { display: block; color: var(--vhigh); font-size: 30px; } .num span { color: var(--muted); font-size: 15px; }
.tourist { background: var(--lapis); color: #fff; border-radius: var(--r); padding: 16px 22px; display: flex; justify-content: space-between; align-items: center; text-decoration: none; }
.tourist b { font-size: 40px; } .tourist h3 { color: #fff; margin: 0; } .tourist span { color: #D5DEE8; font-size: 15px; }
.warn { background: var(--saffron-soft); color: #6E4100; border-radius: 16px; padding: 14px 18px; font-size: 16px; line-height: 1.45; }
.warn a { color: #6E4100; font-weight: 700; }
.phrase { background: #fff; border-radius: var(--r); padding: 20px 24px; cursor: pointer; }
.phrase .uz { font-size: 30px; font-weight: 800; line-height: 1.15; }
.phrase .ru { font-size: 24px; font-weight: 700; color: var(--lapis); margin-top: 4px; }
.phrase .tr { color: var(--muted); margin-top: 6px; font-size: 16px; }
.phrase.dark { background: var(--lapis); color: #fff; }
.phrase.dark .ru { color: var(--saffron); } .phrase.dark .tr { color: #D5DEE8; }
.quick { background: #fff; border: 0; border-radius: 16px; padding: 16px 10px; font-weight: 700; font-size: 16px; color: var(--lapis); cursor: pointer; }
.quick.left { text-align: left; color: var(--ink); font-weight: 500; font-size: 17px; padding: 16px 18px; }

/* ask */
.chat { display: flex; flex-direction: column; gap: 14px; padding-bottom: 150px; }
.msg-me { align-self: flex-end; background: var(--lapis); color: #fff; padding: 14px 20px; border-radius: 20px 20px 6px 20px; max-width: 86%; font-size: 18px; line-height: 1.4; }
.msg-ai { background: #fff; padding: 18px 20px; border-radius: 20px 20px 20px 6px; max-width: 100%; font-size: 18px; line-height: 1.45; }
.msg-ai .src { border-top: 1.5px solid #E3E9EE; margin-top: 14px; padding-top: 10px; font-size: 14px; color: var(--muted); }
.ask-bar { position: fixed; left: 0; right: 0; bottom: 88px; max-width: 480px; margin: 0 auto; padding: 10px 18px; background: var(--glaze); }
.ask-bar form { display: flex; gap: 10px; }
.ask-bar .input { border-radius: 16px; }
.send { flex: 0 0 56px; border: 0; border-radius: 16px; background: var(--lapis); color: #fff; cursor: pointer; display: grid; place-items: center; }

/* money */
.big-num { font-size: 46px; font-weight: 800; color: var(--lapis); letter-spacing: -0.02em; line-height: 1.1; }

/* bottom nav */
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #DDE4E9; z-index: 20; }
.nav .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 4px calc(10px + env(safe-area-inset-bottom)); }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500; padding: 4px 0; }
.nav a svg { width: 30px; height: 30px; }
.nav a.on { color: var(--lapis); font-weight: 750; }
.nav a.help { color: var(--vhigh); font-weight: 700; }

/* overlays */
.overlay { position: fixed; inset: 0; background: rgba(16, 32, 47, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--glaze); width: 100%; max-width: 480px; border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
.showcard { position: fixed; inset: 0; z-index: 60; background: var(--lapis); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 32px 26px; cursor: pointer; }
.showcard .uz { font-size: clamp(36px, 10vw, 60px); font-weight: 800; line-height: 1.1; }
.showcard .ru { font-size: clamp(28px, 7vw, 44px); font-weight: 700; color: var(--saffron); margin-top: 14px; line-height: 1.15; }
.showcard .tr { font-size: 20px; color: #D5DEE8; margin-top: 18px; }
.showcard .hint { position: absolute; bottom: 30px; left: 26px; right: 26px; font-size: 15px; color: #B8C6D4; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 110px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 70; font-size: 15px; max-width: 90vw; text-align: center; }
.back { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--lapis); font-weight: 700; font-size: 16px; padding: 0; margin-bottom: 14px; cursor: pointer; }
.body-text { font-size: 17px; line-height: 1.55; white-space: pre-line; }
.err { color: var(--vhigh); font-size: 15px; margin-top: 8px; }
.results { margin-top: 10px; }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px #E3E9EE; } }

/* city switcher and section tabs: always fit the screen, never cut off */
.city-seg { display: flex; gap: 2px; }
.city-seg button { flex: 1 1 auto; padding: 10px 7px; font-size: 14px; white-space: nowrap; }
.tabs-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs-grid .chip { flex: 1 1 auto; padding: 11px 12px; font-size: 16px; text-align: center; white-space: nowrap; }

/* ===== Responsive: tablet and desktop ===== */
.nav .nav-brand, .nav .nav-ask { display: none; }
.nav a.mob-on { color: var(--lapis); font-weight: 750; }
.tile, .card.press { transition: box-shadow .15s ease, transform .08s ease; }

@media (min-width: 640px) and (max-width: 959px) {
  .app, .nav .in, .ask-bar { max-width: 640px; }
  .page { padding: 32px 28px 8px; }
  .band { padding: 30px 28px 64px; }
  .page.start { padding-top: 40px; }
}

@media (min-width: 960px) {
  body { background: var(--glaze); }
  .app { max-width: none; padding: 76px 0 64px; box-shadow: none !important; }
  .app.no-nav { padding: 56px 20px; }
  .page { max-width: 1160px; margin: 0 auto; padding: 44px 40px 8px; }
  .page.narrow { max-width: 860px; }
  h1 { font-size: 40px; }
  .tile:hover, .card.press:hover { box-shadow: 0 8px 24px rgba(16, 32, 47, .10); }

  /* top navigation bar */
  .nav { top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid #DDE4E9; }
  .nav .in { max-width: 1160px; display: flex; align-items: center; gap: 4px; height: 76px; padding: 0 40px; }
  .nav a { flex-direction: row; gap: 8px; font-size: 16px; padding: 10px 14px; border-radius: 12px; }
  .nav a svg { width: 22px; height: 22px; }
  .nav a:hover { background: #EEF2F5; }
  .nav a.on { background: #E6ECF1; }
  .nav a.mob-on { color: var(--muted); font-weight: 500; }
  .nav a.help { margin-left: 8px; border: 1.5px solid #EBC8CD; }
  .nav .nav-brand { display: flex; margin-right: auto; color: var(--lapis); font-size: 23px; padding: 0; gap: 10px; }
  .nav .nav-brand:hover { background: none; }
  .nav .nav-brand svg { width: 34px; height: 34px; }
  .nav .nav-brand b { font-weight: 800; letter-spacing: -0.01em; }
  .nav .nav-ask { display: flex; }

  /* home */
  .band { padding: 52px 0 108px; }
  .band-in { max-width: 1160px; margin: 0 auto; padding: 0 40px; }
  .band .mob-only { display: none; }
  .band-in > .row { justify-content: flex-end; margin-bottom: 4px; }
  .band h1 { font-size: 46px; margin-top: 0; }
  .band .sub { font-size: 18px; }
  .lift { margin-top: -68px; }
  .home-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: stretch; }
  .home-top > * { margin: 0 !important; }
  .home-top .card { padding: 26px 28px; }
  .grid2.tiles4 { grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 20px; }
  .tile { min-height: 148px; padding: 26px; }
  .tile h3 { font-size: 21px; }

  /* arrival kit */
  .kit-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; margin-top: 24px; }
  .kit-layout > * { margin: 0 !important; }
  .kit-side { position: sticky; top: 100px; padding: 28px; }
  .kit-side h2 { font-size: 26px; }

  /* fair price */
  .price-page .card.mt { padding: 30px; }
  .price-split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
  .price-split .field-label { margin-top: 0 !important; }
  .chips.scroll { flex-wrap: wrap; margin-left: 0; margin-right: 0; padding: 0; overflow: visible; }
  .city-seg { max-width: 560px; }
  .tabs-grid .chip { flex: 0 0 auto; min-width: 130px; }
  .city-seg button { font-size: 15px; }

  /* city */
  .city-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .city-grid > * { margin: 0 !important; }
  .city-grid .span-all { grid-column: 1 / -1; padding: 30px 32px; }
  .city-grid .span-all h2 { font-size: 28px; }

  /* guides */
  .guides-layout { display: grid; grid-template-columns: 1.45fr 1fr; gap: 24px; align-items: start; }
  .guides-side { position: sticky; top: 92px; }
  .guides-side form { padding: 26px; }

  /* help */
  .help-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
  .help-layout .label { margin-top: 16px; }

  /* money */
  .money-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
  .money-layout .label { margin-top: 16px; }

  /* ask */
  .ask-bar { bottom: 0; max-width: 860px; padding: 14px 40px 24px; }
  .chat { padding-bottom: 180px; }
  .msg-me, .msg-ai { max-width: 78%; }

  /* onboarding */
  .page.start { max-width: 660px; background: #fff; border-radius: 28px; padding: 44px 52px; box-shadow: 0 12px 40px rgba(16, 32, 47, .08); }

  /* overlays */
  .overlay { align-items: center; padding: 24px; }
  .sheet { border-radius: 24px; max-width: 520px; padding: 28px; }
  .toast { bottom: 32px; }
}
