/* Хасан — заявки на питание. Тема интерфейса: светлая и тёмная. */

:root {
  color-scheme: light;

  /* Безопасные отступы: вырез экрана, а в полноэкранном Telegram ещё и его кнопки «Закрыть» и меню.
     Переменные --tg-* выставляет скрипт Telegram, ui.js дублирует их на старых клиентах. */
  --safe-top: max(env(safe-area-inset-top, 0px), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));

  --plane: #F9F9F7;
  --surface: #FCFCFB;
  --surface-2: #F1F1EE;
  --surface-3: #E9E9E4;
  --line: rgba(11, 11, 11, 0.10);
  --line-soft: rgba(11, 11, 11, 0.06);
  --grid: #E1E0D9;
  --axis: #C3C2B7;

  --ink: #0B0B0B;
  --ink-2: #52514E;
  --ink-3: #6B6964;
  --link: var(--accent);

  --accent: #1C5CAB;
  --accent-hover: #104281;
  --accent-soft: #E4EDFA;
  --accent-ink: #184F95;
  --on-accent: #FFFFFF;

  --series-1: #2A78D6;
  --series-2: #EB6834;
  --c1: #2A78D6; --c2: #EB6834; --c3: #1F9E6E; --c4: #8B5CF6; --c5: #D4A20C; --c6: #D6457A; --c7: #1FA3B8; --c8: #7A8B2F;
  --c-rest: #B7BDC6;

  --good: #0CA30C;
  --good-ink: #006300;
  --good-soft: #E4F4E4;
  --warning: #FAB219;
  --warning-ink: #6B4A00;
  --warning-soft: #FBF0D9;
  --serious: #EC835A;
  --serious-ink: #7A3416;
  --serious-soft: #FBEAE2;
  --critical: #D03B3B;
  --critical-ink: #8C1F1F;
  --critical-soft: #F9E4E4;

  --glass: rgba(252, 252, 251, 0.78);
  --shadow-1: 0 1px 2px rgba(11, 11, 11, .05), 0 6px 18px rgba(11, 11, 11, .05);
  --shadow-2: 0 2px 6px rgba(11, 11, 11, .08), 0 18px 44px rgba(11, 11, 11, .14);

  --radius: 14px;
  --radius-sm: 10px;
  /* Кривые из навыка animate: сильный выход для появлений и нажатий, мягкий ход для перемещений, шторки как в iOS. */
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --fast: 150ms var(--ease);
  --mid: 240ms var(--ease);
  --meal-1: var(--c5); --meal-2: var(--c1); --meal-3: var(--c3); --meal-4: var(--c4);
  --font: "Onest", "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* числа и короткие служебные подписи; коды QR и счётчики раздачи */
  --font-num: var(--font);
  --font-code: "Tektur", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;

    --plane: #0D0D0D;
    --surface: #1A1A19;
    --surface-2: #232322;
    --surface-3: #2C2C2A;
    --line: rgba(255, 255, 255, 0.11);
    --line-soft: rgba(255, 255, 255, 0.07);
    --grid: #2C2C2A;
    --axis: #383835;

    --ink: #FFFFFF;
    --ink-2: #C3C2B7;
    --ink-3: #9A9892;
    --link: var(--accent-ink);

    --accent: #2470CC;
    --accent-hover: #3987E5;
    --accent-soft: #17273B;
    --accent-ink: #9EC5F4;
    --on-accent: #FFFFFF;

    --series-1: #3987E5;
    --series-2: #D95926;
    --c1: #3987E5; --c2: #E0703D; --c3: #34B886; --c4: #A07BFA; --c5: #E0B532; --c6: #E4679A; --c7: #3BBBD0; --c8: #9AAE45;
    --c-rest: #5A616B;

    --good-ink: #6FD36F;
    --good-soft: #142914;
    --warning-ink: #F1C778;
    --warning-soft: #2E2413;
    --serious-ink: #F0A98A;
    --serious-soft: #31201A;
    --critical-ink: #EE8686;
    --critical-soft: #301818;

    --glass: rgba(26, 26, 25, 0.78);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 44px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --plane: #0D0D0D;
  --surface: #1A1A19;
  --surface-2: #232322;
  --surface-3: #2C2C2A;
  --line: rgba(255, 255, 255, 0.11);
  --line-soft: rgba(255, 255, 255, 0.07);
  --grid: #2C2C2A;
  --axis: #383835;

  --ink: #FFFFFF;
  --ink-2: #C3C2B7;
  --ink-3: #9A9892;
  --link: var(--accent-ink);

  --accent: #2470CC;
  --accent-hover: #3987E5;
  --accent-soft: #17273B;
  --accent-ink: #9EC5F4;
  --on-accent: #FFFFFF;

  --series-1: #3987E5;
  --series-2: #D95926;
  --c1: #3987E5; --c2: #E0703D; --c3: #34B886; --c4: #A07BFA; --c5: #E0B532; --c6: #E4679A; --c7: #3BBBD0; --c8: #9AAE45;
  --c-rest: #5A616B;

  --good-ink: #6FD36F;
  --good-soft: #142914;
  --warning-ink: #F1C778;
  --warning-soft: #2E2413;
  --serious-ink: #F0A98A;
  --serious-soft: #31201A;
  --critical-ink: #EE8686;
  --critical-soft: #301818;

  --glass: rgba(26, 26, 25, 0.78);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 18px 44px rgba(0, 0, 0, .55);
}

/* ——— Вид «табличка» (новый): включается в настройках, атрибут data-look="plate" у <html>.
   Привычный вид — токены и правила выше; ниже только то, чем табличка от него отличается. ——— */
:root[data-look="plate"] {
  --plane: #EDEEEB;
  --surface: #FBFBFA;
  --surface-2: #F2F2EF;
  --surface-3: #E6E6E2;
  --line: rgba(28, 29, 28, 0.13);
  --line-soft: rgba(28, 29, 28, 0.08);
  --grid: #DDDDD8;
  --axis: #B9BAB4;

  --ink: #1C1D1C;
  --ink-2: #4A4B48;
  --ink-3: #626360;
  --link: var(--accent);

  --accent: #8E3320;
  --accent-hover: #73281A;
  --accent-soft: #F4E4DF;
  --accent-ink: #7A2B1B;
  --on-accent: #FFFFFF;

  --series-1: #A13B24;
  --series-2: #8A8B84;
  --c1: #A13B24; --c2: #2F6F8F; --c3: #2E8B3A; --c4: #6C5BA8; --c5: #B88A0E; --c6: #B5487A; --c7: #2B8C9A; --c8: #6F7F2A;
  --c-rest: #B7BDC6;
  --meal-1: #D98C76; --meal-2: #A13B24; --meal-3: #4A4B48; --meal-4: #A3A49D;

  --good: #2E8B3A;
  --good-ink: #1E5B22;
  --good-soft: #E3F0E3;
  --warning: #E8B21A;
  --warning-ink: #6B4A00;
  --warning-soft: #FBF1D3;
  --serious: #D9783E;
  --serious-ink: #7A3416;
  --serious-soft: #FBEADF;
  --critical: #C62828;
  --critical-ink: #8E1B1B;
  --critical-soft: #F8E1E1;

  --glass: rgba(251, 251, 250, 0.9);
  --shadow-1: 0 1px 0 rgba(28, 29, 28, .04);
  --shadow-2: 0 2px 6px rgba(28, 29, 28, .10), 0 16px 40px rgba(28, 29, 28, .16);

  --radius: 8px;
  --radius-sm: 6px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --fast: 150ms var(--ease);
  --mid: 240ms var(--ease);
  --shell: #6B2619;
  --shell-2: #82301F;
  --on-shell: #FFFFFF;
  --on-shell-2: #D9C3BE;
  --action: #1F2120;
  --action-hover: #383A38;
  --on-action: #FFFFFF;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --font-plate: "Tektur", "Commissioner", system-ui, sans-serif;
  --font-digits: var(--font-plate);
  --font: "Commissioner", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root[data-look="plate"]:where(:not([data-theme="light"])) {
    color-scheme: dark;

    --shell: #3A1A13;
    --shell-2: #4C2319;
    --on-shell: #F4ECE9;
    --on-shell-2: #C9A9A1;
    --action: #F2F1EC;
    --action-hover: #FFFFFF;
    --on-action: #1B1C1B;
    --plane: #121312;
    --surface: #1B1C1B;
    --surface-2: #242524;
    --surface-3: #2E2F2D;
    --line: rgba(242, 241, 236, 0.12);
    --line-soft: rgba(242, 241, 236, 0.07);
    --grid: #2E2F2D;
    --axis: #3D3E3B;

    --ink: #F2F1EC;
    --ink-2: #C9C8C1;
    --ink-3: #A09F98;
    --link: var(--accent-ink);

    --accent: #E58B72;
    --accent-hover: #F0A38E;
    --accent-soft: #3A231D;
    --accent-ink: #F0B9A9;
    --on-accent: #1B1C1B;

    --series-1: #D9694C;
    --series-2: #77786F;
    --c1: #D9694C; --c2: #5FA3C4; --c3: #5DBB6B; --c4: #A394DB; --c5: #E0B532; --c6: #E07AA8; --c7: #4FBCC8; --c8: #A3B353;
    --c-rest: #5A616B;
    --meal-1: #E8A894; --meal-2: #D9694C; --meal-3: #C9C8C1; --meal-4: #6F706A;

    --good-ink: #7DCB86;
    --good-soft: #15291A;
    --warning-ink: #F1C778;
    --warning-soft: #2E2413;
    --serious-ink: #F0A98A;
    --serious-soft: #31201A;
    --critical-ink: #EE8686;
    --critical-soft: #301818;

    --glass: rgba(27, 28, 27, 0.92);
    --shadow-1: 0 1px 0 rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .55);
  }
}

:root[data-look="plate"][data-theme="dark"] {
  color-scheme: dark;

  --shell: #3A1A13;
  --shell-2: #4C2319;
  --on-shell: #F4ECE9;
  --on-shell-2: #C9A9A1;
  --action: #F2F1EC;
  --action-hover: #FFFFFF;
  --on-action: #1B1C1B;
  --plane: #121312;
  --surface: #1B1C1B;
  --surface-2: #242524;
  --surface-3: #2E2F2D;
  --line: rgba(242, 241, 236, 0.12);
  --line-soft: rgba(242, 241, 236, 0.07);
  --grid: #2E2F2D;
  --axis: #3D3E3B;

  --ink: #F2F1EC;
  --ink-2: #C9C8C1;
  --ink-3: #A09F98;
  --link: var(--accent-ink);

  --accent: #E58B72;
  --accent-hover: #F0A38E;
  --accent-soft: #3A231D;
  --accent-ink: #F0B9A9;
  --on-accent: #1B1C1B;

  --series-1: #D9694C;
  --series-2: #77786F;
  --c1: #D9694C; --c2: #5FA3C4; --c3: #5DBB6B; --c4: #A394DB; --c5: #E0B532; --c6: #E07AA8; --c7: #4FBCC8; --c8: #A3B353;
  --c-rest: #5A616B;
  --meal-1: #E8A894; --meal-2: #D9694C; --meal-3: #C9C8C1; --meal-4: #6F706A;

  --good-ink: #7DCB86;
  --good-soft: #15291A;
  --warning-ink: #F1C778;
  --warning-soft: #2E2413;
  --serious-ink: #F0A98A;
  --serious-soft: #31201A;
  --critical-ink: #EE8686;
  --critical-soft: #301818;

  --glass: rgba(27, 28, 27, 0.92);
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--plane); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
  transition: background var(--mid), color var(--mid);
}

