/* ================= Инструменты: сканер QR и генератор штрихкодов (19.11.2026) =================
   Работают и на сайте (.brand-site: /skaner-qr-koda, /generator-shtrih-koda, главная), и в кабинете (.shell: /app/tools/…).
   Цвета — из переменных сайта --b-*; в кабинете они же заданы через цвета кабинета (brand-app.css, body.shell). */
:is(.brand-site, .shell) .sc-box, :is(.brand-site, .shell) .bc-out, :is(.brand-site, .shell) .bc-form { padding: 18px; border-radius: 18px; }
:is(.brand-site, .shell) .sc-idle { display: grid; place-items: center; gap: 8px; padding: 24px; text-align: center; color: var(--b-ink-2); }
:is(.brand-site, .shell) .sc-idle .i { width: 46px; height: 46px; opacity: .55; }
:is(.brand-site, .shell) .sc-idle p { margin: 0; max-width: 260px; }
:is(.brand-site, .shell) .bc-kinds { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
:is(.brand-site, .shell) .bc-kinds legend { padding: 0; margin-bottom: 8px; font-weight: 600; }
:is(.brand-site, .shell) .bc-kind { position: relative; }
:is(.brand-site, .shell) .bc-kind input { position: absolute; opacity: 0; pointer-events: none; }
:is(.brand-site, .shell) .bc-kind span { display: block; height: 100%; padding: 10px 12px; border: 1.5px solid var(--b-rule); border-radius: 12px;
  font-weight: 700; cursor: pointer; background: var(--b-surface); }
:is(.brand-site, .shell) .bc-kind small { display: block; margin-top: 2px; font-weight: 400; font-size: 12px; color: var(--b-ink-2); }
:is(.brand-site, .shell) .bc-kind input:checked + span { border-color: var(--b-ink); box-shadow: inset 0 0 0 1px var(--b-ink); }
:is(.brand-site, .shell) .bc-kind input:focus-visible + span { outline: 3px solid rgba(23, 27, 33, .25); outline-offset: 2px; }
@media (max-width: 520px) { :is(.brand-site, .shell) .bc-kinds { grid-template-columns: minmax(0, 1fr); } }
:is(.brand-site, .shell) .bc-code { font-size: 20px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
:is(.brand-site, .shell) .bc-err.warn { color: var(--b-red-ink); }
:is(.brand-site, .shell) .bc-img { display: grid; place-items: center; min-height: 170px; padding: 12px; border-radius: 14px; background: #fff;
  border: 1px solid var(--b-rule); }
:is(.brand-site, .shell) .bc-img svg { width: 100%; max-width: 420px; height: auto; }
:is(.brand-site, .shell) .bc-img .sc-idle { color: #5d626a; }  /* поле штрихкода всегда белое — и в тёмной теме текст тёмный */
:is(.brand-site, .shell) .bc-label { margin: 8px 0 0; overflow-wrap: anywhere; }
:is(.brand-site, .shell) .bc-acts { display: flex; gap: 10px; margin: 12px 0 0; }
:is(.brand-site, .shell) .bc-labels { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--b-rule); }
:is(.brand-site, .shell) .bc-lrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
@media (max-width: 520px) { :is(.brand-site, .shell) .bc-lrow { grid-template-columns: minmax(0, 1fr); } }

/* сканер QR, вторая версия (19.11.2026): снимок с рамками найденных кодов, ручное выделение, яркий результат */
:is(.brand-site, .shell) .sc-stage { position: relative; display: grid; place-items: center; min-height: min(260px, 62vw); max-width: 100%; aspect-ratio: 4 / 3; border-radius: 14px;
  overflow: hidden; background: var(--b-panel); border: 2px dashed var(--b-rule-2); transition: border-color .15s, background .15s; }
:is(.brand-site, .shell) .sc-stage.has-img { aspect-ratio: auto; min-height: 0; border-style: solid; border-color: var(--b-rule); background: var(--b-panel); }
:is(.brand-site, .shell) .sc-stage.drag { border-color: var(--b-ink); background: var(--b-panel-2); }
:is(.brand-site, .shell) .sc-drop { display: grid; justify-items: center; gap: 8px; padding: 28px 20px; text-align: center; cursor: pointer; width: 100%; height: 100%;
  align-content: center; color: var(--b-ink-2); }
:is(.brand-site, .shell) .sc-drop .i { width: 54px; height: 54px; opacity: .55; }
:is(.brand-site, .shell) .sc-drop b { font-size: 17px; color: var(--b-ink); }
:is(.brand-site, .shell) .sc-drop:focus-visible { outline: 3px solid var(--b-ink); outline-offset: -6px; border-radius: 12px; }
:is(.brand-site, .shell) .sc-drop kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--b-rule-2); border-bottom-width: 2px; border-radius: 6px;
  background: var(--b-surface); font: 600 12px/1.5 inherit; color: var(--b-ink); }
