/* ═══════════════════════════════════════════════════════════════════════════
   Fabriq UI — «Чернила и золото»
   Один стиль для всех разделов: светлая тема (льняной фон + тёмное меню)
   и тёмная тема. Цвета — только через переменные ниже; компоненты — классы fq-*,
   чтобы жить рядом с Bootstrap, пока старые страницы переезжают.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Шрифты: Inter (текст, таблицы, цифры) + Manrope (заголовки, крупные числа) ── */
/* поменял файл шрифта — поменяй и v */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/inter-cyrillic-wght-normal.woff2?v=20261004") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.woff2?v=20261004") 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; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-cyrillic-wght-normal.woff2?v=20261004") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url("fonts/manrope-latin-wght-normal.woff2?v=20261004") 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; }

/* ── Общая шкала (одна на обе темы) ── */
:root {
  --fq-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fq-display: "Manrope", "Inter", system-ui, sans-serif;
  --fq-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 17px;
  --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 30px; --fs-4xl: 40px;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-2xl: 22px; --r-full: 999px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.36, .64, 1);
  --t-fast: 120ms; --t: 180ms; --t-slow: 300ms;

  --rail-w: 68px;
  --side-w: 244px;
  --top-h: 60px;
  --page-x: 32px;
  --tab-h: 64px;            /* нижняя панель на телефоне */
  --ctl-h: 38px;            /* высота полей и кнопок на компьютере */

  --brand-ink: #0B1220;
  --brand-gold: #C9A86A;
  --brand-gold-deep: #A8854A;
  --brand-ivory: #F6F3EC;
  --paper: #FFFFFF;         /* лист документа в просмотре и печати — белый в обеих темах, как бумага */
}
@media (max-width: 767px) {
  :root { --page-x: 16px; --top-h: 56px; --ctl-h: 44px; }
}

/* ── Светлая тема: лён + тёмное меню ── */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #ECE9E2;
  --bg-2: #E4E0D7;
  --surface: #F8F6F1;
  --surface-2: #FDFCFA;
  --surface-3: #F1EEE7;
  --zebra: #F4F1EB;
  --hover: #EEEAE2;
  --selected: #EDE4D2;
  --line: #DAD4C8;
  --line-2: #E6E1D7;
  --line-strong: #C6BFB1;

  --text: #151C2A;
  --text-2: #3E4656;
  --muted: #5F6775;
  --faint: #8C919B;
  --link: #1D4E8C;
  --link-hover: #133B6D;

  --primary: #141C2D;
  --primary-hover: #222C42;
  --primary-press: #0B1220;
  --on-primary: #F8F5EE;
  --primary-icon: #D7B878;

  --accent: #C9A86A;
  --accent-ink: #8B692B;
  --accent-soft: rgba(201, 168, 106, .17);
  --accent-line: rgba(176, 138, 69, .55);

  --focus-ring: 0 0 0 3px rgba(201, 168, 106, .45);
  --shadow-1: 0 1px 2px rgba(21, 28, 42, .05);
  --shadow-2: 0 1px 2px rgba(21, 28, 42, .05), 0 4px 14px -6px rgba(21, 28, 42, .12);
  --shadow-pop: 0 2px 6px rgba(11, 18, 32, .06), 0 22px 48px -16px rgba(11, 18, 32, .32);
  --backdrop: rgba(11, 18, 32, .42);
  --glass: rgba(236, 233, 226, .78);

  --nav-bg: #0B1220;
  --nav-bg-2: #0F1728;
  --nav-line: rgba(255, 255, 255, .07);
  --nav-text: #AAB3C3;
  --nav-text-hi: #F4F0E7;
  --nav-muted: #6C778B;
  --nav-hover: rgba(255, 255, 255, .055);
  --nav-active: rgba(201, 168, 106, .14);
  --nav-icon: #8590A4;
  --nav-icon-active: #D9B979;
  --nav-badge-bg: rgba(201, 168, 106, .18);
  --nav-badge-tx: #E8CF9B;

  --s-neutral-bg: #E6E2DA; --s-neutral-tx: #3A4251; --s-neutral-dot: #7A818D;
  --s-info-bg: #DCE6F3;    --s-info-tx: #17457C;    --s-info-dot: #3271BF;
  --s-progress-bg: #E6E0F2; --s-progress-tx: #4A2E86; --s-progress-dot: #7B5CC8;
  --s-warn-bg: #F4E3CA;    --s-warn-tx: #7A3D05;    --s-warn-dot: #D9811B;
  --s-ok-bg: #D9EBDE;      --s-ok-tx: #165A34;      --s-ok-dot: #2E9A5B;
  --s-bad-bg: #F5DCD7;     --s-bad-tx: #8F2318;     --s-bad-dot: #D04A3B;
  --s-teal-bg: #D4EAE7;    --s-teal-tx: #0E554F;    --s-teal-dot: #2A9D8F;
  --s-gold-bg: #F0E5CE;    --s-gold-tx: #6B4E1C;    --s-gold-dot: #C9A86A;
  --s-cancel-tx: #6C727D;  --s-cancel-line: #CBC4B7;

  --money-in: #1B7843;
  --money-out: #A2261B;
  --debt: #A2261B;
  --warn-tx: #8A4A08;

  --c1: #22314D; --c2: #C9A86A; --c3: #4C7FC0; --c4: #2A9D8F; --c5: #7B5CC8; --c6: #C2566F; --c7: #8A93A3;
  --chart-grid: #DFD9CD;
  --skel: #E5E0D6; --skel-hi: #F1EDE5;
}

/* ── Тёмная тема: ночная тушь ── */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1019;
  --bg-2: #070B12;
  --surface: #111823;
  --surface-2: #161F2D;
  --surface-3: #141B28;
  --zebra: #131A26;
  --hover: #19222F;
  --selected: #2A2416;
  --line: #222C3D;
  --line-2: #1B2332;
  --line-strong: #2F3B50;

  --text: #E8EBF1;
  --text-2: #B9C1CE;
  --muted: #8A94A6;
  --faint: #677184;
  --link: #93B8EC;
  --link-hover: #B9D2F4;

  --primary: #C9A86A;
  --primary-hover: #D6B983;
  --primary-press: #B8965A;
  --on-primary: #0B1220;
  --primary-icon: #0B1220;

  --accent: #C9A86A;
  --accent-ink: #DCC08A;
  --accent-soft: rgba(201, 168, 106, .14);
  --accent-line: rgba(201, 168, 106, .5);

  --focus-ring: 0 0 0 3px rgba(201, 168, 106, .38);
  --shadow-1: none;
  --shadow-2: 0 10px 28px -14px rgba(0, 0, 0, .7);
  --shadow-pop: 0 0 0 1px rgba(255, 255, 255, .04), 0 26px 56px -14px rgba(0, 0, 0, .72);
  --backdrop: rgba(2, 5, 10, .62);
  --glass: rgba(11, 16, 25, .76);

  --nav-bg: #070B12;
  --nav-bg-2: #0A0F18;
  --nav-line: rgba(255, 255, 255, .06);
  --nav-text: #A3ACBC;
  --nav-text-hi: #F1EDE4;
  --nav-muted: #616C80;
  --nav-hover: rgba(255, 255, 255, .045);
  --nav-active: rgba(201, 168, 106, .12);
  --nav-icon: #7A8599;
  --nav-icon-active: #D9B979;

  --s-neutral-bg: #222B3A; --s-neutral-tx: #CDD3DD; --s-neutral-dot: #8C96A8;
  --s-info-bg: #132B48;    --s-info-tx: #A8CBF4;    --s-info-dot: #5AA2EE;
  --s-progress-bg: #282046; --s-progress-tx: #CDBDF4; --s-progress-dot: #9C82E6;
  --s-warn-bg: #382813;    --s-warn-tx: #F3C68E;    --s-warn-dot: #E8943C;
  --s-ok-bg: #112F1E;      --s-ok-tx: #9ADBB2;      --s-ok-dot: #47BC78;
  --s-bad-bg: #3A1916;     --s-bad-tx: #F4ADA3;     --s-bad-dot: #E56B5D;
  --s-teal-bg: #0E312E;    --s-teal-tx: #93D9D0;    --s-teal-dot: #3CB8A8;
  --s-gold-bg: #312717;    --s-gold-tx: #E6CC97;    --s-gold-dot: #C9A86A;
  --s-cancel-tx: #8691A3;  --s-cancel-line: #33405A;

  --money-in: #6FD39B;
  --money-out: #F2A097;
  --debt: #F2A097;
  --warn-tx: #F0BF84;

  --c1: #8FA6CF; --c2: #D9BC82; --c3: #6E9FE0; --c4: #45BBAA; --c5: #A58AEA; --c6: #E07D93; --c7: #8C96A8;
  --chart-grid: #1F2938;
  --skel: #182130; --skel-hi: #1F2A3B;
}

/* ═══ База ═══ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fq-font);
  font-size: var(--fs-base);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05" 1, "cv08" 1;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Список вариантов у select с прозрачным фоном Chrome рисует на белом, а цвет текста берёт у поля */
select option, select optgroup { color: var(--text); background-color: var(--surface-2); }
button { cursor: pointer; }
/* Стрелки «больше/меньше» у числовых полей убраны везде (21.10): число вписывают с клавиатуры, стрелки мешали. */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
h1, h2, h3, h4 { margin: 0; font-family: var(--fq-display); color: var(--text); letter-spacing: -.01em; }
p { margin: 0; }
::selection { background: rgba(201, 168, 106, .35); color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.fq-num, .t-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv05" 1; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Иконки (SVG из icons.js) */
.fq-i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.fq-i.sm { width: 15px; height: 15px; }
.fq-i.lg { width: 22px; height: 22px; }
.fq-i.xl { width: 28px; height: 28px; stroke-width: 1.6; }
i[data-i] { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }

/* ═══ Каркас ═══ */
.fq-app {
  display: grid;
  grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--t-slow) var(--ease);
}
.fq-app.is-collapsed { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr); }
.fq-app.no-side { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.fq-app.no-rail { grid-template-columns: minmax(0, 1fr); }
.fq-top-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font: 800 17px/1 var(--fq-display); letter-spacing: -.02em; margin-right: 10px; }
.fq-top-brand svg { width: 26px; height: 26px; }
.fq-top-brand:hover { color: var(--text); }
.fq-app > .fq-rail { grid-column: 1; grid-row: 1; }
.fq-app > .fq-side { grid-column: 2; grid-row: 1; }
.fq-app > .fq-main { grid-column: -2 / -1; grid-row: 1; }

/* Рельс модулей */
.fq-rail {
  position: sticky; top: 0; height: 100vh; z-index: 41;
  background: var(--nav-bg);
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; gap: 4px;
  border-right: 1px solid var(--nav-line);
}
.fq-rail-logo { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 12px;
  transition: transform var(--t) var(--ease); }
.fq-rail-logo:hover { transform: rotate(-4deg) scale(1.04); }
.fq-rail-logo svg { width: 30px; height: 30px; }
.fq-rail-group { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.fq-rail-spacer { flex: 1; }
.fq-rail-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px; border: 0;
  display: grid; place-items: center; color: var(--nav-icon); background: transparent;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.fq-rail-btn .fq-i { width: 21px; height: 21px; }
.fq-rail-btn:hover { background: var(--nav-hover); color: var(--nav-text-hi); }
.fq-rail-btn.is-active { background: var(--nav-active); color: var(--nav-icon-active); }
.fq-rail-btn.is-active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.fq-rail-btn .fq-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%;
  background: #E5654F; box-shadow: 0 0 0 2px var(--nav-bg); }
.fq-rail-sep { width: 28px; height: 1px; background: var(--nav-line); margin: 8px 0; }
.fq-rail-avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; margin-top: 6px;
  background: linear-gradient(135deg, #2A3550, #1A2235); color: var(--nav-text-hi); font: 600 13px/1 var(--fq-display);
  display: grid; place-items: center; box-shadow: 0 0 0 1px rgba(201,168,106,.35); }

/* Подсказка у кнопок рельса */
[data-tip] { position: relative; }
.fq-rail [data-tip]:hover::after, .fq-rail [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; padding: 6px 10px; border-radius: var(--r-md); font: 500 12.5px/1.2 var(--fq-font);
  background: #1B2436; color: #F4F0E7; box-shadow: var(--shadow-pop); pointer-events: none; z-index: 60;
  animation: fq-tip .14s var(--ease) both;
}
@keyframes fq-tip { from { opacity: 0; transform: translate(-4px, -50%); } }

/* Панель разделов */
.fq-side {
  position: sticky; top: 0; height: 100vh; z-index: 40; overflow: hidden;
  background: var(--nav-bg-2); color: var(--nav-text);
  border-right: 1px solid var(--nav-line);
  display: flex; flex-direction: column;
}
.fq-app.is-collapsed .fq-side { visibility: hidden; }
.fq-side-head { padding: 18px 16px 10px 18px; display: flex; align-items: flex-start; gap: 10px; min-width: var(--side-w); }
.fq-side-title { font: 700 16px/1.25 var(--fq-display); color: var(--nav-text-hi); letter-spacing: -.01em; }
.fq-side-sub { font-size: 12px; color: var(--nav-muted); margin-top: 2px; }
.fq-side-collapse { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  color: var(--nav-muted); display: grid; place-items: center; transition: background var(--t), color var(--t); }
.fq-side-collapse:hover { background: var(--nav-hover); color: var(--nav-text-hi); }
.fq-side-scope { margin: 4px 14px 6px; min-width: calc(var(--side-w) - 28px); display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 10px; border-radius: 9px; background: rgba(255,255,255,.04); border: 1px solid var(--nav-line);
  color: var(--nav-text); font-size: 12.5px; }
.fq-side-scope b { color: var(--nav-text-hi); font-weight: 600; }
.fq-side-scope .fq-i { width: 15px; height: 15px; color: var(--nav-muted); }
.fq-side-scope .fq-i:last-child { margin-left: auto; }
.fq-side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; min-width: var(--side-w);
  scrollbar-color: rgba(255,255,255,.12) transparent; }
.fq-side-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); background-clip: padding-box; }
.fq-nav-group { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--nav-muted); padding: 16px 10px 6px; letter-spacing: .01em; border-radius: 6px; }
.fq-nav-group .fq-i { width: 13px; height: 13px; margin-left: auto; opacity: 0; transition: opacity var(--t), transform var(--t) var(--ease); }
.fq-nav-group:hover { color: var(--nav-text); }
.fq-nav-group:hover .fq-i, .fq-nav-sec.is-closed .fq-nav-group .fq-i { opacity: 1; }
.fq-nav-sec.is-closed .fq-nav-group .fq-i { transform: rotate(-90deg); }
.fq-nav-sec.is-closed .fq-nav-items { display: none; }
.fq-nav-group .fq-nav-sum { margin-left: 4px; font-weight: 500; opacity: .8; }
.fq-nav-sec:not(.is-closed) .fq-nav-sum, .fq-nav-sec:not(.is-closed) .fq-nav-group .fq-nav-badge { display: none; }
.fq-nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; height: 35px; padding: 0 10px; border-radius: 9px;
  color: var(--nav-text); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