h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -0.015em; }
h1 { font-size: 18px; }
h2 { font-size: 16px; }
p { margin: 0; }
a { color: var(--link); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ——— прогресс загрузки ——— */

.progress {
  position: fixed;
  inset: var(--safe-top) auto auto 0;
  height: 2px;
  width: 0;
  z-index: 90;
  background: var(--accent);
  transition: width 220ms var(--ease), opacity 320ms var(--ease);
  box-shadow: 0 0 10px var(--accent);
}
.progress.done { opacity: 0; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: var(--plane);
  display: grid;
  place-items: center;
  transition: opacity 320ms var(--ease), visibility 320ms;
}
.boot.hidden { opacity: 0; visibility: hidden; }
.boot span { font-size: 13px; color: var(--ink-3); }

.shell {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100dvh;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

/* ——— шапка ——— */

.hdr {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border-bottom: 1px solid var(--line-soft);
  padding: calc(10px + var(--safe-top)) 16px 9px;
  transition: padding var(--mid), box-shadow var(--mid);
}
.hdr.compact { padding-top: calc(7px + var(--safe-top)); padding-bottom: 7px; box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }

.hdr-top { display: flex; align-items: center; gap: 10px; }
.hdr-top h1 { font-size: 17px; line-height: 1.25; flex: 1; min-width: 0; }
/* Знак в шапке — только на телефоне, где нет боковой панели. */
.hdr-mark { display: none; width: 30px; height: 30px; flex: none; background: var(--ink); -webkit-mask: url(/favicon.svg?v=1) center / 100% 100% no-repeat; mask: url(/favicon.svg?v=1) center / 100% 100% no-repeat; }
@media (max-width: 1039px) { .hdr-mark { display: block; } }
.hdr-role {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.hdr-contract {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hdr-strip {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  transition: opacity var(--mid), max-height var(--mid), margin var(--mid);
  max-height: 36px;
}
.hdr-strip::-webkit-scrollbar { display: none; }
.hdr.compact .hdr-strip.collapsible { opacity: 0; max-height: 0; margin-top: 0; pointer-events: none; }

.theme-btn {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background var(--fast), color var(--fast), transform var(--fast);
}
.theme-btn:active { transform: scale(.94); }
.theme-btn svg { width: 17px; height: 17px; }

.price-chip {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.price-chip b { font-weight: 620; color: var(--ink); }
.price-chip.total { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.price-chip.total b { color: var(--accent-ink); }

/* кликабельные чипы состояния */
.stat-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  transition: background var(--fast), border-color var(--fast), transform var(--fast);
}
.stat-chip:active { transform: scale(.97); }
.stat-chip b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.stat-chip[aria-pressed="true"] b { color: var(--accent-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.good { background: var(--good); }
.dot.warning { background: var(--warning); }
.dot.serious { background: var(--serious); }
.dot.critical { background: var(--critical); }
.dot.off { background: var(--axis); }

/* ——— полотно ——— */

main {
  flex: 1;
  padding: 14px 16px 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px;
}
.card-head { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 11px; }
.card-head h2 { flex: 1; }
.card-note { font-size: 12.5px; color: var(--ink-3); }

.eyebrow {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}

/* ——— элементы управления ——— */

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--surface-2);
  border-radius: 11px;
  border: 1px solid var(--line-soft);
}
.segmented button {
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 540;
  color: var(--ink-2);
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.segmented button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
/* Переключатель компаний в шапке: у кого их несколько. Длинные названия переносятся. */
.hdr-companies { display: flex; flex-wrap: wrap; width: fit-content; margin-top: 8px; max-width: 100%; }
.hdr-companies[hidden] { display: none; }
.hdr-companies button { text-align: left; min-width: 0; overflow-wrap: anywhere; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 560;
  transition: transform var(--fast), background var(--fast), border-color var(--fast), opacity var(--fast);
}
.btn:active { transform: scale(.985); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .btn-ghost:hover { background: var(--surface-3); } }
.btn-primary { background: var(--accent); color: var(--on-accent); }
@media (hover: hover) and (pointer: fine) { .btn-primary:hover { background: var(--accent-hover); } }
.btn-primary:disabled { background: var(--surface-3); color: var(--ink-3); cursor: not-allowed; }
.btn-quiet { color: var(--link); font-weight: 560; font-size: 13.5px; padding: 4px 2px; }
@media (hover: hover) and (pointer: fine) { .btn-quiet:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; } }
.btn-sm { padding: 6px 10px; font-size: 13px; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 40px; height: 23px;
  border-radius: 999px;
  background: var(--surface-3);
  position: relative;
  transition: background var(--mid);
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  inset: 2px auto 2px 2px;
  width: 19px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform var(--mid);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .switch-text { font-size: 13.5px; color: var(--ink-2); }

.dates { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 132px; flex: 1; }
.field span { font-size: 12px; color: var(--ink-3); font-weight: 540; }
.field input, .field textarea, .search {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--fast), box-shadow var(--fast);
}
.field input:focus, .field textarea:focus, .search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.date-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ——— дни заявки ——— */

.days { display: flex; flex-direction: column; gap: 9px; }

.day {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--mid), background var(--mid), opacity var(--mid);
}
/* Анимация только у карточки, появившейся впервые: иначе при каждой правке
   форма мигала целиком. */
.day.day-new { animation: riseIn 280ms var(--ease) both; }
@keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.day.off { background: var(--surface-2); }
.day.late { border-color: var(--serious); }
.day.closed { opacity: .72; }

.day-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.day-date { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.day-date strong { font-size: 14.5px; font-weight: 600; }
.day-date small { font-size: 11.5px; color: var(--ink-3); }
.day.late .day-date small { color: var(--serious-ink); }
.day-sum { font-size: 13px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.day-sum b { font-weight: 620; color: var(--ink); }

.day-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}
.day.off .day-body { display: none; }

.meal {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 9px 9px;
  background: var(--surface-2);
}
.meal-top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 7px; }
.meal-top b { font-size: 13px; font-weight: 580; }
.meal-top span { font-size: 11.5px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }

.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 30px; height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
  transition: background var(--fast), transform var(--fast);
}
.stepper button:active { transform: scale(.92); background: var(--surface-3); }
.stepper input {
  flex: 1;
  min-width: 0;
  height: 32px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stepper input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper input.zero { color: var(--ink-3); font-weight: 500; }

.meal-alt { margin-top: 6px; display: none; }
.meal-alt.on { display: block; animation: fadeUp 220ms var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.meal-alt label { display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 4px; }

.day-closed-note { padding: 0 12px 12px; font-size: 12.5px; color: var(--ink-3); }

/* ——— таблицы ——— */

.totals, .grid-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.totals th, .totals td { padding: 7px 0; text-align: right; border-bottom: 1px solid var(--line-soft); }
.totals th:first-child, .totals td:first-child { text-align: left; }
.totals thead th, .grid-table thead th {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .04em;
}
.totals tbody td { color: var(--ink-2); }
.totals tbody td.qty, .totals tbody td.sum { color: var(--ink); font-weight: 560; }
.totals tr.muted td { color: var(--ink-3); font-weight: 400; }
.totals tfoot td { font-weight: 660; border-bottom: 0; padding-top: 9px; color: var(--ink); }

/* ——— плашки ——— */

.banner {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  animation: fadeUp 260ms var(--ease) both;
}
.banner b { font-weight: 620; }
.banner.warn { background: var(--serious-soft); color: var(--serious-ink); }
.banner.warn a { color: inherit; }
.banner.info { background: var(--accent-soft); color: var(--accent-ink); }
.banner .banner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.banner .btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }

/* ——— док отправки ——— */

.submit-dock { position: fixed; left: 0; right: 0; bottom: calc(58px + var(--safe-bottom)); z-index: 45; padding: 0 12px 10px; pointer-events: none; }
.submit-dock-inner {
  max-width: 736px;
  margin: 0 auto;
  pointer-events: auto;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  box-shadow: var(--shadow-2);
  padding: 9px 10px 10px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform var(--mid), opacity var(--mid);
}
.submit-dock.hidden .submit-dock-inner { transform: translateY(18px); opacity: 0; pointer-events: none; }
.dock-figures { flex: 1; min-width: 0; }
.dock-figures .dock-main { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.dock-figures .dock-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-figures .dock-main.flash { animation: pop 300ms var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.045); } 100% { transform: scale(1); } }
.submit-dock .btn-primary { padding: 11px 16px; flex: none; }

/* ——— нижнее меню ——— */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: flex;
  padding: 5px 8px calc(5px + var(--safe-bottom));
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border-top: 1px solid var(--line-soft);
}
.tabbar-inner { max-width: 760px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 2px; }
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 540;
  color: var(--ink-3);
  transition: color var(--fast), background var(--fast);
}
.tab svg { width: 20px; height: 20px; }
.tab[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }

/* Rubber dock (rubberdock.js): активную вкладку рисует пилюля-пружина, значки на ней — белая копия ряда поверх.
 * Оригинальная активная вкладка остаётся без фона, иначе под тянущейся пилюлей проступит прежняя подсветка. */
.tabbar-inner.rd { position: relative; touch-action: none; }
.tabbar-inner.rd > .tab, .tabbar-inner.rd > .profile-btn { position: relative; z-index: 1; }
.tabbar-inner.rd > .tab[aria-current="page"], .tabbar-inner.rd > .tab.active { color: var(--ink-3); background: transparent; box-shadow: none; }
.tabbar-inner.rd > .tab:active { transform: none; }
.tabbar-inner.rd .tab svg { transform-origin: 50% 50%; }
.rd-pill { position: absolute; left: 0; top: 0; z-index: 0; background: var(--rd-pill, var(--accent)); pointer-events: none; will-change: transform; }
.rd-top { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; gap: inherit; pointer-events: none; }
.rd-top > * { color: var(--rd-on-pill, var(--on-accent)) !important; background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.rd-top > .profile-btn { visibility: hidden; }
:where(:root[data-look="plate"]) .tabbar { --rd-pill: var(--shell-2); --rd-on-pill: var(--on-shell); }

.profile-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background var(--fast), transform var(--fast);
  max-width: 47%;
}
.profile-btn:active { transform: scale(.97); }
.profile-btn .ava {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 650;
  display: grid;
  place-items: center;
  flex: none;
}
.profile-btn .pname { font-size: 13px; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ——— списки ——— */

.list { display: flex; flex-direction: column; gap: 9px; }
.item {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
  animation: riseIn 260ms var(--ease) both;
  transition: border-color var(--fast), background var(--fast), transform var(--fast);
  text-align: left;
  width: 100%;
}
button.item { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { button.item:hover { border-color: var(--line); background: var(--surface-2); } }
button.item:active { transform: scale(.995); }
.item .item-main { flex: 1; min-width: 0; }
.item .item-title { font-size: 14px; font-weight: 600; }
.item .item-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.item .item-side { text-align: right; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item .item-side b { display: block; font-weight: 620; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge.good { background: var(--good-soft); color: var(--good-ink); }
.badge.warning { background: var(--warning-soft); color: var(--warning-ink); }
.badge.serious { background: var(--serious-soft); color: var(--serious-ink); }
.badge.critical { background: var(--critical-soft); color: var(--critical-ink); }
.badge.off { background: var(--surface-3); color: var(--ink-3); }
.badge.neutral { background: var(--surface-3); color: var(--ink-2); }

.log { display: flex; flex-direction: column; }
.log-row {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.log-row .log-act { font-weight: 560; }
.log-row .log-who { color: var(--ink-3); font-size: 12px; margin-top: 2px; }

.empty {
  padding: 26px 14px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.contact { display: flex; align-items: center; gap: 11px; }
.contact .ava { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 650; font-size: 13px; flex: none; }
.contact .contact-main { flex: 1; min-width: 0; }
.contact .contact-main b { font-size: 14px; font-weight: 600; display: block; }
.contact .contact-main span { font-size: 12.5px; color: var(--ink-3); }

/* ——— диалоги ——— */

dialog {
  border: 0;
  padding: 0;
  border-radius: 16px;
  max-width: 460px;
  width: calc(100% - 28px);
  box-shadow: var(--shadow-2);
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop { background: rgba(6, 8, 10, .5); backdrop-filter: blur(3px); }
dialog[open] { animation: dlgIn 240ms var(--ease) both; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.dlg-body { padding: 18px 18px 14px; }
.dlg-body h2 { margin-bottom: 9px; }
.dlg-lines { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; margin: 12px 0; }
.dlg-lines .row { display: flex; justify-content: space-between; gap: 12px; }
.dlg-lines .row span { color: var(--ink-3); }
.dlg-lines .row b { font-weight: 600; text-align: right; }
.legal { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); background: var(--surface-2); border-radius: 11px; padding: 11px 12px; }
.dlg-actions { display: flex; gap: 8px; padding: 0 18px 18px; flex-wrap: wrap; }
.dlg-actions .btn { flex: 1; min-width: 130px; }

/* полноэкранный дашборд */
dialog.sheet {
  max-width: 860px;
  width: calc(100% - 20px);
  max-height: calc(100dvh - 40px - var(--safe-top) - var(--safe-bottom));
  padding: 0;
}
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet[open] { animation: sheetIn 280ms var(--ease) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.sheet-head {
  position: sticky; top: 0;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px 12px;
  z-index: 2;
}
.sheet-body { overflow-y: auto; padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.sheet-close {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-soft);
}
@media (hover: hover) and (pointer: fine) { .sheet-close:hover { background: var(--surface-3); } }

/* ——— тост ——— */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(128px + var(--safe-bottom));
  transform: translate(-50%, 14px);
  z-index: 80;
  background: var(--ink);
  color: var(--plane);
  padding: 10px 15px;
  border-radius: 11px;
  font-size: 13.5px;
  max-width: calc(100% - 32px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--mid), transform var(--mid);
  box-shadow: var(--shadow-2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.view { display: none; flex-direction: column; gap: 12px; }
.view.active { display: flex; animation: fadeUp 180ms var(--ease-out) both; }
.view > div:empty { display: none; }

@media (min-width: 620px) {
  .day-body { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  main { padding-left: 20px; padding-right: 20px; }
}

@media (min-width: 1040px) {
  .shell.wide { max-width: 1120px; }
  .shell.wide .tabbar-inner { max-width: 1120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ——— боковая панель на большом экране ——— */

.app { display: flex; align-items: flex-start; min-height: 100dvh; width: 100%; }
.sidebar { display: none; }

@media (min-width: 1040px) {
  .tabbar { display: none; }
  .app { justify-content: center; gap: 0; }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 236px;
    flex: none;
    position: sticky;
    top: 0;
    height: 100dvh;
    padding: 16px 12px 14px;
    border-right: 1px solid var(--line-soft);
    background: var(--surface);
  }
  .shell { margin: 0; flex: 1; max-width: 1000px; }
  .shell.wide { max-width: 1120px; }
  .submit-dock { left: 236px; bottom: 0; }
  main { padding-bottom: 120px; }
}

.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 14px; }
/* Знак сервиса: миска, каска и кран из favicon.svg. Маска красится цветом текста, поэтому один файл на обе темы. */
.side-brand .mark {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: var(--ink);
  -webkit-mask: url(/favicon.svg?v=1) center / 100% 100% no-repeat; mask: url(/favicon.svg?v=1) center / 100% 100% no-repeat;
}
.side-brand b { font-size: 14.5px; font-weight: 640; letter-spacing: -.01em; }
.side-brand span { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

.tab-wide {
  flex: none;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 11px;
  font-size: 14px;
  font-weight: 540;
  border-radius: 10px;
}
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.side-foot .profile-btn { margin-left: 0; flex: 1; max-width: none; }

/* ——— переключатель темы ——— */

.theme-btn { position: relative; overflow: hidden; }
.theme-btn svg { transition: transform 420ms var(--ease), opacity 220ms var(--ease); }

.theme-wipe {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  background: var(--plane);
  clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%));
  animation: wipe 520ms var(--ease) forwards;
}
@keyframes wipe {
  from { clip-path: circle(0 at var(--wx, 50%) var(--wy, 50%)); opacity: 1; }
  to { clip-path: circle(150% at var(--wx, 50%) var(--wy, 50%)); opacity: 0; }
}

/* ——— свайп ——— */

.view { touch-action: pan-y; }
.swipe-hint {
  position: fixed;
  bottom: calc(118px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transition: opacity var(--mid);
}
.swipe-hint.show { opacity: 1; }
.swipe-hint i { width: 6px; height: 6px; border-radius: 50%; background: var(--axis); transition: background var(--fast), width var(--fast); }
.swipe-hint i.on { background: var(--accent); width: 16px; border-radius: 3px; }
@media (min-width: 1040px) { .swipe-hint { display: none; } }

dialog.sheet { touch-action: pan-y; }
.sheet-grip {
  width: 38px; height: 4px; border-radius: 2px;
  background: var(--axis);
  margin: 0 auto 10px;
  display: none;
}
@media (max-width: 1039px) { .sheet-grip { display: block; } }

/* ——— экран активации ——— */

.gate {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--plane);
  display: block;
  padding: calc(20px + var(--safe-top)) 16px calc(40px + var(--safe-bottom));
  overflow-y: auto;
  animation: fadeUp 280ms var(--ease) both;
}
.gate[hidden] { display: none; }
.gate-card {
  margin: 0 auto;
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-1);
  padding: 20px 18px 18px;
}
.gate-step { animation: fadeUp 240ms var(--ease) both; }
.gate-grid { display: grid; gap: 10px; }
.gate-actions { display: flex; gap: 8px; margin-top: 16px; }
.gate-actions .btn { flex: 1; }
.gate-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-2);
  background: var(--surface-2);
  border-radius: 11px;
  padding: 11px 12px;
  cursor: pointer;
}
.gate-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
@media (min-width: 560px) { .gate-grid { grid-template-columns: 1fr 1fr; } }


/* ——— карточка подробностей ——— */

.has-details { cursor: pointer; }
.has-details:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.has-details[data-details-pinned] { box-shadow: 0 0 0 2px var(--accent) inset; }

.details-card {
  position: fixed;
  z-index: 85;
  min-width: 248px;
  max-width: min(360px, calc(100vw - 20px));
  max-height: min(70dvh, 520px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow-2);
  padding: 12px 13px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--fast), transform var(--fast);
}
.details-card.show { opacity: 1; transform: none; }
.details-head { display: flex; align-items: flex-start; gap: 10px; }
.details-title { font-weight: 640; font-size: 14px; letter-spacing: -.01em; }
.details-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.details-close {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  color: var(--ink-3); background: var(--surface-2); font-size: 12px; line-height: 1;
}
@media (hover: hover) and (pointer: fine) { .details-close:hover { background: var(--surface-3); color: var(--ink); } }
.details-method {
  margin-top: 8px; padding: 7px 9px; border-radius: 9px;
  background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.4;
}
.details-section { margin-top: 10px; }
.details-section + .details-section { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.details-section-title {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 650; margin-bottom: 5px;
}
.details-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.details-row span { color: var(--ink-2); min-width: 0; }
.details-row b { font-weight: 600; white-space: nowrap; }
.details-row.strong span, .details-row.strong b { color: var(--ink); font-weight: 650; }
.details-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; margin: 1px 0 4px; }
.details-actions { margin-top: 11px; display: flex; }
.details-actions .btn { flex: 1; }
.details-foot { margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }

@media (hover: none) { .details-foot { content: none; } }

/* переходы между разделами */
.view.active.slide-in { animation: slideIn 260ms var(--ease) both; }
.view.active.slide-back { animation: slideBack 260ms var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes slideBack { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .view.active, .view.active.slide-in, .view.active.slide-back { animation: none; }
}

/* уточнения для кабинета менеджера */
.totals .dim { color: var(--ink-3); font-weight: 400; margin-left: 6px; font-size: 12px; }
.item .btn-quiet { margin-top: 6px; padding: 0; }
.day-head .day-sum { margin-left: auto; }
.hdr-strip .badge { white-space: nowrap; flex: none; }
.gate-actions-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.gate-actions-stack .btn { justify-content: center; }
/* Появление и скрытие колонки «без свинины» без рывка */
.meal-alt.on { animation: fadeUp 200ms var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .day.day-new, .meal-alt.on { animation: none; }
}
.head-actions { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.row-actions .btn-quiet { padding: 0; }
.report-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 11px; }
.report-bar select {
  height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); padding: 0 9px; font: inherit; flex: 1 1 200px; min-width: 0;
}
.report-bar #report-format { flex: 0 0 auto; width: auto; }
.billing-panel { margin: -2px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft, var(--surface)); }
.billing-panel summary { cursor: pointer; padding: 10px 12px; font-weight: 620; list-style: none; }
.billing-panel summary::-webkit-details-marker { display: none; }
.billing-panel summary::after { content: ''; float: right; margin: 6px 4px 0 0; width: 7px; height: 7px; border-right: 1.7px solid var(--ink-3); border-bottom: 1.7px solid var(--ink-3); transform: rotate(-45deg); transition: transform var(--mid); }
.billing-panel[open] summary::after { transform: rotate(45deg); }
.billing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 2px 12px 10px; }
.billing-grid label { display: grid; gap: 5px; min-width: 0; }
.billing-grid label span { color: var(--ink-3); font-size: 11.5px; }
.billing-grid input, .billing-grid select { width: 100%; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 0 9px; font: inherit; }
.billing-note { padding: 0 12px 8px; line-height: 1.4; }
.billing-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 12px 12px; }
.billing-package { display: flex; align-items: center; gap: 7px 13px; flex-wrap: wrap; margin: 0 12px 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); font-size: 12px; }
.billing-package > span { color: var(--ink-3); font-weight: 650; }
.billing-package label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.billing-package input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.billing-parties { margin: 0 12px 10px; border-top: 1px solid var(--line-soft); }
.billing-parties > summary { padding: 10px 0 8px; color: var(--ink-2); font-size: 12.5px; }
.billing-parties .billing-grid { padding-left: 0; padding-right: 0; }
.billing-party-title { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; font-size: 12px; font-weight: 650; }
.billing-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .billing-grid { grid-template-columns: 1fr; } }

/* Памятка доступна из кабинета заказчика и диспетчерской, без всплывающего окна. */
.help-btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.side-foot .help-btn { margin-left: auto; }
.help-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .28); opacity: 0; transition: opacity 220ms var(--ease); z-index: 80; }
.help-backdrop.open { opacity: 1; }
.help-drawer { position: fixed; z-index: 81; top: var(--safe-top); right: 0; width: min(480px, 94vw); height: calc(100dvh - var(--safe-top)); overflow: auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -16px 0 50px rgb(0 0 0 / .16); padding: 20px; transform: translateX(102%); transition: transform 220ms var(--ease); }
.help-drawer.open { transform: none; }
.help-open { overflow: hidden; }
/* На компьютере «Помощь» не ложится поверх, а делит экран (split view): затемнения нет, со страницей
 * можно работать дальше. Если справа хватает пустого места, лента стоит как стояла; если панель закрыла бы
 * её край (help.js ставит help-squeeze), лента ужимается или отходит ровно к краю панели, не дальше.
 * Перестройка ленты — разовая, без анимации (анимировать ширину дорого и дёргано);
 * едет только сама панель: transform, кривая шторки --ease-drawer, 240 мс. */
