/* Шрифт Onest (SIL Open Font License 1.1, static/fonts/OFL.txt): переменный,
   веса 100–900 в одном файле, без обращений во внешние сети. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/static/fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Цвета и размеры — переменные. Основное оформление: холодные серые тона и
   один акцентный цвет (индиго); цветные только статусы. --accent-fg — цвет
   текста на акцентной заливке, --accent-text — акцентный текст на фоне. */
:root {
  --bg: #f4f5f9; --card: #ffffff; --raised: #f8f9fc; --hover: #f0f2f8; --fg: #1c1f2b; --strong: #05070f;
  --muted: #61687a; --subtle: #8a91a3; --line: #e1e4ec; --line-strong: #cbd0dc;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-fg: #ffffff; --accent-soft: #eeedfd; --accent-text: #4338ca;
  --ok-bg: #e3f6e9; --ok-fg: #1a7f37; --err-bg: #fdecea; --err-fg: #c0262f; --warn: #a35200; --warn-bg: #fff4d6; --chip: #eef0f5;
  --shadow-sm: 0 1px 2px rgba(23, 27, 56, .05);
  --shadow: 0 1px 2px rgba(23, 27, 56, .05), 0 4px 16px rgba(23, 27, 56, .05);
  --shadow-pop: 0 2px 6px rgba(23, 27, 56, .10), 0 14px 36px rgba(23, 27, 56, .18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --select-arrow: url("/static/select.svg");
  color-scheme: light;
}
/* Оформление выбирает пользователь (data-theme на <html>): без атрибута —
   как в системе, light — светлое, dark — темное, classic — классическое. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0d0f17; --card: #151925; --raised: #1a1f2d; --hover: #1d2436; --fg: #e5e9f2; --strong: #f3f5fc;
    --muted: #99a1b6; --subtle: #737c92; --line: #262c3c; --line-strong: #39415a;
    --accent: #8a84f9; --accent-hover: #a19cfc; --accent-fg: #0b0a2e; --accent-soft: #221e4d; --accent-text: #a8a3fb;
    --ok-bg: #0f2a1d; --ok-fg: #56c770; --err-bg: #341519; --err-fg: #ff8078; --warn: #e0a83a; --warn-bg: #2d2510; --chip: #20263a;
    --shadow-sm: 0 1px 2px rgba(2, 3, 10, .5);
    --shadow: 0 1px 2px rgba(2, 3, 10, .45), 0 6px 18px rgba(2, 3, 10, .35);
    --shadow-pop: 0 2px 6px rgba(2, 3, 10, .45), 0 12px 32px rgba(2, 3, 10, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f17; --card: #151925; --raised: #1a1f2d; --hover: #1d2436; --fg: #e5e9f2; --strong: #f3f5fc;
  --muted: #99a1b6; --subtle: #737c92; --line: #262c3c; --line-strong: #39415a;
  --accent: #8a84f9; --accent-hover: #a19cfc; --accent-fg: #0b0a2e; --accent-soft: #221e4d; --accent-text: #a8a3fb;
  --ok-bg: #0f2a1d; --ok-fg: #56c770; --err-bg: #341519; --err-fg: #ff8078; --warn: #e0a83a; --warn-bg: #2d2510; --chip: #20263a;
  --shadow-sm: 0 1px 2px rgba(2, 3, 10, .5);
  --shadow: 0 1px 2px rgba(2, 3, 10, .45), 0 6px 18px rgba(2, 3, 10, .35);
  --shadow-pop: 0 2px 6px rgba(2, 3, 10, .45), 0 12px 32px rgba(2, 3, 10, .55);
  color-scheme: dark;
}
:root[data-theme="classic"] {
  --bg: #f7f2e6; --card: #fefbf1; --raised: #fefbf1; --hover: #fbf6d9; --fg: #1b1a14; --strong: #1b1a14;
  --muted: #6e6a58; --subtle: #6e6a58; --line: #cbc6af; --line-strong: #a8a387;
  --accent: #2a4fc4; --accent-hover: #2a4fc4; --accent-fg: #ffffff; --accent-soft: #f5f1de; --accent-text: #2a4fc4;
  --ok-bg: #e7f1dc; --ok-fg: #2f5d1a; --err-bg: #fbe3dc; --err-fg: #a12a1f; --warn: #8a5a00; --warn-bg: #fbf6d9; --chip: #ece8d6;
  --grid: #b2ac8a; --band: #e9e5d9; --sel: #3f5fcc;
  --shadow-sm: none; --shadow: none; --shadow-pop: 2px 2px 4px rgba(0, 0, 0, .2); --ring: none;
  --r-sm: 0; --r: 0; --r-lg: 0;
  --font: Tahoma, Verdana, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--strong); margin: 0 0 6px; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; color: var(--strong); margin: 30px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
/* Закладки внутри страницы: подчеркивание акцентом у выбранной. */
nav.tabs { display: flex; gap: 2px 18px; flex-wrap: wrap; margin: 14px 0 20px; border-bottom: 1px solid var(--line); }
nav.tabs a { padding: 9px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; }
nav.tabs a:hover { color: var(--strong); text-decoration: none; }
nav.tabs a.active { color: var(--strong); border-bottom-color: var(--accent); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.scroll { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.scroll td.text { min-width: 16rem; }
.scroll td.who { min-width: 10rem; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; background: var(--raised); }
th.center { text-align: center; }
tr:last-child td { border-bottom: none; }
tr:hover > td { background: var(--hover); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.wrap { white-space: normal; min-width: 5.5rem; }
tr.total td { font-weight: 700; color: var(--strong); border-top: 1px solid var(--line-strong); background: var(--raised); }
.notice { background: var(--ok-bg); color: var(--ok-fg); padding: 11px 14px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: var(--r); margin-bottom: 16px; }
.error { background: var(--err-bg); color: var(--err-fg); padding: 11px 14px; border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: var(--r); margin-bottom: 16px; white-space: pre-wrap; }
.warn { color: var(--warn); margin: 6px 0; }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.6; }
.chip.posted { background: var(--ok-bg); color: var(--ok-fg); }
.chip.cancelled { background: var(--err-bg); color: var(--err-fg); }
form .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
form .grid > .end { align-self: end; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 7px 10px; margin-top: 4px; transition: border-color .15s ease, box-shadow .15s ease; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--muted)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
select:not([multiple]) { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: var(--select-arrow);
  background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; }
input.amount { text-align: right; font-variant-numeric: tabular-nums; }
table input, table select { margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
button, .button { font: inherit; font-weight: 600; font-size: 14px; line-height: 1.45; padding: 8px 16px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--card); color: var(--fg); cursor: pointer; display: inline-block; box-shadow: var(--shadow-sm);
  transition: background .15s ease, border-color .15s ease, color .15s ease; }
button:hover, .button:hover { background: var(--hover); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--err-fg); }
.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.inline > div { min-width: 160px; }
.big { font-size: 20px; font-weight: 700; }
.mb { margin-bottom: 16px; }
.mt { margin-top: 12px; }
.mt0 { margin-top: 0; }
.full { flex-basis: 100%; margin: 0; }
code { background: var(--chip); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
nav.tabs .group { padding: 9px 4px 9px 14px; font-size: 12px; color: var(--subtle); border-left: 1px solid var(--line); align-self: center; }
tr.archived td { color: var(--muted); }
.check { display: flex; gap: 8px; align-items: center; color: var(--fg); font-size: 14px; font-weight: 400; }
.check input { width: auto; margin: 0; }
.chip.error { background: var(--err-bg); color: var(--err-fg); }
.chip.pending { background: var(--chip); }
.chip.done { background: var(--ok-bg); color: var(--ok-fg); }
.chip.abc-A { background: var(--ok-bg); color: var(--ok-fg); }
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 8px; }
.sections .card { margin-bottom: 0; }
td.links { white-space: nowrap; }
.filterinfo { margin: 0 0 10px; }

/* Раскладка: боковая панель на всю высоту слева (сворачивается в узкую
   полосу со значками), справа от нее меню, содержимое и колонка фильтров. */
.shell { display: flex; min-height: 100vh; }
.workspace { flex: 1; min-width: 0; container-type: inline-size; }

.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; width: 264px; flex: none; display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--line); }
.sidebar-head { height: 57px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); }
.sidebar a.brand { display: flex; flex-direction: row; align-items: center; gap: 10px; flex: 1; min-width: 0; font-weight: 800; font-size: 16px; letter-spacing: -.01em;
  color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar a.brand:hover { text-decoration: none; }
/* Знак программы: акцентный квадрат перед названием. */
.sidebar a.brand::before { content: ""; flex: none; width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--strong))); }
.sidebar-toggle { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: var(--r);
  background: transparent; color: var(--subtle); box-shadow: none; }