.fq-nav-link .fq-i { width: 17px; height: 17px; color: var(--nav-icon); transition: color var(--t); }
.fq-nav-link:hover { background: var(--nav-hover); color: var(--nav-text-hi); }
.fq-nav-link:hover .fq-i { color: var(--nav-text-hi); }
.fq-nav-link.is-active { background: var(--nav-active); color: var(--nav-text-hi); font-weight: 600; }
.fq-nav-link.is-active .fq-i { color: var(--nav-icon-active); }
.fq-nav-link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); }
.fq-nav-link .fq-nav-label { overflow: hidden; text-overflow: ellipsis; }
.fq-nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center;
  font: 600 11px/1 var(--fq-font); background: var(--nav-badge-bg); color: var(--nav-badge-tx); font-variant-numeric: tabular-nums; }
.fq-nav-badge.is-alert { background: rgba(229, 101, 79, .2); color: #F6A595; }
.fq-side-foot { padding: 10px 14px 14px; border-top: 1px solid var(--nav-line); min-width: var(--side-w); }
.fq-side-foot .fq-nav-link { height: 32px; font-size: 13px; }

/* Основная колонка */
.fq-main { min-width: 0; display: flex; flex-direction: column; }
.fq-top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 14px; padding: 0 var(--page-x);
  background: var(--glass); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--t), box-shadow var(--t);
}
.fq-top.is-scrolled { border-bottom-color: var(--line); }
.fq-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.fq-crumbs a { color: var(--muted); }
.fq-crumbs a:hover { color: var(--text); }
.fq-crumbs .fq-i { width: 14px; height: 14px; color: var(--faint); }
.fq-crumbs span:last-child { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.fq-search-btn {
  display: flex; align-items: center; gap: 10px; height: 38px; width: 300px; padding: 0 8px 0 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--faint); font-size: 13.5px;
  transition: border-color var(--t), box-shadow var(--t);
}
.fq-search-btn:hover { border-color: var(--line-strong); }
.fq-search-btn .fq-i { width: 16px; height: 16px; }
.fq-search-btn kbd { margin-left: auto; }
kbd, .fq-kbd { font: 500 11px/1 var(--fq-font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); box-shadow: 0 1px 0 var(--line); }
.fq-top-btn { position: relative; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2);
  display: grid; place-items: center; transition: background var(--t), color var(--t); }
.fq-top-btn:hover { background: var(--hover); color: var(--text); }
.fq-top-btn .fq-i { width: 19px; height: 19px; }
.fq-top-btn .fq-dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: #E5654F;
  box-shadow: 0 0 0 2px var(--bg); }
.fq-theme-ic-dark { display: none; }
[data-theme="dark"] .fq-theme-ic-dark { display: block; }
[data-theme="dark"] .fq-theme-ic-light { display: none; }

.fq-page { padding: 6px var(--page-x) 56px; flex: 1; min-width: 0; }
.fq-page.is-narrow { max-width: 1040px; }
.fq-page.is-medium { max-width: 1320px; }

/* ═══ Мобильный каркас ═══ */
.fq-appbar { display: none; }
.fq-tabbar { display: none; }
.fq-drawer-nav { display: none; }

@media (max-width: 1279px) {
  .fq-app { grid-template-columns: var(--rail-w) 0 minmax(0, 1fr); }
  .fq-app.no-rail { grid-template-columns: minmax(0, 1fr); }
  .fq-app .fq-side { position: fixed; left: var(--rail-w); width: var(--side-w); transform: translateX(-110%);
    visibility: hidden; transition: transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow);
    box-shadow: 24px 0 48px -20px rgba(0,0,0,.45); }
  .fq-app.is-side-open .fq-side { transform: none; visibility: visible; transition: transform var(--t-slow) var(--ease); }
  .fq-search-btn { width: 220px; }
}
@media (max-width: 1023px) {
  .fq-app, .fq-app.is-collapsed, .fq-app.no-side { grid-template-columns: minmax(0, 1fr); }
  .fq-rail, .fq-app .fq-side { display: none; }
  .fq-top { display: none; }
  .fq-appbar {
    display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30; height: var(--top-h);
    padding: 0 8px 0 6px; background: var(--glass); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px);
    border-bottom: 1px solid var(--line-2);
  }
  .fq-appbar-title { flex: 1; min-width: 0; font: 700 16px/1.2 var(--fq-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fq-appbar-title small { display: block; font: 500 11.5px/1.2 var(--fq-font); color: var(--muted); }
  .fq-page { padding-top: 14px; }
}
.fq-cab .fq-tabbar {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line-2);
}
@media (max-width: 767px) {
  .fq-tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line-2);
  }
  .fq-tabbar a, .fq-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .01em; position: relative; }
  .fq-tabbar .fq-i { width: 22px; height: 22px; }
  .fq-tabbar .is-active { color: var(--text); }
  .fq-tabbar .is-active .fq-i { color: var(--accent-ink); }
  .fq-tabbar .is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .fq-tabbar .fq-tab-badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
    background: #D9493A; color: #fff; font-size: 10px; display: grid; place-items: center; }
  .fq-page { padding-bottom: calc(var(--tab-h) + 32px + env(safe-area-inset-bottom)); }
  body.no-tabbar .fq-page { padding-bottom: 32px; }
}

/* Выезжающее меню (телефон, планшет) */
.fq-drawer-nav.is-open { display: block; }
.fq-drawer-nav { position: fixed; inset: 0; z-index: 80; }
.fq-drawer-nav .fq-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fq-fade .2s var(--ease) both; }
.fq-drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(88vw, 360px); background: var(--nav-bg-2); color: var(--nav-text);
  display: flex; flex-direction: column; animation: fq-slide-in .28s var(--ease) both; box-shadow: 24px 0 64px -24px rgba(0,0,0,.6);
}
.fq-drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--nav-line); }
.fq-drawer-head .fq-wordmark { height: 36px; }
.fq-drawer-modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px 12px 8px; border-bottom: 1px solid var(--nav-line); }
.fq-drawer-modules a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px; border-radius: 12px;
  color: var(--nav-text); font-size: 11px; font-weight: 600; text-align: center; line-height: 1.15; }
.fq-drawer-modules a .fq-i { width: 22px; height: 22px; color: var(--nav-icon); }
.fq-drawer-modules a.is-active { background: var(--nav-active); color: var(--nav-text-hi); }
.fq-drawer-modules a.is-active .fq-i { color: var(--nav-icon-active); }
.fq-drawer-panel .fq-side-nav { min-width: 0; }
.fq-drawer-foot { display: flex; gap: 8px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--nav-line); }
.fq-drawer-foot button { flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--nav-line); background: rgba(255,255,255,.04);
  color: var(--nav-text-hi); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 13px; }
@keyframes fq-slide-in { from { transform: translateX(-100%); } }

/* ═══ Заголовок страницы ═══ */
.fq-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 10px 0 20px; }
.fq-head-main { min-width: 0; flex: 1 1 320px; }
.fq-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.fq-back:hover { color: var(--text); }
.fq-back .fq-i { width: 16px; height: 16px; }
.fq-title { font: 700 28px/1.15 var(--fq-display); letter-spacing: -.025em; color: var(--text); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fq-title-meta { font: 500 15px/1 var(--fq-font); color: var(--muted); letter-spacing: 0; }
.fq-sub { margin-top: 6px; color: var(--muted); font-size: 14px; max-width: 760px; }
.fq-head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; color: var(--text-2); font-size: 13.5px; }
.fq-head-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.fq-head-meta .fq-i { width: 15px; height: 15px; color: var(--faint); }
.fq-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
@media (max-width: 767px) {
  .fq-head { margin: 4px 0 16px; align-items: stretch; }
  .fq-title { font-size: 23px; }
  .fq-head-actions { width: 100%; }
  .fq-head-actions .fq-btn { flex: 1; }
  .fq-head-actions .fq-btn.is-icon { flex: 0 0 auto; }
}
.fq-section-title { font: 700 17px/1.3 var(--fq-display); color: var(--text); display: flex; align-items: center; gap: 10px; }
.fq-section-title .fq-count { font: 600 12.5px/1 var(--fq-font); color: var(--muted); }
.fq-section-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ═══ Кнопки ═══ */
.fq-btn {
  --b-bg: var(--surface-2); --b-tx: var(--text); --b-line: var(--line); --b-hover: var(--hover);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--ctl-h); padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-tx);
  font: 600 13.5px/1 var(--fq-font); white-space: nowrap; user-select: none; text-decoration: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t), transform var(--t-fast) var(--ease), box-shadow var(--t);
  box-shadow: var(--shadow-1);
}
.fq-btn:hover { background: var(--b-hover); color: var(--b-tx); }
.fq-btn:active { transform: translateY(1px) scale(.99); }
.fq-btn .fq-i { width: 17px; height: 17px; }
.fq-btn.is-primary { --b-bg: var(--primary); --b-tx: var(--on-primary); --b-line: var(--primary); --b-hover: var(--primary-hover);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 6px 16px -8px rgba(11,18,32,.55); }
.fq-btn.is-primary .fq-i { color: var(--primary-icon); }
[data-theme="dark"] .fq-btn.is-primary { box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 20px -10px rgba(201,168,106,.55); }
.fq-btn.is-gold { --b-bg: var(--accent); --b-tx: #0B1220; --b-line: var(--accent); --b-hover: #D4B57B; }
.fq-btn.is-ghost { --b-bg: transparent; --b-line: transparent; --b-hover: var(--hover); box-shadow: none; color: var(--text-2); }
.fq-btn.is-link { --b-bg: transparent; --b-line: transparent; --b-hover: transparent; box-shadow: none; color: var(--link); padding: 0 4px; }
.fq-btn.is-link:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
.fq-btn.is-danger { --b-bg: var(--surface-2); --b-tx: var(--money-out); --b-line: color-mix(in srgb, var(--money-out) 35%, var(--line)); --b-hover: var(--s-bad-bg); }
.fq-btn.is-danger-solid { --b-bg: #B42F22; --b-tx: #fff; --b-line: #B42F22; --b-hover: #9E271C; }
.fq-btn.is-success { --b-bg: #1F7A47; --b-tx: #fff; --b-line: #1F7A47; --b-hover: #19693C; }
.fq-btn.is-accent-line { --b-line: var(--accent-line); --b-tx: var(--accent-ink); --b-hover: var(--accent-soft); }
.fq-btn.is-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 6px; }
.fq-btn.is-sm .fq-i { width: 15px; height: 15px; }
/* .is-tap — маленькая кнопка там, куда жмут пальцем (кабинет бригадира, окно загрузки): на телефоне она не меньше
   44px — .fq-btn.is-sm растёт до высоты поля, .fq-iconbtn — до квадрата 44×44. */
@media (max-width: 767px) {
  .fq-btn.is-sm.is-tap { height: 44px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }
  .fq-btn.is-sm.is-tap .fq-i { width: 17px; height: 17px; }
  .fq-iconbtn.is-tap { width: 44px; height: 44px; }
}
.fq-btn.is-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 11px; }
.fq-btn.is-xl { height: 58px; padding: 0 24px; font-size: 17px; border-radius: 14px; }
.fq-btn.is-block { width: 100%; }
.fq-btn.is-icon { width: var(--ctl-h); padding: 0; }
.fq-btn.is-icon.is-sm { width: 30px; }
.fq-btn[disabled], .fq-btn.is-disabled { opacity: .5; pointer-events: none; }
/* Неактивная на вид, но нажатие доходит — страница объясняет, почему сейчас нельзя («Печать», пока готовится просмотр). */
.fq-btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.fq-btn.is-loading { pointer-events: none; color: transparent !important; position: relative; }
.fq-btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--b-tx); border-right-color: transparent; animation: fq-spin .7s linear infinite; }
.fq-btn-group { display: inline-flex; }
.fq-btn-group .fq-btn { border-radius: 0; margin-left: -1px; }
.fq-btn-group .fq-btn:first-child { border-radius: 9px 0 0 9px; margin-left: 0; }
.fq-btn-group .fq-btn:last-child { border-radius: 0 9px 9px 0; }
.fq-iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted);
  display: inline-grid; place-items: center; transition: background var(--t), color var(--t); }
.fq-iconbtn:hover { background: var(--hover); color: var(--text); }
.fq-iconbtn .fq-i { width: 17px; height: 17px; }
.fq-iconbtn.is-danger:hover { color: var(--money-out); background: var(--s-bad-bg); }

/* Плавающая кнопка действия (телефон) */
.fq-fab { position: fixed; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 34;
  height: 56px; min-width: 56px; padding: 0 20px; border-radius: 18px; border: 0; display: none; align-items: center; gap: 10px;
  background: var(--primary); color: var(--on-primary); font: 700 15px/1 var(--fq-font);
  box-shadow: 0 14px 30px -10px rgba(11,18,32,.6), 0 0 0 1px rgba(255,255,255,.06) inset; }
.fq-fab .fq-i { width: 22px; height: 22px; color: var(--primary-icon); }
@media (max-width: 767px) { .fq-fab { display: inline-flex; } .fq-fab ~ * .hide-if-fab, .has-fab .hide-if-fab { display: none !important; } }

/* ═══ Поля ввода ═══ */
.fq-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fq-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.fq-label .req { color: var(--accent-ink); font-weight: 700; }
.fq-label .opt { color: var(--faint); font-weight: 500; }
.fq-hint { font-size: 12.5px; color: var(--muted); }
.fq-error { font-size: 12.5px; color: var(--money-out); display: flex; align-items: center; gap: 6px; }
.fq-input, .fq-select, .fq-textarea {
  width: 100%; height: var(--ctl-h); padding: 0 12px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 14px; outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.fq-input::placeholder, .fq-textarea::placeholder { color: var(--faint); }
.fq-input:hover, .fq-select:hover, .fq-textarea:hover { border-color: var(--line-strong); }
.fq-input:focus, .fq-select:focus, .fq-textarea:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.fq-input.is-invalid { border-color: var(--money-out); }
.fq-input[readonly], .fq-input:disabled { background: var(--surface-3); color: var(--muted); }
.fq-input.t-num { text-align: right; }
.fq-textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.fq-select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888f9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.fq-inputgroup { display: flex; align-items: stretch; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2);
  transition: border-color var(--t), box-shadow var(--t); height: var(--ctl-h); }
