/* Цвета и размеры из Макет.pen */
:root {
  --bg: #EEECE6;
  --surface: #FFFFFF;
  --ink: #141414;
  --ink-2: #55534E;
  --ink-3: #8A877F;
  --line: #D9D5CC;
  --accent: #FFC21A;
  --accent-soft: #FFF1C4;
  --free: #16773A;
  --free-bg: #DCF1E1;
  --busy: #9E430B;
  --busy-bg: #FBE4CF;
  --link: #1A56C4;
  --photo: #CFCAC0;
  --seg: #E2DFD8;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
.ic { flex-shrink: 0; fill: currentColor; display: block; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.page.with-bar { padding-bottom: calc(108px + var(--safe-b)); }

/* --- шапки --- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 16px; padding-top: max(16px, env(safe-area-inset-top)); }
.top h1 { font-size: 30px; font-weight: 800; margin: 0; line-height: 1.15; }
.top .sub { color: var(--ink-2); font-size: 16px; margin-top: 2px; word-break: break-all; }
.top-back { display: flex; align-items: center; gap: 4px; padding: 8px 16px 8px 8px; padding-top: max(8px, env(safe-area-inset-top)); }
.top-back h1 { font-size: 26px; font-weight: 800; margin: 0; flex: 1; min-width: 0; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: var(--r); flex-shrink: 0; }
.icon-btn.filled { background: var(--surface); }

/* --- кнопки --- */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 64px; padding: 0 16px; border-radius: var(--r); font-size: 20px; font-weight: 700; width: 100%; background: var(--surface); color: var(--ink); }
.btn.main { background: var(--accent); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.small { height: 56px; font-size: 18px; }
.btn:active, .tile:active, .row:active, .opt:active { transform: scale(.985); }
.btn.quiet { background: none; color: var(--ink-3); font-size: 17px; font-weight: 500; height: 56px; gap: 8px; }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--bg); box-shadow: 0 -4px 16px #0000001F; padding: 12px 16px calc(28px + var(--safe-b)); }
.bar-in { max-width: 448px; margin: 0 auto; display: flex; gap: 10px; flex-direction: column; align-items: center; }
.bar-in.row2 { flex-direction: row; }
.bar-in.row2 .btn { flex: 1; }

/* --- список машин владельца --- */
.list { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.card { background: var(--surface); border-radius: 18px; overflow: hidden; }
.card .photo { height: 150px; padding: 12px; display: flex; align-items: flex-end; }
.photo { background: var(--photo) center / cover no-repeat; position: relative; }
.photo .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.card .name { font-size: 22px; font-weight: 700; }
.card .rate { font-size: 18px; color: var(--ink-2); margin-top: 2px; }

.pill { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: var(--r); font-size: 19px; font-weight: 700; box-shadow: 0 2px 8px #00000033; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.is-free { background: var(--free-bg); color: var(--free); }
.is-busy { background: var(--busy-bg); color: var(--busy); }

/* --- нижний лист --- */
.shade { position: fixed; inset: 0; background: #00000080; z-index: 20; animation: fade .15s ease-out; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px 16px calc(32px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; max-width: 480px; margin: 0 auto; animation: up .2s ease-out; }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; }
.sheet h2 { font-size: 22px; font-weight: 800; margin: 0; }
.sheet .hint { color: var(--ink-2); font-size: 16px; line-height: 21px; margin: 0; }
.opt { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 8px 16px; border-radius: var(--r); background: var(--bg); text-align: left; width: 100%; }
.opt.short { min-height: 64px; }
.opt .t { font-size: 19px; font-weight: 700; }
.opt .d { font-size: 15px; color: var(--ink-2); }
.opt .grow { flex: 1; }
.opt.sel-free { background: var(--free-bg); color: var(--free); }
.opt.sel-busy { background: var(--busy-bg); }
.opt .clock { color: var(--busy); }
.date-hidden { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* --- отправка --- */
.stack { display: flex; flex-direction: column; gap: 20px; padding: 0 16px 24px; }
.sec { display: flex; flex-direction: column; gap: 8px; }
.sec-t { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.what { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface); border-radius: var(--r); }
.thumb { width: 56px; height: 42px; border-radius: 8px; background: var(--photo) center / cover no-repeat; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.thumb.all { background: var(--ink); }
.what .cap { font-size: 14px; color: var(--ink-3); }
.what .val { font-size: 19px; font-weight: 700; }
.phone { display: flex; align-items: center; height: 64px; padding: 0 8px 0 16px; background: var(--surface); border-radius: var(--r); }
.phone input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 24px; font-weight: 700; height: 100%; }
.phone input::placeholder { color: var(--ink-3); font-weight: 400; }
.phone .clear { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.warn { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--busy-bg); color: var(--ink); font-size: 16px; line-height: 21px; }
.warn .ic { color: var(--busy); }
.warn b { display: block; color: var(--busy); font-size: 17px; margin-bottom: 2px; }
.tpl { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r); font-size: 17px; line-height: 21px; text-align: left; width: 100%; }
.tpl .ic { color: var(--ink-3); }
.tpl.on { background: var(--accent-soft); font-weight: 600; }
.tpl.on .ic { color: var(--ink); }
.msg { background: var(--surface); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; font-size: 17px; line-height: 22px; }
.msg .lnk { color: var(--link); font-weight: 600; word-break: break-all; }
.msg textarea { border: 0; outline: 0; resize: none; width: 100%; min-height: 132px; font-size: 17px; line-height: 22px; background: var(--bg); border-radius: 10px; padding: 10px; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 16px; font-weight: 600; padding: 6px 0 0; align-self: flex-start; }
.apps { display: flex; gap: 8px; width: 100%; }
.app { flex: 1; height: 76px; border-radius: var(--r); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 17px; font-weight: 700; }
.app.last { background: var(--accent); }
.app:disabled { opacity: .35; cursor: default; }
.other-app { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 16px; font-weight: 600; padding: 4px 8px; }
.page.send { padding-bottom: calc(160px + var(--safe-b)); }

/* --- админка --- */
.group { background: var(--surface); border-radius: 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 0 16px; width: 100%; text-align: left; }
.row + .row { border-top: 1px solid var(--bg); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 19px; font-weight: 700; }
.row .d { font-size: 15px; color: var(--ink-2); }
.row .chev { color: var(--ink-3); }
.row .badge { width: 44px; height: 44px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row .plus { width: 56px; height: 42px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.h2 { font-size: 22px; font-weight: 800; margin: 0; }
.hint { color: var(--ink-2); font-size: 16px; line-height: 21px; margin: 0; }
.form { display: flex; flex-direction: column; gap: 24px; padding: 8px 16px 24px; }
.fs { display: flex; flex-direction: column; gap: 12px; }
.lbl { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl > span { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.field { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 14px; background: var(--surface); border-radius: 12px; min-width: 0; position: relative; }
.field input, .field select { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: none; font-size: 19px; font-weight: 600; height: 100%; appearance: none; -webkit-appearance: none; }
.field input::placeholder { color: var(--ink-3); font-weight: 500; }
.field .u { color: var(--ink-3); font-size: 17px; font-weight: 500; white-space: nowrap; }
.field .ic { color: var(--ink-2); pointer-events: none; }
.field:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.pair { display: flex; gap: 10px; }
.pair > * { flex: 1; }
.pair > .narrow { flex: 0 0 110px; }
.zone { display: flex; align-items: center; gap: 10px; }
.zone > span { flex: 1; font-size: 17px; font-weight: 500; }
.zone .field { width: 150px; flex: 0 0 150px; }
.seg { display: flex; gap: 4px; padding: 4px; height: 56px; background: var(--seg); border-radius: var(--r); }
.seg button { flex: 1; border-radius: 11px; font-size: 18px; font-weight: 500; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px #00000026; }
.toggles { background: var(--surface); border-radius: var(--r); padding: 0 16px; }
.tg { display: flex; align-items: center; justify-content: space-between; height: 64px; font-size: 18px; font-weight: 600; width: 100%; text-align: left; }
.tg + .tg { border-top: 1px solid var(--bg); }
.sw { width: 56px; height: 32px; border-radius: 16px; background: var(--line); padding: 3px; display: flex; flex-shrink: 0; transition: background .15s; }
.sw::after { content: ''; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .15s; }
.sw.on { background: var(--free); }
.sw.on::after { transform: translateX(24px); }
.work { background: var(--surface); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.work .head { display: flex; align-items: center; gap: 8px; }
.work .head input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 18px; font-weight: 700; padding: 8px 0; }
.work .head input:focus { box-shadow: 0 2px 0 var(--ink); }
.work .price { display: flex; align-items: center; gap: 8px; }
.work .price > span { color: var(--ink-2); font-size: 17px; font-weight: 500; }
.work .field { background: var(--bg); flex: 1; }
.work .field.unit { flex: 0 0 136px; }
.del { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); flex-shrink: 0; }
.spec { display: flex; align-items: center; gap: 10px; }
.spec > span, .spec > input.sname { flex: 1; font-size: 17px; font-weight: 500; min-width: 0; }
.spec > input.sname { border: 0; outline: 0; background: none; border-bottom: 1px solid var(--line); padding: 8px 0; }
.spec .field { flex: 0 0 150px; width: 150px; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.ph { flex: 0 0 72px; height: 90px; border-radius: 10px; background: var(--photo) center / cover no-repeat; display: flex; align-items: flex-end; padding: 6px; }
.ph.first { flex-basis: 120px; }
.ph .tag { background: var(--accent); border-radius: 8px; padding: 2px 8px; font-size: 13px; font-weight: 700; }
.ph.add { flex-basis: 90px; border: 2px dashed var(--line); background: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); font-size: 14px; font-weight: 600; }

.tpls { display: flex; flex-direction: column; gap: 12px; }
.tpl-card { display: flex; align-items: center; gap: 6px; padding: 14px 12px 14px 4px; background: var(--surface); border-radius: var(--r); touch-action: pan-y; }
.tpl-card.dragging { box-shadow: 0 8px 24px #00000033; position: relative; z-index: 2; transform: scale(1.02); }
.drag { width: 40px; height: 56px; display: flex; align-items: center; justify-content: center; color: var(--ink-3); touch-action: none; cursor: grab; flex-shrink: 0; }
.tpl-card .grow { flex: 1; display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 17px; font-weight: 500; line-height: 22px; min-width: 0; }
.tag-def { align-self: flex-start; background: var(--accent); border-radius: 6px; padding: 2px 8px; font-size: 13px; font-weight: 700; }
.area { background: var(--surface); border-radius: var(--r); padding: 14px; }
.area textarea { width: 100%; min-height: 142px; border: 0; outline: 0; resize: none; font-size: 19px; font-weight: 500; line-height: 26px; background: none; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 16px; line-height: 21px; }
.mypage { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mypage .addr { font-size: 22px; font-weight: 800; word-break: break-all; }
.small-note { font-size: 15px; line-height: 20px; color: var(--ink-3); margin: 0; }
.demo { border: 2px dashed var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.demo .btn { height: 52px; font-size: 17px; }

.empty-t { font-size: 26px; font-weight: 800; margin: 0; }
.types { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.type-btn { display: flex; align-items: center; justify-content: space-between; height: 64px; padding: 0 18px; background: var(--surface); border-radius: var(--r); font-size: 19px; font-weight: 600; width: 100%; text-align: left; }
.type-btn .chev { color: var(--ink-3); }
.type-btn.other { background: none; height: 72px; justify-content: flex-start; gap: 14px; }
.type-btn.other .grow { flex: 1; }
.type-btn.other .d { font-size: 15px; color: var(--ink-2); font-weight: 400; }

.login { display: flex; flex-direction: column; gap: 20px; padding: 40px 20px 24px; padding-top: max(40px, env(safe-area-inset-top)); }
.logo { width: 72px; height: 72px; border-radius: 18px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 14px; font-weight: 500; }
.login h1 { font-size: 30px; font-weight: 800; margin: 0; line-height: 39px; }
.login p { font-size: 18px; line-height: 24px; color: var(--ink-2); margin: 0; }
.login .phone input { font-size: 24px; }

.toast { position: fixed; left: 50%; bottom: calc(130px + var(--safe-b)); transform: translateX(-50%); background: #2B2B2B; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 16px; font-weight: 500; z-index: 40; max-width: calc(100% - 32px); text-align: center; animation: fade .15s; pointer-events: none; }

/* --- страницы клиента --- */
.c-photos { height: 200px; position: relative; background: var(--photo); }
.c-photos .track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.c-photos .track::-webkit-scrollbar { display: none; }
.c-photos .slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; background: var(--photo) center / cover no-repeat; }
.c-photos .count { position: absolute; right: 12px; bottom: 12px; background: #000000A0; color: #fff; font-size: 14px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.c-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 20px 24px; }
.c-model { font-size: 28px; font-weight: 800; margin: 0; line-height: 1.15; }
.c-type { font-size: 17px; color: var(--ink-2); margin-top: 2px; }
.c-status { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 22px; font-weight: 700; }
.c-status .dot { width: 14px; height: 14px; }
.c-price { background: var(--surface); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.c-hour { font-size: 36px; font-weight: 800; line-height: 1.1; }
.c-shift { font-size: 19px; font-weight: 600; color: var(--ink-2); }
.hr { height: 1px; background: var(--line); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 17px; }
.kv .k { color: var(--ink-2); }
.kv .v { font-weight: 700; text-align: right; }
.kv .z { font-weight: 500; }
.col { display: flex; flex-direction: column; gap: 6px; }
.inc { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 500; }
.inc .ic { color: var(--free); }
.vat { font-size: 16px; color: var(--ink-2); }
.c-works { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.c-h { font-size: 24px; font-weight: 800; margin: 0; }
.c-sub { font-size: 17px; line-height: 22px; color: var(--ink-2); margin: 0; }
.wlist { background: var(--surface); border-radius: 16px; padding: 4px 18px; }
.wrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; font-size: 17px; line-height: 21px; }
.wrow + .wrow { border-top: 1px solid var(--bg); }
.wrow .n { font-weight: 500; }
.wrow .m { font-size: 14px; line-height: 18px; color: var(--ink-3); margin-top: 2px; }
.wrow .p { font-weight: 800; white-space: nowrap; }
.photo-hint { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 500; line-height: 22px; color: var(--ink-2); }
.specs { background: var(--surface); border-radius: 16px; padding: 4px 18px; }
.specs summary { list-style: none; display: flex; align-items: center; justify-content: space-between; height: 56px; font-size: 19px; font-weight: 700; cursor: pointer; }
.specs summary::-webkit-details-marker { display: none; }
.specs[open] summary .ic { transform: rotate(180deg); }
.specs .kv { padding: 10px 0; }
.upd { font-size: 15px; line-height: 20px; color: var(--ink-3); }
.c-head { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 4px; }
.c-head h1 { font-size: 32px; font-weight: 800; margin: 0; }
.c-head p { font-size: 18px; line-height: 23px; color: var(--ink-2); margin: 0; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 8px; background: var(--surface); border-radius: 16px; }
.mrow .thumb { width: 112px; height: 96px; border-radius: 10px; }
.mrow .grow { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mrow .mm { font-size: 18px; font-weight: 700; line-height: 23px; }
.mrow .rr { font-size: 17px; font-weight: 500; color: var(--ink-2); }
.mrow .ss { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; background: none; }
.mrow .ss .dot { width: 10px; height: 10px; }
.mrow .chev { color: var(--ink-3); }
.notfound { padding: 60px 20px; text-align: center; color: var(--ink-2); }

@media (min-width: 560px) {
  body { background: #E3E0D8; }
  .page { background: var(--bg); box-shadow: 0 0 0 1px #0000000D; }
}

[hidden] { display: none !important; }
.zone .field { width: 170px; flex-basis: 170px; }
.field input:placeholder-shown + .u { display: none; }