.sidebar-toggle:hover { background: var(--hover); color: var(--strong); }
.sidebar nav.orgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; }
.sidebar nav.orgs h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); margin: 0 8px 8px; font-weight: 600; }
.sidebar nav.orgs p { margin: 0 8px 6px; }
.sidebar nav.orgs a { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: var(--r); color: var(--fg); }
.sidebar nav.orgs a:hover { background: var(--hover); text-decoration: none; }
.sidebar nav.orgs a.active { background: var(--accent-soft); color: var(--accent-text); }
.sidebar nav.orgs a.active .name { font-weight: 600; }
.sidebar nav.orgs a.add { align-items: center; color: var(--accent-text); margin-top: 4px; }
.sidebar .txt { display: flex; flex-direction: column; min-width: 0; }
.sidebar .name { line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* Страна, режим и валюта организации — здесь, под названием, до двух строк. */
.sidebar .meta { font-size: 12px; line-height: 1.3; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical;
  -webkit-line-clamp: 2; }
.sidebar nav.orgs a.active .meta { color: var(--accent-text); opacity: .75; }
/* Значки организаций: мягкая подложка оттенка и буквы того же цвета. */
.avatar { flex: none; width: 32px; height: 32px; border-radius: var(--r); display: grid; place-items: center; font-size: 13px; font-weight: 700;
  line-height: 1; --tone: var(--muted); color: var(--tone); background: color-mix(in srgb, var(--tone) 14%, var(--card)); }
.avatar.tone0 { --tone: #4f5bd5; } .avatar.tone1 { --tone: #2f8a55; } .avatar.tone2 { --tone: #7b5ccc; }
.avatar.tone3 { --tone: #b8691f; } .avatar.tone4 { --tone: #23838c; } .avatar.tone5 { --tone: #b84a6e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .avatar { background: color-mix(in srgb, var(--tone) 22%, var(--card)); color: color-mix(in srgb, var(--tone) 55%, #fff); }
}
:root[data-theme="dark"] .avatar { background: color-mix(in srgb, var(--tone) 22%, var(--card)); color: color-mix(in srgb, var(--tone) 55%, #fff); }
.sidebar a.add .avatar { background: transparent; color: var(--accent-text); border: 1px dashed var(--line-strong); font-size: 18px; font-weight: 400; }
.sidebar .user { flex: none; display: flex; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); cursor: default; }
.sidebar .user .avatar { border-radius: 50%; background: var(--chip); color: var(--muted); }
.sidebar .user .name { font-weight: 600; }

/* Свернутая панель: только значки, полные названия — во всплывающей подсказке. */
.shell.collapsed .sidebar { width: 64px; }
.shell.collapsed .sidebar .txt { display: none; }
.shell.collapsed .sidebar-head { justify-content: center; padding: 0; }
.shell.collapsed .sidebar-toggle svg { transform: rotate(180deg); }
.shell.collapsed .sidebar nav.orgs { padding: 14px 8px; }
.shell.collapsed .sidebar nav.orgs a { justify-content: center; padding: 6px 0; }
.shell.collapsed .sidebar .user { justify-content: center; padding: 12px 0; }

/* Разделы — «пилюли», подразделы — закладки с подчеркиванием. */
header.top { background: var(--card); border-bottom: 1px solid var(--line); }
nav.areas { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-height: 56px; padding: 8px 24px; }
nav.areas a { padding: 6px 12px; border-radius: var(--r); color: var(--muted); font-weight: 600; font-size: 14.5px; }
nav.areas a:hover { background: var(--hover); color: var(--strong); text-decoration: none; }
nav.areas a.active { background: var(--accent-soft); color: var(--accent-text); }
nav.subnav { display: flex; gap: 0 20px; flex-wrap: wrap; padding: 0 24px; border-top: 1px solid var(--line); }
nav.subnav a { padding: 10px 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 14.5px; font-weight: 500; }
nav.subnav a:hover { color: var(--strong); text-decoration: none; }
nav.subnav a.active { color: var(--strong); border-bottom-color: var(--accent); font-weight: 600; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; padding: 24px 28px 56px; align-items: start; max-width: 1480px; }
aside.filters { width: 256px; position: sticky; top: 16px; }
aside.filters:not(:has(section)) { display: none; }
aside.filters .block { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
aside.filters h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--subtle); margin: 0 0 10px; font-weight: 600; }
aside.filters form label { margin-bottom: 10px; }
aside.filters form .check { margin-bottom: 8px; }
aside.filters .actions { margin-top: 8px; }

/* Мало места справа от панели — фильтры над списком, поля в несколько колонок. */
@container (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 40px; }
  aside.filters { width: auto; position: static; order: -1; }
  aside.filters form { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 12px; align-items: end; }
  aside.filters form label, aside.filters form .check, aside.filters .actions { margin: 0; }
  nav.areas, nav.subnav { padding-left: 16px; padding-right: 16px; }
}
/* Узкий экран (телефон): панель всегда узкая, со значками. */
@media (max-width: 720px) {
  .shell .sidebar { width: 64px; }
  .shell .sidebar .txt, .shell .sidebar .user .txt, .sidebar-toggle { display: none; }
  .shell .sidebar-head { justify-content: center; padding: 0; }
  .shell .sidebar nav.orgs { padding: 14px 8px; }
  .shell .sidebar nav.orgs a { justify-content: center; padding: 6px 0; }
  .shell .sidebar .user { justify-content: center; padding: 12px 0; }
}

/* Воронка сделок: колонки стадий с карточками. */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.board .column { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; }
.board h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 2px 4px 10px; }
.dealcard { display: flex; flex-direction: column; gap: 2px; padding: 10px; margin-bottom: 8px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card); color: var(--fg); box-shadow: var(--shadow-sm); }
.dealcard:hover { border-color: var(--accent); text-decoration: none; }