@media (min-width: 1100px) {
  :root { --help-w: 420px; }
  .help-drawer { z-index: 97; top: 0; width: var(--help-w); height: 100dvh; box-shadow: none; transition: transform 240ms var(--ease-drawer); }
  html.help-docked .help-open { overflow: visible; }
  html.help-squeeze .app { padding-right: var(--help-pad, var(--help-w)); box-sizing: border-box; }
  html.help-squeeze .gate { right: var(--help-pad, var(--help-w)); }
  html.help-squeeze .submit-dock { right: var(--help-pad, var(--help-w)); }
  html.help-docked .jobs-dock { right: calc(var(--help-w) + 20px); }
  html.help-docked .notif-panel { right: calc(var(--help-w) + 12px); }
  html.help-docked .ib { right: var(--help-w); }
}
@media (min-width: 1100px) and (prefers-reduced-motion: reduce) {
  .help-drawer { transform: none; opacity: 0; transition: opacity 160ms var(--ease); }
  .help-drawer.open { opacity: 1; }
}
.help-head { position: sticky; top: -20px; z-index: 1; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin: -20px -20px 12px; padding: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.help-head h2 { margin: 2px 0 4px; }
.help-head p { margin: 0; color: var(--ink-3); font-size: 12px; }
.help-list { display: grid; gap: 8px; }
.help-step { border: 1px solid var(--line-soft); border-radius: 12px; padding: 0 12px; background: var(--surface-soft, var(--surface)); }
.help-step summary { cursor: pointer; padding: 11px 0; font-weight: 620; }
.help-step p { margin: 0 0 8px; color: var(--ink-2); line-height: 1.5; }
.help-step ul { margin: 0 0 12px; padding-left: 20px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.help-support { margin: 14px 0 0; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); color: var(--ink-2); line-height: 1.45; font-size: 12.5px; }
@media (max-width: 680px) {
  .help-drawer { top: auto; bottom: 0; width: 100%; height: min(88dvh, 760px); border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; transform: translateY(102%); padding: 16px; }
  .help-head { top: -16px; margin: -16px -16px 10px; padding: 16px; }
}

/* Карточка договора в шапке кабинета заказчика */
.hdr-card { margin-top: 10px; font-size: 13px; }
.hdr-card summary { cursor: pointer; color: var(--ink-3); font-weight: 560; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.hdr-card summary::-webkit-details-marker { display: none; }
.hdr-card summary::after { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .2s ease; display: inline-block; }
.hdr-card[open] summary::after { transform: rotate(45deg); }
.hdr-card dl { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 14px; margin: 10px 0 2px; }
.hdr-card dt { color: var(--ink-3); }
.hdr-card dd { margin: 0; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
@media (max-width: 560px) { .hdr-card dl { grid-template-columns: 1fr; gap: 2px; } .hdr-card dd { margin-bottom: 8px; } }
.hdr.compact .hdr-card.collapsible { display: none; }

/* Раскрывающиеся заявки в кабинете заказчика */
.order-item { flex-direction: column; gap: 0; padding: 0; }
.order-toggle { display: flex; align-items: flex-start; gap: 11px; width: 100%; padding: 11px 12px 4px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 12px; }
.order-toggle .item-main, .order-toggle .item-title, .order-toggle .item-meta { display: block; }
.order-toggle .chev { flex: none; margin-top: 2px; color: var(--ink-3); transition: transform var(--mid); }
.order-item.open .chev { transform: rotate(90deg); }
.order-item .row-actions { padding: 2px 12px 11px; }
.order-body { padding: 4px 12px 2px; animation: riseIn 220ms var(--ease) both; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -12px; padding: 0 12px; }
.order-table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.order-table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 11.5px; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.order-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: top; }
.order-table td small { display: block; color: var(--ink-3); font-size: 11px; }
.order-table td.strong { font-weight: 620; }
.order-table td.muted { color: var(--ink-3); }
.order-table tr.warn td { background: color-mix(in srgb, var(--warning, #D4A20C) 10%, transparent); }
.order-comment { margin-top: 8px; line-height: 1.45; }
/* Кабинет заказчика: группировка столбцов «Дни / Недели / Полмесяца / Месяцы» над диаграммой. */
.my-chart-tools { display: flex; margin: 0 0 4px; overflow-x: auto; scrollbar-width: none; }
.my-chart-tools::-webkit-scrollbar { display: none; }
.my-chart-tools:empty { display: none; }
.my-chart-tools .seg-control { display: inline-flex; flex: none; padding: 2px; border-radius: 9px; background: var(--surface-3); gap: 2px; }
.my-chart-tools .seg-control button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 560; color: var(--ink-2); padding: 5px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.my-chart-tools .seg-control button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ——— строка периодов в шапке (periods.js): та же, что в диспетчерской (admin.css) ———
 * «Обзор», половины месяцев, «Период…». Не помещается — листается вбок, «Период…» прилипает справа. */
.period-wrap[hidden] { display: none; }
.period-row { display: flex; gap: 6px; align-items: center; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; max-height: none; flex-wrap: nowrap; padding-block: 1px; }
.period-row::-webkit-scrollbar { display: none; }
.hdr .period-row .chip { min-height: 32px; display: inline-flex; align-items: center; white-space: nowrap; padding: 5px 12px; font-size: 13px; flex: none; }
.chip-custom { gap: 6px; }
.chip-custom svg { flex: none; }
.chip-custom[aria-expanded="true"]:not([aria-pressed="true"]) { border-color: var(--accent); color: var(--accent-ink); }
.period-row.overflowing .chip-custom { position: sticky; right: 0; z-index: 1; box-shadow: -14px 0 10px -2px var(--surface); }
@media (pointer: coarse) { .hdr .period-row .chip { min-height: 36px; } }
.range-box { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-soft); animation: fadeUp 200ms var(--ease) both; }
.range-box[hidden] { display: none; }
.range-hints { display: flex; flex-wrap: wrap; gap: 6px; }
.range-hints .chip.sm { min-height: 30px; }
.range-fields { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.range-fields .field { min-width: 132px; flex: 0 1 160px; }
.range-fields .btn { min-height: 38px; }
@media (max-width: 560px) {
  .range-fields .field { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .range-fields .btn { flex: 1 1 calc(50% - 4px); }
}

/* ——— плавность: тема, нажатия, раскрытия, окна, переходы между страницами ——— */

/* Смена темы: вся страница мягко перетекает из старой темы в новую. */
.theme-vt::view-transition-old(root) { animation: themeOut 380ms var(--ease-in-out) both; z-index: 1; }
.theme-vt::view-transition-new(root) { animation: none; }
@keyframes themeOut { to { opacity: 0; } }
@keyframes themeIn { from { opacity: 0; } }
.theme-veil { position: fixed; inset: 0; z-index: 300; pointer-events: none; opacity: 1; transition: opacity 380ms var(--ease-in-out); }
.theme-veil.gone { opacity: 0; }
.theme-btn svg { transition: transform 480ms var(--ease); }
.theme-btn.spin svg { transform: rotate(180deg) scale(.86); }

/* Переход между страницами сервиса (вход → кабинет, кабинет ↔ диспетчерская). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut 180ms var(--ease) both; }
::view-transition-new(root) { animation: vtIn 260ms var(--ease) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }

/* Нажатия: всё, что нажимается, чуть проседает — видно, что нажатие дошло. */
.btn, .chip, .tab, .btn-quiet, .legend-item, .seg-control button, .order-toggle, .has-details, .theme-btn, .profile-btn, button.item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active, .chip:active, .tab:active, .legend-item:active, .seg-control button:active, .theme-btn:active, .profile-btn:active {
  transform: scale(.97);
  transition-duration: 120ms;
}
.has-details { cursor: pointer; transition: transform 160ms var(--ease), box-shadow 160ms var(--ease), filter 160ms var(--ease); }
.has-details:active { transform: scale(.985); }
.bar.has-details:active { transform: none; filter: brightness(1.12); }
.seg-control button { transition: background 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease), transform 90ms var(--ease); }

/* Раскрытие: <details> и блоки заявки растут по высоте, а не появляются рывком. */
:root { interpolate-size: allow-keywords; }
details::details-content {
  block-size: 0; overflow: clip;
  transition: block-size 280ms var(--ease), content-visibility 280ms allow-discrete;
}
details[open]::details-content { block-size: auto; }
.order-body { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 280ms var(--ease), opacity 220ms var(--ease); animation: none; padding-top: 0; padding-bottom: 0; }
.order-body > .order-body-inner { min-height: 0; overflow: hidden; }
.order-item.open .order-body { grid-template-rows: 1fr; opacity: 1; }
.order-item.open .order-body > .order-body-inner { padding: 4px 0 2px; }

/* Всплывающая расшифровка: появляется из точки нажатия и так же уходит. */
.details-card { transform-origin: top center; transform: translateY(-4px) scale(.98); transition: opacity 160ms var(--ease), transform 200ms var(--ease); }
.details-card.show { transform: none; }

/* Окна: закрытие — зеркало открытия. */
dialog.closing { animation: dlgOut 170ms var(--ease) both; }
dialog.closing::backdrop { animation: fadeOutBg 170ms var(--ease) both; }
dialog[open]::backdrop { animation: fadeInBg 220ms var(--ease) both; }
@keyframes dlgOut { to { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes fadeInBg { from { opacity: 0; } }
@keyframes fadeOutBg { to { opacity: 0; } }

/* Появление содержимого карточки и панелей. */
.panel-enter > * { animation: riseIn 300ms var(--ease) both; }
.panel-enter > *:nth-child(2) { animation-delay: 30ms; }
.panel-enter > *:nth-child(3) { animation-delay: 60ms; }
.panel-enter > *:nth-child(4) { animation-delay: 90ms; }
.panel-enter > *:nth-child(n+5) { animation-delay: 120ms; }

/* Столбцы диаграмм вырастают снизу при каждом обновлении. */
.bar-stack { transform-origin: bottom; animation: barGrow 420ms var(--ease) both; animation-delay: calc(var(--i, 0) * 6ms); }
@keyframes barGrow { from { transform: scaleY(.02); opacity: .3; } to { transform: none; opacity: 1; } }
.chart-plot.loading .bar-stack { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  @view-transition { navigation: none; }
}
/* Растворяющаяся карточка не должна перехватывать нажатия. */
/* Пока карточка не закреплена, она прозрачна для мыши: даже если легла поверх элемента,
 * указатель остаётся на элементе, карточка не мигает, а нажатие закрепляет её. */
.details-card:not(.pinned), .details-card:not(.show) { pointer-events: none; }

/* Заявка в интересах другой компании */
.behalf-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; padding: 2px 0; }
.behalf-check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.behalf-pick { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; animation: fadeUp 220ms var(--ease) both; }
.behalf-list { max-height: 240px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line-soft); border-radius: 10px; }
.behalf-row { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--line-soft); background: none; font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; transition: background var(--fast); }
.behalf-row:last-child { border-bottom: 0; }
.behalf-row small { color: var(--ink-3); white-space: nowrap; font-size: 12px; }
@media (hover: hover) and (pointer: fine) { .behalf-row:hover { background: var(--surface-3); } }
.behalf-row[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.behalf-chosen { font-weight: 560; color: var(--ink-2); }
.badge.behalf { background: color-mix(in srgb, var(--c6) 14%, transparent); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c6) 40%, transparent); white-space: normal; }
.behalf-line { padding: 2px 12px 4px; }
.behalf-line .badge { font-size: 11.5px; line-height: 1.35; padding: 3px 8px; }
.order-item.foreign { border-style: dashed; }

/* ——— формирование документов в фоне ——— */

.jobs-dock {
  position: fixed;
  right: 12px; left: 12px;
  bottom: calc(66px + var(--safe-bottom));
  z-index: 70;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
  max-height: calc(100dvh - 140px);
}
.jobs-dock:empty { display: none; }
@media (min-width: 1040px) { .jobs-dock { left: auto; width: 420px; right: 20px; bottom: 20px; } }
.job-card {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 12px 14px 12px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: auto;
  max-height: inherit;
}
.job-card.entering { animation: jobIn 260ms var(--ease) both; }
.job-card.leaving { animation: jobOut 200ms var(--ease) both; }
@keyframes jobIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes jobOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
.job-head { display: flex; align-items: center; gap: 8px; }
.job-title { flex: 1; font-weight: 600; font-size: 14px; }
.job-close { width: 28px; height: 28px; border-radius: 8px; color: var(--ink-3); font-size: 18px; line-height: 1; }
@media (hover: hover) and (pointer: fine) { .job-close:hover { background: var(--surface-2); color: var(--ink); } }
.job-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.job-bar span { display: block; height: 100%; width: 4%; border-radius: inherit; background: var(--accent); transition: width 500ms var(--ease); }
.job-card:not(.done):not(.failed) .job-bar span { background-image: linear-gradient(90deg, transparent, rgb(255 255 255 / .35), transparent); background-size: 200% 100%; animation: jobShine 1.4s linear infinite; background-color: var(--accent); }
@keyframes jobShine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.job-card.done .job-bar span { background: var(--good); }
.job-card.failed .job-bar span { background: var(--critical); width: 100% !important; }
.job-stage { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.job-card.mini .job-result, .job-card.mini .job-stage { display: none; }
.job-result { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.job-result ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.job-row { display: flex; gap: 8px; align-items: flex-start; }
.job-row p { margin: 2px 0 0; color: var(--ink-2); line-height: 1.4; }
.job-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: var(--good); }
.job-row.partial .job-dot { background: var(--warning); }
.job-row.none .job-dot { background: var(--critical); }
.job-status { color: var(--ink-3); font-size: 12px; }
.job-list summary { cursor: pointer; color: var(--ink-2); padding: 2px 0 6px; }
.job-file { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 6px 6px 6px 10px; }
.job-file span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--ink-2); }
.job-note { margin: 0; color: var(--ink-3); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .job-card, .job-bar span { animation: none !important; transition: none !important; } }

/* Форматы файлов по документам: у УПД три — Word, PDF и XML. */
.billing-formats-grid { display: grid; grid-template-columns: max-content 1fr; align-items: center; gap: 7px 14px; margin: 0 12px 10px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); font-size: 12px; }
.billing-formats-grid > span { color: var(--ink-3); font-weight: 650; }
.billing-formats-grid > div { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.billing-formats-grid label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.billing-formats-grid input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.billing-edo { display: grid; gap: 5px; margin: 0 12px 10px; }
.billing-edo[hidden] { display: none; }
.billing-edo > span { color: var(--ink-3); font-size: 11.5px; }
.billing-edo input { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); padding: 0 9px; font: inherit; }
.billing-edo small { color: var(--ink-3); font-size: 11.5px; }
@media (max-width: 420px) { .billing-formats-grid { grid-template-columns: 1fr; gap: 4px; } .billing-formats-grid > div { margin-bottom: 6px; } }

/* ——— вход по логину и паролю ——— */
.gate-lead { margin: 8px 0 14px; line-height: 1.45; }
.gate-stack { display: grid; gap: 10px; }
.gate-subtitle { margin: 16px 0 8px; font-size: 13px; font-weight: 650; color: var(--ink); }
.gate-hint { margin-top: 6px; line-height: 1.4; }
.gate-foot { margin-top: 14px; line-height: 1.5; }
.gate-foot .btn-quiet { display: inline; padding: 0; margin-left: 2px; }
.gate-notice { margin-bottom: 12px; color: var(--serious-ink); line-height: 1.45; }
.gate-tg-box { margin: 4px 0 6px; }
.gate-tg-box[hidden] { display: none; }
.btn-tg { text-decoration: none; width: 100%; min-height: 52px; font-size: 16.5px; font-weight: 650; border-radius: 12px; background: #229ED9; color: #fff; }
@media (hover: hover) and (pointer: fine) { .btn-tg:hover { background: #16739F; color: #fff; text-decoration: none; } }
.gate-actions-stack .btn-tg { min-height: 52px; }
.gate-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: 12.5px; color: var(--ink-3); }
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.gate-howto { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 10px; font-size: 13px; color: var(--ink-2); }
.gate-howto summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.gate-howto summary::-webkit-details-marker { display: none; }
.gate-howto summary::after { content: ' ▾'; font-size: 11px; }
.gate-howto[open] summary::after { content: ' ▴'; }
.gate-howto ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 7px; line-height: 1.45; }
.gate-howto b { color: var(--ink); font-weight: 620; }
.gate-error { min-height: 0; margin: 8px 0 0; font-size: 13px; color: var(--critical-ink); line-height: 1.4; }
.gate-error:empty { display: none; }
.gate-check { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.4; cursor: pointer; }
.gate-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex: none; }
.pass-wrap { position: relative; display: block; }
.pass-wrap input { width: 100%; padding-right: 86px; }
.pass-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 12px; color: var(--accent); padding: 6px 8px; border-radius: 7px; }
@media (hover: hover) and (pointer: fine) { .pass-eye:hover { background: var(--accent-soft); } }
.cred-box { display: grid; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 6px 12px; }
.cred-row { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
.cred-row span { width: 64px; color: var(--ink-3); font-size: 12.5px; }
.cred-row b { flex: 1; font-weight: 620; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: .01em; }
.tg-offer { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.tg-offer .card-note { line-height: 1.45; }
.tg-offer .ok { color: var(--good-ink); }

/* ——— настройки учётной записи ——— */
.account-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; }
.acc-notice { margin: 4px 0 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; line-height: 1.4; }
.acc-section { border-top: 1px solid var(--line-soft); padding: 12px 0 4px; }
.acc-section:first-child { border-top: 0; }
.acc-section h3 { margin: 0 0 8px; font-size: 13px; font-weight: 650; }
.acc-section .dlg-lines { margin: 0; }
.acc-list { display: flex; flex-direction: column; gap: 2px; }
.acc-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.acc-item b { font-weight: 600; }
.acc-item small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.acc-item-quiet b { font-weight: 540; color: var(--ink-2); }
.acc-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--good-soft); color: var(--good-ink); font-size: 11.5px; font-weight: 600; }
.acc-form { display: grid; gap: 9px; margin-top: 8px; }
.acc-form[hidden] { display: none; }
.acc-row-actions { display: flex; gap: 8px; margin-top: 6px; }
.acc-actions .btn { min-width: 0; }
.ok { color: var(--good-ink); }

