/* ============================================================
   КвалисЛаб · Моя лаборатория — стили (mobile-first)
   Палитра: сиреневый #958CE8, голубой #ACD1FD, тёмный #21222D,
   нейтральный #DBDBE5. Golos Text, мягкие «объёмные» тени,
   лёгкий химический мотив.
   ============================================================ */

@font-face { font-family: 'Golos Text'; src: url(fonts/golos-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Golos Text'; src: url(fonts/golos-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Golos Text'; src: url(fonts/golos-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Golos Text'; src: url(fonts/golos-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --font: 'Golos Text', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --brand: #6c5fd8;         /* интерактив: кнопки, активное, FAB */
  --brand-dark: #5a4dc8;
  --brand-soft: #ecebfb;    /* светлая сиреневая заливка */
  --accent: #acd1fd;        /* голубой акцент */
  --accent-soft: #e8f1ff;
  --navy: #21222d;          /* заголовки, тёмные элементы */
  --mark-gap: #ffffff;

  --bg: #f2f1f7;
  --surface: #ffffff;
  --surface-2: #f2f1f7;
  --border: #e8e8f0;
  --border-strong: #dbdbe5;

  --text: #2b2c38;
  --text-2: #61637a;
  --text-3: #9a9fb2;

  --ok: #2e9e6b;      --ok-soft: #e5f4ec;
  --warn: #c5892c;    --warn-soft: #f9f0dc;
  --danger: #e0574f;  --danger-soft: #fceae9;
  --precursor: #9b45c0; --precursor-soft: #f4e9f9;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --shadow: 0 2px 8px rgba(33, 34, 45, .05);
  --shadow-md: 0 6px 18px rgba(33, 34, 45, .08);
  --shadow-lg: 0 18px 44px rgba(33, 34, 45, .20);
  --shadow-btn: 0 5px 14px color-mix(in srgb, var(--brand) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
  --nav-h: 76px;

  /* лёгкий гексагональный (химический) мотив */
  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='96' viewBox='0 0 56 96'%3E%3Cg fill='none' stroke='%236c5fd8' stroke-opacity='0.06' stroke-width='1.5'%3E%3Cpath d='M28 1 54 16v30L28 61 2 46V16z'/%3E%3Cpath d='M28 49 54 64v30M28 49 2 64v30'/%3E%3C/g%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #958ce8; --brand-dark: #a99ff0; --brand-soft: #2a2846;
    --accent: #acd1fd; --accent-soft: #1c2740; --navy: #ececf3; --mark-gap: #21222d;
    --bg: #16171f; --surface: #21222d; --surface-2: #282a36;
    --border: #313340; --border-strong: #40414f;
    --text: #e7e7ee; --text-2: #a6a9ba; --text-3: #7d8194;
    --ok: #55cf95; --ok-soft: #123020; --warn: #e6b155; --warn-soft: #33280f;
    --danger: #ff8078; --danger-soft: #3a1a18;
    --precursor: #cf8ae0; --precursor-soft: #2c1b33;
    --shadow: 0 2px 8px rgba(0, 0, 0, .3); --shadow-md: 0 6px 18px rgba(0, 0, 0, .38);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
  }
}
:root[data-theme="dark"] {
  --brand: #958ce8; --brand-dark: #a99ff0; --brand-soft: #2a2846;
  --accent: #acd1fd; --accent-soft: #1c2740; --navy: #ececf3; --mark-gap: #21222d;
  --bg: #16171f; --surface: #21222d; --surface-2: #282a36;
  --border: #313340; --border-strong: #40414f;
  --text: #e7e7ee; --text-2: #a6a9ba; --text-3: #7d8194;
  --ok: #55cf95; --ok-soft: #123020; --warn: #e6b155; --warn-soft: #33280f;
  --danger: #ff8078; --danger-soft: #3a1a18;
  --precursor: #cf8ae0; --precursor-soft: #2c1b33;
  --shadow: 0 2px 8px rgba(0, 0, 0, .3); --shadow-md: 0 6px 18px rgba(0, 0, 0, .38);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .55);
}
:root[data-theme="light"] {
  --brand: #6c5fd8; --brand-dark: #5a4dc8; --brand-soft: #ecebfb; --accent: #acd1fd; --accent-soft: #e8f1ff;
  --navy: #21222d; --mark-gap: #ffffff;
  --bg: #f2f1f7; --surface: #ffffff; --surface-2: #f2f1f7;
  --border: #e8e8f0; --border-strong: #dbdbe5;
  --text: #2b2c38; --text-2: #61637a; --text-3: #9a9fb2;
  --ok: #2e9e6b; --ok-soft: #e5f4ec; --warn: #c5892c; --warn-soft: #f9f0dc;
  --danger: #e0574f; --danger-soft: #fceae9;
  --precursor: #9b45c0; --precursor-soft: #f4e9f9;
  --shadow: 0 2px 8px rgba(33, 34, 45, .05); --shadow-md: 0 6px 18px rgba(33, 34, 45, .08);
  --shadow-lg: 0 18px 44px rgba(33, 34, 45, .20);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%; overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
body { height: 100vh; height: 100dvh; overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); }

/* ---------- Каркас ---------- */
#app {
  max-width: 620px; margin: 0 auto;
  height: 100vh; height: 100dvh;
  background: var(--bg);
  display: flex; flex-direction: column; overflow: hidden;
}
.appbar {
  flex: none; z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 12px;
  display: flex; align-items: center; gap: 12px; min-height: 56px;
}
.appbar h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: -.3px; color: var(--navy); }
.appbar .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; font-weight: 500; }
.appbar .grow { flex: 1; min-width: 0; }
.appbar .titles { min-width: 0; }
.appbar .titles h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logo { width: 36px; height: 36px; flex: none; display: grid; place-items: center; }
.logo svg, svg.mark { display: block; }

