/*
 * Веб-версия «BlackCoat» для клиентов (с 0.70): iPhone и компьютер. Поверх общего app.css — как экраны приложения:
 * одна колонка шириной с телефон, серые блоки, чёрная главная кнопка внизу формы.
 */
body { min-height: 100vh; }
/* Шапка — в цвете бренда BlackCoat (тёмно-синий), одинаковая в светлой и тёмной теме */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: #111322; color: #fff; border-bottom: 1px solid #1E2236;
}
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; text-decoration: none; }
.top .brand .logo { width: 30px; }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 8px 12px; border-radius: 12px; color: rgba(255, 255, 255, .72); font-weight: 550; text-decoration: none; }
.top nav a.on { background: rgba(255, 255, 255, .12); color: #fff; }
/* Разделы не помещаются рядом с названием на телефоне (кабинет агентства — 4, с 0.79 и сайт клиента — 3) — строкой ниже, поровну */
@media (max-width: 600px) {
  .top { flex-wrap: wrap; row-gap: 6px; padding-bottom: 6px; }
  .top .brand { white-space: nowrap; }
  .top nav { width: 100%; gap: 2px; }
  .top nav a { flex: 1; text-align: center; padding: 8px 2px; font-size: 15px; }
}
.wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 120px; display: flex; flex-direction: column; gap: 14px; }
.wrap h1 { font-size: 26px; line-height: 1.2; text-wrap: balance; }
.wrap p, .wrap .t, .wrap .s { text-wrap: pretty; }
.sec { font-size: 17px; font-weight: 650; margin-top: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.rowx { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Строки списков — как ListRow в приложении */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 18px;
  background: var(--s2); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.item:hover { background: var(--s3); }
/* Строка-сведение (карточка агентства): не нажимается — без подсветки и руки */
.item.plain { cursor: default; }
.item.plain:hover { background: var(--s2); }
.item .t { font-weight: 600; }
.item .s { color: var(--muted); font-size: 14px; }
.item .chev { color: var(--muted); font-size: 20px; flex: none; }
/* Выбор из списка («Бронь сразу»): выбранная строка — с рамкой, как выбранное предложение в приложении */
button.item { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.item.on { box-shadow: inset 0 0 0 2px var(--text); }
.item .tags { margin-top: 6px; }
.item .center { flex: none; text-align: right; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Формы */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.choice {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1.5px solid transparent; border-radius: 16px;
  background: var(--s2); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.choice b { font-weight: 600; }
.choice span { color: var(--muted); font-size: 13px; }
.choice.on { border-color: var(--primary); background: var(--bg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 16px; background: var(--s2); }
.stepper .v { font-weight: 600; }
.stepper .btns { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--bg); color: var(--text); font: inherit; font-size: 20px; cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: default; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--s2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.check.off { opacity: .55; cursor: default; }
/* Поле под галочкой — со сдвигом под её текст */
.sub { margin-left: 32px; }
.found { padding: 12px 14px; border-radius: 14px; background: var(--green-bg); color: var(--text); font-size: 14px; }
.found a { font-weight: 600; }
.err { color: var(--red); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; }
.count { text-align: right; color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Нижняя панель формы: главная кнопка всегда под рукой */
.bar {
  position: sticky; bottom: 0; margin: 6px -16px -120px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--bg); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}

/* Заказ */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--muted); }
.kv span:nth-child(even) { text-align: right; font-weight: 550; }
.kv .total { font-weight: 700; font-size: 16px; color: var(--text) !important; }
.code { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.code b { font-size: 34px; letter-spacing: .18em; font-weight: 700; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline .st { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.timeline .st:last-child { padding-bottom: 0; }
.timeline .dot { width: 12px; height: 12px; border-radius: 6px; background: var(--s4); margin-top: 5px; flex: none; position: relative; z-index: 1; }
.timeline .st.done .dot { background: var(--green); }
.timeline .st:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 2px; background: var(--s3); }
.offer { display: flex; flex-direction: column; gap: 10px; }
.offer .price { font-size: 20px; font-weight: 700; white-space: nowrap; }
.quote { padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 14px; }
.stars { display: flex; gap: 6px; }
.stars button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg); color: var(--s4); font-size: 24px; cursor: pointer; }
.stars button.on { color: var(--star); }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Чат */
.chat { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; background: var(--s2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--primary); color: var(--on-primary); }
.msg.sys { align-self: center; background: transparent; color: var(--muted); font-size: 13px; text-align: center; }
.msg .a { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg .w { display: block; font-size: 11px; opacity: .6; margin-top: 4px; text-align: right; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 14px; background: var(--inverse); color: var(--on-inverse);
  box-shadow: var(--shadow); font-size: 14px; text-wrap: pretty;
}
.center { text-align: center; }
@media (max-width: 420px) { .wrap h1 { font-size: 23px; } .code b { font-size: 30px; } }

/* Охранники смены и фото (с сервера по токену — через blob:) */
.guard { display: flex; align-items: center; gap: 12px; }
.ava { width: 44px; height: 44px; border-radius: 22px; object-fit: cover; flex: none; cursor: zoom-in; background: var(--s3); }
.ava.none { display: grid; place-items: center; font-weight: 650; color: var(--muted); cursor: default; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--s3); cursor: zoom-in; }
.zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .86); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* Метки внутри карточки — по ширине текста, не во всю строку */
.block > .tag { align-self: flex-start; }

/* Галочка внутри серого блока — без своего фона */
.block .check { background: none; padding: 0; }
/* Поля внутри серого блока — светлее блока, чтобы было видно, куда нажимать */
.block .field { background: var(--bg); }
.block .btn.secondary { background: var(--bg); }
.block .btn.secondary:hover { background: var(--s3); }
/* iPhone: поле с текстом мельче 16 px Safari увеличивает при касании — поля всегда 16 px */
input.field, textarea.field, select.field { font-size: 16px; }

/* Уведомления — как список в приложении: новые — с точкой */
.notes { display: flex; flex-direction: column; gap: 8px; }
.note { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--bg); color: var(--text); font: inherit; text-align: left; }
button.note { cursor: pointer; }
.wrap > .notes .note { background: var(--s2); }
.note .t { font-weight: 600; }
.note.new .t::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--blue); margin-right: 8px; vertical-align: 2px; }
.note .s { color: var(--muted); font-size: 14px; }
.note .w { color: var(--muted); font-size: 12px; }