.fq-inputgroup:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.fq-inputgroup .fq-input { border: 0; box-shadow: none !important; background: transparent; height: 100%; }
.fq-inputgroup .fq-addon { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.fq-inputgroup .fq-addon + .fq-input { padding-left: 0; }
.fq-inputgroup .fq-addon.is-end { border-left: 1px solid var(--line-2); }
/* Выбор единицы в конце поля числа: «120 [бобины ▾]» — заявка, покупка, приёмка, выдача (docs/stock-units.md). */
.fq-inputgroup .fq-unit-pick { border: 0; border-left: 1px solid var(--line-2); border-radius: 0 9px 9px 0; background-color: transparent;
  height: auto; width: auto; min-width: 72px; max-width: 132px; padding: 0 28px 0 10px; color: var(--text-2); font-size: 13px; box-shadow: none; }
.fq-inputgroup .fq-unit-pick:focus { box-shadow: none; }
.fq-search { position: relative; display: flex; align-items: center; }
.fq-search .fq-i { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.fq-search .fq-input { padding-left: 36px; }
.fq-search kbd { position: absolute; right: 8px; }

/* Чекбокс, радио, переключатель */
.fq-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--text); user-select: none; }
.fq-check input { appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; border: 1.5px solid var(--line-strong);
  background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; transition: background var(--t), border-color var(--t); cursor: pointer; }
.fq-check input[type="radio"] { border-radius: 50%; }
.fq-check input:checked { background: var(--primary); border-color: var(--primary); }
.fq-check input:checked::after { content: ""; width: 10px; height: 10px;
  background: var(--on-primary); clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }
.fq-check input[type="radio"]:checked::after { clip-path: none; width: 8px; height: 8px; border-radius: 50%; }
.fq-check input:indeterminate { background: var(--primary); border-color: var(--primary); }
.fq-check input:indeterminate::after { content: ""; width: 9px; height: 2px; border-radius: 2px; background: var(--on-primary); clip-path: none; }
.fq-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; user-select: none; }
.fq-switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; margin: 0; background: var(--line-strong);
  position: relative; transition: background var(--t) var(--ease); cursor: pointer; flex-shrink: 0; }
.fq-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t) var(--ease-spring); }
.fq-switch input:checked { background: var(--primary); }
[data-theme="dark"] .fq-switch input:checked::after { background: #0B1220; }
.fq-switch input:checked::after { transform: translateX(16px); }

/* Сегментный переключатель */
.fq-seg { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bg-2);
  border: 1px solid var(--line-2); position: relative; }
.fq-seg button, .fq-seg a { position: relative; z-index: 1; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-2); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: color var(--t); }
.fq-seg .is-on { color: var(--text); }
.fq-seg .fq-seg-thumb { position: absolute; z-index: 0; top: 3px; bottom: 3px; border-radius: 8px; background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); transition: left var(--t-slow) var(--ease), width var(--t-slow) var(--ease); }
.fq-seg:not(.is-ready) .is-on { background: var(--surface-2); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.fq-seg .fq-i { width: 16px; height: 16px; }
.fq-seg.is-icons button { width: 32px; padding: 0; justify-content: center; }

/* ═══ Вкладки ═══ */
.fq-tabs { display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: var(--bg-2);
  border: 1px solid var(--line-2); position: relative; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.fq-tabs::-webkit-scrollbar { display: none; }
.fq-tab { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0;
  border-radius: 9px; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: color var(--t); }
.fq-tab:hover { color: var(--text); }
.fq-tab .n { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.fq-tab.is-on { color: var(--text); font-weight: 600; }
.fq-tab.is-on .n { color: var(--text); }
.fq-tabs .fq-tabs-thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 9px; background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); transition: left var(--t-slow) var(--ease), width var(--t-slow) var(--ease); }
.fq-tabs:not(.is-ready) .fq-tab.is-on { background: var(--surface-2); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.fq-tab .fq-dot-alert { width: 7px; height: 7px; border-radius: 50%; background: #D9493A; }
/* Вкладки под палец (раздел «Задачи»): на телефоне вкладки делят ширину поровну и не ниже 44px. */
@media (max-width: 767px) { .fq-tabs.is-touch { width: 100%; } .fq-tabs.is-touch .fq-tab { flex: 1; justify-content: center; height: 44px; } }
/* Линейные вкладки (карточка документа) */
.fq-tabs.is-line { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 22px; overflow-x: auto; }
.fq-tabs.is-line .fq-tab { height: 42px; padding: 0 2px; border-radius: 0; font-size: 14px; }
.fq-tabs.is-line .fq-tab.is-on { background: none; box-shadow: none; }
.fq-tabs.is-line .fq-tabs-thumb { top: auto; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--accent); box-shadow: none; }
.fq-tabs.is-line:not(.is-ready) .fq-tab.is-on { box-shadow: inset 0 -2.5px 0 var(--accent); }
.fq-tabpane { display: none; }
.fq-tabpane.is-on { display: block; animation: fq-rise .3s var(--ease) both; }

/* ═══ Панели и карточки ═══ */
.fq-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.fq-panel.is-flush { overflow: hidden; overflow: clip; }   /* clip: углы режет, но для липкой шапки таблицы — не «экран» */
.fq-panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); min-height: 56px; flex-wrap: wrap; }
.fq-panel-head .fq-section-title { font-size: 15.5px; }
.fq-panel-head .fq-panel-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.fq-panel-body { padding: 18px; }
.fq-panel-foot { padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.fq-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px;
  color: var(--text); box-shadow: var(--shadow-1); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t); }
a.fq-card:hover, .fq-card.is-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); color: var(--text); }
.fq-callout { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px;
  background: var(--s-info-bg); color: var(--s-info-tx); border: 1px solid color-mix(in srgb, var(--s-info-dot) 25%, transparent); }
.fq-callout .fq-i { margin-top: 1px; }
.fq-callout b { font-weight: 600; }
.fq-callout.is-warn { background: var(--s-warn-bg); color: var(--s-warn-tx); border-color: color-mix(in srgb, var(--s-warn-dot) 30%, transparent); }
.fq-callout.is-bad { background: var(--s-bad-bg); color: var(--s-bad-tx); border-color: color-mix(in srgb, var(--s-bad-dot) 30%, transparent); }
.fq-callout.is-ok { background: var(--s-ok-bg); color: var(--s-ok-tx); border-color: color-mix(in srgb, var(--s-ok-dot) 30%, transparent); }
.fq-callout.is-gold { background: var(--s-gold-bg); color: var(--s-gold-tx); border-color: var(--accent-line); }
.fq-callout.is-info { background: var(--s-info-bg); color: var(--s-info-tx); border-color: color-mix(in srgb, var(--s-info-dot) 30%, transparent); }
.fq-callout .fq-callout-actions { margin-left: auto; display: flex; gap: 8px; }
/* Телефон: текст на всю ширину, действия — строкой под ним (отступ = иконка 18px + зазор 12px) */
@media (max-width: 767px) {
  .fq-callout:has(> .fq-callout-actions) { flex-wrap: wrap; }
  .fq-callout:has(> .fq-callout-actions) > :not(.fq-i, .fq-callout-actions) { flex: 1 1 0; min-width: 0; }
  .fq-callout > .fq-callout-actions { flex: 1 1 100%; flex-wrap: wrap; margin-left: 0; }
  .fq-callout > .fq-i ~ .fq-callout-actions { flex-basis: calc(100% - 30px); margin-left: 30px; }
}