.iconbtn {
  border: 1px solid var(--border); background: var(--surface);
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; flex: none; color: var(--text-2);
  transition: background .12s;
}
.iconbtn:active { background: var(--surface-2); }
.iconbtn svg { width: 20px; height: 20px; }

.screen {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(env(safe-area-inset-bottom, 0px) + 26px);
}
.screen.no-tabs { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 26px); }

/* ---------- Полоса контекста ---------- */
.ctxbar { flex: none; z-index: 25; background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 10px; }
.ctx { width: 100%; background: none; border: 0; text-align: left; padding: 9px 6px; display: flex; flex-direction: column; gap: 1px; }
.ctx-co { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.ctx-dep { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--brand); }
.ctx-dep svg { width: 15px; height: 15px; flex: none; }
.ctx-dep svg:last-child { margin-left: -2px; opacity: .7; }

/* ---------- Экран регистрации (с химическим мотивом) ---------- */
.hero {
  text-align: center; padding: 18px 8px 22px; display: grid; justify-items: center; gap: 10px;
  background: var(--hex) center top / 56px 96px repeat; border-radius: var(--radius-lg); margin-bottom: 6px;
}
.hero h2 { margin: 6px 0 0; font-size: 23px; font-weight: 700; letter-spacing: -.5px; color: var(--navy); }
.hero p { margin: 0; font-size: 14px; color: var(--text-2); max-width: 40ch; line-height: 1.5; }

/* ---------- Компания ---------- */
.company-card .cc-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.company-card .cc-name { font-size: 18px; font-weight: 700; line-height: 1.25; color: var(--navy); }
.dep-item, .user-item { width: 100%; text-align: left; font: inherit; color: inherit; background: var(--surface); }
.dep-item.active, .user-item.active { box-shadow: var(--shadow), inset 3px 0 0 var(--brand); }
.badge.dep { background: var(--surface-2); color: var(--text-2); }
.scopeseg { margin-bottom: 14px; }

/* ---------- Нижняя навигация + центральная кнопка скана ---------- */
.tabbar {
  flex: none; z-index: 40; background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-around;
  padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 8px);
}
.tabbar a {
  flex: 1; padding: 4px 2px; text-decoration: none; color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 550; letter-spacing: .1px;
}
.tabbar a svg { width: 23px; height: 23px; }
.tabbar a.active { color: var(--brand); }
.tabbar a.fab {
  flex: none; width: 58px; height: 58px; margin-top: -22px; border-radius: 20px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow-btn); border: 4px solid var(--surface);
}
.tabbar a.fab svg { width: 26px; height: 26px; }
.tabbar a.fab:active { transform: translateY(1px); }

