:root {
  --bg: #F6EEEA; --card: #EBDCD7; --card2: #F1E5E1; --line: #DCC9C3;
  --accent: #6B3F45; --accent-d: #52303A; --text: #3B2A2C; --muted: #8A7473; --white: #fff;
  --ok: #4C7A5A; --warn: #B0762A; --bad: #A64545; --blue: #4A6A8A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
#phone { height: 100dvh; display: flex; justify-content: center; align-items: center; }
#app { width: 100%; height: 100%; background: var(--bg); display: flex; flex-direction: column; overflow: hidden; position: relative; }
@media (min-width: 560px) {
  body { background: #E4D3CD; }
  #app { width: 410px; height: min(860px, 94dvh); border-radius: 34px; box-shadow: 0 20px 60px rgba(80,40,45,.28); border: 8px solid #3B2A2C; }
}
.hdr { display: flex; align-items: center; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 16px 10px; min-height: 56px; }
.hdr h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.hdr .back { border: 0; background: var(--card); width: 36px; height: 36px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.icon-btn { position: relative; border: 0; background: var(--card); width: 38px; height: 38px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.badge { position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; -webkit-overflow-scrolling: touch; }
.tabs { display: flex; background: var(--white); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tab { flex: 1; border: 0; background: none; padding: 6px 2px; font-size: 11px; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tab span { font-size: 20px; }
.tab.on { color: var(--accent); font-weight: 700; }
.bar { padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--white); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.bar .sum { flex: 1; line-height: 1.2; }
.bar .sum b { font-size: 18px; display: block; }
.bar .sum small { color: var(--muted); }

.card { background: var(--card); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.card.light { background: var(--card2); }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.sp { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.sec { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 2px 8px; font-weight: 600; }
.btn { border: 0; border-radius: 14px; padding: 13px 18px; font-weight: 600; cursor: pointer; background: var(--accent); color: #fff; font-size: 15px; }
.btn:active { background: var(--accent-d); }
.btn.block { display: block; width: 100%; }
.btn.sec2 { background: var(--card); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.danger { background: var(--bad); }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 11px; }
.btn:disabled { opacity: .4; cursor: default; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1; text-align: center; white-space: nowrap; }

.hero { background: linear-gradient(135deg, #E8D3CC, #D9BDB5); border-radius: 22px; padding: 22px 18px; margin: 4px 0 14px; }
.hero h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.1; }
.hero p { margin: 0; color: var(--accent); font-style: italic; }
.svc { cursor: pointer; display: flex; gap: 12px; align-items: center; }
.svc .ic { font-size: 28px; width: 46px; height: 46px; background: var(--white); border-radius: 14px; display: grid; place-items: center; flex: none; }
.price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--white); color: var(--muted); white-space: nowrap; }
.s-new { background: #F3E3C2; color: #8A5E10; } .s-confirmed { background: #D8E3F0; color: #3A5878; }
.s-assigned { background: #DCE8F7; color: #2E4E78; } .s-enroute { background: #E4DAF1; color: #5B3F85; }
.s-working { background: #F6DCCB; color: #9A4F1F; } .s-done { background: #D3E8D8; color: #2F6A42; }
.s-paid { background: #BFE0C8; color: #1F5A33; } .s-cancelled { background: #EBCFCF; color: #8C3030; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill { border: 1.5px solid var(--line); background: var(--white); border-radius: 22px; padding: 8px 14px; white-space: nowrap; cursor: pointer; font-size: 14px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pill.sm { padding: 6px 11px; font-size: 13px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid4 .pill { text-align: center; padding: 12px 4px; border-radius: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid3 .pill { text-align: center; border-radius: 12px; padding: 10px 4px; }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 12px 2px 5px; }
.in { width: 100%; border: 1.5px solid var(--line); background: var(--white); border-radius: 13px; padding: 12px 14px; outline: none; }
.in:focus { border-color: var(--accent); }
textarea.in { min-height: 76px; resize: vertical; }
.opt { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1.5px solid var(--line); border-radius: 15px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.opt.on { border-color: var(--accent); background: #FBF4F1; }
.opt .ic { font-size: 22px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 32px; height: 32px; border-radius: 10px; border: 0; background: var(--card); font-size: 18px; cursor: pointer; color: var(--accent); }
.dots { display: flex; gap: 5px; margin: 0 2px 14px; }
.dots i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.dots i.on { background: var(--accent); }
.tl { position: relative; padding-left: 22px; }
.tl .it { position: relative; padding-bottom: 12px; }
.tl .it::before { content: ''; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.tl .it::after { content: ''; position: absolute; left: -13px; top: 15px; bottom: -4px; width: 1.5px; background: var(--line); }
.tl .it:last-child::after { display: none; }
.banner { background: #F8E7C6; border-radius: 16px; padding: 12px 14px; margin-bottom: 12px; }
.banner.red { background: #F1D3D3; } .banner.green { background: #D8EBDD; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .big { font-size: 44px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.kv + .kv { border-top: 1px dashed var(--line); }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; }
.qr { background: #fff; border-radius: 16px; padding: 14px; margin: 10px auto; width: 230px; }
.qr img { width: 100%; display: block; }
.sheet-bg { position: absolute; inset: 0; background: rgba(40,20,25,.45); display: flex; align-items: flex-end; z-index: 10; }
.sheet { background: var(--bg); width: 100%; max-height: 88%; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet h2 { margin: 0 0 10px; font-size: 19px; }
#toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%); background: #3B2A2C; color: #fff; padding: 11px 16px; border-radius: 14px; max-width: min(380px, 92vw); font-size: 14px; z-index: 100; transition: transform .3s; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
#toast.show { transform: translate(-50%, 0); }
.center { text-align: center; }
.seg { display: flex; background: var(--card); border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 4px; border-radius: 11px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--white); color: var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
a { color: var(--accent); }
.hint { background: var(--white); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.sw { width: 44px; height: 26px; border-radius: 13px; background: var(--line); position: relative; border: 0; cursor: pointer; flex: none; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw.on { background: var(--ok); } .sw.on::after { left: 21px; }

/* Веб-панель администратора (/admin): без рамки телефона, шире */
body.admin { background: var(--bg); }
@media (min-width: 560px) {
  body.admin #app { width: min(820px, 100%); height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
}