/* Документы (с 0.75): договор, счёт, акт — читаются на экране и печатаются без шапки и кнопок («Сохранить как PDF») */
.doc { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 18px; background: var(--s2); }
.doc h1 { font-size: 22px; text-wrap: balance; }
.doc h3 { font-size: 15px; margin: 0 0 4px; color: var(--muted); font-weight: 600; }
.doc p { margin: 0; white-space: pre-line; text-wrap: pretty; line-height: 1.5; }
.nowrap { white-space: nowrap; }
@media print {
  .top, .noprint, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .doc { padding: 0; background: none; color: #000; }
  .doc h3 { color: #444; }
  .docpart { break-inside: avoid; }
}

/* Карточка агентства (с 0.77): плитки «смен выполнено», «заказывают снова», «смен через сервис» */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
.stats div { background: var(--bg); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 13px; text-wrap: balance; }
/* Звёзды отзыва — цвет StarColor приложения; пустые — цветом рамки */
.stars { color: #F5A524; letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--outline); }

/* Аналитика «Про» в кабинете агентства (с 0.78): доля выбранных откликов и выручка по неделям */
.meter { height: 8px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.weeks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: end; height: 96px; }
.weeks div { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.weeks i { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--primary); }
.weeks span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* Шаг «Осталось настроить» ведёт к форме (с 0.84): блок не прячется под липкой шапкой */
[id^="setup-"] { scroll-margin-top: 112px; }
