/* Оформление в стиле Apple: системный шрифт, много воздуха, полупрозрачные панели,
   мягкие тени, отклик на нажатие сразу (на pointer-down), уважение к настройкам «меньше движения». */

:root {
  /* Палитра: светлый «яблочный» фон, синий акцент чистоты, голубой второй цвет */
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: #f2f2f7;            /* заливка полей и сегментов, как в iOS */
  --fill-2: #e8e8ed;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(60, 60, 67, .12);
  --accent: #0071e3;          /* основной синий */
  --accent-2: #0062c4;
  --accent-soft: rgba(0, 113, 227, .1);
  --sky: #5ac8fa;             /* голубой: пузыри, градиенты */
  --danger: #ff3b30;
  --danger-soft: rgba(255, 59, 48, .1);
  --ok: #248a3d;
  --ok-soft: rgba(52, 199, 89, .14);
  --wa: #25d366;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .12);
  --press: transform 100ms ease-out;
}

* { 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: 106.25%/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  letter-spacing: -0.012em; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif; }
h1 { font-size: 1.75rem; line-height: 1.12; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 .4rem; }
h2 { font-size: 1.18rem; line-height: 1.2; letter-spacing: -0.018em; font-weight: 650; margin: 0 0 .9rem; }
small, .muted { color: var(--muted); }
.muted { font-size: .88rem; letter-spacing: -0.005em; }
[hidden] { display: none !important; }

/* ---------- Шапка: полупрозрачный материал, контент прокручивается под ней ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(245, 245, 247, .72); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 650; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 7px; }
.brand span { line-height: 1.2; }
@media (max-width: 400px) { .brand { font-size: .94rem; } }
.lang { display: flex; flex-shrink: 0; white-space: nowrap; padding: 2px; background: var(--fill-2); border-radius: 9px; font-size: .78rem; }
.lang span { padding: 4px 10px; border-radius: 7px; }
.lang-on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.lang-off { color: var(--muted); cursor: not-allowed; }
.lang-off small { font-size: .68rem; }

.wrap { max-width: 660px; margin: 0 auto; padding: 18px 16px 130px; }
.hero { padding: 12px 4px 18px; }
.hero p { margin: 0; color: var(--muted); }

/* ---------- Карточки и группы ---------- */
.card { display: block; background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
  color: inherit; box-shadow: var(--shadow); }
.card.center { text-align: center; }
.card.narrow { max-width: 400px; margin: 32px auto; }

/* Выбор уборки: сгруппированный список, как в Настройках iOS */
.options { display: grid; gap: 0; margin-bottom: 14px; background: var(--fill); border-radius: 14px; overflow: hidden; }
.option { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; position: relative;
  transition: background-color 150ms ease; }
.option + .option::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; height: .5px; background: var(--line); }
.option:active { background: var(--fill-2); }
.option:has(input:checked) { background: var(--accent-soft); }
.option span { flex: 1; }
.option b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.option input { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; }