/* ═══ Показатели (KPI) ═══ */
.fq-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.fq-kpi { padding: 15px 20px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.fq-kpis .fq-kpi + .fq-kpi { border-left: 1px solid var(--line-2); }
.fq-kpi-label { font-size: 12.5px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.fq-kpi-label .fq-i { width: 15px; height: 15px; }
.fq-kpi-value { font: 700 24px/1.15 var(--fq-display); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; white-space: nowrap; }
.fq-kpi-value small { font: 500 13px/1 var(--fq-font); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.fq-kpi-value.is-debt { color: var(--debt); }
.fq-kpi-value.is-in { color: var(--money-in); }
.fq-kpi-foot { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fq-delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 2px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.fq-delta .fq-i { width: 13px; height: 13px; stroke-width: 2.2; }
.fq-delta.is-up { color: var(--s-ok-tx); background: var(--s-ok-bg); }
.fq-delta.is-down { color: var(--s-bad-tx); background: var(--s-bad-bg); }
.fq-delta.is-flat { color: var(--s-neutral-tx); background: var(--s-neutral-bg); }
.fq-kpi .fq-spark { position: absolute; right: 16px; top: 36px; width: 84px; height: 30px; opacity: .9; }
.fq-kpi.is-hero { background: linear-gradient(135deg, #111A2C, #0B1220 70%); color: #F4F0E7; }
.fq-kpi.is-hero .fq-kpi-label { color: #A9B2C2; }
.fq-kpi.is-hero .fq-kpi-value { color: #F6E7C8; }
.fq-kpi.is-hero .fq-kpi-value small { color: #A9B2C2; }
@media (max-width: 767px) {
  .fq-kpis { grid-template-columns: 1fr 1fr; }
  .fq-kpis .fq-kpi + .fq-kpi { border-left: 0; }
  .fq-kpis .fq-kpi { border-top: 1px solid var(--line-2); padding: 12px 14px; }
  .fq-kpis .fq-kpi:nth-child(-n+2) { border-top: 0; }
  .fq-kpis .fq-kpi:nth-child(2n) { border-left: 1px solid var(--line-2); }
  .fq-kpis .fq-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fq-kpi-value { font-size: 20px; }
  .fq-kpi .fq-spark { display: none; }
}
/* Отдельные карточки показателей */
.fq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.fq-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.fq-stat-top { display: flex; align-items: center; gap: 10px; }
.fq-stat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.fq-stat-ic .fq-i { width: 18px; height: 18px; }
.fq-stat-ic.is-info { background: var(--s-info-bg); color: var(--s-info-tx); }
.fq-stat-ic.is-ok { background: var(--s-ok-bg); color: var(--s-ok-tx); }
.fq-stat-ic.is-warn { background: var(--s-warn-bg); color: var(--s-warn-tx); }
.fq-stat-ic.is-bad { background: var(--s-bad-bg); color: var(--s-bad-tx); }
.fq-stat-ic.is-progress { background: var(--s-progress-bg); color: var(--s-progress-tx); }
.fq-stat-ic.is-ink { background: var(--primary); color: var(--primary-icon); }
.fq-stat .fq-kpi-value { font-size: 26px; margin-top: 4px; }
.fq-stat .fq-chart { margin: 4px -4px -6px; }

/* ═══ Статусы, метки, деньги ═══ */
.fq-status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1;
  background: var(--s-neutral-bg); color: var(--s-neutral-tx); }
.fq-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--s-neutral-dot); flex-shrink: 0; }
.fq-status.no-dot::before { display: none; }
.fq-status.s-info { background: var(--s-info-bg); color: var(--s-info-tx); } .fq-status.s-info::before { background: var(--s-info-dot); }
.fq-status.s-progress { background: var(--s-progress-bg); color: var(--s-progress-tx); } .fq-status.s-progress::before { background: var(--s-progress-dot); }
.fq-status.s-warn { background: var(--s-warn-bg); color: var(--s-warn-tx); } .fq-status.s-warn::before { background: var(--s-warn-dot); }
.fq-status.s-ok { background: var(--s-ok-bg); color: var(--s-ok-tx); } .fq-status.s-ok::before { background: var(--s-ok-dot); }
.fq-status.s-bad { background: var(--s-bad-bg); color: var(--s-bad-tx); } .fq-status.s-bad::before { background: var(--s-bad-dot); }
.fq-status.s-teal { background: var(--s-teal-bg); color: var(--s-teal-tx); } .fq-status.s-teal::before { background: var(--s-teal-dot); }
.fq-status.s-gold { background: var(--s-gold-bg); color: var(--s-gold-tx); } .fq-status.s-gold::before { background: var(--s-gold-dot); }
.fq-status.s-cancel { background: transparent; color: var(--s-cancel-tx); box-shadow: inset 0 0 0 1px var(--s-cancel-line); }
.fq-status.s-cancel::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--s-cancel-tx); }
.fq-status.is-live::before { animation: fq-pulse 2.4s ease-in-out infinite; will-change: opacity; transform: translateZ(0); backface-visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .fq-status.is-live::before { animation: none; } }
.fq-status.is-lg { height: 30px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.fq-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; }
.fq-badge .fq-i { width: 13px; height: 13px; }
.fq-badge.is-gold { background: var(--s-gold-bg); color: var(--s-gold-tx); border-color: transparent; }
.fq-badge.is-ink { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.fq-badge.is-new { background: var(--accent); color: #0B1220; border-color: transparent; }
.fq-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.fq-chip .fq-i { width: 14px; height: 14px; color: var(--muted); }
.fq-chip.is-link { color: var(--link); }
/* Убрать метку (наблюдатель задачи): крестик 22px, касание — 44px за счёт невидимой рамки вокруг. */
.fq-chip-x { position: relative; width: 22px; height: 22px; margin-right: -4px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.fq-chip-x::after { content: ""; position: absolute; inset: -11px; }
.fq-chip-x:hover { color: var(--text); background: var(--hover); }
.fq-chip-x .fq-i { width: 14px; height: 14px; }
.fq-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 600 11.5px/1 var(--fq-font);
  background: var(--surface-3); color: var(--text-2); font-variant-numeric: tabular-nums; }
.fq-count.is-alert { background: #D9493A; color: #fff; }
.fq-count.is-gold { background: var(--accent); color: #0B1220; }

.fq-money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.fq-money small, .fq-unit { font-size: .82em; color: var(--muted); font-weight: 500; margin-left: 3px; }
.fq-money.is-in { color: var(--money-in); }
.fq-money.is-out, .fq-money.is-debt { color: var(--debt); }
.fq-money.is-strong { font-weight: 700; }
.fq-dash { color: var(--faint); }
.t-muted { color: var(--muted); } .t-faint { color: var(--faint); } .t-2 { color: var(--text-2); }
.t-strong { font-weight: 600; color: var(--text); } .t-bold { font-weight: 700; }
.t-right { text-align: right; } .t-center { text-align: center; }
.t-sm { font-size: 12.5px; } .t-xs { font-size: 12px; } .t-lg { font-size: 15.5px; }
.t-nowrap { white-space: nowrap; } .t-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-strike { text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); }
.t-mono { font-family: var(--fq-mono); font-size: .92em; font-feature-settings: "calt" 0, "liga" 0; }  /* без замен: дефис в артикуле остаётся дефисом */
.t-up { color: var(--money-in); } .t-down { color: var(--money-out); } .t-warn { color: var(--warn-tx); } .t-gold { color: var(--accent-ink); }
.t-link { color: var(--link); font-weight: 600; }

/* Цвет ткани/изделия — квадратик */
.fq-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; vertical-align: -2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.fq-swatch.is-lg { width: 22px; height: 22px; border-radius: 6px; }
[data-theme="dark"] .fq-swatch { box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.fq-swatch.is-xl { width: 44px; height: 44px; border-radius: 12px; }
.fq-colorchip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 9px 0 6px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }

/* Аватар */
.fq-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: inline-grid; place-items: center;
  font: 600 12px/1 var(--fq-display); color: #F4F0E7; background: #2A3550; overflow: hidden; }
.fq-avatar.is-sm { width: 24px; height: 24px; font-size: 10px; }
.fq-avatar.is-lg { width: 44px; height: 44px; font-size: 15px; }
.fq-avatar.is-xl { width: 64px; height: 64px; font-size: 21px; }
.fq-avatar.a1 { background: #2A3550; } .fq-avatar.a2 { background: #7A5B2C; } .fq-avatar.a3 { background: #2D6B62; }
.fq-avatar.a4 { background: #5B3F86; } .fq-avatar.a5 { background: #8E3B47; } .fq-avatar.a6 { background: #3C5E8C; }
.fq-avatars { display: inline-flex; } .fq-avatars .fq-avatar { box-shadow: 0 0 0 2px var(--surface); } .fq-avatars .fq-avatar + .fq-avatar { margin-left: -8px; }
.fq-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fq-person-name { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-person-sub { font-size: 12.5px; color: var(--muted); }

/* ═══ Фильтры над таблицей ═══ */
.fq-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fq-toolbar .fq-spacer { flex: 1; }
.fq-filters { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.fq-filters .fq-search { flex: 1 1 300px; max-width: 380px; }
.fq-filter input { border: 0; background: transparent; color: inherit; font: inherit; padding: 0; outline: none; min-width: 0; }
.fq-filter input[type=date] { width: 120px; color-scheme: light dark; }
.fq-filter select { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; padding: 0 2px; outline: none; cursor: pointer; max-width: 220px; text-overflow: ellipsis; }
.fq-filter select option { color: var(--text); background: var(--surface-2); }
.fq-pager { flex-wrap: wrap; }
.fq-select.is-sm { height: 30px; padding: 0 28px 0 10px; font-size: 13px; border-radius: 8px; }
.fq-filter { display: inline-flex; align-items: center; gap: 8px; height: var(--ctl-h); padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: border-color var(--t), background var(--t); }
.fq-filter:hover { border-color: var(--line-strong); }
.fq-filter .fq-i { width: 16px; height: 16px; color: var(--muted); }
.fq-filter .fq-i:last-child { width: 14px; height: 14px; }
.fq-filter b { color: var(--text); font-weight: 600; }
.fq-filter.is-set { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.fq-filter.is-set .fq-i { color: var(--accent-ink); }
/* Выбор кнопкой (срок, «Кому», выходные дни): <label class="fq-filter is-choice"><input type="radio|checkbox">…</label>.
   Поле остаётся в форме и доступно с клавиатуры (Tab, стрелки, пробел), на экране его нет; фокус — кольцом у кнопки. */
.fq-filter.is-choice { position: relative; cursor: pointer; }
.fq-filter.is-choice > input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fq-filter.is-choice:has(> input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--text); }
.fq-filter.is-choice:has(> input:focus-visible) { border-color: var(--accent); box-shadow: var(--focus-ring); }
.fq-filters .fq-reset { font-size: 13px; color: var(--muted); font-weight: 500; padding: 0 6px; border: 0; background: none; }
.fq-filters .fq-reset:hover { color: var(--text); }
@media (max-width: 767px) {
  .fq-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 10px 12px; }
  .fq-filters::-webkit-scrollbar { display: none; }
  .fq-filters .fq-search { flex: 0 0 72%; max-width: none; }
  /* .is-wrap: фильтров много — на телефоне переносятся, а не уезжают вбок; поиск на всю ширину. Выбор из списка
     .is-fill делит строку с соседями (длинное значение — с многоточием), а не встаёт отдельной строкой. .is-compact —
     только иконка 44×44 рядом с поиском: список открывает тот же select, прозрачный поверх иконки; выбранное не по
     умолчанию страница отмечает .is-set. Без :has() (старый браузер) он просто встаёт в начало второй строки. */
  .fq-filters.is-wrap { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; }
  .fq-filters.is-wrap .fq-search { flex: 1 1 100%; order: -2; }
  .fq-filters.is-wrap .fq-filter { max-width: 100%; }
  .fq-filters.is-wrap .fq-filter.is-fill { flex: 1 1 0; min-width: 0; }
  .fq-filters.is-wrap .fq-filter.is-fill select { flex: 1 1 auto; width: 0; min-width: 0; max-width: none; }
  .fq-filters.is-wrap:has(> .fq-filter.is-compact) .fq-search { flex-basis: calc(100% - var(--ctl-h) - 8px); }
  .fq-filter.is-compact { order: -1; position: relative; flex: 0 0 var(--ctl-h); width: var(--ctl-h); padding: 0; justify-content: center; }
  .fq-filter.is-compact select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; cursor: pointer; }
  .fq-filter.is-compact:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
  .fq-toolbar { flex-wrap: wrap; row-gap: 8px; }
  .fq-toolbar > .fq-tabs { width: 100%; }
  .fq-toolbar > .fq-search { flex: 1 1 100%; max-width: none !important; }
}

/* ═══ Таблица ═══ */
.fq-table-wrap { overflow-x: auto; position: relative; }
.fq-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.fq-table th { position: relative; z-index: 2; height: 40px; padding: 0 12px; text-align: left; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--line); }
/* Шапка держится при прокрутке (fabriq.js: layoutHeads). Таблица влезает — липнет сама (sticky у thead, отступ сверху —
   --fq-head-top: высота верхней панели или 0 в блоке со своей прокруткой), обёртка тогда без прокрутки (.is-fit).
   Шире — обёртка прокручивается вбок, а над экраном встаёт прибитая копия шапки .fq-headclone. */
.fq-table thead, table[data-sticky-head] thead { position: sticky; top: var(--fq-head-top, 0px); z-index: 3; }
table[data-sticky-head] thead th { background: var(--surface); }
.fq-head-wrap.is-fit { overflow: visible; -webkit-mask-image: none; mask-image: none; }
.fq-headclone { position: fixed; z-index: 29; overflow: hidden; display: none; box-shadow: var(--shadow-2); }
.fq-headclone.is-on { display: block; }
.fq-headclone > table { table-layout: fixed; margin: 0; }
.fq-headclone > table:not(.fq-table) th { background: var(--surface); }
.fq-table th.is-sort { cursor: pointer; user-select: none; }
.fq-table th.is-sort::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; opacity: .5;
  background: currentColor; clip-path: polygon(50% 0, 100% 40%, 0 40%, 50% 0, 0 60%, 100% 60%, 50% 100%); vertical-align: -1px; }
.fq-table th.is-sorted-down::after { opacity: 1; clip-path: polygon(0 30%, 100% 30%, 50% 90%); }
.fq-table th.is-sorted-up::after { opacity: 1; clip-path: polygon(50% 10%, 100% 70%, 0 70%); }
.fq-table td { height: 44px; padding: 6px 12px; border-bottom: 1px solid var(--line-2); color: var(--text); vertical-align: middle; white-space: nowrap; }
.fq-table td.wrap, .fq-table td .wrap { white-space: normal; }
.fq-table .cell-sub { white-space: normal; min-width: 0; }
.fq-table .num .cell-sub, .fq-table .t-right .cell-sub, .fq-table .t-nowrap { white-space: nowrap; }
.fq-table-wrap.is-scroll:not(.is-end) { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
/* Обрезка в ячейке: на широком экране места больше (до 1714px — 240). :where — своя ширина страницы
   (.op-desc { max-width: … }) перебивает общую, а не проигрывает ей по весу. */
:where(.fq-table) .t-ellipsis { display: block; max-width: clamp(240px, 14vw, 480px); overflow: hidden; text-overflow: ellipsis; }
.fq-table th:first-child, .fq-table td:first-child { padding-left: 18px; }
.fq-table th:last-child, .fq-table td:last-child { padding-right: 18px; }
.fq-table tbody tr { transition: background var(--t-fast); }
.fq-table.is-zebra tbody tr:nth-child(even) { background: var(--zebra); }
.fq-table tbody tr:hover { background: var(--hover); }
.fq-table tbody tr.is-selected { background: var(--selected); }
.fq-table tbody tr.is-cancel td { color: var(--s-cancel-tx); }
.fq-table tbody tr.is-muted td { color: var(--muted); }
.fq-table tbody tr.is-link { cursor: pointer; }
.fq-table tbody tr.is-attention td:first-child { box-shadow: inset 3px 0 0 var(--s-warn-dot); }
.fq-table tbody tr.is-danger td:first-child { box-shadow: inset 3px 0 0 var(--s-bad-dot); }
.fq-table tbody tr:last-child td { border-bottom: 0; }
.fq-table .num, .fq-table .t-right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fq-table th.num { text-align: right; }
.fq-table .t-center { text-align: center; }
.fq-table .is-check { width: 44px; padding-right: 0; }
.fq-table .is-actions { width: 1%; white-space: nowrap; text-align: right; }
.fq-table .row-actions { display: inline-flex; gap: 4px; align-items: center; justify-content: flex-end; }
.fq-table .row-actions .fq-iconbtn { opacity: .55; transition: opacity var(--t); }
.fq-table tr:hover .row-actions .fq-iconbtn { opacity: 1; }
.fq-table .cell-main { font-weight: 600; color: var(--text); }
.fq-table .cell-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
/* Комментарий к позиции заявки на закуп — строкой под названием (_plan_item_comment.html, кабинет снабженца). */
.plan-cmt { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; font-size: 12.5px; font-weight: 500; line-height: 1.35;
  color: var(--text-2); white-space: normal; overflow-wrap: anywhere; text-align: left; }
.plan-cmt .fq-i { width: 13px; height: 13px; margin-top: 2px; color: var(--accent-ink); }
.fq-table .cell-link { color: var(--link); font-weight: 600; }
.fq-table .cell-link:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 3px; }
.fq-table tfoot td { background: var(--surface-3); font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; height: 46px; }
.fq-table tr.is-group td { background: var(--bg-2); font-weight: 700; color: var(--text-2); height: 34px; font-size: 12.5px; }
.fq-table.is-compact td { height: 36px; padding-top: 3px; padding-bottom: 3px; }
.fq-table.is-compact th { height: 36px; }
.fq-table.is-comfy td { height: 56px; }
.fq-table .fq-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--line-2); }
.fq-table-foot { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.fq-table-foot .fq-pager { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.fq-pager button, .fq-pager a { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  color: var(--text-2); font-weight: 600; font-size: 13px; display: inline-grid; place-items: center; }
.fq-pager .is-on { background: var(--surface-2); border-color: var(--line); color: var(--text); box-shadow: var(--shadow-1); }
.fq-pager button:hover { background: var(--hover); }

/* Панель массовых действий */
.fq-bulkbar { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); display: none; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px; border-radius: 14px; background: #121A2B; color: #F4F0E7; box-shadow: var(--shadow-pop); font-size: 13.5px; }
.fq-bulkbar.is-on { display: flex; animation: fq-pop .25s var(--ease-spring) both; }
.fq-bulkbar b { color: #F6E7C8; }
.fq-bulkbar .fq-btn { --b-bg: rgba(255,255,255,.06); --b-tx: #F4F0E7; --b-line: rgba(255,255,255,.1); --b-hover: rgba(255,255,255,.12); box-shadow: none; }
@media (max-width: 767px) {
  .fq-bulkbar { left: 12px; right: 12px; transform: none; bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
}
.fq-bulkbar .fq-btn.is-gold { --b-bg: var(--accent); --b-tx: #0B1220; --b-line: var(--accent); --b-hover: #D4B57B; }

/* Таблица → карточки на телефоне */
@media (max-width: 767px) {
  .fq-table.is-cards thead { display: none; }
  .fq-table.is-cards, .fq-table.is-cards tbody { display: block; }
  .fq-table.is-cards tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 3px;
    padding: 13px 16px; border-bottom: 1px solid var(--line-2); background: transparent !important; position: relative; }
  .fq-table.is-cards tbody tr:last-child { border-bottom: 0; }
  .fq-table.is-cards td { display: block; height: auto; padding: 0 !important; border: 0; min-width: 0; text-align: left; white-space: normal; }
  .fq-table.is-cards td.m-foot .fq-iconbtn:not([data-menu]) { display: none; }
  .fq-table.is-cards .cell-sub { white-space: normal !important; }
  .fq-table.is-cards td.m-foot:not(:has(.fq-btn, .fq-status, .fq-chip, .fq-badge, .fq-iconbtn[data-menu])) { display: none; }
  .fq-table.is-cards td.m-title { grid-column: 1; font-weight: 600; font-size: 14.5px; }
  .fq-table.is-cards td.m-aside { grid-column: 2; grid-row: 1 / span 2; text-align: right; align-self: start; }
  .fq-table.is-cards td.m-sub { grid-column: 1; color: var(--muted); font-size: 13px; }
  .fq-table.is-cards td.m-meta { grid-column: 1 / -1; color: var(--text-2); font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
  .fq-table.is-cards td.m-meta[data-label]::before { content: attr(data-label) ":"; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
  .fq-table.is-cards td.m-foot { grid-column: 1 / -1; margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
  .fq-table.is-cards td.m-foot .row-actions { justify-content: flex-start; }
  .fq-table.is-cards td.m-foot .row-actions .fq-iconbtn { opacity: 1; }
  .fq-table.is-cards td.m-hide, .fq-table.is-cards td.is-check { display: none; }
  .fq-table.is-cards td.num, .fq-table.is-cards td.t-right { text-align: left; }
  .fq-table.is-cards td.m-aside.num { text-align: right; }
  .fq-table.is-cards tbody tr.is-attention { box-shadow: inset 3px 0 0 var(--s-warn-dot); }
  .fq-table.is-cards tbody tr.is-danger { box-shadow: inset 3px 0 0 var(--s-bad-dot); }
  .fq-table.is-cards tbody tr.is-attention td:first-child, .fq-table.is-cards tbody tr.is-danger td:first-child { box-shadow: none; }
  .fq-table.is-cards tfoot { display: block; }
  .fq-table.is-cards tfoot tr { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--surface-3); }
  .fq-table.is-cards tfoot td { height: auto; padding: 0; background: none; border: 0; }
  .fq-table.is-cards tfoot td.m-hide { display: none; }
  .fq-table-foot { padding: 11px 16px; }
  .fq-table-foot .fq-pager { margin-left: 0; width: 100%; justify-content: center; }
}

/* ═══ Список «ключ — значение» ═══ */
.fq-dl { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 0; font-size: 13.5px; }
.fq-dl dt { color: var(--muted); padding: 9px 0; border-bottom: 1px dashed var(--line-2); }
.fq-dl dd { margin: 0; padding: 9px 0; border-bottom: 1px dashed var(--line-2); color: var(--text); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.fq-dl dt:last-of-type, .fq-dl dd:last-of-type { border-bottom: 0; }
.fq-dl.is-left dd { text-align: left; }
.fq-dl .is-total { font-weight: 700; font-size: 15px; color: var(--text); }
.fq-sumrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13.5px; }
.fq-sumrow + .fq-sumrow { border-top: 1px dashed var(--line-2); }
.fq-sumrow .l { color: var(--muted); }
.fq-sumrow .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.fq-sumrow.is-total { border-top: 1px solid var(--line) !important; padding-top: 12px; margin-top: 4px; }
.fq-sumrow.is-total .l { color: var(--text); font-weight: 600; }
.fq-sumrow.is-total .v { font: 700 20px/1 var(--fq-display); }

/* ═══ Лента событий ═══ */
.fq-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.fq-timeline li { position: relative; padding: 0 0 16px 28px; font-size: 13.5px; }
.fq-timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -2px; width: 1.5px; background: var(--line); }
.fq-timeline li:last-child::before { display: none; }
.fq-timeline li::after { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 2.5px var(--line-strong); }
.fq-timeline li.is-ok::after { box-shadow: inset 0 0 0 2.5px var(--s-ok-dot); }
.fq-timeline li.is-info::after { box-shadow: inset 0 0 0 2.5px var(--s-info-dot); }
.fq-timeline li.is-warn::after { box-shadow: inset 0 0 0 2.5px var(--s-warn-dot); }
.fq-timeline li.is-bad::after { box-shadow: inset 0 0 0 2.5px var(--s-bad-dot); }
.fq-timeline li.is-gold::after { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fq-timeline .tl-title { font-weight: 600; color: var(--text); }
.fq-timeline .tl-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ═══ Прогресс и этапы ═══ */
.fq-progress { height: 8px; border-radius: 6px; background: var(--bg-2); overflow: hidden; position: relative; min-width: 60px; }
.fq-progress > span { display: block; height: 100%; border-radius: 6px; background: var(--primary); width: var(--v, 0%);
  transition: width .9s var(--ease); }
[data-theme="dark"] .fq-progress > span { background: var(--accent); }
.fq-progress.is-gold > span { background: linear-gradient(90deg, #B8924F, #D9BC82); }
.fq-progress.is-ok > span { background: var(--s-ok-dot); }
.fq-progress.is-warn > span { background: var(--s-warn-dot); }
.fq-progress.is-bad > span { background: var(--s-bad-dot); }
.fq-progress.is-info > span { background: var(--s-info-dot); }
.fq-progress.is-thin { height: 5px; }
.fq-progress.is-thick { height: 12px; border-radius: 8px; }
.fq-progress-row { display: flex; align-items: center; gap: 10px; }
.fq-progress-row .fq-progress { flex: 1; }
.fq-progress-row .v { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }
.fq-ring { --p: 0; --size: 52px; --w: 6px; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center;
  background: conic-gradient(var(--ring-c, var(--accent)) calc(var(--p) * 1%), var(--bg-2) 0); position: relative; flex-shrink: 0; }
.fq-ring::before { content: ""; position: absolute; inset: var(--w); border-radius: 50%; background: var(--surface); }
.fq-ring > span { position: relative; font: 700 12.5px/1 var(--fq-display); font-variant-numeric: tabular-nums; }
/* Цепочка этапов */
.fq-stages { display: flex; align-items: stretch; gap: 0; overflow-x: auto; scrollbar-width: none; }
.fq-stages::-webkit-scrollbar { display: none; }
.fq-stage { flex: 1 1 0; min-width: 120px; position: relative; padding: 10px 12px 10px 22px; background: var(--surface-3);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); margin-right: -6px; }
.fq-stage:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; border-radius: 10px 0 0 10px; }
.fq-stage:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); border-radius: 0 10px 10px 0; margin-right: 0; }
.fq-stage .st-name { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.fq-stage .st-val { font: 700 17px/1.2 var(--fq-display); color: var(--text); font-variant-numeric: tabular-nums; }
.fq-stage .st-sub { font-size: 11.5px; color: var(--muted); }
.fq-stage.is-done { background: var(--s-ok-bg); } .fq-stage.is-done .st-name { color: var(--s-ok-tx); }
.fq-stage.is-now { background: var(--primary); } .fq-stage.is-now .st-name, .fq-stage.is-now .st-sub { color: color-mix(in srgb, var(--on-primary) 75%, transparent); }
.fq-stage.is-now .st-val { color: var(--on-primary); }
/* Шаги мастера */
.fq-steps { display: flex; align-items: center; gap: 8px; counter-reset: step; flex-wrap: wrap; }
.fq-step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.fq-step::before { counter-increment: step; content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line); }
.fq-step.is-done::before { content: "✓"; background: var(--s-ok-bg); color: var(--s-ok-tx); border-color: transparent; }
.fq-step.is-now { color: var(--text); }
.fq-step.is-now::before { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.fq-step-sep { width: 28px; height: 1.5px; background: var(--line); }

/* ═══ Пустое состояние, загрузка ═══ */
/* white-space: normal — внутри ячейки таблицы (nowrap) текст иначе вылезает из блока строкой. */
.fq-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px; gap: 10px; white-space: normal; }
.fq-empty.is-sm { padding: 20px 12px; gap: 6px; }
.fq-empty.is-sm h3 { font-size: 14.5px; }
.fq-empty-art { width: 120px; height: 96px; margin-bottom: 6px; }
/* Рисунок {% empty_art %} — маска (art/*.png, scripts/build_photos.py), цвет — переменной: сам подходит к обеим
   темам. Макеты рисуют тот же слот своим <svg> — ему маска и фон не нужны. */
span.fq-empty-art { flex-shrink: 0; background: var(--faint);
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.fq-empty-art.a-hanger { -webkit-mask-image: url("art/hanger.png"); mask-image: url("art/hanger.png"); }
.fq-empty-art.a-shelf { -webkit-mask-image: url("art/shelf.png"); mask-image: url("art/shelf.png"); }
.fq-empty-art.a-search { -webkit-mask-image: url("art/search.png"); mask-image: url("art/search.png"); }
.fq-empty-art.a-scissors { -webkit-mask-image: url("art/scissors.png"); mask-image: url("art/scissors.png"); }
.fq-empty-art.a-stack { -webkit-mask-image: url("art/stack.png"); mask-image: url("art/stack.png"); }
.fq-empty-art.a-thimble { -webkit-mask-image: url("art/thimble.png"); mask-image: url("art/thimble.png"); }
.fq-empty-art.a-dressform { -webkit-mask-image: url("art/dressform.png"); mask-image: url("art/dressform.png"); }
.fq-empty-art.a-ledger { -webkit-mask-image: url("art/ledger.png"); mask-image: url("art/ledger.png"); }
.fq-empty-art.a-pattern { -webkit-mask-image: url("art/pattern.png"); mask-image: url("art/pattern.png"); }
.fq-empty-art.a-tangle { -webkit-mask-image: url("art/tangle.png"); mask-image: url("art/tangle.png"); }
.fq-empty-art.a-lock { -webkit-mask-image: url("art/lock.png"); mask-image: url("art/lock.png"); }
.fq-empty-art.a-machine { -webkit-mask-image: url("art/machine.png"); mask-image: url("art/machine.png"); }
.fq-empty-art.a-bundle { -webkit-mask-image: url("art/bundle.png"); mask-image: url("art/bundle.png"); }
.fq-empty-art.a-parcel { -webkit-mask-image: url("art/parcel.png"); mask-image: url("art/parcel.png"); }
.fq-empty-art.a-calendar { -webkit-mask-image: url("art/calendar.png"); mask-image: url("art/calendar.png"); }
/* Экраны ошибок и «нет доступа»: рисунок крупнее, цвет — --muted (рисунок там главный). */
span.fq-empty-art.is-lg { width: 180px; height: 144px; background: var(--muted); }
.fq-ph .fq-empty-art { width: 72%; height: 72%; max-width: 120px; margin: 0; background: var(--muted); }
/* Миниатюра «нет фото» (30–40px): рисунок из art/sm/ с линией толще и цветом темнее — тонкая линия там тает. */
span.fq-empty-art.is-sm { width: 82%; height: 82%; margin: 0; background: var(--muted); }
.fq-empty-art.is-sm.a-hanger { -webkit-mask-image: url("art/sm/hanger.png"); mask-image: url("art/sm/hanger.png"); }
.fq-empty-art.is-sm.a-shelf { -webkit-mask-image: url("art/sm/shelf.png"); mask-image: url("art/sm/shelf.png"); }
.fq-empty-art.is-sm.a-search { -webkit-mask-image: url("art/sm/search.png"); mask-image: url("art/sm/search.png"); }
.fq-empty-art.is-sm.a-scissors { -webkit-mask-image: url("art/sm/scissors.png"); mask-image: url("art/sm/scissors.png"); }
.fq-empty-art.is-sm.a-stack { -webkit-mask-image: url("art/sm/stack.png"); mask-image: url("art/sm/stack.png"); }
.fq-empty-art.is-sm.a-thimble { -webkit-mask-image: url("art/sm/thimble.png"); mask-image: url("art/sm/thimble.png"); }
.fq-empty-art.is-sm.a-dressform { -webkit-mask-image: url("art/sm/dressform.png"); mask-image: url("art/sm/dressform.png"); }
.fq-empty-art.is-sm.a-ledger { -webkit-mask-image: url("art/sm/ledger.png"); mask-image: url("art/sm/ledger.png"); }
.fq-empty-art.is-sm.a-pattern { -webkit-mask-image: url("art/sm/pattern.png"); mask-image: url("art/sm/pattern.png"); }
.fq-empty-art.is-sm.a-tangle { -webkit-mask-image: url("art/sm/tangle.png"); mask-image: url("art/sm/tangle.png"); }
.fq-empty-art.is-sm.a-lock { -webkit-mask-image: url("art/sm/lock.png"); mask-image: url("art/sm/lock.png"); }
.fq-empty-art.is-sm.a-machine { -webkit-mask-image: url("art/sm/machine.png"); mask-image: url("art/sm/machine.png"); }
.fq-empty-art.is-sm.a-bundle { -webkit-mask-image: url("art/sm/bundle.png"); mask-image: url("art/sm/bundle.png"); }
.fq-empty-art.is-sm.a-parcel { -webkit-mask-image: url("art/sm/parcel.png"); mask-image: url("art/sm/parcel.png"); }
.fq-empty-art.is-sm.a-calendar { -webkit-mask-image: url("art/sm/calendar.png"); mask-image: url("art/sm/calendar.png"); }
.fq-empty h3 { font: 700 17px/1.3 var(--fq-display); }
.fq-empty p { color: var(--muted); max-width: 380px; font-size: 13.5px; }
.fq-skel { border-radius: 6px; background: var(--skel); min-height: 12px; position: relative; overflow: hidden; }
.fq-skel::after, .fq-cmd-skel i::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--skel-hi), transparent); animation: fq-shimmer 1.4s linear infinite; will-change: transform; }
.fq-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: fq-spin .7s linear infinite; }

/* ═══ Окна: модальное, боковое, шторка ═══ */
.fq-overlay { position: fixed; inset: 0; z-index: 90; display: none; }
.fq-overlay.is-open { display: block; }
.fq-overlay > .fq-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fq-fade .2s var(--ease) both; }
.fq-modal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
  animation: fq-modal .26s var(--ease) both; }
.fq-modal.is-lg { width: min(860px, calc(100vw - 32px)); }
.fq-modal.is-anchored { transform: none; width: min(440px, calc(100vw - 24px)); animation: fq-pop .18s var(--ease) both; }
.fq-modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; }
.fq-modal-head h3 { font: 700 18px/1.3 var(--fq-display); }
.fq-modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.fq-modal-head .fq-iconbtn { margin-left: auto; }
.fq-modal-body { padding: 4px 20px 18px; overflow-y: auto; }
.fq-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-2); background: var(--surface-3);
  border-radius: 0 0 var(--r-xl) var(--r-xl); }
.fq-drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: fq-drawer .3s var(--ease) both; }
.fq-drawer .fq-modal-body { flex: 1; }
.fq-drawer .fq-modal-foot { border-radius: 0; }
@media (max-width: 767px) {
  .fq-modal, .fq-drawer { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0;
    animation: fq-sheet .32s var(--ease) both; border-left: 0; }
  .fq-modal::before, .fq-drawer::before { content: ""; width: 40px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; flex-shrink: 0; }
  .fq-modal.is-lg { width: 100%; }   /* большое окно на телефоне — та же шторка во всю ширину */
  .fq-modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .fq-modal-foot .fq-btn { flex: 1; height: 48px; }
}
@keyframes fq-modal { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }
@keyframes fq-drawer { from { transform: translateX(100%); } }
@keyframes fq-sheet { from { transform: translateY(100%); } }

/* Всплывающее меню */
.fq-menu { position: absolute; z-index: 70; min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: var(--shadow-pop); display: none; animation: fq-pop .18s var(--ease) both; }
.fq-menu.is-open { display: block; }
.fq-menu a, .fq-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13.5px; font-weight: 500; text-align: left; }
.fq-menu a:hover, .fq-menu button:hover { background: var(--hover); color: var(--text); }
.fq-menu .fq-i { width: 16px; height: 16px; color: var(--muted); }
.fq-menu .is-danger { color: var(--money-out); } .fq-menu .is-danger .fq-i { color: var(--money-out); }
.fq-menu hr { border: 0; height: 1px; background: var(--line-2); margin: 6px 4px; }
.fq-menu .fq-menu-label { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 8px 10px 4px; }
.fq-menu .is-checked::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: var(--accent-ink);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }

