/* Подбор образцов: раздел сайта Полки (https://design-polka.ru/cvet/). Вид как у всей Полки, по её DESIGN.md
   и app/globals.css (решение Евгения 23.11.2026, «полностью как Полка»): белый фон, чернила #0d0c22, один розовый
   акцент, шрифт Onest, кнопки-пилюли, скругление 8 у картинок и 16 у окон и блоков.
   Одно отступление: контур полей ввода темнее линий Полки, чтобы поле было видно (3,3 к 1 при норме 3 к 1). */

/* Шрифт сайта Полки: Onest с адреса сайта /fonts/onest/ (на сервере эти файлы отдаёт сайт, на рабочем ПК сам сервис
   из копии Полки). Начертания и диапазоны знаков те же, что в app/globals.css Полки. */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-latin.woff2") format('woff2');
  unicode-range: U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-latin-ext.woff2") format('woff2');
  unicode-range: U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-cyrillic.woff2") format('woff2');
  unicode-range: U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-greek.woff2") format('woff2');
  unicode-range: U+302-303,U+305,U+307-308,U+310,U+312,U+315,U+31A,U+326-327,U+32C,U+32F-330,U+332-333,U+338,U+33A,U+346,U+34D,U+391-3A1,U+3A3-3A9,U+3B1-3C9,U+3D1,U+3D5-3D6,U+3F0-3F1,U+3F4-3F5,U+2016-2017,U+2034-2038,U+203C,U+2040,U+2043,U+2047,U+2050,U+2057,U+205F,U+2070-2071,U+2074-208E,U+2090-209C,U+20D0-20DC,U+20E1,U+20E5-20EF,U+2100-2112,U+2114-2115,U+2117-2121,U+2123-214F,U+2190,U+2192,U+2194-21AE,U+21B0-21E5,U+21F1-21F2,U+21F4-2211,U+2213-2214,U+2216-22FF,U+2308-230B,U+2310,U+2319,U+231C-2321,U+2336-237A,U+237C,U+2395,U+239B-23B7,U+23D0,U+23DC-23E1,U+2474-2475,U+25AF,U+25B3,U+25B7,U+25BD,U+25C1,U+25CA,U+25CC,U+25FB,U+266D-266F,U+27C0-27FF,U+2900-2AFF,U+2B0E-2B11,U+2B30-2B4C,U+2BFE,U+3030,U+FF5B,U+FF5D,U+1D400-1D7FF,U+1EE??;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-vietnamese.woff2") format('woff2');
  unicode-range: U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/onest/onest-symbols.woff2") format('woff2');
  unicode-range: U+1-C,U+E-1F,U+7F-9F,U+20DD-20E0,U+20E2-20E4,U+2150-218F,U+2190,U+2192,U+2194-2199,U+21AF,U+21E6-21F0,U+21F3,U+2218-2219,U+2299,U+22C4-22C6,U+2300-243F,U+2440-244A,U+2460-24FF,U+25A0-27BF,U+28??,U+2921-2922,U+2981,U+29BF,U+29EB,U+2B??,U+4DC0-4DFF,U+FFF9-FFFB,U+10140-1018E,U+10190-1019C,U+101A0,U+101D0-101FD,U+102E0-102FB,U+10E60-10E7E,U+1D2C0-1D2D3,U+1D2E0-1D37F,U+1F0??,U+1F100-1F1AD,U+1F1E6-1F1FF,U+1F30D-1F30F,U+1F315,U+1F31C,U+1F31E,U+1F320-1F32C,U+1F336,U+1F378,U+1F37D,U+1F382,U+1F393-1F39F,U+1F3A7-1F3A8,U+1F3AC-1F3AF,U+1F3C2,U+1F3C4-1F3C6,U+1F3CA-1F3CE,U+1F3D4-1F3E0,U+1F3ED,U+1F3F1-1F3F3,U+1F3F5-1F3F7,U+1F408,U+1F415,U+1F41F,U+1F426,U+1F43F,U+1F441-1F442,U+1F444,U+1F446-1F449,U+1F44C-1F44E,U+1F453,U+1F46A,U+1F47D,U+1F4A3,U+1F4B0,U+1F4B3,U+1F4B9,U+1F4BB,U+1F4BF,U+1F4C8-1F4CB,U+1F4D6,U+1F4DA,U+1F4DF,U+1F4E3-1F4E6,U+1F4EA-1F4ED,U+1F4F7,U+1F4F9-1F4FB,U+1F4FD-1F4FE,U+1F503,U+1F507-1F50B,U+1F50D,U+1F512-1F513,U+1F53E-1F54A,U+1F54F-1F5FA,U+1F610,U+1F650-1F67F,U+1F687,U+1F68D,U+1F691,U+1F694,U+1F698,U+1F6AD,U+1F6B2,U+1F6B9-1F6BA,U+1F6BC,U+1F6C6-1F6CF,U+1F6D3-1F6D7,U+1F6E0-1F6EA,U+1F6F0-1F6F3,U+1F6F7-1F6FC,U+1F7??,U+1F800-1F80B,U+1F810-1F847,U+1F850-1F859,U+1F860-1F887,U+1F890-1F8AD,U+1F8B0-1F8BB,U+1F8C0-1F8C1,U+1F900-1F90B,U+1F93B,U+1F946,U+1F984,U+1F996,U+1F9E9,U+1FA00-1FA6F,U+1FA70-1FA7C,U+1FA80-1FA89,U+1FA8F-1FAC6,U+1FACE-1FADC,U+1FADF-1FAE9,U+1FAF0-1FAF8,U+1FB??;
}