/* ---------- Плитки статистики ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 16px; }
.kpi { background: var(--surface); border-radius: var(--radius); padding: 14px 15px; text-align: left;
  box-shadow: var(--shadow); position: relative; overflow: hidden; border: 1.5px solid transparent; }
.kpi .num { font-size: 27px; font-weight: 600; line-height: 1.05; letter-spacing: -.8px; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi .lbl { font-size: 12px; color: var(--text-2); margin-top: 3px; font-weight: 500; }
.kpi.is-active { border-color: var(--brand); }
.kpi.total .num { color: var(--brand); }
.kpi.soon .num { color: var(--warn); }
.kpi.expired .num { color: var(--danger); }
.kpi.precursor .num { color: var(--precursor); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 16px; margin-bottom: 13px; }
.card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--navy); }
.card.flush { padding: 0; overflow: hidden; }

.section-title { display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--text-3); margin: 20px 2px 9px; }
.section-title svg { width: 14px; height: 14px; }

/* ---------- Иконка типа позиции ---------- */
.tico { width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; flex: none; }
.tico svg { width: 18px; height: 18px; }
.tico.standard { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 60%, #1c2740); }
.tico.column { background: var(--precursor-soft); color: var(--precursor); }

/* ---------- Бейджи ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; white-space: nowrap; line-height: 1.35; }
.badge svg { width: 13px; height: 13px; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.soon { background: var(--warn-soft); color: var(--warn); }
.badge.expired { background: var(--danger-soft); color: var(--danger); }
.badge.none { background: var(--surface-2); color: var(--text-3); }
.badge.precursor { background: var(--precursor-soft); color: var(--precursor); }
.badge.type { background: var(--brand-soft); color: var(--brand); }
.badge.low { background: var(--warn-soft); color: var(--warn); }

/* ---------- Список позиций ---------- */
.list { display: flex; flex-direction: column; gap: 11px; }
.item { display: block; text-decoration: none; color: inherit; background: var(--surface); border-radius: var(--radius);
  padding: 14px 15px; box-shadow: var(--shadow); transition: transform .1s; }
.item:active { transform: scale(.99); }
.item .top { display: flex; gap: 11px; align-items: flex-start; }
.item .headtext { min-width: 0; flex: 1; }
.item .name { font-weight: 600; font-size: 15.5px; line-height: 1.25; color: var(--navy); }
.item .meta { font-size: 12.5px; color: var(--text-2); margin-top: 5px; font-weight: 500; }
.item .bottom { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; align-items: center; }
.item .qty { margin-left: auto; font-weight: 600; font-size: 14.5px; white-space: nowrap; color: var(--navy); font-variant-numeric: tabular-nums; }
.item.s-expired { box-shadow: var(--shadow), inset 3px 0 0 var(--danger); }
.item.s-soon { box-shadow: var(--shadow), inset 3px 0 0 var(--warn); }
.item.s-ok { box-shadow: var(--shadow), inset 3px 0 0 var(--ok); }

/* ---------- Строки описания (с иконками) ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; align-items: center; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--text-2); flex: none; width: 46%; font-size: 13.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.row .k svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.row .v { flex: 1; text-align: right; font-weight: 500; word-break: break-word; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Полоса остатка ---------- */
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.bar.low > i { background: var(--warn); }
.bar.empty > i { background: var(--danger); }

/* ---------- Баннеры ---------- */
.banner { display: flex; gap: 11px; align-items: flex-start; border-radius: var(--radius); padding: 13px 14px; margin-bottom: 13px; font-size: 13.5px; line-height: 1.45; }
.banner b { display: block; font-size: 14px; margin-bottom: 2px; font-weight: 600; }
.banner svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.precursor { background: var(--precursor-soft); color: var(--precursor); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.info { background: var(--brand-soft); color: var(--brand); }

/* ---------- Кнопки (лёгкая «объёмность») ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--navy);
  padding: 13px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; text-decoration: none; width: 100%;
  min-height: 50px; transition: transform .1s, box-shadow .12s; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-btn); }
.btn.primary:active { box-shadow: 0 3px 9px color-mix(in srgb, var(--brand) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 5px 14px color-mix(in srgb, var(--danger) 30%, transparent); }
.btn.ghost { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.sm { padding: 10px 14px; font-size: 14px; min-height: 42px; width: auto; border-radius: 12px; box-shadow: none; }
.btn.sm.primary { box-shadow: var(--shadow-btn); }
.btn-row { display: flex; gap: 11px; }
.btn-row > * { flex: 1; }

/* ---------- Формы ---------- */
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.4; }
.field.req > label::after { content: ' *'; color: var(--danger); }
input[type=text], input[type=number], input[type=date], input[type=search],
input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 13px; border: 1.5px solid var(--border-strong);
  background: var(--surface); outline: none; font-size: 16px; color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.inline { display: flex; gap: 11px; }
.inline > * { flex: 1; }
.inline .unit { flex: 0 0 96px; }

.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.seg label { flex: 1; text-align: center; padding: 10px 4px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); background: transparent; border: 0; position: relative; transition: background .12s; }
.seg label:has(input:checked) { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

.check { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--brand); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; -webkit-overflow-scrolling: touch; }
.chip { border: 1.5px solid var(--border-strong); background: var(--surface); padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 550; color: var(--text-2); white-space: nowrap; flex: none; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Сканер ---------- */
.scanwrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #16171f;
  aspect-ratio: 3 / 4; max-height: 62vh; display: grid; place-items: center; box-shadow: var(--shadow-md); }
