:root {
  --bg: #f5f4f0;
  --card: #ffffff;
  --ink: #1c1b19;
  --muted: #6f6b64;
  --line: #e6e3dc;
  --accent: #0e6b52;
  --accent-soft: #e2f0ea;
  --warn: #a8540a;
  --warn-soft: #fcefd9;
  --danger: #b42318;
  --danger-soft: #fbe7e4;
  --r: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: #dedbd3;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }

.stage { display: flex; gap: 28px; justify-content: center; align-items: flex-start; padding: 20px; min-height: 100%; }
.phone {
  width: 390px; height: min(844px, calc(100vh - 40px)); flex: none; background: var(--bg);
  border-radius: 28px; overflow: hidden; position: relative; display: flex; flex-direction: column;
  box-shadow: 0 0 0 10px #1c1b19, 0 24px 60px rgba(0,0,0,.25);
}
.panel { width: 380px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 16px; padding: 18px; font-size: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 8px; }
.panel h3 { font-size: 13px; margin: 18px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.panel .sc { display: flex; flex-wrap: wrap; gap: 6px; }
.panel .sc button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.panel .sc button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel dl { margin: 0; }
.panel dt { font-weight: 600; margin-top: 10px; }
.panel dd { margin: 2px 0 0; color: #45423d; }
.panel .hint { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) {
  body { background: var(--bg); }
  .stage { padding: 0; }
  .phone { width: 100%; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; }
  .panel { display: none; }
}

.offline { background: var(--warn-soft); color: var(--warn); font-size: 13px; padding: 6px 16px; text-align: center; }
.top { display: flex; align-items: center; gap: 4px; padding: 10px 8px 6px 16px; min-height: 56px; flex: none; }
.top.sub { padding-left: 4px; }
.top h1 { font-size: 22px; font-weight: 700; margin: 0; flex: 1; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top.sub h1 { font-size: 18px; }
.ib { width: 44px; height: 44px; border: 0; background: none; border-radius: 12px; display: grid; place-items: center; position: relative; flex: none; }
.ib:active { background: var(--line); }
.ib .dot { position: absolute; top: 6px; right: 5px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 17px; height: 17px; }
.scr { flex: 1; overflow-y: auto; padding: 4px 16px 24px; }
.bar { flex: none; padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line); }
.bar .sum { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.bar .sum b { color: var(--ink); }

.tabs { flex: none; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; border: 0; background: none; padding: 8px 0 7px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs button.on { color: var(--accent); font-weight: 600; }
.tabs button.plus span { width: 46px; height: 38px; border-radius: 13px; background: var(--ink); color: #fff; display: grid; place-items: center; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; padding: 0 14px; text-decoration: none; color: var(--ink); }
.btn.p { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.d { color: var(--danger); }
.btn.sm { min-height: 40px; font-size: 14px; width: auto; }
.btn[disabled] { opacity: .45; }
.row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.row2 > * { flex: 1; min-width: 100px; }
.link { border: 0; background: none; color: var(--accent); font-weight: 600; padding: 10px 0; }

.card { background: var(--card); border-radius: var(--r); padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); }
.card.hl { border-color: var(--accent); }
.card.warn { background: var(--warn-soft); border-color: transparent; }
.sec { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 2px 8px; text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; }
.list { background: var(--card); border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 10px; overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); min-height: 52px; }
.li:last-child { border-bottom: 0; }
.li:active { background: #faf9f6; }
.li .g { flex: 1; min-width: 0; }
.li .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .t.wrap { white-space: normal; }
.li .s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .r { font-weight: 600; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.li .r small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.li .tm { width: 48px; font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.li .tm small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.li.free { color: var(--muted); font-size: 14px; min-height: 40px; padding: 8px 14px; background: repeating-linear-gradient(-45deg, #fff, #fff 8px, #f8f7f3 8px, #f8f7f3 16px); }
.chev { color: #b9b4aa; }
.muted { color: var(--muted); }
.sm { font-size: 14px; }
.xs { font-size: 13px; }
.b { font-weight: 600; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mt { margin-top: 10px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ic { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; }
.ic svg { margin-top: 2px; color: var(--muted); }

.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: #efede8; color: #4d4a44; white-space: nowrap; }
.chip.ok { background: var(--accent-soft); color: var(--accent); }
.chip.w { background: var(--warn-soft); color: var(--warn); }
.chip.e { background: var(--danger-soft); color: var(--danger); }

.ava { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; }
.ava.l { width: 64px; height: 64px; font-size: 22px; }
.stars { color: #c27803; font-weight: 600; white-space: nowrap; }

.days { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 2px 16px; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.day { flex: none; width: 52px; padding: 7px 0 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: center; }
.day small { display: block; font-size: 12px; color: var(--muted); }
.day b { font-size: 17px; }
.day i { display: block; width: 5px; height: 5px; border-radius: 50%; margin: 3px auto 0; background: transparent; }
.day.has i { background: var(--accent); }
.day.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.day.on small { color: #cfcac0; }
.day.off { opacity: .4; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-variant-numeric: tabular-nums; }
.slot.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.seg button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 12px; font-size: 14px; min-height: 40px; }
.seg button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.f { display: block; margin-bottom: 14px; }
.f > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.f input, .f textarea, .f select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); min-height: 48px; outline: none; }
.f input:focus, .f textarea:focus { border-color: var(--accent); }
.f input.bad, .f input.bad:focus { border-color: var(--danger); background: var(--danger-soft); }
.f textarea { min-height: 84px; resize: vertical; }
.f .err { color: var(--danger); font-size: 13px; margin-top: 4px; }
.f .help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.search { position: relative; margin-bottom: 12px; }
.search input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 40px; background: var(--card); outline: none; }
.search svg { position: absolute; left: 12px; top: 13px; color: var(--muted); }
.sug { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin: -8px 0 14px; overflow: hidden; }
.sug button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sug button:last-child { border: 0; }

.sw { width: 46px; height: 28px; border-radius: 14px; background: #cfcac0; border: 0; position: relative; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw.on { background: var(--accent); }
.sw.on::after { left: 21px; }
.cb { width: 24px; height: 24px; border-radius: 7px; border: 2px solid #cfcac0; flex: none; display: grid; place-items: center; color: #fff; }
.cb.on { background: var(--accent); border-color: var(--accent); }
.rb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cfcac0; flex: none; }
.rb.on { border: 7px solid var(--accent); }

.empty { text-align: center; padding: 48px 20px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

.photos { display: flex; gap: 8px; overflow-x: auto; margin: 8px 0; }
.ph { width: 76px; height: 76px; border-radius: 10px; background: #e9e6df center/cover; flex: none; border: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.ph.add { border: 1.5px dashed #bdb8ad; background: none; }
.lightbox { position: absolute; inset: 0; background: rgba(0,0,0,.92); z-index: 40; display: grid; place-items: center; }
.lightbox div { width: 100%; aspect-ratio: 1; background: #333 center/contain no-repeat; color: #aaa; display: grid; place-items: center; }

.back { position: absolute; inset: 0; background: rgba(28,27,25,.45); z-index: 30; display: flex; align-items: flex-end; }
.sheet { background: var(--bg); width: 100%; max-height: 88%; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 8px 16px 20px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: #cfcac0; margin: 4px auto 12px; }
.sheet h2 { font-size: 19px; margin: 0 0 12px; }
.toast { position: absolute; left: 16px; right: 16px; bottom: 84px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; z-index: 50; text-align: center; }
.rate { display: flex; gap: 6px; justify-content: center; margin: 8px 0 16px; }
.rate button { border: 0; background: none; padding: 4px; color: #cfcac0; }
.rate button.on { color: #c27803; }
.rate svg { width: 38px; height: 38px; fill: currentColor; stroke: none; }
.qr { width: 200px; height: 200px; margin: 8px auto 12px; display: grid; grid-template-columns: repeat(21, 1fr); background: #fff; padding: 10px; border-radius: 12px; }
.qr i { background: #fff; }
.qr i.k { background: var(--ink); }
.steps { display: flex; gap: 4px; margin: 0 0 14px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--accent); }
.done-ic { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 24px auto 12px; }
.done-ic svg { width: 32px; height: 32px; }
.c { text-align: center; }
.msg { max-width: 82%; background: var(--card); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 9px 12px; margin-bottom: 8px; }
.msg.me { margin-left: auto; background: var(--accent-soft); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.msg small { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.li.sel, .li.sel:active { background: var(--accent-soft); }
.cb svg { width: 15px; height: 15px; stroke-width: 3.2; }
.cb.on svg { stroke: #fff; }
.li[role=button] .s { white-space: normal; }
.li[role=button] .r { align-self: flex-start; padding-top: 2px; }
.qty { display: flex; align-items: center; margin: 6px 0 0 auto; width: 92px; height: 32px; border-radius: 9px; background: var(--card); border: 1px solid #b9d6ca; overflow: hidden; }
.qty button { width: 32px; height: 100%; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--accent); padding: 0; }
.qty button:active { background: var(--accent-soft); }
.qty span { flex: 1; text-align: center; font-size: 14px; font-weight: 600; }
.slot small { display: block; font-size: 11px; font-weight: 600; color: var(--warn); }
.slot.on small { color: #fff; }
.map { position: relative; height: 260px; border-radius: 14px; overflow: hidden; background: #e8eadf; z-index: 0; }
.map .pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); color: var(--danger); pointer-events: none; z-index: 500; }
.map .pin svg { width: 38px; height: 38px; fill: var(--danger-soft); }
.qr { display: block; }
.qr svg { width: 100%; height: 100%; display: block; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; }
.agree .cb { background: var(--card); padding: 0; }
.agree .cb.on { background: var(--accent); }
.del { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; padding: 0; }
.del svg { width: 13px; height: 13px; }

/* Аналитика: общие стили для телефона и страницы на компьютере */
.mx { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.mx h3 { margin: 0; font-size: 16px; }
.mx-note { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.mx-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.mx-tile { background: var(--bg); border-radius: 10px; padding: 10px; min-width: 0; }
.mx-l { font-size: 12px; color: var(--muted); }
.mx-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mx-s { font-size: 12px; color: var(--muted); }
.mx-sub { font-size: 13px; font-weight: 600; margin: 14px 0 2px; }
.mx-bars { margin-top: 10px; display: grid; gap: 10px; }
.mx-rl { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.mx-rl span:first-child { font-weight: 600; }
.mx-rl span:last-child { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mx-rl .mx-warn, .mx-ls.mx-warn { color: var(--warn); font-weight: 600; }
.mx-track { height: 8px; border-radius: 4px; background: var(--accent-soft); overflow: hidden; }
.mx-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.mx-row:hover .mx-track i { background: #0a4f3d; }
.mx-heat { display: grid; gap: 2px; margin-top: 12px; align-items: center; }
.mx-heat b { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
.mx-heat i { font-style: normal; height: 30px; border-radius: 4px; display: grid; place-items: center; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mx-list { margin-top: 8px; }
.mx-li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.mx-li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx-lt { font-weight: 600; font-size: 14px; }
.mx-ls { font-size: 13px; color: var(--muted); }
.mx-empty { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
/* Компьютер */
.desk { max-width: 1280px; margin: 0 auto; padding: 24px; }
.desk header { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin-bottom: 8px; }
.desk header h1 { font-size: 24px; margin: 0; flex: 1; }
.desk .grid { columns: 3 340px; column-gap: 14px; }
.desk .grid .mx { break-inside: avoid; margin: 0 0 14px; }
.desk .mx-tiles { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.desk .seg { margin: 0; }

/* Аренда: фото объекта, выбор дат, календарь хозяина */
.rphs .ph { width: 150px; height: 104px; padding: 8px; text-align: center; gap: 4px; }
.ava svg { width: 20px; height: 20px; }
.rmon { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rmon small { text-align: center; font-size: 12px; color: var(--muted); }
.rmon button { position: relative; min-height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-variant-numeric: tabular-nums; padding: 8px 0 0; }
.rmon button i { position: absolute; top: 3px; left: 0; right: 0; font-style: normal; font-size: 10px; font-weight: 400; color: var(--muted); text-decoration: none; }
.rmon button.busy { text-decoration: line-through; color: #a7a299; background: #f1efe9; }
.rmon button[disabled] { opacity: .5; }
.rmon button.in { background: var(--accent-soft); border-color: transparent; color: var(--accent); text-decoration: none; }
.rmon button.on { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }
.rmon button.on i { color: #cfe3da; }
.slot[disabled] { opacity: .35; text-decoration: line-through; }
.rcal { overflow-x: auto; margin: 0 -16px 10px; background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rcal-in { position: relative; }
.rcal-row { display: flex; height: 46px; border-bottom: 1px solid var(--line); }
.rcal-row:last-of-type { border-bottom: 0; }
.rcal-row.hid .rcal-lab span { color: var(--muted); }
.rcal-head { height: 40px; }
.rcal-lab { position: sticky; left: 0; z-index: 3; width: 100px; overflow-wrap: anywhere; flex: none; background: var(--card); border: 0; border-right: 1px solid var(--line); text-align: left; padding: 3px 6px 3px 10px; font-size: 12px; line-height: 1.2; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.rcal-lab span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.rcal-lab small { color: var(--muted); font-size: 11px; }
.rcal-cells { position: relative; display: flex; flex: none; }
.rcal-day { flex: none; text-align: center; padding-top: 3px; border-left: 1px solid var(--line); }
.rcal-day small { display: block; font-size: 11px; color: var(--muted); }
.rcal-day b { font-size: 14px; }
.rcal-day.we small { color: var(--warn); }
.rcal-day.on { background: var(--ink); }
.rcal-day.on b { color: #fff; }
.rcal-day.on small { color: #cfcac0; }
.rcal-cell { flex: none; height: 100%; border: 0; border-left: 1px solid var(--line); background: none; padding: 0; }
.rcal-cell.on { background: #f3f8f6; }
.rcal-cell[disabled] { background: #f6f5f1; }
.rcal-cell:active { background: var(--accent-soft); }
.rbar { position: absolute; top: 7px; height: 32px; border-radius: 8px; border: 0; padding: 0 6px; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.rbar.conf { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px #9cc7b6; }
.rbar.out { background: var(--accent); color: #fff; }
.rbar.req { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px #e0b97c; }
.rbar.over { background: var(--danger); color: #fff; }
.rbar.done { background: #e9e6df; color: var(--muted); }
.rbar.blk { background: repeating-linear-gradient(-45deg, #dedad1, #dedad1 5px, #f6f5f1 5px, #f6f5f1 10px); color: #4d4a44; }
.rprep { position: absolute; top: 7px; height: 32px; border-radius: 0 4px 4px 0; background: repeating-linear-gradient(-45deg, #9cc7b6, #9cc7b6 2px, transparent 2px, transparent 4px); }
.rnow { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.rleg { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin: 0 2px 10px; }
.rleg span { display: inline-flex; align-items: center; gap: 5px; }
.rleg .rbar { position: static; width: 16px; height: 10px; padding: 0; border-radius: 3px; display: inline-block; }
.rph0 { align-content: center; gap: 4px; padding: 4px; line-height: 1.15; text-align: center; overflow: hidden; }
.rph0 span { font-size: 11px; }