/* ——— правка заявки и история версий ——— */
.order-edit-dialog { width: min(860px, calc(100vw - 24px)); }
.oe-table { font-size: 13px; }
.oe-table th, .oe-table td { padding: 6px 6px; vertical-align: top; text-align: left; white-space: nowrap; }
.oe-table input[type="number"] { width: 70px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 0 7px; font: inherit; font-variant-numeric: tabular-nums; }
.oe-table input[type="number"]:disabled { opacity: .45; }
.oe-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); margin-top: 7px; }
.oe-table small { display: block; margin: 4px 0 2px; font-size: 11px; color: var(--ink-3); }
.oe-table tr.locked td { color: var(--ink-3); }
.oe-pork { margin: 0 0 8px; }
.oe-comment { margin-top: 12px; }
.oe-comment textarea, .oe-decide textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 8px 10px; font: inherit; font-size: 13.5px; resize: vertical; }
.oe-history { margin-top: 12px; }
.order-history-title { margin: 10px 0 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.oe-rev { border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; font-size: 13px; background: var(--surface); }
.oe-rev.pending { border-color: color-mix(in srgb, var(--warning-ink) 40%, var(--line)); }
.oe-rev-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--ink-2); font-size: 12.5px; }
.oe-rev-days { margin: 6px 0 0; padding-left: 18px; line-height: 1.45; }
.oe-rev-note { margin: 6px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.4; }
.oe-decide { margin-top: 8px; display: grid; gap: 6px; }
.oe-decide-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 600px) {
  .oe-table thead { display: none; }
  .oe-table, .oe-table tbody { display: block; }
  .oe-table tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .oe-table td { padding: 0; }
  .oe-table td.oe-date { grid-column: 1 / -2; font-weight: 620; align-self: center; }
  .oe-table td.oe-mode { grid-column: -2 / -1; justify-self: end; align-self: center; }
  .oe-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
  .oe-table input[type="number"] { width: 100%; }
  .oe-table input[type="checkbox"] { margin-top: 4px; }
}