#reader { width: 100%; height: 100%; }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; display: block; }
#reader img[alt="Info icon"], #reader__dashboard_section_csr span, #reader__status_span { display: none !important; }
#reader__scan_region img { display: none !important; }
.scan-idle { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: #d6d4ea; gap: 12px; }
.scan-idle p { font-size: 13.5px; color: #9a99b4; margin: 0; max-width: 34ch; }
.scan-frame { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.scan-frame > div { width: 68%; aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 2000px rgba(16, 17, 24, .5);
  border: 2px solid rgba(255, 255, 255, .9); position: relative; }
.scan-frame > div::after { content: ''; position: absolute; left: 8%; right: 8%; height: 2px;
  background: #958ce8; box-shadow: 0 0 12px #958ce8; top: 10%; animation: sweep 2.2s ease-in-out infinite; }
@keyframes sweep { 0%, 100% { top: 8%; } 50% { top: 90%; } }
.scan-hint { text-align: center; font-size: 13px; color: var(--text-2); margin: 12px 2px 16px; }

.torch { position: absolute; right: 12px; top: 12px; z-index: 5; background: rgba(20, 18, 30, .6);
  border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: 12px; width: 42px; height: 42px; display: grid; place-items: center; }

/* ---------- QR-этикетка ---------- */
.label-card { background: #fff; color: #111; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.label-card .qr { display: grid; place-items: center; }
.label-card .qr img, .label-card .qr svg { width: 190px; height: 190px; image-rendering: pixelated; }
.label-card .lname { font-weight: 700; font-size: 15px; margin-top: 10px; }
.label-card .lmeta { font-size: 12px; color: #444; margin-top: 3px; }
.label-card .lcode { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; margin-top: 6px; letter-spacing: 1px; }
/* Компактная этикетка для стандартов (мелкие баночки) */
.label-card.small { padding: 8px; }
.label-card.small .qr img, .label-card.small .qr svg { width: 96px; height: 96px; }
.label-card.small .lname { font-size: 11px; margin-top: 5px; line-height: 1.15; }
.label-card.small .lcode { font-size: 11px; margin-top: 3px; }
.label-card.small .lmeta { font-size: 9.5px; }
.labels-grid.small { grid-template-columns: repeat(3, 1fr); }
.labels-grid.small .label-card .qr img, .labels-grid.small .label-card .qr svg { max-width: 92px; }

.labels-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; }
.labels-grid .label-card { padding: 10px; }
.labels-grid .label-card .qr img, .labels-grid .label-card .qr svg { width: 100%; height: auto; max-width: 150px; }
.labels-grid .lname { font-size: 12px; }
.labels-grid .lmeta { font-size: 10.5px; }
.labels-grid .lcode { font-size: 11px; }

/* ---------- Журнал ---------- */
.log-item { background: var(--surface); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.log-item .lhead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.log-item .lname { font-weight: 600; font-size: 14.5px; color: var(--navy); }
.log-item .lamt { font-weight: 700; color: var(--danger); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-item .lmeta { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }

/* ---------- Прочее ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty svg { width: 50px; height: 50px; opacity: .55; margin-bottom: 12px; color: var(--brand); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3px; }
.muted { color: var(--text-3); }
.center { text-align: center; }
.mt { margin-top: 13px; }
.stack > * + * { margin-top: 11px; }

/* ---------- Приглашение установить ---------- */
.install-bar { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  width: calc(100% - 24px); max-width: 596px; z-index: 90; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 13px 15px; display: flex; gap: 12px; align-items: center; animation: pop .2s ease-out; }
.install-bar .ib-text { flex: 1; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.install-bar .ib-text b { display: block; font-size: 14px; color: var(--navy); margin-bottom: 2px; }
.install-bar .ib-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.install-bar .ib-share { display: inline-block; font-weight: 700; color: var(--brand); transform: translateY(1px); }
@media (max-width: 420px) {
  .install-bar { flex-direction: column; align-items: stretch; }
  .install-bar .ib-actions { flex-direction: row; }
  .install-bar .ib-actions .btn { flex: 1; }
}

.toast { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  background: var(--navy); color: #fff; padding: 13px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 500; z-index: 100; box-shadow: var(--shadow-lg); max-width: 90%; animation: pop .18s ease-out; }
.toast.err { background: var(--danger); color: #fff; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 8px); } }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 34, .5); z-index: 60;
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); }
.sheet { background: var(--surface); width: 100%; max-width: 620px; border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 18px); max-height: 88vh; overflow: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); } }
.sheet h2 { margin: 0 0 14px; font-size: 18px; font-weight: 600; color: var(--navy); }

@media print {
  .appbar, .tabbar, .ctxbar, .no-print { display: none !important; }
  html, body { height: auto; overflow: visible; }
  #app { height: auto; overflow: visible; display: block; }
  body, #app, .screen { background: #fff; padding: 0; }
  .screen { overflow: visible; height: auto; }
  .labels-grid { grid-template-columns: repeat(2, 1fr); }
  .label-card { break-inside: avoid; border: 1px dashed #999; box-shadow: none; }
}
