:root {
  --bg: #f3f0fa;
  --sheet: #ffffff;
  --muted: #8b8798;
  --text: #1a1528;
  --line: #eceaf2;
  --accent: #6c63ff;
  --accent2: #5b52e8;
  --soft: #f4f2fb;
  --font: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  position: fixed;
  inset: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }

#app {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}

.map-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  isolation: isolate;
  background: #efeaff;
  touch-action: pan-x pan-y;
}
#map {
  position: absolute;
  inset: 0;
  background: #efeaff;
}
#map > ymaps {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.map-ui {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.map-ui > * { pointer-events: auto; }
.map-hint, .map-pin { pointer-events: none !important; }
.map-hint {
  position: absolute; top: calc(12px + env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.92);
  border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 600; z-index: 20;
  box-shadow: 0 6px 20px rgba(40,30,80,.12);
  white-space: nowrap;
}
.map-pin {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -100%);
  z-index: 21; pointer-events: none; text-align: center;
}
.map-pin-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 18px;
  box-shadow: 0 8px 20px rgba(108,99,255,.35);
}
.map-pin i {
  display: block; width: 2px; height: 18px; background: #1a1528; margin: 0 auto;
}

.pill-points {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  z-index: 25; border: 0; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 8px 12px; font-weight: 800; font-size: 13px;
  box-shadow: 0 8px 20px rgba(108,99,255,.28);
}
.pill-points.sm { position: static; }

.fab {
  position: absolute; z-index: 25;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: #fff; color: var(--text);
  box-shadow: 0 8px 22px rgba(40,30,80,.16);
  display: grid; place-items: center; cursor: pointer;
}
.fab-back { left: 12px; bottom: 0; }
.fab-geo { right: 12px; bottom: 0; }
.fab.static { position: static; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  z-index: 50; background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 40px rgba(40,30,80,.14);
  height: 56%;
  min-height: 320px;
  max-height: 62%;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet[data-size="search"] { height: 86%; max-height: 90%; min-height: 60%; }
.sheet[data-size="mappick"] { height: 30%; max-height: 34%; min-height: 200px; }
.sheet[data-size="when"] { height: 48%; max-height: 56%; min-height: 280px; }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 4px; background: #e4e0ee;
  margin: 8px auto 4px; flex-shrink: 0;
}
.view {
  flex: 1;
  min-height: 0;
  overflow: auto; overscroll-behavior: contain;
  padding: 4px 16px 14px;
  -webkit-overflow-scrolling: touch;
}
.view[hidden] { display: none !important; }