/* Панель «Отправить» только на вкладке новой заявки. */
.submit-dock.off-view { display: none; }

/* Пальцем по мелким кнопкам не попасть: на сенсорных экранах минимум 40 пикселей. */
@media (pointer: coarse) {
  .btn-sm, .btn-quiet, .segmented button, .chip, .toggle-chip, .stat-chip, .help-btn, .theme-btn { min-height: 40px; }
  .theme-btn { min-width: 40px; }
  .row-actions .btn-quiet { padding: 6px 2px; }
  .stepper input, .oe-table input[type="number"] { min-height: 42px; font-size: 16px; }
  .sheet-close { min-width: 40px; min-height: 40px; }
}

/* ——— памятка ——— */
.help-tabs { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.help-tabs button { font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; min-height: 38px; }
.help-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.help-lead { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.help-demo-btn { width: 100%; justify-content: center; min-height: 44px; margin-bottom: 6px; text-decoration: none; }
.help-demo { margin: 0 0 14px; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }
.help-demo.on { color: var(--accent-ink); background: var(--accent-soft); padding: 9px 11px; border-radius: 10px; }
.help-step p { line-height: 1.5; font-size: 13.5px; }
.help-shot { margin: 8px 0 10px; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--plane); }
.help-shot img { display: block; width: 100%; height: auto; }
.help-table { overflow-x: auto; margin: 6px 0 10px; }
.help-table table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.help-table th, .help-table td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); line-height: 1.4; }
.help-table th { color: var(--ink-3); font-weight: 600; }
.help-faq-title { margin: 18px 0 8px; font-size: 14px; }