:is(.brand-site, .shell) .sc-video { width: 100%; height: 100%; object-fit: cover; }
:is(.brand-site, .shell) .sc-frame { position: absolute; inset: 14% 22%; border: 3px solid #fff; border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .28); pointer-events: none; }
:is(.brand-site, .shell) .sc-canvas { display: block; max-width: 100%; }
:is(.brand-site, .shell) .sc-canvas.selecting { cursor: crosshair; touch-action: none; }
:is(.brand-site, .shell) .sc-busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(250, 250, 248, .82);
  backdrop-filter: blur(2px); color: #171b21; font-size: 16px; }
:is(.brand-site, .shell) .sc-spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(23, 27, 33, .15); border-top-color: #16a34a; animation: sc-spin .8s linear infinite; }
@keyframes sc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { :is(.brand-site, .shell) .sc-spin { animation-duration: 2.4s; } }
:is(.brand-site, .shell) .sc-select-tip { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px;
  background: rgba(17, 20, 26, .86); color: #fff; font-weight: 600; font-size: 14px; pointer-events: none; white-space: nowrap; }
:is(.brand-site, .shell) .sc-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
:is(.brand-site, .shell) .sc-file { position: relative; cursor: pointer; }
:is(.brand-site, .shell) .sc-acts .btn[aria-pressed="true"] { background: var(--b-ink); border-color: var(--b-ink); color: var(--b-page); opacity: 1; }
:is(.brand-site, .shell) .sc-banner { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid; }
:is(.brand-site, .shell) .sc-banner > .i { flex: none; width: 26px; height: 26px; margin-top: 1px; }
:is(.brand-site, .shell) .sc-banner-t { display: grid; gap: 3px; }
:is(.brand-site, .shell) .sc-banner-t b { font-size: 18px; line-height: 1.25; }
:is(.brand-site, .shell) .sc-banner-t span { font-size: 15px; }
:is(.brand-site, .shell) .sc-ok { background: #e7f6ec; border-color: #7fcf9c; color: #0f4d2a; }
:is(.brand-site, .shell) .sc-ok > .i { color: #16a34a; }
:is(.brand-site, .shell) .sc-bad { background: #fff1e6; border-color: #f2b48a; color: #6b2d07; }
:is(.brand-site, .shell) .sc-bad > .i { color: #d9630f; }
:is(.brand-site, .shell) .sc-info { background: var(--b-panel); border-color: var(--b-rule-2); color: var(--b-ink); }
:root[data-theme="dark"] :is(.brand-site, .shell) .sc-ok { background: #12301f; border-color: #2f7a4b; color: #c9f0d6; }
:root[data-theme="dark"] :is(.brand-site, .shell) .sc-bad { background: #3a2212; border-color: #8a4b1f; color: #ffd9bf; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.brand-site, .shell) .sc-ok { background: #12301f; border-color: #2f7a4b; color: #c9f0d6; }
  :root:not([data-theme="light"]) :is(.brand-site, .shell) .sc-bad { background: #3a2212; border-color: #8a4b1f; color: #ffd9bf; }
}
:is(.brand-site, .shell) .sc-banner.pop { animation: sc-pop .35s ease-out; }
@keyframes sc-pop { from { transform: scale(.97); opacity: .3; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { :is(.brand-site, .shell) .sc-banner.pop { animation: none; } }
:is(.brand-site, .shell) .sc-results { display: grid; gap: 12px; margin-top: 12px; }
:is(.brand-site, .shell) .sc-results:empty { display: none; }
:is(.brand-site, .shell) .sc-card { padding: 14px; border: 1px solid var(--b-rule); border-radius: 14px; background: var(--b-surface); }
:is(.brand-site, .shell) .sc-card-h { display: flex; align-items: center; gap: 8px; }
:is(.brand-site, .shell) .sc-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #16a34a; color: #fff; font-weight: 700; font-size: 13px; }
:is(.brand-site, .shell) .sc-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--b-ink-2); }
:is(.brand-site, .shell) .sc-host { margin: 8px 0 4px; font-size: 19px; overflow-wrap: anywhere; }
:is(.brand-site, .shell) .sc-big { margin: 8px 0 4px; font-size: 24px; font-weight: 700; letter-spacing: .03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
:is(.brand-site, .shell) .sc-raw, :is(.brand-site, .shell) .sc-text { display: block; margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: var(--b-panel);
  font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; max-height: 220px; overflow: auto; }
:is(.brand-site, .shell) .sc-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; }
:is(.brand-site, .shell) .sc-rows dt { color: var(--b-ink-2); }
:is(.brand-site, .shell) .sc-rows dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
:is(.brand-site, .shell) .sc-warn { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 9px 11px; border-radius: 10px;
  background: color-mix(in srgb, #f2a100 16%, var(--b-surface)); color: var(--b-ink); font-size: 14px; }
:is(.brand-site, .shell) .sc-warn .i { flex: none; width: 18px; height: 18px; color: #b45309; margin-top: 1px; }
:is(.brand-site, .shell) .sc-cnote { margin: 8px 0 0; }
:is(.brand-site, .shell) .sc-cacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
:is(.brand-site, .shell) .sc-note { margin: 12px 0 0; }
/* на телефоне нечего перетаскивать и нет Ctrl+V — там другая подсказка */
:is(.brand-site, .shell) .sc-touch { display: none; }
@media (hover: none) and (pointer: coarse) { :is(.brand-site, .shell) .sc-desk { display: none; } :is(.brand-site, .shell) .sc-touch { display: inline; } }

/* --- инструменты внутри кабинета (/app/tools/…): две колонки, на телефоне — одна --- */
.shell .app-tool { max-width: 1120px; }
.shell .app-tool-lead { margin: 0 0 16px; max-width: 720px; font-size: 14.5px; }
.shell .app-tool-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.shell .app-tool-grid > .card { margin: 0; padding: 18px; }
.shell .app-tool-tips h2 { margin: 0 0 12px; font-size: 16px; }
.shell .app-tool-tips ul { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.shell .app-tool-tips li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.shell .app-tool-tips li b { color: var(--text); }
.shell .app-tool-tips li .i { margin-top: 2px; color: var(--accent); }
.shell .app-tool-types { margin-top: 16px; padding: 0; overflow: auto; }
.shell .app-tool .bc-kind span { background: var(--bg); }
@media (max-width: 900px) { .shell .app-tool-grid { grid-template-columns: minmax(0, 1fr); } }
