:root {
  --ink: #3B2B30; --pink: #D98BA0; --soft: #F8E6EA; --muted: #7E666C; --paper: #FBF6F4;
  --line: #F0E2E3; --line2: #F3E7E8; --rose: #9C4862; --warn-bg: #FCEFE0; --warn: #7A4A1A; --red: #A1452F;
}
* { box-sizing: border-box; }
html { background: #EFE3E1; }
body { margin: 0; background: #EFE3E1; font-family: 'Nunito', system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; text-wrap: pretty; }
a { color: #B0566F; }
button, input, select { font-family: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.scr::-webkit-scrollbar { display: none; }
.scr { scrollbar-width: none; }

.app { max-width: 440px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--paper); display: flex; flex-direction: column; position: relative; }
@media (min-width: 480px) { .app { box-shadow: 0 30px 60px -20px rgba(59,43,48,.35); } }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 4px; font: 700 14px Nunito, sans-serif; }
.top b { font-weight: 800; color: #B0566F; }
.main { flex: 1; padding: 8px 18px 24px; display: flex; flex-direction: column; gap: 18px; }
.nav { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px 14px calc(14px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); z-index: 5; }
.nav button { border: 0; background: none; cursor: pointer; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 800 12px Nunito, sans-serif; color: var(--muted); }
.nav button svg { width: 44px; height: 30px; padding: 3px 10px; border-radius: 999px; transition: background .15s, color .15s; }
.nav button.on { color: var(--ink); }
.nav button.on svg { background: var(--soft); color: var(--rose); }

.h1 { font: 800 30px/1.1 Nunito, sans-serif; }
.h2 { font: 800 26px/1.15 Nunito, sans-serif; }
.b15 { font: 800 15px Nunito, sans-serif; }
.b14 { font: 800 14px Nunito, sans-serif; }
.m12 { font: 600 12px/1.4 Nunito, sans-serif; color: var(--muted); }
.m13 { font: 600 13px/1.4 Nunito, sans-serif; color: var(--muted); }
.heart { color: var(--pink); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.card { background: #fff; border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.tile { background: var(--paper); border-radius: 14px; padding: 10px; }
.grow { flex: 1; min-width: 0; }

.btn { border: 0; cursor: pointer; padding: 14px; border-radius: 16px; font: 800 15px Nunito, sans-serif; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-out { background: transparent; border: 1.5px solid var(--ink); }
.btn-sm { padding: 8px 12px; border-radius: 12px; font-size: 12px; }
.btn-round { border: 0; background: #fff; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font: 700 18px Nunito, sans-serif; box-shadow: 0 1px 3px rgba(59,43,48,.08); }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; font: 700 13px Nunito, sans-serif; color: #B0566F; }
.pills { display: flex; gap: 4px; padding: 4px; background: #fff; border-radius: 999px; align-self: flex-start; }
.pills button { border: 0; cursor: pointer; padding: 8px 14px; border-radius: 999px; font: 700 13px Nunito, sans-serif; background: transparent; }
.pills button.on, .chip.on { background: var(--ink); color: #fff; }
.chip { flex: none; border: 0; cursor: pointer; padding: 8px 13px; border-radius: 999px; font: 700 13px Nunito, sans-serif; background: #fff; }
.tag { font: 700 11px Nunito, sans-serif; padding: 3px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); }
.tag.why { background: var(--soft); color: var(--rose); }
.tag.now { background: var(--ink); color: #fff; font-weight: 800; }
.tag.new { background: var(--pink); color: var(--ink); font-weight: 800; }

.field { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 13px 14px; font: 700 16px Nunito, sans-serif; }
.field:focus { border-color: var(--pink); outline: none; }
.phone { position: relative; width: 100%; }
.phone .field { padding-right: 72px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.phone.big .field { font: 800 22px Nunito, sans-serif; padding: 16px 80px 16px 16px; border-radius: 16px; letter-spacing: .03em; }
.phone .phone-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--line2); color: var(--muted); font: 800 13px Nunito, sans-serif; cursor: pointer; display: none; }
.phone.filled .phone-clear { display: block; }
.phone .phone-ok { position: absolute; right: 46px; top: 50%; transform: translateY(-50%) scale(.6); opacity: 0; color: #4F9D69; font: 900 18px Nunito, sans-serif; transition: .15s; }
.phone.ok .phone-ok { opacity: 1; transform: translateY(-50%) scale(1); }
.phone.ok .field { border-color: #9BCBAA; }
.btn:disabled { background: #CDBFC2; }
.datef { position: relative; display: block; width: 100%; }
.datef-txt { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.datef-txt.ph { color: #B9A7AB; }
.datef input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.datef:focus-within .datef-txt { border-color: var(--pink); }
.datef-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--line2); color: var(--muted); font: 800 12px Nunito, sans-serif; cursor: pointer; display: none; z-index: 1; }
.datef.filled .datef-clear { display: block; }
.err { color: var(--red); font: 700 13px Nunito, sans-serif; }

.strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { border: 0; cursor: pointer; padding: 8px 0; border-radius: 14px; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.day.on { background: var(--ink); color: #fff; }
.day:disabled { opacity: .35; cursor: default; }
.arrow:disabled { opacity: .3; cursor: default; }
.day .dw { font: 600 11px Nunito, sans-serif; opacity: .8; }
.day .num { font: 800 16px Nunito, sans-serif; }
.day .cnt { font: 700 10px Nunito, sans-serif; opacity: .7; }
.day .dot { width: 5px; height: 5px; border-radius: 50%; }
.arrow { flex: none; border: 0; background: #fff; width: 30px; align-self: stretch; min-height: 34px; border-radius: 12px; cursor: pointer; font: 800 18px Nunito, sans-serif; color: var(--ink); }
.mday { border: 0; background: var(--paper); border-radius: 12px; padding: 6px 0 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; font: 800 14px Nunito, sans-serif; min-height: 42px; }
.mday i { font: 700 9px Nunito, sans-serif; font-style: normal; color: var(--rose); height: 10px; letter-spacing: -1px; }
.mday.off { opacity: .45; }
.mday.today { box-shadow: inset 0 0 0 1.5px var(--pink); }
.mday.on { background: var(--ink); color: #fff; opacity: 1; }
.mday.on i { color: #fff; }
a.chip.mess { text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); padding: 6px 11px; font-size: 12px; }
.copy-link { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1.5px dashed #E8B9C5; border-radius: 16px; padding: 14px 16px; }
.copy-link:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.picked { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--pink); border-radius: 14px; padding: 11px 14px; }
.pick-row { border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 10px 14px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; width: 100%; }
.pick-row:hover, .pick-row:focus-visible { border-color: var(--pink); }
.price { position: relative; flex: 1; }
.price span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 700 14px Nunito, sans-serif; color: var(--muted); }
.price .field { padding-right: 28px; }
textarea.field { font-weight: 600; font-size: 15px; }
.hscroll { display: flex; gap: 6px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.hscroll .day { flex: none; width: 52px; }

.appt { border: 0; background: #fff; border-radius: 18px; padding: 14px; display: flex; gap: 14px; cursor: pointer; text-align: left; width: 100%; }
.appt.block { background: repeating-linear-gradient(135deg, #F3ECEA 0 8px, #EDE3E1 8px 16px); }
.appt.guest { cursor: default; }
.gap { background: var(--soft); border: 1.5px dashed var(--pink); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cand { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 10px 12px; }
.dead { display: flex; align-items: center; gap: 10px; padding: 0 4px; font: 700 12px Nunito, sans-serif; color: var(--red); }
.dead span.l { flex: 1; border-top: 1.5px dashed #E3B9AE; }
.empty { padding: 22px; border: 1.5px dashed #E8D3D6; border-radius: 18px; text-align: center; font: 600 14px Nunito, sans-serif; color: var(--muted); }
.list-item { background: #fff; border-radius: 18px; padding: 12px 12px 12px 14px; display: flex; align-items: center; gap: 10px; }
.list-item > .open { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.heart-btn { border: 0; width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font: 400 20px Nunito, sans-serif; color: var(--pink); flex: none; }

.slot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; text-align: left; width: 100%; }
.slot.on { border-color: var(--pink); background: var(--soft); }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slots button { border: 1.5px solid var(--line); background: #fff; padding: 12px 0; border-radius: 14px; cursor: pointer; font: 800 14px Nunito, sans-serif; }
.slots button.fit { border-color: var(--pink); }

.toggle-row { border: 0; background: none; padding: 14px 0; display: flex; gap: 12px; align-items: center; cursor: pointer; text-align: left; border-bottom: 1px solid var(--line2); width: 100%; }
.rules > :last-child { border-bottom: 0; }
.sw { width: 48px; height: 28px; border-radius: 14px; padding: 3px; display: flex; flex: none; background: #E8D3D6; }
.sw.on { justify-content: flex-end; background: var(--pink); }
.sw i { width: 22px; height: 22px; border-radius: 50%; background: #fff; }

.overlay { position: fixed; inset: 0; background: rgba(59,43,48,.35); z-index: 20; cursor: pointer; -webkit-tap-highlight-color: transparent; }   /* cursor: без него iPhone не присылает нажатие по затемнению */
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 440px; background: var(--paper); border-radius: 28px 28px 0 0; padding: 10px 18px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; max-height: 85vh; overflow-y: auto; z-index: 21; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #E8D3D6; align-self: center; }
.bubble { background: #fff; border-radius: 18px 18px 18px 6px; padding: 14px 16px; font: 600 15px/1.45 Nunito, sans-serif; white-space: pre-line; }
.copy-msg { border: 0; width: 100%; text-align: left; cursor: pointer; color: var(--ink); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s; }
.copy-msg:hover, .copy-msg.done { box-shadow: inset 0 0 0 1.5px var(--pink); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 92px; width: calc(100% - 36px); max-width: 404px; background: var(--ink); color: #fff; border-radius: 16px; padding: 13px 16px; font: 700 14px/1.35 Nunito, sans-serif; box-shadow: 0 10px 30px rgba(59,43,48,.3); z-index: 30; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); font: 600 14px Nunito, sans-serif; }

/* окно записи, перенос, новая запись */
.sheet.tall { max-height: 92vh; }
.ava { width: 48px; height: 48px; border-radius: 50%; background: var(--soft); color: var(--rose); display: flex; align-items: center; justify-content: center; font: 800 18px Nunito, sans-serif; flex: none; }
.nudge { border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; height: 46px; font: 800 14px Nunito, sans-serif; cursor: pointer; color: var(--ink); }
.nudge:active { background: var(--ink); color: #fff; border-color: var(--ink); }
.fitln { display: flex; align-items: flex-start; gap: 8px; font: 700 13px/1.35 Nunito, sans-serif; color: #2F6B45; }
.fitln svg { flex: none; margin-top: 1px; }
.fitln.warn { color: var(--warn); }
.fitln.bad { color: var(--red); }
.list-link { border: 0; width: 100%; background: #fff; border-radius: 18px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--ink); font-family: inherit; }
.tile-btn { border: 0; background: #fff; border-radius: 16px; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 800 12px Nunito, sans-serif; cursor: pointer; text-decoration: none; color: var(--ink); }
.tile-btn svg { color: var(--rose); }
.tile-btn:disabled { opacity: .45; cursor: default; }
.step { font: 800 13px Nunito, sans-serif; color: var(--muted); }
.svcs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.svc { border: 0; background: #fff; border-radius: 14px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px; cursor: pointer; color: var(--ink); font-family: inherit; }
.svc.on { background: var(--ink); color: #fff; }
.svc.on .m12 { color: #E9D9DC; }
.dstrip { display: flex; gap: 4px; align-items: stretch; }
.ddays { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; min-width: 0; }
.dnav { flex: none; width: 26px; border: 0; background: none; font: 800 20px Nunito, sans-serif; color: var(--rose); cursor: pointer; padding: 0; }
.dday { border: 0; background: #fff; border-radius: 12px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; color: var(--ink); font-family: inherit; min-width: 0; }
.dday .dw { font: 700 11px Nunito, sans-serif; color: var(--muted); }
.dday .dn { font: 800 15px Nunito, sans-serif; }
.dday .dl { font: 700 9.5px Nunito, sans-serif; color: var(--muted); white-space: nowrap; }
.dday.free .dl { color: #2F6B45; }
.dday.off { background: #F3ECEA; color: var(--muted); }
.dday.today { box-shadow: inset 0 0 0 1.5px var(--pink); }
.dday.on { background: var(--ink); color: #fff; box-shadow: none; }
.dday.on .dw, .dday.on .dl { color: #F8E6EA; }
.tslots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tslot { border: 0; background: #fff; border-radius: 12px; height: 44px; font: 800 14px Nunito, sans-serif; cursor: pointer; color: var(--ink); }
.tslot.like { box-shadow: inset 0 0 0 1.5px var(--pink); }
.tslot.on { background: var(--ink); color: #fff; box-shadow: none; }
.tslot.custom { background: none; border: 1.5px dashed var(--pink); color: var(--rose); font-size: 13px; }
.tslot.custom.on { background: var(--soft); }
.sheet-foot { position: sticky; bottom: calc(-28px - env(safe-area-inset-bottom)); margin: 4px -18px calc(-28px - env(safe-area-inset-bottom)); background: #fff; padding: 14px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px -12px rgba(59,43,48,.25); display: flex; flex-direction: column; gap: 10px; border-radius: 22px 22px 0 0; z-index: 3; }
.dayline { position: relative; margin: 8px 0 4px 44px; border-left: 1.5px solid var(--line2); flex: none; }
.dl-h { position: absolute; left: -46px; width: 38px; text-align: right; font: 700 11px Nunito, sans-serif; color: var(--muted); transform: translateY(-50%); }
.dl-item { position: absolute; left: 6px; right: 0; background: #F3ECEA; border-radius: 10px; padding: 2px 10px; font: 700 12px Nunito, sans-serif; color: var(--muted); overflow: hidden; }
.dl-item.blk { background: repeating-linear-gradient(135deg, #F3ECEA 0 8px, #EDE3E1 8px 16px); }
.dl-me { position: absolute; left: 12px; right: 6px; background: var(--pink); color: var(--ink); border-radius: 10px; padding: 4px 10px; display: flex; align-items: center; gap: 8px; font: 800 13px Nunito, sans-serif; box-shadow: 0 8px 18px -6px rgba(59,43,48,.45); touch-action: none; cursor: grab; z-index: 2; user-select: none; -webkit-user-select: none; }
.dl-me.grab { cursor: grabbing; box-shadow: 0 14px 26px -8px rgba(59,43,48,.55); }
.dl-me.bad { background: #EBB0A3; outline: 2px solid var(--red); }
.appt.movable { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.appt.lifted { position: relative; z-index: 5; transform-origin: center; box-shadow: 0 22px 40px -14px rgba(59,43,48,.55), 0 0 0 2px var(--pink) !important; }
.appt.lifted [data-t=s] { color: var(--rose); }
.appt.lifted.clash { box-shadow: 0 22px 40px -14px rgba(59,43,48,.55), 0 0 0 2px var(--red) !important; }
#undo { display: flex; align-items: center; gap: 10px; }
#undo[hidden] { display: none; }
#undo button { border: 0; background: none; color: var(--soft); font: 800 14px Nunito, sans-serif; cursor: pointer; padding: 6px 4px; margin-left: auto; }
.tile-sub { display: block; font: 700 10px Nunito, sans-serif; color: var(--muted); margin-top: 1px; }
.sheet.swiping { transition: none; }
.sheet.settle { transition: transform .22s ease-out; }
/* услуги и цены */
.svc-row { border: 0; border-bottom: 1px solid var(--line2); background: none; padding: 13px 0; display: flex; align-items: center; gap: 12px; cursor: pointer; color: var(--ink); font-family: inherit; width: 100%; }
.svc-row:last-child { border-bottom: 0; }
.svc-row.off { color: var(--muted); }
.m12.warn { color: var(--warn); font-weight: 700; }
.price-step { border: 0; background: #fff; width: 52px; height: 52px; border-radius: 16px; font: 800 24px Nunito, sans-serif; color: var(--ink); cursor: pointer; flex: none; }
.price-step:active { background: var(--ink); color: #fff; }
.price-big { flex: 1; min-width: 0; background: #fff; border: 1.5px solid var(--pink); border-radius: 16px; height: 52px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; }
.price-big input { border: 0; outline: 0; background: none; width: 100%; min-width: 0; text-align: right; font: 800 26px Nunito, sans-serif; color: var(--ink); }
.price-big span { font: 800 20px Nunito, sans-serif; color: var(--muted); }
.note-soft { background: var(--soft); border-radius: 14px; padding: 11px 14px; font: 600 12px/1.45 Nunito, sans-serif; color: #6E555B; }
/* наложения в ленте дня: как в календаре iPhone — сдвиг вправо и полоса слева */
.appt.nested { width: auto; box-shadow: inset 4px 0 0 var(--pink) !important; }   /* width: auto — со сдвигом не вылезать за край */
.appt.block.nested { box-shadow: inset 4px 0 0 #C9B6BA !important; }
.tag.over { background: #FBE3D6; color: var(--red); font-weight: 800; }
.dl-me.over { background: #F2C49B; outline: 2px solid #D9822B; }
.appt.lifted.clash { box-shadow: 0 22px 40px -14px rgba(59,43,48,.55), 0 0 0 2px #D9822B !important; }