/* Уведомление */
.fq-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 95; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.fq-toast { display: flex; align-items: center; gap: 12px; min-width: 300px; max-width: 420px; padding: 12px 12px 12px 14px; border-radius: 12px;
  background: #121A2B; color: #F1EDE4; box-shadow: var(--shadow-pop); font-size: 13.5px; animation: fq-toast .32s var(--ease-spring) both; }
.fq-toast .fq-i { color: #7FD3A2; }
.fq-toast.is-bad .fq-i { color: #F09A8E; }
.fq-toast .fq-toast-act { margin-left: auto; color: #E2C48A; font-weight: 600; background: none; border: 0; }
@keyframes fq-toast { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@media (max-width: 767px) { .fq-toasts { left: 12px; right: 12px; bottom: calc(var(--tab-h) + 12px); } .fq-toast { min-width: 0; width: 100%; } }
/* Внизу панель с кнопками (липкая .fq-savebar, .mobile-cta) — уведомление встаёт над ней, а не закрывает «Сохранить». */
body:has(.fq-savebar) .fq-toasts, body:has(.mobile-cta) .fq-toasts { bottom: 88px; }
@media (max-width: 767px) { body:has(.fq-savebar) .fq-toasts, body:has(.mobile-cta) .fq-toasts, body:has(.fq-fab) .fq-toasts { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 84px); } }

/* Командная строка (Ctrl+K) */
.fq-cmd-overlay > .fq-backdrop { backdrop-filter: blur(6px) saturate(1.1); -webkit-backdrop-filter: blur(6px) saturate(1.1); }
.fq-cmd { position: absolute; left: 50%; top: 10vh; transform: translateX(-50%); width: min(720px, calc(100vw - 24px)); border-radius: 20px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: var(--shadow-pop), 0 0 0 1px rgba(201,168,106,.08); overflow: hidden;
  display: flex; flex-direction: column; max-height: min(78vh, 680px); animation: fq-cmd-in .22s var(--ease) both; }
@keyframes fq-cmd-in { from { opacity: 0; transform: translate(-50%, -8px) scale(.985); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.fq-cmd-input { position: relative; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 20px; height: 64px; border-bottom: 1px solid var(--line-2); flex: none; }
.fq-cmd-input > .fq-i { width: 22px; height: 22px; color: var(--accent-ink); }
.fq-cmd-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 500 17px var(--fq-font); color: var(--text); }
.fq-cmd-input input::placeholder { color: var(--faint); font-weight: 400; }
.fq-cmd-close { border: 0; background: transparent; padding: 0; cursor: pointer; }
.fq-cmd-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); opacity: 0; transition: opacity .15s; }
.fq-cmd-overlay.is-loading .fq-cmd-spin { opacity: 1; animation: fq-spin .7s linear infinite; }
.fq-cmd-input::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.fq-cmd-overlay.is-loading .fq-cmd-input::after { animation: fq-cmd-bar 1s var(--ease) infinite; }
@keyframes fq-cmd-bar { from { transform: scaleX(0); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }

.fq-cmd-scopes { display: flex; align-items: center; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; flex: none; background: var(--surface); }
.fq-cmd-scopes::-webkit-scrollbar { display: none; }
.fq-cmd-scopes-l { font-size: 12px; color: var(--faint); white-space: nowrap; margin-right: 4px; }
.fq-cmd-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: var(--r-full); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-2); font: 500 13px var(--fq-font); white-space: nowrap; cursor: pointer; transition: background var(--t), border-color var(--t), color var(--t); }
.fq-cmd-chip .fq-i { width: 14px; height: 14px; color: var(--muted); }
.fq-cmd-chip span { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.fq-cmd-chip:hover { border-color: var(--line-strong); color: var(--text); }
.fq-cmd-chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.fq-cmd-chip.is-on .fq-i, .fq-cmd-chip.is-on span { color: var(--primary-icon); }

.fq-cmd-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 8px 10px; overscroll-behavior: contain; }
.fq-cmd-group { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 12px 12px 6px; }
.fq-cmd-more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--link); }
.fq-cmd-more .fq-i { width: 13px; height: 13px; }
.fq-cmd-item { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 7px 10px; border-radius: 12px; color: var(--text); cursor: pointer; position: relative; }
.fq-cmd-item:hover { color: var(--text); }
.fq-cmd-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--s-neutral-bg); color: var(--s-neutral-tx); }
.fq-cmd-ic .fq-i { width: 18px; height: 18px; }
.fq-cmd-ic.t-info { background: var(--s-info-bg); color: var(--s-info-tx); }
.fq-cmd-ic.t-ok { background: var(--s-ok-bg); color: var(--s-ok-tx); }
.fq-cmd-ic.t-warn { background: var(--s-warn-bg); color: var(--s-warn-tx); }
.fq-cmd-ic.t-bad { background: var(--s-bad-bg); color: var(--s-bad-tx); }
.fq-cmd-ic.t-progress { background: var(--s-progress-bg); color: var(--s-progress-tx); }
.fq-cmd-ic.t-teal { background: var(--s-teal-bg); color: var(--s-teal-tx); }
.fq-cmd-ic.t-gold { background: var(--s-gold-bg); color: var(--s-gold-tx); }
.fq-cmd-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fq-cmd-txt b { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-cmd-txt small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-cmd-txt mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -1px 0 var(--accent-line); }
.fq-cmd-go { color: var(--faint); opacity: 0; transform: translateX(-4px); transition: opacity var(--t), transform var(--t); }
.fq-cmd-go .fq-i { width: 16px; height: 16px; }
.fq-cmd-item.is-on { background: var(--hover); }
.fq-cmd-item.is-on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.fq-cmd-item.is-on .fq-cmd-go { opacity: 1; transform: none; color: var(--accent-ink); }