:root {
  color-scheme: light;
  /* палитра Полки */
  --bg: #ffffff;
  --ink: #0d0c22;          /* текст, чёрные кнопки */
  --ink-deep: #060318;     /* кнопка под мышью */
  --ink-soft: #3a3546;     /* текст пояснений */
  --muted: #6e6d7a;        /* вторые надписи: на белом 5,1 к 1, на подложке 4,6 к 1 */
  --muted-2: #9e9ea7;      /* неактивное */
  --line: #e7e7e9;         /* линии, контуры кнопок */
  --line-2: #dbdade;
  --surface-2: #f3f3f4;    /* подложка картинок, выбранная вкладка, стол доски */
  --surface-3: #f8f7f4;    /* мягкая подложка блоков */
  --accent: #ea4c89;       /* розовый: выделенные слова, главное действие, выбранное, фокус */
  --accent-hover: #f082ac;
  --accent-tint: #fdf2f8;
  --field: #8c8b97;        /* контур полей ввода */
  --shadow: 0 1px 2px rgb(6 3 24 / 0.06), 0 12px 32px -16px rgb(6 3 24 / 0.25);    /* лист и плавающие панели, как у Полки */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --fast: 150ms;
  --font: Onest, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 8px;
  --radius-big: 16px;
  --hdr-h: 84px;
  --bar: 64px;             /* нижняя строка мест на телефоне */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --z-sticky: 20;
  --z-note: 60;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* выбранный с клавиатуры элемент не прячется под шапкой и нижней строкой мест */
:focus { scroll-margin-top: calc(var(--hdr-h) + 16px); scroll-margin-bottom: calc(var(--bar) + 96px); }
main:focus { outline: none; }

/* ссылка для клавиатуры: сразу к содержимому, мимо шапки. Видна, только когда на ней фокус */
.skip {
  position: absolute; left: 16px; top: -100px; z-index: calc(var(--z-note) + 1);
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border-radius: 9999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
}
.skip:focus { top: 8px; }

.second { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- кнопки и поля: как на Полке ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border: 1px solid transparent; border-radius: 9999px;
  background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast);
}
.btn:hover { background: var(--ink-deep); }
.btn:active { transform: scale(0.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: default; }
.btn--accent { background: var(--accent); }                   /* главное действие экрана, одно на экран: как «Хочу контакт фабрики» */
.btn--accent:hover { background: var(--accent-hover); }
.btn--second { height: 40px; padding: 0 20px; background: #fff; color: var(--ink); border-color: var(--line); font-size: 13px; }
.btn--second:hover { background: #fff; border-color: var(--ink); }
.btn--quiet { height: 40px; padding: 0 12px; background: transparent; color: var(--ink); font-size: 13px; }
.btn--quiet:hover { background: var(--surface-2); }
.btn--wide { width: 100%; }
/* кнопка-надпись у скрытого поля выбора файла: фокус с клавиатуры виден на ней */
.visually-hidden:focus-visible + .btn { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; }
.field__input {
  width: 100%; height: 48px; padding: 0 20px;
  border: 1px solid var(--field); border-radius: 9999px; background: #fff; font-size: 15px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.field__input:hover { border-color: var(--ink); }
.field__input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(234 76 137 / 0.18); }
.field__input[aria-invalid="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.field__input::placeholder { color: var(--muted); }
.field__error { min-height: 20px; font-size: 14px; line-height: 20px; font-weight: 600; }
.page > .field__error:empty { display: none; }

/* ---------- шапка, места раздела, подвал ---------- */

.hdr {
  position: sticky; top: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 20px;
  height: var(--hdr-h); padding: 0 40px; background: var(--bg);
}
.logo { display: inline-flex; flex: none; border-radius: 10px; }
.logo svg { display: block; width: 44px; height: 44px; }
.hdr__section { display: inline-flex; align-items: center; min-height: 44px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.hdr__places { margin-left: 4px; }
.hdr__side { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hdr__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-size: 14px; font-weight: 600; }
.hdr__link:hover { color: var(--ink-deep); text-decoration: underline; text-underline-offset: 4px; }

/* места раздела: вкладки Полки, открытая в серой пилюле */
.places { display: flex; gap: 4px; }
.places a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: 9999px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background var(--fast) var(--ease);
}
.places a:hover { background: var(--surface-3); }
.places a[aria-current="page"] { background: var(--surface-2); }

.bottom {
  position: fixed; inset: auto 0 0 0; z-index: var(--z-sticky);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgb(255 255 255 / 0.96); border-top: 1px solid var(--line);
}
.bottom .places a { flex: 1; height: 48px; }

/* страница не короче экрана, подвал прижат книзу: пока карточки грузятся, подвал стоит за краем экрана и не прыгает */
.page { display: flex; flex-direction: column; width: 100%; min-height: 100dvh; max-width: 1440px; margin: 0 auto; padding: 16px 40px 0; }
.page__end { flex: 1 0 56px; }                             /* распорка перед подвалом: не меньше 56 точек, остальное место её */
.page h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; }
.page__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 8px 0 28px; }
.page__head #count { margin-left: 12px; font-size: 20px; font-weight: 500; letter-spacing: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.page__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page__hint { font-size: 14px; font-weight: 600; }

/* подвал Полки: ссылка на политику данных видна с каждой страницы сайта; переключатель языка тут же */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px;
  padding: 16px 0 24px; border-top: 1px solid var(--line);
  font-size: 15px; color: var(--muted);
}
.foot a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.foot a:hover { color: var(--ink); }
.foot .sep { flex: 1 1 auto; }

.lang { display: inline-flex; align-items: center; }
.lang button {
  min-width: 44px; min-height: 44px; padding: 0 8px; border: 0; background: none;
  color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer;
}
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.lang span { color: var(--line-2); }

main { padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom)); }
.entry main { padding-bottom: 0; }                           /* у страницы входа нет нижней строки мест */

