/* Corta HR — дизайн-система.
   Главный элемент — лента времени в клетке табеля; всё остальное намеренно спокойное.
   --brand* — заглушка: заменить по брендбуку Corta (ТЗ 17.3, 36), остальные цвета смысловые. */

@font-face { font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/onest-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/onest-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Onest; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #ffffff;
  --canvas: #f4f5f7;
  --ink: #18212f;
  --ink-2: #4a5566;
  --muted: #667085;  /* контраст 5:1 на белом — вспомогательный текст читается */
  --rule: #e3e6eb;
  --rule-strong: #cdd2da;

  --brand: #2f55d4;
  --brand-ink: #1e3a9e;
  --brand-wash: #eef2fd;
  /* словарь входа: синий войлок доски и обложки журнала, красная закладка, жёлтый стикер, печати */
  --felt: #1b2a6b;
  --felt-deep: #121d52;
  --ribbon: #c62a34;
  --sticky: #ffe36b;
  --seal-ok: #1e8a5a;
  --seal-no: #d63a24;
  --felt-bg: radial-gradient(130% 70% at 0% 0%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%),
             repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 4px),
             linear-gradient(180deg, var(--felt), var(--felt-deep));

  --both: #1e8a5a;  --both-wash: #e4f3eb;
  --cam: #3e5bd8;   --cam-wash: #e8ecfc;
  --card: #b07400;  --card-wash: #fff2d6;
  --hr: #7a4cc2;    --hr-wash: #f0e9fb;
  --abs: #6b7383;   --abs-wash: #eef0f3;
  --late: #c23a22;  --late-wash: #fbe9e5;

  --brush: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='160'><filter id='b'><feTurbulence type='fractalNoise' baseFrequency='.002 1.2' numOctaves='1' seed='3'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  .07 0 0 0 -.015'/></filter><rect width='100%' height='100%' filter='url(%23b)'/></svg>");
  /* латунь табличек и номерков (как табличка на двери): шлифованное золото, заклёпка — выпуклая точка */
  --brass: linear-gradient(180deg, #f7e4a8 0%, #e2bf68 36%, #cda24a 68%, #b98d36 100%);
  --rivet: radial-gradient(circle at 40% 35%, #fff8da 0 14%, #dcb965 38%, #8d6721 70%, rgba(110, 78, 22, .55) 80%, rgba(110, 78, 22, 0) 86%);

  --r-ctl: 8px;
  --r-panel: 12px;
  --rail: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 14px/1.5 Onest, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "tnum" 1;  /* время в табеле стоит ровно */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.rail :focus-visible, .mobilebar :focus-visible, .pboard :focus-visible, .pass-head :focus-visible, .login :focus-visible { outline-color: #fff; }  /* на синем войлоке и пробке синяя рамка не видна */
h1 { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
form.inline { display: inline; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* ── каркас ─────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }
/* меню — синий войлок, как доска пропусков и обложка журнала на входе */
.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 18px; color: #dfe5f7;
  background:
    radial-gradient(130% 50% at 0% 0%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 60%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, var(--felt), var(--felt-deep));
}
.rail::after {  /* ворс */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.wordmark { display: flex; align-items: baseline; gap: 6px; padding: 0 10px 22px; color: var(--ink); }
.wordmark b { font-size: 19px; font-weight: 700; letter-spacing: 0.02em; color: var(--brand); }
.wordmark span { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.rail .wordmark b { color: #fff; }
.rail .wordmark span { color: #9fb0e8; }
.nav { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-ctl);
  color: rgba(223, 229, 247, .78); font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .11); color: #fff; }
.nav a.on::before {  /* закладка-ленточка, как в журнале: отмечает раздел, где вы сейчас */
  content: ""; position: absolute; left: -14px; top: -3px; width: 7px; height: calc(100% + 9px);
  background: linear-gradient(90deg, #a31f29, #d3343e 45%, #b0222c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 5px), 0 100%);
}
.nav .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 10px; }
.rail .iconbtn { color: var(--ink-2); }
/* вы — пропуск внизу меню */
.me {
  position: relative; z-index: 1; margin-top: auto; overflow: hidden;
  background: var(--paper); color: var(--ink); border-radius: 10px; transform: rotate(-1.2deg);
  box-shadow: 0 14px 24px -10px rgba(0, 0, 0, .55), 0 2px 4px rgba(0, 0, 0, .25);
}
.me-top {  /* шапка пропуска, как у карточки сотрудника: синяя полоса с CORTA и прорезью под ленту */
  position: relative; display: flex; align-items: baseline; gap: 7px; padding: 7px 12px 6px; background: var(--felt-bg); color: #fff;
}
.me-top b { font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.me-top span { font-size: 11.5px; color: rgba(223, 229, 247, .75); }
.me-body { display: flex; align-items: center; gap: 10px; padding: 9px 6px 9px 10px; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .who span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-ctl);
  border: 0; background: none; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: #eaecf0; color: var(--ink); }

.main { min-width: 0; padding: 26px 32px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.mobilebar { display: none; }

/* ── элементы ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-ctl);
  border: 1px solid var(--felt); background: var(--felt); color: #fff; font: 500 14px/1 Onest, sans-serif;
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #24357f; border-color: #24357f; text-decoration: none; }
.btn.quiet { background: var(--paper); color: var(--ink); border-color: var(--rule-strong); }
.btn.quiet:hover { background: var(--canvas); }
.btn.danger { background: var(--paper); color: var(--late); border-color: #efc2b9; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand-ink); cursor: pointer; font: inherit; }
.linkbtn:hover { text-decoration: underline; }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-strong);
  border-radius: var(--r-ctl); height: 36px; padding: 0 10px; max-width: 100%;
}
input[type=checkbox] { height: auto; }
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.field { display: flex; flex-direction: column; gap: 5px; position: relative; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field.wide { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.errorlist { color: var(--late); margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; }
/* ошибка у поля — стикер, как на входе: приклеен к углу поля и ничего не сдвигает */
.field .errorlist {
  position: absolute; z-index: 2; top: -14px; right: -8px; max-width: min(250px, 82%); margin: 0; padding: 8px 11px 9px;
  background: linear-gradient(170deg, #fff2a0, var(--sticky) 60%, #f9d85a); color: #3a2f12; font: 600 13.5px/1.3 Onest, sans-serif;
  border-radius: 2px 2px 12px 2px; transform: rotate(2.5deg); box-shadow: 0 10px 16px -8px rgba(60, 45, 10, .45), 0 1px 2px rgba(60, 45, 10, .2);
  animation: sticky-in .3s cubic-bezier(.3, 1.4, .5, 1) both;
}
.field:has(.errorlist) input, .field:has(.errorlist) select, .field:has(.errorlist) textarea { border-color: #d9a400; box-shadow: 0 0 0 3px rgba(255, 227, 107, .45); }
@keyframes sticky-in { from { opacity: 0; transform: rotate(6deg) translateY(-8px) scale(.95); } }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; }
/* поле, которое поменялось само (раздел в бланке под выбранную подсказку) — мазок жёлтого маркера */
.marked { animation: marker .9s ease-out; }
@keyframes marker { from { background-color: #fff3b0; border-color: #d9a400; box-shadow: 0 0 0 3px rgba(255, 227, 107, .55); } }

/* подсказки к полю (datalist → свой список, initSuggest в app.js): листок под полем; группы — цветом разделителей папки */
input.sel-search { min-width: min(17em, 100%); }  /* поиск вместо списка сотрудников (select[data-search]) */
input.has-suggest {
  padding-right: 30px;
  background: var(--paper) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 9px center / 15px;
}
.suggest {
  position: absolute; z-index: 30; max-height: 272px; overflow-y: auto; overscroll-behavior: contain; padding: 4px;
  background: var(--paper); border-radius: var(--r-ctl);
  box-shadow: 0 0 0 1px var(--rule-strong), 0 18px 30px -14px rgba(24, 33, 47, .42);
  animation: suggest-in .12s ease-out;
}
@keyframes suggest-in { from { opacity: 0; transform: translateY(-4px); } }
.suggest-g {
  width: fit-content; margin: 8px 6px 3px; padding: 2px 8px; border-radius: 4px;
  background: var(--tone, var(--canvas)); color: var(--tone-ink, var(--ink-2)); font-size: 11.5px; font-weight: 700;
}
.suggest-g:first-child { margin-top: 3px; }
.suggest-o { padding: 7px 10px; border-radius: 6px; color: var(--ink); font-size: 14px; line-height: 1.3; cursor: pointer; }
.suggest-o b { font-weight: 700; }
.suggest-o.on { background: var(--brand-wash); color: var(--brand-ink); }

/* поле файла (core/_filedrop.html, initFileDrop): пунктир «положить сюда»; выбранный файл — листок, как в папке */
.filedrop-box { position: relative; }
.filedrop-zone { position: relative; display: block; cursor: pointer; }
.filedrop.js input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.filedrop:not(.js) .filedrop-pick, .filedrop:not(.js) .filedrop-file, .filedrop:not(.js) .filedrop-x { display: none; }
.filedrop-pick {
  display: grid; justify-items: center; gap: 1px; padding: 15px 12px 14px; text-align: center;
  border: 1.5px dashed #aebadb; border-radius: var(--r-ctl); background: rgba(255, 255, 255, .75); color: var(--ink-2); font-size: 13px;
  transition: background-color .15s, border-color .15s;
}
.filedrop-pick .icon { width: 26px; height: 26px; margin-bottom: 5px; color: var(--felt); transition: transform .15s; }
.filedrop-pick b { color: var(--ink); font-size: 14px; font-weight: 600; }
.filedrop-pick u { color: var(--brand-ink); text-underline-offset: 2px; }
.filedrop-drop, .filedrop-tap { display: none; }
@media (hover: none) {  /* на телефоне перетаскивать нечего — просто «Выберите файл» */
  .filedrop-idle, .filedrop-pick > span { display: none; }
  .filedrop-tap { display: block; }
}
.filedrop-zone:hover .filedrop-pick { border-color: var(--brand); background: var(--brand-wash); }
.filedrop.over .filedrop-pick { border-style: solid; border-color: var(--brand); background: var(--brand-wash); }
.filedrop.over .filedrop-pick .icon { transform: translateY(-3px); }
.filedrop.over .filedrop-idle, .filedrop.over .filedrop-pick > span { display: none; }
.filedrop.over .filedrop-drop { display: block; }
.filedrop-file { display: flex; align-items: center; gap: 11px; padding: 9px 44px 9px 10px; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--paper); }
.filedrop-zone:hover .filedrop-file { border-color: var(--brand); }
.filedrop-nm { display: grid; min-width: 0; line-height: 1.3; }
.filedrop-nm b {  /* имя файла — до двух строк: в узком бланке по одной строке его не узнать */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
  font-size: 13.5px; font-weight: 600;
}
.filedrop-nm small { font-size: 12px; color: var(--muted); }
.filedrop.has-file:not(.over) .filedrop-pick, .filedrop:not(.has-file) .filedrop-file, .filedrop.over .filedrop-file { display: none; }
.filedrop-x {
  position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 30px; height: 30px; margin-top: -15px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer;
}
.filedrop-x .icon { width: 16px; height: 16px; }
.filedrop-x:hover { background: var(--canvas); color: var(--ink); }
.filedrop:not(.has-file) .filedrop-x, .filedrop.over .filedrop-x { display: none; }
.filedrop-zone:has(input:focus-visible) > :is(.filedrop-pick, .filedrop-file) { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .suggest { animation: none; }
  .filedrop-pick .icon { transition: none; }
}

.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 9px; color: var(--muted); }
.search input { padding-left: 34px; width: 240px; }

/* сообщения — листок с печатью: зелёная «принято», красная «не принято». Не сдвигают страницу */
.toasts {
  position: fixed; top: 18px; right: 22px; z-index: 50; width: min(430px, calc(100vw - 32px));
  list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px;
}
.toasts li {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 8px 12px 13px; background: #fffdf6; color: var(--ink);
  border-radius: 3px 3px 12px 3px; box-shadow: 0 18px 32px -14px rgba(24, 33, 47, .4), 0 2px 5px rgba(24, 33, 47, .12);
  animation: slip-in .32s cubic-bezier(.3, 1.3, .5, 1) both; transition: opacity .3s, transform .3s;
}
.toasts li.gone { opacity: 0; transform: translateY(-10px); }
.toasts .seal {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--seal-ok); color: var(--seal-ok);
  transform: rotate(-12deg); animation: seal-in .3s .12s cubic-bezier(.3, 1.4, .5, 1) both;
  -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 60%, rgba(0, 0, 0, .7) 62%, #000 80%); mask-image: radial-gradient(circle at 30% 30%, #000 60%, rgba(0, 0, 0, .7) 62%, #000 80%);
}
.toasts .seal .icon { stroke-width: 2.6; }
.toasts li.error .seal { border-color: var(--seal-no); color: var(--seal-no); }
.toasts .msg { flex: 1; min-width: 0; padding-top: 6px; overflow-wrap: anywhere; }
.toasts .msg a { display: block; margin-top: 4px; font-size: 12.5px; }
.toasts .copy { margin-top: 8px; }
.toasts .iconbtn { width: 28px; height: 28px; flex: none; }
@keyframes slip-in { from { opacity: 0; transform: translateY(-12px) rotate(1deg); } }
@keyframes seal-in { from { opacity: 0; transform: rotate(-12deg) scale(1.9); } }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; background: var(--abs-wash); color: var(--ink-2); white-space: nowrap;
}
.chip.both { background: var(--both-wash); color: #166b46; }
.chip.cam { background: var(--cam-wash); color: #2c44ad; }
.chip.card { background: var(--card-wash); color: #8a5b00; }
.chip.hr { background: var(--hr-wash); color: #613a9f; }
.chip.late { background: var(--late-wash); color: #9e2e1a; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* инициалы — в окне фото, как на пропуске */
.avatar {
  width: 30px; height: 30px; border-radius: 7px; display: inline-grid; place-items: center; flex: none;
  background: #e9edf7; color: #2a3a72; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: inset 0 0 0 1px rgba(27, 42, 107, .08);
}
.avatar.lg { width: 44px; height: 44px; font-size: 15px; border-radius: 10px; }
.avatar.has-photo { overflow: hidden; background: #dfe4ee; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }

.panel { border: 1px solid var(--rule); border-radius: var(--r-panel); padding: 16px 18px; background: var(--paper); }
.panel + .panel { margin-top: 14px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }

table.list { width: 100%; border-collapse: collapse; }
.table-scroll { overflow-x: auto; }
table.list th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.list td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #fafbfc; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* массовое действие над отмеченными строками */
.assign-bar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px;
  border-radius: 10px; background: var(--brand-wash); box-shadow: inset 0 0 0 1px #d6defa;
}
table.list th.pick, table.list td.pick { width: 36px; padding-right: 0; }
table.list td.pick input, table.list th.pick input { width: 17px; height: 17px; cursor: pointer; }
.person .nm { min-width: 0; }
.person .nm b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .nm span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--rule-strong); border-radius: var(--r-panel); }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.empty.done { border-style: solid; border-color: var(--rule); }
/* печати: статус дня в разборе и «всё сделано» в пустых списках */
.seal-mark, .seal-big {
  display: inline-block; border: 2px solid currentColor; font-weight: 700; color: var(--ink-2); transform: rotate(-2.5deg);
  -webkit-mask-image: radial-gradient(circle at 70% 35%, #000 60%, rgba(0, 0, 0, .78) 61%, #000 76%); mask-image: radial-gradient(circle at 70% 35%, #000 60%, rgba(0, 0, 0, .78) 61%, #000 76%);
}
.seal-mark { padding: 2px 10px; border-radius: 7px; font-size: 13px; }
.seal-mark.both { color: var(--seal-ok); }
.seal-mark.cam { color: var(--cam); }
.seal-mark.card { color: #a06a00; }
.seal-mark.hr { color: var(--hr); }
.seal-big { display: block; width: max-content; margin: 0 auto 10px; padding: 6px 18px; border-width: 3px; border-radius: 10px; font-size: 19px; font-weight: 800; color: var(--seal-ok); transform: rotate(-4deg); }
/* форма — бланк на бумаге журнала, с красной линией поля */
.paper-form {
  max-width: 860px; padding: 26px 30px 24px 60px; border-radius: 4px;
  background: linear-gradient(90deg, transparent 38px, rgba(214, 69, 65, .42) 38px 39.5px, transparent 39.5px), #fffdf6;
  box-shadow: 0 0 0 1px #ece5d4, 0 20px 32px -20px rgba(24, 33, 47, .35);
}

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }  /* иначе рядом с вкладками торчит стрелка прокрутки */
.tabs a { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.tabs a .n { color: var(--muted); font-weight: 400; margin-left: 2px; }
/* тихое действие в строке таблицы: видно, но не кричит в каждой строке */
.addlink { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; list-style: none; border-radius: 6px; padding: 3px 6px 3px 2px; }
.addlink::-webkit-details-marker { display: none; }
.addlink .icon { width: 15px; height: 15px; }
table.list tr:hover .addlink, .addlink:hover, details[open] > .addlink { color: var(--brand-ink); }

details.act { border-top: 1px solid var(--rule); padding: 12px 0 2px; }
details.act > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.act > summary::-webkit-details-marker { display: none; }
.act-row { border-top: 1px solid var(--rule); padding: 12px 0 2px; display: flex; justify-content: space-between; gap: 8px; }
details.act > summary .icon { transition: transform .15s; }
details.act[open] > summary .icon { transform: rotate(90deg); }
details.act form { margin-top: 12px; }

/* ── сводка дня: полоса показателей ─────────────────── */
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r-panel); margin-bottom: 22px; }
.strip > * { padding: 14px 18px; border-left: 1px solid var(--rule); color: inherit; }
.strip > *:first-child { border-left: 0; }
.strip > a:hover { background: var(--canvas); text-decoration: none; }
.strip .v { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.strip .t { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.strip .v.late { color: var(--late); }
.strip .v.inside { color: var(--both); }

.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 18px; }
.board a { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: var(--r-ctl); color: var(--ink); }
.board a:hover { background: var(--canvas); text-decoration: none; }
.board .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .tm { font-size: 12.5px; color: var(--muted); }
.board .tm.late { color: var(--late); font-weight: 600; }
.section-title { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 10px; }
.section-title h2 { margin: 0; }
.section-title .n {  /* число — латунный номерок на двух заклёпках, как над крючками доски */
  align-self: center; min-width: 30px; padding: 1px 11px; border-radius: 3px; text-align: center; font-size: 11.5px; font-weight: 700; color: #4a3608;
  text-shadow: 0 1px 0 rgba(255, 244, 200, .55);
  background: var(--rivet) left 3px center / 4px 4px no-repeat, var(--rivet) right 3px center / 4px 4px no-repeat, var(--brush), var(--brass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -1px 0 rgba(110, 76, 16, .35), 0 1px 2px rgba(0, 0, 0, .25);
}
.section-title .hint-line { color: var(--muted); font-size: 13px; }

/* ── доска «Кто где» на главной: пробковая доска в светлой деревянной раме, зоны с латунными табличками;
   пропуска приколоты кнопками, у каждого свой наклон; кто внутри — яркий, кто не внутри — бледный ── */
.board-head { flex-wrap: wrap; }
.board-filter { margin-left: auto; }
.pboard {
  --cork: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='a'><feTurbulence type='fractalNoise' baseFrequency='.36' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 .36  0 0 0 0 .21  0 0 0 0 .08  0 0 0 -2.1 1.12'/></filter><filter id='b'><feTurbulence type='fractalNoise' baseFrequency='.42' numOctaves='2' seed='9'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .93  0 0 0 0 .8  0 0 0 1.8 -1.12'/></filter><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='2' seed='2'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .17  0 0 0 0 .05  0 0 0 .9 -.32'/></filter><rect width='100%' height='100%' filter='url(%23c)'/><rect width='100%' height='100%' filter='url(%23a)'/><rect width='100%' height='100%' filter='url(%23b)'/></svg>");
  --grain-h: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='640' height='48'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.006 .42' numOctaves='3' seed='5'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .26  0 0 0 0 .11  0 0 0 -2 1.15'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --grain-v: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='640'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.42 .006' numOctaves='3' seed='8'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .26  0 0 0 0 .11  0 0 0 -2 1.15'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --frame: 14px;
  position: relative; display: flex; flex-direction: column; gap: 26px; padding: 22px 20px 26px; margin: 4px 1px 6px;
  border: var(--frame) solid transparent; border-radius: 4px;
  /* пробка — внутри рамки (padding-box), дерево — сама рамка (border-box): боковые планки поверх, с вертикальными волокнами */
  background:
    var(--cork) padding-box,
    radial-gradient(120% 90% at 30% 15%, rgba(255, 238, 205, .16), rgba(255, 238, 205, 0) 60%) padding-box,
    linear-gradient(160deg, #c79964, #b98754 55%, #ab7a46) padding-box,
    var(--grain-v) left top / var(--frame) 100% no-repeat border-box,
    var(--grain-v) right top / var(--frame) 100% no-repeat border-box,
    linear-gradient(90deg, #d2ad78, #dcbb88 50%, #cfa873) left top / var(--frame) 100% no-repeat border-box,
    linear-gradient(90deg, #cfa873, #dcbb88 50%, #d2ad78) right top / var(--frame) 100% no-repeat border-box,
    var(--grain-h) border-box,
    linear-gradient(180deg, #dcbb88, #d3b07c 50%, #c9a26c) border-box;
  box-shadow: inset 0 0 0 1px rgba(70, 42, 14, .55), inset 0 3px 7px rgba(60, 35, 10, .45), inset 0 -1px 2px rgba(60, 35, 10, .2),
              0 0 0 1px #8f6a3c, 0 1px 0 1px rgba(255, 240, 210, .35), 0 22px 30px -14px rgba(60, 40, 15, .55);
}
.pboard::before {  /* фаска рамки: светлый внешний край, тень к пробке */
  content: ""; position: absolute; inset: calc(-1 * var(--frame)); border-radius: 4px; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 246, 225, .55), inset 0 -1px 0 rgba(90, 60, 25, .4), inset 1px 0 0 rgba(255, 246, 225, .35), inset -1px 0 0 rgba(90, 60, 25, .3);
}
.pzone { scroll-margin-top: 20px; }
.plate {  /* латунная табличка на двух заклёпках — как табличка на двери; на пробке тень поглубже */
  position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 7px 24px; border-radius: 4px;
  background: var(--rivet) left 8px center / 7px 7px no-repeat, var(--rivet) right 8px center / 7px 7px no-repeat, var(--brush), var(--brass);
  color: #3d2c06; font-size: 13.5px; font-weight: 700; text-shadow: 0 1px 0 rgba(255, 244, 200, .6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(110, 76, 16, .4), 2px 4px 7px rgba(40, 20, 5, .5);
}
.plate b {  /* число — вставка из тёмной эмали */
  position: relative; min-width: 24px; padding: 1px 7px; border-radius: 3px; background: linear-gradient(180deg, #3a2a07, #5a420f); color: #f6e3a8;
  text-align: center; font-size: 12px; text-shadow: none; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 244, 200, .5);
}
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px 12px; }
/* пропуск на крючке: висит с наклоном, качается от курсора; в офисе — яркий с зелёной лампочкой, как пропуск при входе */
.hook { position: relative; display: block; padding-top: 13px; color: var(--ink); border-radius: 8px; }
.hook:hover { text-decoration: none; }
.hook:focus-visible { outline-color: #fff; }
.hook .peg {  /* канцелярская кнопка: пластиковая шляпка с бликом, тень падает на пробку */
  position: absolute; top: -1px; left: 50%; z-index: 2; width: 13px; height: 13px; margin-left: -6.5px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .85) 0 12%, rgba(255, 255, 255, 0) 32%),
              radial-gradient(circle at 50% 55%, var(--pin, #c0392b) 0 55%, color-mix(in srgb, var(--pin, #c0392b) 70%, #000) 100%);
  box-shadow: 2px 3px 3px rgba(40, 20, 5, .45), inset 0 -1px 1px rgba(0, 0, 0, .25);
}
.hook .mp {
  position: relative; display: block; min-height: 88px; padding: 14px 10px 9px; border-radius: 8px; background: var(--paper);  /* все пропуска одного размера */
  box-shadow: 0 10px 16px -8px rgba(40, 20, 5, .65), 0 1px 2px rgba(40, 20, 5, .35); transform-origin: 50% -6px; transform: rotate(var(--tilt, 0deg));
}
.hook .mp::before {  /* прорезь под крючок */
  content: ""; position: absolute; top: 5px; left: 50%; width: 22px; height: 4px; margin-left: -11px; border-radius: 2px; background: #e3e7ee;
}
.hook:hover .mp { animation: hook-swing .9s ease-out; }
@keyframes hook-swing {
  20% { transform: rotate(calc(var(--tilt, 0deg) + 6deg)); }
  45% { transform: rotate(calc(var(--tilt, 0deg) - 4deg)); }
  70% { transform: rotate(calc(var(--tilt, 0deg) + 1.5deg)); }
}
.mp .led { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #c8ced8; }
.hook.in .mp .led { background: #2fbf71; box-shadow: 0 0 0 2px #e2f6eb, 0 0 6px #2fbf71; }
.hook.due .mp .led { background: var(--late); box-shadow: 0 0 0 2px rgba(214, 58, 36, .2); }
.mp-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mp .avatar { width: 30px; height: 34px; font-size: 10.5px; border-radius: 6px; }  /* окошко фото 5:6, как на пропуске */
.mp .nm { min-width: 0; line-height: 1.2; }
.mp .nm b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp .nm span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp .st { display: block; margin-top: 6px; font-style: normal; font-size: 11.5px; line-height: 1.3; color: var(--ink-2); }
.mp .st.ok { color: var(--both); font-weight: 600; }
.mp .st.late { color: var(--late); font-weight: 600; }
/* кого нет в офисе — пропуск висит, но бумага бледнее: яркие пропуска сразу видно */
.hook.out .mp, .hook.left .mp { background: #e6dece; box-shadow: 0 5px 10px -8px rgba(40, 20, 5, .55); opacity: .9; }  /* выцветшая бумага: пробка чуть просвечивает */
.hook.out .mp .avatar, .hook.left .mp .avatar { background: #d8cfbc; }
.hook.left .mp { opacity: .8; }
.hook.absent .mp { background: repeating-linear-gradient(135deg, #f0ebe0 0 6px, #e4ddcf 6px 12px); }

/* ── карточка сотрудника: шапка-пропуск на войлоке ── */
.pass-head {
  position: relative; display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr) auto; align-items: start; gap: 24px;
  margin-bottom: 18px; padding: 40px 24px 26px; border-radius: 14px; background: var(--felt-bg);
}
.pass-head .actions { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }  /* столбиком: кнопок бывает до четырёх */
.pass-head .photo-origin { max-width: 220px; color: rgba(255, 255, 255, .75); text-align: right; }
.pass-head .btn.quiet { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .28); }
.pass-head .btn.quiet:hover { background: rgba(255, 255, 255, .18); }
.idpass {
  position: relative; padding: 22px 22px 14px; border-radius: 14px; background: var(--paper); color: var(--ink); transform: rotate(-.8deg);
  box-shadow: 0 22px 34px -14px rgba(0, 0, 0, .6), 0 2px 5px rgba(0, 0, 0, .3);
}
.idpass-strap {  /* лента от верха доски до зажима */
  position: absolute; bottom: 100%; left: 50%; width: 24px; height: 32px; margin-left: -12px; margin-bottom: 8px; overflow: hidden;
  background: linear-gradient(90deg, #233a9c, #2f55d4 50%, #233a9c);
}
.idpass-strap span { display: block; writing-mode: vertical-rl; font-size: 8px; font-weight: 700; letter-spacing: .3em; color: rgba(255, 255, 255, .55); margin: 2px auto 0; }
.idpass-clip {
  position: absolute; top: -12px; left: 50%; width: 32px; height: 22px; margin-left: -16px; border-radius: 5px 5px 9px 9px;
  background: linear-gradient(180deg, #e3e7ee, #8d95a3); box-shadow: 0 2px 3px rgba(0, 0, 0, .3);
}
.idpass-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.idpass-top b { color: var(--brand); font-size: 17px; font-weight: 750; letter-spacing: .02em; }
.idpass-top span { color: var(--muted); font-size: 12px; }
.idpass-top .led { margin-left: auto; align-self: center; width: 9px; height: 9px; border-radius: 50%; background: #c8ced8; box-shadow: 0 0 0 3px #f1f3f6; }
.idpass-top .led.on { background: #2fbf71; box-shadow: 0 0 0 3px #e2f6eb, 0 0 8px #2fbf71; }
.idpass-body { display: flex; gap: 18px; align-items: flex-start; }
.idpass-photo {
  position: relative; flex: none; display: grid; place-items: center; width: 96px; height: 114px; border-radius: 10px;
  background: linear-gradient(180deg, #eef1f8, #dde3f0); color: #2a3a72; font-size: 30px; font-weight: 650; letter-spacing: .02em;
}
.idpass-photo::before, .idpass-photo::after {  /* уголки рамки распознавания, как на входе */
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  background:
    linear-gradient(#5f7bd6, #5f7bd6) left top / 14px 2px no-repeat, linear-gradient(#5f7bd6, #5f7bd6) left top / 2px 14px no-repeat,
    linear-gradient(#5f7bd6, #5f7bd6) right top / 14px 2px no-repeat, linear-gradient(#5f7bd6, #5f7bd6) right top / 2px 14px no-repeat;
}
.idpass-photo::after { transform: scaleY(-1); }
.idpass-photo.has-photo { overflow: hidden; background: #dfe4ee; }
.idpass-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.idpass-photo.has-photo::before, .idpass-photo.has-photo::after { z-index: 1; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .5)); }
/* загрузка фото: кнопка в окне фото, видна при наведении (без фото — всегда) */
.photo-up { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0; }
.photo-up label {
  display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; cursor: pointer;
  background: rgba(18, 29, 82, .72); color: #fff; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .15s;
}
.photo-up label .icon { width: 14px; height: 14px; }
.photo-up input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.idpass-photo:hover .photo-up label, .photo-up label:focus-within, .idpass-photo:not(.has-photo) .photo-up label { opacity: 1; }
.idpass-photo:not(.has-photo) .photo-up label { background: rgba(18, 29, 82, .55); }
.idpass-info { min-width: 0; flex: 1; }
.idpass-info h1 { font-size: 22px; overflow-wrap: anywhere; }
.idpass-info .role { color: var(--ink-2); margin: 3px 0 10px; }
.idpass-info dl { margin: 0; display: grid; gap: 3px; font-size: 13px; }
.idpass-info dl div { display: flex; gap: 8px; }
.idpass-info dt { width: 72px; flex: none; color: var(--muted); }
.idpass-info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.idpass-info .today { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.idpass-info .today.in { color: var(--both); }
.idpass-info .today.late { color: var(--late); }
.idpass-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--rule-strong); font-size: 12px; color: var(--ink-2); }
.idpass-code .barcode { width: 128px; height: 26px; fill: var(--ink); }
.idpass-code .none { color: var(--muted); }
.idpass-code .face { margin-left: auto; color: var(--muted); }
.idpass-code .face.yes { color: var(--cam); }
.idpass.off .idpass-body, .idpass.off .idpass-code { opacity: .55; }
.idpass-stamp {  /* уволен — печать поверх пропуска */
  position: absolute; top: 46%; left: 52%; padding: 4px 14px; border: 3px solid var(--seal-no); border-radius: 8px; color: var(--seal-no);
  font-weight: 800; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; transform: translate(-50%, -50%) rotate(-11deg);
  -webkit-mask-image: radial-gradient(circle at 70% 35%, #000 60%, rgba(0, 0, 0, .75) 61%, #000 76%); mask-image: radial-gradient(circle at 70% 35%, #000 60%, rgba(0, 0, 0, .75) 61%, #000 76%);
}
.note-sticky {  /* пометка кадров — стикер на доске рядом с пропуском */
  position: relative; align-self: center; justify-self: start; max-width: 250px; padding: 24px 16px 18px; color: #3a2f12;
  font: 600 14.5px/1.35 Onest, sans-serif; background: linear-gradient(170deg, #fff2a0, var(--sticky) 60%, #f9d85a);
  border-radius: 2px 2px 14px 2px; transform: rotate(3deg); box-shadow: 0 14px 22px -10px rgba(0, 0, 0, .55), 0 2px 3px rgba(0, 0, 0, .25);
}
.note-sticky .tape { position: absolute; top: -10px; left: 50%; width: 70px; height: 22px; margin-left: -35px; background: rgba(255, 255, 255, .5); transform: rotate(-4deg); }

/* ── проходная: камеры — «экраны» с рамкой распознавания, как на пропуске при входе ── */
.post { margin-bottom: 26px; }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.post-head h2 { margin: 0; }
.srv { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--late); }
.srv i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.srv.on { color: var(--both); }
.cams { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 240px)); gap: 16px; }
.cam-screen {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; color: #9fb0e8;
  background: radial-gradient(120% 90% at 50% 40%, #24357f 0%, #121d52 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 20px -12px rgba(18, 29, 82, .6);
}
.cam-screen::before, .cam-screen::after {  /* уголки рамки распознавания */
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  background:
    linear-gradient(#7d95e6, #7d95e6) left top / 14px 2px no-repeat, linear-gradient(#7d95e6, #7d95e6) left top / 2px 14px no-repeat,
    linear-gradient(#7d95e6, #7d95e6) right top / 14px 2px no-repeat, linear-gradient(#7d95e6, #7d95e6) right top / 2px 14px no-repeat;
}
.cam-screen::after { transform: scaleY(-1); }
.cam-screen .cam-ico { width: 38px; height: 38px; stroke-width: 1.4; opacity: .7; }
.cam-who b { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 17px; font-weight: 650; }
.cam-state { position: absolute; top: 16px; left: 18px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .3); color: #d9f5e6; font-size: 11.5px; font-weight: 600; }
.cam-state i { width: 7px; height: 7px; border-radius: 50%; background: #2fbf71; box-shadow: 0 0 6px #2fbf71; }
.cam-name { position: absolute; left: 18px; bottom: 15px; color: #fff; font-size: 13px; font-weight: 600; }
.cam.off .cam-screen { background: repeating-linear-gradient(135deg, #2a3042 0 8px, #232838 8px 16px); color: #6c7590; }
.cam.off .cam-screen::before, .cam.off .cam-screen::after { opacity: .3; }
.cam.off .cam-state { color: #ffd3c9; }
.cam.off .cam-state i { background: var(--late); box-shadow: none; }
.cam.gate-t .cam-state { color: #e7ecff; }
.cam.gate-t .cam-state i { background: #d1aa52; box-shadow: none; }
.cam-meta { margin-top: 7px; font-size: 13px; color: var(--ink-2); }
.cam-meta .gate-err { color: var(--late); }
.cam-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--felt); font: 600 13px/1 Onest, sans-serif;
  cursor: pointer; opacity: 0; transition: opacity .15s;
}
.cam-play .icon { width: 14px; height: 14px; fill: currentColor; }
.cam-screen:hover .cam-play, .cam-play:focus-visible, .cam-play.peek { opacity: 1; }
.cam-screen:hover .cam-ico, .cam-screen:hover .cam-who { opacity: .25; }
@media (hover: none) { .cam-play { opacity: 1; top: auto; bottom: 12px; left: auto; right: 12px; transform: none; } }
/* живое видео — окно поверх страницы, без записи */
dialog.live { width: min(1000px, 94vw); padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #0b1027; color: #e7ecff; }
dialog.live::backdrop { background: rgba(10, 14, 30, .72); }
.live-bar { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; }
.live-bar .live-note { color: #9fb0e8; font-size: 12.5px; }
.live-bar .live-close { margin-left: auto; color: #e7ecff; }
.live-bar .live-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #6c7590; }
dialog.live.ok .live-dot { background: #ff4d3a; box-shadow: 0 0 0 4px rgba(255, 77, 58, .25); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 77, 58, 0); } }
.live-screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.live-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.live-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; color: #9fb0e8; }
table.journal tr.unknown td { background: #fffaf0; }
table.journal .unk { font-weight: 600; color: #8a5b00; }

/* ── табель ─────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.month { display: inline-flex; align-items: center; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); height: 36px; }
.month a { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink-2); }
.month a:hover { background: var(--canvas); text-decoration: none; }
.month span { padding: 0 10px; font-weight: 600; min-width: 128px; text-align: center; }

.sheet { overflow: auto; border: 1px solid var(--rule); border-radius: var(--r-panel); max-height: calc(100vh - 230px); }
table.tabel { border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tabel th, table.tabel td { border-bottom: 1px solid var(--rule); }
/* шапка — синий войлок, как меню: выходные темнее, сегодняшнее число — в красном кружке цвета закладки */
table.tabel thead th {
  position: sticky; top: 0; z-index: 2; background: var(--felt); font-weight: 500; color: rgba(223, 229, 247, .72);
  padding: 7px 0 6px; text-align: center; min-width: 64px; line-height: 1.25; border-bottom: 0;
}
table.tabel thead th b { display: block; color: #fff; font-size: 13px; font-weight: 600; }
table.tabel thead th.we { background: var(--felt-deep); color: rgba(223, 229, 247, .58); }
table.tabel thead th.we b { color: rgba(255, 255, 255, .6); }
table.tabel thead th.today { background: #2b3f95; color: #fff; }
table.tabel thead th.today b { width: 24px; margin: 0 auto; border-radius: 999px; background: var(--ribbon); }
table.tabel .who {
  position: sticky; left: 0; z-index: 1; background: var(--paper); text-align: left; padding: 6px 12px;
  min-width: 232px; max-width: 232px; border-right: 1px solid var(--rule);
}
table.tabel thead th.who { z-index: 3; background: var(--felt); color: rgba(223, 229, 247, .72); border-right-color: rgba(255, 255, 255, .12); }
table.tabel tr.dep td { background: var(--canvas); padding: 7px 12px; font-weight: 600; color: var(--ink-2); }
table.tabel tr.dep td:first-child { position: sticky; left: 0; z-index: 1; }
table.tabel tr.dep td .n { font-weight: 400; color: var(--muted); margin-left: 4px; }
table.tabel td.sum { text-align: center; font-weight: 600; min-width: 52px; padding: 0 6px; border-left: 1px solid var(--rule); }
table.tabel td.sum.late { color: var(--late); }

/* клетка: время прихода и лента дня (7:00–21:00) на серой подложке с отметкой начала рабочего дня.
   Клетка ~58×52: лента толстая, штриховка крупная — иначе на таком размере не читается */
td.c { padding: 0; height: 52px; position: relative; }
td.c > a, td.c > span.blank { display: block; height: 100%; position: relative; color: var(--ink); padding: 7px 6px 0; text-decoration: none; }
td.c > a:hover { box-shadow: inset 0 0 0 2px var(--brand); }
td.c .tm { display: block; font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
td.c .tm.late { color: var(--late); font-weight: 700; }
td.c .tm.ok { color: var(--both); font-weight: 700; }  /* позже начала дня офиса, но в своё согласованное время */
td.c .tm2 { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; }
td.c .tm2.now { font-size: 10px; font-weight: 500; color: var(--both); line-height: 1.5; letter-spacing: -.01em; }  /* ещё внутри */
/* откуда отметка — значок, как в разборе дня: ✓ совпали, карта, лицо (камера), карандаш — исправлено кадрами */
.src { display: inline-grid; place-items: center; }
.src .icon { width: 12px; height: 12px; stroke-width: 2.3; vertical-align: 0; }
.src.both { color: var(--both); }
.src.card { color: #a06a00; }
.src.cam { color: var(--cam); }
.src.hr { color: var(--hr); }
td.c .src { position: absolute; bottom: 9px; right: 5px; }  /* строка ухода — она короче */
.fl { display: inline-grid; place-items: center; width: 13px; height: 13px; border-radius: 50%; background: var(--late); color: #fff; font-size: 9.5px; font-weight: 800; line-height: 1; }
td.c .fl { position: absolute; top: 8px; right: 5px; }
td.c.we { background: #e9ecf0; }
td.c.today { background: #eef2fe; }
td.c.s-abs { background: repeating-linear-gradient(135deg, #d9dee5 0 6px, #f1f3f5 6px 12px); }
td.c.s-abs .code { display: grid; place-items: center; height: 100%; padding: 0; font-weight: 700; color: var(--ink); font-size: 14px; }
td.c .none { color: #aab1bc; }
td.c.na { background: #fbfbfc; }
td.c.na.we { background: #f0f2f5; }
td.c.from { box-shadow: inset 3px 0 0 var(--felt); }
td.c.till { box-shadow: inset -3px 0 0 var(--felt); }
td.c.from.till { box-shadow: inset 3px 0 0 var(--felt), inset -3px 0 0 var(--felt); }
td.c .na-l { position: absolute; bottom: 6px; font-size: 10.5px; color: var(--felt); font-weight: 600; }
td.c .na-l.принят { right: 5px; }
td.c .na-l.уволен { left: 5px; }
/* табель в часах: засчитано по правилам закрытия месяца; меньше нормы дня — красным, красная точка — опоздал */
td.c .hrs { display: block; padding-top: 8px; font-size: 16px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
td.c .hrs.short { color: var(--late); }
td.c .hrs.off { color: #aab1bc; font-weight: 500; }
td.c .hrs.q { color: #aab1bc; font-weight: 600; }
td.c .hrs.late::before { content: ''; position: absolute; top: 7px; left: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--late); }
table.tabel thead th.hol b { color: #ffc2c5; }

/* обозначения табеля — по кнопке, а не строкой под таблицей */
.legend-pop { position: relative; }
.legend-pop > summary { list-style: none; }
.legend-pop > summary::-webkit-details-marker { display: none; }
.legend-pop[open] > summary { background: var(--canvas); }
.legend-body {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 330px; padding: 12px 14px; border-radius: 10px;
  background: var(--paper); box-shadow: 0 18px 34px -12px rgba(24, 33, 47, .35), 0 0 0 1px var(--rule); font-size: 13px;
}
.legend-body p { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 0; }
.legend-body .k { flex: none; width: 92px; display: inline-flex; align-items: center; gap: 4px; }
.legend-body .tm { font-weight: 600; }
.legend-body .tm.late { color: var(--late); }
.legend-body .tm.ok { color: var(--both); }
.legend-body .tm2 { color: var(--muted); font-size: 12px; }
.legend-body .src .icon { width: 15px; height: 15px; }
.legend-body .hrs { font-weight: 700; font-size: 14px; }
.legend-body .hrs.short { color: var(--late); }


/* ── разбор дня ─────────────────────────────────────── */
.day-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.day-head .hand-date { margin-left: auto; align-self: flex-start; font: 600 23px/1 Caveat, cursive; color: #22398f; white-space: nowrap; }
.day-head > div { min-width: 0; }
.day-head h1 { font-size: 22px; }
.day-head .sub { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r-panel); margin: 16px 0; }
.facts > div { padding: 12px 14px; border-left: 1px solid var(--rule); }
.facts > div:first-child { border-left: 0; }
.facts .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.facts .v.late { color: var(--late); }
.facts .v.ok, .facts .okt { color: var(--both); }
.facts .t { font-size: 12.5px; color: var(--muted); }

.timeline { margin: 4px 0 18px; }
.timeline .scale { position: relative; height: 18px; margin-left: 82px; font-size: 11px; color: var(--muted); }
.timeline .scale span { position: absolute; transform: translateX(-50%); }
.timeline .lane { display: flex; align-items: center; height: 28px; }
.timeline .lane > b { width: 82px; flex: none; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.timeline .line { position: relative; flex: 1; height: 100%; border-top: 1px solid var(--rule); }
.timeline .start { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--rule-strong); }
.timeline .stay { position: absolute; top: 10px; height: 8px; border-radius: 4px; }
.timeline .stay.both { background: var(--both); }
.timeline .stay.cam { background: var(--cam); }
.timeline .stay.card { background: repeating-linear-gradient(135deg, #9c6200 0 4px, #f3c24f 4px 8px); }
.timeline .stay.hr { box-shadow: inset 0 0 0 1.5px var(--hr); }
/* источник — полоса «внутри»: начало — вход, конец — выход; вырез с красным пунктиром — выходил */
.timeline .lane.src > b { display: flex; align-items: center; gap: 5px; }
.timeline .lane.src > b .icon { width: 14px; height: 14px; color: var(--muted); vertical-align: 0; }
.timeline .in-seg { position: absolute; top: 9px; height: 10px; min-width: 4px; border-radius: 5px; }
.timeline .line.card .in-seg { background: repeating-linear-gradient(135deg, #9c6200 0 4px, #f3c24f 4px 8px); }
.timeline .line.camera .in-seg { background: var(--cam); }
.timeline .in-seg.open { border-radius: 5px 0 0 5px; -webkit-mask-image: linear-gradient(90deg, #000 65%, transparent); mask-image: linear-gradient(90deg, #000 65%, transparent); }
.timeline .out-gap { position: absolute; top: 6px; z-index: 1; height: 16px; min-width: 6px; background: var(--paper); cursor: help; }
.timeline .out-gap::after { content: ""; position: absolute; left: 1px; right: 1px; top: 7px; border-top: 2px dotted var(--seal-no); }
.timeline .odd { position: absolute; top: 5px; width: 2px; height: 18px; margin-left: -1px; border-radius: 1px; background: var(--seal-no); cursor: help; }
.timeline .nopass { position: absolute; left: 6px; top: 5px; font-size: 12px; color: var(--muted); }
.mk-chip { display: inline-flex; align-items: center; gap: 1px; padding: 1px 4px; margin-right: 6px; border: 1.5px solid currentColor; border-radius: 6px; vertical-align: -3px; }
.mk-chip .icon { width: 13px; height: 13px; stroke-width: 2.2; vertical-align: 0; }
.mk-chip .src { margin-right: 2px; }
.mk-chip.in { color: var(--seal-ok); }
.mk-chip.out { color: var(--seal-no); }

.flags { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.flags li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: var(--r-ctl); background: var(--late-wash); color: #8f2a18; font-size: 13px; }
.flags li .icon { margin-top: 1px; }
.history p { font-size: 13px; padding: 8px 0; border-top: 1px solid var(--rule); margin: 0; }
/* вкладка «График»: крупно — во сколько сегодня начинается день, ниже периоды и форма */
.sched { max-width: 760px; }
.sched-now { display: grid; gap: 2px; margin-bottom: 22px; }
.sched-now b { font-size: 34px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sched-row { display: flex; align-items: baseline; gap: 14px; padding: 10px 0; border-top: 1px solid var(--rule); }
.sched-row:last-of-type { border-bottom: 1px solid var(--rule); }
.sched-row > b { min-width: 70px; font-variant-numeric: tabular-nums; }
.sched-row > span { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.sched-form { margin-top: 22px; }
.sched-form h3 { margin: 0 0 12px; font-size: 15px; }
/* своё время — только когда выбрано «Другое время…» */
.own-time { display: none; }
form:has(select[name=schedule] option[value=own]:checked) .own-time { display: flex; }
.facts .early { color: var(--late); font-weight: 600; }
.history p:first-child { border-top: 0; }
.passes td { padding: 7px 8px; font-size: 13px; }

/* ── боковая панель ─────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(24, 33, 47, .28); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); z-index: 41; background: var(--paper);
  box-shadow: -12px 0 32px rgba(24, 33, 47, .14); transform: translateX(102%); transition: transform .2s ease-out;
  display: flex; flex-direction: column;
}
.drawer .drawer-bar { display: flex; justify-content: flex-end; gap: 4px; padding: 10px 12px 0; }
.drawer .drawer-body { overflow: auto; padding: 0 24px 28px; }
body.drawer-open { overflow: hidden; }
body.drawer-open .scrim { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .drawer, .scrim, details.act > summary .icon { transition: none; }
  .toasts li, .toasts .seal, .field .errorlist, dialog.live.ok .live-dot { animation: none; }
  .hook:hover .mp { animation: none; }
}

/* ── вход ───────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--felt-bg); }
.login-box { width: 100%; max-width: 380px; }
.login-box .wordmark { justify-content: center; padding-bottom: 46px; }
.login-box .wordmark b { font-size: 26px; color: #fff; }
.login-box .wordmark span { font-size: 20px; color: #9fb0e8; }
.login-box form {
  position: relative; background: var(--paper); border-radius: 14px; padding: 30px 26px 26px; display: flex; flex-direction: column; gap: 14px;
  transform: rotate(-.8deg); box-shadow: 0 24px 36px -14px rgba(0, 0, 0, .6), 0 2px 5px rgba(0, 0, 0, .3);
}
.login-box form::before {  /* зажим ленты */
  content: ""; position: absolute; top: -12px; left: 50%; width: 32px; height: 22px; margin-left: -16px; border-radius: 5px 5px 9px 9px;
  background: linear-gradient(180deg, #e3e7ee, #8d95a3); box-shadow: 0 2px 3px rgba(0, 0, 0, .3);
}
.login-box form::after {
  content: ""; position: absolute; bottom: calc(100% + 8px); left: 50%; width: 24px; height: 30px; margin-left: -12px;
  background: linear-gradient(90deg, #233a9c, #2f55d4 50%, #233a9c);
}
.login-box .idpass-top { margin-bottom: 2px; }
.login-box input { width: 100%; height: 42px; }
.login-box .btn { height: 42px; justify-content: center; }
.login-box .note { text-align: center; margin-top: 14px; color: var(--muted); font-size: 12.5px; }

/* ── страница входа: пропуск на ленте ──────────────── */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr); }
.gate-art { position: relative; overflow: hidden; background: var(--brand); perspective: 1100px; }
/* маятник: лента от верхнего края, качается вокруг точки крепления */
.pendulum { position: absolute; top: -8px; left: 50%; width: 320px; margin-left: -160px; transform-origin: 50% 0; display: flex; flex-direction: column; align-items: center; }
.lanyard {
  width: 26px; height: 31vh; min-height: 120px; background: #16234f; overflow: hidden;
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, .06), inset -2px 0 0 rgba(0, 0, 0, .2);
}
.lanyard span { display: block; writing-mode: vertical-rl; white-space: nowrap; color: rgba(255, 255, 255, .55); font-size: 10px; font-weight: 700; letter-spacing: .35em; line-height: 26px; }
.clip { width: 34px; height: 30px; margin-top: -4px; border-radius: 6px 6px 10px 10px; background: linear-gradient(180deg, #c9ced8, #8d95a3); box-shadow: 0 2px 3px rgba(0, 0, 0, .25); position: relative; z-index: 2; }
.clip::after { content: ""; position: absolute; left: 50%; bottom: -12px; width: 6px; height: 16px; margin-left: -3px; border-radius: 3px; background: #8d95a3; }

.badge {
  --gx: 50%;
  position: relative; width: 300px; margin-top: 4px; padding: 28px 24px 20px; border-radius: 20px; background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 24px 48px -16px rgba(8, 20, 60, .55), 0 6px 14px rgba(8, 20, 60, .25);
  transform-style: preserve-3d; will-change: transform;
}
.badge-slot { position: absolute; top: 9px; left: 50%; width: 46px; height: 8px; margin-left: -23px; border-radius: 4px; background: #e3e7ee; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.badge-head { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.badge-head b { font-size: 20px; font-weight: 750; letter-spacing: .03em; color: var(--brand); }
.badge-head span { font-size: 12px; color: var(--muted); flex: 1; }
.led { width: 9px; height: 9px; border-radius: 50%; background: #c8ced8; align-self: center; box-shadow: 0 0 0 3px #f1f3f6; }
.gate.reading .led { background: #f2b33d; box-shadow: 0 0 0 3px #fdf0d5, 0 0 10px #f2b33d; }
.gate.denied .led { background: #e5533d; box-shadow: 0 0 0 3px #fbe1dc, 0 0 10px #e5533d; }

.badge-photo {
  position: relative; width: 132px; height: 156px; margin: 20px 0 18px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(180deg, #eef1f6, #e2e7ef); display: grid; place-items: center;
}
/* рамка распознавания — как у камеры на входе */
.badge-photo .frame { position: absolute; inset: 12px; pointer-events: none; opacity: .55;
  background:
    linear-gradient(var(--brand), var(--brand)) top left / 16px 2px no-repeat,
    linear-gradient(var(--brand), var(--brand)) top left / 2px 16px no-repeat,
    linear-gradient(var(--brand), var(--brand)) top right / 16px 2px no-repeat,
    linear-gradient(var(--brand), var(--brand)) top right / 2px 16px no-repeat,
    linear-gradient(var(--brand), var(--brand)) bottom left / 16px 2px no-repeat,
    linear-gradient(var(--brand), var(--brand)) bottom left / 2px 16px no-repeat,
    linear-gradient(var(--brand), var(--brand)) bottom right / 16px 2px no-repeat,
    linear-gradient(var(--brand), var(--brand)) bottom right / 2px 16px no-repeat; }
.badge-photo .scan { position: absolute; left: 10px; right: 10px; top: 14px; height: 2px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 12px 2px rgba(47, 85, 212, .55); opacity: 0; }
.gate.scanning .badge-photo .scan, .gate.reading .badge-photo .scan { opacity: 1; animation: badge-scan 1.6s ease-in-out infinite alternate; }
.gate.scanning .badge-photo .frame, .gate.reading .badge-photo .frame { opacity: 1; }
@keyframes badge-scan { from { top: 14px; } to { top: calc(100% - 16px); } }

.badge-name { font-size: 23px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; min-height: 26px; }
.gate:not(.typed) .badge-name { color: #b3bac6; }
.gate.autofilled .badge-name { color: var(--ink); }
.badge-role { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.badge-code { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--rule-strong); }
.badge-code svg { display: block; width: 100%; height: 34px; fill: var(--ink); }
.badge-code span { display: block; margin-top: 6px; font-size: 12px; letter-spacing: .32em; color: var(--ink-2); }
/* блик ламината — двигается вместе с наклоном */
.glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(105deg, transparent calc(var(--gx) - 30%), rgba(255, 255, 255, .55) var(--gx), transparent calc(var(--gx) + 30%)); }

.gate.denied .badge { animation: badge-deny .5s ease-out 1; }
@keyframes badge-deny { 0%, 100% { translate: 0 0; } 20% { translate: -9px 0; } 40% { translate: 8px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; } }

.gate-form { display: grid; place-items: center; padding: 40px 32px; background: var(--paper); }
.gate-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.gate-card .gate-mark { padding: 0 0 18px; }
.gate-card h1 { font-size: 30px; }
.gate-card > .muted { margin: -8px 0 6px; }
.gate-card input { width: 100%; height: 44px; }
.gate-card .btn { height: 44px; justify-content: center; font-size: 15px; margin-top: 4px; }
.gate-note { color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }
.gate-card .flags li { display: block; }
/* фон входа: «студийный свет» + гильош — тонкий защитный узор, как на пропусках и документах */
.gate { position: relative; overflow: hidden; background: var(--canvas); }
/* на входе выделяется только то, что вводишь: логин и пароль */
.gate { -webkit-user-select: none; user-select: none; }
.gate input { -webkit-user-select: text; user-select: text; }
.door-left, .door-right { position: relative; overflow: hidden; z-index: 1; transition: transform .65s cubic-bezier(.7, 0, .25, 1); }
.gate-art .pendulum, .gate-card { position: relative; z-index: 1; }
.gate-address { position: absolute; left: 32px; bottom: 22px; margin: 0; z-index: 1; color: rgba(255, 255, 255, .7); font-size: 13px; }
.gate-art::after, .gate-form::after {  /* зерно: убирает «пластиковую» плоскость и полосы на градиенте */
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.gate-art::after { opacity: .22; }
.gate-form::after { opacity: .32; mix-blend-mode: multiply; filter: contrast(.2) brightness(1.6); }
/* стена из дубовых реек: тёплый свет сверху, тень к полу, блик на рёбрах */
.gate-art {
  background:
    radial-gradient(70% 55% at 50% 28%, rgba(255, 226, 180, .30), rgba(255, 226, 180, 0) 70%),
    linear-gradient(180deg, rgba(20, 10, 2, 0) 55%, rgba(20, 10, 2, .38) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, #b98251 0 20px, #3a2312 20px 24px, #c48c59 24px 44px, #3a2312 44px 48px, #ad7748 48px 68px, #3a2312 68px 72px);
}
.gate-art::before {  /* волокна дерева */
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply; opacity: .32;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='600'><filter id='w'><feTurbulence type='fractalNoise' baseFrequency='.018 .42' numOctaves='3' seed='4'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .3  0 0 0 0 .18  0 0 0 1.2 -.35'/></filter><rect width='100%' height='100%' filter='url(%23w)'/></svg>");
}
.gate-form {
  background:
    radial-gradient(38% 70% at 0% 52%, rgba(47, 85, 212, .09), rgba(47, 85, 212, 0) 72%),
    linear-gradient(180deg, #ffffff 0%, #f5f7fc 100%);
}
.guilloche { position: absolute; pointer-events: none; z-index: 0; fill: none; stroke-linecap: round; }
.g-waves { inset: 0; width: 100%; height: 100%; stroke: rgba(47, 85, 212, .085); stroke-width: .8; }
/* плавное затухание узора под формой, чтобы поля читались */
.gate-form .g-waves { -webkit-mask-image: radial-gradient(48% 42% at 55% 50%, transparent 55%, #000 100%); mask-image: radial-gradient(48% 42% at 55% 50%, transparent 55%, #000 100%); }
/* защитная полоска на самом пропуске */
.badge-head { position: relative; z-index: 1; }
.badge-guard { position: absolute; left: 0; right: 0; top: 16px; height: 50px; width: 100%; stroke: rgba(47, 85, 212, .22); stroke-width: .6; fill: none; pointer-events: none; }
/* размытая тень бейджа на «стене»; JS сдвигает её против наклона */
.cast {
  position: absolute; top: 58px; left: 50%; width: 300px; height: 470px; margin-left: -150px; z-index: 0;
  border-radius: 24px; background: rgba(12, 18, 50, .55); filter: blur(22px); transform: translate(22px, 30px);
}
.badge { z-index: 1; }

/* человечек: глаза закрываются на пароле, грустит при отказе, улыбается при входе */
.badge-photo .face { position: absolute; inset: 0; width: 100%; height: 100%; }
.face .f-eyes-closed, .face .f-happy, .face .f-sad { display: none; }
.gate.scanning .face .f-eyes-open { display: none; }
.gate.scanning .face .f-eyes-closed { display: inline; }
.gate.denied .face .f-calm, .gate.granted .face .f-calm { display: none; }
.gate.denied .face .f-sad { display: inline; }
.gate.denied .face .f-brows path:first-child { transform: rotate(-12deg); transform-origin: 56px 63px; }
.gate.denied .face .f-brows path:last-child { transform: rotate(12deg); transform-origin: 76px 63px; }
.gate.granted .face .f-happy { display: inline; }
.gate.granted .face .f-eyes-closed { display: none; }
.gate.granted .face .f-eyes-open { display: inline; }
.badge-photo .frame, .badge-photo .scan { z-index: 1; }
.gate.granted .badge-photo .frame { opacity: 1; filter: hue-rotate(-95deg) saturate(1.4); }
.gate.granted .led { background: #2fbf71; box-shadow: 0 0 0 3px #d9f4e5, 0 0 10px #2fbf71; }
.gate.granted .badge-role { color: var(--both); font-weight: 600; }

/* печать «Отказано» поверх карты */
.stamp {
  position: absolute; left: 50%; top: 46%; z-index: 3; pointer-events: none;
  padding: 6px 16px 5px; border: 4px solid #d63a24; border-radius: 10px; color: #d63a24;
  font-size: 34px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
  background: rgba(255, 255, 255, .72); opacity: 0; transform: translate(-50%, -50%) rotate(-14deg) scale(1.6);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .75) 61%, #000 75%); mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, .75) 61%, #000 75%);
}
/* обе печати «Отказано» — на пропуске и в журнале — висят на одном классе .denied, поэтому падают и уходят одновременно */
.stamp, .j-deny { transition: opacity .2s ease-out, transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.gate.denied .stamp { opacity: 1; transform: translate(-50%, -50%) rotate(-14deg) scale(1); }

/* успешный вход: половины разъезжаются, как двери */
.gate-welcome { position: absolute; inset: 0; z-index: 0; display: grid; place-content: center; text-align: center; color: var(--ink-2); }
.gate-welcome .wordmark { justify-content: center; padding: 0 0 8px; }
.gate-welcome .wordmark b { font-size: 28px; }
.gate-welcome .wordmark span { font-size: 22px; }
.gate.opening .door-left { transform: translateX(-101%); }
.gate.opening .door-right { transform: translateX(101%); }
.btn:disabled { opacity: .7; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
  .gate.scanning .badge-photo .scan, .gate.reading .badge-photo .scan, .gate.denied .badge { animation: none; }
  .stamp, .j-deny, .sticky { transition: none; }
  .door-left, .door-right { transition: none; }
}
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .gate-art { height: 372px; }
  .pendulum { transform: scale(.66); }
  .lanyard { height: 64px; min-height: 0; }
  .gate-form { place-items: start center; padding: 28px 18px 40px; }
  .gate-address { display: none; }
  .cast { top: 50px; }
  .gate-form .g-waves { opacity: .55; -webkit-mask-image: radial-gradient(90% 60% at 50% 42%, transparent 45%, #000 100%); mask-image: radial-gradient(90% 60% at 50% 42%, transparent 45%, #000 100%); }
}

/* ── доска пропусков ────────────────────────────────── */
.layer { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.layer > svg { position: absolute; top: 0; left: 0; display: block; }
.lanyard { height: 12vh; }
.minis { position: absolute; inset: 0; }
.mini { position: absolute; width: 0; height: 0; --sc: 1; }
/* латунный номерок над крючком, как в ключницах */
.mini .tag {
  position: absolute; left: calc(-12px * var(--sc)); top: calc(-24px * var(--sc)); width: calc(24px * var(--sc)); height: calc(13px * var(--sc));
  border-radius: 2px; color: #3b2a07; font: 700 calc(8.5px * var(--sc))/calc(13px * var(--sc)) Onest, sans-serif;
  background: var(--rivet) left calc(1.5px * var(--sc)) center / calc(3px * var(--sc)) calc(3px * var(--sc)) no-repeat,
              var(--rivet) right calc(1.5px * var(--sc)) center / calc(3px * var(--sc)) calc(3px * var(--sc)) no-repeat, var(--brush), var(--brass);
  text-align: center; font-style: normal; letter-spacing: .02em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 1px rgba(0, 0, 0, .35);
}
.mini .hook { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #f2f4f8, #8f97a5); box-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.mini .swing { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
.mini .cord { position: absolute; left: -1.5px; top: 0; width: 3px; height: calc(26px * var(--sc)); background: var(--ly); }
.mini-card {
  position: absolute; left: calc(-32px * var(--sc)); top: calc(24px * var(--sc)); width: calc(64px * var(--sc)); height: calc(86px * var(--sc));
  background: #fff; border-radius: calc(7px * var(--sc)); padding: calc(6px * var(--sc)); box-shadow: 0 6px 12px rgba(5, 12, 45, .45);
  filter: saturate(.85) brightness(.93);
}
.mini-card b { display: block; height: calc(5px * var(--sc)); width: 55%; border-radius: 2px; background: var(--brand); opacity: .8; }
.mini-card svg { display: block; width: 62%; margin: calc(4px * var(--sc)) 0; border-radius: 3px; background: #e9edf4; }
.mini-card span { display: block; height: calc(4px * var(--sc)); width: 80%; border-radius: 2px; background: #c9cfd9; margin-top: calc(3px * var(--sc)); }
.mini-card span.s2 { width: 50%; }
.mini svg .f-eyes-closed, .mini svg .f-happy, .mini svg .f-sad { display: none; }
.gate.granted .pendulum { transform: translateY(-115%) !important; transition: transform .5s cubic-bezier(.6, 0, .3, 1); }
/* автозаполнение браузера: ловим момент подстановки (см. login.js) */
@keyframes autofill-on { from { outline-color: transparent; } to { outline-color: transparent; } }
input:-webkit-autofill { animation: autofill-on 1ms; }
@media (max-width: 860px) {
  .lanyard { height: 40px; }
}

/* ── правая половина: стойка вахты из терраццо и раскрытый журнал ── */
@font-face { font-family: Caveat; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/caveat-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Caveat; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/caveat-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Caveat; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/caveat-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Caveat; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url(../fonts/caveat-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.gate-form {
  --ink-pen: #22398f; --paper-line: rgba(80, 120, 200, .24);
  background:
    radial-gradient(60% 42% at 0% 24%, rgba(255, 214, 160, .26), rgba(255, 214, 160, 0) 72%),
    radial-gradient(65% 55% at 48% 42%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(60, 45, 30, .1)),
    var(--terrazzo, none) 0 0 / 320px 320px,
    #ebe7df;
}
.gate-form::after { opacity: .3; mix-blend-mode: multiply; filter: contrast(.25) brightness(1.55); }
/* край стойки: стойка стоит перед стеной. Скруглённый край камня ловит свет, стена за стойкой уходит в тень */
.gate-form::before {
  content: ""; position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 16px; pointer-events: none;
  background: linear-gradient(90deg, rgba(45, 32, 20, .7) 0, rgba(45, 32, 20, .2) 1.5px, rgba(255, 255, 255, .85) 3.5px, rgba(255, 255, 255, .4) 8px, rgba(255, 255, 255, 0) 16px);
}
.gate-art { box-shadow: inset -70px 0 80px -30px rgba(20, 10, 2, .55), inset -18px 0 14px -12px rgba(20, 10, 2, .6); }
.desk { position: absolute; inset: 0; pointer-events: none; }
.prop { position: absolute; display: block; filter: drop-shadow(7px 10px 10px rgba(50, 35, 20, .26)) drop-shadow(1px 2px 2px rgba(50, 35, 20, .2)); }
.prop.cup { z-index: 2; width: 184px; top: -26px; right: -20px; }
.prop.pen { z-index: 2; width: 210px; bottom: 12%; right: 6px; transform: rotate(-58deg); }
.prop.paperclip { z-index: 2; width: 16px; }
.prop.paperclip.c1 { top: 5%; left: 7%; transform: rotate(24deg); }
.prop.paperclip.c2 { top: 8%; left: 12%; transform: rotate(-8deg); }
.cup-swirl { transform-origin: 100px 100px; animation: cup-swirl 48s linear infinite; }  /* пенка медленно плывёт по кругу */
@keyframes cup-swirl { to { transform: rotate(360deg); } }
.pn-logo { font-family: Onest, sans-serif; }

/* книга: обложка из ткани, слева страница с сегодняшними записями и формой, справа чистая — уходит за край экрана */
.gate-form { justify-items: start; padding-left: 58px; }
.ledger { position: relative; z-index: 1; width: clamp(300px, calc(100% - 140px), 430px); transform: rotate(-.6deg); }
.ledger::before {
  content: ""; position: absolute; top: -14px; bottom: -14px; left: -14px; right: calc(-100% - 14px); z-index: -1; border-radius: 9px;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 2px, transparent 2px 4px), linear-gradient(135deg, #24366f, #16224f);
  box-shadow: 12px 34px 50px -20px rgba(40, 28, 15, .6), 4px 10px 18px rgba(40, 28, 15, .25);
}
.ledger-right, .ledger-page { background: #fffdf6; }
.ledger-right {
  position: absolute; top: 0; bottom: 0; left: 100%; width: 100%; overflow: hidden; padding: 26px 28px 20px 46px; border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, transparent 36px, rgba(214, 69, 65, .45) 36px 37.5px, transparent 37.5px), #fffdf6;
  box-shadow: inset 26px 0 26px -18px rgba(60, 45, 30, .28);
}
.gate-card.ledger-page {
  max-width: none; gap: 12px; padding: 26px 30px 26px 46px; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, transparent 36px, rgba(214, 69, 65, .45) 36px 37.5px, transparent 37.5px), #fffdf6;
  box-shadow: inset -26px 0 26px -18px rgba(60, 45, 30, .26);
}
.lp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: #5f6b7c; border-bottom: 3px double var(--paper-line); padding-bottom: 6px; }
.lp-date { font: 600 21px/1 Caveat, cursive; color: var(--ink-pen); }
.ledger-page h1 { font-size: 27px; margin-top: 4px; }
.ledger-page > .muted { margin: -6px 0 2px; }
.lp-cols, .lp-row { display: grid; grid-template-columns: 58px 1fr 70px; gap: 8px; align-items: end; }
.lp-cols { font-size: 11px; color: #6b7586; border-bottom: 1px solid var(--paper-line); padding: 6px 0 4px; }
.lp-row { height: 34px; border-bottom: 1px solid var(--paper-line); color: var(--ink-pen); overflow: hidden; }
.lp-row i { font-style: normal; font-size: 10.5px; color: #9aa2b1; align-self: center; }
.lp-row b { font: 600 21px/1 Caveat, cursive; padding-bottom: 4px; }
.lp-row span { padding-bottom: 3px; opacity: .85; }
.lp-row span svg { display: block; max-width: 100%; }
.ledger-right .lp-cols { margin-top: 12px; }

/* твоя строка: пишешь от руки, ручкой */
.lp-field > span { font-size: 12.5px; color: #5b6576; font-weight: 500; }
.lp-field input {
  height: 44px; padding: 0 4px; border: 0; border-bottom: 1.5px solid rgba(80, 120, 200, .5); border-radius: 0; background: transparent;
  font: 600 27px/1 Caveat, cursive; color: var(--ink-pen);
}
.lp-field input::placeholder { font: 400 14px Onest, sans-serif; color: #8a93a3; }
.lp-field input:focus { box-shadow: none; border-bottom-color: var(--brand); background: linear-gradient(0deg, rgba(47, 85, 212, .05), transparent 60%); }
.gate-card .btn.lp-stamp {
  align-self: flex-start; width: 58%; height: 46px; margin-top: 8px; background: transparent; color: #2c4fc4; border: 3px solid #2c4fc4; border-radius: 10px;
  font-weight: 800; letter-spacing: .1em; text-transform: uppercase; transform: rotate(-2deg);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 62%, rgba(0, 0, 0, .78) 63%, #000 78%); mask-image: radial-gradient(circle at 30% 40%, #000 62%, rgba(0, 0, 0, .78) 63%, #000 78%);
}
.gate-card .btn.lp-stamp:hover { background: rgba(44, 79, 196, .07); }
.ledger-page .gate-note { font-size: 12px; }
.j-stamp {
  position: absolute; right: 30px; bottom: 96px; padding: 4px 14px; border: 3px solid #1e8a5a; border-radius: 8px; color: #1e8a5a;
  font-weight: 800; font-size: 24px; letter-spacing: .1em; text-transform: uppercase; transform: rotate(-12deg) scale(1.6); opacity: 0; pointer-events: none;
}
.gate.granted .j-stamp { animation: j-stamp .28s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes j-stamp { to { opacity: .9; transform: rotate(-12deg) scale(1); } }
/* ленточка-закладка */
.ribbon {
  position: absolute; top: -14px; left: calc(100% + 18px); width: 13px; height: calc(100% + 60px);
  background: linear-gradient(90deg, #a31f29, #d3343e 45%, #b0222c); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 10px), 0 100%);
  filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, .25));
}
@media (max-width: 860px) {
  .gate-form { justify-items: center; padding-left: 18px; }
  .gate-form::before { top: 0; right: 0; bottom: auto; width: auto; height: 16px;
    background: linear-gradient(180deg, rgba(45, 32, 20, .7) 0, rgba(45, 32, 20, .2) 1.5px, rgba(255, 255, 255, .85) 3.5px, rgba(255, 255, 255, .4) 8px, rgba(255, 255, 255, 0) 16px); }
  .gate-art { box-shadow: inset 0 -70px 80px -30px rgba(20, 10, 2, .55), inset 0 -18px 14px -12px rgba(20, 10, 2, .6); }
  .ledger { width: calc(100% - 20px); transform: none; margin-top: 8px; }
  .ledger-right, .prop.cup, .prop.paperclip { display: none; }
  .ledger::before { left: -10px; right: -10px; }
  .gate-card.ledger-page { border-radius: 3px; padding: 20px 18px 22px 40px; box-shadow: none; }
  .ribbon { left: 14px; }
  .prop.pen { width: 150px; bottom: 6px; right: -10px; transform: rotate(-26deg); }
}
@media (prefers-reduced-motion: reduce) { .gate.granted .j-stamp { animation: none; opacity: .9; transform: rotate(-12deg); } .cup-swirl { animation: none; } }


.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* печать «Отказано» в журнале — поверх строк с логином и паролем */
.j-deny {
  position: absolute; left: 50%; top: 56%; padding: 4px 16px; border: 4px solid #d63a24; border-radius: 10px; color: #d63a24; pointer-events: none;
  font-weight: 800; font-size: 30px; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; background: rgba(255, 253, 246, .5);
  opacity: 0; transform: translate(-50%, -50%) rotate(-9deg) scale(1.6);
  -webkit-mask-image: radial-gradient(circle at 70% 35%, #000 60%, rgba(0, 0, 0, .75) 61%, #000 76%); mask-image: radial-gradient(circle at 70% 35%, #000 60%, rgba(0, 0, 0, .75) 61%, #000 76%);
}
.gate.denied .j-deny { opacity: .92; transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
.gate.denied .ledger { animation: ledger-thump .32s ease-out 1; }
@keyframes ledger-thump { 35% { scale: .992; } }
/* стикер с подсказкой: приклеивается у края страницы и не сдвигает журнал.
   На компьютере держится за страницу у пароля, на телефоне — поверх прошлых записей, чтобы не закрыть поля */
.lp-past { display: flex; flex-direction: column; gap: inherit; }
.sticky {
  position: absolute; right: -158px; top: 45%; z-index: 3; width: 148px; min-height: 146px; padding: 26px 15px 16px;
  background: linear-gradient(170deg, #fff2a0, #ffe36b 60%, #f9d85a); box-shadow: 0 14px 20px -10px rgba(60, 45, 10, .45), 0 2px 3px rgba(60, 45, 10, .2);
  border-radius: 2px 2px 14px 2px; opacity: 0; transform: rotate(7deg) translateY(-14px) scale(.96); pointer-events: none;
  transition: opacity .2s, transform .35s cubic-bezier(.3, 1.4, .5, 1);
}
.sticky .tape { position: absolute; top: -10px; left: 50%; width: 78px; height: 22px; margin-left: -39px; background: rgba(255, 255, 255, .55); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); transform: rotate(-4deg); }
.sticky p { margin: 0; font: 600 15px/1.3 Onest, sans-serif; color: #3a2f12; }
.gate.noted .sticky { opacity: 1; transform: rotate(7deg); }
.gate[data-note=caps] .sticky { background: linear-gradient(170deg, #ffd9e6, #ffc2d6 60%, #fbb4cb); }
@media (max-width: 1100px) { .sticky { right: -64px; width: 136px; } }
@media (max-width: 860px) {
  .lp-past { position: relative; }
  .sticky { right: -24px; top: 2px; width: 150px; min-height: 0; padding: 20px 12px 12px; }
  .sticky p { font-size: 19px; }
}

/* ── телефон ────────────────────────────────────────── */
@media (max-width: 860px) {
  .app { display: block; }
  .rail { display: none; }
  .main { padding: 18px 16px 88px; }
  h1 { font-size: 22px; }
  .mobilebar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: linear-gradient(180deg, var(--felt), var(--felt-deep)); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobilebar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: rgba(223, 229, 247, .72); padding: 4px 0; }
  .mobilebar a.on { color: #fff; }
  .mobilebar a.on::before { content: ""; position: absolute; top: -6px; left: 50%; width: 22px; height: 3px; margin-left: -11px; border-radius: 0 0 3px 3px; background: var(--ribbon); }
  .toasts { top: 10px; right: 8px; }
  .mobilebar a:hover { text-decoration: none; }
  .mobilebar .icon { width: 22px; height: 22px; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div { border-left: 0; border-top: 1px solid var(--rule); }
  .strip > div:nth-child(-n+2) { border-top: 0; }
  .strip > div:nth-child(even) { border-left: 1px solid var(--rule); }
  .strip .v { font-size: 24px; }
  .search input { width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  table.tabel .who { min-width: 148px; max-width: 148px; padding: 6px 8px; }
  table.tabel .who .avatar { display: none; }
  .sheet { max-height: none; }
  .drawer .drawer-body { padding: 0 16px 24px; }
  .facts .v { font-size: 20px; }
  .day-head { flex-wrap: wrap; }
  .day-head .hand-date { width: 100%; margin: 2px 0 0; }
  .pboard { --frame: 10px; padding: 16px 10px 18px; margin: 2px 0 4px; }
  .pgrid { grid-template-columns: 1fr 1fr; gap: 12px 8px; }
  .mp .avatar { display: none; }
  .board-filter { margin-left: 0; width: 100%; }
  .board-filter select { width: 100%; }
  .section-title { flex-direction: column; gap: 2px; }
  .pass-head { grid-template-columns: 1fr; padding: 40px 14px 18px; gap: 16px; }
  .idpass-body { gap: 12px; }
  .idpass-photo { width: 72px; height: 88px; font-size: 22px; }
  .note-sticky { justify-self: center; }
}

/* ── личные дела: металлическая картотека во всю ширину — сатиновый графит со шлифовкой, хромированные рамки ярлыков
   и ручки-ракушки, ярлык подписан от руки. Наведение — ящик выезжает на зрителя, в нём поднимаются корешки папок ── */
.cab {
  position: relative; margin: 18px 0 40px; padding: 14px 14px 16px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(90deg, #1c1f25, #2b2f37 5%, #2e323a 50%, #2b2f37 95%, #1c1f25);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .12), 0 30px 34px -22px rgba(10, 14, 24, .65);
}
.cab::before {  /* крышка: светлый загнутый край листа */
  content: ""; position: absolute; left: -4px; right: -4px; top: -9px; height: 11px; border-radius: 5px 5px 2px 2px;
  background: var(--brush), linear-gradient(180deg, #6a707c, #434852 70%, #353a42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 3px rgba(0, 0, 0, .4);
}
.cab::after {  /* цоколь, утоплен */
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -14px; height: 14px; border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, #121419, #1c1f25);
}
.cab-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 1500px) { .cab-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.dr {
  position: relative; z-index: 1; display: block; height: 124px; border-radius: 3px; color: inherit;
  background: #0b0c0f; box-shadow: inset 0 4px 8px rgba(0, 0, 0, .8);
  perspective: 700px; perspective-origin: 50% -80%;  /* смотрим чуть сверху: выдвинутый ящик ниже и крупнее */
  /* закрывающийся ящик плавно уходит вниз по слоям: соседний, который открывается, сразу оказывается поверх */
  transition: z-index .3s linear;
}
.dr:nth-child(3n+1) { --gx: -130px; --gy: -40px; }
.dr:nth-child(3n+2) { --gx: -320px; --gy: -90px; }
.dr:nth-child(4n) { --gx: -470px; --gy: -20px; }
.dr:hover { text-decoration: none; }
.dr:focus-visible { outline: none; }
.dr:focus-visible .dr-front { outline: 3px solid #fff; outline-offset: 2px; }
.dr-front {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px;
  border-radius: 3px; background: var(--brush) var(--gx, 0) var(--gy, 0), radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0) 60%),
              linear-gradient(180deg, #5d6370 0, #4c525d 7%, #444953 55%, #3b3f48 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 rgba(0, 0, 0, .4),
              inset 1px 0 0 rgba(255, 255, 255, .08), inset -1px 0 0 rgba(0, 0, 0, .3);
  transition: transform .28s cubic-bezier(.4, 0, .6, 1), box-shadow .28s;  /* закрывается быстрее, чем открывается */
}
/* хромированная рамка на двух заклёпках, в ней ярлык: код синими чернилами от руки, ниже число папок */
.dr-label {
  position: relative; display: block; min-width: 122px; padding: 3px; border-radius: 2px;
  background: linear-gradient(180deg, #f6f7f9, #c6cbd2 40%, #8b929c); box-shadow: 0 1px 2px rgba(0, 0, 0, .6), inset 0 1px 0 #fff;
}
.dr-label::before, .dr-label::after {
  content: ""; position: absolute; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, #b7bdc6 55%, #6a717b); box-shadow: 0 1px 1px rgba(0, 0, 0, .6);
}
.dr-label::before { left: -10px; }
.dr-label::after { right: -10px; }
.dr-label > span {
  display: grid; justify-items: center; min-height: 40px; padding: 3px 12px 4px; border-radius: 1px;
  background: linear-gradient(180deg, #fcf8ec, #efe6cf); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35);
}
.dr-label b { font: 700 25px/1 Caveat, cursive; color: #1f2c66; }
.dr-label small { margin-top: 1px; font-size: 10.5px; line-height: 1.2; color: #6f6a5c; }
.dr.arch .dr-label b { color: #a32a20; }
.dr.spare .dr-label > span { background: linear-gradient(180deg, #e9e4d6, #ddd6c4); }
/* ручка-ракушка */
.dr-pull {
  position: relative; display: block; width: 76px; height: 19px; border-radius: 3px 3px 40px 40px / 3px 3px 19px 19px;
  background: linear-gradient(180deg, #fff, #d2d6dc 30%, #858c96); box-shadow: 0 3px 4px rgba(0, 0, 0, .55), inset 0 1px 0 #fff;
}
.dr-pull::before {
  content: ""; position: absolute; left: 8px; right: 8px; top: 4px; bottom: 4px; border-radius: 2px 2px 30px 30px / 2px 2px 11px 11px;
  background: linear-gradient(180deg, #1f232a, #6d737d); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .7);
}
/* внутри ящика: корешки папок, код — первые буквы фамилии и имени */
.dr-in {
  position: absolute; inset: 0; display: grid; align-content: start; gap: 3px; padding: 8px 9px 0; overflow: hidden; border-radius: 3px;
  background: linear-gradient(180deg, #08090b, #191c22);
}
.fo {
  display: block; height: 21px; padding: 0 9px; border-radius: 3px 3px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: linear-gradient(180deg, #f8ebcb, #ead5a5); color: #3d2c06; font-size: 12.5px; line-height: 21px;
  box-shadow: 0 2px 0 #b38d55; transform: translateY(10px); opacity: 0; transition: transform .2s ease-in, opacity .15s;
}
.fo b { margin-right: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fo:nth-child(even) { margin-left: 14px; background: linear-gradient(180deg, #f2e0b6, #e3c992); }
.fo.more, .fo.none { margin-left: 0; padding-left: 2px; background: none; box-shadow: none; color: #c9cfda; }
@media (hover: hover) {
  a.dr:hover { z-index: 20; transition: none; }
  a.dr:hover .dr-front {
    transform: translateY(80%) translateZ(46px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -2px 0 rgba(0, 0, 0, .4), 0 24px 26px -10px rgba(0, 0, 0, .8);
    transition: transform .42s cubic-bezier(.2, .75, .25, 1) .06s, box-shadow .42s .06s;  /* короткая пауза: мышь, проходящая мимо, не дёргает ящики */
  }
  a.dr:hover .fo { transform: none; opacity: 1; transition: transform .3s ease-out, opacity .2s; transition-delay: calc(.18s + var(--i, 0) * .05s); }
}
a.dr:focus-visible, a.dr.peek { z-index: 20; transition: none; }
a.dr:focus-visible .dr-front, a.dr.peek .dr-front { transform: translateY(80%) translateZ(46px); }
a.dr:focus-visible .fo, a.dr.peek .fo { transform: none; opacity: 1; }
/* открытый ящик и ящики с найденными папками — чуть выдвинуты, на них красная закладка, как у раздела в меню */
.dr.open, .dr.hit { z-index: 3; }
.dr.open .dr-front, .dr.hit .dr-front { transform: translateY(20%) translateZ(12px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 12px 16px -8px rgba(0, 0, 0, .7); }
.dr.open .fo, .dr.hit .fo { transform: none; opacity: 1; }
.dr.open .dr-front::after, .dr.hit .dr-front::after {
  content: ""; position: absolute; top: -3px; right: 14px; width: 12px; height: 28px; background: var(--ribbon);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .35));
}
.dr-open { scroll-margin-top: 16px; }
.on-touch { display: none; }
@media (hover: none) { .on-hover { display: none; } .on-touch { display: inline; } }
.section-title .push { margin-left: auto; font-size: 13px; }

/* папки в открытом ящике: крафт, ярлычок с кодом то слева, то посередине, то справа — как в настоящем ящике */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 28px 14px; padding-top: 18px; }
.folder {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 6px 10px; align-items: center; padding: 12px 12px 9px;
  border-radius: 0 7px 7px 7px; color: #3d2c06; background: linear-gradient(180deg, #efdcb2, #e2c590);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 #b8935a, 0 12px 18px -14px rgba(60, 40, 0, .55);
}
.folder:hover { text-decoration: none; background: linear-gradient(180deg, #f4e5c4, #e8cd9b); }
.folder-tab {
  position: absolute; left: 0; bottom: 100%; height: 18px; padding: 1px 12px 0; border-radius: 6px 6px 0 0;
  background: #efdcb2; color: #5a4310; font-size: 12px; font-weight: 700; line-height: 17px; font-variant-numeric: tabular-nums;
}
.folder:nth-child(3n+2) { border-radius: 7px; }
.folder:nth-child(3n+2) .folder-tab { left: 36%; }
.folder:nth-child(3n) { border-radius: 7px 0 7px 7px; }
.folder:nth-child(3n) .folder-tab { left: auto; right: 0; }
.folder .avatar { width: 40px; height: 48px; border-radius: 4px; background: #f7ecd2; color: #6b5321; box-shadow: inset 0 0 0 1px rgba(90, 67, 16, .2); }
.folder-nm { display: grid; min-width: 0; line-height: 1.25; }
.folder-nm b, .folder-nm span, .folder-nm small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.folder-nm b { font-size: 14px; }
.folder-nm span { font-size: 13px; }
.folder-nm small { margin-top: 2px; font-size: 11.5px; color: #7a6230; }
.folder-n { grid-column: 1 / -1; padding-top: 6px; border-top: 1px dashed rgba(90, 67, 16, .3); font-size: 12px; font-weight: 600; }
.folder-n.none { font-weight: 400; color: rgba(61, 44, 6, .6); }

/* «Сотрудники»: под картотекой — список */
.people-list-head { margin-top: 30px; }
#list { scroll-margin-top: 12px; }
/* папка сотрудника (вкладка «Документы»): разделы-разделители, документы листами */
.dossier { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.doc-kind {  /* листок с загнутым углом, цвет — вид файла */
  flex: none; display: flex; align-items: flex-end; justify-content: center; width: 34px; height: 42px; padding-bottom: 5px;
  color: #fff; font-size: 9.5px; font-weight: 800; clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%); border-radius: 2px;
}
.doc-kind.k-pdf { background: #c8463a; }
.doc-kind.k-img { background: var(--cam); }
.doc-kind.k-doc { background: var(--felt); }
.doc-kind.k-xls { background: var(--both); }
.doc-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.doc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.doc-title a { font-weight: 600; }
.doc-act label { position: relative; }
.doc-act label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.doc-act label:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.dossier-add { position: sticky; top: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 20px 20px 18px 52px; }
.dossier-add input, .dossier-add select { width: 100%; min-width: 0; }
.dossier-add h3 { margin: 0; font-size: 15px; }
.dossier-add .form-actions { margin: 4px 0 0; }
@media (max-width: 1100px) {
  .dossier { grid-template-columns: 1fr; }
  .dossier-add { position: static; }
}
@media (max-width: 860px) {
  .cab { padding: 9px 9px 11px; }
  .cab-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .dr { height: 108px; }
  .dr-label { min-width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .dr-front, .fo { transition: none; }
}

/* «Действует»: переключатель и настольный календарь (attendance/_period.html, initPeriods в app.js).
   Период — полоса жёлтого маркера, первый и последний день обведены синими чернилами, сегодня — красное число */
.period { margin: 0; padding: 0; border: 0; min-width: 0; }
.period legend { float: left; width: 100%; margin-bottom: 5px; padding: 0; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; align-self: flex-start; padding: 3px; border-radius: 10px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--rule); }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; font-weight: 500; white-space: nowrap; pointer-events: none; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(24, 33, 47, .14), 0 0 0 1px var(--rule); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
/* без JS — обычные поля дат */
.period-dates { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 10px; }
.period:has(input[name=scope][value=day]:checked) .period-dates,
.period:has(input[name=scope][value=from]:checked) .period-to { display: none; }
.period.js .period-dates { display: none; }

.cal-wrap { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .32s cubic-bezier(.3, .7, .2, 1); }
.period.is-day .cal-wrap { grid-template-rows: 0fr; }
.cal { min-height: 0; overflow: hidden; padding: 16px 6px 4px; margin: 0 -6px; }
.cal-sheet {
  position: relative; max-width: 316px; padding: 24px 12px 10px; border-radius: 3px 3px 10px 10px; background: var(--paper);
  box-shadow: 0 0 0 1px var(--rule), 0 1px 0 2px #f1f2f5, 0 2px 0 2px var(--rule), 0 14px 24px -14px rgba(24, 33, 47, .38);
  transform-origin: 50% 0; transition: transform .32s cubic-bezier(.3, .7, .2, 1), opacity .2s;
}
.cal-sheet::before {  /* корешок синим войлоком, как обложка журнала */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 13px; border-radius: 3px 3px 0 0; background: var(--felt-bg);
}
.period.is-day .cal-sheet { transform: perspective(500px) rotateX(-24deg); opacity: 0; }
.cal-rings { position: absolute; left: 0; right: 0; top: -9px; display: flex; justify-content: space-between; padding: 0 26%; pointer-events: none; }
.cal-rings i { width: 8px; height: 19px; border-radius: 5px; background: linear-gradient(90deg, #7e8796, #f4f5f8 45%, #a3aab6); box-shadow: 0 2px 2px rgba(0, 0, 0, .28); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-month { font: 600 25px/1 Caveat, cursive; color: #22398f; }
.cal-head .iconbtn { width: 30px; height: 30px; }
.cal-wd, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-wd span { padding: 4px 0; text-align: center; font-size: 11.5px; color: var(--muted); }
.cal-wd .we { color: #a3abb8; }
.cal-grid { row-gap: 2px; }
.cal-grid.go-next { animation: cal-next .22s ease-out; }
.cal-grid.go-prev { animation: cal-prev .22s ease-out; }
@keyframes cal-next { from { opacity: 0; transform: translateX(16px); } }
@keyframes cal-prev { from { opacity: 0; transform: translateX(-16px); } }
.cal-d { position: relative; display: grid; place-items: center; height: 36px; padding: 0; border: 0; background: none; color: var(--ink); font: 500 14px/1 Onest, sans-serif; cursor: pointer; }
.cal-d > span { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; }
.cal-d:hover > span { background: var(--canvas); }
.cal-d:focus-visible { outline: none; }
.cal-d:focus-visible > span { outline: 2px solid var(--brand); outline-offset: 0; }
.cal-d.we { color: #98a1b0; }
.cal-d.today > span { color: var(--ribbon); font-weight: 700; }
.cal-d.today > span::before { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--ribbon); }
/* полоса маркера: чуть неровные края, на концах недели и периода — скруглена */
.cal-d.on::before {
  content: ""; position: absolute; left: 0; right: 0; top: 8px; bottom: 8px; background: rgba(255, 222, 84, .82);
  mix-blend-mode: multiply;
}
.cal-d.on.pv::before { background: rgba(255, 222, 84, .42); }
.cal-d.on.l::before { left: 5px; border-radius: 9px 2px 2px 11px / 10px 2px 2px 8px; }
.cal-d.on.r::before, .cal-d.on.end::before { right: 5px; border-radius: 2px 10px 12px 2px / 2px 8px 10px 2px; }
.cal-d.on.a::before { left: 50%; }
.cal-d.on.b::before { right: 50%; }
.cal-d.on.fade::before { right: 0; border-radius: 0; background: linear-gradient(90deg, rgba(255, 222, 84, .82), rgba(255, 222, 84, 0)); }
.cal-d.on:hover > span { background: rgba(255, 255, 255, .55); }
/* первый и последний день — обведены от руки */
.cal-d.a > span, .cal-d.b > span { color: #1d3189; font-weight: 700; }
.cal-d.a > span::after, .cal-d.b > span::after {
  content: ""; position: absolute; inset: -1px -2px; border: 2px solid #2747a8; border-radius: 52% 48% 55% 45% / 46% 56% 44% 54%;
  transform: rotate(-9deg); animation: ink-in .26s cubic-bezier(.3, 1.4, .5, 1);
}
.cal-d.b > span::after { border-radius: 46% 54% 48% 52% / 55% 45% 56% 44%; transform: rotate(12deg); }
.cal-d.a > span, .cal-d.b > span { background: var(--paper); }
@keyframes ink-in { from { opacity: 0; transform: rotate(-30deg) scale(1.3); } }
.cal-sum { margin: 10px 2px 0; font-size: 13.5px; color: var(--ink-2); }
.cal-sum b { color: var(--ink); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .cal-wrap, .cal-sheet { transition: none; }
  .cal-grid.go-next, .cal-grid.go-prev, .cal-d.a > span::after, .cal-d.b > span::after { animation: none; }
}

/* ── обучение (static/js/tour.js): затемнение, подсветка, Корти и его реплика ── */
html.tour-pending body::after { content: ""; position: fixed; inset: 0; z-index: 999; background: rgba(9, 14, 34, .74); }  /* между страницами обучения не мигает */
.tour { position: fixed; inset: 0; z-index: 1000; pointer-events: none; animation: tour-in .25s ease-out; }
@keyframes tour-in { from { opacity: 0; } }
.tour.leaving { opacity: 0; transition: opacity .2s; }
.tour.going .tour-box { opacity: 0; transition: opacity .2s; }
.tour-veil { position: absolute; inset: 0; pointer-events: auto; }
.tour-dim { position: fixed; inset: 0; background: rgba(9, 14, 34, .74); pointer-events: none; }
.tour-spot {
  position: fixed; border-radius: 12px; pointer-events: none;
  transition: left .45s cubic-bezier(.3, .7, .2, 1), top .45s cubic-bezier(.3, .7, .2, 1), width .45s cubic-bezier(.3, .7, .2, 1), height .45s cubic-bezier(.3, .7, .2, 1);
}
.tour-spot::after {  /* рамка подсветки дышит, чтобы глаз сразу её нашёл */
  content: ""; position: absolute; inset: -3px; border-radius: 15px; border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 4px rgba(255, 227, 107, .35), 0 0 26px rgba(255, 227, 107, .35); animation: spot-breathe 2.2s ease-in-out infinite;
}
.tour.center .tour-spot::after { display: none; }
@keyframes spot-breathe { 50% { box-shadow: 0 0 0 9px rgba(255, 227, 107, .12), 0 0 34px rgba(255, 227, 107, .45); } }
.tour-box {
  position: fixed; left: 0; top: 0; display: flex; align-items: flex-end; gap: 4px; width: min(420px, calc(100vw - 16px));
  pointer-events: auto; transition: transform .45s cubic-bezier(.3, .7, .2, 1), opacity .2s;
}
.tour.center .tour-box { width: min(460px, calc(100vw - 16px)); }
.tour-pal { position: relative; z-index: 2; flex: none; width: 64px; margin-bottom: -4px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35)); transition: width .35s cubic-bezier(.3, 1.3, .5, 1); }  /* над репликой: рука, которой показывает, не прячется за ней */
.tour-pal.big { width: 92px; }
.tour-pal svg { display: block; width: 100%; height: auto; overflow: visible; }
.tour-bubble {
  position: relative; flex: 1; min-width: 0; margin-bottom: 26px; padding: 12px 14px 12px 16px; border-radius: 14px; background: var(--paper); color: var(--ink);
  box-shadow: 0 22px 44px -14px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .2);
}
.tour-bubble::before {  /* хвостик реплики — к Корти */
  content: ""; position: absolute; left: -6px; bottom: 26px; width: 14px; height: 14px; border-radius: 0 0 0 4px; background: var(--paper); transform: rotate(45deg);
}
.tour-top { display: flex; align-items: center; gap: 6px; margin: -4px -6px 4px 0; }
.tour-top b { font-size: 13px; font-weight: 600; color: var(--felt); }
.tour-n { margin-right: auto; font-size: 12px; color: var(--muted); }
.tour-top .iconbtn { width: 30px; height: 30px; }
.tour-sound .mute { display: none; }
.tour-sound.off .w1, .tour-sound.off .w2 { display: none; }
.tour-sound.off .mute { display: inline; }
.tour-text { position: relative; margin: 0 0 12px; font-size: 15.5px; line-height: 1.5; }
.tour-text .ghost { visibility: hidden; }  /* место под весь текст заранее — реплика не растёт, пока печатается */
.tour-text .typed { position: absolute; inset: 0; }
.tour-text .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tour-nav { display: flex; justify-content: flex-end; gap: 8px; }
.tour-nav .btn:disabled { opacity: .45; cursor: default; }
.tour :focus-visible { outline-color: var(--brand); }
/* Корти-помощник (прототип, core/vaipi.py): вместо «Назад/Дальше» — поле вопроса */
.tour:not(.ask) .tour-ask, .tour.ask .tour-nav { display: none; }
.tour-ask { display: flex; gap: 8px; }
.tour-ask input { flex: 1; min-width: 0; }
.tour.asking .tour-ask button { opacity: .5; pointer-events: none; }
.tour.asking .tour-text .typed { color: var(--muted); }

/* Корти: дышит, моргает, смотрит на подсвеченное, говорит ртом, на новом шаге подпрыгивает, здоровается рукой */
.vp { animation: vp-bob 2.6s ease-in-out infinite; }
@keyframes vp-bob { 50% { transform: translateY(-2.5px); } }
.vp-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: vp-blink 4.4s infinite; }
@keyframes vp-blink { 0%, 93%, 100% { transform: none; } 95.5% { transform: scaleY(.12); } }
.vp-pupils { transform: translate(var(--px, 0), var(--py, 0)); transition: transform .35s ease-out; }
.tour-pal .vp-pupils { transform: translate(var(--px, 0), var(--py, 0)); }
.vp-mouth-o { display: none; }
.talking.o .vp-mouth-o, .tour-pal.talking.o .vp-mouth-o { display: inline; }
.talking.o .vp-mouth-c { display: none; }
.tour-pal.hop .vp { animation: vp-hop .42s cubic-bezier(.3, 1.6, .5, 1), vp-bob 2.6s ease-in-out .42s infinite; }
@keyframes vp-hop { 40% { transform: translateY(-9px) rotate(-3deg); } }
.vp-arm { transform-box: view-box; transition: transform .38s cubic-bezier(.3, 1.35, .5, 1); }
.vp-arm-r { transform-origin: 63px 54px; transform: rotate(-26deg); }  /* руки чуть в стороны */
.vp-arm-l { transform-origin: 9px 54px; transform: rotate(26deg); }
.vp-finger { opacity: 0; transition: opacity .2s; }
/* показывает на подсвеченное: рука к цели, видно указательный палец; второй рукой жестикулирует, пока говорит */
.tour-pal.pose-point:not(.aim-left) .vp-arm-r, .tour-pal.pose-point.aim-left .vp-arm-l { transform: rotate(var(--aim, -90deg)); }
.tour-pal.pose-point:not(.aim-left) .vp-arm-r .vp-finger, .tour-pal.pose-point.aim-left .vp-arm-l .vp-finger { opacity: 1; }
.tour-pal.talking.pose-point:not(.aim-left) .vp-arm-l, .tour-pal.talking:not([class*=pose-]) .vp-arm-l { animation: vp-gesture-l 1.5s ease-in-out infinite; }
.tour-pal.talking.pose-point.aim-left .vp-arm-r { animation: vp-gesture-r 1.5s ease-in-out infinite; }
@keyframes vp-gesture-l { 50% { transform: rotate(58deg); } }
@keyframes vp-gesture-r { 50% { transform: rotate(-58deg); } }
/* машет: рука вверх, кисть качается */
.tour-pal.pose-wave .vp-arm-r { transform: rotate(-150deg); animation: vp-wave 1s ease-in-out 3 .2s; }
@keyframes vp-wave { 0%, 100% { transform: rotate(-150deg); } 50% { transform: rotate(-118deg); } }
/* думает — перебирает папки в картонном ящике (05.11; прежняя поза «рука к голове» проводила руку через лицо):
   ящик появляется перед ним, ладони на его краях, правая листает, папки по очереди приподнимаются, глаза — в ящик */
.vp-files { opacity: 0; transition: opacity .2s; }
.vp-file { transform-box: fill-box; transform-origin: 50% 100%; }
.tour-pal.pose-think .vp-files { opacity: 1; }
.tour-pal.pose-think .vp-file { animation: vp-file 1.6s ease-in-out infinite; }
.tour-pal.pose-think .vp-file.f2 { animation-delay: .4s; }
.tour-pal.pose-think .vp-file.f3 { animation-delay: .8s; }
.tour-pal.pose-think .vp-file.f4 { animation-delay: 1.2s; }
@keyframes vp-file { 0%, 55%, 100% { transform: none; } 18% { transform: translateY(-7px) rotate(-9deg); } 34% { transform: translateY(-3px) rotate(5deg); } }
.tour-pal.pose-think .vp-arm-l { transform: rotate(-32deg); }  /* руки уходят за корпус — видны ладони на ящике */
.tour-pal.pose-think .vp-arm-r { transform: rotate(32deg); }
.tour-pal.pose-think .vp-hand.hr { animation: vp-leaf .4s ease-in-out infinite alternate; }
@keyframes vp-leaf { to { transform: translate(-5px, -5px); } }
.tour-pal.pose-think .vp-pupils { transform: translate(0, 2.4px); }
.tour-pal.pose-think .vp-mouth-c { transform: scaleX(.6); transform-box: fill-box; transform-origin: 50% 50%; }
@media (prefers-reduced-motion: reduce) { .tour-pal.pose-think .vp-file, .tour-pal.pose-think .vp-hand { animation: none; } }
/* радуется: обе руки вверх, подпрыгивает */
.tour-pal.pose-cheer .vp-arm-r { transform: rotate(-152deg); }
.tour-pal.pose-cheer .vp-arm-l { transform: rotate(152deg); }
.tour-pal.pose-cheer .vp { animation: vp-hop .5s cubic-bezier(.3, 1.6, .5, 1) 2, vp-bob 2.6s ease-in-out 1s infinite; }
/* Корти живёт в меню, на обучение выходит оттуда: пока ведёт — на его месте пусто; летит дугой (tour.js, fly).
   Реплика появляется, когда он долетел */
html.tour-on .tour-launch .pal-mini, html.tour-pending .tour-launch .pal-mini { visibility: hidden; }
.tour-fly { position: fixed; left: 0; top: 0; z-index: 1001; margin: 0; transition: none; pointer-events: none; will-change: transform; }
.tour.arriving .tour-pal { visibility: hidden; }
.tour-bubble { transform-origin: 0 100%; transition: opacity .22s ease-out, transform .22s ease-out; }
.tour.arriving .tour-bubble { opacity: 0; transform: scale(.94); }

/* кнопка «Обучение» в меню: Корти выглядывает */
.tour-launch {
  display: flex; align-items: center; gap: 11px; width: 100%; margin: auto 0 14px; padding: 6px 10px; border: 0; border-radius: var(--r-ctl);
  background: none; color: rgba(223, 229, 247, .78); font: 500 14px/1.2 Onest, sans-serif; text-align: left; cursor: pointer; position: relative; z-index: 1;
}
.tour-launch:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.tour-launch + .me { margin-top: 0; }
.pal-mini { display: block; flex: none; width: 20px; height: 28px; margin: -2px 0 -2px -1px; }
/* в меню Корти стоит на вашем пропуске: крупнее, с ногами, подпись рядом */
.rail .tour-launch { flex-direction: row-reverse; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: -10px; padding: 4px 14px 0 10px; z-index: 2; background: none; }
.rail .tour-launch:hover { background: none; }
.rail .tour-launch .pal-mini { width: 42px; height: 58px; margin: 0; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .35)); transition: transform .2s; }
.rail .tour-launch:hover .pal-mini { transform: translateY(-3px); }
.rail .tour-launch .pal-mini .vp-legs { display: inline; }
.tl-text { display: grid; padding-bottom: 13px; line-height: 1.2; }
.tl-text b { font-weight: 500; color: rgba(223, 229, 247, .9); }
.tl-text small { font-size: 11.5px; color: rgba(223, 229, 247, .55); }
.rail .tour-launch:hover .tl-text b { color: #fff; }
.pal-mini svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tour-launch:hover .pal-mini .vp-arm-r { animation: vp-wave 1s ease-in-out; }
.pal-mini .vp-legs { display: none; }
.mobilebar .tour-launch { flex-direction: column; justify-content: center; gap: 2px; width: auto; margin: 0; padding: 4px 0; font-size: 11px; text-align: center; color: rgba(223, 229, 247, .72); }
.mobilebar .tour-launch .pal-mini { width: 17px; height: 22px; margin: 0; }
.mobilebar .tour-launch .tl-text small { display: none; }
.mobilebar .tour-launch .tl-text { padding: 0; }
.mobilebar .tour-launch .tl-text b { font-weight: 400; font-size: 11px; color: inherit; }
.tour-menu {
  position: fixed; z-index: 60; display: grid; gap: 2px; min-width: 240px; padding: 6px; border-radius: 12px; background: var(--paper);
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .45), 0 0 0 1px var(--rule); animation: sticky-in .2s ease-out both;
}
.tour-menu button, .tour-menu a { display: grid; gap: 1px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 14px/1.3 Onest, sans-serif; text-align: left; cursor: pointer; }
.tour-menu button span, .tour-menu a span { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.tour-menu button:hover, .tour-menu button:focus-visible, .tour-menu a:hover, .tour-menu a:focus-visible { background: var(--canvas); text-decoration: none; }
.tour-offer {
  position: fixed; z-index: 60; width: 236px; padding: 12px 14px; border-radius: 14px; background: var(--paper); color: var(--ink);
  box-shadow: 0 18px 36px -12px rgba(0, 0, 0, .5), 0 0 0 1px var(--rule); animation: offer-in .45s cubic-bezier(.3, 1.4, .5, 1) both;
}
.tour-offer::before { content: ""; position: absolute; left: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: var(--paper); transform: rotate(45deg); box-shadow: -1px 1px 0 var(--rule); }
.tour-offer p { margin: 0 0 10px; font-size: 14.5px; }
.tour-offer div { display: flex; gap: 8px; }
@keyframes offer-in { from { opacity: 0; transform: translateX(-10px) scale(.94); } }
@media (max-width: 900px) { .tour-offer::before { left: auto; right: 22px; top: auto; bottom: -6px; } }
@media (max-width: 640px) {
  .tour-box { width: calc(100vw - 16px); }
  .tour-pal { width: 54px; }
  .tour-pal.big { width: 72px; }
  .tour-text { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour, .tour-offer, .tour-menu { animation: none; }
  .tour-spot, .tour-box, .tour-pal, .tour-bubble { transition: none; }
  .tour-spot::after, .vp, .vp-eyes, .tour-pal.hop .vp, .tour-pal .vp-arm, .tour-pal.pose-cheer .vp, .tour-launch:hover .pal-mini .vp-arm-r { animation: none; }
  .vp-arm { transition: none; }
}

/* ── кадровые операции (ТЗ 5): трудоустройство с периодами «отдел и должность», история событий ── */
.eng { margin-bottom: 18px; padding: 18px 20px 16px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); }
.eng.ended { background: var(--canvas); }
.eng-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eng-head h2 { margin: 0; font-size: 17px; }
.eng-head .sub { color: var(--ink-2); margin-top: 2px; }
.eng-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin: 14px 0 0; }
.eng-facts dt { font-size: 12px; color: var(--muted); }
.eng-facts dd { margin: 1px 0 0; }
.eng-h { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.periods { margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--rule); }
.periods li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 5px 0 5px 16px; }
.periods li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--rule-strong); }
.periods li.now::before { background: var(--both); box-shadow: 0 0 0 3px var(--both-wash); }
.periods li.planned::before { box-shadow: inset 0 0 0 2px var(--cam); }
.periods li.past { color: var(--muted); }
.periods .when { min-width: 190px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eng-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.eng-actions .linkbtn { margin-left: auto; }
.op-now { margin: -8px 0 14px; color: var(--ink-2); }
.op-form { max-width: 760px; }
.op-note { margin-top: 14px; max-width: 70ch; }
/* «История» в карточке — лента времени (19.11): слева «в силе с», на линии кружок цвета вида (HrEvent.LOOK); исправление —
   «карандашом» на жёлто-серой бумаге, не процесс; отменённое — бледное, вид зачёркнут */
.hr-log { margin: 0; padding: 0; list-style: none; }
.hr-log .ev { --tone: var(--abs); display: grid; grid-template-columns: 96px 30px minmax(0, 1fr); column-gap: 14px; }
.hr-log .ev.g-in { --tone: var(--both); }
.hr-log .ev.g-move { --tone: var(--cam); }
.hr-log .ev.g-org { --tone: var(--hr); }
.hr-log .ev.g-out { --tone: var(--late); }
.hr-log .ev.g-fix { --tone: #8a8370; }
.ev-date { padding: 15px 0; text-align: right; }
.ev-date b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.ev-date span { display: block; font-size: 12px; color: var(--muted); }
.ev-rail { position: relative; display: flex; justify-content: center; }
.ev-rail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--rule); }
.hr-log .ev:first-child .ev-rail::before { top: 26px; }
.hr-log .ev:last-child .ev-rail::before { bottom: auto; height: 26px; }
.hr-log .ev:only-child .ev-rail::before { display: none; }
.ev-dot { position: relative; display: grid; place-items: center; width: 30px; height: 30px; margin-top: 11px; border-radius: 50%;
  background: var(--tone); color: #fff; box-shadow: 0 0 0 4px var(--paper); }
.ev-dot .icon { width: 15px; height: 15px; stroke-width: 2.2; }
.ev-body { min-width: 0; padding: 14px 0 16px; border-bottom: 1px solid var(--rule); }
.hr-log .ev:last-child .ev-body { border-bottom: 0; }
.ev-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-weight: 600; }
.ev-title .muted { font-weight: 400; }
.ev-kind { color: var(--tone); }
.ev-diff { margin: 6px 0 0; padding: 0; list-style: none; }
.ev-diff s { color: var(--muted); }
.ev-line, .ev-doc { margin: 5px 0 0; }
.ev-doc { color: var(--ink-2); font-size: 13.5px; }
.ev-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.ev-cancel { margin-top: 6px; border: 0; padding: 0; }
/* исправление ошибки в данных: карандаш, бумага, пунктир — видно, что это не приём и не перевод */
.hr-log .ev.g-fix .ev-dot { background: #f4f0e0; color: #6b6550; border: 2px dashed #a8a088; }
.hr-log .ev.g-fix .ev-body { margin: 8px 0; padding: 10px 14px 12px; border: 1px dashed #d6ceb2; border-radius: 10px; background: #faf7ec; }
.hr-log .ev.g-fix .ev-kind { color: #5e5944; }
.ev-fix-note { margin: 2px 0 0; font-size: 12.5px; color: #7d7660; }
.ev-reason { margin: 6px 0 0; font-style: italic; color: var(--ink-2); font-size: 13.5px; }
.ev-reason::before { content: "Причина: "; font-style: normal; color: var(--muted); }
/* отменённое: бледное, вид зачёркнут, причина отмены — на виду */
.hr-log .ev.cancelled { --tone: var(--muted); }
.hr-log .ev.cancelled .ev-dot { background: var(--paper); color: var(--muted); border: 2px solid var(--rule-strong); }
.hr-log .ev.cancelled .ev-kind { text-decoration: line-through; text-decoration-thickness: 2px; }
.hr-log .ev.cancelled .ev-title, .hr-log .ev.cancelled .ev-diff, .hr-log .ev.cancelled .ev-line,
.hr-log .ev.cancelled .ev-doc, .hr-log .ev.cancelled .ev-reason, .hr-log .ev.cancelled .ev-date { opacity: .55; }
.ev-cancelled { margin: 7px 0 0; font-size: 13px; color: #8f2a18; }
@media (max-width: 640px) {
  .hr-log .ev { grid-template-columns: 30px minmax(0, 1fr); column-gap: 12px; }
  .hr-log .ev .ev-rail { grid-column: 1; grid-row: 1 / span 2; }
  .hr-log .ev .ev-date { grid-column: 2; grid-row: 1; display: flex; gap: 6px; align-items: baseline; padding: 14px 0 0; text-align: left; }
  .hr-log .ev .ev-body { grid-column: 2; grid-row: 2; padding-top: 4px; }
  .hr-log .ev.g-fix .ev-body { margin-top: 6px; }
  .periods .when { min-width: 0; }
  .eng-actions .linkbtn { margin-left: 0; }
}

/* ── оклады и согласования (ТЗ 6, 25) ── */
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--ribbon); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; }
.todo-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 10px 14px; border-radius: var(--r-panel); background: var(--cam-wash); color: #23367f; }
.todo-bar:hover { text-decoration: none; background: #dde4fb; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pay-up { color: var(--both); }
.pay-down { color: var(--late); }
.pay-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 0 0 16px; }
.pay-now b { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pay-now.big { margin: 14px 0 6px; }
.pay-now.big b { font-size: 28px; }
.pay-diff { flex-basis: 100%; font-size: 13.5px; font-weight: 600; }
.pay-planned { margin: 4px 0; }
.pay-hist tr.planned td { color: var(--muted); }
.pay-returned { position: relative; max-width: 520px; margin: 0 0 16px; }
.pay-status { align-self: center; font-size: 13px; padding: 5px 12px; }
.pay-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, auto)); align-items: end; gap: 14px 22px; margin: 4px 0 8px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: var(--r-panel); }
.pay-sum > div { display: flex; flex-direction: column; gap: 2px; }
/* заявление из кабинета на бланке — распечатать и подписать (cabinet/statement.py) */
.leave-paper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 18px; padding: 10px 14px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); }
.leave-paper > .icon { color: var(--muted); }
.leave-paper > span { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 1px; }
.leave-paper small { font-size: 12.5px; color: var(--muted); }
.pay-sum > div span { font-size: 12px; }
.pay-sum b { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pay-sum .pay-arrow { font-size: 20px; color: var(--muted); }
.pay-sum .wide { grid-column: 1 / -1; }
/* маршрут: четыре шага по очереди; пройденный — зелёный, текущий — синий, остановленный — красный */
.route { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 22px 0; padding: 0; list-style: none; counter-reset: none; }
.route li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0 12px 0 0; font-size: 13px; color: var(--muted); }
.route li::before { content: ""; position: absolute; left: 30px; right: 4px; top: 13px; height: 2px; background: var(--rule); }
.route li:last-child::before { display: none; }
.route li.done::before { background: var(--both); }
.route i { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--rule-strong); font-style: normal; font-weight: 700; color: var(--muted); }
.route i .icon { width: 15px; height: 15px; stroke-width: 2.6; }
.route b { color: var(--ink); font-size: 13.5px; }
.route li.done i { background: var(--both); box-shadow: none; color: #fff; }
.route li.now i { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash); color: #fff; }
.route li.now b { color: var(--brand-ink); }
.route li.stopped i { background: var(--late); box-shadow: none; color: #fff; }
.route q { color: var(--ink-2); font-style: italic; }
.pay-act { position: relative; max-width: 760px; margin-bottom: 18px; }
/* решение — круглыми печатями (05.11, по отзыву «не похоже на печати»): двойной обод, по кругу компания и БИН,
   в центре решение (core/templatetags/ui.py: seal). Цвет — currentColor; «чернила» — фильтр #seal-ink */
.seal { display: block; width: 100%; height: auto; overflow: visible; }
.seal .ink { filter: url(#seal-ink); }
.seal.t-ok, .seal-btn.t-ok { color: #1f8a57; }
.seal.t-back, .seal-btn.t-back { color: #2f4fb8; }
.seal.t-no, .seal-btn.t-no { color: #cf3424; }
.seal-btns { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: flex-start; margin-top: 14px; }
.seal-btn {
  --tilt: -6deg; display: grid; justify-items: center; gap: 4px; width: 128px; padding: 6px 4px; border: 0; border-radius: 14px;
  background: none; cursor: pointer; font: 600 13px/1.25 Onest, sans-serif; text-align: center;
}
.seal-btn.t-back { --tilt: 5deg; }
.seal-btn.t-no { --tilt: -3deg; }
.seal-btn .seal { width: 112px; transform: rotate(var(--tilt)); transition: transform .16s cubic-bezier(.3, 1.4, .5, 1); }
.seal-btn:hover .seal { transform: rotate(calc(var(--tilt) * -.4)) translateY(-3px) scale(1.04); }
.seal-btn:active .seal { transform: rotate(var(--tilt)) scale(.93); }
.seal-btn:focus-visible { outline: 2px dashed currentColor; outline-offset: 2px; }
.seal-btn:disabled { opacity: .35; cursor: progress; }
/* заявление на странице и оттиски на нём */
.leave-doc { max-width: 860px; margin: 0 0 18px; }
.leave-doc .dp-page { box-shadow: 0 1px 3px rgba(24, 33, 47, .12), 0 14px 28px -18px rgba(24, 33, 47, .4); }
.seal-stock { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.seal-stock .seal-imp { position: static; width: 120px; transform: rotate(var(--tilt)); }  /* без JS — рядом с заявлением */
.seal-imp {
  --tilt: -6deg; position: absolute; z-index: 3; width: 172px; pointer-events: none; opacity: .88; mix-blend-mode: multiply;
  transform: translate(-50%, -50%) rotate(var(--tilt));
}
.seal-imp.new { animation: seal-drop .42s cubic-bezier(.3, 1.35, .5, 1) both; }
@keyframes seal-drop {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--tilt) + 8deg)) scale(2.2); }
  to { opacity: .88; transform: translate(-50%, -50%) rotate(var(--tilt)) scale(1); }
}
.seal-imp.in-form { left: auto; right: 4%; top: 50%; width: 150px; transform: translateY(-50%) rotate(var(--tilt)); animation-name: seal-drop-form; }
@keyframes seal-drop-form {
  from { opacity: 0; transform: translateY(-50%) rotate(calc(var(--tilt) + 8deg)) scale(2.2); }
  to { opacity: .88; transform: translateY(-50%) rotate(var(--tilt)) scale(1); }
}
.dp-page.thump, .paper-form.stamped { animation: ledger-thump .32s ease-out 1; }
.decide { position: relative; max-width: 860px; margin: 0 0 22px; padding: 18px 20px 14px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); }
.decide h3 { margin: 0 0 10px; font-size: 15px; }
@media (max-width: 640px) { .seal-btn { width: 96px; } .seal-btn .seal { width: 84px; } }
@media (prefers-reduced-motion: reduce) { .seal-imp.new, .seal-imp.in-form { animation: none; } .seal-btn .seal { transition: none; } }
.pay-act h3 { margin: 0 0 10px; font-size: 15px; }
.pay-initial input { width: 150px; }
.pay-initial input.pay-amount { text-align: right; font-variant-numeric: tabular-nums; }
.pay-initial tr.todo td:first-child { box-shadow: inset 3px 0 0 var(--sticky); }
.pay-save { position: sticky; bottom: 0; display: flex; align-items: center; gap: 14px; padding: 12px 0; background: var(--paper); border-top: 1px solid var(--rule); }
@media (max-width: 760px) {
  .route { grid-template-columns: 1fr; gap: 12px; }
  .route li::before { display: none; }
}

/* ── каталог уроков (/learn/): пробковая доска (как «Кто где»), уроки — разноцветные стикеры, приколотые кнопками ── */
.learn-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.learn-head .sub { color: var(--muted); margin-top: 4px; max-width: 64ch; }
.learn-pal.pal-mini { width: 54px; height: 74px; margin: 0; }
.learn-pal .vp-legs { display: inline; }
.learn-bar { margin-bottom: 6px; }
.learn-search { flex: 1 1 320px; }
.learn-search input { width: 100%; }
.learn-board { padding: 30px 26px 34px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 34px 26px; }
.note {
  --note: #ffe36b; position: relative; display: flex; flex-direction: column; min-height: 200px; padding: 22px 18px 14px;
  background: linear-gradient(175deg, color-mix(in srgb, var(--note) 70%, #fff) 0, var(--note) 26%, color-mix(in srgb, var(--note) 88%, #000) 100%);
  color: #2b2414; transform: rotate(var(--tilt, 0deg)); transform-origin: 50% 0;
  box-shadow: 0 1px 1px rgba(40, 25, 5, .2), 0 14px 16px -10px rgba(40, 25, 5, .55);
  border-radius: 2px 2px 3px 14px / 2px 2px 3px 6px;  /* нижний угол чуть загнут */
  transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.note[hidden] { display: none; }
.note:hover { transform: rotate(0deg) translateY(-3px); }
.note::before {  /* клеевая полоска сверху — бумага там чуть темнее */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18px; background: rgba(0, 0, 0, .04);
}
.note .peg {
  position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, .85) 0 12%, rgba(255, 255, 255, 0) 32%),
              radial-gradient(circle at 50% 55%, var(--pin, #c0392b) 0 55%, color-mix(in srgb, var(--pin, #c0392b) 70%, #000) 100%);
  box-shadow: 2px 3px 3px rgba(40, 20, 5, .45), inset 0 -1px 1px rgba(0, 0, 0, .25);
}
.note h2 { margin: 0 0 6px; padding-right: 46px; font: 700 27px/1.05 Caveat, cursive; color: #1f1a10; }
/* значок раздела — будто нарисован синей шариковой ручкой: толще линия, лёгкая дрожь, второй проход чуть со сдвигом */
.note-ico { position: absolute; top: 16px; right: 14px; transform: rotate(-6deg); }
.note:nth-child(even) .note-ico { transform: rotate(5deg); }
.note-ico .icon { width: 40px; height: 40px; stroke: #23389a; stroke-width: 1.7; filter: url(#pen-wobble) drop-shadow(.8px .6px 0 rgba(35, 56, 154, .45)); }
.note p { margin: 0; font: 500 14.5px/1.4 Onest, sans-serif; color: #3a3120; }
.note .lesson-hit { margin-top: 8px; font-size: 13.5px; color: #5a4a26; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 14px; }
.note-foot .lesson-n { font: 600 12.5px/1 Onest, sans-serif; color: #5a4a26; }
.note-foot .btn { background: rgba(255, 255, 255, .7); color: #1f1a10; border-color: rgba(60, 45, 10, .35); }
.note-foot .btn:hover { background: #fff; }
@media (prefers-reduced-motion: reduce) { .note { transition: none; } }

/* ── личный кабинет (ТЗ 12) ── */
.me-head { display: flex; align-items: center; gap: 14px; }
.me-fix { padding: 16px 18px; border-radius: var(--r-panel); background: var(--canvas); }
.me-fix p { color: var(--ink-2); }
.me-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--r-panel); background: var(--cam-wash); color: #23367f; }
.me-abs { margin: 6px 0; }
.me-doc { padding: 12px 0; }
.me-news { display: flex; justify-content: space-between; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--rule); color: var(--ink); }
.me-news:hover { text-decoration: none; background: var(--canvas); }
.me-news time { flex: none; font-size: 12.5px; color: var(--muted); }
.me-news.unread span { font-weight: 600; }
.me-news.unread span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--brand); vertical-align: 1px; }
.nav-badge.inline { margin-left: 4px; }
.mobilebar a .nav-badge { position: absolute; top: 0; left: calc(50% + 6px); margin: 0; min-width: 17px; padding: 0 4px; font-size: 10px; }
.route.route-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.leave-days { margin: 10px 0 0; font-weight: 600; }
@media (max-width: 760px) { .route.route-3 { grid-template-columns: 1fr; } }
.pw-form { max-width: 460px; }  /* смена пароля: три поля, широкий бланк ни к чему */
.me-acts { display: flex; flex: none; margin-left: -4px; }  /* пароль и выход — парой, чтобы имя на пропуске не сжималось */
.me-acts .iconbtn { width: 27px; }

/* ── раскрытая папка личного дела (вкладка «Документы»): крафт как у папок в ящике, стопка листов,
   справа торчат пластиковые разделители разделов; у раздела-листа — полоса его цвета ── */
.dfolder {
  --kraft-ink: #5a4310;
  position: relative; margin-top: 18px; padding: 14px 16px 18px; border-radius: 0 10px 10px 10px; color: #3d2c06;
  background: linear-gradient(180deg, #efdcb2, #e2c590);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 #b8935a, 0 18px 26px -20px rgba(60, 40, 0, .6);
}
.dfolder-tab {  /* тот же ярлычок с кодом, что у папки в ящике */
  position: absolute; left: 0; bottom: 100%; height: 20px; padding: 1px 16px 0; border-radius: 7px 7px 0 0;
  background: #efdcb2; color: var(--kraft-ink); font-size: 12.5px; font-weight: 700; line-height: 19px;
}
.dfolder-top { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px 2px; }
.dfolder-top b { font-size: 15px; }
.dfolder-top span { font-size: 13px; color: #7a6230; }
.dstack { display: grid; grid-template-columns: minmax(0, 1fr) 168px; align-items: start; }
.dsheets {  /* стопка: верхний лист и края двух под ним */
  position: relative; z-index: 1; min-height: 300px; border-radius: 3px; background: var(--paper);
  box-shadow: 0 1px 0 rgba(90, 67, 16, .22), 3px 3px 0 -1px #fbf8f0, 3px 3px 0 0 rgba(90, 67, 16, .22),
              6px 6px 0 -1px #f6f0e2, 6px 6px 0 0 rgba(90, 67, 16, .18), 0 16px 22px -16px rgba(60, 40, 0, .55);
}
.t-all   { --tone: #fffdf6; --tone-ink: var(--ink); }
.t-blue  { --tone: #cfdcff; --tone-ink: #1e3a9e; }
.t-green { --tone: #cdebd7; --tone-ink: #17633f; }
.t-amber { --tone: #ffe39c; --tone-ink: #7a5200; }
.t-coral { --tone: #ffd0c5; --tone-ink: #8f2c18; }
.t-lilac { --tone: #e3d9f6; --tone-ink: #5a3596; }
.dtabs { display: flex; flex-direction: column; gap: 5px; padding-top: 10px; }
.dtab {  /* разделитель: заходит под стопку, торчит вправо; выбранный выдвинут сильнее */
  display: flex; justify-content: space-between; gap: 8px; margin-left: -4px; padding: 7px 10px 7px 16px; border-radius: 0 8px 8px 0;
  background: var(--tone); color: var(--tone-ink); font-size: 13px; font-weight: 600; line-height: 1.25;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 1px 0 rgba(60, 40, 0, .22), 0 3px 6px -4px rgba(60, 40, 0, .5);
  transition: transform .16s ease-out;
}
.dtab span { font-weight: 700; font-variant-numeric: tabular-nums; opacity: .8; }
.dtab:hover { text-decoration: none; transform: translateX(3px); }
.dtab.on { transform: translateX(8px); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 0 rgba(60, 40, 0, .3), 0 6px 10px -5px rgba(60, 40, 0, .55); }
.dtab.none:not(.on) { background: color-mix(in srgb, var(--tone) 40%, #ead3a3); color: rgba(61, 44, 6, .66); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.dtab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dsec-h {  /* лист-разделитель раздела */
  margin: 0; padding: 7px 16px; background: var(--tone); color: var(--tone-ink); font-size: 13px; font-weight: 700;
  box-shadow: inset 0 -1px 0 rgba(60, 40, 0, .1);
}
.dsec:first-child .dsec-h, .dsec[hidden] + .dsec .dsec-h { border-radius: 3px 3px 0 0; }
.dsec-empty { margin: 0; padding: 18px 16px 22px; color: var(--muted); font-size: 13.5px; }
.doc { display: flex; align-items: flex-start; gap: 13px; padding: 13px 16px 12px; border-bottom: 1px solid var(--rule); }
.dsec .doc:last-child { border-bottom: 0; }
.doc { position: relative; }
.doc .doc-kind { position: relative; z-index: 1; margin-top: 1px; }
.doc.has-prev::before {  /* прежняя версия — лист под значком */
  content: ""; position: absolute; left: 21px; top: 9px; width: 34px; height: 42px; border-radius: 2px;
  background: #d9dde5; clip-path: polygon(0 0, 68% 0, 100% 24%, 100% 100%, 0 100%);
}
.doc-meta { font-size: 12.5px; color: var(--muted); }
.doc-act { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 5px; font-size: 12.5px; }
.doc-act form { display: flex; flex-wrap: wrap; gap: 3px 14px; margin: 0; }
.doc-title a.chip:hover { text-decoration: none; filter: brightness(.97); }
.dempty { display: grid; gap: 6px; justify-items: start; max-width: 520px; padding: 34px 26px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.dempty b { font-family: 'Caveat', cursive; font-size: 26px; font-weight: 600; line-height: 1.1; color: var(--ink); }
.dhistory { margin: 16px 2px 0; }
.dhistory summary { color: var(--kraft-ink); }
@media (max-width: 760px) {
  .dfolder { padding: 12px 10px 14px; }
  .dstack { grid-template-columns: minmax(0, 1fr); }
  .dtabs { order: -1; flex-direction: row; gap: 4px; padding: 0 2px; overflow-x: auto; scrollbar-width: none; }
  .dtab { flex: none; margin: 0 0 -3px; padding: 7px 11px 9px; border-radius: 8px 8px 0 0; white-space: nowrap; }
  .dtab:hover { transform: none; }
  .dtab.on { transform: translateY(-4px); }
  .doc { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .dtab { transition: none; } }

/* ── карточка сотрудника: под пропуском раскрытое личное дело — тот же крафт, что у папок в ящике;
   вкладки — язычки листов, выбранный белый и сливается с листом впереди, остальные — листы позади ── */
.pfile {
  margin-top: 4px; padding: 10px 14px 16px; border-radius: 12px;
  background: linear-gradient(180deg, #efdcb2, #e2c590);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 0 #b8935a, 0 18px 26px -20px rgba(60, 40, 0, .6);
}
.pfile > .tabs { gap: 3px; margin: 0; padding: 4px 8px 0; border-bottom: 0; }
.pfile > .tabs a {
  position: relative; margin: 0; padding: 8px 15px 7px; border: 0; border-radius: 8px 8px 0 0;
  background: #f4e8cc; color: #5a4310; font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -4px 5px -4px rgba(60, 40, 0, .3);
}
.pfile > .tabs a:hover { background: #faf2df; color: #3d2c06; }
.pfile > .tabs a.on { z-index: 1; background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: 0 -3px 6px -4px rgba(60, 40, 0, .4); }
.pfile > .tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.fsheet {
  position: relative; min-height: 260px; padding: 22px 24px 26px; border-radius: 3px; background: var(--paper);
  box-shadow: 0 1px 0 rgba(90, 67, 16, .25), 0 10px 18px -14px rgba(60, 40, 0, .5);
}
.fsheet > :first-child { margin-top: 0; }
/* «Документы» уже лежат в этой папке: свой крафт, ярлычок и подпись не нужны — стопка с разделителями прямо на листе */
.pfile .dfolder { margin: 0; padding: 0; background: none; box-shadow: none; border-radius: 0; }
.pfile .dfolder-tab, .pfile .dfolder-top { display: none; }
.pfile .dsheets { box-shadow: 0 0 0 1px var(--rule-strong), 3px 3px 0 -1px #fbf9f4, 3px 3px 0 0 var(--rule-strong),
                  6px 6px 0 -1px #f7f4ec, 6px 6px 0 0 var(--rule), 0 14px 20px -16px rgba(30, 40, 60, .35); }
.pfile .dtab.none:not(.on) { background: color-mix(in srgb, var(--tone) 35%, #eef0f3); color: var(--muted); }
.pfile .dhistory summary { color: inherit; }
@media (max-width: 760px) {
  .pfile { margin: 4px -8px 0; padding: 8px 8px 12px; }
  .pfile > .tabs { padding: 4px 2px 0; }
  .pfile > .tabs a { padding: 8px 12px 7px; }
  .fsheet { padding: 16px 14px 20px; }
}

/* ── список сотрудников: сортировка по колонкам, страницы (ТЗ 24.1) ── */
table.list th a.sort { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.list th a.sort:hover { color: var(--ink); text-decoration: none; }
table.list th a.sort.on { color: var(--ink); font-weight: 600; }
table.list th a.sort.on::after { content: ""; border: 4px solid transparent; border-bottom-color: currentColor; margin-top: -4px; }
table.list th a.sort.on.desc::after { border-bottom-color: transparent; border-top-color: currentColor; margin: 4px 0 0; }
table.list th.num a.sort { flex-direction: row-reverse; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 16px 0 4px; color: var(--muted); font-size: 13px; }
.filter-note { margin: -4px 0 12px; padding: 8px 12px; border-radius: 8px; background: var(--card-wash); color: #6b4a00; font-size: 13px; }

/* ── общее для новых разделов: колонка с бланком справа, поле в строке фильтров ── */
.side-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.side-layout.single { grid-template-columns: minmax(0, 1fr); }
.side-layout > div > .section-title:first-child { margin-top: 0; }
.side-form { position: sticky; top: 16px; display: grid; gap: 12px; padding: 20px 20px 18px 52px; }
.side-form h3 { margin: 0; font-size: 15px; }
.side-form input:not([type=checkbox]):not([type=radio]), .side-form select { width: 100%; min-width: 0; }
.side-form .form-actions { margin-top: 4px; }
div.side-form { padding: 0; }
div.side-form > .paper-form { padding: 18px 18px 16px 50px; display: grid; gap: 10px; }
div.side-form > .paper-form h3 { margin: 0; font-size: 15px; }
div.side-form > .paper-form.compact { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 12px 50px; }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.inline-field input { height: 34px; }
.kind-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.check-line { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.check-line input { width: 17px; height: 17px; margin: 0; }
.check-line .hint { grid-column: 2; font-size: 12px; color: var(--muted); }
.doc-locked { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.doc-locked .icon { width: 14px; height: 14px; }
label.file-link { position: relative; font-size: 12.5px; }
label.file-link input { position: absolute; width: 1px; height: 1px; opacity: 0; }
label.file-link:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
.form-aside { display: inline-flex; align-items: center; gap: 5px; margin-top: -6px; }
.form-aside .icon { width: 14px; height: 14px; }
.chip.big { height: 30px; padding: 0 13px; font-size: 13.5px; font-weight: 600; }
.ev-papers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }
.ev-papers .addlink .icon { width: 14px; height: 14px; }
.linked { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--brand-wash); color: var(--brand-ink); font-size: 13.5px; }
.linked .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }

/* ── штатное расписание и отчёты: группы-отделы, подытоги, общий итог ── */
table.list tr.group td { padding: 14px 10px 6px; border-bottom: 1px solid var(--rule-strong); background: none; }
table.list tr.group td b { font-size: 14.5px; }
table.list tr.subtotal td { background: var(--canvas); font-weight: 600; font-size: 13.5px; }
table.list tfoot tr.grand td { padding: 14px 10px; border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; font-size: 15px; }
table.list.staffing tbody + tbody tr.group td { padding-top: 22px; }
table.list.report td { vertical-align: top; }
.report-sum { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--r-panel); color: var(--ink-2); font-size: 13.5px; }
.report-sum b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.report-card {
  position: relative; display: grid; gap: 4px; align-content: start; min-height: 132px; padding: 16px 18px 18px 58px;
  border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); color: var(--ink-2); font-size: 13.5px;
}
a.report-card:hover { text-decoration: none; border-color: var(--rule-strong); box-shadow: 0 10px 22px -16px rgba(24, 33, 47, .4); }
.report-card b { color: var(--ink); font-size: 15.5px; font-weight: 600; }
.report-card.off { background: var(--canvas); }
.report-card.off b { color: var(--ink-2); }
.report-n {  /* номер формы — латунный номерок, как у разделов */
  position: absolute; left: 16px; top: 15px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--brass); color: #3b2a07; font-weight: 700; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 2px rgba(60, 40, 0, .3);
}
.report-note { margin-top: 6px; color: #8a5b00; font-size: 12.5px; }

/* ── главная: четыре утверждённых показателя (ТЗ 17.1, 23) ── */
.home-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { display: grid; align-content: start; gap: 2px; padding: 14px 18px 16px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); color: inherit; }
a.kpi:hover, .kpi-split > a:hover { background: var(--canvas); text-decoration: none; }
.kpi-v { font-size: 32px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-v.hot { color: var(--late); }
.kpi-t { color: var(--ink); font-size: 13.5px; font-weight: 500; }
.kpi-n { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.kpi-split { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; gap: 0; overflow: hidden; }
.kpi-split > a { display: grid; align-content: start; gap: 2px; padding: 14px 16px 16px; color: inherit; border-left: 1px solid var(--rule); }
.kpi-split > a:first-child { border-left: 0; }
.kpi-split > a.kpi-warn {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-left: 0;
  border-top: 1px solid var(--rule); background: var(--card-wash); color: #6b4a00; font-size: 12.5px;
}
.kpi-warn .icon { width: 15px; height: 15px; flex: none; }

/* ── двухфакторный вход ── */
.tf-link {
  display: flex; align-items: center; gap: 12px; max-width: 860px; margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); color: var(--ink-2); font-size: 13.5px;
}
.tf-link:hover { text-decoration: none; border-color: var(--rule-strong); }
.tf-link span { flex: 1; display: grid; gap: 2px; }
.tf-link b { color: var(--ink); font-size: 14.5px; }
.tf-steps { margin: 0; padding-left: 20px; display: grid; gap: 18px; }
.tf-steps li { padding-left: 4px; }
.tf-steps li > b { display: block; margin-bottom: 4px; color: var(--ink); }
.tf-steps li > span { display: block; color: var(--ink-2); font-size: 13.5px; margin: 4px 0; }
.tf-qr { display: inline-block; margin: 8px 0; padding: 8px; background: #fff; border-radius: 8px; box-shadow: 0 0 0 1px var(--rule); line-height: 0; }
.tf-qr svg { width: 205px; height: 205px; }
.tf-key { font-size: 14px; letter-spacing: .06em; padding: 2px 6px; border-radius: 5px; background: var(--canvas); word-break: break-all; }
.tf-act { display: grid; gap: 10px; max-width: 360px; margin-top: 8px; }
input.code-input { height: 46px; font-size: 22px; letter-spacing: .25em; font-variant-numeric: tabular-nums; text-align: center; }
.backup-codes { columns: 2; gap: 24px; margin: 12px 0; padding-left: 22px; font-size: 16px; line-height: 1.9; }
.backup-codes code { font-size: 16px; letter-spacing: .04em; }
.tf-on h3 { display: flex; align-items: center; gap: 8px; }
@media print {
  .rail, .mobilebar, .back, .page-head, .tf-codes .form-actions, .toasts { display: none; }
}

/* ── кадровые документы: реестр, черновик, шаблоны, нумерация ── */
.paper-new .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.paper-new .date-row { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
/* предпросмотр рядом с формой: лист A4 в масштабе колонки; жёлтое — данные из системы, розовое — данных нет */
.paper-split { display: grid; gap: 24px; align-items: start; }
.doc-preview { display: grid; gap: 10px; min-width: 0; max-width: 860px; align-content: start; }
.dp-bar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-height: 36px; }
.dp-bar h2 { margin: 0 auto 0 0; font-size: 15px; }
.dp-who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.dp-who select { max-width: 220px; }
.dp-legend { margin: 0; display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.dp-legend mark { padding: 1px 7px; color: var(--ink); }
.dp-note { margin: 0; padding: 16px; border: 1px dashed var(--rule-strong); border-radius: 8px; color: var(--ink-2); }
.dp-missing { border-radius: 8px; background: #fff5f5; box-shadow: inset 0 0 0 1px #f2cfcf; font-size: 13px; }
.dp-missing summary { cursor: pointer; padding: 8px 14px; font-weight: 500; color: #8a2c2c; }
.dp-missing ul { margin: 0; padding: 0 14px 10px 32px; display: grid; gap: 4px; }
.dp-missing span { color: var(--muted); }
.dp-desk { background: #e8eaee; border-radius: 8px; padding: 12px; overflow: hidden; }
.dp-sheet { --k: .6; --dp-serif: "Times New Roman", Times, "Liberation Serif", serif; }
.dp-page { zoom: var(--k); position: relative; box-sizing: border-box; margin: 0 auto; overflow: hidden; background: #fff; color: #000;
  font-family: var(--dp-serif); font-size: 12pt; line-height: 1.15; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 18px -8px rgba(0, 0, 0, .25); }
.dp-page p { margin: 0; overflow-wrap: break-word; }
.dp-page table { border-collapse: collapse; table-layout: fixed; max-width: 100%; }
.dp-header, .dp-body, .dp-footer { position: relative; z-index: 1; }
.dp-footer { margin-top: 24px; }
.dp-layer { position: absolute; z-index: 0; pointer-events: none; }
.dp-tab { display: inline-block; width: 4em; }
.dp-float.r { float: right; }
.dp-float.l { float: left; }
.dp-img { display: inline-block; vertical-align: top; background: repeating-linear-gradient(45deg, #eceef2 0 6px, #f7f8fa 6px 12px); }
.dp-break { display: block; margin: 10px 0; border-top: 1px dashed #9aa3b2; }
mark.dp-f, mark.dp-e, mark.dp-u, mark.dp-n { color: inherit; border-radius: 2px; }
mark.dp-f { background: #fff0a6; box-shadow: 0 0 0 1px #ecd06a; }
mark.dp-e { background: #ffdede; box-shadow: 0 0 0 1px #eea9a9; }
mark.dp-u { background: #ffd9ad; box-shadow: 0 0 0 1px #d98a2b; }
mark.dp-n { background: #e6e9ef; box-shadow: 0 0 0 1px #c5cbd6; }
.doc-preview.is-busy .dp-sheet { opacity: .55; transition: opacity .15s .2s; }
.doc-preview.in-page { margin-top: 24px; }
@media (min-width: 1280px) {
  .paper-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .paper-split .paper-form, .paper-split .doc-preview { max-width: none; }
  .paper-split .doc-preview { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; overscroll-behavior: contain; }
}
.source-pick { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.source-pick legend { padding: 0; margin-bottom: 6px; font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.source-pick:has(input[name=use][value=template]:checked) .use-file,
.source-pick:has(input[name=use][value=file]:checked) .use-template { display: none; }
.paper-facts { margin-top: 0; }
.paper-actions { display: grid; gap: 14px; }
.paper-actions .paper-cancel { border-top: 0; padding: 0 4px; }
.inline-act { display: inline-block; }
.inline-act > summary { list-style: none; cursor: pointer; }
.inline-act > summary::-webkit-details-marker { display: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.inline-form input[type=file] { height: auto; padding: 4px; max-width: 240px; }
.fields-ref td { padding: 6px 10px; }
.fields-ref code { font-size: 13px; color: var(--brand-ink); }
table.numbers td { padding: 6px 10px; }
.num-form { display: flex; gap: 8px; align-items: center; }
.num-form .w-pattern { width: 130px; }
.num-form .w-num { width: 90px; }
.check-inline { display: inline-grid; place-items: center; width: 70px; }
.check-inline input { width: 17px; height: 17px; }

/* выбор сотрудников фишками (core/_people_picker.html, initPicker) */
.picker-ui { flex-wrap: wrap; align-items: center; gap: 6px; min-height: 40px; padding: 4px 6px; border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--paper); position: relative; }
.picker.js .picker-ui:not([hidden]) { display: flex; }
.picker-ui:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-wash); }
.picker-chips { display: contents; }
.picker-chip { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px 0 10px; border-radius: 999px; background: var(--brand-wash); color: var(--brand-ink); font-size: 13px; font-weight: 500; }
.picker-chip button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.picker-chip button:hover { background: rgba(30, 58, 158, .12); }
.picker-ui input.picker-input { flex: 1; min-width: 160px; height: 30px; padding: 0 4px; border: 0; box-shadow: none; background-color: transparent; }
.picker-native { height: auto; padding: 4px; }

@media (max-width: 1100px) {
  .side-layout { grid-template-columns: minmax(0, 1fr); }
  .side-form { position: static; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi-split { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 760px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi-v { font-size: 26px; }
  .kpi-split > a { padding: 12px; }
  .paper-new .form-grid { grid-template-columns: minmax(0, 1fr); }
  .paper-new .date-row { grid-template-columns: minmax(0, 1fr); }
  .home-filter { width: 100%; }
  .home-filter select { flex: 1; min-width: 0; }
  .inline-field input { width: 140px; }
  .report-card { min-height: 0; }
  .backup-codes { columns: 1; }
}
.tf-steps li > span.on-touch { display: none; }
@media (hover: none) { .tf-steps li > span.on-touch { display: block; } }
.kpi-split > a { min-width: 0; }
.kpi-split .kpi-t { overflow-wrap: anywhere; }

/* регистрация лица на камере офиса (attendance/enroll.py): слева живое видео камеры, справа ход и итог */
.cam-enroll { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 12.5px; font-weight: 600; }
.cam-enroll .icon { width: 15px; height: 15px; }
.idpass-code .face-enroll { margin-left: 6px; font-weight: 600; }
.enroll-form { max-width: 720px; }
.enroll-who { font-size: 16px; }
.enroll-tips { margin: 14px 0 0; padding: 10px 14px; border-radius: var(--r-ctl); background: var(--cam-wash); font-size: 13.5px; }
.enroll-tips ul, ul.enroll-tips { margin: 6px 0 0; padding-left: 18px; }
ul.enroll-tips { padding: 10px 14px 10px 30px; }
.enroll { display: grid; gap: 18px; max-width: 1180px; }
@media (min-width: 980px) { .enroll { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); align-items: start; } }
.enroll-live { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-panel); background: #0d1220; overflow: hidden; display: grid; place-items: center; }
.enroll-live .live-img { position: absolute; inset: 0; }
.enroll-onair { position: absolute; left: 12px; top: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; }
.enroll-onair i { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; animation: rec-blink 1.4s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: .3; } }
.enroll-novideo { margin: 0; color: #aeb6c7; font-size: 14px; }
.enroll-card { padding: 18px 20px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); }
.enroll-state { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.enroll-state.done { color: var(--seal-ok); }
.enroll-state.error, .enroll-state.timeout { color: var(--late); }
.enroll-state.cancel { color: var(--muted); }
.enroll-stage { margin: 0 0 12px; font-size: 16px; min-height: 1.4em; }
.enroll-bar { height: 8px; border-radius: 99px; background: var(--canvas); overflow: hidden; }
.enroll-bar i { display: block; height: 100%; border-radius: inherit; background: var(--cam); transition: width .4s ease-out; }
.enroll-detail { margin: 10px 0 0; font-size: 13.5px; }
.enroll-detail:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .enroll-onair i { animation: none; } .enroll-bar i { transition: none; } }

/* журнал согласования (05.11, по отзыву: «имя явнее, компактнее, офисно»): разлинованный журнал регистрации на бумаге,
   с красным полем, как бланки; по строке на решение; замечание — синими чернилами в кавычках (Caveat читали с трудом) */
.jlog {
  max-width: 860px; margin: 0 0 26px; padding: 4px 0 8px; list-style: none; border-radius: 4px;
  background: linear-gradient(90deg, transparent 38px, rgba(214, 69, 65, .42) 38px 39.5px, transparent 39.5px), #fffdf6;
  box-shadow: 0 0 0 1px #ece5d4, 0 16px 28px -22px rgba(24, 33, 47, .4);
}
.jl-head, .jl-row { display: grid; grid-template-columns: 62px minmax(170px, 230px) minmax(0, 1fr); gap: 14px; align-items: center; padding: 0 18px 0 54px; }
.jl-head { padding-top: 6px; padding-bottom: 6px; border-bottom: 3px double rgba(80, 120, 200, .35); font-size: 11.5px; color: var(--muted); }
.jl-row { min-height: 46px; padding-top: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(80, 120, 200, .2); }
.jl-row:last-child { border-bottom: 0; }
.jl-when { display: grid; line-height: 1.15; font-variant-numeric: tabular-nums; }
.jl-when b { font-size: 14px; }
.jl-when span { font-size: 12px; color: var(--muted); }
.jl-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.jl-who > span:last-child { display: grid; min-width: 0; line-height: 1.2; }
.jl-who b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jl-who small { font-size: 12px; color: var(--muted); }
.jl-what { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; }
.jl-act { flex: none; padding: 1px 8px; border: 1.5px solid currentColor; border-radius: 5px; font-size: 12.5px; font-weight: 700; transform: rotate(-1.5deg); }
.jl-row.t-ok .jl-act { color: #1f8a57; }
.jl-row.t-back .jl-act { color: #2f4fb8; }
.jl-row.t-no .jl-act { color: #cf3424; }
.jl-row.t-sub .jl-act { color: var(--ink-2); border-color: transparent; padding-left: 0; transform: none; }
.jl-row.t-skip .jl-act { color: var(--muted); border-style: dashed; transform: none; }
.jl-what q { font: 500 14px/1.35 Onest, sans-serif; color: #22398f; quotes: '«' '»'; }
.jl-sep { position: relative; padding: 8px 18px 6px 54px; font-size: 12px; color: var(--muted); }
.jl-sep span { position: relative; padding-right: 10px; background: #fffdf6; }
.jl-sep::before { content: ""; position: absolute; left: 54px; right: 18px; top: 50%; border-top: 1px dashed rgba(80, 120, 200, .45); }
@media (max-width: 640px) {
  .jl-head { display: none; }
  .jl-row { grid-template-columns: 52px minmax(0, 1fr); padding-left: 48px; }
  .jl-what { grid-column: 2; }
}


/* ── закрытие месяца (attendance/close.html) ───────────── */
.cl-state { margin: 0 0 6px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); }
.cl-state > p { margin: 0 0 10px; }
.cl-state.is-closed { border-color: #b9dcc9; background: var(--both-wash); }
.cl-state details.act { border-top: 0; padding-top: 0; margin-bottom: 8px; }
.cl-totals { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); font-size: 13px; }
.cl-totals b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.cl-hist { margin-top: 8px; font-size: 13px; color: var(--muted); }
.cl-hist summary { cursor: pointer; }
.cl-hist ul { margin: 6px 0 0; padding-left: 18px; }
.cl-list { border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper); overflow: hidden; }
.cl-head, .cl-p > summary {
  display: grid; grid-template-columns: minmax(220px, 2.2fr) 1.3fr .9fr 1.1fr 1fr 118px;
  grid-template-areas: "p cr ot lt ab ch"; gap: 12px; align-items: center; padding: 10px 14px;
}
.cl-head { font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--rule); }
.cl-dep { padding: 7px 14px; background: var(--canvas); font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.cl-dep .n { font-weight: 400; color: var(--muted); margin-left: 4px; }
.cl-p { border-bottom: 1px solid var(--rule); }
.cl-p:last-child { border-bottom: 0; }
.cl-p > summary { cursor: pointer; list-style: none; }
.cl-p > summary::-webkit-details-marker { display: none; }
.cl-p > summary:hover { background: #fafbfc; }
.cl-p .person { grid-area: p; display: flex; align-items: center; gap: 10px; min-width: 0; }
.cl-p .person .nm { display: flex; flex-direction: column; min-width: 0; }
.cl-p .person .nm span { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-cr { grid-area: cr; } .cl-ot { grid-area: ot; } .cl-lt { grid-area: lt; } .cl-codes { grid-area: ab; } .cl-chip { grid-area: ch; justify-self: end; }
.cl-fig { font-variant-numeric: tabular-nums; }
.cl-fig b { font-size: 15px; }
.cl-fig em { font-style: normal; font-weight: 600; margin-left: 2px; }
.cl-fig em.minus { color: var(--late); }
.cl-fig em.plus { color: var(--both); }
.cl-fig .m-l { display: none; }
.cl-codes { display: flex; flex-wrap: wrap; gap: 4px; }
.cl-codes .code { padding: 1px 6px; border-radius: 6px; background: var(--abs-wash); font-size: 12.5px; font-weight: 600; }
.cl-days { padding: 0 14px 12px; }
.cl-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; }
.cl-day { display: grid; grid-template-columns: 112px minmax(0, 1fr) 220px; gap: 6px 16px; padding: 11px 0; border-top: 1px dashed var(--rule); }
.cl-when { display: flex; flex-direction: column; }
.cl-when span { color: var(--muted); font-size: 12.5px; }
.cl-day.need .cl-when b { color: var(--late); }
.cl-what a { margin-left: 6px; white-space: nowrap; }
.cl-away { display: block; margin-top: 2px; font-weight: 600; color: var(--card); }
.cl-res { text-align: right; }
.cl-res .small { display: block; }
.cl-do { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cl-do .btn.on { background: var(--brand-wash); border-color: var(--brand); color: var(--brand-ink); }
.cl-hours { display: inline-flex; gap: 4px; }
.cl-hours input { width: 72px; height: 30px; padding: 0 8px; }
.cl-note { flex: 1; min-width: 180px; height: 30px; padding: 0 8px; }
.cl-mod { display: flex; align-items: center; gap: 6px; }
.cl-late td { white-space: nowrap; }
.cl-late td:first-child { white-space: normal; min-width: 140px; }
.cl-mod input { width: 64px; height: 30px; padding: 0 8px; }
.cl-x { color: var(--muted); }
@media (max-width: 900px) {
  .cl-head { display: none; }
  .cl-p > summary { grid-template-columns: 1fr 1fr auto; grid-template-areas: "p p ch" "cr ot lt" "ab ab ab"; row-gap: 6px; }
  .cl-fig .m-l { display: block; color: var(--muted); font-size: 11.5px; }
  .cl-codes:has(> .muted:only-child) { display: none; }
  .cl-day { grid-template-columns: 1fr; }
  .cl-res { text-align: left; }
  .cl-do { grid-column: 1; }
}

/* норма по месяцам в «Настройки → Производственный календарь» */
.cal-norms { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r-panel); overflow: hidden; }
.cal-norms > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-left: 1px solid var(--rule); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.cal-norms > div:first-child { border-left: 0; }
.cal-norms b { font-weight: 600; }
.cal-norms span { color: var(--muted); }
.cal-norms .total { background: var(--canvas); }
@media (max-width: 900px) {
  .cal-norms { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cal-norms > div { border-top: 1px solid var(--rule); }
}

/* ── инвентаризация (10.11) ─────────────────────────────── */
/* инвентарная бирка — серебристая наклейка с номером и штрихкодом, как на самой технике */
.inv-tag {
  display: inline-flex; flex-direction: column; align-items: stretch; gap: 1px; min-width: 68px; padding: 3px 7px 4px;
  border-radius: 3px; color: #1d2633; text-align: center; line-height: 1.1; white-space: nowrap; vertical-align: middle;
  background: linear-gradient(115deg, #eef1f4 0%, #d3d9e0 30%, #f9fafb 47%, #cdd4dc 70%, #e8ebef 100%);
  box-shadow: inset 0 0 0 1px rgba(70, 84, 104, .32), inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 1px rgba(24, 33, 47, .12);
}
.inv-tag small { font-size: 8.5px; font-weight: 600; color: #5d6878; letter-spacing: .06em; }
.inv-tag b { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.inv-tag .barcode { display: block; width: 100%; height: 8px; margin-top: 1px; fill: #1d2633; }
.inv-tag.none { padding: 6px 8px; background: none; box-shadow: none; border: 1px dashed var(--rule-strong); color: var(--muted); font-size: 11.5px; }
.inv-tag.lg { min-width: 152px; padding: 8px 16px 9px; border-radius: 5px; transform: rotate(-1.2deg); }
.inv-tag.lg small { font-size: 10.5px; }
.inv-tag.lg b { font-size: 21px; }
.inv-tag.lg .barcode { height: 20px; margin-top: 3px; }
.inv-tag.lg.none { font-size: 14px; padding: 18px 16px; }

.inv-name a { color: inherit; }
.inv-name b { font-weight: 600; }
.inv-name > span { display: block; font-size: 12px; color: var(--muted); }
table.list tr.gone td { color: var(--muted); }
table.list tr.gone .inv-tag, table.list tr.gone .avatar { opacity: .55; }
.closed-on { display: block; }
.acc-login { font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
.shared { color: var(--ink-2); }
.tabs a .n.warn { color: var(--late); font-weight: 600; }
a.plain { color: inherit; }
.off-list td { vertical-align: top; }
.off-thing { display: block; font-size: 13.5px; }
.off-thing + .off-thing { margin-top: 3px; }

/* пароль: точки, по коду — сам пароль моноширинным (чтобы l, I и 1 не путались), через 30 с снова точки */
.pw { display: inline-flex; align-items: center; gap: 6px; }
.pw form { display: contents; }
.pw-text { letter-spacing: .12em; color: var(--ink-2); }
.pw.shown .pw-text {
  letter-spacing: 0; font: 500 13.5px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink);
  background: var(--card-wash); padding: 2px 6px; border-radius: 5px; user-select: all; white-space: nowrap;
}
.pw .iconbtn { width: 28px; height: 28px; }
.pw-input { display: flex; gap: 6px; }
.pw-input input { flex: 1; min-width: 0; }
.pw-shown {
  display: inline-block; margin: 0 0 10px; padding: 14px 18px; border-radius: 8px; background: var(--card-wash);
  font: 600 22px/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace; user-select: all; overflow-wrap: anywhere;
}
dialog.vault-dialog { width: min(400px, calc(100vw - 32px)); padding: 0; border: 0; background: none; overflow: visible; }
dialog.vault-dialog::backdrop { background: rgba(16, 22, 40, .45); }
dialog.vault-dialog .paper-form { display: grid; gap: 12px; padding: 22px 22px 18px 54px; }
dialog.vault-dialog h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; }
dialog.vault-dialog .form-actions { margin-top: 2px; }
.vault-error { margin: 0; color: var(--late); font-size: 13px; }
.vault-page { max-width: 440px; display: grid; gap: 12px; }

.side-col { display: grid; gap: 18px; align-content: start; }
.side-col .side-form { position: static; }
.more-fields { border-top: 1px dashed var(--rule-strong); padding-top: 8px; }
.more-fields > summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.more-fields[open] { display: grid; gap: 12px; }
div.side-form.inv-moves { gap: 0; padding: 14px 20px 10px 52px; }  /* div.side-form без отступов — для обёрток, здесь свой лист */
.inv-moves details.act:first-child { border-top: 0; padding-top: 0; }
.inv-moves details.act form { display: grid; gap: 10px; padding: 10px 0 6px; }

.item-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.item-head > div { flex: 1; min-width: 220px; }
.item-head .sub { color: var(--muted); margin-top: 4px; }
.inv-who { gap: 14px; }
.inv-facts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 0 0 10px; overflow: hidden;
  border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper);
}
.inv-facts > div { padding: 11px 14px; box-shadow: 1px 1px 0 0 var(--rule); }
.inv-facts .wide { grid-column: 1 / -1; }
.inv-facts dt { font-size: 12.5px; color: var(--muted); }
.inv-facts dd { margin: 3px 0 0; font-weight: 500; }
.inv-log td { vertical-align: top; }
.inv-log .change { display: block; font-size: 12.5px; color: var(--ink-2); }
.inv-log b { font-weight: 600; }
.ev-issued { color: #2c44ad; }
.ev-returned, .ev-fixed, .ev-found { color: #166b46; }
.ev-repair { color: #8a5b00; }
.ev-lost, .ev-off { color: var(--late); }
.pw.failed .pw-text { letter-spacing: 0; font-size: 12.5px; color: var(--late); }

/* справочник сервисов: подсказка под полем «Сервис» — есть / похоже на … / новый */
.svc-pick .hint.warn { color: #8a5b00; }
.svc-pick .hint button {
  padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--brand-ink); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.svc-pick .svc-new { margin-top: 4px; }

/* ── склад: стеллаж с коробками (10.11, просьба пользователя: «как реальные складские полки, товар в коробке, фото на нём»).
   Синие перфорированные стойки, оранжевые балки с табличками места, коробки из крафта: размер — по виду вещи,
   на лицевой стороне фото или значок вида «краской». rack.js раскладывает по ярусам и даёт таскать и бросать. */
:root {
  --kraft-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='k'><feTurbulence type='fractalNoise' baseFrequency='.9 .3' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 .32  0 0 0 0 .2  0 0 0 0 .07  0 0 0 .2 0'/></filter><rect width='100%' height='100%' filter='url(%23k)'/></svg>");
}
.rk-help { margin: -6px 0 10px; font-size: 13px; color: var(--muted); }
.rk-tools { align-items: center; margin-bottom: 10px; }
.rk-tools .rk-help { flex: 1; min-width: 220px; margin: 0; }
.whs {
  --u: 1px; --post: 16px; position: relative; margin: 0 0 24px; padding: 22px 20px 0; border-radius: var(--r-panel);
  background: linear-gradient(180deg, #f2efea, #e6e1d9); box-shadow: inset 0 0 0 1px rgba(70, 55, 30, .08); overflow: hidden;
}
/* пол цеха: бетон и жёлтая разметка */
.whs::after {
  content: ''; display: block; height: 20px; margin: 0 -20px;
  background: linear-gradient(180deg, #c5bdaf 0 2px, #dcd6cb 2px 8px, #efc12f 8px 11px, #dcd6cb 11px);
}
.rk { position: relative; padding: 0 var(--post); }
.rk::before, .rk::after {  /* стойки с перфорацией */
  content: ''; position: absolute; z-index: 3; top: -22px; bottom: 0; width: var(--post); pointer-events: none;
  background:
    repeating-linear-gradient(180deg, transparent 0 7px, #10224f 7px 13px, transparent 13px 20px) 50% 0 / 4px 100% no-repeat,
    linear-gradient(90deg, #1c3a7c, #3a66bf 35%, #2b52a3 65%, #1a3471);
  box-shadow: 1px 0 2px rgba(0, 0, 0, .18);
}
.rk::before { left: 0; }
.rk::after { right: 0; }
.rk-sec { position: relative; padding: 0 10px; }
.rk-load { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; min-height: 58px; padding-top: 20px; }
.rk-beam {
  position: relative; z-index: 2; height: 22px; margin: 0 calc(-10px - var(--post));
  background: linear-gradient(180deg, #f7a868 0 2px, #ea7b2c 2px 17px, #c4601f 17px 20px, rgba(60, 30, 10, .22) 20px 22px);
}
.rk-loc {
  position: absolute; left: calc(var(--post) + 18px); top: 3px; display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 2 * var(--post) - 36px); height: 16px; padding: 0 2px 0 6px; overflow: hidden;
  background: #fff; color: #171717; border-radius: 1px; box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
  font: 500 11px/16px Onest, sans-serif; white-space: nowrap;
}
.rk-loc b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.rk-loc .rk-hint { color: #5f5a52; overflow: hidden; text-overflow: ellipsis; }
.rk-loc .n { flex: none; padding: 0 5px; background: #171717; color: #fff; border-radius: 1px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-loc a { display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: inherit; }
.rk-loc .avatar { flex: none; width: 14px; height: 14px; font-size: 6.5px; border-radius: 2px; }
.rk-empty { align-self: center; font-size: 12.5px; color: #8b8478; }
/* rack.js разложил по ярусам: координаты коробок и балок — в пикселях внутри секции */
.rk-sec.packed .rk-load { display: block; min-height: 0; height: 0; padding: 0; }
.rk-sec.packed .rk-beam { position: absolute; left: calc(-1 * var(--post)); right: calc(-1 * var(--post)); margin: 0; }
.rk-sec.packed .rk-beam.extra .rk-loc { display: none; }
.rk-sec.packed .rk-empty { position: absolute; left: 12px; }
.rk-sec.packed .bx { position: absolute; left: 0; top: 0; cursor: grab; touch-action: pan-y; will-change: transform; }
.rk-sec.packed .bx.grabbing { cursor: grabbing; z-index: 4; }

/* коробка: крафт, скотч сверху, светлая кромка крышки, тень справа; размеры — по виду (в «единицах» --u) */
.bx {
  --w: 76; --h: 56; position: relative; display: block; flex: none; width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u));
  padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: none; cursor: pointer;
  container-type: size; user-select: none; -webkit-user-select: none;
  filter: drop-shadow(2px 3px 2px rgba(45, 28, 10, .22));
  /* цвет коробки — переменные: крафт по умолчанию; белые, тёмные, светлый крафт — по виду; сломанное — красное */
  --box-hi: #d0a66a; --box-lo: #c29455; --box-edge: rgba(95, 60, 22, .42); --tape: rgba(246, 232, 196, .66);
  --grain: var(--kraft-grain); --print: #3f2710; --print-blend: multiply; --marker: #1d1a17;
}
/* ноутбуки, телефоны, планшеты, гарнитуры — белые коробки, как из магазина */
.bx.k-laptop, .bx.k-phone, .bx.k-tablet, .bx.k-headset {
  --box-hi: #f7f5f1; --box-lo: #e6e2da; --box-edge: rgba(70, 64, 54, .3); --tape: rgba(255, 255, 255, .5); --grain: none; --print: #2a2a2a;
}
/* клавиатуры, мыши, веб-камеры — тёмные коробки периферии */
.bx.k-keyboard, .bx.k-mouse, .bx.k-webcam {
  --box-hi: #4a4e55; --box-lo: #393c42; --box-edge: rgba(0, 0, 0, .45); --tape: rgba(255, 255, 255, .14); --grain: none;
  --print: #eef0f3; --print-blend: normal; --marker: #fff;
}
/* сеть, ИБП, провода, SIM, ключи — светлый крафт */
.bx.k-network, .bx.k-ups, .bx.k-accessory, .bx.k-sim, .bx.k-key { --box-hi: #e3c993; --box-lo: #d5b67d; }
/* сломанное (в ремонте или «Сломалось» от сотрудника) — всё одним цветом, красным (просьба пользователя «интереса ради») */
.bx.broken {
  --box-hi: #d0614c; --box-lo: #b84a37; --box-edge: rgba(90, 20, 10, .5); --tape: rgba(255, 236, 228, .5);
  --grain: var(--kraft-grain); --print: #3a0d05; --print-blend: multiply; --marker: #2a0a04;
}
.bx.k-laptop { --w: 118; --h: 40; }
.bx.k-computer { --w: 64; --h: 94; }
.bx.k-monitor { --w: 132; --h: 88; }
.bx.k-keyboard { --w: 124; --h: 30; }
.bx.k-mouse { --w: 44; --h: 34; }
.bx.k-headset { --w: 62; --h: 56; }
.bx.k-webcam { --w: 46; --h: 42; }
.bx.k-phone { --w: 40; --h: 54; }
.bx.k-tablet { --w: 84; --h: 60; }
.bx.k-sim { --w: 30; --h: 22; }
.bx.k-printer { --w: 150; --h: 112; }
.bx.k-network { --w: 92; --h: 40; }
.bx.k-ups { --w: 70; --h: 66; }
.bx.k-accessory { --w: 56; --h: 38; }
.bx.k-furniture { --w: 120; --h: 112; }
.bx.k-key { --w: 34; --h: 22; }
.bx-face {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 2px; overflow: hidden;
  background:
    linear-gradient(90deg, transparent 43%, var(--tape) 43% 57%, transparent 57%) top / 100% 32% no-repeat,
    linear-gradient(180deg, rgba(255, 246, 225, .22) 0 4px, rgba(60, 40, 20, .22) 4px 5px, transparent 5px),
    var(--grain),
    linear-gradient(180deg, var(--box-hi), var(--box-lo));
  box-shadow: inset 0 0 0 1px var(--box-edge), inset -6px 0 7px -5px rgba(40, 25, 10, .4);
  transition: transform .15s ease;
}
.bx-print { display: grid; place-items: center; color: var(--print); }
.bx-picto { width: min(58cqh, 44cqw); height: min(58cqh, 44cqw); opacity: .8; mix-blend-mode: var(--print-blend); }
/* одинаковые вещи — стопка: за коробкой видны края ещё двух, на коробке маркером «×5» */
.bx.stack::before, .bx.stack::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 2px;
  background: linear-gradient(180deg, var(--box-hi), var(--box-lo)); box-shadow: inset 0 0 0 1px var(--box-edge);
  transform: translate(4px, -5px); filter: brightness(.9);
}
.bx.stack::after { transform: translate(8px, -10px); filter: brightness(.8); }
.bx-count {
  position: absolute; left: 7%; top: 9%; font: 700 clamp(13px, 30cqh, 26px)/1 Caveat, cursive; color: var(--marker);
  transform: rotate(-7deg); pointer-events: none;
}
.bx.ph .bx-print {  /* фото — напечатано на белой вставке, как на упаковке */
  width: 74%; height: 64%; padding: 3%; background: #fbfaf6; box-shadow: 0 0 0 1px rgba(90, 60, 25, .25);
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);  /* иначе высота картинки — по её содержимому, и фото режется */
}
.bx.ph .bx-print img { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; pointer-events: none; }
.bx-name {
  display: none; position: absolute; left: 7%; right: 26%; bottom: 8%; padding: 0 4px; overflow: hidden;
  background: #fbf8f0; color: #2b2116; border-radius: 1px; box-shadow: 0 0 0 1px rgba(90, 60, 25, .2);
  font: 600 clamp(6px, 8.5cqh, 10.5px)/1.45 Onest, sans-serif; white-space: nowrap; text-overflow: ellipsis; text-align: left;
}
.bx-no {
  display: none; position: absolute; right: 6%; bottom: 8%; padding: 0 3px; border-radius: 1.5px; color: #1d2633;
  font: 700 clamp(5.5px, 12cqh, 8.5px)/1.45 Onest, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: linear-gradient(115deg, #eef1f4 0%, #d3d9e0 30%, #f9fafb 47%, #cdd4dc 70%, #e8ebef 100%);
  box-shadow: inset 0 0 0 1px rgba(70, 84, 104, .3);
}
@container (min-width: 56px) and (min-height: 30px) { .bx-no { display: block; } }
@container (min-width: 96px) and (min-height: 60px) {
  .bx-name { display: block; }
  .bx-print { margin-bottom: 14%; }
  .bx-picto { width: min(46cqh, 40cqw); height: min(46cqh, 40cqw); }
  .bx.ph .bx-print { align-self: start; height: 58%; margin: 9cqh 0 0; }  /* фото выше этикетки с названием */
}
@media (hover: hover) { .bx:hover .bx-face { transform: translateY(-2px); } }
.bx:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.bx.grabbing .bx-face { transform: none; }

/* полки сотрудников: маленькие стеллажи, табличка — фото и фамилия */
.whs.bays { --u: .62px; --post: 9px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); align-items: end; gap: 18px 16px; padding: 16px 16px 14px; }
.whs.bays::after { display: none; }
.bays-more { grid-column: 1 / -1; padding: 4px 0 2px; font-size: 13px; color: var(--muted); text-align: center; }
.rk.rk-mini::before, .rk.rk-mini::after { top: 0; bottom: -6px; }
.rk.rk-mini .rk-sec { padding: 0 6px; }
.rk.rk-mini .rk-load { min-height: 40px; padding-top: 14px; gap: 5px; }
.rk.rk-mini .rk-beam { height: 20px; margin: 0 calc(-6px - var(--post)); background: linear-gradient(180deg, #f7a868 0 2px, #ea7b2c 2px 16px, #c4601f 16px 18px, rgba(60, 30, 10, .22) 18px 20px); }
.rk.rk-mini .rk-sec.packed .rk-beam { margin: 0; }
.rk.rk-mini .rk-loc { left: calc(var(--post) + 8px); top: 2px; max-width: calc(100% - 2 * var(--post) - 16px); }
.whs.mine { --u: 1.1px; padding-top: 18px; }
.whs.preview { --u: 1px; --post: 12px; margin: 0; padding: 18px 14px 0; }
.whs.preview::after { margin: 0 -14px; }
@media (max-width: 600px) {
  .whs { --u: .74px; padding: 16px 12px 0; }
  .whs::after { margin: 0 -12px; }
  .whs.bays { --u: .55px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 12px 10px 12px; }
  .whs.mine { --u: .8px; }
  .rk-loc .rk-hint { display: none; }
}

/* карточка коробки по нажатию */
.bx-pop {
  position: fixed; z-index: 60; width: min(290px, calc(100vw - 24px)); padding: 14px; border-radius: 10px; background: var(--paper);
  box-shadow: 0 12px 32px rgba(20, 25, 40, .22), 0 0 0 1px rgba(20, 25, 40, .08);
}
.bx-pop-head { display: flex; gap: 12px; align-items: center; }
.bx-pop-thumb {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border-radius: 6px; color: #3f2710;
  background: var(--kraft-grain), linear-gradient(180deg, #d0a66a, #c29455);
}
.bx-pop-thumb svg { width: 34px; height: 34px; opacity: .8; }
.bx-pop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bx-pop-head b { display: block; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.bx-pop-head span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.bx-pop-where { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-2); }
.bx-pop-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bx-pop-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 260px; overflow: auto; border-top: 1px solid var(--rule); }
.bx-pop-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.bx-pop-list li b { font-weight: 600; font-size: 13.5px; }
.bx-pop-list li span { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.bx-pop-list li .acts { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; gap: 4px; justify-content: end; }
.bx-pop-list li .acts .btn { padding: 4px 8px; font-size: 12px; }
.bx-pop-asked { margin: 10px 0 0; padding: 6px 10px; border-radius: var(--r-ctl); background: var(--card-wash); color: #7a5200; font-size: 13px; }

/* «В ремонт» и «Списать» (11.11): появляются справа внизу, пока коробку держат (rack.js). Плитка — бетон цеха с жёлтой
   разметкой зоны; ящик с инструментами красный, как сломанные коробки; мусорный контейнер — зелёный. Наведи коробку —
   крышка поднимается, разметка становится чёрно-жёлтой. Размер — по просьбе пользователя на 30 % больше первого */
.dock {
  position: fixed; right: 16px; bottom: 16px; z-index: 85; display: flex; gap: 13px; pointer-events: none;
  transform: translateY(calc(100% + 30px)); transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}
.dock.on { transform: none; }
.dock-t {
  position: relative; width: 154px; padding: 15px 10px 12px; border-radius: 13px; text-align: center;
  background: linear-gradient(180deg, #e9e4da, #d6cfc2); outline: 2px dashed #e0ad17; outline-offset: -9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 12px 28px rgba(30, 25, 15, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dock-t > svg { display: block; width: 114px; height: 96px; margin: 0 auto; overflow: visible; }
.dock-t b {
  display: inline-block; margin-top: 5px; padding: 0 9px; background: #fff; color: #171717; border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .25); font: 600 15px/26px Onest, sans-serif;
}
.dock-t .why { display: block; margin-top: 4px; font-size: 14px; line-height: 19px; color: #6b6458; }
.dock-t .why:empty { display: none; }
.dock-t.hot { transform: translateY(-6px) scale(1.06); outline-color: #1f1f1f; box-shadow: inset 0 0 0 3px #efc12f, 0 18px 34px rgba(30, 25, 15, .38); }
.dock-t.hot b { background: #efc12f; }
.dock-t.no > svg { filter: grayscale(1); opacity: .45; }
.dock-t.no b { color: #8b8478; }
.dk-lid, .dk-tools { transform-box: view-box; transition: transform .2s cubic-bezier(.3, .7, .4, 1.35); }
/* у ящика крышка нарисована позади инструментов: откинулась — не закрывает их; закрыт — инструменты целиком в ящике */
.dock-repair .dk-tools { transform: translateY(29px); }
.dock-repair.hot .dk-lid, .dock-repair.gulp .dk-lid { transform: rotate(28deg); }
.dock-t.hot .dk-tools, .dock-t.gulp .dk-tools { transform: none; }
/* мусорка: крышка подскакивает вверх и зависает над контейнером, чуть покачиваясь (пользователь: «вверх и зависает»);
   бросили коробку — так и висит, пока не решат */
.dock-off.hot .dk-lid, .dock-off.gulp .dk-lid {
  animation: dk-lift .32s cubic-bezier(.3, .8, .4, 1.5) forwards, dk-hover 1.3s .32s ease-in-out infinite alternate;
}
@keyframes dk-lift { to { transform: translateY(-17px) rotate(9deg); } }
@keyframes dk-hover { from { transform: translateY(-17px) rotate(9deg); } to { transform: translateY(-13px) rotate(6deg); } }
.dock-t.gulp > svg { animation: dk-gulp .34s ease-out; }
/* мышка-пасхалка, простая, в полигонах (пользователь: «навели на мусорку — появилась, увели — ушла»): выбегает из-за
   правого края плитки к колесу контейнера, садится и машет лапкой; увели коробку — разворачивается и убегает за край */
.ms { position: absolute; top: 79px; right: 0; width: 41px; height: 30px; overflow: hidden; }
.ms svg { display: block; width: 100%; height: 100%; transform: translateX(100%); transition: transform .3s ease-in; }
.dock-off.hot .ms svg { transform: none; transition: transform .4s cubic-bezier(.2, .75, .35, 1); }
.ms-side, .ms-front { transform-box: fill-box; }
.ms-side { transform-origin: center; transform: scaleX(-1); }
.dock-off.hot .ms-side { transform: none; animation: ms-off 0s .42s forwards; }
.ms-front { opacity: 0; transform-origin: 50% 100%; }
.dock-off.hot .ms-front { animation: ms-sit .2s .42s cubic-bezier(.3, .8, .4, 1.4) forwards; }
.ms-arm { transform-box: view-box; }
.dock-off.hot .ms-arm { animation: ms-wave .26s .7s ease-in-out infinite alternate; }
.dock.on .ms-bob { animation: ms-bob .11s ease-in-out infinite alternate; }
.dock.on .ms-ft { animation: ms-step .11s linear infinite alternate; }
.dock.on .ms-ft + .ms-ft { animation-direction: alternate-reverse; }
@keyframes ms-off { to { opacity: 0; } }
@keyframes ms-sit { from { opacity: 1; transform: scale(.9, .5); } to { opacity: 1; transform: none; } }
@keyframes ms-bob { to { transform: translateY(-1.2px); } }
@keyframes ms-step { from { transform: translateX(-2px); } to { transform: translateX(2px); } }
@keyframes ms-wave { from { transform: rotate(-16deg); } to { transform: rotate(18deg); } }
@keyframes dk-gulp { 35% { transform: scale(1.08, .9); } 65% { transform: scale(.97, 1.04); } }
/* ── незнакомцы на камерах и снимки проходов (13.11, attendance/strangers.py, _strangers.html) ── */
.stg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.stg { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-panel); background: var(--paper);
  box-shadow: 0 0 0 1px var(--rule), 0 10px 22px -18px rgba(24, 33, 47, .5); }
.stg-shot { flex: none; display: block; width: 112px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 8px; background: #1c2230; }
.stg-shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.stg-shot.none { display: grid; place-content: center; justify-items: center; gap: 4px; color: #9aa3b2; font-size: 12px; }
.stg-shot.none .icon { width: 28px; height: 28px; }
.stg-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.stg-body > b { font-size: 15px; }
.stg-guess { align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: var(--card-wash); color: #8a5b00;
  font-size: 12.5px; font-weight: 600; }
.stg-form { display: grid; gap: 8px; margin-top: auto; padding-top: 10px; }
.stg-form select, .stg-form .sel-search { width: 100%; min-width: 0; }
.stg-or { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; }
.stg-or .linkbtn { margin-left: 4px; }
.stg-done { margin-top: 12px; }
.stg-list { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.stg-list li { display: flex; align-items: center; gap: 12px; }
.stg-list img, .stg-noimg { flex: none; display: grid; place-items: center; width: 36px; height: 48px; border-radius: 5px; object-fit: cover;
  object-position: 50% 15%; background: #1c2230; color: #9aa3b2; }
.stg-when { display: grid; line-height: 1.25; }
.stg-when .muted { font-size: 12px; }
.stg-v { margin-left: auto; }
.stg-v.out { color: var(--late); }
/* снимок у прохода — в журнале «Камер» и в разборе дня; портретный, «по пояс», лицо сверху */
.list .j-shot { width: 46px; padding-right: 0; }
.j-shot img { display: block; width: 36px; height: 48px; border-radius: 5px; object-fit: cover; object-position: 50% 15%; background: #1c2230; }
@media (max-width: 600px) { .stg-grid { grid-template-columns: minmax(0, 1fr); } .stg-shot { width: 96px; } }
/* ── незнакомцы по людям и регистрация лица по проходам (19.11, attendance/collect.py) ── */
.stg-tabs { margin: -4px 0 16px; }
.clr-list { display: grid; gap: 4px; margin: 0 0 18px; padding: 0; list-style: none; }
.clr-list a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 10px; border-radius: var(--r-ctl); color: var(--ink); font-size: 13.5px; }
.clr-list a:hover { background: var(--canvas); text-decoration: none; }
.clr-list .muted { font-size: 12.5px; }
.clr-st { flex: none; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--cam-wash); color: #2c44ad; }
.clr-st.done { background: var(--both-wash); color: #17694a; }
.clr-st.error, .clr-st.timeout { background: var(--late-wash); color: #8f2a18; }
.sgp-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.sgp-filter a { padding: 4px 12px; border-radius: 999px; background: var(--canvas); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.sgp-filter a span { color: var(--muted); font-weight: 400; margin-left: 2px; }
.sgp-filter a:hover { text-decoration: none; color: var(--ink); }
.sgp-filter a.on { background: var(--felt); color: #fff; }
.sgp-filter a.on span { color: rgba(255, 255, 255, .75); }
.sgp-notes { margin: 0 0 14px; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.sgp-where { align-self: flex-start; padding: 0 7px; border-radius: 4px; background: var(--cam-wash); color: #2c44ad; font-size: 11.5px; font-weight: 600; }
.sgp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.sgp { display: flex; gap: 14px; padding: 12px; border-radius: var(--r-panel); background: var(--paper); color: var(--ink);
  box-shadow: 0 0 0 1px var(--rule), 0 10px 22px -18px rgba(24, 33, 47, .5); }
.sgp:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--rule-strong), 0 14px 26px -18px rgba(24, 33, 47, .6); }
.sgp:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sgp-cover { flex: none; display: grid; place-items: center; width: 96px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 8px; background: #1c2230; color: #9aa3b2; }
.sgp-cover img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.sgp-cover .icon { width: 26px; height: 26px; }
.sgp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sgp-body > b { font-size: 16px; }
.sgp-strip { display: flex; gap: 3px; margin-top: 4px; }
.sgp-strip img { width: 26px; height: 35px; border-radius: 4px; object-fit: cover; object-position: 50% 15%; background: #1c2230; }
.sgp .stg-guess { margin-top: auto; }
.clg { margin-top: 4px; }
.clg-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 4px; }
.clg-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; }
.clg .hint-line { display: block; margin: 0 0 12px; }
.clg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.clg-shot label { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px; border-radius: 10px; background: var(--paper);
  box-shadow: 0 0 0 2px var(--brand); cursor: pointer; font-size: 12.5px; }
.clg-shot input { position: absolute; top: 12px; left: 12px; z-index: 1; width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
.clg-img { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 6px;
  background: #1c2230; color: #9aa3b2; text-align: center; font-size: 12px; }
.clg-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transition: filter .15s, opacity .15s; }
.clg-img .icon { width: 24px; height: 24px; }
.clg-meta { display: flex; justify-content: space-between; gap: 6px; }
.clg-grade { padding: 0 7px; border-radius: 999px; font-weight: 600; background: var(--abs-wash); color: var(--abs); }
.g-good .clg-grade { background: var(--both-wash); color: #17694a; }
.g-weak .clg-grade { background: var(--card-wash); color: #8a5b00; }
.clg-sim { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.clg-when { display: grid; line-height: 1.25; }
.clg-when .muted { font-size: 11.5px; }
.clg-hr { color: var(--hr); font-size: 11.5px; }
.clg-shot label:has(input:not(:checked)) { box-shadow: 0 0 0 1px var(--rule); background: var(--canvas); }
.clg-shot label:has(input:not(:checked)) img { filter: grayscale(1); opacity: .45; }
.clg-shot label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.clg-form { position: sticky; top: 16px; }
.clg-form h3 { margin-top: 0; }
.clg-form .field, .clg-form .check-line { margin-bottom: 12px; }
.clg-acts { display: grid; gap: 6px; margin-top: 14px; }
.clg-acts .hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
/* поиск «по сотруднику» (22.11): форма на вкладке «Незнакомцев», на странице итога — порог ползунком и счёт по порогам
   кнопками, у снимка красная пометка «больше похож на …», ссылка на тот же поиск во втором офисе */
.fnd-form { display: grid; gap: 12px; max-width: 560px; }
.fnd-form .btn { justify-self: start; }
.fnd-where { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; border: 0; }
.fnd-where legend { margin-bottom: 6px; padding: 0; font-size: 13px; color: var(--ink-2); }
.fnd { margin-top: 6px; }
.clr-card.wide { max-width: none; }  /* итог поиска — снимкам нужна ширина, монитор остаётся прежнего размера */
.clr-card .crt { max-width: 680px; }
.fnd-thr { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: var(--r-panel); background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--rule); }
.fnd-slider { display: grid; gap: 6px; }
.fnd-slider > span { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.fnd-slider output { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--brand); }
.fnd-slider input { width: 100%; margin: 0; accent-color: var(--brand); }
.fnd-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.fnd-chip { padding: 3px 10px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; }
.fnd-chip b { margin-left: 3px; }
.fnd-chip[aria-pressed=true] { border-color: var(--brand); background: var(--cam-wash); color: #2c44ad; }
.fnd-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.fnd-other { padding: 2px 6px; border-radius: 6px; background: var(--late-wash); color: #8f2a18; font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.fnd-batch { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.fnd-batch a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-ctl); background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--rule); color: var(--ink); }
.fnd-batch a:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--rule-strong); }
/* похожие проходы вокруг группы (22.11): под группой — порог, «Скорее всего он», «Ниже порога»; пока ищем — подпись */
.clg-near { margin-top: 4px; }
.clg-near-box { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--rule); }
.clg-near-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.clg-near-h .muted { font-size: 13px; font-weight: 500; }
.clg-near-sub { margin: 16px 0 8px; font-size: 14px; }
.clg-near-wait, .clg-near-note { margin-top: 18px; }
.clg-jump { font-size: 13.5px; font-weight: 400; }
/* отказ из-за снимков, не похожих на остальные (23.11): красная рамка у снимка в группе и на странице заявки, лицо не
   гасим — его надо разглядеть; над группой — какие и ссылки к ним; на странице заявки — их снимки и две кнопки */
.clg-shot.is-out label, .clg-shot.is-out label:has(input:not(:checked)) { box-shadow: 0 0 0 2px var(--late); background: var(--late-wash); }
.clg-shot.is-out label:has(input:not(:checked)) img { filter: none; opacity: 1; }
.clg-shot.is-out { scroll-margin-top: 16px; }
.clg-outbar { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border-radius: var(--r-ctl);
  background: var(--late-wash); color: #8f2a18; font-size: 13.5px; line-height: 1.45; }
.clg-outbar .icon { flex: none; margin-top: 2px; }
.clg-outbar a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.clr-out { margin: 0 0 14px; padding: 12px 14px 14px; border-radius: var(--r-panel); background: var(--canvas); box-shadow: inset 0 0 0 1px var(--rule); }
.clr-out h3 { margin: 0 0 4px; font-size: 15px; }
.clr-out > .small { margin: 0 0 12px; }
.clr-out-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; max-width: 520px; margin: 0; padding: 0;
  list-style: none; font-size: 12.5px; }
.clr-out-grid li { display: grid; gap: 4px; align-content: start; padding: 5px; border-radius: 10px; background: var(--paper); box-shadow: 0 0 0 2px var(--late); }
.clr-out-grid a.clg-img:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.clr-out-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; }
.clr-out-acts form { margin: 0; }
.clr-out-grid .fnd-other { align-self: start; }
/* «Похоже, это …» — офис назвал другого сотрудника (nearest): его фото из карточки рядом с согласием и кнопкой */
.clr-who-body { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; }
.clr-who-photo { display: grid; gap: 4px; width: 112px; margin: 0; font-size: 12px; color: var(--muted); }
.clr-who-photo img { width: 112px; aspect-ratio: 5 / 6; object-fit: cover; border-radius: 8px; box-shadow: 0 0 0 1px var(--rule); }
.clr-who-form { display: grid; gap: 10px; flex: 1 1 260px; max-width: 420px; }
.clr-who-form .btn { justify-self: start; }
.clr-who-form .field, .clr-who-form .check-line { margin: 0; }
/* «Разбор» (23.11): слева группа заявки, справа тот, на кого она похожа, — его регистрация и проходы; под ними три
   решения. Колонки равные, на узких экранах друг под другом */
.rv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.rv-col { padding: 14px; border-radius: var(--r-panel); background: var(--canvas); box-shadow: inset 0 0 0 1px var(--rule); }
.rv-them { background: var(--paper); box-shadow: inset 0 0 0 2px var(--rule-strong); }
.rv-h { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.rv-h .muted { font-size: 13px; font-weight: 500; }
.rv-sub { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 8px; font-size: 14px; }
.rv-sub .muted { font-size: 12.5px; font-weight: 500; }
.rv-col > .small { margin: 0 0 12px; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 12px; }
.rv-grid li { display: grid; gap: 4px; align-content: start; padding: 4px; border-radius: 9px; background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.rv-grid li.is-out { box-shadow: 0 0 0 2px var(--late); background: var(--late-wash); }
.rv-grid a.clg-img:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.rv-who { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 10px; }
.rv-who .clr-who-photo { flex: none; width: 96px; }
.rv-who .clr-who-photo img { width: 96px; }
.rv-how { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.rv-regs { margin: 0 0 6px; }
.rv-acts { margin-top: 24px; }
.rv-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.rv-choice { display: grid; gap: 10px; align-content: start; padding: 14px; border-radius: var(--r-panel); background: var(--paper);
  box-shadow: 0 0 0 1px var(--rule); }
.rv-choice h3 { margin: 0; font-size: 15px; line-height: 1.3; }
.rv-choice p { margin: 0; }
.rv-choice .btn { justify-self: start; }
.rv-choice form { margin: 0; }
.rv-form { display: grid; gap: 10px; }
.rv-form .field, .rv-form .check-line { margin: 0; }
.rv-confirm { display: grid; gap: 10px; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--late-wash); color: #8f2a18; font-size: 13.5px; }
.rv-confirm p { margin: 0; }
.rv-confirm-acts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 1100px) { .rv-choices { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .rv-cols { grid-template-columns: minmax(0, 1fr); } .rv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.enroll-state.wait, .enroll-state.run { color: var(--cam); }
.clr-card { max-width: 720px; }
/* ход заявки: под монитором — крупный итог и последняя связь с офисом (шаги, время и полоса — на экране, ниже) */
.sgp-tags { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.clr-seen { margin: 10px 0 0; }
.clr-result { margin: 4px 0 6px; font-size: 18px; }
.clr-result b { font-size: 22px; }
/* старый ЭЛТ-монитор (20.11, пользователь: «нет, какой макбук? стилизуй под старый виндовс и вообще старый монитор»; всё
   нарисовано своё, без чужих картинок): бежевый пластик с толстой рамкой и скосом, утопленный экран — чуть скруглён,
   виньетка, блик и едва заметные строки развёртки; на «рабочем столе» — небо и холм градиентами. На подбородке —
   выпуклая надпись, кнопка питания и светодиод: мигает, пока заявка идёт, в «готово» горит ровно, ошибка и «нет связи» —
   янтарный. Снизу шея и подставка */
.crt { margin: 4px 0 18px;
  --xp-blocks: repeating-linear-gradient(90deg, transparent 0 7px, #fff 7px 9px),
               linear-gradient(180deg, #cdf6cd, #63d762 30%, #2dbc35 55%, #46cb4a 75%, #a9eea8);
  --xp-blocks-red: repeating-linear-gradient(90deg, transparent 0 7px, #fff 7px 9px),
                   linear-gradient(180deg, #f9c6b9, #e6623f 30%, #c93b1c 55%, #d8573a 75%, #f3aa98); }
.crt-case { padding: 20px 22px 0; border-radius: 18px 18px 14px 14px; background: linear-gradient(180deg, #ece6d6, #dad3c0 55%, #cfc7b2);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .7), inset -2px -3px 0 rgba(110, 98, 74, .35), 0 22px 34px -24px rgba(48, 40, 24, .6); }
.crt-glass { padding: 9px; border-radius: 14px; background: linear-gradient(160deg, #b2a992, #d6cebb 60%, #e3dcca);
  box-shadow: inset 2px 3px 4px rgba(70, 60, 40, .45), inset -1px -1px 0 rgba(255, 255, 255, .6); }
.crt-screen { position: relative; overflow: hidden; padding: 16px 18px 24px; border-radius: 12px / 16px;
  background: radial-gradient(150% 55% at 26% 114%, #62a63c 0 46%, transparent 47%),
              radial-gradient(120% 48% at 88% 118%, #4b9131 0 44%, transparent 45%),
              linear-gradient(180deg, #2c6bd5, #5b98e7 62%, #a3cbf3);
  box-shadow: inset 0 0 0 2px #1b2230, inset 0 0 28px rgba(0, 0, 0, .45); }
.crt-screen::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 30%),
              repeating-linear-gradient(180deg, rgba(0, 0, 0, .04) 0 1px, transparent 1px 3px),
              radial-gradient(125% 125% at 50% 50%, transparent 62%, rgba(0, 0, 0, .3)); }
.crt-chin { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 4px 0 10px; }
.crt-brand { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: #bbb29c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .85), 0 -1px 0 rgba(90, 80, 60, .3); }
.crt-power { display: flex; align-items: center; gap: 10px; }
.crt-led { width: 7px; height: 7px; border-radius: 50%; background: #4fd65a; box-shadow: 0 0 6px 1px rgba(79, 214, 90, .75); }
.crt-power b { width: 24px; height: 14px; border-radius: 4px; background: linear-gradient(180deg, #ebe5d6, #c8bfa9);
  box-shadow: inset 0 1px 0 #fff, 0 0 0 1px #a89e87, 0 2px 2px -1px rgba(60, 50, 30, .4); }
.crt[data-phase=send] .crt-led, .crt[data-phase=work] .crt-led,
.clr-card:not(.final) .crt[data-phase=offline] .crt-led { animation: crt-led 1.3s linear infinite; }
.crt[data-phase=fail] .crt-led, .crt[data-phase=offline] .crt-led { background: #f3a838; box-shadow: 0 0 6px 1px rgba(243, 168, 56, .75); }
.crt-neck { width: 34%; height: 16px; margin: 0 auto; background: linear-gradient(180deg, #b5ac95, #d3ccb8);
  clip-path: polygon(10% 0, 90% 0, 100% 100%, 0 100%); }
.crt-foot { width: 54%; height: 14px; margin: 0 auto; border-radius: 6px 6px 12px 12px; background: linear-gradient(180deg, #e3ddcc, #c5bda7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 12px 16px -10px rgba(48, 40, 24, .55); }
@keyframes crt-led { 0%, 38%, 52%, 100% { opacity: 1; } 44% { opacity: .25; } 70% { opacity: .55; } 76% { opacity: 1; } }
/* окно в духе Windows XP: синяя строка заголовка (белый жирный текст с тенью), справа «свернуть / развернуть / ×» —
   декоративные, не нажимаются; тело #ece9d8, шрифт как в диалогах XP (Tahoma, без засечек) */
.xp { position: relative; overflow: hidden; padding: 0 3px 3px; border-radius: 8px 8px 0 0; background: #0a4fd6;
  box-shadow: 0 12px 24px -10px rgba(0, 0, 0, .6); font-family: Tahoma, Verdana, "Segoe UI", sans-serif; font-size: 12px; color: #000; }
.xp-bar { display: flex; align-items: center; gap: 6px; height: 28px; margin: 0 -3px; padding: 0 5px 0 8px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #4290f5 0%, #1769e6 9%, #0a5ae0 22%, #0756df 50%, #0a5fec 80%, #1562e4 90%, #0b46c8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); color: #fff; }
.xp-bar img { flex: none; width: 16px; height: 16px; border-radius: 3px; }
.xp-bar b { flex: 1; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; text-shadow: 1px 1px 0 #0a1f73; }
.xp-btns { display: flex; flex: none; gap: 2px; }
.xp-btns i { position: relative; width: 21px; height: 21px; border: 1px solid #fff; border-radius: 3px;
  background: linear-gradient(160deg, #6c9ff8, #2b68e8 50%, #1d52cf); box-shadow: inset 0 0 1px rgba(0, 0, 0, .3); }
.xp-btns i::before, .xp-btns i::after { content: ""; position: absolute; background: #fff; }
.xp-min::before { left: 5px; bottom: 4px; width: 7px; height: 3px; }
.xp-max::before { left: 4px; top: 4px; width: 11px; height: 11px; border: 1px solid #fff; border-top-width: 3px; background: none; }
.xp-btns .xp-close { background: linear-gradient(160deg, #f08d6d, #dd4d27 50%, #c03916); }
.xp-close::before, .xp-close::after { left: 50%; top: 50%; width: 13px; height: 2px; margin: -1px 0 0 -6.5px; transform: rotate(45deg); }
.xp-close::after { transform: rotate(-45deg); }
.xp-body { padding: 8px 12px 12px; background: #ece9d8; }
.xp-cap { margin: 4px 0 6px; }
.xp-detail { margin: -2px 0 6px; color: #4a4a40; }
.xp-detail:empty { display: none; }
/* полоса прогресса из зелёных блоков: по этапу — ждём сервер ~10 %, забрал и выполняет ~35 % и бегущие блоки, готово —
   вся (доезжает вместе с заливкой дуги), ошибка — красные блоки. Заливка — два встречных сдвига: окно едет, блоки стоят */
.xp-prog { --p: .1; position: relative; height: 16px; overflow: hidden; border: 1px solid #7a7a7a; border-radius: 3px; background: #fff;
  box-shadow: inset 1px 1px 0 #d6d3c3; }
.xp-fill { position: absolute; inset: 2px; overflow: hidden; transform: translateX(calc(var(--p) * 100% - 100%)); transition: transform .6s ease-out; }
.xp-fill > span { position: absolute; inset: 0; display: block; background: var(--xp-blocks);
  transform: translateX(calc(100% - var(--p) * 100%)); transition: transform .6s ease-out; }
.xp-run { position: absolute; top: 2px; bottom: 2px; left: calc(35% + 2px); right: 2px; overflow: hidden; opacity: 0; }
.xp-run > span { position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% + 27px); }
.xp-run i { position: absolute; top: 0; bottom: 0; left: -27px; width: 27px; background: var(--xp-blocks); }
.crt[data-phase=work] .xp-prog, .crt[data-phase=fail] .xp-prog { --p: .35; }
.crt[data-phase=done] .xp-prog { --p: 1; }
.crt[data-phase=done] .xp-fill { animation: xp-fill .8s ease-out 1.95s both; }
.crt[data-phase=done] .xp-fill > span { animation: xp-fill-in .8s ease-out 1.95s both; }
.crt[data-phase=work] .xp-run { opacity: 1; }
.crt[data-phase=work] .xp-run > span { animation: xp-run 1.6s linear infinite; }
.crt[data-phase=fail] .xp-fill > span { background: var(--xp-blocks-red); }
@keyframes xp-fill { from { transform: translateX(-65%); } }
@keyframes xp-fill-in { from { transform: translateX(65%); } }
@keyframes xp-run { from { transform: translateX(0); } to { transform: translateX(100%); } }
.xp-nums { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.xp-hint { margin: 4px 0 0; color: #5a5a50; font-size: 11px; }
/* шаги — рамка группы, как в диалогах XP: пройденный — зелёная галочка и время, текущий — песочные часы (переворачиваются),
   ошибка — красный крестик, впереди — пустой кружок */
.xp-group { position: relative; margin: 16px 0 0; padding: 12px 10px 6px; border: 1px solid #d0d0bf; border-radius: 4px; }
.xp-legend { position: absolute; left: 8px; top: -8px; padding: 0 4px; background: #ece9d8; color: #0046d5; }
.xp-steps { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.xp-steps li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 3px 0; color: #8a877a; }
.xp-steps li i { width: 16px; height: 16px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><circle cx='8' cy='8' r='6.6' fill='white' stroke='%23aca899' stroke-width='1.2'/></svg>") center / 16px no-repeat; }
.xp-steps li time { color: #4a4a40; font-variant-numeric: tabular-nums; }
.xp-steps li.done, .xp-steps li.now { color: #000; }
.xp-steps li.now { font-weight: 700; }
.xp-steps li.done i { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><defs><radialGradient id='g' cx='.35' cy='.3' r='.85'><stop offset='0' stop-color='%2394e394'/><stop offset='1' stop-color='%23238a2e'/></radialGradient></defs><circle cx='8' cy='8' r='7.3' fill='url(%23g)' stroke='%231c6a25' stroke-width='.8'/><path d='M4.6 8.2l2.2 2.3 4.6-4.9' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>"); }
.xp-steps li.now i { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='3' y='1' width='10' height='2' rx='1' fill='%23785b2a'/><rect x='3' y='13' width='10' height='2' rx='1' fill='%23785b2a'/><path d='M4.5 3h7c0 3-2.4 4-2.4 5s2.4 2 2.4 5h-7c0-3 2.4-4 2.4-5S4.5 6 4.5 3z' fill='%23eaf2fb' stroke='%235b7fb0' stroke-width='.8'/><path d='M6 4.6h4c-.4 1.3-2 1.9-2 2.7 0-.8-1.6-1.4-2-2.7z' fill='%23d9a441'/><path d='M8 9.6c.3.9 2 1.3 2.3 2.6H5.7C6 10.9 7.7 10.5 8 9.6z' fill='%23d9a441'/></svg>");
  animation: xp-flip 2.4s ease-in-out infinite; }
.xp-steps li.fail { color: #a5260f; }
.xp-steps li.fail i { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><defs><radialGradient id='r' cx='.35' cy='.3' r='.85'><stop offset='0' stop-color='%23f7a08a'/><stop offset='1' stop-color='%23bf321a'/></radialGradient></defs><circle cx='8' cy='8' r='7.3' fill='url(%23r)' stroke='%23902310' stroke-width='.8'/><path d='M5.4 5.4l5.2 5.2M10.6 5.4l-5.2 5.2' stroke='white' stroke-width='2' stroke-linecap='round'/></svg>"); }
@keyframes xp-flip { 0%, 75% { transform: rotate(0); } 100% { transform: rotate(180deg); } }
/* «пока не забрал заявку» — жёлтая подсказка-«облачко», как в XP */
.xp .clr-slow { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; border: 1px solid #000; border-radius: 6px;
  background: #ffffe1; color: #000; font-size: 12px; }
.xp .clr-slow[hidden] { display: none; }
.xp .clr-slow i { flex: none; width: 16px; height: 16px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 1.5l7 12.5H1z' fill='%23f7d23e' stroke='%23a8820f' stroke-linejoin='round'/><path d='M8 6v4' stroke='black' stroke-width='1.6' stroke-linecap='round'/><circle cx='8' cy='12' r='.9'/></svg>") center / 16px no-repeat; }
/* сцена «копирования файлов» (20.11 «как в Windows XP, только на современный лад»; доработка 20.11 по отзыву: «иконки
   красивее, а что фотки туда-сюда летают — прикольно»). Плитки Corta HR и сервера офиса — одна пара: размер, скругление,
   тень; путь — прямая точечная линия между плитками (точки по ней — collect.PATH_DOTS). Этап — data-phase (collect._scene):
   send — снимки летят по пути, чуть подпрыгивая, и складываются стопкой у сервера, по линии бегут точки; work — по стопке идёт сканирующая
   полоса, карточки по одной «вспыхивают»; done — стопка схлопывается в плитку сервера, из неё выходит карточка-итог с
   лицом и галочкой и летит в Corta HR, линия заливается следом за ней, галочка ровно в центре (откат — всё жёлтое); fail —
   стопка так же уходит в сервер, ответ возвращается карточкой, на полпути краснеет и опадает; offline — карточки
   упираются в серый сервер с перечёркнутой сетью. Последний кадр итога статичный, у сервера ничего не висит (вторая
   доработка: «исчезающее фото не секси, оно просто висит как баг»). Двигаются только transform и opacity: «носитель»
   шириной с дорожку минус карточка (translateX(100%) — ровно до края), подскок — анимацией карточки, обе линейные;
   заливка — два встречных сдвига (окно едет, содержимое стоит) */
.xfer { --acc: var(--cam); --done: var(--both); --rise: 12px; --rise1: 9px; --card-w: 32px; --card-h: 40px;
  --col: 108px; --tile: 56px; --end-gap: 9px; --lane: 64px; --pad-x: 2px; --pad-top: 6px;
  /* от середины стопки (у конца пути) до середины плитки сервера — по тем же размерам */
  --sink-x: calc(var(--end-gap) + var(--tile) / 2 + var(--card-w) / 2); --sink-y: 0px;
  position: relative; display: grid; grid-template-columns: var(--col) minmax(0, 1fr) var(--col); align-items: start; gap: 6px;
  overflow: hidden; padding: var(--pad-top) var(--pad-x) 10px; }
.xf-srv { grid-column: 3; }
.xfer[data-kind=rollback] { --done: var(--card); }
.xf-end { position: relative; display: grid; justify-items: center; gap: 3px; text-align: center; font-size: 12px; line-height: 1.25; color: var(--ink-2); }
.xf-end b { margin-top: 6px; font-size: 13px; color: var(--ink); }
.xf-tile { position: relative; z-index: 2; display: grid; place-items: center; width: var(--tile); height: var(--tile); border-radius: 16px;
  box-shadow: 0 12px 22px -14px rgba(24, 33, 47, .7), 0 2px 4px rgba(24, 33, 47, .12); }
.xf-hr .xf-tile { overflow: hidden; background: var(--felt); }
.xf-hr .xf-tile img { width: 100%; height: 100%; }
.xf-srv .xf-tile { background: linear-gradient(160deg, #5675e6, #2f49b9); color: #fff; }
.xf-glyph { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.xf-glyph .xf-led { fill: #7ef0b3; stroke: none; }
.xf-glyph .xf-lens { fill: currentColor; stroke: none; }
.xf-nonet { position: absolute; right: -6px; bottom: -6px; display: none; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--late); box-shadow: 0 0 0 2px #ece9d8; }
.xf-nonet svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.xf-office { padding: 1px 8px; border-radius: 999px; background: var(--cam-wash); color: #2c44ad; font-size: 11.5px; font-weight: 600; }
.xf-off { display: none; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--late); }
/* путь (третья доработка, отзыв «выглядит не супер естественно и немного криво»): прямая точечная линия, как в диалоге
   копирования XP, — ровно между плитками на высоте их середин, концы в 9 px от краёв плиток. Положение считается от
   размеров колонок и плиток (px), не процентами, поэтому на любой ширине линия садится на обе плитки */
.xf-track { position: absolute; left: calc(var(--pad-x) + var(--col) / 2 + var(--tile) / 2 + var(--end-gap));
  right: calc(var(--pad-x) + var(--col) / 2 + var(--tile) / 2 + var(--end-gap));
  top: calc(var(--pad-top) + var(--tile) / 2 - var(--lane) / 2); height: var(--lane); }
.xf-line { position: absolute; left: 0; right: 0; top: 50%; height: 0; margin-top: -1px; border-top: 2px dotted #9a9584; }
.xf-line-on { margin-top: -1.5px; border-top: 3px solid var(--done); }
/* заливка линии справа налево — следом за карточкой-итогом: окно едет, линия в нём стоит */
.xf-wipe { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; overflow: hidden; transform: translateX(101%); }
.xf-wipe > span { position: absolute; inset: 0; display: block; transform: translateX(-101%); }
.xf-dots i { position: absolute; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--acc); opacity: 0; }
.xf-stack { position: absolute; right: 0; top: 50%; width: var(--card-w); height: var(--card-h); margin-top: calc(var(--card-h) / -2); }
.xf-stack i { position: absolute; inset: 0; overflow: hidden; border-radius: 5px; background: var(--paper); opacity: 0;
  box-shadow: 0 0 0 1.5px var(--acc), 0 6px 10px -6px rgba(24, 33, 47, .45); }
.xf-stack i:nth-child(1) { transform: rotate(-7deg); } .xf-stack i:nth-child(2) { transform: translate(1px, -3px) rotate(4deg); }
.xf-stack i:nth-child(3) { transform: translate(-1px, -6px) rotate(-3deg); } .xf-stack i:nth-child(4) { transform: translate(1px, -9px) rotate(6deg); }
.xf-stack i::after { content: ""; position: absolute; inset: 0; background: var(--acc); opacity: 0; }
.xf-stack img, .xf-sheet img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.xf-scanbar { position: absolute; left: -7px; right: -7px; top: -10px; height: 3px; border-radius: 2px; background: var(--acc);
  box-shadow: 0 0 10px var(--acc); opacity: 0; }
.xf-fly { position: absolute; left: 0; top: 50%; width: calc(100% - var(--card-w)); height: 0; opacity: 0; }
.xf-fly.xf-back { width: calc(100% - var(--card-w) - 8px); }  /* карточка-итог шире на рамку: от стопки ровно до начала пути */
.xf-sheet { position: absolute; left: 0; top: calc(var(--card-h) / -2); display: grid; place-items: center; width: var(--card-w); height: var(--card-h);
  overflow: hidden; border-radius: 5px; background: var(--paper); box-shadow: 0 0 0 1.5px var(--acc), 0 10px 14px -8px rgba(24, 33, 47, .5); }
.xf-sheet:empty::before { content: ""; width: 16px; height: 2px; border-radius: 1px; background: var(--rule-strong);
  box-shadow: 0 -6px 0 var(--rule-strong), 0 6px 0 var(--rule-strong), 0 12px 0 var(--rule-strong); }
.xf-sheet::after { content: ""; position: absolute; inset: 0; background: var(--late); opacity: 0; }
/* карточка-итог — превью в белой рамке: лицо крупнее (верхние две трети снимка «по пояс»), ровные края, мягкая тень */
.xf-res { --res-w: calc(var(--card-w) + 8px); --res-h: calc(var(--card-h) + 8px);
  top: calc(var(--res-h) / -2); width: var(--res-w); height: var(--res-h); padding: 3px; overflow: visible; border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(24, 33, 47, .12), 0 12px 18px -10px rgba(24, 33, 47, .55); }
.xf-face { display: grid; place-items: center; width: 100%; height: 100%; overflow: hidden; border-radius: 5px; background: var(--cam-wash); color: var(--cam); }
.xf-face img { object-position: 50% 0; transform: scale(1.5); transform-origin: 50% 0; }
.xf-face .icon { width: 62%; height: 62%; }
.xf-badge { position: absolute; right: -7px; top: -7px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--done); color: #fff; box-shadow: 0 0 0 2px var(--paper); }
.xf-badge .icon { width: 11px; height: 11px; stroke-width: 3.4; }
/* галочка и крестик — кружок с белой обводкой 3 px поверх цельной линии, ровно посередине пути */
.xf-mark { position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; place-items: center; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  border-radius: 50%; color: #fff; opacity: 0; transform: scale(.5); box-shadow: 0 0 0 3px #fff, 0 3px 8px rgba(24, 33, 47, .3); }
.xf-mark .icon { width: 17px; height: 17px; stroke-width: 3.2; }
.xf-yes { background: var(--done); }
.xf-no { background: var(--late); }
/* send — снимки летят по пути, у сервера растёт стопка, по линии бегут точки */
.xfer[data-phase=send] .xf-fly:not(.xf-back) { animation: xf-go 2.4s linear infinite; }
.xfer[data-phase=send] .xf-fly:not(.xf-back) .xf-sheet { animation: xf-rise 2.4s linear infinite; }
.xfer[data-phase=send] .xf-fly.f2, .xfer[data-phase=send] .xf-fly.f2 .xf-sheet { animation-delay: .6s; }
.xfer[data-phase=send] .xf-fly.f3, .xfer[data-phase=send] .xf-fly.f3 .xf-sheet { animation-delay: 1.2s; }
.xfer[data-phase=send] .xf-fly.f4, .xfer[data-phase=send] .xf-fly.f4 .xf-sheet { animation-delay: 1.8s; }
.xfer[data-phase=send] .xf-stack i { animation: xf-land .35s cubic-bezier(.2, .9, .3, 1.3) forwards; animation-delay: calc(2.3s + var(--k) * .6s); }
.xfer[data-phase=send] .xf-dots i { animation: xf-march 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * .11s); }
/* work — стопка у сервера: сканирующая полоса, карточки по одной вспыхивают; огоньки сервера мигают */
.xfer[data-phase=work] .xf-stack i { opacity: 1; }
.xfer[data-phase=work] .xf-stack i::after { animation: xf-flash 2.4s ease-in-out infinite; animation-delay: calc(var(--k) * .6s); }
.xfer[data-phase=work] .xf-scanbar { animation: xf-scan 1.6s ease-in-out infinite alternate; }
.xfer[data-phase=work] .xf-led { animation: xf-led .9s ease-in-out infinite alternate; }
.xfer[data-phase=work] .xf-line { border-top-style: solid; border-top-color: #a9b9ee; }
/* done и fail — стопка схлопывается в плитку сервера (к её середине, 0,3 с), плитка «глотает» */
.xfer[data-phase=done] .xf-stack i, .xfer[data-phase=fail] .xf-stack i { animation: xf-sink .3s cubic-bezier(.55, 0, .85, .35) both; }
.xfer[data-phase=done] .xf-srv .xf-tile, .xfer[data-phase=fail] .xf-srv .xf-tile { animation: xf-gulp .32s ease-out .24s; }
/* done — из плитки выходит карточка-итог, летит в Corta HR и встаёт у неё ровно; линия заливается, галочка в центре */
.xfer[data-phase=done] .xf-back { animation: xf-home 1.6s linear .3s both; }
.xfer[data-phase=done] .xf-back .xf-sheet { animation: xf-rise-home 1.6s linear .3s both; }
.xfer[data-phase=done] .xf-wipe, .xfer[data-phase=done] .xf-wipe > span { animation: xf-wipe .8s cubic-bezier(.3, .7, .3, 1) 1.95s forwards; }
.xfer[data-phase=done] .xf-yes { animation: xf-pop .4s cubic-bezier(.2, .9, .3, 1.3) 2.6s forwards; }
/* fail — ответ возвращается карточкой, на полпути отскакивает, краснеет и опадает (в конце прозрачна целиком), крестик */
.xfer[data-phase=fail] .xf-fly.f1 { animation: xf-bounce 1.8s ease-out .35s both; }
.xfer[data-phase=fail] .xf-fly.f1 .xf-sheet { animation: xf-fall 1.8s ease-in .35s both; }
.xfer[data-phase=fail] .xf-fly.f1 .xf-sheet::after { animation: xf-redden 1.8s ease-out .35s both; }
.xfer[data-phase=fail] .xf-no { animation: xf-pop .4s cubic-bezier(.2, .9, .3, 1.3) 1.7s forwards; }
/* offline — карточки упираются в серый сервер с перечёркнутой сетью; заявка закрыта (тайм-аут) — по разу и тихо */
.xfer[data-phase=offline] .xf-fly:not(.xf-back) { animation: xf-bump 2.8s ease-in-out infinite; }
.xfer[data-phase=offline] .xf-fly:not(.xf-back) .xf-sheet { animation: xf-hop 2.8s ease-in-out infinite; }
.xfer[data-phase=offline] .xf-fly.f2, .xfer[data-phase=offline] .xf-fly.f2 .xf-sheet { animation-delay: .9s; }
.xfer[data-phase=offline] .xf-fly.f3, .xfer[data-phase=offline] .xf-fly.f3 .xf-sheet { animation-delay: 1.8s; }
.xfer[data-phase=offline] .xf-fly.f4 { display: none; }
.clr-card.final .xfer[data-phase=offline] .xf-fly, .clr-card.final .xfer[data-phase=offline] .xf-fly .xf-sheet { animation-iteration-count: 1; }
/* сервер без связи — сплошной серый, не полупрозрачный: значок перечёркнутой сети на нём ярко-красный */
.xfer[data-phase=offline] .xf-srv .xf-tile { background: linear-gradient(160deg, #b4bcc8, #8a93a2); }
.xfer[data-phase=offline] .xf-led { fill: #e3e7ed; }
.xfer[data-phase=offline] .xf-nonet { display: grid; }
.xfer[data-phase=offline] .xf-off { display: block; }
.xfer[data-phase=offline] .xf-office { background: var(--abs-wash); color: var(--abs); }
@keyframes xf-go { 0% { transform: translateX(0); opacity: 0; } 8%, 90% { opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }
@keyframes xf-rise { 0% { transform: translateY(0) rotate(-8deg) scale(.85); } 25% { transform: translateY(calc(var(--rise1) * -1)) rotate(-4deg) scale(1); }
  50% { transform: translateY(calc(var(--rise) * -1)) rotate(0) scale(1.06); } 75% { transform: translateY(calc(var(--rise1) * -1)) rotate(4deg) scale(1); }
  100% { transform: translateY(0) rotate(6deg) scale(.85); } }
@keyframes xf-sink { 0% { opacity: 1; translate: 0 0; scale: 1; } 55% { opacity: 1; } 100% { opacity: 0; translate: var(--sink-x) var(--sink-y); scale: 0; } }
@keyframes xf-gulp { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes xf-home { 0% { transform: translateX(100%); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes xf-rise-home { 0% { transform: translateY(0) rotate(10deg) scale(.4); } 25% { transform: translateY(calc(var(--rise1) * -1)) rotate(5deg) scale(1); }
  50% { transform: translateY(calc(var(--rise) * -1)) rotate(-1deg) scale(1.1); } 75% { transform: translateY(calc(var(--rise1) * -1)) rotate(-3deg) scale(1.04); }
  100% { transform: translateY(0) rotate(0) scale(1); } }
@keyframes xf-land { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes xf-march { 0%, 100% { opacity: .12; } 50% { opacity: .9; } }
@keyframes xf-flash { 0%, 40%, 100% { opacity: 0; } 15% { opacity: .5; } }
@keyframes xf-scan { from { transform: translateY(0); opacity: .9; } to { transform: translateY(calc(var(--card-h) + 14px)); opacity: .9; } }
@keyframes xf-led { from { opacity: .35; } to { opacity: 1; } }
@keyframes xf-wipe { to { transform: translateX(0); } }
@keyframes xf-pop { to { opacity: 1; transform: scale(1); } }
@keyframes xf-bounce { 0% { transform: translateX(100%); opacity: 0; } 10% { opacity: 1; } 55% { transform: translateX(44%); } 70% { transform: translateX(56%); }
  99% { opacity: 1; } 100% { transform: translateX(56%); opacity: 0; } }
@keyframes xf-fall { 0% { transform: translateY(0) rotate(12deg); opacity: 1; } 28% { transform: translateY(calc(var(--rise1) * -1)) rotate(5deg); }
  55% { transform: translateY(calc(var(--rise) * -1)) rotate(-3deg); } 70% { transform: translateY(calc(var(--rise) * -1 + 4px)) rotate(12deg); opacity: 1; }
  100% { transform: translateY(44px) rotate(-48deg); opacity: 0; } }
@keyframes xf-redden { 0%, 52% { opacity: 0; } 66%, 100% { opacity: .55; } }
@keyframes xf-bump { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 68% { transform: translateX(100%); } 76% { transform: translateX(90%); }
  84% { transform: translateX(100%); opacity: 1; } 100% { transform: translateX(100%); opacity: 0; } }
@keyframes xf-hop { 0%, 68% { transform: translateY(0) rotate(-8deg); } 17% { transform: translateY(calc(var(--rise1) * -1)) rotate(-4deg); }
  34% { transform: translateY(calc(var(--rise) * -1)) rotate(1deg); } 51% { transform: translateY(calc(var(--rise1) * -1)) rotate(4deg); }
  76% { transform: translateY(-6px) rotate(-14deg); } 84%, 100% { transform: translateY(0) rotate(-4deg); } }
@keyframes xf-blink { from { opacity: .25; } to { opacity: 1; } }
/* телефон: монитор во всю ширину карточки, рамки тоньше, плитки сцены меньше — всё читается без прокрутки вбок */
@media (max-width: 600px) {
  .crt { margin-left: -12px; margin-right: -12px; }
  .crt-case { padding: 10px 10px 0; border-radius: 14px 14px 10px 10px; }
  .crt-glass { padding: 5px; border-radius: 10px; }
  .crt-screen { padding: 8px 6px 14px; border-radius: 9px / 12px; }
  .crt-chin { height: 28px; }
  .crt-neck { height: 10px; }
  .crt-foot { height: 10px; }
  .xp-bar { gap: 5px; height: 24px; padding: 0 3px 0 6px; }
  .xp-bar b { font-size: 11.5px; }
  .xp-min, .xp-max { display: none; }  /* как у диалогов XP — только «×», иначе название офиса в заголовке не помещается */
  .xp-btns i { width: 17px; height: 17px; }
  .xp-min::before { left: 4px; bottom: 3px; width: 6px; height: 2px; }
  .xp-max::before { left: 3px; top: 3px; width: 9px; height: 9px; border-top-width: 2px; }
  .xp-close::before, .xp-close::after { width: 10px; margin-left: -5px; }
  .xp-body { padding: 6px 8px 10px; }
  .xfer { --rise: 9px; --rise1: 7px; --card-w: 26px; --card-h: 32px; --col: 64px; --tile: 40px; --end-gap: 8px; --lane: 52px; gap: 2px; }
  .xf-tile { border-radius: 12px; }
  .xf-glyph { width: 24px; height: 24px; }
  .xf-end b { font-size: 12px; }
  .xf-mark { width: 26px; height: 26px; margin: -13px 0 0 -13px; }
  .xfer[data-phase=send] .xf-fly.f2, .xfer[data-phase=send] .xf-fly.f4 { display: none; }  /* на короткой линии — две карточки в полёте, не налезают */
}
/* без движения: карточек в полёте нет, стопка стоит или сразу ушла; итог — карточка у Corta HR, залитая дуга и галочка;
   в работе — мягко мигающая точка (только прозрачность) */
@media (prefers-reduced-motion: reduce) {
  .xfer .xf-fly, .xfer .xf-fly .xf-sheet, .xfer .xf-dots i, .xfer .xf-scanbar, .xfer .xf-stack i, .xfer .xf-stack i::after,
  .xfer .xf-led, .xfer .xf-srv .xf-tile, .crt .crt-led, .xp-steps li.now i, .xp-run > span, .xp-fill, .xp-fill > span { animation: none !important; }
  .xp-fill, .xp-fill > span { transition: none; }
  .crt[data-phase=work] .xp-run { opacity: 0; }
  .xfer .xf-fly { opacity: 0 !important; }
  .xfer[data-phase=done] .xf-fly.xf-back { opacity: 1 !important; transform: none; }
  .xfer[data-phase=done] .xf-back .xf-sheet { transform: none; }
  .xfer[data-phase=send] .xf-stack i { opacity: 1; }
  .xfer[data-phase=send] .xf-dots i { opacity: .5; }
  .xfer[data-phase=done] .xf-wipe, .xfer[data-phase=done] .xf-wipe > span { animation: none; transform: none; }
  .xfer[data-phase=done] .xf-yes, .xfer[data-phase=fail] .xf-no { animation: none; opacity: 1; transform: none; }
  .xfer[data-phase=work] .xf-track::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
    border-radius: 50%; background: var(--acc); animation: xf-blink 1.2s ease-in-out infinite alternate; }
}
.clr-done { margin: 10px 0 14px; padding-left: 18px; font-size: 13.5px; }
@media (max-width: 1100px) { .clg.side-layout { grid-template-columns: minmax(0, 1fr); } .clg-form { position: static; } }
@media (max-width: 1100px) { .fnd .clg-form { order: -1; } }  /* у поиска снимков до 600 — согласие и кнопки над ними, не в самом низу */
@media (max-width: 600px) { .sgp-grid { grid-template-columns: minmax(0, 1fr); } .clg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .clg-img img { transition: none; } }
/* коробка «в руке» за пределами полки */
.bx.carry {
  position: fixed; left: 0; top: 0; z-index: 90; margin: 0; pointer-events: none;
  filter: drop-shadow(8px 14px 10px rgba(30, 20, 5, .32));
}
.bx.carry .bx-face { transform: none; }
/* окно «Списать?» / «Отдать в ремонт?» после броска */
dialog.dock-dlg { width: min(400px, calc(100vw - 32px)); padding: 0; border: 0; background: none; overflow: visible; }
dialog.dock-dlg::backdrop { background: rgba(16, 22, 40, .45); }
dialog.dock-dlg .paper-form { display: grid; gap: 12px; padding: 20px 22px 18px 54px; }
dialog.dock-dlg .bx-pop-thumb { width: 48px; height: 48px; }
dialog.dock-dlg h3 { margin: 4px 0 0; font-size: 17px; }
.dock-lead { margin: -6px 0 0; font-size: 13.5px; color: var(--ink-2); }
dialog.dock-dlg .form-actions { margin-top: 2px; }

/* погрузчик: выглядывает справа на полу, по нажатию (и при первом открытии за сеанс) въезжает и задевает стеллаж */
.fork {
  position: absolute; right: -34px; bottom: 1px; z-index: 5; width: 92px; height: 64px; padding: 0; border: 0;
  background: none; cursor: pointer; transition: transform .85s cubic-bezier(.25, .7, .35, 1);
}
.fork.back { transition: transform 1.1s ease-in-out; }
.fork svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 30% 100%; }
.fk-wheel { transform-box: view-box; }
.fork.roll .fk-wheel { animation: fk-spin .5s linear infinite reverse; }
.fork.back .fk-wheel { animation-direction: normal; }
.fk-forks { transform-box: view-box; transition: transform .14s ease-out; }
.fork.lift .fk-forks { transform: translateY(-15px); }
.fork.lift svg { animation: fk-dip .4s ease-out; }
.fork.roll .fk-beacon, .fork.lift .fk-beacon { animation: fk-blink .5s steps(2) infinite; }
@keyframes fk-spin { to { transform: rotate(360deg); } }
@keyframes fk-dip { 30% { transform: rotate(-3deg); } }
@keyframes fk-blink { 50% { fill: #ffd27a; } }
.rk.jolt { animation: rk-jolt .4s ease-out; }
@keyframes rk-jolt { 20% { transform: translateX(-4px); } 45% { transform: translateX(3px); } 70% { transform: translateX(-1.5px); } }
@media (max-width: 860px) {
  .dock { right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); gap: 8px; }
}
@media (max-width: 600px) {
  .dock-t { width: 125px; padding: 12px 8px 9px; }
  .dock-t > svg { width: 91px; height: 77px; }
  .dock-t b { font-size: 13.5px; line-height: 23px; }
  .ms { top: 62px; width: 34px; height: 25px; }
  .fork { right: -26px; width: 70px; height: 49px; }
}

/* значок вида в списках и плитках */
.picto { flex: none; display: block; width: 28px; height: 28px; }
.picto.sm { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; color: var(--ink-2); }
.flags.info li { background: var(--brand-wash); color: var(--brand-ink); }
.off-thing .picto.sm { width: 16px; height: 16px; }

/* «Внести вещь»: плитки видов, «куда», коробка-примерка справа */
.item-new { display: grid; grid-template-columns: minmax(0, 660px) minmax(250px, 360px); gap: 28px; align-items: start; }
.item-new-form { display: grid; gap: 16px; }
.item-new-preview { position: sticky; top: 16px; display: grid; gap: 8px; }
.item-new-preview p { margin: 0; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kind-tiles, .where { min-width: 0; margin: 0; padding: 0; border: 0; }
.kind-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 6px; }
.kind-tiles legend, .where legend { margin-bottom: 8px; padding: 0; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.kind-tile {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 5px; padding: 10px 6px 8px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-ctl); background: var(--paper); color: var(--ink-2);
  font-size: 12px; line-height: 1.2; text-align: center; cursor: pointer;
}
.kind-tile input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.kind-tile .picto { color: var(--ink); }
.kind-tile:has(input:checked) { border-color: var(--felt); background: var(--brand-wash); color: var(--ink); box-shadow: inset 0 0 0 1px var(--felt); }
.kind-tile:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.kind-tile.guessed { animation: kind-guessed .9s ease; }
@keyframes kind-guessed { 0%, 40% { background: var(--sticky); } }
.where { display: grid; gap: 6px; }
.where-opt {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline; padding: 9px 12px;
  border: 1px solid var(--rule); border-radius: var(--r-ctl); cursor: pointer;
}
.where-opt b { font-weight: 500; }
.where-opt .hint { grid-column: 2; }
.where-opt:has(input:checked) { border-color: var(--felt); background: var(--brand-wash); }
.where-more { display: none; gap: 10px; padding: 4px 0 8px 30px; }
.where:has(input[value=shared]:checked) .where-more[data-where=shared],
.where:has(input[value=person]:checked) .where-more[data-where=person] { display: grid; }
@media (max-width: 960px) {
  .item-new { grid-template-columns: minmax(0, 1fr); }
  .item-new-preview { position: static; order: -1; }
}
@media (max-width: 600px) { .form-grid.two { grid-template-columns: minmax(0, 1fr); } }

/* страница вещи: коробка рядом с названием */
.item-head > .item-box { flex: none; min-width: 0; --u: 1px; }
.item-box .bx { cursor: default; }
.item-photo-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* заявки сотрудников */
.asks { display: grid; gap: 10px; margin-bottom: 24px; }
.ask {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 10px 18px; align-items: start; padding: 14px 16px;
  border: 1px solid var(--rule); border-radius: var(--r-panel); background: var(--paper);
}
.ask-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ask-kind .picto.sm, .ask-kind .icon { width: 18px; height: 18px; margin: 0; }
.ask-kind.k-broken { color: #8a5b00; }
.ask-kind.k-not_mine, .ask-kind.k-drop, .ask-kind.k-writeoff { color: var(--late); }
.ask-what b { display: block; margin-top: 3px; font-weight: 600; overflow-wrap: anywhere; }
.ask-what b a { color: inherit; }
.ask-note { margin: 6px 0 0; padding-left: 10px; border-left: 2px solid var(--rule-strong); color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
.ask-acts { display: grid; gap: 8px; justify-items: end; min-width: 230px; }
.ask-photo { display: inline-block; margin-top: 8px; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 1px var(--rule-strong); }
.ask-photo img { display: block; width: 96px; height: 72px; object-fit: cover; }
.ask-acts form { margin: 0; }
.ask-issue { display: flex; gap: 6px; }
.ask-issue select { max-width: 230px; }
.ask-reply > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); text-align: right; }
.ask-reply[open] { justify-self: stretch; }
.ask-reply form { display: grid; gap: 8px; margin-top: 8px; }
@media (max-width: 800px) {
  .ask { grid-template-columns: minmax(0, 1fr); }
  .ask-acts { justify-items: start; min-width: 0; }
  .ask-reply > summary { text-align: left; }
  .ask-issue { flex-wrap: wrap; }
}

/* кабинет: своя полка, заявки */
/* ── доступы — журнал выдачи (12.11, пользователь выбрал из вариантов; «отметка — когда выдан, когда отозван»).
   Бумага журнала согласования (.jlog): строка на доступ по дате выдачи, номер на поле, флажок цвета категории на краю
   листа, значок сервиса и категория (inventory/brands.py), логин, уровень, отметки печатями: «выдан» — зелёная,
   «отозван» — красная, строка зачёркнута; «просят закрыть» — жёлтая. Шаблон — inventory/_svc_ledger.html */
.svc-logo {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; background: #fff;
  box-shadow: inset 0 0 0 1px var(--rule), 0 1px 2px rgba(24, 33, 47, .08);
}
.svc-logo svg { display: block; width: 28px; height: 28px; }
.svc-logo.mono {
  background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); font-size: 19px; font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, #fff);
}
.ilog { max-width: none; container-type: inline-size; }
.il-head, .il-row { grid-template-columns: minmax(170px, 1.2fr) minmax(140px, 1fr) 150px 124px; }  /* у каждой строки своя сетка — колонки без auto */
.il-row { position: relative; min-height: 58px; }
.il-row::before {  /* флажок-закладка цвета категории на краю листа */
  content: ""; position: absolute; left: -6px; top: 50%; width: 13px; height: 24px; margin-top: -12px; border-radius: 0 4px 4px 0;
  background: var(--c); box-shadow: 1px 1px 2px rgba(24, 33, 47, .25);
}
.il-no { position: absolute; left: 10px; top: 50%; width: 26px; transform: translateY(-50%); text-align: center; font-size: 12.5px; color: var(--muted); }
.il-svc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.il-svc > span:last-child, .il-login { display: grid; min-width: 0; line-height: 1.25; }
.il-svc b { font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.il-svc small { font-size: 12px; font-weight: 600; color: var(--c); }
.il-svc .svc-logo { width: 34px; height: 34px; border-radius: 9px; }
.il-svc .svc-logo svg { width: 21px; height: 21px; }
.il-svc .svc-logo.mono { font-size: 15px; }
.il-login b { font-weight: 600; overflow-wrap: anywhere; }
.il-login small { font-size: 12.5px; color: var(--ink-2); }
.il-marks { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.il-stamp { padding: 1px 8px; border: 1.5px solid currentColor; border-radius: 5px; font-size: 12px; font-weight: 700; white-space: nowrap; transform: rotate(-1.5deg); }
.il-stamp.ok { color: #1f8a57; }
.il-stamp.no { color: #cf3424; transform: rotate(1.5deg); }
.il-stamp.wait { color: #a06a00; transform: rotate(1deg); }
.il-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 12.5px; white-space: nowrap; }
.il-acts .icon { width: 15px; height: 15px; margin-right: 4px; vertical-align: -3px; }
.il-acts .il-drop { color: var(--muted); }
.il-acts .il-drop:hover { color: var(--late); }
/* отозван — строка зачёркнута, флажок и значок бесцветные */
.il-row.is-off::before { background: #b6bcc7; }
.il-row.is-off .svc-logo { filter: grayscale(1); opacity: .55; }
.il-row.is-off .il-svc b, .il-row.is-off .il-login b { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(207, 52, 36, .55); }
.il-row.is-off .il-svc small, .il-row.is-off .il-login small { color: var(--muted); }
/* узкий журнал (телефон, узкое окно рядом с меню) — строка складывается: сервис, логин, печати, действия */
@container (max-width: 700px) {
  .il-head { display: none; }
  .il-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding-left: 48px; }
  .il-svc { flex-basis: 100%; }
  .il-login { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding-left: 44px; }
  .il-login b::before { content: "Логин"; display: inline-block; margin-right: 5px; font-weight: 400; color: var(--muted); }  /* inline-block — без зачёркивания */
  .il-marks { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; padding-left: 44px; }
  .il-acts { flex-basis: 100%; flex-direction: row; gap: 16px; padding-left: 44px; }
  .il-acts:empty { display: none; }
}
/* тот же значок и ярлык категории — в заголовке сервиса в списке доступов и на странице сервиса */
.section-title.svc-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.svc-head .svc-logo, .svc-h1 .svc-logo { width: 32px; height: 32px; border-radius: 9px; }
.svc-head .svc-logo svg, .svc-h1 .svc-logo svg { width: 20px; height: 20px; }
.svc-head .svc-logo.mono, .svc-h1 .svc-logo.mono { font-size: 15px; }
.svc-h1 { display: flex; align-items: center; gap: 12px; }
.svc-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.svc-tag::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--c); }
.me-stuff-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.me-stuff-head p { margin: 0; max-width: 580px; color: var(--ink-2); }
.me-stuff-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.my-asks td { vertical-align: top; }
.my-asks form { margin: 0; }
.ask-form { max-width: 680px; display: grid; gap: 14px; }
.ask-thing { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-ctl); background: var(--canvas); }
.ask-thing .picto, .ask-thing > .icon { flex: none; width: 30px; height: 30px; color: var(--ink); }
.ask-thing b { display: block; font-weight: 600; }
.ask-thing span { font-size: 12.5px; color: var(--muted); }

/* ── фото на пропуск из проходов и своё в кабинете (19.11, people/photos.py; рамка — initCropper в app.js) ── */
.pk-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 24px; align-items: start; }
.pk-layout .hint-line { display: block; margin: 0 0 10px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pk-shot { position: relative; display: grid; gap: 4px; padding: 4px; border-radius: 9px; background: var(--paper);
  box-shadow: 0 0 0 1px var(--rule); cursor: pointer; font-size: 11.5px; color: var(--ink-2); }
.pk-shot input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pk-shot img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 15%; border-radius: 6px; background: #1c2230; }
.pk-shot:has(input:checked) { box-shadow: 0 0 0 2px var(--brand); color: var(--ink); font-weight: 600; }
.pk-shot:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 3px; }
.pk-edit { position: sticky; top: 16px; display: grid; gap: 12px; }
.crop-stage { position: relative; justify-self: start; max-width: 100%; overflow: hidden; border-radius: 8px; background: #1c2230;
  user-select: none; -webkit-user-select: none; }
.crop-stage img { display: block; max-width: 100%; max-height: 62vh; }
.crop-frame { position: absolute; left: 0; top: 0; width: 100%; height: 100%; cursor: move; touch-action: none;
  box-shadow: 0 0 0 2px #fff, 0 0 0 2000px rgba(12, 16, 28, .55); }
.crop-frame::after { content: ""; position: absolute; left: 28%; top: 6%; width: 44%; height: 46%; border: 1.5px dashed rgba(255, 255, 255, .7);
  border-radius: 50%; pointer-events: none; }  /* где примерно быть лицу */
.crop-frame:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.crop-out { display: flex; align-items: center; gap: 14px; }
.crop-out p { margin: 0; }
.crop-preview { flex: none; width: 100px; aspect-ratio: 5 / 6; border-radius: 8px; background: #1c2230 no-repeat;
  box-shadow: 0 0 0 1px var(--rule-strong); }
.photo-origin { align-self: center; }
.toolbar .nophoto { white-space: nowrap; }
.me-photo-row { display: flex; gap: 20px; align-items: flex-start; }
.me-photo-now { flex: none; display: grid; place-items: center; width: 96px; aspect-ratio: 5 / 6; overflow: hidden; border-radius: 10px;
  background: #dfe4ee; color: var(--ink-2); font-size: 26px; font-weight: 600; }
.me-photo-now img { width: 100%; height: 100%; object-fit: cover; }
.me-photo-text { flex: 1; min-width: 0; max-width: 640px; }
.me-photo-text > p { margin-top: 0; }
.crop-box { display: grid; gap: 12px; margin-top: 4px; }
@media (max-width: 1000px) { .pk-layout { grid-template-columns: minmax(0, 1fr); } .pk-edit { position: static; } }
@media (max-width: 600px) { .me-photo-row { flex-direction: column; } .pk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