/* Вход и пользователи: мягкое акцентное свечение в углу. */
.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(60% 55% at 85% 0%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%), var(--bg); }
.bare main.card { width: 100%; max-width: 400px; padding: 28px; box-shadow: var(--shadow-pop); }
.bare .brand-line { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--strong); font-size: 17px; }
.bare .brand-line::before { content: ""; width: 24px; height: 24px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--strong))); }
form.stack label { display: block; margin-bottom: 14px; }
.sidebar .user a.avatar { text-decoration: none; }
.sidebar .user a.name { color: var(--fg); text-decoration: none; }
.sidebar .user .txt { min-width: 0; display: flex; flex-direction: column; }
.sidebar .user .meta { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .user form.logout { margin-left: auto; }
button.linklike { border: 0; background: none; padding: 0; color: var(--accent-text); font-size: 13px; font-weight: 500; box-shadow: none; }
button.linklike:hover { background: none; text-decoration: underline; }
.exportbar { display: flex; gap: 16px; align-items: center; margin: 0 0 12px; font-size: 13px; }
.shell.collapsed .sidebar .user form.logout { display: none; }
.temp-password { border-color: var(--warn); }
code.big { font-size: 18px; letter-spacing: 1px; user-select: all; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; }
fieldset .check { margin: 4px 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Сторно в журнале и карточке счета */
tr.storno td { color: var(--err-fg); }

/* Сводка организации */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card);
  color: var(--fg); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s ease, box-shadow .15s ease; }