@media (max-width: 859px) {
  :root { --hdr-h: 68px; }
  .hdr { gap: 12px; padding: 0 16px; }
  .hdr .places, .hdr__link { display: none; }        /* на телефоне места раздела стоят внизу экрана, под большим пальцем */
  .btn--second, .btn--quiet { height: 44px; }
  .page { padding: 8px 16px 0; }
  .page h1 { font-size: 28px; letter-spacing: -0.02em; }
  .page__head { padding: 4px 0 20px; }
}
@media (min-width: 860px) {
  .bottom { display: none; }
  main { padding-bottom: 0; }
}

/* ---------- знак уровня точности карты: три квадрата, как поля карты ---------- */

.tier { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tier__marks { display: inline-flex; gap: 2px; }
.tier__marks i { width: 8px; height: 8px; border-radius: 2px; box-shadow: inset 0 0 0 1px var(--ink); }
.tier__marks i.on { background: var(--ink); }

/* ---------- вердикт: значок в круге и слово ---------- */

.verdict { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.verdict svg { width: 32px; height: 32px; flex: none; padding: 5px; border-radius: 50%; background: var(--surface-2); }
.verdict--retake { color: var(--accent); }                     /* крупный текст: розовому хватает 3,6 к 1 */
.verdict--retake svg { background: var(--accent-tint); }

/* ---------- вход: что это за раздел и вход для команды ---------- */

.hero { display: grid; gap: 32px; padding: 32px 0 24px; }
.hero h1 { font-size: 52px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { margin-top: 14px; max-width: 62ch; font-size: 18px; line-height: 28px; color: var(--muted); }
.badge {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; margin-bottom: 20px;
  border-radius: 9999px; background: var(--accent-tint); font-size: 13px; font-weight: 600;
}
.badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero__card { padding: 7%; border-radius: var(--radius); background: var(--surface-2); }
.hero__card img { width: 100%; height: auto; box-shadow: var(--shadow); }
.how { margin-top: 24px; padding: 40px; border-radius: var(--radius-big); background: var(--surface-3); }
.how h2 { margin-bottom: 20px; font-size: 24px; font-weight: 600; line-height: 1.2; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { display: grid; gap: 6px; align-content: start; }
.steps b { font-size: 16px; font-weight: 600; }
.steps span { font-size: 15px; line-height: 24px; color: var(--muted); }
.team { display: grid; gap: 12px; max-width: 560px; margin-top: 48px; }
.team h2 { font-size: 20px; font-weight: 600; line-height: 1.3; }
.team__note { font-size: 14px; line-height: 22px; color: var(--muted); }
.team__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; margin-top: 4px; }
.team__form .field__error { grid-column: 1 / -1; }

@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); align-items: center; gap: 56px; padding: 40px 0 28px; }
}
@media (max-width: 859px) {
  .hero { padding: 16px 0 8px; gap: 24px; }
  .hero h1 { font-size: 30px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
  .hero__lead { font-size: 16px; line-height: 26px; }
  .how { padding: 24px; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .team__form { grid-template-columns: 1fr; }
}

/* ---------- съёмка ---------- */

/* На телефоне главная кнопка стоит внизу, под большим пальцем. */
.capture { max-width: 720px; display: flex; flex-direction: column; gap: 20px; }
.capture__pad { min-width: 0; }
.capture__card { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 15px; }
.capture__rules { display: grid; gap: 10px; margin-top: 16px; }
.capture__rules li { display: grid; grid-template-columns: 1.6em 1fr; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.capture__rules li > span:first-child { font-weight: 700; color: var(--ink); }
.capture__actions {
  position: sticky; bottom: calc(var(--bar) + env(safe-area-inset-bottom)); margin-top: auto;
  display: grid; gap: 4px; padding: 12px 0;
  background: linear-gradient(to top, #fff 80%, rgb(255 255 255 / 0));
}
.capture__frame { padding-bottom: 24px; }
.capture__busy { display: grid; gap: 8px; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 200ms linear; }
.progress--wait i { width: 35%; animation: wait 1.1s var(--ease) infinite; }
@keyframes wait { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

.result { display: grid; gap: 16px; }
.result__crop { width: 100%; height: auto; border-radius: var(--radius); background: var(--surface-2); }
.result__head { display: grid; gap: 12px; }
.result__name { display: flex; align-items: center; gap: 8px; }
.result__name input {                 /* название правится на месте: черта под ним показывает, что это поле */
  flex: 1; min-width: 0; height: 44px; padding: 0;
  border: 0; border-bottom: 1px solid var(--field); border-radius: 0; background: transparent;
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  transition: border-color var(--fast) var(--ease);
}
.result__name input:hover { border-bottom-color: var(--ink); }
.result__name input:focus { outline: none; border-bottom: 2px solid var(--accent); }
.result__facts { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.result__facts b { color: var(--ink); font-weight: 600; }
.result__checks { display: grid; gap: 8px; }
.result__checks li { display: grid; grid-template-columns: 28px 1fr; font-size: 15px; line-height: 22px; color: var(--ink-soft); }
.result__checks li > span:first-child {
  display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 50%; background: var(--accent-tint); color: var(--ink); font-size: 12px; font-weight: 700;
}
.result__frame { position: relative; }
.result__frame img { width: 100%; height: auto; border-radius: var(--radius); }
.result__frame svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.result__frame polygon { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; paint-order: stroke; filter: drop-shadow(0 0 1px #000); }
.result__buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- рамка участка образца на кадре ---------- */

.zone--editing { touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.zone--editing polygon { stroke-width: 3; }
.zone__handle, .zone__move {
  position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0;
  border: 0; border-radius: 50%; background: none; touch-action: none; cursor: grab;
}
.zone__handle::before, .zone__move::before { content: ""; position: absolute; border-radius: 50%; }
.zone__handle::before { inset: 14px; background: #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 0 3px rgb(6 3 24 / 0.35); }   /* угол: белая точка в розовом кольце */
.zone__move::before { inset: 12px; background: var(--accent); box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgb(6 3 24 / 0.35); }   /* середина: розовая точка в белом кольце */
.zone__handle:active, .zone__move:active { cursor: grabbing; }
.zone__handle:focus-visible, .zone__move:focus-visible { outline: 2px solid #fff; outline-offset: -8px; box-shadow: inset 0 0 0 10px rgb(13 12 34 / 0.55); }
.zone__bar { display: grid; gap: 12px; padding-top: 12px; justify-items: start; }
.zone__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.zone__size { font-weight: 600; font-variant-numeric: tabular-nums; }
.zone__warn { font-weight: 600; }

@media (max-width: 859px) {
  /* страница съёмки занимает экран целиком: главная кнопка внизу, подвал ниже, за краем экрана */
  .capture { min-height: calc(100dvh - var(--hdr-h) - var(--bar) - 8px); }
}
@media (min-width: 860px) {
  .capture { padding-bottom: 8px; }
  .capture__actions { position: static; margin-top: 0; background: none; grid-auto-flow: column; justify-content: start; gap: 12px; padding: 0; }
  .capture__actions .btn--wide { width: auto; }
  .capture__pick { display: none; }       /* на компьютере одна кнопка и так открывает выбор файла */
}

/* ---------- образцы: сетка карточек, как каталоги на Полке ---------- */

.wall { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; }
.tile { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; border-radius: var(--radius); }
.tile__thumb { position: relative; display: block; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.tile__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 250ms var(--ease); }
.tile:hover .tile__thumb img { transform: scale(1.02); }
.tile__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.tile__name { flex: 1 1 0; min-width: 0; font-size: 14px; font-weight: 600; line-height: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile__stats { flex: none; font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile__note { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--muted); }
.tile:focus-visible { outline-offset: 4px; }
/* выбор двух образцов для сравнения: выбранный обведён розовым */
.wall--picking .tile[aria-pressed="true"] .tile__thumb::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 5px #fff; pointer-events: none;
}

.empty { display: grid; gap: 12px; justify-items: start; max-width: 520px; padding: 24px 0 40px; color: var(--muted); }
.empty h2 { font-size: 20px; font-weight: 600; color: var(--ink); }

@media (max-width: 1280px) { .wall { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
  .tile__name { flex-basis: 100%; }                         /* узкая карточка: название целиком, размер строкой ниже */
}

/* ---------- полоса над рабочими экранами: сравнение и доска ---------- */

.bar {
  display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 64px; padding: 0 8px;
  background: #fff; border-bottom: 1px solid var(--line);
}
.bar__end { margin-left: auto; }

.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 44px; height: 44px; padding: 0 10px;
  border: 0; border-radius: 9999px; background: none; color: var(--ink);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--fast) var(--ease);
}
.tool:hover { background: var(--surface-2); }
.tool:active, .tool[aria-pressed="true"] { background: var(--line); }
.tool[disabled] { color: var(--muted-2); background: none; cursor: default; }
#back span { display: none; }                              /* на телефоне от ссылки назад остаётся значок */
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon__solid { fill: currentColor; }
.icon__cover { fill: #fff; }

/* ---------- сравнение двух образцов: встык во весь экран, под ними число отличия и что оно значит ---------- */

.compare { height: 100dvh; display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; }
.compare__title { font-size: 15px; font-weight: 600; letter-spacing: 0; }
main.compare__body { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }
.compare__pair { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; background: var(--surface-2); }      /* на телефоне один над другим */
.compare__half { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.compare__half img { position: absolute; left: 50%; top: 50%; max-width: none; transform: translate(-50%, -50%); }
.compare__facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 24px; padding: 16px 24px 20px; background: #fff; border-top: 1px solid var(--line); }
.compare__facts:empty, .compare__body .field__error:empty { display: none; }
.compare__body .field__error { padding: 12px 24px; }
.compare__lines { grid-column: 1 / -1; display: grid; gap: 4px; }
.compare__verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.compare__verdict b { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.compare__verdict span { color: var(--muted); }
.compare__column { display: grid; align-content: start; gap: 2px; min-width: 0; font-variant-numeric: tabular-nums; }
.compare__name { display: block; padding: 10px 0; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.compare__name:hover { text-decoration-color: var(--ink); }
.compare__card { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }

@media (min-width: 860px) {
  .compare__pair { grid-template: minmax(0, 1fr) / minmax(0, 1fr) minmax(0, 1fr); }       /* на компьютере рядом */
  .compare__name { padding: 4px 0; }
}

/* ---------- лист доски и образцы на нём: общее для редактора и для списка досок ---------- */
/* Цвета листа и подписей на нём это цвета печати (те же числа в boards.py): они не меняются вместе с видом сайта. */

.sheet {
  --paper: #ffffff; --paper-ink: #1b1b1b; --mm: 1px;        /* --mm: точек экрана в миллиметре листа, ставит скрипт */
  position: relative; overflow: hidden; background: var(--paper);
  box-shadow: var(--shadow);
}
.sheet--gray { --paper: #ababab; }
.sheet--dark { --paper: #333333; --paper-ink: #f0f0f0; }
.sheet__hint { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; color: var(--paper-ink); text-align: center; text-wrap: balance; pointer-events: none; }
.piece { position: absolute; overflow: hidden; background: var(--surface-2); }      /* без рамок, скруглений и теней: образцы сходятся встык */
.piece img { position: absolute; max-width: none; transform-origin: 0 0; pointer-events: none; }
.piece__name {                                             /* подпись: уголок цвета листа в левом нижнем углу образца; размеры в мм листа, как в PDF */
  position: absolute; left: 0; bottom: 0; max-width: 100%;
  height: calc(var(--mm) * 4.6); padding: 0 calc(var(--mm) * 1.4);
  font-size: calc(var(--mm) * 2.8); line-height: calc(var(--mm) * 4.6); font-weight: 400; font-kerning: none; letter-spacing: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: var(--paper); color: var(--paper-ink); pointer-events: none;
}

/* ---------- доски: список карточками ---------- */

.boards__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px 28px; }
.board-tile { display: grid; gap: 6px; min-width: 0; }
.board-tile__open { display: grid; gap: 10px; border-radius: var(--radius); }
.board-tile__name { font-size: 14px; font-weight: 600; line-height: 20px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
a.board-tile__open:hover .board-tile__name { text-decoration: underline; text-underline-offset: 3px; }
.board-tile__line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.board-tile__line .btn { margin-right: -12px; }
.mini { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 8%; border-radius: var(--radius); background: var(--surface-2); }      /* миниатюра листа рисуется внутри полей */
.mini .piece { background: none; }

/* ---------- доска: редактор. Сверху одна строка, под ней стол с листом и полка с образцами ---------- */

.editor { height: 100dvh; display: grid; grid-template: auto minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; overscroll-behavior: none; background: var(--surface-2); }
.editor__name {                       /* название правится на месте: черта под ним показывает, что это поле */
  flex: 1; min-width: 0; height: 44px; padding: 0 4px;
  border: 0; border-bottom: 1px solid var(--field); border-radius: 0; background: transparent;
  font-size: 15px; font-weight: 600; text-overflow: ellipsis;
  transition: border-color var(--fast) var(--ease);
}
.editor__name:hover { border-bottom-color: var(--ink); }
.editor__name:focus { outline: none; border-bottom: 2px solid var(--accent); }
.editor__status { display: none; white-space: nowrap; font-size: 13px; }
.editor__status[data-kind="failed"] { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }      /* несохранённый лист виден и на телефоне */
.editor__status[data-kind="failed"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.editor__side { display: flex; align-items: center; gap: 4px; }
.editor__side .btn { height: 44px; padding: 0 16px; }
.editor__shelf-toggle { display: none; }
.editor__shelf-toggle[aria-pressed="true"] { background: var(--surface-2); border-color: var(--surface-2); }
/* колонка не шире экрана: полка листается внутри себя и не распирает страницу */
main.editor__body { display: grid; grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); min-width: 0; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }

/* на столе все движения пальцем принадлежат редактору: браузер не листает страницу, не выделяет текст и не открывает меню картинки */
.table { grid-row: 1; position: relative; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.table .piece { cursor: grab; }
.table .piece:focus { outline: none; }                     /* выбранный образец обведён рамкой с ручками: второй контур лишний */
.table--dragging, .table--dragging .piece { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; }
.over { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.guide { position: absolute; left: 0; top: 0; background: var(--accent); box-shadow: 0 0 0 1px rgb(255 255 255 / 0.9); }     /* линия прилипания видна на любом образце */
.guide--x { width: 1px; }
.guide--y { height: 1px; }
.pick { position: absolute; box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--accent); pointer-events: none; }
.pick__handle {                                            /* --hit: размер цели, его ставит скрипт по размеру образца на экране */
  position: absolute; width: var(--hit, 28px); height: var(--hit, 28px); margin: calc(var(--hit, 28px) / -2) 0 0 calc(var(--hit, 28px) / -2); padding: 0;
  border: 0; border-radius: 50%; background: none; pointer-events: auto; touch-action: none;
}
.pick__handle::before {                                    /* угол: белая точка в розовом кольце, как у рамки участка на кадре */
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--accent), 0 0 0 3px rgb(6 3 24 / 0.3);
}
.pick__handle--side::before { border-radius: 3px; }        /* край: короткая черта вдоль него */
.pick__handle--side[data-index="0"]::before, .pick__handle--side[data-index="2"]::before { width: 18px; height: 6px; margin: -3px 0 0 -9px; }
.pick__handle--side[data-index="1"]::before, .pick__handle--side[data-index="3"]::before { width: 6px; height: 18px; margin: -9px 0 0 -3px; }
.pick__handle:focus-visible { outline: none; }
.pick__handle:focus-visible::before { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px #fff, 0 0 0 6px var(--ink); }
.pick__handle--corner[data-index="0"] { left: 0; top: 0; cursor: nwse-resize; }
.pick__handle--corner[data-index="1"] { left: 100%; top: 0; cursor: nesw-resize; }
.pick__handle--corner[data-index="2"] { left: 100%; top: 100%; cursor: nwse-resize; }
.pick__handle--corner[data-index="3"] { left: 0; top: 100%; cursor: nesw-resize; }
.pick__handle--side[data-index="0"] { left: 50%; top: 0; cursor: ns-resize; }
.pick__handle--side[data-index="1"] { left: 100%; top: 50%; cursor: ew-resize; }
.pick__handle--side[data-index="2"] { left: 50%; top: 100%; cursor: ns-resize; }
.pick__handle--side[data-index="3"] { left: 0; top: 50%; cursor: ew-resize; }
.pick--tight-x .pick__handle--side[data-index="0"], .pick--tight-x .pick__handle--side[data-index="2"],
.pick--tight-y .pick__handle--side[data-index="1"], .pick--tight-y .pick__handle--side[data-index="3"] { display: none; }
/* под палец: цель ручки 44 точки целиком снаружи образца, метка остаётся на его углу или крае */
.pick--outside .pick__handle--corner[data-index="0"] { margin: calc(-1 * var(--hit)) 0 0 calc(-1 * var(--hit)); }
.pick--outside .pick__handle--corner[data-index="1"] { margin: calc(-1 * var(--hit)) 0 0 0; }
.pick--outside .pick__handle--corner[data-index="2"] { margin: 0; }
.pick--outside .pick__handle--corner[data-index="3"] { margin: 0 0 0 calc(-1 * var(--hit)); }
.pick--outside .pick__handle--side[data-index="0"] { margin: calc(-1 * var(--hit)) 0 0 calc(var(--hit) / -2); }
.pick--outside .pick__handle--side[data-index="1"] { margin: calc(var(--hit) / -2) 0 0 0; }
.pick--outside .pick__handle--side[data-index="2"] { margin: 0 0 0 calc(var(--hit) / -2); }
.pick--outside .pick__handle--side[data-index="3"] { margin: calc(var(--hit) / -2) 0 0 calc(-1 * var(--hit)); }
.pick--outside .pick__handle--corner[data-index="0"]::before, .pick--outside .pick__handle--corner[data-index="3"]::before, .pick--outside .pick__handle--side[data-index="3"]::before { left: 100%; }
.pick--outside .pick__handle--corner[data-index="1"]::before, .pick--outside .pick__handle--corner[data-index="2"]::before, .pick--outside .pick__handle--side[data-index="1"]::before { left: 0; }
.pick--outside .pick__handle--corner[data-index="0"]::before, .pick--outside .pick__handle--corner[data-index="1"]::before, .pick--outside .pick__handle--side[data-index="0"]::before { top: 100%; }
.pick--outside .pick__handle--corner[data-index="2"]::before, .pick--outside .pick__handle--corner[data-index="3"]::before, .pick--outside .pick__handle--side[data-index="2"]::before { top: 0; }

.tools {                                                   /* действия с выбранным образцом: внизу стола, под рукой */
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; gap: 2px; max-width: calc(100% - 16px); padding: 4px;
  border: 1px solid var(--line); border-radius: 9999px; background: #fff; box-shadow: var(--shadow);
}
.table__fit { position: absolute; right: 12px; top: 12px; box-shadow: var(--shadow); }
.table__error { position: absolute; inset: 0; display: grid; place-content: center; justify-items: start; gap: 16px; padding: 24px; }
.ghost { position: fixed; left: 0; top: 0; z-index: var(--z-note); opacity: 0.85; pointer-events: none; border-radius: 4px; }

.shelf { grid-row: 2; min-width: 0; min-height: 0; background: #fff; border-top: 1px solid var(--line); }
.shelf__title { display: none; }
.shelf__list { display: flex; gap: 8px; padding: 8px; overflow-x: auto; overscroll-behavior: contain; }
.shelf__tile { display: grid; gap: 4px; width: 104px; padding: 0; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.shelf__tile img { width: 100%; height: 56px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.shelf__name, .shelf__used { font-size: 12px; line-height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.shelf__name { font-weight: 600; }
.shelf__used { color: var(--muted); }
.shelf__empty { padding: 12px 16px; }
.shelf__empty a { text-decoration: underline; text-underline-offset: 3px; }

.panel {                                                   /* настройки листа и размер образца числами: окно Полки */
  position: fixed; inset: 68px 8px auto auto; width: min(360px, calc(100vw - 16px)); margin: 0; padding: 20px;
  border: 0; border-radius: var(--radius-big); background: #fff; color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px rgb(6 3 24 / 0.4);
}
.panel:popover-open { display: grid; gap: 18px; }
/* браузер без встроенного всплывающего окна (выпущен до 2024 года): панель открывает и закрывает скрипт */
@supports not selector(:popover-open) {
  .panel { display: none; z-index: var(--z-note); }
  .panel.panel--open { display: grid; gap: 18px; }
}
.panel__group { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.panel__group legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.panel__foot { font-size: 13px; color: var(--muted); }
.panel__foot a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.choices { display: flex; flex-wrap: wrap; gap: 6px; }
.choice { position: relative; display: inline-flex; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 48px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 9999px; font-size: 13px; font-weight: 600;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.choice span b { font-weight: inherit; }
.choice input:hover + span { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input:disabled + span { border-color: var(--line); color: var(--muted-2); }
.choice input:disabled { cursor: default; }
.choice--check, .choice--check span { width: 100%; }
.panel--piece { inset: auto; width: min(300px, calc(100vw - 16px)); }      /* место над панелью выбранного образца ставит скрипт */
.numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.number { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.number input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--field); border-radius: var(--radius); background: #fff; font-size: 15px; font-weight: 400; font-variant-numeric: tabular-nums;
}
.number input:hover { border-color: var(--ink); }
.number input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgb(234 76 137 / 0.18); }
.tool--size { display: block; min-width: 0; padding: 0 14px; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.swatch { width: 14px; height: 14px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px var(--field); }
.swatch--white { background: #ffffff; }
.swatch--gray { background: #ababab; }
.swatch--dark { background: #333333; }
.choice input:checked + span .swatch { box-shadow: 0 0 0 1px #fff; }

.editor .note { bottom: calc(132px + env(safe-area-inset-bottom)); }       /* над полкой и панелью выбранного образца */

@media (min-width: 860px) {
  .bar { gap: 8px; padding: 0 16px; }
  .editor__name { max-width: 30rem; }
  .editor__status { display: inline; padding: 0 8px; color: var(--muted); }
  .editor__side { margin-left: auto; gap: 8px; }
  .editor__side .btn { height: 40px; }
  .editor__shelf-toggle { display: inline-flex; }
  #back span { display: inline; }
  .tool { min-width: 40px; height: 40px; }
  main.editor__body { grid-template: minmax(0, 1fr) / 232px minmax(0, 1fr); padding-bottom: 0; }
  main.editor__body--no-shelf { grid-template-columns: minmax(0, 1fr); }
  .editor__body--no-shelf .shelf { display: none; }
  .table { grid-row: auto; }
  .shelf { grid-row: auto; overflow-y: auto; border-top: 0; border-right: 1px solid var(--line); }
  .shelf__title { display: block; padding: 16px 16px 0; font-size: 14px; font-weight: 600; }
  .shelf__list { flex-direction: column; gap: 14px; padding: 12px 16px 16px; overflow: visible; }
  .shelf__tile { width: 100%; }
  .shelf__tile img { height: auto; max-height: 132px; }
  .shelf__tile:hover .shelf__name { text-decoration: underline; text-underline-offset: 3px; }
  .editor .note { bottom: 84px; }
}

/* ---------- короткое сообщение внизу: что сделано и как вернуть ---------- */

.note {
  position: fixed; left: 50%; bottom: calc(var(--bar) + 16px + env(safe-area-inset-bottom)); z-index: var(--z-note);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100% - 32px); min-height: 56px; padding: 8px 8px 8px 20px;
  border-radius: var(--radius-big); background: var(--ink); color: #fff; font-size: 14px; line-height: 20px;
  box-shadow: 0 24px 60px -20px rgb(6 3 24 / 0.5);
}
.note button {
  flex: none; height: 40px; padding: 0 16px; border: 0; border-radius: 9999px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
@media (max-width: 859px) { .note button { height: 44px; } }

/* ---------- печать доски из браузера: на бумагу идёт сам лист в настоящем размере, без стола и кнопок ---------- */
/* Это быстрый черновик; файл для типографии даёт кнопка PDF. Печатную копию листа собирает board.js перед печатью. */

.print { display: none; }
@page sheet-a4 { size: 297mm 210mm; margin: 0; }
@page sheet-a4-p { size: 210mm 297mm; margin: 0; }
@page sheet-a3 { size: 420mm 297mm; margin: 0; }
@page sheet-a3-p { size: 297mm 420mm; margin: 0; }
@page sheet-square { size: 250mm 250mm; margin: 0; }
@page sheet-screen { size: 320mm 180mm; margin: 0; }
@page sheet-screen-p { size: 180mm 320mm; margin: 0; }

@media print {
  body.editor { display: block; height: auto; min-height: 0; overflow: visible; background: none; }
  body.editor > :not(.print) { display: none !important; }
  /* фон листа и уголки подписей печатаются и тогда, когда в окне печати выключена «фоновая графика» */
  .print { display: block; overflow: hidden; break-inside: avoid; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .print .sheet { box-shadow: none; }
  .print[data-page="a4"] { page: sheet-a4; }
  .print[data-page="a4-p"] { page: sheet-a4-p; }
  .print[data-page="a3"] { page: sheet-a3; }
  .print[data-page="a3-p"] { page: sheet-a3-p; }
  .print[data-page="square"] { page: sheet-square; }
  .print[data-page="screen"] { page: sheet-screen; }
  .print[data-page="screen-p"] { page: sheet-screen-p; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
