/* Интерфейс, нарисованный кодом (Максим, 2765): упрощённые экраны системы с анимацией.
   Сцены запускаются, когда видны на экране; у кого включено «уменьшить движение» — стоят на последнем кадре */

.mock { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 24px 48px -24px rgba(17,24,39,.25); overflow: hidden; text-align: left; }
.mock__bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); font-size: 13px; color: var(--foreground-muted); }
.mock__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge--muted { background: #f1f2f4; color: #4b5563; }
.badge--blue { background: var(--blue-soft); color: var(--blue); }
.badge--green { background: #e7f6ec; color: #15803d; }
.badge--yellow { background: #fdf3d8; color: #a16207; }

/* Первый экран: счёт разбирается на позиции */
.invoice-scene { margin-top: 56px; }
.invoice-scene__body { display: grid; grid-template-columns: 220px 1fr; min-height: 340px; }
.invoice-scene__drop { display: grid; place-items: center; padding: 24px; border-right: 1px solid var(--border); background: var(--surface-subtle); }
.file-chip { display: grid; justify-items: center; gap: 8px; padding: 20px 16px; border: 1px dashed #c7cdd6; border-radius: 12px; background: #fff; font-size: 13px; color: var(--foreground-secondary); width: 100%; }
.file-chip__icon { display: grid; place-items: center; width: 44px; height: 54px; border-radius: 6px; background: #fdecec; color: #dc2626; font-size: 11px; font-weight: 700; }
.invoice-scene__table { padding: 20px 24px; }
.invoice-scene__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.invoice-scene__title { font-weight: 600; }
.row { display: grid; grid-template-columns: 1fr 72px 110px; gap: 12px; padding: 10px 0; border-top: 1px solid #f0f1f3; font-size: 14px; }
.row span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.row--head { border-top: 0; padding-top: 0; font-size: 12px; color: var(--foreground-muted); }
.row--total { font-weight: 600; }
.invoice-scene__vat { margin-top: 4px; text-align: right; font-size: 12px; color: var(--foreground-muted); }

/* Приёмка на телефоне */
.phone-mock { margin: 0 auto; width: 300px; border: 8px solid #111827; border-radius: 36px; background: #fff; overflow: hidden; box-shadow: 0 24px 48px -24px rgba(17,24,39,.35); }
.phone-mock__screen { display: grid; gap: 12px; padding: 20px 16px 28px; min-height: 520px; align-content: start; }
.phone-mock__title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.phone-mock__meta { font-size: 13px; color: var(--foreground-muted); }
.item-card { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; font-size: 14px; transition: border-color .3s, box-shadow .3s; }
.item-card--active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.item-card__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; color: var(--foreground-muted); }
.item-card__top > span:first-child { white-space: nowrap; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty__input { width: 72px; height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty__of { color: var(--foreground-muted); }
.reason { font-size: 13px; color: #a16207; }

/* Задачи: карточка переезжает в «Выполнена» */
.board-mock { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; background: #fff; }
.board-col { display: grid; gap: 8px; align-content: start; min-height: 220px; padding: 10px; border-radius: 10px; background: var(--surface-subtle); }
.board-col__head { display: flex; justify-content: space-between; font-size: 12px; color: var(--foreground-muted); }
.task-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; line-height: 1.35; }
.task-card__who { margin-top: 6px; font-size: 12px; color: var(--foreground-muted); }
.task-card--moving { position: relative; z-index: 1; box-shadow: 0 12px 24px -12px rgba(17,24,39,.35); }

/* Появление строк и плавные смены */
.appear { opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; }
.appear.is-shown { opacity: 1; transform: none; }
.swap { transition: opacity .25s ease; }

@media (max-width: 640px) {
  .invoice-scene__body { grid-template-columns: 1fr; min-height: 0; }
  .invoice-scene__drop { border-right: 0; border-bottom: 1px solid var(--border); padding: 16px; }
  .file-chip { grid-auto-flow: column; justify-content: start; align-items: center; padding: 12px; }
  .file-chip__icon { width: 34px; height: 42px; }
  .invoice-scene__table { padding: 16px; }
  .row { grid-template-columns: 1fr 48px 92px; font-size: 13px; }
  .board-mock { grid-template-columns: 1fr; }
  .board-col { min-height: 0; }
  .phone-mock { width: min(320px, 100%); border-width: 7px; border-radius: 32px; }
  .phone-mock__screen { min-height: 0; padding: 18px 14px 22px; }
}

/* «Счёт разбирается сам»: бумажный счёт → поля карточки (замечание Миши, 2819) */
.parse { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; margin-top: 16px; }
.parse__paper { position: relative; padding: 18px 18px 22px; border-radius: 6px; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 36px -20px rgba(14,14,16,.3); transform: rotate(-1.5deg); font-size: 11px; line-height: 1.5; color: #4b4b52; overflow: hidden; }
.paper-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.paper-line { position: relative; margin-top: 8px; padding: 2px 4px; border-radius: 4px; }
.paper-table { margin-top: 10px; border-top: 1px solid #e6e6ea; }
.paper-row { position: relative; display: grid; grid-template-columns: 1fr 34px 60px; gap: 6px; padding: 4px 4px; border-bottom: 1px solid #f0f0f2; border-radius: 4px; }
.paper-row span:not(:first-child) { text-align: right; }
.parse [data-mark] { transition: background-color .3s, box-shadow .3s; }
.parse [data-mark].is-marked { background: var(--blue-soft); box-shadow: inset 0 0 0 1px rgba(43, 92, 224, .45); }
.parse__scan { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--blue); box-shadow: 0 0 14px 4px rgba(43, 92, 224, .35); opacity: 0; z-index: 1; }
.parse__scan.is-running { animation: scan 1.6s ease-in-out forwards; }
@keyframes scan { 0% { top: 0; opacity: 1; } 92% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
.parse__fields { display: grid; gap: 8px; }
.parse__field { display: grid; grid-template-columns: 92px 1fr; gap: 8px; align-items: baseline; padding: 9px 12px; border-radius: 10px; background: var(--paper); font-size: 14px; }
.parse__field span { font-size: 12px; color: var(--ink-muted); }
.parse__field b { font-weight: 600; font-variant-numeric: tabular-nums; }
.parse__done { justify-self: start; margin-top: 4px; }
@media (max-width: 640px) {
  .parse { grid-template-columns: 1fr; }
  .parse__paper { transform: none; }
}

/* «Переписка и уведомления»: сообщения по одному и уведомление в Telegram (замечание Миши) */
.chat-mock { position: relative; margin-top: 16px; padding: 14px 14px 84px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); min-height: 300px; overflow: hidden; }
.chat-mock__head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.chat-mock__avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--paper-2); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chat-mock__status { color: var(--ink-muted); font-size: 12px; }
.chat-mock__log { display: grid; gap: 8px; padding-top: 12px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg small { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-muted); text-align: right; }
.msg--in { justify-self: start; background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg--out { justify-self: end; background: var(--blue); color: #fff; border-top-right-radius: 4px; }
.msg--out small { color: rgba(255,255,255,.75); }
.msg__file { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--paper); font-size: 12px; color: var(--ink-2); }
.msg__file b { display: grid; place-items: center; width: 22px; height: 26px; border-radius: 4px; background: #fdecec; color: #dc2626; font-size: 8px; }
.toast { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: flex-start; width: min(270px, calc(100% - 24px)); padding: 10px 12px; border-radius: 12px; background: var(--ink); color: var(--on-dark); font-size: 12px; box-shadow: 0 16px 32px -12px rgba(0,0,0,.45); opacity: 0; transform: translateY(12px); transition: opacity .35s var(--ease-out), transform .35s var(--ease-out); }
.toast.is-shown { opacity: 1; transform: none; }
.toast__icon { display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: #2AABEE; color: #fff; font-size: 13px; }
.toast b { display: block; font-size: 12px; }
.toast span { color: var(--on-dark-muted); }
