:root {
  --accent: #FF5A1F; --accent-press: #e94c13; --accent-soft: rgba(255, 90, 31, .12); --on-accent: #fff;
  --bg: #f3f3f5; --surface: #fff; --surface-2: #f4f4f6; --text: #18181b; --muted: #71717a; --border: #e6e6ea;
  --ok: #15803d; --ok-soft: rgba(22, 163, 74, .12); --warn: #b45309; --warn-soft: rgba(217, 119, 6, .14);
  --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .12); --info: #2563eb; --info-soft: rgba(37, 99, 235, .12);
  --radius: 16px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --tabs-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --surface: #1a1a1d; --surface-2: #232327; --text: #f4f4f5; --muted: #a1a1aa; --border: #2c2c31;
    --shadow: none; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --info: #60a5fa; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0e10; --surface: #1a1a1d; --surface-2: #232327; --text: #f4f4f5; --muted: #a1a1aa; --border: #2c2c31;
  --shadow: none; --ok: #4ade80; --warn: #fbbf24; --danger: #f87171; --info: #60a5fa; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
svg.ic { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app { max-width: 720px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding: 0 var(--sar) 0 var(--sal); }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: calc(var(--sat) + 6px) 16px 6px; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.top h1 { font-size: 20px; margin: 0; flex: 1; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .back { width: 44px; height: 44px; margin-left: -10px; }
.view { padding: 4px 16px calc(var(--tabs-h) + var(--sab) + 96px); }
.view.no-tabs { padding-bottom: calc(var(--sab) + 96px); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: var(--sab);
}
.tabs-in { display: flex; width: 100%; max-width: 720px; }
.tab {
  flex: 1; min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer;
}
.tab.on { color: var(--accent); }
.tab .dot { position: absolute; }

.mainbtn {
  position: fixed; left: 0; right: 0; z-index: 25; bottom: calc(var(--tabs-h) + var(--sab)); padding: 10px 16px;
  display: flex; justify-content: center; background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.mainbtn.no-tabs { bottom: var(--sab); }
.mainbtn .btn { max-width: 688px; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.card.tight { padding: 12px; }
.card.click { cursor: pointer; transition: transform .12s; }
.card.click:active { transform: scale(.985); }
.card.accent { border: 2px solid var(--accent); }
.sec-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 4px 8px; }
.h1 { font-size: 24px; font-weight: 800; margin: 4px 0 4px; letter-spacing: -.02em; }
.h2 { font-size: 17px; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.top-al { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.gap-s { gap: 6px; }
.mt { margin-top: 12px; } .mt-s { margin-top: 6px; } .mb { margin-bottom: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; word-break: break-word; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 14px; border: 0; font-weight: 700; font-size: 16px; cursor: pointer; user-select: none;
  background: var(--surface-2); color: var(--text); transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:active { background: var(--accent-press); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; padding: 0 14px; font-size: 14.5px; border-radius: 12px; }
.btn.icon { width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite;
}
.btn:not(.primary).loading::after { border-color: var(--accent) var(--accent) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0 0 6px 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--surface); font-size: 16px; outline: none; transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 84px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.phone { display: flex; align-items: stretch; }
.phone .pre-code { display: flex; align-items: center; padding: 0 12px; border: 1.5px solid var(--border); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-2); font-weight: 600; }
.phone .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.err-text { color: var(--danger); font-size: 14px; margin: 8px 2px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; padding: 0 6px; }
.seg button.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.orange { background: var(--accent-soft); color: var(--accent); }
.badge.yellow { background: var(--warn-soft); color: var(--warn); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.promo { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }

.banner { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius); padding: 14px; margin: 0 0 12px; background: var(--info-soft); }
.banner.warn { background: var(--warn-soft); }
.banner.danger { background: var(--danger-soft); }
.banner.accent { background: var(--accent-soft); }
.banner .ic { margin-top: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14.5px; margin-top: 6px; }
.check.done { color: var(--ok); }

.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; height: 96px; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 40px 16px; }
.empty .em-ic { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.empty .em-ic svg.ic { width: 34px; height: 34px; }
.empty p { color: var(--muted); margin: 0 auto 18px; max-width: 300px; }

.toast-root { position: fixed; left: 0; right: 0; top: calc(var(--sat) + 12px); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 420px; background: #18181b; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 15px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.2); animation: tin .2s ease-out; }
.toast.err { background: var(--danger); }
.toast.ok { background: #15803d; }
@keyframes tin { from { opacity: 0; transform: translateY(-8px); } }

.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.45); animation: fade .2s; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: 100%; max-width: 720px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--surface);
  border-radius: 22px 22px 0 0; padding: 8px 16px calc(var(--sab) + 16px); animation: up .25s cubic-bezier(.2,.8,.2,1);
}
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 12px; font-size: 19px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .btn { position: absolute; top: calc(var(--sat) + 12px); right: 12px; background: rgba(255,255,255,.15); color: #fff; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--surface-2); flex: none; cursor: pointer; border: 0; padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; border: 0; padding: 0; }
.thumb .x svg.ic { width: 14px; height: 14px; }
.thumb.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px dashed var(--border); color: var(--muted); font-size: 11.5px; font-weight: 600; background: transparent; }

audio { width: 100%; height: 44px; }
.rec-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.rec {
  width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 90, 31, .35); cursor: pointer; transition: transform .15s;
}
.rec svg.ic { width: 40px; height: 40px; }
.rec:active { transform: scale(.95); }
.rec.on { background: var(--danger); animation: pulse 1.2s infinite; box-shadow: 0 0 0 0 rgba(220,38,38,.5); }
@keyframes pulse { 70% { box-shadow: 0 0 0 18px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.rec-done { display: flex; align-items: center; gap: 8px; width: 100%; }

.price { font-size: 22px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.kv { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 600; }
.stars { display: flex; gap: 6px; justify-content: center; }
.star { width: 48px; height: 48px; border: 0; background: none; color: var(--border); cursor: pointer; padding: 0; }
.star svg.ic { width: 40px; height: 40px; fill: currentColor; stroke: none; }
.star.on { color: #f59e0b; }
.rating { display: inline-flex; align-items: center; gap: 2px; color: #f59e0b; font-weight: 700; font-size: 13.5px; }
.rating svg.ic { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); animation: pulse2 1.6s infinite; flex: none; }
@keyframes pulse2 { 50% { opacity: .3; } }
.contact-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.car-chip-add { border-style: dashed; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch button { min-width: 44px; min-height: 36px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; }
.lang-switch button.on { border-color: var(--accent); color: var(--accent); }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.role-pick button { min-height: 96px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface); padding: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 14px; text-align: center; }
.role-pick button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.auth-hero { text-align: center; padding: 28px 0 16px; }
.auth-hero .logo { width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 12px; }

/* Admin */
.adm { max-width: 1280px; margin: 0 auto; padding: calc(var(--sat) + 12px) 16px 40px; }
.adm-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: none; }
.adm-nav a { flex: none; padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; color: var(--text); background: var(--surface); min-height: 44px; display: flex; align-items: center; }
.adm-nav a.on { background: var(--accent); color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 24px; font-weight: 800; }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bars .b i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .b span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.bars .b em { font-size: 10px; font-style: normal; font-weight: 700; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td .btn.sm { min-height: 36px; padding: 0 10px; font-size: 13px; }
.adm-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-filters .input, .adm-filters .select { width: auto; flex: 1; min-width: 160px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); }
@media (min-width: 900px) { .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }
