:root {
  --blue: #0a6cf0;
  --blue-2: #3d8bff;
  --blue-dark: #0848b0;
  --blue-soft: #e8f1ff;
  --bg: #f3f7ff;
  --card: #ffffff;
  --text: #12223d;
  --muted: #6b7c99;
  --line: #e3ebf8;
  --danger: #e5484d;
  --ok: #12a150;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(16, 60, 140, .12);
  --tabbar-h: 64px;
  /* В полноэкранном режиме Telegram контент уходит под статус-бар (safe-area) и под кнопки
     «Закрыть / ⋯» (content-safe-area) — отступаем на сумму обоих. Вне Telegram — env(). */
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: Manrope, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3 { margin: 0; }
.screen { position: fixed; inset: 0; }

/* ---------- buttons ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 14px; font-weight: 700; font-size: 16px; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--blue-2), var(--blue)); color: #fff; box-shadow: 0 6px 18px rgba(10, 108, 240, .35); }
.btn.primary:disabled { opacity: .6; }
.btn.ghost { background: var(--blue-soft); color: var(--blue); }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.link { color: var(--blue); font-weight: 600; padding: 10px; }
.btn.small { padding: 10px 14px; font-size: 14px; width: auto; border-radius: 12px; }
.chip-btn { background: var(--blue-soft); color: var(--blue); font-weight: 700; padding: 8px 14px; border-radius: 999px; font-size: 14px; }

/* ---------- onboarding ---------- */
#onboarding { background: linear-gradient(180deg, #fff 0%, #eaf2ff 100%); display: flex; flex-direction: column; overflow: hidden; }
.ob-track { flex: 1; display: flex; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.ob-slide { min-width: 100%; padding: calc(28px + var(--safe-t)) 26px 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ob-slide h1 { font-size: 27px; font-weight: 800; margin-top: 26px; letter-spacing: -.3px; }
.ob-slide p { color: var(--muted); line-height: 1.5; margin: 12px 0 0; max-width: 360px; }
.ob-art { width: 100%; max-width: 360px; height: 300px; border-radius: 28px; position: relative; flex-shrink: 0; }
#ob-art-1 { background: radial-gradient(circle at 30% 20%, #5aa2ff, #0a6cf0 70%); box-shadow: var(--shadow); overflow: hidden; }
#ob-art-1 svg { width: 100%; height: 100%; }
.ob-features { display: flex; flex-direction: column; gap: 10px; justify-content: center; height: auto; min-height: 300px; }
.feat { display: flex; gap: 14px; align-items: center; text-align: left; background: #fff; border-radius: 18px; padding: 14px 16px; box-shadow: 0 4px 16px rgba(16, 60, 140, .08); }
.feat span { font-size: 26px; width: 46px; height: 46px; border-radius: 14px; background: var(--blue-soft); display: grid; place-items: center; flex-shrink: 0; }
.feat b { display: block; font-size: 15px; }
.feat small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.ob-badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-content: center; padding: 10px; }
.ob-badges .badge { width: 100%; }
.ob-bottom { padding: 18px 26px calc(18px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dots { display: flex; gap: 8px; margin-bottom: 10px; }
.dots i { width: 8px; height: 8px; border-radius: 8px; background: #c8d8f2; transition: all .3s; }
.dots i.on { width: 26px; background: var(--blue); }

/* ---------- auth ---------- */
#auth { overflow-y: auto; background: linear-gradient(180deg, #0a6cf0 0, #3d8bff 230px, var(--bg) 230px); padding: calc(28px + var(--safe-t)) 18px 30px; }
.auth-head { text-align: center; color: #fff; margin-bottom: 22px; }
.auth-head .logo { width: 72px; height: 72px; border-radius: 22px; background: #fff; margin: 0 auto 12px; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(0, 0, 0, .15); }
.auth-head .logo img { width: 46px; }
.auth-head h1 { font-size: 26px; font-weight: 800; }
.auth-head .muted { color: rgba(255, 255, 255, .85); margin: 4px 0 0; }
.auth-card { background: var(--card); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); max-width: 440px; margin: 0 auto; }
.auth-card h2 { font-size: 21px; margin-bottom: 6px; }
.seg { display: flex; background: var(--bg); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.seg button { flex: 1; padding: 10px; border-radius: 11px; font-weight: 700; color: var(--muted); transition: all .2s; }
.seg button.on { background: #fff; color: var(--blue); box-shadow: 0 2px 8px rgba(16, 60, 140, .1); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
label input, label select, label textarea, .field {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px;
  background: #fbfdff; font-size: 16px; color: var(--text); outline: none; transition: border .2s;
}
label input, label select, .select-field { min-height: 50px; }
label input { height: 50px; -webkit-appearance: none; appearance: none; line-height: normal; }
label input[type=date] { min-width: 0; max-width: 100%; text-align: left; padding-top: 0; padding-bottom: 0; }
label input[type=date]::-webkit-date-and-time-value { text-align: left; }
label input[type=date]::-webkit-calendar-picker-indicator { opacity: .5; margin: 0; }
label textarea { resize: none; }
label input:focus, label textarea:focus { border-color: var(--blue); background: #fff; }
.form-err { color: var(--danger); font-size: 14px; min-height: 18px; margin: 2px 0 10px; }
.code-input { width: 100%; text-align: center; font-size: 32px; letter-spacing: 12px; font-weight: 800; padding: 14px; border-radius: 16px; border: 2px solid var(--line); margin: 16px 0 6px; outline: none; color: var(--blue); }
.code-input:focus { border-color: var(--blue); }
.dev-code { background: #fff7e0; color: #8a5a00; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
.spam-note { background: var(--blue-soft); color: #23426e; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-top: 12px; }

/* ---------- app / map ---------- */
#map { position: absolute; inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0; background: #aad3df; z-index: 0; }
.leaflet-control-attribution { font-size: 9px; opacity: .7; }
.leaflet-control-zoom { display: none; }
.map-ui { position: absolute; inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0; pointer-events: none; z-index: 500; }
.map-ui > * { pointer-events: auto; }
.top-bar { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; }
.search { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-radius: 16px; padding: 0 14px; box-shadow: var(--shadow); }
.search.solid { box-shadow: none; border: 1.5px solid var(--line); background: #fff; }
.search svg { width: 20px; height: 20px; fill: var(--muted); flex-shrink: 0; }
.search input { flex: 1; border: 0; outline: 0; background: none; padding: 14px 0; font-size: 16px; min-width: 0; }
.dropdown { margin-top: 8px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); max-height: 50vh; overflow-y: auto; }
.dropdown .row { border-bottom: 1px solid var(--line); }
.dropdown .row:last-child { border: 0; }
.viewing { margin-top: 8px; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.viewing .grow { flex: 1; min-width: 0; }
.viewing b { display: block; }
.viewing small { color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; background: var(--bg); display: grid; place-items: center; font-size: 18px; color: var(--muted); flex-shrink: 0; }
.map-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(18, 34, 61, .82); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.mine-card { display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .96); border-radius: 16px; padding: 12px 12px 12px 16px; box-shadow: var(--shadow); }
.mine-card b { display: block; font-size: 17px; }
.mine-card small { color: var(--muted); }
.fab { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: linear-gradient(135deg, var(--blue-2), var(--blue)); color: #fff; font-weight: 800; font-size: 16px; padding: 15px 24px; border-radius: 999px; box-shadow: 0 10px 26px rgba(10, 108, 240, .45); white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.fab span { font-size: 20px; line-height: 1; }
.fab:active { transform: translateX(-50%) scale(.97); }

.pin { width: 26px; height: 34px; transform-origin: 50% 100%; }
.pin svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.airport-label { background: none; border: 0; box-shadow: none; font-weight: 800; font-size: 11px; color: var(--blue-dark); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; padding: 0; }
.airport-label::before { display: none; }

/* ---------- tabbar ---------- */
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #fff; display: flex; border-top: 1px solid var(--line); z-index: 800; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #9aa9c2; font-size: 11px; font-weight: 700; }
.tabbar svg { width: 25px; height: 25px; fill: currentColor; transition: transform .2s; }
.tabbar button.on { color: var(--blue); }
.tabbar button.on svg { transform: translateY(-1px) scale(1.06); }

/* ---------- panels ---------- */
.panel { position: absolute; inset: 0 0 calc(var(--tabbar-h) + var(--safe-b)) 0; background: var(--bg); overflow-y: auto; z-index: 600; -webkit-overflow-scrolling: touch; }
.panel-head { position: sticky; top: 0; background: var(--bg); padding: calc(16px + var(--safe-t)) 16px 12px; z-index: 2; }
.panel-head h1 { font-size: 26px; font-weight: 800; margin-bottom: 12px; }
.pax-list { padding: 0 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; width: 100%; text-align: left; }
.pax-list .row { border-radius: 18px; box-shadow: 0 2px 10px rgba(16, 60, 140, .06); }
.row .grow { flex: 1; min-width: 0; }
.row b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { color: var(--muted); font-size: 13px; }
.row .mini-badges { display: flex; }
.row .mini-badges .badge { width: 26px; margin-left: -6px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; line-height: 1.5; }
.empty .big { font-size: 44px; display: block; margin-bottom: 8px; }

/* ---------- avatar ---------- */
.avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(135deg, var(--blue-2), var(--blue-dark)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; overflow: hidden; position: relative; }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.avatar.xl { width: 104px; height: 104px; font-size: 40px; border: 4px solid #fff; box-shadow: var(--shadow); }

/* ---------- profile ---------- */
.profile-hero { background: linear-gradient(160deg, #3d8bff, #0a6cf0 60%, #0848b0); color: #fff; padding: calc(24px + var(--safe-t)) 16px 64px; text-align: center; position: relative; overflow: hidden; }
.profile-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8, 20, 45, 0) 45%, rgba(8, 20, 45, .28)); pointer-events: none; }
.profile-hero h2, .profile-hero .email { text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.profile-hero .back { position: absolute; left: 12px; top: calc(12px + var(--safe-t)); background: rgba(255, 255, 255, .2); color: #fff; z-index: 1; }
.avatar-wrap { position: relative; width: 104px; height: 104px; margin: 0 auto; z-index: 1; }
.avatar-wrap .edit { position: absolute; right: -6px; bottom: -2px; width: 42px; height: 42px; padding: 0; margin: 0; border-radius: 50%; background: #fff; color: var(--blue); display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0, 0, 0, .22); border: 3px solid var(--blue-soft); }
.avatar-wrap .edit svg { width: 20px; height: 20px; }
.profile-hero { background-size: cover; background-position: center; }
.profile-hero.has-img::after { background: linear-gradient(180deg, rgba(8, 20, 45, .35), rgba(8, 20, 45, .15) 40%, rgba(8, 20, 45, .55)); }
.profile-hero.has-img h2, .profile-hero.has-img .email { text-shadow: 0 1px 6px rgba(0, 0, 0, .45); }
.banner-btn { position: absolute; right: 12px; top: calc(12px + var(--safe-t)); z-index: 2; display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .22); backdrop-filter: blur(8px); color: #fff; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 999px; }
.banner-btn svg { width: 18px; height: 18px; }
.banner-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.banner-opt { height: 72px; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); border-radius: 14px; color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: flex-end; padding: 8px 10px; border: 3px solid transparent; }
.banner-opt.on { border-color: var(--blue); box-shadow: 0 0 0 2px #fff inset; }
.btn-ico { width: 20px; height: 20px; }
.profile-hero h2 { font-size: 23px; font-weight: 800; margin-top: 10px; position: relative; z-index: 1; }
.profile-hero .email { font-size: 12px; opacity: .8; margin-top: 2px; position: relative; z-index: 1; }
.profile-badges { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.profile-badges .badge { width: 40px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25)); }
.profile-body { padding: 0 16px 24px; margin-top: -44px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.card { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: 0 2px 12px rgba(16, 60, 140, .07); }
.card h3 { font-size: 16px; font-weight: 800; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--bg); border-radius: 14px; padding: 12px; }
.stat b { display: block; font-size: 24px; font-weight: 800; color: var(--blue); letter-spacing: -.5px; }
.stat small { color: var(--muted); font-size: 12px; font-weight: 600; }
.stat.wide { grid-column: span 2; display: flex; align-items: center; gap: 12px; }
.stat.wide .ico { width: 46px; height: 46px; background: #fff; border-radius: 12px; display: grid; place-items: center; color: var(--blue); flex-shrink: 0; }
.stat.wide .ico svg { width: 26px; height: 26px; }
.stat.wide .ico.arms { width: 54px; height: 54px; padding: 0; background: none; border: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--blue), 0 2px 6px rgba(16, 60, 140, .2); }
.stat.wide .ico.arms img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transform: scale(1.12); }
.stat b i { font-style: normal; font-size: 14px; font-weight: 700; margin-left: 2px; }
.stat-ico { width: 22px; height: 22px; color: var(--blue); opacity: .85; display: block; margin-bottom: 6px; }
.stat.wide b { font-size: 18px; }

.seg.mini { margin: 0; padding: 3px; }
.seg.mini button { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.card h3 > span { flex: 1; }
.chart { position: relative; }
.chart svg { width: 100%; height: 170px; display: block; overflow: visible; }
.chart .bar { fill: var(--blue); }
.chart .bar.zero { fill: #dfe8f7; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; font-weight: 600; }
.chart .val { fill: var(--text); font-size: 10px; font-weight: 800; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); background: var(--text); color: #fff; font-size: 12px; font-weight: 700; padding: 6px 9px; border-radius: 9px; white-space: nowrap; pointer-events: none; }

.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; }
.badge-cell { text-align: center; font-size: 12px; font-weight: 700; }
.badge-cell .badge { width: 72%; max-width: 80px; display: block; margin: 0 auto 6px; }
.badge-cell small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.badge-cell.locked .badge { filter: grayscale(1) opacity(.45); }
.progress { height: 4px; background: var(--line); border-radius: 4px; margin: 4px auto 0; width: 70%; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.pick-row { display: flex; gap: 12px; }
.pick-badge { flex: 1; background: var(--bg); border-radius: 16px; padding: 14px 8px; text-align: center; font-size: 13px; font-weight: 700; }
.pick-badge .badge { width: 64px; display: block; margin: 0 auto 8px; }
.pick-badge small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; margin-top: 2px; }
.badge { aspect-ratio: 1; display: inline-block; }
.badge svg, .badge img { width: 100%; height: 100%; display: block; }
.round-img { border-radius: 50%; background: #fff; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--blue), 0 2px 6px rgba(0, 0, 0, .15); overflow: hidden; display: grid; place-items: center; }
.round-img img { width: 82%; height: auto; object-fit: contain; }
.round-img.flag img, .round-img.sq img { width: 100%; height: 100%; object-fit: cover; }
.round-img.sq b { color: var(--blue); font-size: 14px; font-weight: 800; }
.round-img.in-list { width: 40px; flex-shrink: 0; border-width: 2px; box-shadow: 0 0 0 1px var(--line); }
.round-img.empty-b { background: var(--blue-soft); color: var(--blue); box-shadow: 0 0 0 2px #c8dbff; display: flex; align-items: center; justify-content: center; }
.round-img.empty-b svg { width: 42%; height: 42%; stroke-width: 2.4; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 1000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10, 25, 50, .35); animation: fade .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; background: #fff; border-radius: 24px 24px 0 0; padding: 8px 0 calc(16px + var(--safe-b)); display: flex; flex-direction: column; animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.grab { width: 40px; height: 5px; border-radius: 5px; background: #d5dfef; margin: 0 auto 10px; flex-shrink: 0; }
.sheet-body { overflow-y: auto; padding: 0 16px; }
.sheet h2 { font-size: 20px; font-weight: 800; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.route-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0 14px; }
.route-head .ap { flex: 1; min-width: 0; }
.route-head .ap:last-child { text-align: right; }
.route-head .code { font-size: 30px; font-weight: 800; color: var(--blue); letter-spacing: -.5px; }
.route-head .city { font-size: 13px; color: var(--muted); font-weight: 600; line-height: 1.3; }
.route-head .mid { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.route-head .mid .plane { width: 64px; height: 20px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.kv > div { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.kv small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kv b { font-size: 15px; }
.kv .wide { grid-column: span 2; display: flex; align-items: center; gap: 12px; }
.kv .wide img.logo { height: 28px; max-width: 90px; object-fit: contain; }
.kv .wide .ac { width: 70px; height: 40px; flex-shrink: 0; }
.note { background: var(--blue-soft); border-radius: 14px; padding: 12px; font-size: 14px; line-height: 1.45; margin-bottom: 14px; white-space: pre-wrap; word-break: break-word; }
.actions { display: flex; gap: 8px; margin-top: 4px; }
.actions .btn { flex: 1; }
.flight-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.flight-row .codes { font-weight: 800; font-size: 16px; }
.flight-row .grow { flex: 1; min-width: 0; }
.flight-row small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flight-row .logo { width: 44px; height: 22px; object-fit: contain; }
.tag { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 8px; flex-shrink: 0; }
.tag.pub { background: #e3f7ec; color: var(--ok); }
.tag.priv { background: #eef1f6; color: var(--muted); }
.sheet-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 10px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: var(--bg); z-index: 1100; display: flex; flex-direction: column; animation: up .3s cubic-bezier(.2, .8, .2, 1); }
#picker { z-index: 1200; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 14px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.modal-head h2 { flex: 1; font-size: 18px; font-weight: 800; }
.modal-body { flex: 1; overflow-y: auto; padding: 16px; }
.modal-foot { padding: 12px 16px calc(12px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.modal .profile-body { margin-top: -44px; }
.modal.flush .modal-body { padding: 0; }

.select-field { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 6px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 13px; background: #fbfdff; text-align: left; min-height: 52px; color: var(--text); }
.select-field .grow { flex: 1; min-width: 0; }
.select-field b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-field small { color: var(--muted); font-weight: 500; font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-field .ph { color: #9aa9c2; font-weight: 500; }
.select-field .chev { color: #b4c2d9; font-size: 20px; }
.select-field img.logo { width: 54px; height: 24px; object-fit: contain; }
.select-field .ac { width: 56px; height: 32px; flex-shrink: 0; }
.ap-badge { background: var(--blue-soft); color: var(--blue); font-weight: 800; border-radius: 10px; padding: 7px 8px; font-size: 13px; min-width: 54px; text-align: center; flex-shrink: 0; }
/* откуда / куда с кнопкой «поменять местами» ровно посередине */
.route-fields { position: relative; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.select-field.route { margin: 0; padding-right: 66px; min-height: 64px; }
.select-field .cap { color: var(--muted); font-size: 12px; font-weight: 600; }
.rf-ico { width: 24px; height: 24px; color: var(--blue); flex-shrink: 0; }
.swap-btn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); color: var(--blue); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(16, 60, 140, .1); z-index: 1; }
.swap-btn svg { width: 22px; height: 22px; }
.swap-btn:active { transform: translateY(-50%) rotate(180deg); transition: transform .2s; }
label .ico { width: 16px; height: 16px; color: var(--blue); vertical-align: -3px; margin-right: 6px; }
label .opt { font-weight: 500; color: #9aa9c2; }
label.label-only { margin-bottom: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.hint { font-size: 12px; color: var(--blue); font-weight: 600; margin: -6px 0 12px; }
.hint button { color: var(--blue); text-decoration: underline; font-weight: 700; font-size: 12px; padding: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1.5px solid var(--line); border-radius: 13px; padding: 12px 14px; margin-bottom: 12px; }
.toggle-row b { display: block; font-size: 15px; }
.toggle-row small { color: var(--muted); font-size: 12px; }
.switch { width: 50px; height: 30px; border-radius: 30px; background: #cfd9ea; position: relative; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(20px); }

.pick-list { display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden; }
.pick-list .row { border-bottom: 1px solid var(--line); }
.pick-list .row:last-child { border: 0; }
.pick-list .row img.logo { width: 64px; height: 28px; object-fit: contain; flex-shrink: 0; }
.pick-list .row .ac { width: 84px; height: 40px; flex-shrink: 0; }
.pick-list .row .flag { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.group-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 16px 4px 8px; }
.group-title:first-child { margin-top: 0; }
.logo-fallback { width: 64px; height: 28px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 800; font-size: 12px; display: grid; place-items: center; flex-shrink: 0; }

.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 2000; box-shadow: var(--shadow); max-width: calc(100% - 32px); animation: fade .2s; text-align: center; }
.toast.err { background: var(--danger); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-note { margin: 0 0 14px; }
.btn.danger-link { color: var(--danger); font-size: 14px; margin-top: -4px; }