.fq-cmd-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 28px 34px; color: var(--muted); }
.fq-cmd-empty > .fq-i { width: 30px; height: 30px; color: var(--accent-ink); }
.fq-cmd-empty b { font: 700 16px var(--fq-display); color: var(--text); }
.fq-cmd-empty p { max-width: 460px; font-size: 13px; line-height: 1.5; }
.fq-cmd-skel { padding: 8px 4px; display: flex; flex-direction: column; gap: 8px; }
.fq-cmd-skel i { height: 46px; border-radius: 12px; background: var(--surface-3); position: relative; overflow: hidden; --skel-hi: var(--hover); }

.fq-cmd-foot { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); background: var(--surface-3); flex: none; }
.fq-cmd-foot kbd { margin-right: 3px; }
.fq-cmd-foot-r { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.fq-cmd-foot-r .fq-i { width: 13px; height: 13px; }
@media (max-width: 767px) {
  .fq-cmd { top: 0; width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; animation: none; }
  .fq-cmd-input { height: 60px; padding-left: 16px; }
  .fq-cmd-input input { font-size: 16px; }
  .fq-cmd-item { min-height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .fq-cmd { animation: none; } .fq-cmd-overlay.is-loading .fq-cmd-input::after { animation: none; } }

/* ═══ Канбан ═══ */
.fq-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.fq-col { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 200px; }
.fq-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.fq-col-head .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c7); }
.fq-col-head b { font-size: 13.5px; }
.fq-col-head .fq-count { margin-left: 2px; }
.fq-col-head .sum { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fq-col-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px; }
.fq-kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 12px; box-shadow: var(--shadow-1); cursor: grab;
  transition: transform var(--t) var(--ease), box-shadow var(--t); display: flex; flex-direction: column; gap: 8px; }
.fq-kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.fq-kcard .k-title { font-weight: 600; font-size: 13.5px; color: var(--text); }
.fq-kcard .k-sub { font-size: 12.5px; color: var(--muted); }
.fq-kcard .k-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.fq-kcard .k-foot .fq-avatar { margin-left: auto; }
.fq-kcard.is-ghost { border-style: dashed; background: transparent; box-shadow: none; color: var(--muted); align-items: center; justify-content: center; min-height: 48px; cursor: pointer; flex-direction: row; }
@media (max-width: 767px) { .fq-board { grid-auto-columns: 86%; scroll-snap-type: x mandatory; } .fq-col { scroll-snap-align: start; } }