.kpi:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow); text-decoration: none; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .value { font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--strong); font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--subtle); font-size: 12px; }
.kpi.bad .value { color: var(--err-fg); }

/* Печать отчетов: без меню, фильтров и кнопок */
.print-title h1 { font-size: 18px; }
table.kudir tr.cols td { text-align: center; color: var(--muted); font-size: 12px; }
@media print {
  .sidebar, header.top, aside.filters, .actions, .noprint { display: none !important; }
  .shell, .workspace, .layout, main { display: block !important; margin: 0 !important; padding: 0 !important; }
  body { background: #fff; color: #000; }
  table { font-size: 11px; }
  a { color: inherit; text-decoration: none; }
  .card, .scroll { box-shadow: none; }
}
/* Кнопка «Печать» с выпадающим списком печатных форм. */
.docbar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.printmenu { position: relative; display: inline-block; }
.printmenu > summary { list-style: none; padding: 5px 12px; font-size: 13px; user-select: none; }
.printmenu > summary::-webkit-details-marker { display: none; }
.printmenu > summary::after { content: " ▾"; color: var(--subtle); }
.printmenu[open] > summary { border-color: var(--accent); }
.printmenu .menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 240px; padding: 5px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; font-size: 14px; }
.printmenu .menu-forms { display: flex; flex-direction: column; }
.printmenu .menu a, .printmenu .menu button { display: block; padding: 7px 10px; text-align: left; white-space: nowrap;
  color: var(--fg); text-decoration: none; border: 0; border-radius: var(--r-sm); background: none; font-size: 14px; font-weight: 400; box-shadow: none; }
.printmenu .menu a:hover, .printmenu .menu button:hover { background: var(--hover); }
.printmenu .menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.printmenu .menu-note { margin: 0; padding: 7px 10px; color: var(--muted); font-size: 13px; }
.printmenu .menu-group { margin: 0; padding: 6px 10px 2px; color: var(--subtle); font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; }
.createmenu > summary { font-size: 14px; padding: 7px 14px; }
.createmenu > summary::after { color: inherit; opacity: .8; }
.printmenu .menu-note[hidden] { display: none; }
tr[data-row] { cursor: default; }
tr[data-row].selected > td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
@media print { tr[data-row].selected > td { background: none; } }

