/* 19n1: страница /zakaz/ — в духе iOS: крупные плитки, мягкие тени, один акцентный цвет. */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --fill: #e8e8ed;
  --accent: #0066cc;
  --accent-soft: #e8f1fb;
  --accent-ink: #004c99;
  --ok: #1a7f37;
  --ok-soft: #e7f5ea;
  --warn: #8a5a00;
  --warn-soft: #fff6e0;
  --bad: #c41e1e;
  --bad-soft: #fdecec;
  --radius: 22px;
  --tile: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --font: "Inter", system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.noscript { padding: 24px; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(245, 245, 247, .86); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }
.brand { font-weight: 650; font-size: 17px; letter-spacing: -.2px; color: var(--text); text-decoration: none; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--card); color: var(--text); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.top .icon-btn[hidden] + .brand { margin-left: 52px; }

.screen { flex: 1; padding: 4px 16px 140px; display: flex; flex-direction: column; gap: 14px; }
.screen > * { animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .screen > *, .spinner { animation: none !important; } }

h1 { margin: 8px 0 0; font-size: 32px; line-height: 1.12; font-weight: 750; letter-spacing: -.7px; }
h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.3px; }
.lead { margin: 0; color: var(--muted); font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Большая кнопка загрузки */
.drop { border: 2px dashed #a1c6ee; background: var(--card); border-radius: 28px; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; width: 100%; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.drop:active { transform: scale(.98); }
.drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop__icon { width: 76px; height: 76px; border-radius: 38px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.drop__icon svg { width: 36px; height: 36px; }
.drop__title { font-size: 21px; font-weight: 650; }
.drop--small { flex-direction: row; padding: 16px 18px; border-radius: var(--radius); gap: 12px; justify-content: center; }
.drop--small .drop__icon { width: 40px; height: 40px; }
.drop--small .drop__icon svg { width: 22px; height: 22px; }
.drop--small .drop__title { font-size: 17px; }

.kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kind { background: var(--card); border-radius: 18px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 13px; line-height: 1.3; box-shadow: var(--shadow); }
.kind svg { width: 30px; height: 30px; stroke-width: 1.6; }
.kind b { font-size: 14px; }

/* Подсказки */
.hint { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-soft); color: #5c3d00; border-radius: 18px; padding: 14px 16px; font-size: 15px; line-height: 1.45; }
.hint svg { color: var(--warn); width: 28px; height: 28px; stroke-width: 1.7; }
.hint__pic { flex: none; width: 92px; }
.hint__pic svg { width: 92px; height: 64px; stroke-width: 1.4; color: #8a5a00; }
body.no-hints .hint { display: none; }

/* Карточка файла */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.file { display: flex; gap: 12px; align-items: center; }
.thumb { width: 56px; height: 72px; border-radius: 10px; background: var(--fill); flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--muted); position: relative; }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb--photo { width: 64px; height: 64px; }
.file__info { min-width: 0; flex: 1; }
.file__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__meta { color: var(--muted); font-size: 14px; }
.file__price { font-weight: 650; white-space: nowrap; }
.x-btn { width: 36px; height: 36px; border-radius: 18px; border: 0; background: var(--fill); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.x-btn svg { width: 18px; height: 18px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--bad { background: var(--bad-soft); color: var(--bad); }
.badge--info { background: var(--accent-soft); color: var(--accent-ink); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--fill); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }

/* Группа плиток */
.opt { display: flex; flex-direction: column; gap: 8px; }
.opt__label { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { min-height: 64px; border: 2px solid transparent; background: var(--bg); border-radius: var(--tile); padding: 10px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; font-size: 14px; font-weight: 600; line-height: 1.2; transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.tile:active { transform: scale(.97); }
.tile small { font-weight: 500; color: var(--muted); font-size: 12px; }
.tile svg { width: 34px; height: 28px; stroke-width: 1.6; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.tile[aria-pressed="true"] small { color: var(--accent-ink); }
.tile:disabled { opacity: .45; cursor: default; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border-radius: 14px; }
.stepper button { width: 46px; height: 46px; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--accent); }
.stepper button:disabled { color: var(--line); }
.stepper output, .stepper input { min-width: 44px; width: 64px; text-align: center; font-weight: 650; font-size: 18px; border: 0; background: transparent; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; flex: none; transition: background .2s ease; margin: 0; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s ease; }
.switch input:checked { background: #34c759; }
.switch input:checked::after { transform: translateX(20px); }
.switch__text b { display: block; font-weight: 600; }
.switch__text span { color: var(--muted); font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 14px; padding: 13px 14px; background: var(--card); font-size: 17px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.field.is-bad input { border-color: var(--bad); }
.field__err { color: var(--bad); font-size: 14px; }

.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .thumb { width: 64px; height: 64px; }
.strip .thumb .x-mini { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 11px; border: 0; background: rgba(0, 0, 0, .55); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.strip .thumb .x-mini svg { width: 12px; height: 12px; stroke-width: 3; }
.strip .thumb .q-dot { position: absolute; left: 4px; bottom: 4px; width: 12px; height: 12px; border-radius: 6px; border: 2px solid #fff; }

.link-btn { border: 0; background: none; color: var(--accent); padding: 6px 0; font-weight: 600; text-align: left; }
.btn { min-height: 54px; border: 0; border-radius: 16px; padding: 0 22px; font-size: 17px; font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:active { background: var(--accent-ink); }
.btn--primary:disabled { background: #9cc3ea; cursor: default; }
.btn--ghost { background: var(--fill); color: var(--text); }
.btn--block { width: 100%; }

/* Нижняя панель с итогом */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); border-top: 1px solid rgba(0, 0, 0, .06); }
.bar__in { max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.bar__sum { flex: 1; min-width: 0; }
.bar__total { font-size: 22px; font-weight: 750; letter-spacing: -.3px; }
.bar__note { color: var(--muted); font-size: 13px; line-height: 1.3; }
.bar .btn { flex: none; min-width: 150px; }

.receipt { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.receipt .row { align-items: baseline; }
.receipt .row span:first-child { color: var(--muted); }
.receipt__total { border-top: 1px solid var(--fill); padding-top: 10px; margin-top: 4px; font-weight: 700; font-size: 18px; }
.receipt__total span:first-child { color: var(--text) !important; }

.progress { height: 8px; border-radius: 4px; background: var(--fill); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.done-icon { width: 88px; height: 88px; border-radius: 44px; background: #34c759; color: #fff; display: flex; align-items: center; justify-content: center; margin: 24px auto 4px; }
.done-icon svg { width: 46px; height: 46px; stroke-width: 2.6; }
.center { text-align: center; }
.err-box { background: var(--bad-soft); color: var(--bad); border-radius: 16px; padding: 12px 14px; font-size: 15px; }

@media (min-width: 600px) {
  .screen { padding-top: 16px; }
  h1 { font-size: 38px; }
}
.thumb--tap { cursor: pointer; }
.thumb--tap:active { transform: scale(.96); }

/* 19n2: услуги на первом экране и в «Добавить» */
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.svc { display: flex; flex-direction: column; gap: 8px; }
.svc__item { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; text-align: left; background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); }
.svc__item:active { transform: scale(.98); }
.svc__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.svc__icon svg { width: 26px; height: 26px; stroke-width: 1.6; }
.svc__text { display: flex; flex-direction: column; min-width: 0; }
.svc__text b { font-weight: 600; }
.svc__text small { color: var(--muted); font-size: 13px; }
.svc--small { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.svc--small .svc__item { padding: 10px 12px; gap: 10px; }
.svc--small .svc__icon { width: 36px; height: 36px; }
.tiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Фото на документы */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.checks li { padding: 8px 12px 8px 34px; border-radius: 12px; position: relative; }
.checks li::before { position: absolute; left: 12px; top: 8px; font-weight: 700; }
.checks__ok { background: var(--ok-soft); color: var(--ok); }
.checks__ok::before { content: "✓"; }
.checks__warn { background: var(--warn-soft); color: var(--warn); }
.checks__warn::before { content: "!"; }
.checks__bad { background: var(--bad-soft); color: var(--bad); }
.checks__bad::before { content: "×"; }
.idprev { display: flex; gap: 12px; align-items: flex-end; }
.idprev figure { margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.idprev img { display: block; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); background: #fff; }
.idprev figure:first-child img { width: 96px; }
.idprev__sheet { flex: 1; min-width: 0; }
.idprev__sheet img { width: 100%; max-width: 240px; }
.idprev figcaption { font-size: 12px; color: var(--muted); text-align: center; }

/* Промокод и бонусы */
.promo { display: flex; gap: 8px; align-items: flex-end; }
.promo .field { flex: 1; }
.promo .btn { min-height: 52px; }
.receipt__bonus span { color: var(--ok) !important; }

/* Конструктор визиток — на весь экран */
.ctor { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow: auto; -webkit-overflow-scrolling: touch; }
.ctor[hidden] { display: none; }
.ctor__bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(245, 245, 247, .92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.ctor__bar b { flex: 1; }
.ctor__bar .btn { min-height: 44px; }
.ctor__host { max-width: 1100px; margin: 0 auto; padding: 16px; }
.ctor .err-box { margin: 12px 16px 0; }
body.ctor-open { overflow: hidden; }

/* 19n2: компьютер — заказ слева, чек справа (нижняя панель только на телефоне) */
.side { display: none; }
@media (min-width: 1000px) {
  .app { max-width: 1140px; display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: auto 1fr; column-gap: 40px; padding: 0 32px; }
  .top { grid-column: 1 / -1; padding-left: 0; padding-right: 0; }
  .screen { padding: 4px 0 64px; max-width: 680px; }
  .side:not([hidden]) { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; align-self: start; padding-top: 58px; }
  .side__card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
  .side__total { font-size: 30px; font-weight: 750; letter-spacing: -.5px; }
  .side__note { margin: 0; color: var(--muted); font-size: 14px; }
  .side__note--bad { color: var(--bad); }
  .side__help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; padding: 0 4px; }
  .side__steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
  .bar { display: none !important; }
  .only-phone { display: none; }
  h1 { font-size: 40px; }
  .svc:not(.svc--small) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .svc:not(.svc--small) .svc__item { flex-direction: column; align-items: flex-start; }
  .idprev figure:first-child img { width: 130px; }
  .idprev__sheet img { max-width: 300px; }
}

/* 19n2: шапка как на главной — логотип «К», название, телефон, мессенджеры */
.top { justify-content: flex-start; gap: 10px; background: rgba(255, 255, 255, .9); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.icon-btn--plain { box-shadow: none; background: transparent; width: 40px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.2px; min-width: 0; }
.logo__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 16px; flex: none; }
.logo__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top__contact { display: none; flex-direction: column; align-items: flex-end; line-height: 1.25; margin-right: 6px; }
.top__phone { color: var(--text); font-weight: 700; font-size: 15px; text-decoration: none; }
.top__pickup { color: var(--muted); font-size: 12px; }
.top__msg { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 12px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; }
.top__msg svg { width: 20px; height: 20px; }
.top__msg span { display: none; }
.top__msg--wa { background: #0b7a6e; }
.top__msg--tg { background: #2aabee; }
.top .icon-btn { width: 40px; height: 40px; }
@media (max-width: 440px) { .logo__city { display: none; } }
.top { box-shadow: 0 0 0 100vmax rgba(255, 255, 255, .9); clip-path: inset(0 -100vmax); }
@media (min-width: 760px) {
  .top__contact { display: flex; }
  .top__msg span { display: inline; }
  .top__msg { padding: 0 14px; }
}

/* 19n2: «Это: документ / фото / …» — клиент поправляет распознавание */
.kind-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kind-row__label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.kind-row[data-guessed] .kind-row__label { color: var(--accent-ink); font-weight: 600; }
.chip { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }

/* 19n2h: проверка зоны доставки под адресом (assets/js/delivery-check.js) */
.dcheck { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: -4px 0 0; }
.dcheck__btn { max-width: 100%; white-space: normal; text-align: left; line-height: 1.3; height: auto; min-height: 44px; padding: 10px 16px; font-size: 15px; }
.dcheck > [role="status"] { margin: 0; font-size: 15px; font-weight: 600; border-radius: 12px; padding: 8px 12px; max-width: 100%; overflow-wrap: anywhere; }
.dcheck > [role="status"][hidden] { display: none; }
/* setMsg() в delivery-check.js переписывает className целиком, поэтому оформление — по роли внутри .dcheck */
.dcheck .delivery-check__msg--ok { color: var(--ok); background: var(--ok-soft); }
.dcheck .delivery-check__msg--err { color: var(--bad); background: var(--bad-soft); }
.dcheck .delivery-check__msg--info { color: var(--warn); background: var(--warn-soft); }