/* ═══ Календарь ═══ */
.fq-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.fq-cal-dow { padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line-2); background: var(--surface-3); }
.fq-cal-day { min-height: 112px; padding: 8px 10px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.fq-cal-day:nth-child(7n) { border-right: 0; }
.fq-cal-day .d { font: 600 13px/1 var(--fq-display); color: var(--text-2); margin-bottom: 4px; display: flex; align-items: center; justify-content: space-between; }
.fq-cal-day.is-out { background: var(--surface-3); } .fq-cal-day.is-out .d { color: var(--faint); }
.fq-cal-day.is-weekend .d { color: var(--muted); }
.fq-cal-day.is-today .d span { width: 26px; height: 26px; margin: -6px 0 -4px -6px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: var(--on-primary); }
.fq-cal-ev { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden;
  background: var(--s-neutral-bg); color: var(--s-neutral-tx); font-variant-numeric: tabular-nums; }
.fq-cal-ev.is-in { background: var(--s-ok-bg); color: var(--s-ok-tx); }
.fq-cal-ev.is-out { background: var(--s-bad-bg); color: var(--s-bad-tx); }
.fq-cal-ev.is-plan { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.fq-cal-ev.is-info { background: var(--s-info-bg); color: var(--s-info-tx); }
@media (max-width: 767px) { .fq-cal-day { min-height: 64px; padding: 6px; } .fq-cal-ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; } }

/* ═══ Графики ═══ */
.fq-chart { width: 100%; position: relative; }
.fq-chart svg { width: 100%; height: 100%; overflow: visible; }
.fq-chart .grid line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.fq-chart .axis text { fill: var(--muted); font: 500 11px var(--fq-font); font-variant-numeric: tabular-nums; }
.fq-chart .area { opacity: .16; }
.fq-chart .line { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.fq-chart .bar { transition: opacity var(--t); }
.fq-chart .bar:hover { opacity: .8; }
.fq-chart .dot { stroke: var(--surface); stroke-width: 2; }
.fq-chart-tip { position: absolute; pointer-events: none; z-index: 5; padding: 8px 10px; border-radius: 9px; background: #121A2B; color: #F1EDE4;
  font-size: 12px; box-shadow: var(--shadow-pop); white-space: nowrap; opacity: 0; transform: translate(-50%, -110%); transition: opacity .12s; }
.fq-chart-tip b { color: #F6E7C8; font-variant-numeric: tabular-nums; }
.fq-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.fq-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fq-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.fq-bars-h { display: flex; flex-direction: column; gap: 10px; }
.fq-bar-h { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.fq-bar-h .l { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-bar-h .track { height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.fq-bar-h .track span { display: block; height: 100%; border-radius: 5px; background: var(--c1); width: var(--v); transition: width 1s var(--ease); }
[data-theme="dark"] .fq-bar-h .track span { background: var(--c1); }
.fq-bar-h .v { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }

/* ═══ Цех: крупные элементы для пальцев и сканера ═══ */
.fq-terminal { --ctl-h: 52px; font-size: 15px; }
.fq-terminal .fq-btn { border-radius: 12px; font-size: 15px; }
.fq-stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; }
.fq-stepper button { height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; box-shadow: var(--shadow-1); transition: transform var(--t-fast), background var(--t); }
.fq-stepper button:active { transform: scale(.94); background: var(--hover); }
.fq-stepper button .fq-i { width: 26px; height: 26px; stroke-width: 2.2; }
.fq-stepper output, .fq-stepper input { height: 64px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--surface-2);
  font: 800 34px/64px var(--fq-display); text-align: center; color: var(--text); font-variant-numeric: tabular-nums; width: 100%; }
.fq-stepper.is-sm { grid-template-columns: 30px 64px 30px; gap: 4px; width: max-content; }
.fq-stepper.is-sm button { height: 30px; border-radius: 8px; }
.fq-stepper.is-sm button .fq-i { width: 15px; height: 15px; }
.fq-stepper.is-sm output, .fq-stepper.is-sm input { height: 30px; border-radius: 8px; font: 700 14px/30px var(--fq-font); border-width: 1px; }
.fq-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fq-keypad button { height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); font: 700 24px/1 var(--fq-display);
  color: var(--text); box-shadow: var(--shadow-1); transition: transform var(--t-fast), background var(--t); }
.fq-keypad button:active { transform: scale(.95); background: var(--hover); }
.fq-keypad button.is-ok { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.fq-scan { position: relative; border-radius: 20px; border: 1.5px dashed var(--accent-line); background: var(--accent-soft); padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; overflow: hidden; }
.fq-scan .fq-scan-ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--primary); color: var(--primary-icon); }
.fq-scan .fq-scan-ic .fq-i { width: 32px; height: 32px; }
/* Полоска сканера стоит на месте — луч через середину значка, под содержимым. Бегущая по карточке полоска
   на части мониторов и слабых видеокартах мерцала поверх текста и поля ввода (жалоба 21.10), сдвиг вместо `top` не помог. */
.fq-scan > * { position: relative; }
.fq-scan::before { content: ""; position: absolute; left: 12%; right: 12%; top: 59px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .8; }
.fq-scan h3 { font: 700 19px/1.3 var(--fq-display); }
.fq-scan p { color: var(--muted); font-size: 14px; }
.fq-bigcount { font: 800 44px/1 var(--fq-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
/* Крупная сумма в форме кабинета («Мои расходы»): поле 60px, число Manrope 800 28px вправо, единица — .fq-addon. */
.fq-inputgroup.is-xl { height: 60px; border-radius: 14px; border-width: 1.5px; }
.fq-inputgroup.is-xl .fq-input { font: 800 28px/1 var(--fq-display); text-align: right; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; min-width: 0; }
.fq-inputgroup.is-xl .fq-addon { font-size: 15px; font-weight: 600; }

/* ═══ Выбор карточками (кабинет на телефоне: счёт, частая статья — «Мои расходы») ═══
   .fq-choices > .fq-choice — кнопка или label с radio внутри. Выбрана — .is-on или отмеченный radio; <b> — главное
   (число), <small> — под ним серым. .fq-choices.is-cards — сетка крупных карточек от 150px. */
.fq-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.fq-choices.is-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fq-choice { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 48px;
  padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; overflow-wrap: anywhere; min-width: 0;
  transition: border-color var(--t), box-shadow var(--t), background var(--t); }
.fq-choice:hover { border-color: var(--line-strong); }
.fq-choice input { position: absolute; opacity: 0; pointer-events: none; }
.fq-choice.is-on, .fq-choice:has(input:checked) { color: var(--text); border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft); }
.fq-choice:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.fq-choice b { font: 700 17px/1.2 var(--fq-display); font-variant-numeric: tabular-nums; color: var(--text); }
.fq-choice small { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.fq-choice.is-bad b { color: var(--money-out); }

/* ═══ Фото ═══ */
.fq-photo { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line-2); aspect-ratio: 1; }
.fq-photo img { width: 100%; height: 100%; object-fit: cover; }
.fq-photo .fq-photo-tag { position: absolute; left: 6px; bottom: 6px; padding: 3px 7px; border-radius: 6px; background: rgba(11,18,32,.72); color: #F4F0E7;
  font-size: 11px; font-weight: 600; backdrop-filter: blur(6px); }
.fq-photo .fq-photo-star { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(11,18,32,.6); color: var(--accent); }
.fq-photo-add { border: 1.5px dashed var(--line-strong); background: transparent; display: grid; place-items: center; color: var(--muted); aspect-ratio: 1;
  border-radius: 12px; transition: border-color var(--t), color var(--t), background var(--t); }
.fq-photo-add:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.fq-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint);
  background: repeating-linear-gradient(135deg, var(--surface-3) 0 10px, var(--bg-2) 10px 20px); }
/* Ряд миниатюр фото (задача, комментарий): квадраты 72px, на телефоне 64px; нажатие — фото на весь экран. */
.fq-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.fq-photos .fq-photo, .fq-photos .fq-photo-add { width: 72px; height: 72px; aspect-ratio: auto; padding: 0; cursor: pointer; }
.fq-photos .fq-photo-x { position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; border: 0; border-radius: 8px; display: grid;
  place-items: center; background: rgba(11,18,32,.66); color: #F4F0E7; }
.fq-photos .fq-photo-x .fq-i { width: 15px; height: 15px; }
@media (max-width: 767px) { .fq-photos .fq-photo, .fq-photos .fq-photo-add { width: 64px; height: 64px; } }

/* ═══ Список поручений (раздел «Задачи») ═══
   .fq-tasks > .fq-task: слева круглая кнопка «Готово» (.fq-task-done, касание 44px), дальше ссылка на карточку
   (.fq-task-main: .fq-task-title + .fq-task-meta). Просроченный срок — .is-late, снятая строка — .is-gone. */
.fq-tasks { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.fq-task { display: flex; align-items: flex-start; gap: 4px; border-top: 1px solid var(--line-2); transition: background var(--t), opacity var(--t-slow); }
.fq-task:first-child { border-top: 0; }
.fq-task:hover { background: var(--hover); }
.fq-task-main { flex: 1; min-width: 0; display: block; padding: 12px 16px 12px 14px; color: var(--text); text-decoration: none; }
.fq-task-done + .fq-task-main { padding-left: 2px; }
.fq-task-title { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.fq-task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.fq-task-meta > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.fq-task-meta .fq-i { width: 14px; height: 14px; flex: none; }
.fq-task-meta .fq-status { height: 20px; font-size: 11.5px; padding: 0 7px; }
.fq-task-meta .is-late { color: var(--money-out); font-weight: 600; }
.fq-task-done { flex: none; width: 48px; height: 48px; margin: 2px 0 0 2px; border: 0; border-radius: 50%; background: transparent; display: grid;
  place-items: center; color: var(--muted); cursor: pointer; }
.fq-task-done::before { content: ""; grid-area: 1 / 1; width: 22px; height: 22px; border-radius: 50%; border: 1.75px solid var(--line-strong);
  transition: background var(--t), border-color var(--t); }
.fq-task-done .fq-i { grid-area: 1 / 1; width: 13px; height: 13px; opacity: 0; transition: opacity var(--t); }
.fq-task-done:hover::before { border-color: var(--s-ok-dot); }
.fq-task-done:hover .fq-i { opacity: 1; color: var(--s-ok-tx); }
.fq-task-done.is-on::before { background: var(--s-ok-dot); border-color: var(--s-ok-dot); }
.fq-task-done.is-on .fq-i { opacity: 1; color: var(--surface); }
.fq-task.is-gone { opacity: .45; }
.fq-task.is-gone .fq-task-title { text-decoration: line-through; }

/* Шаги задачи с галочками: строка-флажок во всю ширину, касание не меньше 44px. */
.fq-checklist { display: flex; flex-direction: column; }
.fq-checklist .fq-check { min-height: 44px; padding: 6px 0; align-items: center; }
.fq-checklist > * + * { border-top: 1px dashed var(--line-2); }
.fq-checklist .fq-check.is-done span { color: var(--muted); text-decoration: line-through; }

/* Уведомления в колокольчике (шапка офиса и кабинетов со входом по логину, templates/fabriq/_bell.html):
   число непрочитанных у кнопки — .fq-top-badge, список — .fq-notice в .fq-drawer (на телефоне — шторка). */
.fq-top-btn .fq-top-badge { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: #D9493A; color: #fff; font: 600 10px/17px var(--fq-font); text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.fq-notices { display: flex; flex-direction: column; margin: 0 -20px; }
.fq-notice { display: block; position: relative; padding: 12px 20px 12px 36px; border-top: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.fq-notice:first-child { border-top: 0; }
.fq-notice:hover { background: var(--hover); }
.fq-notice.is-unread::before { content: ""; position: absolute; left: 16px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--s-info-dot); }
.fq-notice-title { font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.fq-notice:not(.is-unread) .fq-notice-title { font-weight: 500; color: var(--text-2); }
.fq-notice-body { margin-top: 2px; font-size: 13px; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.fq-notice-when { margin-top: 3px; font-size: 12px; color: var(--muted); }

/* ═══ Сетки и отступы ═══ */
.fq-grid { display: grid; gap: 16px; }
.fq-grid.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fq-grid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fq-grid.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fq-grid.g-main-aside { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.fq-grid.g-aside-main { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
.fq-grid.g-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.fq-grid.g-auto-sm { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
/* Форма не тянется на весь широкий экран: поле в 2 000 px читать и заполнять неудобно. */
.fq-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; max-width: 1440px; }
.fq-form-grid.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fq-form-grid .span-2 { grid-column: span 2; } .fq-form-grid .span-all { grid-column: 1 / -1; }
.fq-formsec { display: grid; grid-template-columns: 260px minmax(0, 1280px); gap: 28px; padding: 24px 0; border-top: 1px solid var(--line); }
.fq-formsec:first-child { border-top: 0; padding-top: 4px; }
.fq-formsec-info h3 { font: 700 15.5px/1.3 var(--fq-display); }
.fq-formsec-info p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.fq-formsec.is-full { grid-template-columns: minmax(0, 1fr); gap: 14px; }
.fq-formsec.is-full .fq-formsec-info { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.fq-formsec.is-full .fq-formsec-info > div { flex: 1 1 320px; }
.fq-formsec.is-full .fq-formsec-info p { max-width: 640px; }
.fq-savebar { position: sticky; bottom: 0; z-index: 20; margin: 24px calc(var(--page-x) * -1) -56px; padding: 12px var(--page-x);
  display: flex; align-items: center; gap: 10px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); }
.fq-savebar .fq-savebar-info { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.fq-savebar .fq-savebar-actions { margin-left: auto; display: flex; gap: 8px; }
.stack { display: flex; flex-direction: column; } .row { display: flex; align-items: center; } .wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; } .flex-1 { flex: 1; min-width: 0; } .w-100 { width: 100%; }
.p-0 { padding: 0 !important; } .p-16 { padding: 16px; } .p-20 { padding: 20px; }
.hr { height: 1px; background: var(--line-2); border: 0; margin: 14px 0; }
@media (max-width: 1279px) {
  .fq-grid.g-main-aside { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1023px) {
  .fq-grid.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fq-grid.g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fq-grid.g-main-aside, .fq-grid.g-aside-main { grid-template-columns: minmax(0, 1fr); }
  .fq-formsec { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 767px) {
  .fq-grid.g-2, .fq-grid.g-3, .fq-grid.g-4 { grid-template-columns: minmax(0, 1fr); }
  .fq-grid.g-4.keep-2, .fq-grid.g-3.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fq-form-grid, .fq-form-grid.g-3 { grid-template-columns: minmax(0, 1fr); }
  .fq-form-grid .span-2 { grid-column: auto; }
  .hide-mobile { display: none !important; }
  .fq-savebar { margin: 20px -16px calc(-1 * (var(--tab-h) + 32px)); padding-bottom: calc(12px + var(--tab-h) + env(safe-area-inset-bottom)); }
  .fq-savebar .fq-savebar-actions { width: 100%; } .fq-savebar .fq-savebar-actions .fq-btn { flex: 1; height: 48px; }
  .fq-savebar .fq-savebar-info { display: none; }
  /* Страница кабинета без нижних вкладок («Состав бригады» в офисе): места под панель не оставляем. */
  body.fq-cab:not(:has(.fq-tabbar)) .fq-savebar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.fq-cab:not(:has(.fq-tabbar)):has(.fq-savebar) .fq-toasts { bottom: calc(env(safe-area-inset-bottom) + 84px); }
}

@media (min-width: 768px) { .show-mobile { display: none !important; } }

/* ═══ Кабинет (телефонный каркас для цеха, снабжения, директора) ═══ */
.fq-cab { min-height: 100vh; background: var(--bg); }
.fq-cab-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 12px 0 16px;
  background: var(--glass); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line-2); }
.fq-cab-top .fq-cab-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.fq-cab-top .fq-cab-brand svg { width: 30px; height: 30px; flex-shrink: 0; }
.fq-cab-top .fq-cab-title { font: 700 16px/1.15 var(--fq-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fq-cab-top .fq-cab-title small { display: block; font: 500 12px/1.2 var(--fq-font); color: var(--muted); }
.fq-cab-body { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(var(--tab-h) + 40px); }
.fq-cab-body.is-wide { max-width: 1180px; }
.fq-cab-body.is-xwide { max-width: 1400px; }   /* список с широкой таблицей (модели и документы) */
@media (min-width: 768px) {
  .fq-cab .fq-tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 520px; border-radius: 18px; border: 1px solid var(--line);
    box-shadow: var(--shadow-pop); height: var(--tab-h); padding-bottom: 0; }
  .fq-cab .fq-tabbar .is-active::before { top: 0; }
  .fq-cab-body { padding: 24px 24px calc(var(--tab-h) + 56px); }
  /* Вкладки здесь — «таблетка» над низом экрана: липкая панель с кнопками встаёт над ней карточкой,
     а не под неё (закрывало «Добавить сотрудников» в «Составе бригады»). Уведомления — ещё выше. */
  body.fq-cab:has(.fq-tabbar) .fq-savebar { bottom: calc(var(--tab-h) + 28px); margin: 24px 0 0; padding: 12px 16px;
    border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-pop); }
  body.fq-cab:has(.fq-tabbar):has(.fq-savebar) .fq-toasts { bottom: calc(var(--tab-h) + 28px + 84px); }
}
.fq-cab .fq-tabbar a, .fq-cab .fq-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0;
  background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600; position: relative; }
.fq-cab .fq-tabbar .fq-i { width: 22px; height: 22px; }
.fq-cab .fq-tabbar .is-active { color: var(--text); }
.fq-cab .fq-tabbar .is-active .fq-i { color: var(--accent-ink); }
.fq-cab .fq-tabbar .is-active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--accent); }
.fq-cab .fq-tabbar .fq-tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: #D9493A; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.fq-cab .fq-tabbar .is-center { color: var(--muted); }
.fq-cab .fq-tabbar .is-center span.c { width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; background: var(--primary); display: grid; place-items: center;
  box-shadow: 0 10px 24px -8px rgba(11,18,32,.6), 0 0 0 4px var(--bg); }
.fq-cab .fq-tabbar .is-center span.c .fq-i { color: var(--primary-icon); width: 24px; height: 24px; }
.fq-cab .fq-tabbar .is-center::before { display: none; }
/* Переход по вкладкам кабинета (cabinet_base.html: @view-transition { navigation: auto }): шапка и нижние вкладки —
   свои слои и стоят на месте, меняется только содержимое (правила перехода — в «Движении»). При смене темы
   (html.fq-vt-theme) слоёв нет: круг идёт по всему экрану. */
.fq-cab .fq-cab-top { view-transition-name: fq-cab-top; }
.fq-cab .fq-tabbar { view-transition-name: fq-cab-tabs; }
html.fq-vt-theme .fq-cab-top, html.fq-vt-theme .fq-tabbar { view-transition-name: none; }
.fq-hello { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.fq-hello h1 { font: 800 24px/1.15 var(--fq-display); letter-spacing: -.02em; }
.fq-hello p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
/* Шапка первой вкладки кабинета (_cab_hero.html): фото роли справа, слева уходит в чернила под приветствие.
   Тёмная в обеих темах — цвета меню (--nav-*). */
.fq-cab-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 128px;
  margin-bottom: 18px; padding: 20px 22px; border-radius: 18px; background: var(--nav-bg); color: var(--nav-text-hi); }
/* Фото — в правых 62%: на узком экране иначе его закрывает затемнение под текстом. */
.fq-cab-hero-ph { position: absolute; top: 0; right: 0; z-index: -2; width: 62%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.fq-cab-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--nav-bg) 38%, color-mix(in srgb, var(--nav-bg) 55%, transparent) 54%, transparent 82%); }
.fq-cab-hero-t small { display: block; font: 600 12.5px/1 var(--fq-font); color: var(--nav-icon-active); letter-spacing: .02em; }
.fq-cab-hero-t b { display: block; font: 800 24px/1.15 var(--fq-display); letter-spacing: -.02em; margin-top: 8px; }
.fq-cab-hero-t span { display: block; font-size: 13.5px; color: var(--nav-text); margin-top: 4px; }
@media (max-width: 767px) {
  .fq-cab-hero { min-height: 112px; padding: 16px 18px; border-radius: 16px; margin-bottom: 14px; }
  .fq-cab-hero-t b { font-size: 21px; }
}

/* Экран входа */
.fq-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); background: var(--bg); }
.fq-auth-art { position: relative; overflow: hidden; background: #0B1220; color: #F4F0E7; padding: 40px 48px; display: flex; flex-direction: column; }
.fq-auth-art .fq-art-bg { position: absolute; inset: 0; }
.fq-auth-art > *:not(.fq-art-bg) { position: relative; }
.fq-auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.fq-auth-card { width: min(400px, 100%); }
.fq-auth-card h1 { font: 800 30px/1.15 var(--fq-display); letter-spacing: -.025em; }
.fq-auth-card .lead { color: var(--muted); margin-top: 8px; font-size: 14.5px; }
@media (max-width: 1023px) {
  .fq-auth { grid-template-columns: 1fr; }
  .fq-auth-art { min-height: 260px; padding: 28px 24px; }
}

/* ═══ Документ: просмотр и печать (static/fabriq/docview.js) ═══ */
.fq-docview { position: relative; min-height: 200px; }
.fq-docview.is-error { min-height: 0; }
.fq-docview-state { display: grid; place-items: center; min-height: 240px; }
/* Листы по ширине контейнера; крупнее ширины — листаются вбок внутри, вниз листается страница. */
.fq-docview-pages { overflow-x: auto; padding-bottom: 4px; }
.fq-docview-page { position: relative; margin: 0 auto 12px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 2px; box-shadow: var(--shadow-1); }
.fq-docview-page canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* Плашка масштаба — всегда тёмная (видна и на белом листе, и на льне), липнет к низу экрана. */
.fq-docview-bar { position: sticky; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 6; display: flex; align-items: center; gap: 2px;
  width: max-content; max-width: 100%; margin: 4px auto 0; padding: 4px; border-radius: 14px; background: var(--brand-ink); color: var(--brand-ivory);
  box-shadow: var(--shadow-pop); font-size: 13.5px; }
[data-theme="dark"] .fq-docview-bar { border: 1px solid var(--line); }
.fq-docview-bar button { display: inline-grid; place-items: center; min-width: 44px; height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: inherit; font: 600 13.5px/1 var(--fq-font); white-space: nowrap; transition: color var(--t), opacity var(--t); }
.fq-docview-bar button:hover, .fq-docview-bar button[aria-pressed="true"] { color: var(--brand-gold); }
.fq-docview-bar button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fq-docview-bar button[disabled] { opacity: .4; pointer-events: none; }
.fq-docview-bar .fq-i { width: 20px; height: 20px; }
.fq-docview-count { padding: 0 12px 0 8px; opacity: .75; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
  body:has(.fq-tabbar) .fq-docview-bar { bottom: calc(var(--tab-h) + 12px + env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) { body.fq-cab:has(.fq-tabbar) .fq-docview-bar { bottom: calc(var(--tab-h) + 28px); } }
/* Картинка — вписана; нажатие — крупно на весь экран (.fq-docview-lightbox). */
.fq-docview-img { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; border-radius: var(--r-md); }
.fq-docview-img img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 180px); max-height: calc(100svh - 180px);
  margin: 0 auto; border-radius: var(--r-md); }
.fq-docview-lightbox { position: fixed; inset: 0; z-index: 96; background: var(--brand-ink); animation: fq-fade .2s var(--ease) both; }
.fq-docview-lb-scroll { position: absolute; inset: 0; display: grid; overflow: auto; overscroll-behavior: contain; cursor: zoom-out; }
.fq-docview-lb-scroll img { display: block; max-width: none; height: auto; margin: auto; }
.fq-docview-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: var(--brand-ink); color: var(--brand-ivory); box-shadow: var(--shadow-pop); }
.fq-docview-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }
html.fq-docview-locked, html.fq-docview-locked body { overflow: hidden; }
/* Не показалось — вместо листов пояснение (текст задаёт страница или docview.js). */
.fq-docview-msg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.fq-docview-msg .fq-i { width: 28px; height: 28px; color: var(--muted); }
.fq-docview-msg p { color: var(--text-2); font-size: 14px; max-width: 420px; }
/* Готовим печать: кнопка-иконка крутится, тост висит, пока не готово. */
.fq-iconbtn.is-loading { pointer-events: none; color: transparent; position: relative; }
.fq-iconbtn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--muted); border-right-color: transparent; animation: fq-spin .7s linear infinite; }
.fq-toast.is-wait .fq-spinner { flex-shrink: 0; border-top-color: var(--brand-gold); }
/* Печать без просмотра: рамка с PDF (компьютер) и блок листов-картинок (телефон, несколько файлов).
   Каждый лист — на весь лист бумаги без полей браузера; книжный и альбомный — свои именованные страницы. */