.addr-block { margin-bottom: 8px; }
.addr-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: 0; text-align: left; padding: 10px 0; cursor: pointer;
}
.addr-row + .addr-row { border-top: 1px solid var(--line); }
.addr-ico { width: 28px; text-align: center; font-size: 16px; flex-shrink: 0; }
.addr-text { flex: 1; min-width: 0; }
.addr-city { display: block; font-weight: 800; font-size: 15px; }
.addr-line { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-line.placeholder { color: var(--accent); font-weight: 600; }
.addr-chip, .sf-map {
  flex-shrink: 0; border: 0; background: var(--soft); color: var(--text);
  border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700;
}
.addr-plus {
  width: 28px; height: 28px; border-radius: 50%; background: var(--soft);
  display: grid; place-items: center; font-weight: 700; color: var(--muted);
}

.cats {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  padding: 6px 0 10px; scrollbar-width: none; touch-action: pan-x;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  border: 0; background: none; color: var(--muted);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; padding: 6px 0; cursor: pointer;
}
.cat.active { color: var(--text); }

.classes {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 2px 0 12px; scrollbar-width: none; touch-action: pan-x;
}
.classes::-webkit-scrollbar { display: none; }
.class-card {
  flex: 0 0 108px; border: 0; background: transparent; border-radius: 16px;
  padding: 10px 8px 12px; text-align: center; cursor: pointer; color: inherit;
}
.class-card.active { background: var(--soft); }
.class-card .ci { font-size: 28px; line-height: 1; }
.class-card .cn { font-weight: 800; font-size: 13px; margin-top: 6px; }
.class-card .cw { font-size: 11px; color: var(--muted); }
.class-card .cp { font-weight: 800; font-size: 13px; margin-top: 4px; color: var(--accent2); }

.when-btn { border-top: 1px solid var(--line); margin-bottom: 8px; }
.when-cell.block { display: block; margin-bottom: 10px; }
.when-cell.block input { font-size: 16px; }
.when-cell {
  flex: 1; min-width: 0; background: var(--soft); border-radius: 14px; padding: 8px 10px;
}
.when-cell span { display: block; font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.when-cell input {
  width: 100%; border: 0; background: transparent; outline: none; font-weight: 700; padding: 4px 0 0;
}

.meta-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stepper { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.stepper button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 18px; cursor: pointer;
}

.add-pax {
  width: 100%; border: 0; background: none; color: var(--accent);
  font-weight: 700; font-size: 14px; text-align: left; padding: 6px 0 10px; cursor: pointer;
}
.pax-box {
  background: var(--soft); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px;
}
.pax-box label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.pax-box input { width: 100%; border: 0; background: transparent; outline: none; font-weight: 700; padding: 6px 0; }
.pax-del { border: 0; background: none; color: #c24141; font-weight: 700; font-size: 13px; padding: 4px 0 0; cursor: pointer; }

.action-bar {
  display: flex; align-items: center; gap: 8px; padding-top: 4px;
}
.pay-stub, .set-stub {
  width: 48px; height: 48px; flex-shrink: 0; border: 0; border-radius: 14px;
  background: var(--soft); font-weight: 800; cursor: pointer;
}
.cta {
  flex: 1; height: 52px; border: 0; border-radius: 16px;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; cursor: pointer;
}
a.cta {
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.cta:disabled { opacity: .45; }

.search-fields { margin-bottom: 8px; }
.sf-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.sf-row.muted { opacity: .7; border-top: 1px solid var(--line); }
.sf-grow { flex: 1; min-width: 0; }
.sf-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.sf-grow input, .sf-static { width: 100%; border: 0; outline: none; background: none; font-weight: 800; font-size: 16px; }
.gps-row {
  width: 100%; display: flex; gap: 12px; align-items: center;
  border: 0; background: none; text-align: left; padding: 12px 0; cursor: pointer;
}
.gps-row small { display: block; color: var(--muted); font-size: 12px; }
.gps-ico { color: var(--accent); }
.suggest { padding-bottom: 8px; }
.sug {
  width: 100%; display: flex; gap: 12px; align-items: flex-start;
  border: 0; background: none; text-align: left; padding: 12px 0;
  border-top: 1px solid var(--line); cursor: pointer;
}
.sug b { color: var(--accent); display: block; font-size: 15px; }
.sug small { color: var(--muted); }
.sug .km { margin-left: auto; color: var(--muted); font-size: 12px; flex-shrink: 0; }

.mp-title { font-size: 22px; font-weight: 800; margin: 4px 0 12px; }
.mp-addr { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.mp-addr small { display: block; color: var(--muted); font-size: 12px; }
.mp-addr strong { display: block; font-size: 16px; }

.screen {
  position: fixed; inset: 0; z-index: 80; background: #f3f0fa;
  overflow: auto; overscroll-behavior: contain;
  max-width: 480px; margin: 0 auto; left: 0; right: 0; width: 100%;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
}
.screen[hidden] { display: none !important; }
.prof-head { display: flex; justify-content: space-between; align-items: center; padding-top: env(safe-area-inset-top); }
.prof-hero { text-align: center; padding: 12px 0 18px; }
.avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  background: #fff; display: grid; place-items: center; font-size: 36px;
  box-shadow: 0 8px 24px rgba(40,30,80,.1);
}
.prof-name { border: 0; background: none; font-size: 22px; font-weight: 800; }
.prof-mail { color: var(--muted); font-size: 13px; margin-top: 4px; }
.quick { display: flex; justify-content: space-around; margin: 8px 0 18px; }
.qbtn { border: 0; background: none; font-size: 11px; font-weight: 700; color: var(--text); }
.qbtn span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; font-size: 20px; margin: 0 auto 6px; }
.card-list {
  background: #fff; border-radius: 20px; margin-bottom: 12px; overflow: hidden;
}
.card-list.dark { background: #3b2f73; }
.card-list.dark .li, .card-list.dark .li b { color: #fff; }
.li {
  width: 100%; display: flex; align-items: center; gap: 12px;
  border: 0; background: none; text-align: left; padding: 14px 16px; cursor: pointer;
}
.li + .li { border-top: 1px solid var(--line); }
.li span:first-child { width: 28px; text-align: center; }
.li span:nth-child(2) { flex: 1; }
.li b { display: block; font-size: 15px; }
.li small { color: var(--muted); }
.li i { color: var(--muted); font-style: normal; }

.login-box, .orders-box { background: #fff; border-radius: 20px; padding: 16px; margin-top: 8px; }
.login-box h3, .orders-box h3 { margin-bottom: 12px; }
.login-box label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 12px; }
.login-box input {
  width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; background: var(--soft); outline: none;
}

.auth {
  position: fixed; inset: 0; z-index: 90; background: #fff;
  max-width: 480px; margin: 0 auto; left: 0; right: 0; width: 100%;
  padding: calc(16px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  overflow: auto;
}
.auth[hidden] { display: none !important; }
.auth-back { margin-bottom: 18px; }
.auth-brand {
  font-weight: 900; letter-spacing: .08em; color: var(--accent); margin-bottom: 28px;
}
.auth h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 8px; }
.auth-lead { color: var(--muted); margin-bottom: 24px; line-height: 1.4; }
.auth-field { display: block; margin-bottom: 20px; }
.auth-field span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.auth-field input {
  width: 100%; border: 0; background: var(--soft); border-radius: 16px;
  padding: 16px 18px; font-size: 18px; font-weight: 700; outline: none;
}
.otp { display: flex; gap: 8px; margin: 8px 0 18px; }
.otp input {
  flex: 1; min-width: 0; height: 52px; text-align: center; font-size: 22px; font-weight: 800;
  border: 0; background: var(--soft); border-radius: 12px; outline: none;
}
.auth-hint { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.auth-call-num {
  font-size: 28px; font-weight: 800; letter-spacing: -0.03em;
  text-align: center; margin: 4px 0 18px; color: var(--text);
}
.auth-call-btn { width: 100%; margin-bottom: 14px; }
.otp[hidden], #authCallBox[hidden] { display: none !important; }
.auth-resend {
  width: 100%; margin-top: 10px; border: 0; background: none; color: var(--accent);
  font-weight: 700; padding: 12px; cursor: pointer;
}
.auth-resend:disabled { color: var(--muted); cursor: default; }

.order-card { background: var(--soft); border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.order-card .oc-map { width: 100%; height: 90px; object-fit: cover; border-radius: 12px; margin-bottom: 8px; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #ece7ff; color: var(--accent); }
.badge.paid { background: #dcfce7; color: #15803d; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 200; background: #fff; color: var(--text);
  padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 30px rgba(40,30,80,.2); max-width: 90%;
}
.toast[hidden] { display: none !important; }

@media (min-width: 900px) {
  body { background: #e8e3f7; }
}
