/* «Фильм» обработки: документ слева, извлечённое справа. Светлая тема, без свечения. */
.stage { padding:20px 20px 14px; }
.st-files { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.st-chip { font-size:12.5px; padding:4px 10px; border:1px solid var(--line); border-radius:3px;
           color:var(--mut); background:#fafaf8; transition:all .3s; }
.st-chip b { font-weight:600; margin-right:4px; }
.st-chip.on { border-color:var(--ink); color:var(--txt); background:#eef3f8; }
.st-chip.done { color:var(--ok); border-color:#b7d6b9; }
.st-chip.done::before { content:'✓ '; }
.st-title { font-size:20px; font-weight:600; margin-bottom:14px; min-height:28px; }

.st-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:20px; }
.st-grid.prices { grid-template-columns:300px minmax(0,1fr); }
.st-doc, .st-out { height:min(62vh,560px); }
.st-doc { overflow:hidden; }
.st-out { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:3px; }
.st-out-head { padding:10px 14px; border-bottom:1px solid var(--line); background:#f7f7f5; font-size:13px; color:var(--mut); }
.st-out-head b { font-size:22px; color:var(--txt); font-variant-numeric:tabular-nums; margin-right:6px; }
.st-rows { flex:1; overflow:auto; padding:6px 0; scroll-behavior:smooth; }
.st-foot { display:flex; justify-content:flex-end; margin-top:12px; }

/* Лист документа */
.paper { position:relative; height:100%; overflow:hidden; border:1px solid var(--line); background:#fff;
         box-shadow:0 1px 2px rgba(0,0,0,.06); }
.paper img { width:100%; display:block; }
.scanline { position:absolute; left:0; right:0; top:0; height:3px; background:var(--ink);
            box-shadow:0 0 0 1px rgba(31,78,121,.15), 0 6px 14px rgba(31,78,121,.18); transition:top .25s linear; }
.read-area { position:absolute; left:0; right:0; top:0; height:0; background:rgba(31,78,121,.07);
             border-bottom:1px solid rgba(31,78,121,.25); transition:height .25s linear; }

.sheet-wrap { overflow:auto; }
.sheet { font-size:12px; border-collapse:collapse; width:max-content; min-width:100%; }
.sheet td { border:1px solid #e3e3df; padding:3px 6px; white-space:nowrap; max-width:320px;
            overflow:hidden; text-overflow:ellipsis; position:static; background:#fff; }
.sheet td.rn { background:#f3f3f0; color:var(--mut); text-align:right; }
.sheet tr.read td { background:#f1f6fb; }
.sheet tr.reading td { background:#dfeaf5; outline:1px solid var(--ink); }

.tree { overflow:auto; padding:10px 0; font-size:13px; }
.tree-head { padding:4px 14px 10px; color:var(--mut); border-bottom:1px solid var(--line2); margin-bottom:6px; }
.tree-sec { padding:6px 14px; font-weight:600; background:#f3f3f0; }
.tree-pos { padding:4px 14px 4px 28px; }
.tree .read { background:#f1f6fb; }
.tree .reading { background:#dfeaf5; box-shadow:inset 3px 0 0 var(--ink); }

/* Извлечённые строки */
.st-sec { padding:8px 14px 4px; font-size:12px; font-weight:600; color:var(--mut); }
.st-row { display:flex; justify-content:space-between; gap:12px; padding:6px 14px; border-bottom:1px solid var(--line2); font-size:13px; }
.st-name { min-width:0; }
.st-name i { display:block; font-style:normal; color:var(--mut); font-size:11.5px; }
.st-qty { white-space:nowrap; font-variant-numeric:tabular-nums; color:var(--mut); }
.fly { animation:fly .35s ease-out both; }
@keyframes fly { from { opacity:0; transform:translateX(18px); background:#eef3f8; } to { opacity:1; transform:none; } }

/* Сцена поиска цен */
.pr-board { height:100%; display:flex; flex-direction:column; justify-content:center; gap:28px;
            border:1px solid var(--line); padding:28px; }
.pr-board span { display:block; color:var(--mut); font-size:13px; }
.pr-board b { font-size:40px; font-weight:600; font-variant-numeric:tabular-nums; letter-spacing:-.02em; }
.pr-board small { color:var(--mut); margin-left:8px; font-size:15px; }
.pr-board .sup-list { font-size:20px; }
.pr-row { display:grid; grid-template-columns:minmax(0,1fr) auto 90px 92px; gap:10px; align-items:center;
          padding:7px 14px; border-bottom:1px solid var(--line2); font-size:13px; color:var(--mut); transition:background .25s; }
.pr-row.active { background:#eef3f8; color:var(--txt); }
.pr-row.done { color:var(--txt); }
.pr-sup { display:flex; gap:4px; }
.pr-sup em { font-style:normal; font-size:11px; padding:2px 6px; border:1px solid var(--line); border-radius:2px; color:var(--mut); }
.pr-sup em.ask { animation:ask .5s ease-in-out infinite alternate; }
@keyframes ask { from { border-color:var(--line); } to { border-color:var(--ink); color:var(--ink); } }
.pr-sup em.miss { opacity:.35; }
.pr-sup em.best { background:var(--ink); border-color:var(--ink); color:#fff; }
.pr-price { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
.pr-st { font-size:12px; text-align:right; }

@media (max-width: 720px) {
  .st-grid { grid-template-columns:1fr; }
  .st-doc { height:34vh; } .st-out { height:42vh; }
  .st-title { font-size:16px; }
  .pr-row { grid-template-columns:minmax(0,1fr) 80px; }
  .pr-row .pr-sup, .pr-row .pr-st { display:none; }
  .pr-board { padding:16px; gap:12px; } .pr-board b { font-size:26px; }
}
@media (prefers-reduced-motion: reduce) {
  .fly, .pr-sup em.ask { animation:none; }
  .scanline, .read-area { transition:none; }
}
