:root {
  --accent: #fcdb1e;
  --accent-dark: #e6c400;
  --text: #21201f;
  --muted: #9e9b98;
  --bg: #ffffff;
  --gray: #f2f1ef;
  --gray2: #e8e6e3;
  --red: #f33;
  --radius: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #ddd; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--text); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; }
#app { position: relative; max-width: 480px; height: 100%; margin: 0 auto; background: var(--bg); overflow: hidden; }
.muted { color: var(--muted); }
.center { text-align: center; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column; overflow-y: auto; background: var(--bg); }
.screen.active { display: flex; }
.screen.overlay { z-index: 1000; }

/* ---------- Главная ---------- */
.home-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px; }
.icon-btn { width: 44px; height: 44px; font-size: 24px; border-radius: 50%; }
.brand { text-align: center; }
.logo { font-weight: 800; font-size: 28px; letter-spacing: -1px; }
.logo span { background: var(--text); color: var(--accent); border-radius: 10px; padding: 0 8px; font-style: italic; }
.cur-addr { font-size: 16px; margin-top: 2px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { display: inline-block; background: var(--text); color: #fff; border-radius: 50%; width: 18px; height: 18px; line-height: 17px; font-style: normal; font-size: 14px; }
.pill-btn { background: var(--gray); border-radius: 24px; padding: 10px 14px; font-size: 15px; white-space: nowrap; }

.tiles { padding: 16px; }
.tile { width: 100%; background: var(--gray); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; align-items: center; transition: transform .1s; }
.tile:active { transform: scale(.98); }
.tile-img { font-size: 72px; line-height: 1; }
.tile-title { font-size: 20px; font-weight: 600; margin-top: 8px; }
.tile-title .muted { font-weight: 400; }

.search-bar { margin: 4px 16px 8px; display: flex; gap: 14px; align-items: center; background: var(--gray); border-radius: 32px; padding: 18px 22px; font-size: 20px; text-align: left; }
.search-ph { font-weight: 600; }

.addr-list { list-style: none; margin: 0; padding: 0 16px; }
.addr-list li { display: flex; align-items: center; gap: 14px; padding: 10px 0; cursor: pointer; }
.addr-list li + li .a-text { border-top: 1px solid var(--gray2); }
.a-ico { flex: 0 0 48px; height: 48px; border-radius: 14px; background: var(--gray); display: grid; place-items: center; font-size: 20px; }
.a-text { flex: 1; min-width: 0; padding: 6px 0; }
.a-title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-sub { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-time { color: var(--muted); font-size: 16px; }

/* ---------- Карта ---------- */
#map { position: absolute; inset: 0; z-index: 1; }
.map-top { position: absolute; top: 0; left: 0; right: 0; z-index: 400; text-align: center; padding: 18px 70px 0; pointer-events: none; }
.your-addr .small { font-size: 15px; }
.your-addr .big { font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 6px #fff; }
.center-pin { position: absolute; left: 50%; top: 38%; z-index: 401; transform: translate(-50%, -100%); pointer-events: none; display: flex; flex-direction: column; align-items: center; transition: transform .15s; }
.center-pin.lift { transform: translate(-50%, calc(-100% - 12px)); }
.pin-head { background: #fff; border-radius: 16px; padding: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.pin-head span { display: grid; place-items: center; min-width: 52px; height: 52px; background: var(--accent); border-radius: 12px; font-weight: 700; font-size: 14px; padding: 0 6px; }
.pin-leg { width: 3px; height: 26px; background: var(--text); border-radius: 0 0 2px 2px; }
.center-pin.hidden { display: none; }
.round-btn { position: absolute; z-index: 400; width: 56px; height: 56px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 22px; }
.btn-back { left: 12px; top: 16px; }
.btn-locate { right: 12px; bottom: calc(var(--sheet-h, 300px) + 12px); transition: bottom .2s; }

.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 500; background: #fff; border-radius: 28px 28px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(0,0,0,.08); max-height: 75%; overflow-y: auto; }
.sheet-grip { width: 40px; height: 5px; background: var(--gray2); border-radius: 3px; margin: 0 auto 10px; }
.step { display: none; }
.step.active { display: block; }
.sheet-title { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 800; margin: 4px 0 12px; }
.sheet-title.center { justify-content: center; font-size: 24px; }
.brand-dot { width: 44px; height: 44px; border-radius: 50%; background: conic-gradient(var(--accent) 0 50%, var(--text) 50% 75%, #f5f0e6 75%); }
.where-btn { width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; background: var(--gray); border-radius: 20px; padding: 18px; font-size: 20px; font-weight: 600; position: relative; }
.where-btn i { position: absolute; right: 18px; font-style: normal; background: var(--text); color: #fff; width: 24px; height: 24px; border-radius: 50%; line-height: 23px; }

.route-box { background: var(--gray); border-radius: 18px; padding: 4px 14px; margin-bottom: 12px; }
.route-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-size: 17px; cursor: pointer; }
.route-row + .route-row { border-top: 1px solid var(--gray2); }
.route-row span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-info { color: var(--muted); font-size: 14px; white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.dot-a { background: var(--text); box-shadow: inset 0 0 0 3px var(--text), inset 0 0 0 5px #fff; background: #fff; border: 4px solid var(--text); }
.dot-b { background: #fff; border: 4px solid #e53935; }

.tariffs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.tariffs::-webkit-scrollbar { display: none; }
.tariff { flex: 0 0 104px; background: var(--gray); border-radius: 18px; padding: 10px; text-align: left; border: 2px solid transparent; }
.tariff.sel { background: #fff; border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.tariff .t-ico { font-size: 34px; }
.tariff .t-name { font-size: 14px; }
.tariff .t-price { font-size: 17px; font-weight: 700; }
.tariff .t-eta { font-size: 12px; color: var(--muted); }

.order-opts { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.opt-btn { flex: 0 0 auto; background: var(--gray); border-radius: 14px; padding: 10px 14px; font-size: 14px; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

.main-btn { width: 100%; background: var(--accent); border-radius: 18px; padding: 18px; font-size: 18px; font-weight: 700; }
.main-btn:active { background: var(--accent-dark); }
.main-btn:disabled { opacity: .5; }
.secondary-btn { width: 100%; background: var(--gray); border-radius: 18px; padding: 16px; font-size: 17px; margin-top: 12px; }

.search-anim { display: flex; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.search-anim span { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); animation: bounce 1.2s infinite; }
.search-anim span:nth-child(2) { animation-delay: .2s; }
.search-anim span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.6); opacity: .5 } 40% { transform: scale(1.1); opacity: 1 } }
.order-summary { background: var(--gray); border-radius: 16px; padding: 12px 14px; margin-top: 14px; font-size: 15px; line-height: 1.5; }
.order-summary b { font-weight: 600; }

.ride-status { font-size: 24px; font-weight: 800; }
.ride-sub { margin: 2px 0 12px; }
.car-card { display: flex; align-items: center; gap: 12px; background: var(--gray); border-radius: 18px; padding: 14px; }
.plate { border: 2px solid var(--text); border-radius: 8px; padding: 4px 8px; font-weight: 700; font-size: 17px; letter-spacing: 1px; background: #fff; white-space: nowrap; }
.car-info { flex: 1; min-width: 0; }
.car-emoji { font-size: 40px; }
.ride-actions { display: flex; gap: 8px; margin-top: 12px; }
.ride-actions .act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--gray); border-radius: 16px; padding: 12px 6px; font-size: 20px; text-decoration: none; color: inherit; }
.ride-actions .act span { font-size: 13px; }

.done-price { font-size: 44px; font-weight: 800; text-align: center; }
.stars { display: flex; justify-content: center; gap: 6px; font-size: 42px; color: var(--gray2); margin: 6px 0; }
.stars b { cursor: pointer; }
.stars b.on { color: var(--accent); }
.tips { display: flex; gap: 6px; margin: 8px 0; }
.tips button { flex: 1; background: var(--gray); border-radius: 12px; padding: 10px 4px; font-size: 14px; }
.tips button.sel { background: var(--accent); }
textarea { width: 100%; min-height: 64px; border: 0; background: var(--gray); border-radius: 14px; padding: 12px; margin-bottom: 12px; resize: vertical; }

/* ---------- Поиск адреса ---------- */
.search-head { display: flex; gap: 8px; padding: 12px 12px 8px; align-items: flex-start; }
.search-fields { flex: 1; background: var(--gray); border-radius: 18px; padding: 0 14px; }
.sf { display: flex; align-items: center; gap: 12px; }
.sf + .sf { border-top: 1px solid var(--gray2); }
.sf input { flex: 1; border: 0; background: none; padding: 14px 0; font-size: 18px; outline: none; }
.pick-on-map { margin: 4px 16px 8px; padding: 12px; background: var(--gray); border-radius: 14px; text-align: left; font-size: 16px; }

/* ---------- Профиль ---------- */
.plain-head { display: flex; align-items: center; gap: 8px; padding: 12px; }
.plain-head h2 { margin: 0; font-size: 22px; }
.profile-top { text-align: center; }
.avatar { width: 100px; height: 100px; border-radius: 50%; background: #fdf3c4; display: grid; place-items: center; font-size: 48px; margin: 0 auto 10px; }
.p-name { font-size: 26px; font-weight: 700; }
.p-quick { display: flex; justify-content: space-around; margin: 20px 8px; }
.p-quick button { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; }
.p-quick span { width: 58px; height: 58px; border-radius: 50%; background: var(--gray); display: grid; place-items: center; font-size: 24px; }
.card-group { margin: 0 16px 14px; background: var(--gray); border-radius: 24px; overflow: hidden; }
.row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-align: left; font-size: 18px; }
.row + .row { border-top: 1px solid var(--gray2); }
.ri { font-size: 22px; }
.rt { flex: 1; display: flex; flex-direction: column; }
.rt small { color: var(--muted); font-size: 14px; }
.row i { font-style: normal; font-size: 22px; }

.page-body { padding: 0 16px 24px; }
.hist { background: var(--gray); border-radius: 18px; padding: 14px; margin-bottom: 10px; }
.hist .h-top { display: flex; justify-content: space-between; font-weight: 600; }
.hist .h-route { margin: 6px 0; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 12px; background: #fff; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; border: 0; background: var(--gray); border-radius: 14px; padding: 14px; font-size: 17px; }
.choice { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--gray); border-radius: 14px; margin-bottom: 8px; font-size: 17px; text-align: left; border: 2px solid transparent; }
.choice.sel { border-color: var(--accent); background: #fff; }
.choice .c-right { margin-left: auto; color: var(--muted); }

/* ---------- Модалка / тост ---------- */
.modal { position: absolute; inset: 0; z-index: 2000; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; }
.modal[hidden] { display: none; }
.modal-box { width: 100%; background: #fff; border-radius: 28px 28px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
.modal-box h3 { margin: 0 0 14px; font-size: 22px; }
.modal-btns { display: flex; gap: 8px; }
.modal-btns .secondary-btn { margin-top: 0; }
.toast { position: absolute; left: 16px; right: 16px; top: 16px; z-index: 3000; background: var(--text); color: #fff; border-radius: 14px; padding: 14px; font-size: 15px; }
.toast[hidden] { display: none; }

/* маркеры на карте */
.mk { width: 22px; height: 22px; border-radius: 50%; border: 6px solid var(--text); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mk.b { border-color: #e53935; }
.mk-car { font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2f80ed; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,128,237,.2); }