/* ——— учебный режим ——— */
.demo-bar { position: relative; z-index: 90; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 8px 14px; background: #FFF4D6; color: #5A4300; border-bottom: 1px solid #F0D89A; font-size: 13px; line-height: 1.35; }
.demo-bar .demo-actions { display: inline-flex; gap: 10px; align-items: center; }
.demo-bar .btn-quiet { color: #5A4300; text-decoration: underline; text-underline-offset: 3px; }
:root[data-theme="dark"] .demo-bar { background: #3A3016; color: #F3DFA6; border-color: #5C4B1F; }
:root[data-theme="dark"] .demo-bar .btn-quiet { color: #F3DFA6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-bar { background: #3A3016; color: #F3DFA6; border-color: #5C4B1F; } :root:not([data-theme="light"]) .demo-bar .btn-quiet { color: #F3DFA6; } }

/* Кнопки памятки и учебного режима на странице входа. */
.gate-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.gate-extra .btn { min-height: 42px; text-align: center; text-decoration: none; font-size: 13px; line-height: 1.25; }
@media (max-width: 420px) { .gate-extra { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  .demo-bar { padding: 6px 12px; font-size: 12px; gap: 6px; }
  .demo-bar .demo-note { display: none; }
  .demo-bar .btn-sm { min-height: 32px; padding: 4px 10px; }
}

/* ——— ручные статусы, переписка, уведомления ——— */

.badge.mstatus { background: color-mix(in srgb, var(--ms) 14%, var(--surface)); color: color-mix(in srgb, var(--ms) 58%, var(--ink)); }
.badge.mstatus .dot { background: var(--ms); }
.badge.staff-made { background: var(--accent-soft); color: var(--accent-ink); }
.ms-picker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.ms-picker select { font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; max-width: 220px; }

.thread { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.thread-title { font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-3); text-transform: uppercase; margin-bottom: 8px; }
.thread-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.thread-item { max-width: 88%; padding: 8px 11px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.45; }
.thread-item.executor { align-self: flex-start; border-bottom-left-radius: 4px; }
.thread-item.customer { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.thread-item.pending { opacity: .62; }
.thread-head { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.thread-head b { color: var(--ink-2); font-weight: 600; }
.thread-body { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.thread-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.thread-form textarea { flex: 1; min-width: 0; resize: vertical; min-height: 40px; max-height: 160px; font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.thread-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.thread-hint { font-size: 11.5px; color: var(--ink-3); margin: 5px 0 0; }
@media (pointer: coarse) { .thread-hint { display: none; } .thread-form textarea { font-size: 16px; } }

.notif-bell { position: relative; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); border: 1px solid var(--line); background: var(--surface); flex: none; }
.notif-count { position: absolute; top: -5px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.notif-bell.has-unread { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.notif-bell.has-unread .notif-count { animation: notifPulse 2.4s var(--ease) infinite; }
@keyframes notifPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(208, 59, 59, .45); } 50% { box-shadow: 0 0 0 5px rgba(208, 59, 59, 0); } }
@media (prefers-reduced-motion: reduce) { .notif-bell.has-unread .notif-count { animation: none; } }
.notif-panel { position: fixed; z-index: 85; top: calc(var(--safe-top) + 56px); right: 12px; width: min(380px, calc(100vw - 24px)); max-height: min(70dvh, 520px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); padding: 8px; }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; }
.notif-panel .card-note { padding: 4px 8px 10px; }
.notif-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; font: inherit; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .notif-item:hover { background: var(--surface-2); } }
.notif-item b { font-size: 13px; color: var(--ink); font-weight: 600; }
.notif-item span { font-size: 12.5px; overflow-wrap: anywhere; }
.notif-item time { font-size: 11px; color: var(--ink-3); }
.notif-item.unread { background: var(--accent-soft); }
.notif-bell.fresh .notif-count { animation: notifPulse 900ms var(--ease-out) 2; }
@media (prefers-reduced-motion: reduce) { .notif-bell.fresh .notif-count { animation: none; } }

/* Три равноправных способа входа: одинаковый размер и вес, Telegram отличается только цветом. */
.gate-methods { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 6px 0 14px; }
.gate-method-slot { display: contents; }
.gate-method-slot[hidden] { display: none; }
.gate-method { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .gate-method:hover { background: var(--surface-2); text-decoration: none; } }
.gate-method[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.gate-method.tg { background: #229ED9; border-color: #229ED9; color: #fff; }
@media (hover: hover) and (pointer: fine) { .gate-method.tg:hover { background: #16739F; color: #fff; } }
@media (max-width: 380px) { .gate-methods { grid-auto-flow: row; } }

/* Отмена заявки */
.btn-danger { background: var(--critical); color: #fff; border: 1px solid var(--critical); }
@media (hover: hover) and (pointer: fine) { .btn-danger:hover { background: var(--critical-ink); } }
.btn-danger-ghost { color: var(--critical-ink); }
.btn-danger-quiet { color: var(--critical-ink) !important; }
:root[data-theme="dark"] .btn-danger-ghost, :root[data-theme="dark"] .btn-danger-quiet { color: #F19C9C !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger-ghost, :root:not([data-theme="light"]) .btn-danger-quiet { color: #F19C9C !important; } }
.oc-lines p { margin: 8px 0; line-height: 1.5; font-size: 14px; }
.order-cancel-dialog label.field { margin-top: 10px; }
.order-cancel-dialog .oc-restore { margin: 10px 0 4px; align-items: flex-start; }
.order-cancel-dialog .oc-restore span { font-size: 13.5px; line-height: 1.45; }
.gate-method.max { background: #4B3FE0; border-color: #4B3FE0; color: #fff; }
@media (hover: hover) and (pointer: fine) { .gate-method.max:hover { background: #3F34C4; color: #fff; } }
@media (max-width: 520px) { .gate-methods { grid-auto-flow: row; grid-template-columns: 1fr 1fr; } }
.acc-item-link small.ok { color: var(--good-ink); }

/* ——— быстрое заполнение и шаблоны ——— */
.quick-fill { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -2px 0 8px; }
.quick-fill label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.quick-fill input { width: 92px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; font-size: 16px; font-weight: 600; text-align: center; }
.quick-fill .btn { min-height: 40px; }
.quick-fill .card-note { flex: 1 1 180px; line-height: 1.35; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.preset-chips:empty { display: none; }
.preset-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.preset-chip button { border: 0; background: transparent; color: var(--ink); font: inherit; cursor: pointer; }
.preset-chip [data-preset] { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px; min-height: 44px; justify-content: center; text-align: left; }
.preset-chip [data-preset] b { font-size: 13.5px; font-weight: 600; }
.preset-chip [data-preset] small { font-size: 11.5px; color: var(--ink-3); }
@media (hover: hover) and (pointer: fine) { .preset-chip [data-preset]:hover { background: var(--surface-2); } }
.preset-chip .preset-del { padding: 0 10px; color: var(--ink-3); border-left: 1px solid var(--line-soft); font-size: 15px; }
.preset-chip .preset-del[data-armed="1"] { color: var(--critical-ink); font-size: 12px; }
.preset-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; width: 100%; }
.preset-form input { flex: 1 1 180px; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; font-size: 16px; }
.net-banner { margin-bottom: 10px; }
.net-banner p { margin: 4px 0 0; line-height: 1.45; }
.stale-note { margin: 0 0 10px; }

/* На узком экране подпись роли не помещается рядом с заголовком; роль видна в профиле. */
@media (max-width: 430px) { .hdr-role { display: none; } }
.month-nav .chip svg { display: block; }

/* ——— Вид 2026-10: «вагонная табличка» ———
   Оболочка цвета вагонного сурика, графитовые действия, трафаретные цифры в показателях.
   Цвета и шрифты задаются токенами в начале файла; здесь — форма компонентов. */

td, th, .num, .price-chip, .stat-chip b, .kpi-value, .bar-value, .day-sum, .dock-main { font-variant-numeric: tabular-nums; }
:where(:root[data-look="plate"]) ::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
:where(:root[data-look="plate"]) h1, :where(:root[data-look="plate"]) h2, :where(:root[data-look="plate"]) h3 { letter-spacing: -0.01em; }
:where(:root[data-look="plate"]) input, :where(:root[data-look="plate"]) textarea { caret-color: var(--accent); }
:where(:root[data-look="plate"]) * { scrollbar-color: var(--axis) transparent; }

/* Подписи капителью с разрядкой — шаблонный приём; ранг держит вес. */
:where(:root[data-look="plate"]) .hdr-role, :where(:root[data-look="plate"]) .eyebrow, :where(:root[data-look="plate"]) .req-title { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; }

/* Действия: графит. Выбранное: тон сурика. */
:where(:root[data-look="plate"]) .btn-primary { background: var(--action); color: var(--on-action); }
@media (hover: hover) and (pointer: fine) { :where(:root[data-look="plate"]) .btn-primary:hover { background: var(--action-hover); } }
:where(:root[data-look="plate"]) .btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { :where(:root[data-look="plate"]) .btn-ghost:hover { background: var(--surface-2); } }
:where(:root[data-look="plate"]) .btn:active { transform: scale(.97); transition-duration: 100ms; }
:where(:root[data-look="plate"]) .segmented { border-radius: 8px; padding: 2px; gap: 2px; }
:where(:root[data-look="plate"]) .segmented button { border-radius: 6px; }
:where(:root[data-look="plate"]) .segmented button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--line); }
:where(:root[data-look="plate"]) .stat-chip, :where(:root[data-look="plate"]) .price-chip { border-radius: 6px; }
:where(:root[data-look="plate"]) .stat-chip[aria-pressed="true"] { border-color: var(--accent); }
:where(:root[data-look="plate"]) .switch input:checked + .track { background: var(--accent); }
:where(:root[data-look="plate"]) .field input, :where(:root[data-look="plate"]) .field textarea, :where(:root[data-look="plate"]) .search { border-radius: 6px; }
:where(:root[data-look="plate"]) .day { border-radius: 8px; }
:where(:root[data-look="plate"]) .day.late { border-color: var(--serious); box-shadow: inset 3px 0 0 -2px var(--serious); }

/* Шапка: плотная, без стекла. */
:where(:root[data-look="plate"]) .hdr { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: var(--line); }
:where(:root[data-look="plate"]) .hdr-top h1 { font-family: var(--font-plate); font-stretch: 88%; font-weight: 600; letter-spacing: 0; font-size: 19px; }
:where(:root[data-look="plate"]) #price-chips { flex-wrap: wrap; overflow: visible; max-height: 120px; row-gap: 6px; }
:where(:root[data-look="plate"]) .price-chip.total { background: var(--accent-soft); color: var(--accent-ink); }

/* Оболочка: рейл и нижнее меню цвета сурика. */
:where(:root[data-look="plate"]) .tabbar { background: var(--shell); border-top: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
:where(:root[data-look="plate"]) .tab { color: var(--on-shell-2); border-radius: 6px; }
:where(:root[data-look="plate"]) .tab[aria-current="page"] { color: var(--on-shell); background: var(--shell-2); box-shadow: inset 0 -2px 0 var(--on-shell); }
:where(:root[data-look="plate"]) .tabbar .profile-btn { background: transparent; border-color: rgba(255, 255, 255, .22); color: var(--on-shell); }
@media (min-width: 1040px) {
  :where(:root[data-look="plate"]) .sidebar { background: var(--shell); border-right: 0; color: var(--on-shell); }
  :where(:root[data-look="plate"]) .tab-wide[aria-current="page"] { box-shadow: inset 3px 0 0 -1px var(--on-shell); }
  :where(:root[data-look="plate"]) .tab-wide:hover:not([aria-current="page"]) { background: rgba(255, 255, 255, .07); color: var(--on-shell); }
  :where(:root[data-look="plate"]) .side-foot { border-top-color: rgba(255, 255, 255, .16); }
  :where(:root[data-look="plate"]) .side-foot .profile-btn { background: transparent; border-color: rgba(255, 255, 255, .22); color: var(--on-shell); }
  :where(:root[data-look="plate"]) .side-foot .theme-btn, :where(:root[data-look="plate"]) .sidebar .theme-btn { background: transparent; border-color: rgba(255, 255, 255, .22); color: var(--on-shell); }
}
:where(:root[data-look="plate"]) .side-brand .mark { background: var(--on-shell); }
:where(:root[data-look="plate"]) .side-brand b { font-family: var(--font-plate); font-stretch: 88%; font-weight: 600; letter-spacing: .01em; font-size: 15.5px; color: var(--on-shell); }
:where(:root[data-look="plate"]) .side-brand span { color: var(--on-shell-2); font-family: var(--font); font-stretch: 100%; letter-spacing: 0; }

/* Табличка: показатели одной строкой ячеек, цифры трафаретом. */
:where(:root[data-look="plate"]) .plate {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--shell); color: var(--on-shell);
  border-radius: 6px; overflow: hidden;
}
:where(:root[data-look="plate"]) .plate > * { padding: 11px 14px 12px; border-top: 1px solid rgba(255, 255, 255, .14); border-left: 1px solid rgba(255, 255, 255, .14); min-width: 0; }
:where(:root[data-look="plate"]) .plate > :nth-child(-n+2) { border-top: 0; }
:where(:root[data-look="plate"]) .plate > :nth-child(2n+1) { border-left: 0; }
@media (min-width: 620px) {
  :where(:root[data-look="plate"]) .plate { grid-template-columns: repeat(var(--plate-cols, 4), minmax(0, 1fr)); }
  :where(:root[data-look="plate"]) .plate > * { border-top: 0; border-left: 1px solid rgba(255, 255, 255, .14); }
  :where(:root[data-look="plate"]) .plate > :first-child { border-left: 0; }
}
:where(:root[data-look="plate"]) .plate-label, :where(:root[data-look="plate"]) .plate .kpi-label { font-size: 12.5px; font-weight: 500; color: var(--on-shell-2); }
:where(:root[data-look="plate"]) .plate-value, :where(:root[data-look="plate"]) .plate .kpi-value { font-family: var(--font-digits); font-stretch: 78%; font-weight: 600; font-size: 34px; line-height: 1.1; margin-top: 4px; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:where(:root[data-look="plate"]) .plate-sub, :where(:root[data-look="plate"]) .plate .kpi-sub { font-size: 12.5px; color: var(--on-shell-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
:where(:root[data-look="plate"]) .plate button, :where(:root[data-look="plate"]) .plate [role="button"] { text-align: left; color: inherit; cursor: pointer; transition: background var(--fast); }
@media (hover: hover) and (pointer: fine) { :where(:root[data-look="plate"]) .plate [role="button"]:hover, :where(:root[data-look="plate"]) .plate button:hover { background: var(--shell-2); } }
:where(:root[data-look="plate"]) .plate :focus-visible { outline: 2px solid var(--on-shell); outline-offset: -3px; }
:where(:root[data-look="plate"]) .plate .kpi { background: none; border-radius: 0; box-shadow: none; animation: none; border-color: rgba(255, 255, 255, .14); border-style: solid; border-width: 0; }
:where(:root[data-look="plate"]) .plate .kpi.accent { background: none; color: inherit; }
@media (max-width: 619px) {
  :where(:root[data-look="plate"]) .plate .kpi:nth-child(n+3) { border-top-width: 1px; }
  :where(:root[data-look="plate"]) .plate .kpi:nth-child(2n) { border-left-width: 1px; }
}
@media (min-width: 620px) { :where(:root[data-look="plate"]) .plate .kpi + .kpi { border-left-width: 1px; } }
.btn-icon-text { display: inline-flex; align-items: center; gap: 6px; }

/* Рейл прижат к левому краю, рабочая колонка по центру оставшегося места. */
@media (min-width: 1040px) {
  :where(:root[data-look="plate"]) .app { justify-content: flex-start; }
  :where(:root[data-look="plate"]) .shell { margin-inline: auto; }
}
@media (min-width: 620px) { :where(:root[data-look="plate"]) .plate .kpi-value, :where(:root[data-look="plate"]) .plate-value { font-size: 40px; } }

/* Возвраты к табличке для правок, которые в привычном виде откатаны. */
:where(:root[data-look="plate"]) .progress { box-shadow: none; }
:where(:root[data-look="plate"]) .hdr-strip { max-height: 50px; padding-block: 2px; }
:where(:root[data-look="plate"]) .notif-toast { border-left-width: 1px; border-left-color: var(--line); border-radius: 8px; }

/* Настройки: подпись под выбором вида. */
.acc-section .segmented + .card-note { margin-top: 8px; }

/* Вышла новая версия, а человек уже работает: кнопка вместо самовольной перезагрузки. */
.update-bar {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-bottom)); z-index: 210;
  transform: translate(-50%, 14px); opacity: 0;
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100% - 32px);
  padding: 8px 8px 8px 14px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  font-size: 13.5px;
  transition: opacity var(--mid), transform var(--mid);
}
.update-bar.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 1040px) { .update-bar { bottom: 24px; } }

/* ——— Работники и QR (тестовый модуль) ——— */
.pass-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); margin-top: 8px; }
.pass-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pass-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pass-meals { display: flex; flex-wrap: wrap; gap: 6px; }
.pass-check { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 99px; font-size: 13.5px; cursor: pointer; background: var(--surface); }
.pass-check input { accent-color: var(--accent); }
.pass-list { display: grid; gap: 2px; }
.pass-item { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.pass-item:last-child { border-bottom: 0; }
.pass-item.off .pass-main b { color: var(--ink-3); }
.pass-main { min-width: 0; }
.pass-main small { display: block; color: var(--ink-3); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.pass-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.pass-item [data-pass-meals] { grid-column: 1 / -1; }
.pass-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pass-table-wrap { overflow-x: auto; }
.pass-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pass-table th, .pass-table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.pass-table th { font-size: 12px; color: var(--ink-3); font-weight: 560; }
.pass-table td small { display: block; color: var(--warning-ink); font-size: 11.5px; }
.pass-table td.over { color: var(--critical-ink); }
.pass-table td.muted { color: var(--ink-3); }

/* ——— Шрифт Geist (проба) ———
 * Включается в настройках («Шрифт»), хранится на устройстве: атрибут data-font="geist" на <html>
 * ставит скрипт в <head>. Geist — текст, Geist Mono — числа, время, коды и короткие служебные подписи.
 * Правила с :root[data-font] сильнее обычных, поэтому их можно держать здесь, а не в каждом файле. */
:root[data-font="geist"] {
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-num: "Geist Num", "Geist", system-ui, sans-serif;
  --font-code: var(--font-num);
  --font-plate: var(--font);
  --font-digits: var(--font-num);
}
:root[data-font="geist"] :is(h1, h2, h3) { letter-spacing: -.015em; }

/* числа */
:root[data-font="geist"] :is(
  .num, time, kbd, .key-code, .kpi-value, .mini-value, .plate-value, .bar-value, .day-sum, .dock-main,
  .stat-chip b, .price-chip b, .meal-top span, .item-side, .picker-row b, .cred-row b, .pass-stats b,
  .totals td:not(:first-child), .grid-table td:not(:first-child),
  .qp-kpis b, .qp-tag.mono, .qp-htime, .qp-mx-day b, .qp-pop-row b, .qp-pf-num, .qt-count,
  .qa-meal-num, .qa-workers b, .qa-flags b, .scan-log-at
) { font-family: var(--font-num); letter-spacing: -.01em; }
:root[data-font="geist"] :is(.kpi-value, .mini-value, .qp-kpis b) { letter-spacing: -.03em; font-weight: 560; }

/* короткие служебные подписи */
:root[data-font="geist"] :is(
  .eyebrow, .hdr-role, .req-title, .details-section-title, .docs-section-title, .list-group-title, .thread-title,
  .badge, .totals thead th, .grid-table thead th, .pass-table th
) { font-family: var(--font-num); letter-spacing: .02em; font-weight: 520; }


/* ——— Статус в шапке (sync.js, appupdate.js) ———
 * Ничего не ложится поверх интерфейса: чтение — тонкая линия по нижнему краю шапки (через 600 мс),
 * сохранение, «Сохранено», «Нет связи», новая версия — маленькая плашка в строке шапки. */
.hdr::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent 0, var(--accent) 50%, transparent 100%) no-repeat;
  background-size: 40% 100%; background-position: -40% 0;
  opacity: 0; transition: opacity 200ms var(--ease-out);
}
.hdr[data-loading]::after { opacity: 1; animation: syncRun 1.1s linear infinite; }
@keyframes syncRun { to { background-position: 140% 0; } }
.hdr-status {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-width: 0; max-width: 42vw;
  height: 26px; padding: 0 9px 0 7px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  color: var(--ink-2); font-size: 12.5px; font-weight: 560; white-space: nowrap;
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
@starting-style { .hdr-status { opacity: 0; transform: translateY(-2px); } }
.hdr-status[hidden] { display: none; }
.hdr-status-mark { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; flex: none; }
.hdr-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: syncDot 1.1s var(--ease-in-out, ease-in-out) infinite; }
@keyframes syncDot { 50% { opacity: .35; } }
.hdr-status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hdr-status[data-kind="done"] { color: var(--good-ink); }
.hdr-status[data-kind="off"] { background: var(--warning-soft); border-color: transparent; color: var(--warning-ink); }
.hdr-status-retry { flex: none; margin-left: 2px; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; background: transparent; color: inherit; font: inherit; font-size: 12px; cursor: pointer; }
.hdr-update { flex: none; height: 26px; padding: 0 11px; border-radius: 99px; border: 0; background: var(--accent); color: var(--on-accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: opacity 160ms var(--ease-out), transform 120ms var(--ease-out); }
@starting-style { .hdr-update { opacity: 0; transform: translateY(-2px); } }
.hdr-update:active { transform: scale(.97); }
/* На телефоне в строке шапки тесно: остаётся значок (точка, галочка, «нет связи»), слова — в подсказке. */
@media (max-width: 560px) {
  .hdr-status { width: 26px; padding: 0; justify-content: center; gap: 0; }
  .hdr-status[data-kind="off"] { width: auto; padding: 0 3px 0 7px; gap: 4px; }
  .hdr-status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hdr-update { padding: 0 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .hdr[data-loading]::after { animation: none; background-position: 30% 0; }
  .hdr-status-dot { animation: none; }
}
@media print { .hdr::after, .hdr-status, .hdr-update { display: none !important; } }


/* ——— Жидкое стекло (навык animate, references/liquid-glass.md, раздел «Websites») ———
 * Шапка и нижнее меню — лёгкое стекло: размытие 8 px вместо прежних 22, мягкий свет в левом верхнем углу,
 * блик по верхней кромке. Над ними проходит текст списков, поэтому подкраска плотная (--glass).
 * Плавающий док отправки — остров: тень, блик по краю, а в Chromium ещё и преломление у кромки (glass.js). */
:root {
  --lg-hi: rgb(255 255 255 / 85%);
  --lg-hi-low: rgb(255 255 255 / 40%);
  --lg-edge: rgb(20 20 20 / 9%);
  --lg-drop: 0 10px 28px -16px rgb(20 20 20 / 32%);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --lg-hi: rgb(255 255 255 / 22%);
    --lg-hi-low: rgb(255 255 255 / 8%);
    --lg-edge: rgb(0 0 0 / 40%);
    --lg-drop: 0 12px 30px -14px rgb(0 0 0 / 60%);
  }
}
:root[data-theme="dark"] {
  --lg-hi: rgb(255 255 255 / 22%);
  --lg-hi-low: rgb(255 255 255 / 8%);
  --lg-edge: rgb(0 0 0 / 40%);
  --lg-drop: 0 12px 30px -14px rgb(0 0 0 / 60%);
}
/* Только в основном виде: в виде «Плашка» шапка и меню сплошные. */
:root:not([data-look="plate"]) :is(.hdr, .tabbar) {
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--lg-hi) 20%, transparent) 0%, transparent 46%),
    var(--glass);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  backdrop-filter: blur(8px) saturate(160%);
}
:root:not([data-look="plate"]) .tabbar { box-shadow: inset 0 1px 0 var(--lg-hi-low); }
.submit-dock-inner {
  background:
    radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--lg-hi) 36%, transparent) 0%, transparent 46%),
    var(--glass);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  backdrop-filter: blur(8px) saturate(160%);
  border-color: transparent;
  box-shadow:
    inset 1px 1.5px 0 var(--lg-hi),
    inset -1px -1px 0 var(--lg-hi-low),
    0 0 0 .5px var(--lg-edge),
    var(--lg-drop);
}
/* Где браузер умеет преломление: картинку у кромки изгибает фильтр, по краю — кольцо блика,
 * яркое в левом верхнем и правом нижнем углу; ровная белая обводка смотрелась бы дёшево. */
html[data-lg-refract] .submit-dock-inner {
  position: relative;
  box-shadow:
    inset 0 12px 18px -16px var(--lg-hi),
    inset 0 -12px 18px -16px rgb(0 0 0 / 22%),
    0 0 0 .5px var(--lg-edge),
    var(--lg-drop);
}
html[data-lg-refract] .submit-dock-inner::after {
  content: ""; position: absolute; inset: 0; z-index: 2; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(72px 72px at 0 0, var(--lg-hi), transparent 70%),
    radial-gradient(72px 72px at 100% 100%, color-mix(in srgb, var(--lg-hi) 70%, transparent), transparent 70%),
    linear-gradient(var(--lg-hi-low), var(--lg-hi-low));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  :root:not([data-look="plate"]) :is(.hdr, .tabbar), .submit-dock-inner { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  :root:not([data-look="plate"]) :is(.hdr, .tabbar), .submit-dock-inner { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ——— Подсказки кодом (hints.js): полоски шагов, живой макет экрана, подпись «1 из N» ———
 * Все цвета — переменные темы, поэтому в тёмной теме подсказка тёмная, в светлой светлая.
 * Движение — transform и opacity, кривая --ease-out; при «уменьшить движение» всё стоит. */
.hint { --h-ease: var(--ease-out, cubic-bezier(.23, 1, .32, 1)); display: block; position: relative; margin: 10px 0 4px; padding: 10px 12px 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft, var(--line)); color: var(--ink); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.hint:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hst-bars { display: flex; gap: 4px; margin-bottom: 9px; }
.hst-bars i { flex: 1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.hst-bars b { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.hm-screen { position: relative; overflow: hidden; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); min-height: 176px; }
.hm-content { display: flex; flex-direction: column; justify-content: center; gap: 7px; min-height: 176px; padding: 12px; box-sizing: border-box; opacity: 0; transform: translateY(6px); }
.hm-content { transform: translateY(4px); }
.hm-content.in { opacity: 1; transform: none; transition: opacity 220ms var(--h-ease), transform 220ms var(--h-ease); }
.hm-title { font-size: 13px; font-weight: 640; color: var(--ink); }
.hm-field { display: grid; gap: 3px; }
.hm-label { font-size: 11px; color: var(--ink-3); }
.hm-input { min-height: 28px; display: flex; align-items: center; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; font-family: var(--font-num, inherit); color: var(--ink); }
.hm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; font-weight: 560; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-soft, var(--line)); transition: transform 120ms var(--h-ease); }
.hm-btn.primary { background: var(--accent); color: var(--on-accent, #fff); border-color: transparent; }
.hm-btn.pressed, .hm-chip.pressed, .hm-row.pressed, .hm-msg-btns span.pressed, .hm-icon.pressed, .hm-qr.pressed { transform: scale(.97); }
.hm-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 7px 9px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; transition: transform 120ms var(--h-ease); }
.hm-row > span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.hm-row svg { flex: none; color: var(--ink-3); }
.hm-row small { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.hm-row.wait { box-shadow: inset 3px 0 0 var(--warning); }
.hm-row.good { box-shadow: inset 3px 0 0 var(--good, var(--accent)); }
.hm-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.hm-chip { padding: 4px 9px; border-radius: 99px; font-size: 11.5px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line-soft, var(--line)); transition: transform 120ms var(--h-ease); }
.hm-chip.on { background: var(--accent); color: var(--on-accent, #fff); border-color: transparent; }
.hm-qr { display: grid; justify-items: center; gap: 4px; padding: 6px 0; color: var(--ink); transition: transform 120ms var(--h-ease); }
.hm-qr small { font-size: 11.5px; color: var(--ink-3); }
.hm-icon { display: grid; justify-items: center; gap: 6px; padding: 4px 0; text-align: center; transition: transform 120ms var(--h-ease); }
.hm-icon > span { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.hm-icon.good > span { background: var(--good-soft, var(--accent-soft)); color: var(--good-ink, var(--accent)); }
.hm-icon.warn > span { background: var(--warning-soft); color: var(--warning-ink); }
.hm-icon.bad > span { background: var(--critical-soft); color: var(--critical-ink); }
.hm-icon.mute > span { background: var(--surface-2); color: var(--ink-3); }
.hm-icon small { font-size: 12px; color: var(--ink-2); max-width: 30ch; }
.hm-bars { display: flex; align-items: flex-end; gap: 5px; height: 72px; padding: 0 2px; }
.hm-bars i { flex: 1; border-radius: 4px 4px 2px 2px; background: var(--line); }
.hm-bars i.on { background: var(--accent); }
.hm-note { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }
.hm-ok { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--good-ink); }
.hm-warn { padding: 6px 9px; border-radius: 8px; background: var(--warning-soft); color: var(--warning-ink); font-size: 12px; }
.hm-msg { display: grid; gap: 4px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; }
.hm-msg small { color: var(--ink-2); white-space: pre-line; }
.hm-msg-btns { display: flex; gap: 6px; margin-top: 4px; }
.hm-msg-btns span { flex: 1; text-align: center; padding: 5px 0; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); font-size: 12px; transition: transform 120ms var(--h-ease); }
.hint .hl { outline: 2px solid var(--accent); outline-offset: 2px; }
.hm-finger { position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; box-sizing: border-box; background: color-mix(in srgb, var(--accent) 28%, transparent); border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.hm-cap { display: flex; gap: 10px; align-items: baseline; margin: 9px 2px 0; min-height: 2.8em; font-size: 13.5px; line-height: 1.4; color: var(--ink); }
.hm-cap b { flex: none; font-size: 11.5px; font-weight: 560; color: var(--ink-3); font-family: var(--font-num, inherit); }
.hst-nav { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin: 2px 2px 0; }
@media (prefers-reduced-motion: reduce) {
  .hm-content, .hm-content.in, .hm-finger, .hm-btn, .hm-row, .hm-chip, .hm-icon, .hm-qr { transition: none; }
  .hm-content { opacity: 1; transform: none; }
  .hm-finger { display: none; }
}

/* ——— «Два телефона» в подсказках раздачи (hints.js, part 'duo'): слева экран повара, справа работник ———
 * Телефон работника подносят к камере (.near): движение по экрану — ease-in-out, 520 мс.
 * Луч сканера — постоянное движение, linear. При «уменьшить движение» всё стоит. */
.hd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; width: 100%; max-width: 330px; margin: 0 auto; }
.hd-side { margin: 0; display: grid; justify-items: center; gap: 5px; min-width: 0; }
.hd-side figcaption { font-size: 10.5px; color: var(--ink-3); text-align: center; line-height: 1.2; }
.hd-phone { width: 100%; max-width: 132px; aspect-ratio: 9 / 15.5; padding: 4px; border-radius: 16px; background: var(--ink); box-sizing: border-box; }
.hd-screen { height: 100%; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 8px 7px; box-sizing: border-box; overflow: hidden; color: var(--ink); text-align: center; }
.hd-screen .hm-input { min-height: 22px; font-size: 11px; padding: 0 6px; justify-content: center; }
.hd-screen .hm-label, .hd-sub, .hd-cap { font-size: 10px; color: var(--ink-3); line-height: 1.25; }
.hd-screen .hm-chip { align-self: center; font-size: 10px; padding: 2px 7px; }
.hd-btn { min-height: 24px; padding: 0 6px; font-size: 10.5px; border-radius: 7px; gap: 4px; }
.hd-name { font-size: 12px; line-height: 1.2; }
.hd-view { position: relative; align-self: center; width: 76%; aspect-ratio: 1; border-radius: 8px; background: color-mix(in srgb, var(--ink) 6%, var(--surface)); display: grid; place-items: center; overflow: hidden; }
.hd-view > i { position: absolute; width: 22%; height: 22%; border: 2px solid var(--accent); }
.hd-view > i:nth-child(1) { top: 6%; left: 6%; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.hd-view > i:nth-child(2) { top: 6%; right: 6%; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.hd-view > i:nth-child(3) { bottom: 6%; left: 6%; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.hd-view > i:nth-child(4) { bottom: 6%; right: 6%; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }
.hd-qr { color: #111; line-height: 0; background: #fff; border-radius: 4px; padding: 3px; }
.hd-qr.big { padding: 6px; border-radius: 6px; }
.hd-beam { position: absolute; left: 10%; right: 10%; top: 12%; height: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: hdBeam 1.3s linear infinite alternate; }
@keyframes hdBeam { to { transform: translateY(calc(76cqh)); } }
.hd-view { container-type: size; }
.hd-band { display: flex; align-items: center; justify-content: center; gap: 4px; margin: -8px -7px 2px; padding: 10px 4px; font-size: 12px; }
.hd-band.ok { background: var(--good-soft); color: var(--good-ink); }
.hd-band.bad { background: var(--critical-soft); color: var(--critical-ink); }
.hd-band.over { background: color-mix(in srgb, var(--scan-over, #5B3CC4) 16%, var(--surface)); color: var(--scan-over, #5B3CC4); }
.hd-entry { display: grid; gap: 4px; margin-top: 4px; }
.hd-paper { background: #fff; color: #111; align-items: center; }
.hd-paper small { font-size: 9.5px; color: #555; white-space: nowrap; }
.hd-worker { transform-origin: 50% 90%; transition: transform 520ms var(--ease-in-out, cubic-bezier(.77, 0, .175, 1)); }
.hd.near .hd-worker { transform: translateX(-16%) rotate(-9deg); }
.hd-person { width: 100%; max-width: 132px; aspect-ratio: 9 / 15.5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.hd-ava { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.hd-say { position: relative; max-width: 100%; padding: 6px 9px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink, var(--accent)); font-size: 11.5px; line-height: 1.3; }
.hd-say::before { content: ''; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.hint .hm-content:has(.hd) { padding: 10px 8px; }
@media (prefers-reduced-motion: reduce) {
  .hd-beam { animation: none; top: 48%; }
  .hd-worker { transition: none; }
}

/* Внутри встроенного кабинета нет своей «Помощи», темы и профиля: они уже есть в шапке диспетчерской. */
html.embedded [data-help], html.embedded [data-theme-btn], html.embedded [data-profile] { display: none !important; }

/* Выпадающие списки в стиле сайта (окно списка в ui.js). */
select:not([multiple]) {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 28px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 9px center !important; background-size: 13px !important;
}
.ui-pop { position: fixed; z-index: 300; max-width: min(420px, calc(100vw - 16px)); max-height: min(320px, 60vh); overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 10px 28px rgb(0 0 0 / .2); opacity: 0; transform: scale(.97); transition: opacity 130ms var(--ease), transform 130ms var(--ease); }
.ui-pop.open { opacity: 1; transform: none; }
.ui-opt { display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.3; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.ui-opt.selected { color: var(--accent); font-weight: 600; }
.ui-opt.active { background: var(--surface-2); }
.ui-opt:disabled { color: var(--ink-3); cursor: default; }
@media (prefers-reduced-motion: reduce) { .ui-pop { transform: none; } }