.fq-docprint { display: none; }
.fq-docprint-frame { position: absolute; width: 0; height: 0; border: 0; visibility: hidden; }
@page fq-port { size: A4 portrait; margin: 0; }
@page fq-land { size: A4 landscape; margin: 0; }
@media print {
  html.fq-docprinting, html.fq-docprinting body { display: block !important; margin: 0 !important; padding: 0 !important; height: auto !important;
    min-height: 0 !important; overflow: visible !important; background: var(--paper) !important; }
  html.fq-docprinting body > :not(.fq-docprint) { display: none !important; }
  html.fq-docprinting .fq-docprint { display: block !important; }
  .fq-docprint-page { page: fq-port; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
    width: 210mm; height: 296.5mm; overflow: hidden; break-after: page; }
  .fq-docprint-page.is-land { page: fq-land; width: 297mm; height: 209.5mm; }
  .fq-docprint-page.is-img { padding: 10mm; }
  .fq-docprint-page:last-child { break-after: auto; }
  .fq-docprint-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
  /* iPhone и iPad: Safari не слушает @page и ставит свои поля — лист меньше А4, чтобы не перелезть на второй. */
  .fq-docprint.is-ios .fq-docprint-page { width: 190mm; height: 270mm; margin: 0 auto; }
}

/* ═══ Документы модели: чип документа, строка файла, зона загрузки, строка загрузки ═══
   Список моделей, страница модели и окно «Добавить файлы» (docs/model-docs.md, «Экраны»). Без color-mix и
   вложенных правил: страницы открывает и бригадир со старого телефона. */
/* Чип обязательного документа: есть у всех цветов (is-yes), не у всех (is-part), нет (is-no — серый пунктир). */
.fq-docchips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.fq-docchip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px 0 6px; border-radius: 7px;
  border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.fq-docchip .fq-i { width: 13px; height: 13px; flex-shrink: 0; }
.fq-docchip.is-yes { border: 1px solid transparent; background: var(--s-ok-bg); color: var(--s-ok-tx); }
.fq-docchip.is-part { border: 1px solid transparent; background: var(--s-warn-bg); color: var(--s-warn-tx); }
.fq-docchip-more { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
/* Миниатюра модели в строке списка: портретная, 40×52 (обычная .fq-thumb — квадрат 36). */
.fq-table .fq-thumb.is-tall, .fq-thumb.is-tall { width: 40px; height: 52px; border-radius: 8px; object-fit: cover; }
span.fq-thumb { display: inline-grid; place-items: center; overflow: hidden; background: var(--surface-3); border: 1px solid var(--line-2); vertical-align: middle; }
/* Вид документа на странице модели: заголовок вида с состоянием и его файлы. */
.fq-dockind { border-top: 1px solid var(--line); }
.fq-dockind:first-child { border-top: 0; }
.fq-dockind-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 14px 18px 6px; }
.fq-dockind-head h3 { font: 700 15.5px/1.3 var(--fq-display); display: inline-flex; align-items: center; gap: 6px; }
.fq-dockind-head h3 .fq-i { width: 14px; height: 14px; color: var(--accent-ink); }
.fq-dockind-empty { padding: 2px 18px 16px; color: var(--muted); font-size: 13.5px; }
/* Строка файла: значок типа, название и подпись, кнопки справа; на телефоне кнопки — рядом под названием. */
.fq-file { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 18px; border-top: 1px solid var(--line-2); }
.fq-dockind-head + .fq-file { border-top: 0; }
.fq-file-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--s-neutral-bg); color: var(--s-neutral-tx); }
.fq-file-ic .fq-i { width: 20px; height: 20px; }
.fq-file-ic.t-word { background: var(--s-info-bg); color: var(--s-info-tx); }
.fq-file-ic.t-excel { background: var(--s-ok-bg); color: var(--s-ok-tx); }
.fq-file-ic.t-pdf { background: var(--s-bad-bg); color: var(--s-bad-tx); }
.fq-file-ic.t-photo { background: var(--s-progress-bg); color: var(--s-progress-tx); }
.fq-file-ic.t-slides { background: var(--s-warn-bg); color: var(--s-warn-tx); }
.fq-file-ic.t-patterns { background: var(--s-gold-bg); color: var(--s-gold-tx); }
.fq-file-main { min-width: 0; }
.fq-file-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.fq-file-title a { color: inherit; }
.fq-file-title a:hover { color: var(--link); }
.fq-file-meta { display: flex; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.fq-file-meta > span:not(:last-child)::after { content: "·"; margin-left: 6px; color: var(--faint); }
.fq-file-wait { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.fq-file-wait .fq-spinner { width: 13px; height: 13px; border-width: 2px; }
.fq-file-actions { display: flex; align-items: center; gap: 6px; }
/* «Прошлые версии (N)» под строкой файла. */
.fq-file-old { grid-column: 2 / -1; font-size: 12.5px; }
.fq-file-old summary { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; color: var(--muted); font-weight: 500; cursor: pointer; list-style: none; }
.fq-file-old summary::-webkit-details-marker { display: none; }
.fq-file-old summary:hover { color: var(--text); }
.fq-file-old summary .fq-i { width: 14px; height: 14px; transition: transform var(--t); }
.fq-file-old[open] summary .fq-i { transform: rotate(90deg); }
.fq-file-oldrow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 6px 0; border-top: 1px dashed var(--line-2); color: var(--text-2); }
.fq-file-oldrow b { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.fq-file-oldrow .fq-file-actions { margin-left: auto; }
@media (max-width: 767px) {
  .fq-dockind-head { padding: 14px 14px 6px; }
  .fq-dockind-empty { padding: 2px 14px 14px; }
  .fq-file { grid-template-columns: 40px minmax(0, 1fr); padding: 12px 14px; }
  .fq-file > .fq-file-actions { grid-column: 1 / -1; margin-top: 6px; }
  .fq-file > .fq-file-actions .fq-btn { flex: 1; }
  .fq-file-actions .fq-iconbtn { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 9px; flex-shrink: 0; }
  .fq-file-old { grid-column: 1 / -1; }
  .fq-file-old summary { min-height: 44px; }
  .fq-file-oldrow .fq-btn.is-sm { height: 44px; padding: 0 14px; }
}
/* Зона загрузки: пунктир, по нажатию — выбор файла, при переносе файла подсвечивается (is-over). */
.fq-drop { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 60px; padding: 12px 16px;
  border: 1.5px dashed var(--line-strong); border-radius: 12px; background: transparent; color: var(--muted);
  font: 500 13.5px/1.35 var(--fq-font); text-align: center; cursor: pointer; transition: border-color var(--t), background var(--t), color var(--t); }
.fq-drop .fq-i { width: 18px; height: 18px; color: var(--accent-ink); flex-shrink: 0; }
.fq-drop:hover, .fq-drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.fq-drop.is-lg { flex-direction: column; min-height: 132px; font-size: 14px; }
.fq-drop.is-lg .fq-i { width: 26px; height: 26px; }
/* Файл тащат над страницей: рамка на весь экран «Отпустите, чтобы добавить». */
.fq-pagedrop { position: fixed; inset: 12px; z-index: 96; display: none; place-items: center; padding: 24px; border: 2px dashed var(--accent);
  border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 700 20px/1.3 var(--fq-display); color: var(--text); text-align: center; pointer-events: none; }
.fq-pagedrop.is-on { display: grid; }
/* Строка загрузки в окне «Добавить файлы»: название, вид, «для кого», полоса и состояние. */
.fq-up { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fq-up + .fq-up { margin-top: 10px; }
.fq-up-top { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.fq-up-name { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fq-up-fields { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
.fq-up-for { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fq-up-for > .fq-up-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-right: 2px; }
.fq-up-for .fq-filter { height: 32px; padding: 0 10px; font-size: 13px; }
.fq-up-note { font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
.fq-up-state { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.fq-up-state .fq-i { width: 16px; height: 16px; flex-shrink: 0; }
.fq-up-state .fq-progress { flex: 1; }
.fq-up-state .fq-spinner { width: 14px; height: 14px; flex-shrink: 0; }
.fq-up.is-done { border-color: var(--s-ok-dot); }
.fq-up.is-done .fq-up-state .fq-i { color: var(--s-ok-dot); }
.fq-up.is-bad { border-color: var(--s-bad-dot); }
.fq-up.is-bad .fq-up-state { color: var(--money-out); font-weight: 500; }
@media (max-width: 767px) {
  .fq-up-fields { grid-template-columns: minmax(0, 1fr); }
  .fq-up-for .fq-filter { height: 44px; }
}

/* ═══ Движение ═══ */
@keyframes fq-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fq-fade { from { opacity: 0; } }
@keyframes fq-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes fq-spin { to { transform: rotate(360deg); } }
@keyframes fq-shimmer { from { transform: translate3d(-100%, 0, 0); } to { transform: translate3d(100%, 0, 0); } }
/* Живая точка «дышит» прозрачностью — без тени, которая перерисовывалась каждый кадр. */
@keyframes fq-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes fq-draw { from { stroke-dashoffset: var(--len, 1000); } to { stroke-dashoffset: 0; } }
@keyframes fq-grow-y { from { transform: scaleY(0); } }
.fq-enter > * { animation: fq-rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
/* В кабинетах содержимое показывается сразу (быстрое проявление 0,15 с без подъёма по очереди) — рабочему экрану важнее скорость, чем эффект. */
.fq-cab .fq-enter > * { animation: fq-fade .15s var(--ease) backwards; animation-delay: 0s; }
/* Страница уже на экране (fabriq.js: после тихого обновления FQ.refresh или перехода с View Transitions) — блоки
   .fq-enter больше не поднимаются, а то, что пришло с сервера новым, коротко проявляется (.fq-fresh). Заливка
   backwards: после конца анимации у блока нет ни прозрачности, ни слоя, окна внутри не «прилипают» к нему. */
html.fq-still .fq-enter > * { animation: none; }
.fq-fresh, html.fq-still .fq-enter > .fq-fresh { animation: fq-fade .24s var(--ease) backwards; }
.fq-anim-draw { stroke-dasharray: var(--len, 1000); animation: fq-draw 1.1s var(--ease) both; }
.fq-anim-grow { transform-origin: bottom; transform-box: fill-box; animation: fq-grow-y .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
/* View Transitions. Смена темы (html.fq-vt-theme, fabriq.js: setTheme) — круг рисует скрипт, свои анимации выключены.
   Переход между страницами кабинета — «сквозное проявление»: старое гаснет за 90 мс, новое проявляется за 0,2 с;
   шапка и вкладки (свои слои, см. «Кабинет») стоят на месте, у них сменяется только надпись. */
html.fq-vt-theme::view-transition-old(root), html.fq-vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; } ::view-transition-new(root) { z-index: 2; }
html:not(.fq-vt-theme)::view-transition-old(root) { animation: fq-vt-out 90ms var(--ease) both; mix-blend-mode: normal; }
html:not(.fq-vt-theme)::view-transition-new(root) { animation: fq-vt-in .2s var(--ease) 40ms both; mix-blend-mode: normal; }
::view-transition-group(fq-cab-top), ::view-transition-group(fq-cab-tabs),
::view-transition-old(fq-cab-top), ::view-transition-new(fq-cab-top),
::view-transition-old(fq-cab-tabs), ::view-transition-new(fq-cab-tabs) { animation-duration: .2s; }
@keyframes fq-vt-in { from { opacity: 0; } }
@keyframes fq-vt-out { to { opacity: 0; } }
/* Тихое обновление (FQ.refresh, формы data-fq-soft): тонкая золотая полоска у верха, если ответ дольше ~150 мс.
   В кабинете — под шапкой. Экран не блокирует. */
.fq-refresh-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: 2px; overflow: hidden; pointer-events: none;
  opacity: 0; transition: opacity var(--t) var(--ease); }
.fq-refresh-bar.is-on { opacity: 1; }
.fq-refresh-bar::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.fq-refresh-bar.is-on::before { animation: fq-cmd-bar 1s var(--ease) infinite; }
.fq-cab .fq-refresh-bar { top: 60px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .fq-refresh-bar.is-on::before { animation: none !important; transform: none; opacity: .6; }
}

/* ═══ Печать ═══ */
@media print {
  .fq-rail, .fq-side, .fq-top, .fq-appbar, .fq-tabbar, .fq-fab, .fq-head-actions, .fq-filters, .fq-bulkbar { display: none !important; }
  .fq-app { display: block; } .fq-page { padding: 0; } body { background: #fff; }
  .fq-panel { box-shadow: none; border-color: #ccc; }
  .fq-headclone { display: none !important; }
}
.t-link-quiet { color: inherit; } .t-link-quiet:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }

/* Поставленное приложение на iPhone (pwa/pwa_head.html: строка состояния black-translucent): страница
   идёт под часы и батарею — верхние панели опускаются на её высоту. В браузере и на Android env() = 0. */
@media (display-mode: standalone) {
  .fq-cab-top { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }
  .fq-cab .fq-refresh-bar { top: calc(60px + env(safe-area-inset-top)); }
  .fq-top, .fq-appbar { padding-top: env(safe-area-inset-top); height: calc(var(--top-h) + env(safe-area-inset-top)); }
}