/* Выбор оформления: внизу боковой панели и на странице профиля. */
.sidebar .themebar { flex: none; padding: 10px 18px; border-top: 1px solid var(--line); }
.sidebar .themebar label { font-size: 12px; }
.sidebar .themebar select { padding: 4px 28px 4px 8px; font-size: 13px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.themecard { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--fg); font-size: 14px; font-weight: 400; cursor: pointer; }
.themecard:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.themecard input { width: auto; margin: 0; }
/* Выбор страны учета: карточки стран. */
.countries { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.countrycard { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  color: var(--fg); font-size: 15px; font-weight: 400; cursor: pointer; }
.countrycard:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.countrycard input { width: auto; margin: 0; }
.countrycard .check b { font-size: 16px; }
.preview { position: relative; display: block; height: 64px; border: 1px solid var(--pv-line); border-radius: var(--r); overflow: hidden;
  background: var(--pv-bg); }
.preview i { position: absolute; display: block; left: 30%; right: 8px; height: 7px; background: var(--pv-line); border-radius: 3px; }
.preview i:nth-child(1) { left: 0; right: auto; top: 0; bottom: 0; width: 22%; height: auto; background: var(--pv-side);
  border-right: 1px solid var(--pv-line); border-radius: 0; }
.preview i:nth-child(2) { top: 9px; height: 9px; background: var(--pv-accent); right: 40%; }
.preview i:nth-child(3) { top: 27px; }
.preview i:nth-child(4) { top: 42px; }
.preview-light { --pv-bg: #f4f5f9; --pv-side: #ffffff; --pv-line: #dde1ea; --pv-accent: #4f46e5; }
.preview-dark { --pv-bg: #0d0f17; --pv-side: #151925; --pv-line: #2c3345; --pv-accent: #8a84f9; }
.preview-system { --pv-side: transparent; --pv-line: #8a91a3; --pv-accent: #6d66ef;
  --pv-bg: linear-gradient(135deg, #f4f5f9 50%, #0d0f17 50%); }
.preview-classic { --pv-bg: #fefbf1; --pv-side: #e9e5d9; --pv-line: #b2ac8a; --pv-accent: #3f5fcc; border-radius: 0; }
.preview-classic i { border-radius: 0; }
.preview-classic i:nth-child(3), .preview-classic i:nth-child(4) { background: #fff; border: 1px solid #b2ac8a; height: 9px; }

/* Классическое оформление: мелкий шрифт, плотные таблицы с полной сеткой,
   объемные кнопки и закладки, подчеркнутые ссылки, синее выделение. */
[data-theme="classic"] body { font: 13px/1.4 Tahoma, Verdana, "Segoe UI", Arial, sans-serif; }
[data-theme="classic"] main :where(a:not(.button, .kpi, .dealcard)) { text-decoration: underline; }
[data-theme="classic"] h1 { font-size: 22px; font-weight: 400; color: #8a8463; }
[data-theme="classic"] h2 { font-size: 13px; font-weight: 700; color: var(--muted); background: var(--band); padding: 3px 8px; margin: 18px 0 8px; }
[data-theme="classic"] .small { font-size: 12px; }
[data-theme="classic"] .card, [data-theme="classic"] .scroll, [data-theme="classic"] aside.filters .block,
[data-theme="classic"] .board .column, [data-theme="classic"] .kpi, [data-theme="classic"] .dealcard,
[data-theme="classic"] fieldset, [data-theme="classic"] .themecard, [data-theme="classic"] .countrycard { border-radius: 0; border-color: var(--grid); }
[data-theme="classic"] .card { padding: 10px 12px; margin-bottom: 12px; }
[data-theme="classic"] .scroll { background: #fff; }
[data-theme="classic"] th, [data-theme="classic"] td { padding: 2px 6px; border: 1px solid #d6d1bb; }
[data-theme="classic"] th { font-size: 12px; font-weight: 400; color: var(--fg); background: linear-gradient(#fbf9ef, #ebe7d3);
  border-color: var(--grid); }
[data-theme="classic"] tr:last-child td { border-bottom: 1px solid #d6d1bb; }
[data-theme="classic"] tr.total td { border-top: 2px solid var(--grid); background: var(--band); }
[data-theme="classic"] tbody tr:hover > td, [data-theme="classic"] tr[data-row]:hover > td { background: #fbf6d9; }
[data-theme="classic"] tr[data-row].selected > td { background: var(--sel); color: #fff; }
[data-theme="classic"] tr[data-row].selected > td a, [data-theme="classic"] tr[data-row].selected > td .chip { color: #fff; }
[data-theme="classic"] tr[data-row].selected > td .chip { background: rgba(255, 255, 255, .2); }
[data-theme="classic"] input, [data-theme="classic"] select, [data-theme="classic"] textarea {
  background: #fff; border-color: #a8a387; border-radius: 0; padding: 3px 5px; }
[data-theme="classic"] input:focus, [data-theme="classic"] select:focus, [data-theme="classic"] textarea:focus {
  outline: 1px solid var(--sel); outline-offset: 0; border-color: var(--sel); }
[data-theme="classic"] label { font-size: 12px; }
[data-theme="classic"] button, [data-theme="classic"] .button { padding: 3px 12px; border-radius: 2px; border-color: #a8a387; color: var(--fg);
  background: linear-gradient(#fefdf8, #e6e2d0); }
[data-theme="classic"] button:hover, [data-theme="classic"] .button:hover { background: linear-gradient(#fffbe6, #f2e3a6); text-decoration: none; }
[data-theme="classic"] button.primary, [data-theme="classic"] .button.primary { font-weight: 700; color: var(--fg); border-color: #7a7458;
  background: linear-gradient(#fefdf8, #e6e2d0); }
[data-theme="classic"] button.danger { color: var(--err-fg); }
[data-theme="classic"] button.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
[data-theme="classic"] .actions { margin-top: 10px; gap: 6px; }
[data-theme="classic"] .sidebar-toggle { background: transparent; border: 0; border-radius: 2px; }
[data-theme="classic"] .sidebar-toggle:hover { background: #f5f1de; }
[data-theme="classic"] table input, [data-theme="classic"] table select { border-color: transparent; background: transparent; }
[data-theme="classic"] table input:hover, [data-theme="classic"] table select:hover { border-color: #c9c3a6; }
[data-theme="classic"] .notice, [data-theme="classic"] .error { border-radius: 0; padding: 6px 10px; border: 1px solid currentColor; }
[data-theme="classic"] .chip { border-radius: 2px; }
[data-theme="classic"] code { border-radius: 0; }
[data-theme="classic"] .avatar { border-radius: 2px; }
[data-theme="classic"] .sidebar { background: var(--band); border-right-color: var(--grid); }
[data-theme="classic"] .sidebar-head { border-bottom-color: var(--grid); }
[data-theme="classic"] .sidebar nav.orgs a { border-radius: 0; }
[data-theme="classic"] .sidebar nav.orgs a:hover { background: #f5f1de; }
[data-theme="classic"] .sidebar nav.orgs a.active { background: var(--sel); color: #fff; }
[data-theme="classic"] .sidebar .user, [data-theme="classic"] .sidebar .themebar { border-top-color: var(--grid); }
[data-theme="classic"] header.top { background: var(--band); border-bottom-color: var(--grid); }
[data-theme="classic"] nav.areas { gap: 2px; min-height: 0; padding: 6px 24px 0; align-items: flex-end; }
[data-theme="classic"] nav.areas a { padding: 3px 12px; border: 1px solid #c0bb9f; border-bottom: 0; border-radius: 3px 3px 0 0;
  font-weight: 400; color: var(--fg); background: linear-gradient(#f8f6ea, #e3dfc8); }
[data-theme="classic"] nav.areas a:hover { background: linear-gradient(#fffbe6, #f2e3a6); }
[data-theme="classic"] nav.areas a.active { background: var(--card); color: var(--fg); border-color: var(--grid); padding-bottom: 5px;
  margin-bottom: -1px; position: relative; }
[data-theme="classic"] nav.subnav { background: var(--card); border-top-color: var(--grid); padding: 4px 24px; gap: 2px 14px; }
[data-theme="classic"] nav.subnav a { padding: 1px 0; border-radius: 0; color: var(--accent); text-decoration: underline; }
[data-theme="classic"] nav.subnav a.active { background: none; color: var(--fg); text-decoration: none; font-weight: 700; }
[data-theme="classic"] nav.tabs { gap: 2px; margin: 10px 0 14px; border-bottom-color: var(--grid); }
[data-theme="classic"] nav.tabs a { padding: 3px 12px; border: 1px solid #c0bb9f; border-bottom: 0; border-radius: 3px 3px 0 0;
  color: var(--fg); background: linear-gradient(#f8f6ea, #e3dfc8); text-decoration: none; }
[data-theme="classic"] nav.tabs a.active { background: var(--card); border-color: var(--grid); font-weight: 400; }
[data-theme="classic"] nav.tabs .group { padding: 3px 4px 3px 12px; border-left-color: var(--grid); }
[data-theme="classic"] .layout { gap: 16px; padding: 14px 20px 40px; }
[data-theme="classic"] .printmenu .menu { border-radius: 0; border-color: var(--grid); box-shadow: 2px 2px 4px rgba(0, 0, 0, .2); background: #fff; }
[data-theme="classic"] .printmenu .menu a, [data-theme="classic"] .printmenu .menu button { padding: 4px 14px; font-size: 13px;
  background: none; border: 0; text-decoration: none; font-weight: 400; }
[data-theme="classic"] .printmenu .menu a:hover, [data-theme="classic"] .printmenu .menu button:hover { background: var(--sel); color: #fff; }
[data-theme="classic"] .exportbar { font-size: 12px; }
[data-theme="classic"] .exportbar a { text-decoration: underline; }
/* Классическое оформление не берет черты основного: без скруглений, теней,
   жирных подписей и знака у названия. */
[data-theme="classic"] h1, [data-theme="classic"] h2 { letter-spacing: normal; }
[data-theme="classic"] button, [data-theme="classic"] .button { font-weight: 400; font-size: inherit; line-height: inherit; }
[data-theme="classic"] button:active, [data-theme="classic"] .button:active { transform: none; }
[data-theme="classic"] select { appearance: auto; -webkit-appearance: menulist; }
[data-theme="classic"] :where(.chip) { font-weight: 400; color: var(--fg); line-height: 1.5; }
[data-theme="classic"] .sidebar a.brand { display: block; font-weight: 700; font-size: inherit; letter-spacing: normal; }
[data-theme="classic"] .sidebar a.brand::before, [data-theme="classic"] .bare .brand-line::before { display: none; }
[data-theme="classic"] .sidebar nav.orgs h3, [data-theme="classic"] aside.filters h3 { font-size: 13px; text-transform: none; letter-spacing: normal; color: var(--muted); }
[data-theme="classic"] .sidebar nav.orgs a.active .meta { color: #fff; }
[data-theme="classic"] .avatar { background: var(--tone); color: #fff; }
[data-theme="classic"] nav.areas a { font-size: inherit; }
[data-theme="classic"] nav.subnav a { border-bottom: 0; margin-bottom: 0; font-size: inherit; font-weight: 400; }
[data-theme="classic"] nav.tabs a { margin-bottom: 0; font-weight: 400; }
[data-theme="classic"] nav.tabs a.active { margin-bottom: -1px; }
[data-theme="classic"] .printmenu .menu { padding: 4px 0; }
[data-theme="classic"] .bare { background: var(--bg); }
[data-theme="classic"] .bare main.card { padding: 16px; }
/* Печать — всегда светлая, в каком бы оформлении ни работал пользователь. */
@media print {
  :root:not([data-theme]), :root[data-theme] {
    --bg: #ffffff; --card: #ffffff; --fg: #000000; --muted: #555555; --line: #cccccc; --grid: #999999; --band: #eeeeee;
    --accent: #000000; --chip: #eeeeee; --ok-bg: #ffffff; --ok-fg: #000000; --err-bg: #ffffff; --err-fg: #000000;
    --raised: #ffffff; --hover: #ffffff; --strong: #000000; --subtle: #555555; --line-strong: #999999; --accent-text: #000000;
    --shadow-sm: none; --shadow: none; --shadow-pop: none;
    color-scheme: light;
  }
  [data-theme] th { background: none; }
}

/* Штрихкоды в карточке номенклатуры. */
.barcodes { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.barcodes figure { margin: 0; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.barcodes svg { display: block; width: 200px; height: 70px; }

/* Поле сканера в документе: первая кнопка формы — «Добавить по штрихкоду»,
   чтобы Enter сканера не проводил документ; на экране ее не видно. */
.defaultsubmit { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.scanbar { display: flex; gap: 8px; align-items: end; max-width: 640px; margin-bottom: 4px; }
.scanbar label { flex: 1; }
/* Розница: рабочее место кассира (pos.js), документы розницы. */
.grid-info { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.posbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.posbar h2 { margin: 0; }
.postitle { display: flex; flex-direction: column; }
.posbar .grow { flex: 1; }
.posmsg { padding: 11px 14px; border-radius: var(--r-lg); margin-bottom: 14px; background: var(--ok-bg); color: var(--ok-fg); white-space: pre-wrap; }
.posmsg.error { background: var(--err-bg); color: var(--err-fg); }
.posmsg.big { font-size: 20px; font-weight: 600; }
.posgrid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@container (max-width: 860px) { .posgrid { grid-template-columns: minmax(0, 1fr); } }
.poscart, .pospay { margin-bottom: 0; }
.posscan input { font-size: 17px; padding: 10px 12px; }
.posfound { list-style: none; margin: 6px 0 10px; padding: 4px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow-pop); max-height: 320px; overflow-y: auto; }
.posfound li button { display: flex; width: 100%; gap: 12px; justify-content: space-between; border: 0; border-radius: var(--r-sm); background: none; text-align: left; padding: 8px 10px; font-weight: 400; box-shadow: none; }
.posfound li button:hover, .posfound li button:focus { background: var(--hover); }
.posfound .muted { white-space: nowrap; }
.postable { margin-top: 10px; }
.postable td { vertical-align: middle; }
.postable input { width: 7rem; padding: 5px 7px; }
.postable input.posqty { width: 5.5rem; }
.postable input.posdisc { width: 4.5rem; }
.postable button.posdel { padding: 2px 9px; color: var(--err-fg); }
.postable tr.noprice input.posprice { border-color: var(--err-fg); }
.postotal { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.postotal b { font-size: 32px; font-weight: 700; letter-spacing: -.02em; color: var(--strong); font-variant-numeric: tabular-nums; }
.pospay label { margin-bottom: 10px; }
.pospay input { font-size: 17px; }
.poschange { margin: 2px 0 14px; font-size: 17px; }
.poschange b { font-variant-numeric: tabular-nums; }
.posbuttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
button.posbig { width: 100%; padding: 14px 10px; font-size: 17px; font-weight: 600; }
.posmixed { margin-top: 12px; }
.posmixed summary { cursor: pointer; color: var(--accent-text); font-size: 14px; margin-bottom: 8px; }
.posrefund { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; margin: 0 0 12px; }
.posrefund legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.posrefund .check { margin: 4px 0; }
.posreceipts { margin-top: 8px; }
.posfind summary { cursor: pointer; }
.pos.busy button { opacity: .6; pointer-events: none; }
.chip.new { background: var(--err-bg); color: var(--err-fg); }
.chip.failed { background: var(--chip); color: var(--muted); }
.chip.draft { background: var(--chip); }
/* Узкий экран (телефон): строка чека — название сверху, поля под ним. */
@container (max-width: 640px) {
  #pos-cart thead { display: none; }
  #pos-cart tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 4px 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
  #pos-cart td { padding: 0; border: 0; }
  #pos-cart td:first-child { grid-column: 1 / -1; }
  #pos-cart td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); text-align: left; }
  #pos-cart td.num { text-align: left; }
  #pos-cart input { width: 100%; }
  #pos-cart td:last-child { align-self: end; }
  #pos-cart td.possum { grid-column: 1 / 4; font-weight: 600; }
}

/* Терминал склада (/orgs/{org}/m): страницы для телефона и терминала сбора
   данных — крупные кнопки и поля, без меню и боковой панели. */
.m-shell { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.m-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 12px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.m-back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -6px; border-radius: var(--r); color: var(--accent-text); }
.m-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.m-title b { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-title span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-home { padding: 8px 10px; font-weight: 600; }
#m-main { flex: 1; padding: 14px 16px 24px; }
#m-main h2 { margin: 20px 0 8px; }
.m-foot { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding: 12px 16px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line); }
.m-foot form { margin-left: auto; }
.m-whpick select { font-size: 17px; padding: 10px; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.m-tile { display: flex; flex-direction: column; gap: 4px; min-height: 104px; padding: 16px 14px; border-radius: calc(var(--r-lg) + 2px); background: var(--card);
  border: 1px solid var(--line); color: var(--fg); box-shadow: var(--shadow-sm); }
.m-tile:hover { text-decoration: none; border-color: var(--accent); }
.m-tile b { font-size: 18px; color: var(--accent-text); }
.m-tile span { font-size: 13px; color: var(--muted); }
.m-wide { display: block; text-align: center; padding: 14px; font-size: 17px; margin-bottom: 8px; }
.m-scan { margin-bottom: 14px; }
.m-scanrow { display: flex; gap: 8px; align-items: stretch; }
.m-scanrow input { flex: 1; min-width: 0; margin: 0; font-size: 18px; padding: 12px; }
.m-scanrow button { min-width: 52px; min-height: 52px; font-size: 16px; }
.m-cambtn { display: grid; place-items: center; padding: 0; color: var(--accent-text); }
.m-cambtn[hidden] { display: none; }
.m-cambtn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.m-full { margin-bottom: 10px; }
.m-qty, .m-more, .m-left { margin-top: 10px; }
.m-qty summary, .m-more summary, .m-left summary, .m-fix summary { color: var(--accent-text); cursor: pointer; font-size: 14px; padding: 4px 0; }
.m-qty input { font-size: 17px; max-width: 12rem; }
.m-left ul { margin: 6px 0 0; padding-left: 20px; }
.m-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-cards a { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); color: var(--fg); box-shadow: var(--shadow-sm); }
.m-cards a:hover { text-decoration: none; border-color: var(--accent); }
.m-cards a b { color: var(--accent-text); }
.m-overdue { color: var(--err-fg); }
.m-lines { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.m-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.m-lines li:last-child { border-bottom: 0; }
.m-lines li.last { background: var(--ok-bg); }
.m-lines li.done .m-name, .m-lines li.done .m-q { color: var(--muted); }
.m-lines li.done .m-q b::before { content: "✓ "; color: var(--ok-fg); }
.m-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.m-q { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.m-q b { font-size: 18px; }
.m-fix { grid-column: 1 / -1; }
.m-fixform { display: flex; gap: 8px; margin-top: 4px; }
.m-fixform input { margin: 0; max-width: 9rem; font-size: 17px; }
.m-choices form { margin-top: 8px; }
.m-choice { width: 100%; text-align: left; padding: 12px; }
.m-head { margin: 0 0 4px; }
.m-figures { display: flex; gap: 20px; flex-wrap: wrap; }
.m-figures div { display: flex; flex-direction: column; }
.m-figures b { font-size: 22px; }
.m-prefilled { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.m-cam { position: sticky; top: 56px; z-index: 4; background: #000; }
.m-cam[hidden] { display: none; }
.m-cam video { display: block; width: 100%; height: 34vh; object-fit: cover; }
.m-cam-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 6px 12px; color: #fff; font-size: 13px; }
.m-cam-bar button { padding: 6px 12px; }

/* Код из письма: цифры крупно и вразрядку */
input.code { font-size: 20px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