/* ---------- Поля ввода: залитые, без рамки ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .82rem; margin: 0 0 6px 4px; color: var(--muted); letter-spacing: 0; }
input[type=text], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; font: inherit; letter-spacing: -0.01em; padding: 12px 14px; border: 0; border-radius: 12px;
  background: var(--fill); color: var(--text); min-height: 48px; transition: box-shadow 150ms ease, background-color 150ms ease;
  -webkit-appearance: none; appearance: none; }
select { 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; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; background-color: var(--card); box-shadow: 0 0 0 4px rgba(0, 113, 227, .25), 0 0 0 1px var(--accent); }
.bad { background-color: var(--danger-soft) !important; box-shadow: 0 0 0 1px var(--danger) !important; }
.err { display: block; color: var(--danger); font-size: .82rem; font-style: normal; margin: 6px 4px 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Количество: степпер как в iOS ---------- */
.qty-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: .5px solid var(--line); }
.qty-row:first-of-type { border-top: 0; padding-top: 0; }
.qty-row small { font-variant-numeric: tabular-nums; }
.stepper { display: flex; align-items: center; flex-shrink: 0; background: var(--fill); border-radius: 10px; padding: 2px; }
.stepper input { width: 44px; text-align: center; padding: 6px 2px; min-height: 36px; background: transparent; border-radius: 0;
  font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input:focus { box-shadow: none; background: transparent; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.step { width: 40px; height: 36px; border-radius: 8px; border: 0; background: transparent; font-size: 1.3rem; line-height: 1;
  cursor: pointer; color: var(--accent); transition: var(--press), background-color 100ms ease; }
.step:active { background: var(--fill-2); transform: scale(.92); }

/* ---------- Кнопки: отклик сразу при нажатии ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 12px 22px;
  border: 0; border-radius: 980px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: var(--press), background-color 150ms ease, opacity 150ms ease; user-select: none; }
.btn:hover { background: var(--accent-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-light { background: var(--accent-soft); color: var(--accent); }
.btn-light:hover { background: rgba(0, 113, 227, .16); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #e0352b; }
.btn-wa { background: var(--wa); }
.btn-wa:hover { background: #1fb959; }
.btn.wide { width: 100%; }
.btn-sm { min-height: 36px; padding: 7px 16px; font-size: .9rem; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; }

/* ---------- Нижняя панель с итогом: материал с размытием ---------- */
.total-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -.5px 0 var(--line); transition: transform .4s cubic-bezier(.2, .8, .2, 1); }
.total-bar > div { display: flex; flex-direction: column; }
.total-bar small { font-size: .78rem; }
.total-bar strong { font-size: 1.45rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
@media (min-width: 692px) { .total-bar { left: 50%; transform: translateX(-50%); width: 660px; bottom: 14px; border-radius: 22px;
  box-shadow: var(--shadow-lg), inset 0 .5px 0 rgba(255,255,255,.6); padding-bottom: 12px; } }
body.on-welcome .total-bar { transform: translateY(140%); }
@media (min-width: 692px) { body.on-welcome .total-bar { transform: translate(-50%, 140%); } }
.note { font-size: .84rem; color: var(--muted); margin: 8px 4px; }

.alert, .success { padding: 13px 16px; border-radius: 14px; margin-bottom: 14px; font-size: .95rem; }
.alert { background: var(--danger-soft); color: #c4271d; }
.success { background: var(--ok-soft); color: var(--ok); }
.success strong { display: block; }

/* ---------- Заказ ---------- */
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.badge { font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 980px; white-space: nowrap; letter-spacing: 0; }
.s-new { background: rgba(255, 149, 0, .14); color: #b25f00; }
.s-confirmed { background: var(--accent-soft); color: var(--accent); }
.s-on_the_way { background: rgba(88, 86, 214, .13); color: #4b49c7; }
.s-done { background: var(--ok-soft); color: var(--ok); }
/* «Отменён» — тёмно-красный #B22222 (просьба пользователя) */
.s-cancelled { background: rgba(178, 34, 34, .12); color: #b22222; }

.progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; padding: 0; margin: 16px 0;
  font-size: .72rem; color: var(--muted); }
.progress li { padding-top: 8px; position: relative; }
.progress li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--fill-2); }
.progress li.done { color: var(--text); font-weight: 500; }
.progress li.done::before { background: linear-gradient(90deg, var(--accent), var(--sky)); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.items { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.items td { padding: 10px 0; border-bottom: .5px solid var(--line); vertical-align: top; }
.items td:nth-child(2) { color: var(--muted); padding: 10px 8px; white-space: nowrap; }
.items td:last-child { text-align: right; white-space: nowrap; }
.items .sum td { font-weight: 700; border-bottom: 0; color: var(--text); font-size: 1.05rem; }

/* ---------- Админка: вкладки как сегментированный переключатель ---------- */
.tabs { display: flex; gap: 2px; margin: 10px auto 0; padding: 3px; max-width: 628px; width: calc(100% - 32px);
  background: var(--fill-2); border-radius: 11px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1; text-align: center; padding: 7px 10px; border-radius: 9px; color: var(--text); font-size: .9rem; font-weight: 500;
  white-space: nowrap; transition: background-color 150ms ease, box-shadow 150ms ease; }
.tabs a:hover { text-decoration: none; }
.tabs a.on { background: var(--card); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
.count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 980px; background: var(--danger);
  color: #fff; font-size: .7rem; font-weight: 700; text-align: center; line-height: 18px; vertical-align: 1px; }
.filters, .period { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar, .period::-webkit-scrollbar { display: none; }
.chip { padding: 7px 14px; border-radius: 980px; background: var(--card); color: var(--text); white-space: nowrap; font-size: .88rem;
  box-shadow: var(--shadow); transition: var(--press); }
.chip:hover { text-decoration: none; }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--text); color: #fff; }

.order-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: relative; }
.order-row.unseen::before { content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--accent); }
.order-row.unseen { padding-left: 26px; }
.order-main { min-width: 0; }
.order-name { display: block; font-size: 1.06rem; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.order-when { display: flex; gap: 8px; margin-top: 2px; color: var(--muted); font-variant-numeric: tabular-nums; }
.order-when span:last-child { font-weight: 600; color: var(--text); }
.order-when .today { color: var(--accent); font-weight: 600; }
.order-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.push-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { padding: 9px 0; border-bottom: .5px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history .muted { margin-right: 8px; font-variant-numeric: tabular-nums; }

/* ---------- Финансы ---------- */
.custom-range { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.custom-range .field { margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.tile small { display: block; font-size: .8rem; font-weight: 500; }
.tile strong { display: block; font-size: 1.5rem; margin: 4px 0 2px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile .muted { font-size: .78rem; }
.tile.main { background: linear-gradient(135deg, var(--accent), #2f8cff 60%, var(--sky)); color: #fff; }
.tile.main small, .tile.main .muted { color: rgba(255,255,255,.85); }
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; gap: 10px; } .tile { padding: 12px 16px; } .tile strong { font-size: 1.3rem; }
  .custom-range { grid-template-columns: 1fr 1fr; } .custom-range .btn { grid-column: 1 / -1; }
}
.fin-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fin-table th { text-align: left; font-weight: 500; font-size: .78rem; color: var(--muted); padding: 6px 4px; border-bottom: .5px solid var(--line); }
.fin-table td { padding: 10px 4px; border-bottom: .5px solid var(--line); }
.fin-table tr:last-child td { border-bottom: 0; }
.fin-table td:last-child, .fin-table th:last-child { text-align: right; white-space: nowrap; }
.fin-table .cancelled td:last-child { color: var(--muted); text-decoration: line-through; }
.fin-table .nowrap { white-space: nowrap; color: var(--muted); }
.fin-table .st { display: block; color: var(--muted); font-size: .78rem; }

/* ---------- Услуги и цены ---------- */
.svc-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 14px 0; border-top: .5px solid var(--line); }
.svc-row:first-of-type { border-top: 0; padding-top: 0; }
.svc-row > input { grid-column: 1 / -1; font-weight: 500; }
.svc-row .price { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--muted); font-size: .9rem; }
.svc-row .price input { width: 112px; font-variant-numeric: tabular-nums; }
.svc-row .err { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 10px; margin: 12px 0; cursor: pointer; }
.check input[type=checkbox]:not(.switch) { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.changed { box-shadow: 0 0 0 2px #ff9f0a !important; background-color: rgba(255, 159, 10, .08) !important; }
label.changed { border-radius: 980px; }

/* Переключатель iOS вместо галочки */
.switch { -webkit-appearance: none; appearance: none; position: relative; flex-shrink: 0; width: 51px; height: 31px; margin: 0;
  border-radius: 980px; background: #e9e9ea; cursor: pointer; transition: background-color 250ms ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform 250ms cubic-bezier(.3, .7, .4, 1.1); }
.switch:checked { background: #34c759; }
.switch:checked::after { transform: translateX(20px); }
.switch:active::after { width: 31px; }
.switch:checked:active::after { transform: translateX(16px); }
.switch:focus-visible { outline: 3px solid rgba(0, 113, 227, .4); outline-offset: 2px; }

.consent { align-items: flex-start; font-size: .86rem; color: var(--muted); line-height: 1.4; }
.consent input { margin-top: 1px; }
.bad-check { color: var(--danger); }
.policy h2 { margin-top: 1.6rem; }
.policy p, .policy li { color: var(--text); }
.footer-links { text-align: center; font-size: .88rem; margin-top: 12px; }

/* ---------- Окна: материализуются, фон затемняется ---------- */
dialog { border: 0; border-radius: 24px; padding: 24px; width: min(92vw, 440px); box-shadow: var(--shadow-lg); color: var(--text); }
dialog[open] { animation: materialize 320ms cubic-bezier(.2, .8, .2, 1); }
dialog::backdrop { background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog ul { padding-left: 18px; max-height: 40vh; overflow: auto; }
@keyframes materialize { from { opacity: 0; transform: scale(.94); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

/* Поле-ловушка для ботов: убрано за пределы экрана, человек его не видит */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 380px) { .row2 { grid-template-columns: 1fr; } .tabs a { padding: 7px 6px; font-size: .84rem; } }

/* ---------- Приветственный экран ---------- */
html { scroll-behavior: smooth; }
.welcome { position: relative; min-height: calc(100svh - 64px); display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; margin: -18px -16px 18px; padding: 24px 16px 40px; overflow: hidden;
  background: radial-gradient(90% 60% at 50% 8%, rgba(90, 200, 250, .22) 0%, rgba(0, 113, 227, .06) 45%, transparent 75%), var(--bg); }
.eyebrow { margin: 0 0 10px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.welcome-title { font-size: clamp(2.3rem, 9vw, 3.8rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 14px; }
.welcome-title .line { display: block; }
.shine { background: linear-gradient(90deg, #0071e3, #2f8cff, #5ac8fa, #2f8cff, #0071e3); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
.sparkle { display: inline-block; margin-left: 4px; color: #ffcc00; font-size: .6em; vertical-align: top; animation: twinkle 1.8s ease-in-out infinite; }
.lead { max-width: 460px; margin: 0 auto 4px; color: var(--muted); font-size: 1.06rem; line-height: 1.45; letter-spacing: -0.012em; }
.sofa-stage { position: relative; width: 100%; max-width: 580px; height: clamp(260px, 42vh, 400px); }
.sofa-stage canvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.sofa-stage canvas:active { cursor: grabbing; }
.sofa-fallback { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 7rem; animation: bob 2.4s ease-in-out infinite; }
.sofa-stage.no-3d canvas, .sofa-stage.no-3d .sofa-hint { display: none; }
.sofa-stage.no-3d .sofa-fallback { display: flex; }
.sofa-hint { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: .78rem; color: var(--muted); white-space: nowrap;
  padding: 6px 12px; border-radius: 980px; background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: var(--shadow); pointer-events: none; transition: opacity .4s; opacity: 0; }
.sofa-stage.ready .sofa-hint { opacity: 1; animation: nudge 2.4s ease-in-out 1.5s 3; }
.sofa-stage.touched .sofa-hint { opacity: 0; }
.btn-big { min-height: 56px; padding: 15px 36px; font-size: 1.08rem; margin-top: 10px; box-shadow: 0 8px 24px rgba(0, 113, 227, .3); }
.scroll-down { margin-top: 18px; width: 26px; height: 40px; border: 2px solid rgba(29, 29, 31, .25); border-radius: 14px; position: relative; }
.scroll-down span { position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px;
  background: var(--muted); animation: wheel 1.8s ease-in-out infinite; }
.float-bubbles i { position: absolute; bottom: -40px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.95), rgba(90,200,250,.28) 60%, rgba(0,113,227,.1));
  border: 1px solid rgba(90, 200, 250, .3); animation: rise linear infinite; }
.float-bubbles i:nth-child(1) { left: 6%;  width: 22px; height: 22px; animation-duration: 9s; }
.float-bubbles i:nth-child(2) { left: 18%; width: 12px; height: 12px; animation-duration: 7s; animation-delay: 2s; }
.float-bubbles i:nth-child(3) { left: 32%; width: 30px; height: 30px; animation-duration: 12s; animation-delay: 4s; }
.float-bubbles i:nth-child(4) { left: 64%; width: 16px; height: 16px; animation-duration: 8s; animation-delay: 1s; }
.float-bubbles i:nth-child(5) { left: 78%; width: 26px; height: 26px; animation-duration: 11s; animation-delay: 3s; }
.float-bubbles i:nth-child(6) { left: 90%; width: 14px; height: 14px; animation-duration: 7.5s; animation-delay: 5s; }
.float-bubbles i:nth-child(7) { left: 48%; width: 18px; height: 18px; animation-duration: 10s; animation-delay: 6s; }
.anim { opacity: 0; transform: translateY(16px); filter: blur(6px); animation: rise-in .8s cubic-bezier(.2, .8, .2, 1) forwards; }
.d1 { animation-delay: .05s; } .d2 { animation-delay: .18s; } .d3 { animation-delay: .32s; }
.d4 { animation-delay: .48s; } .d5 { animation-delay: .62s; } .d6 { animation-delay: .8s; }

@keyframes rise-in { to { opacity: 1; transform: none; filter: none; } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes twinkle { 0%, 100% { transform: scale(.7) rotate(0); opacity: .5; } 50% { transform: scale(1.2) rotate(20deg); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes nudge { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 10px)); } 75% { transform: translateX(calc(-50% + 10px)); } }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(-110vh); opacity: 0; } }

/* ---------- Игра «очисти диван» после заказа ---------- */
.clean-dialog { text-align: center; width: min(94vw, 420px); padding: 26px 20px 20px; }
.clean-dialog h2 { font-size: 1.4rem; letter-spacing: -0.025em; margin: 0 0 4px; }
.clean-sub { margin: 0 0 10px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.clean-task { margin: 0 0 10px; font-size: .92rem; color: var(--muted); }
.clean-area { position: relative; width: 100%; aspect-ratio: 320 / 220; margin: 0 auto; }
.clean-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#clean-dirt { touch-action: none; cursor: grab; }
#clean-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fx-bubble { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%; border: 1px solid rgba(90, 200, 250, .5); background: radial-gradient(circle at 30% 30%, #fff, rgba(90, 200, 250, .35));
  animation: pop .9s ease-out forwards; }
.fx-sparkle { position: absolute; color: #ffcc00; font-style: normal; font-size: 22px; animation: spark 1.4s ease-out forwards; }
.clean-progress { height: 6px; background: var(--fill-2); border-radius: 980px; overflow: hidden; margin: 12px 0 6px; }
.clean-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--sky));
  border-radius: 980px; transition: width .25s ease; }
.clean-label { margin: 0; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.clean-done { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--ok-soft); color: var(--ok); animation: rise-in .5s ease forwards; }
.clean-buttons { justify-content: center; margin-top: 14px; }
.clean-dialog.cleaned .clean-area { animation: happy .6s ease 2; }
@keyframes pop { 0% { transform: scale(.4); opacity: 1; } 100% { transform: translateY(-26px) scale(1.2); opacity: 0; } }
@keyframes spark { 0% { transform: scale(0) rotate(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: scale(1.4) rotate(90deg) translateY(-20px); opacity: 0; } }
@keyframes happy { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Доступность: меньше движения, меньше прозрачности, больше контраста ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anim, .shine, .sparkle, .float-bubbles i, .scroll-down span, .sofa-fallback, .sofa-stage.ready .sofa-hint,
  dialog[open], .clean-dialog.cleaned .clean-area { animation: none; opacity: 1; transform: none; filter: none; }
  .btn:active, .chip:active, .step:active { transform: none; }
  .switch::after { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .total-bar, .sofa-hint { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --muted: #3a3a3c; --line: rgba(0, 0, 0, .35); }
  .card, .tile { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
  input, select, textarea { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .4); }
}
.switch-row { justify-content: space-between; padding: 6px 0 4px; }
.chip-cancelled { color: #b22222; }
.chip-cancelled.on { background: #b22222; color: #fff; }
/* «Оформить заказ» на приветствии прокручивает к заголовку формы, не пряча его под шапкой */
.hero { scroll-margin-top: 64px; }

/* ---------- Демо-режим ---------- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; padding: 9px 16px;
  background: #fff4e5; color: #8a4b00; font-size: .84rem; text-align: center; line-height: 1.35; }
.demo-bar a { font-weight: 600; color: #8a4b00; text-decoration: underline; white-space: nowrap; }
.demo-login { padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: .92rem; }
.clean-demo { margin: 0 0 8px; font-size: .82rem; color: #8a4b00; }

/* ---------- Профиль ---------- */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 2px 0 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--sky), var(--accent)); color: #fff; font-size: 1.5rem; font-weight: 700; }
a.tile { color: inherit; transition: var(--press); }
a.tile:hover { text-decoration: none; }
a.tile:active { transform: scale(.98); }
.logout-btn { color: #b22222; margin-top: 10px; }
/* 5 вкладок панели помещаются на узком телефоне */
@media (max-width: 430px) { .tabs { gap: 0; } .tabs a { padding: 7px 3px; font-size: .78rem; letter-spacing: -0.02em; } }
