/* ScanTessera — дизайн-система этапа 11 (docs/этап-11-проект.md, раздел 2.1).
   Functional Minimalism: нейтральная палитра, акцент — фирменный синий, тонкие границы вместо теней,
   скругление 6–8 px, Inter, иконки Lucide. Две темы: светлая и ночной режим html.theme-dark (с 2026-11-28, этап 14;
   до этого — только светлая, решение владельца 2026-11-25).
   Всё, что меняется централизованно, — токены в :root; цвета, размеры и отступы — только через них.

   Разделы файла:
   1. Шрифт и токены          6. Меню, всплывающие панели, поиск
   2. Основа                   7. Карточка объекта, вкладки, сканы, записи
   3. Каркас (.app)            8. Слой совместимости: dialog.js и admin-ui.js
   4. Элементы управления      9. Страницы-карточки (.auth), индикатор загрузки, язык
   5. Показатели и таблица    10. Узкий экран (до 900 px) */

/* ---------- 1. Шрифт и токены ---------- */

/* Адреса шрифтов без версии: /static/fonts/ сервер отдаёт как неизменяемые (server/main.py,
   FreshStatic). Заменили шрифт — меняйте имя файла. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/inter/inter-cyrillic-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/inter/inter-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/inter/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/static/fonts/inter/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  /* Цвет */
  --c-bg: #ffffff;
  --c-bg-subtle: #fafafa;
  --c-sidebar: #f7f7f8;
  --c-hover: #f2f2f4;
  --c-active: #ebebef;
  --c-border: #e6e6ea;
  --c-border-strong: #d6d6dc;
  --c-text: #18181b;
  --c-text-2: #52525b;
  --c-text-3: #8a8a93;
  --c-on-brand: #ffffff;
  --c-brand: #3258ce;
  --c-brand-hover: #2848b0;
  --c-brand-soft: #eef2fc;
  --c-brand-line: #dbe3f8;
  --c-brand-text: #2a4bb5;
  --c-warn: #b45309;
  --c-warn-soft: #fdf5e6;
  --c-warn-line: #f2dfbd;
  --c-work: #d97706;
  --c-danger: #c62828;
  --c-danger-hover: #a91f1f;
  --c-danger-soft: #fdf1f1;
  --c-danger-line: #f3caca;
  --c-danger-focus: rgba(198, 40, 40, .2);
  --c-ok: #15803d;
  --c-ok-soft: #effaf2;
  --c-neutral-dot: #a1a1aa;
  --c-focus: rgba(50, 88, 206, .35);
  --c-avatar-bg: #e4e7f3;
  --c-avatar-text: #3a4a7a;
  --c-inverse: #18181b;
  --c-inverse-text: #ffffff;
  --c-inverse-muted: rgba(255, 255, 255, .7);
  --c-inverse-line: rgba(255, 255, 255, .16);
  --c-inverse-hover: rgba(255, 255, 255, .1);
  --c-inverse-danger: #fca5a5;
  --c-scrim: rgba(16, 16, 24, .16);
  --c-scrim-strong: rgba(16, 16, 24, .32);
  --c-chip-x-hover: rgba(50, 88, 206, .12);
  --c-sk-1: #f0f0f2;
  --c-sk-2: #f7f7f9;
  --c-thumb: #fafafa;
  /* Цвета логотипа — для знака из квадратов (.brand-anim). В интерфейсе не использовать; исключение —
     правая половина вьювера при сравнении (--v-pane-2, решение владельца 2026-11-28, этап 14) */
  --c-logo-blue: #335acf;
  --c-logo-accent: #a22b63;

  /* Типографика */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  /* Самый мелкий текст (подписи, счётчики, метки) — 12 px, как --fs-xs: при 11 px на мониторе
     с масштабом 100% его плохо читали (решение владельца 2026-11-26). Мельче 12 px текст не
     задавать; исключения — инициалы в круге аватара и число на углу значка аннотаций во вьювере */
  --fs-2xs: 12px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 22px;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* Размеры и отступы (шаг 4 px) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;
  --control-h: 32px;
  --control-h-sm: 28px;
  --control-h-lg: 36px;
  --row-h: 36px;
  --row-h-compact: 30px;
  --head-h: 34px;
  --head-h-compact: 30px;
  --icon: 16px;
  --icon-sm: 14px;
  --icon-lg: 18px;
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 52px;
  --topbar-h: 48px;
  --page-max: 1280px;
  --sheet-w: 440px;
  --dialog-w: 440px;
  --palette-w: 620px;
  --auth-w: 380px;
  --auth-w-wide: 680px;

  /* Глубина: только у всплывающих элементов */
  --shadow-pop: 0 1px 2px rgba(16, 16, 24, .04), 0 8px 24px rgba(16, 16, 24, .08);
  --shadow-knob: 0 1px 2px rgba(0, 0, 0, .2);

  /* Движение */
  --dur: 150ms;
  --dur-slow: 200ms;
  --ease: cubic-bezier(.2, 0, 0, 1);

  /* Слои */
  --z-sticky: 2;
  --z-sidebar: 35;
  --z-bulk: 30;
  --z-scrim: 40;
  --z-menu: 50;
  --z-toast: 60;
}

/* ---------- ночной режим (этап 14, docs/этап-14-проект.md, Т-15 — Т-18) ----------
   Класс theme-dark на <html> ставит сервер (server/theme.py): профиль → cookie tessera_theme →
   светлая; системная настройка не читается, первое открытие — дневной режим (решение владельца
   2026-11-28). Переопределяются только токены: страницы берут цвета из них. Фон почти чёрный,
   текст почти белый (просьба пользователя), контраст основного текста не ниже 4,5:1. */
html.theme-dark {
  color-scheme: dark;

  --c-bg: #111113;
  --c-bg-subtle: #18181b;
  --c-sidebar: #0c0c0e;
  --c-hover: #1f1f23;
  --c-active: #27272c;
  --c-border: #2a2a30;
  --c-border-strong: #3a3a42;
  --c-text: #f4f4f5;
  --c-text-2: #b4b4bd;
  --c-text-3: #8b8b95;
  --c-on-brand: #ffffff;
  --c-brand: #3f66dc;
  --c-brand-hover: #5577e2;
  --c-brand-soft: #1a2342;
  --c-brand-line: #2b3a6b;
  --c-brand-text: #9bb2f7;
  --c-warn: #f0a24a;
  --c-warn-soft: #2d2213;
  --c-warn-line: #5a4220;
  --c-work: #f59e0b;
  --c-danger: #f06461;
  --c-danger-hover: #f37f7c;
  --c-danger-soft: #2e1617;
  --c-danger-line: #5c2a2b;
  --c-danger-focus: rgba(240, 100, 97, .3);
  --c-ok: #4ade80;
  --c-ok-soft: #122a1b;
  --c-neutral-dot: #71717a;
  --c-focus: rgba(120, 150, 240, .5);
  --c-avatar-bg: #2a3150;
  --c-avatar-text: #c7d2fe;
  --c-inverse: #f4f4f5;
  --c-inverse-text: #18181b;
  --c-inverse-muted: rgba(24, 24, 27, .7);
  --c-inverse-line: rgba(24, 24, 27, .16);
  --c-inverse-hover: rgba(24, 24, 27, .08);
  --c-inverse-danger: #b91c1c;
  --c-scrim: rgba(0, 0, 0, .45);
  --c-scrim-strong: rgba(0, 0, 0, .6);
  --c-chip-x-hover: rgba(155, 178, 247, .18);
  --c-sk-1: #1f1f23;
  --c-sk-2: #27272c;
  --c-thumb: #18181b;
  /* Знак из квадратов светлее: на почти чёрном исходные цвета логотипа темнеют */
  --c-logo-blue: #5a7fe8;
  --c-logo-accent: #c9578b;

  --shadow-pop: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .55);
  --shadow-knob: 0 1px 2px rgba(0, 0, 0, .5);
}
/* Логотипы — PNG для светлого фона (синий и малиновый): на тёмном их немного осветляем */
html.theme-dark :is(.sidebar-logo, .sidebar-mark, .auth-logo, .topbar-logo, .upload-logo, .upload-mark, .home-logo,
  .brand-anim-word) { filter: brightness(1.3); }

/* Переключатель темы (theme-switch.js): луна в светлой теме, солнце в тёмной */
.theme-switch {
  display: inline-grid; place-items: center; width: var(--control-h-sm); height: var(--control-h-sm); padding: 0;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--c-text-2); cursor: pointer;
}
.theme-switch:hover { background: var(--c-hover); color: var(--c-text); }
.theme-switch:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 1px; }
.theme-switch .i { width: 16px; height: 16px; }

/* ---------- 2. Основа ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: 400 var(--fs-md)/1.45 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-semibold); }
p { margin: 0; }
a { color: var(--c-brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 1px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: var(--fs-xs); }
.muted { color: var(--c-text-2); }
.faint { color: var(--c-text-3); }
.sr-only, .visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Иконки Lucide из спрайта (ui-icons.js) */
.i { width: var(--icon); height: var(--icon); flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: var(--icon-sm); height: var(--icon-sm); }
.i-lg { width: var(--icon-lg); height: var(--icon-lg); }

/* ---------- 3. Каркас (разметка — ui-shell.js, комментарий в начале файла) ---------- */

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; height: 100dvh; transition: grid-template-columns var(--dur) var(--ease); }
/* Состояние из localStorage ставится до первой отрисовки: без анимации, чтобы не мелькало */
.app.no-anim, .app.no-anim * { transition: none !important; }

.sidebar {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  background: var(--c-sidebar); border-right: 1px solid var(--c-border);
  padding: var(--sp-2);
}
.sidebar-head { display: flex; align-items: center; gap: var(--sp-2); height: var(--control-h-lg); padding: 0 var(--sp-1) 0 6px; margin-bottom: var(--sp-2); }
.sidebar-brand { display: inline-flex; align-items: center; border-radius: var(--radius-sm); }
.sidebar-logo { height: 22px; width: auto; display: block; }
.sidebar-mark { width: 22px; height: 22px; display: none; border-radius: 5px; }
.sidebar-head .icon-btn { margin-left: auto; }
.org {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%; padding: 6px; margin-bottom: var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); font-size: var(--fs-sm); text-align: left;
}
button.org { cursor: pointer; }
button.org:hover { border-color: var(--c-border-strong); }
.org .i { margin-left: auto; color: var(--c-text-3); }
.org-badge { width: 20px; height: 20px; border-radius: 5px; background: var(--c-brand-soft); color: var(--c-brand-text); display: grid; place-items: center; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); flex: none; }
.org-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); min-width: 0; }

.nav { flex: 1; min-height: 0; overflow-y: auto; }
.nav-group { margin-bottom: var(--sp-3); }
.nav-label { font-size: var(--fs-2xs); font-weight: var(--fw-medium); color: var(--c-text-3); padding: 0 var(--sp-2); height: 24px; display: flex; align-items: center; letter-spacing: .02em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 var(--sp-2); border-radius: var(--radius-sm);
  color: var(--c-text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); position: relative;
}
.nav-item:hover { background: var(--c-hover); color: var(--c-text); text-decoration: none; }
.nav-item.is-active { background: var(--c-bg); color: var(--c-text); box-shadow: inset 0 0 0 1px var(--c-border); }
.nav-item.is-active .i { color: var(--c-brand); }
.nav-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-item .count { margin-left: auto; font-size: var(--fs-2xs); color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.nav-item .count.is-warn { color: var(--c-warn); }
.nav-item .nav-ext { color: var(--c-text-3); opacity: 0; transition: opacity var(--dur) var(--ease); }
.nav-item:hover .nav-ext { opacity: 1; }
.nav-item .count + .nav-ext { margin-left: 0; }
.nav-item .nav-text + .nav-ext { margin-left: auto; }
/* Подпункты (у врача — «Новые», «В работе», …): точка вместо значка */
.nav-children { display: grid; gap: 1px; margin: 1px 0 var(--sp-1); }
.nav-item.nav-child { height: 28px; padding-left: 34px; font-weight: 400; }
.nav-item.nav-child .dot { position: absolute; left: 13px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--c-border); padding-top: var(--sp-2); display: flex; align-items: center; gap: var(--sp-1); }
.user-chip { display: flex; align-items: center; gap: var(--sp-2); flex: 1; min-width: 0; padding: 6px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left; }
.user-chip:hover { background: var(--c-hover); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--c-avatar-bg); color: var(--c-avatar-text); display: grid; place-items: center; font-size: 10.5px; font-weight: var(--fw-semibold); flex: none; }
.avatar-sm { width: 20px; height: 20px; font-size: 9.5px; }
.user-chip-text { min-width: 0; line-height: 1.25; }
.user-chip-name, .user-chip-role { display: block; }
.user-chip-name { font-size: var(--fs-sm); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-role { font-size: var(--fs-2xs); color: var(--c-text-3); }
.sidebar-foot .lang-switch { flex: none; }

@media (min-width: 900px) {
  .app.is-collapsed { grid-template-columns: var(--sidebar-w-collapsed) minmax(0, 1fr); }
  .app.is-collapsed .sidebar-logo, .app.is-collapsed .nav-label, .app.is-collapsed .nav-text,
  .app.is-collapsed .nav-item .count, .app.is-collapsed .nav-ext, .app.is-collapsed .nav-children,
  .app.is-collapsed .org-name, .app.is-collapsed .org .i, .app.is-collapsed .user-chip-text { display: none; }
  .app.is-collapsed .sidebar-mark { display: block; }
  .app.is-collapsed .sidebar-head { flex-direction: column; height: auto; gap: var(--sp-2); padding: var(--sp-1) 0; }
  .app.is-collapsed .sidebar-head .icon-btn { margin: 0; }
  .app.is-collapsed .nav-item { justify-content: center; padding: 0; }
  .app.is-collapsed .nav-group { border-top: 1px solid var(--c-border); padding-top: var(--sp-2); }
  .app.is-collapsed .nav-group:first-of-type { border-top: 0; }
  .app.is-collapsed .org { justify-content: center; padding: 6px 0; }
  .app.is-collapsed .sidebar-foot { flex-direction: column; }
  .app.is-collapsed .user-chip { justify-content: center; }
}

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: var(--sp-3); height: var(--topbar-h); padding: 0 var(--sp-5); border-bottom: 1px solid var(--c-border); background: var(--c-bg); flex: none; }
.topbar .topbar-menu { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-text-2); min-width: 0; }
.crumbs a { color: var(--c-text-2); white-space: nowrap; }
.crumbs a:hover { color: var(--c-text); text-decoration: none; }
.crumbs .current { color: var(--c-text); font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .i { color: var(--c-text-3); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.topbar-page-actions { display: flex; align-items: center; gap: var(--sp-2); }
.topbar-page-actions:empty { display: none; }
.search-trigger {
  display: flex; align-items: center; gap: var(--sp-2); width: 280px; height: var(--control-h); padding: 0 6px 0 10px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-bg-subtle); color: var(--c-text-3);
  font-size: var(--fs-sm); cursor: pointer; transition: border-color var(--dur) var(--ease);
}
.search-trigger:hover { border-color: var(--c-border-strong); }
.search-trigger > span:not(.kbd) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .search-trigger { width: 200px; } }
.search-trigger .kbd { margin-left: auto; }
.kbd { white-space: nowrap; flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 5px; border: 1px solid var(--c-border); border-radius: var(--radius-xs); background: var(--c-bg); color: var(--c-text-3); font-size: var(--fs-2xs); font-family: var(--font); }

.content { flex: 1; overflow: auto; min-height: 0; }
.page { padding: var(--sp-6) var(--sp-8) var(--sp-8); max-width: var(--page-max); }
.page-wide { max-width: none; }
.page-head { display: flex; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.01em; line-height: 1.3; }
.page-sub { margin: 2px 0 0; color: var(--c-text-2); font-size: var(--fs-sm); }
.page-head-actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
/* Шапка без боковой панели (загрузка, главная) */
.app-plain { min-height: 100vh; display: flex; flex-direction: column; }
.app-plain > .topbar { position: sticky; top: 0; z-index: var(--z-sticky); }

/* ---------- 4. Элементы управления ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-h); padding: 0 12px;
  border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); background: var(--c-bg); color: var(--c-text);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { background: var(--c-hover); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible, .nav-item:focus-visible, .tab:focus-visible, .chip:focus-visible,
.user-chip:focus-visible, .search-trigger:focus-visible, .org:focus-visible, .seg button:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--c-focus); border-color: var(--c-brand);
}
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { background: var(--c-bg); }
.btn-primary { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-on-brand); }
.btn-primary:hover { background: var(--c-brand-hover); border-color: var(--c-brand-hover); }
.btn-primary:disabled:hover { background: var(--c-brand); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-on-brand); }
.btn-danger:hover { background: var(--c-danger-hover); border-color: var(--c-danger-hover); }
.btn-danger:disabled:hover { background: var(--c-danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--c-text-2); }
.btn-ghost:hover { background: var(--c-hover); color: var(--c-text); }
.btn-sm, .btn-small { height: var(--control-h-sm); padding: 0 10px; font-size: var(--fs-xs); }
.btn-lg { height: var(--control-h-lg); padding: 0 var(--sp-4); }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--control-h-sm); height: var(--control-h-sm); padding: 0; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--c-text-2); cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--c-hover); color: var(--c-text); }
.icon-btn.is-on { background: var(--c-active); color: var(--c-text); }
.icon-btn.is-danger { color: var(--c-danger); }
.icon-btn:disabled { opacity: .45; cursor: default; }

.input,
:where(input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"],
       input[type="date"], input[type="url"], input[type="tel"], input:not([type]), textarea, select) {
  height: var(--control-h); padding: 0 10px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
  background: var(--c-bg); color: var(--c-text); font-size: var(--fs-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input { width: 100%; }
.input::placeholder, :where(input, textarea)::placeholder { color: var(--c-text-3); }
:where(input, textarea, select):focus-visible { outline: none; border-color: var(--c-brand); box-shadow: 0 0 0 3px var(--c-focus); }
:where(input, textarea, select):disabled { background: var(--c-bg-subtle); color: var(--c-text-3); }
:where(textarea), textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
:where(select) { padding-right: 6px; }
.input.is-invalid, :where(input, textarea, select)[aria-invalid="true"] { border-color: var(--c-danger); }
.input.is-invalid:focus-visible, :where(input, textarea, select)[aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px var(--c-danger-focus); }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--c-text-3); pointer-events: none; }
.input-icon .input { padding-left: 30px; }
:where(input[type="checkbox"], input[type="radio"]) { accent-color: var(--c-brand); }

.field { display: grid; gap: 6px; margin-bottom: var(--sp-4); }
.field-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.field-hint { font-size: var(--fs-xs); color: var(--c-text-3); }
.field-error { font-size: var(--fs-xs); color: var(--c-danger); display: flex; gap: var(--sp-1); align-items: center; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.form-section { padding: var(--sp-4) 0; border-top: 1px solid var(--c-border); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin: 0 0 var(--sp-3); }
.disclosure { border: 0; background: none; padding: 0; display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--c-text-2); font-size: var(--fs-sm); cursor: pointer; }
.disclosure:hover { color: var(--c-text); }
.disclosure .i { transition: transform var(--dur) var(--ease); }
.disclosure[aria-expanded="true"] .i { transform: rotate(90deg); }

.switch { position: relative; width: 30px; height: 18px; flex: none; appearance: none; margin: 0; border-radius: 9px; background: var(--c-border-strong); cursor: pointer; transition: background var(--dur) var(--ease); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--c-bg); box-shadow: var(--shadow-knob); transition: transform var(--dur) var(--ease); }
.switch:checked { background: var(--c-brand); }
.switch:checked::after { transform: translateX(12px); }
.switch:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-focus); }
/* Флажок. Класс .check занят подписью-строкой (<label class="check">) у dialog.js */
.cb { width: 15px; height: 15px; margin: 0; accent-color: var(--c-brand); cursor: pointer; flex: none; }
.check { display: flex; align-items: center; gap: var(--sp-2); cursor: pointer; }

/* Значки состояния: маленькая точка и подпись */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--c-text-2); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-neutral-dot); flex: none; display: inline-block; }
.dot-new { background: var(--c-brand); }
.dot-work { background: var(--c-work); }
.dot-done { background: var(--c-ok); }
.dot-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c-neutral-dot); }
.dot-danger { background: var(--c-danger); }
.dot-warn { background: var(--c-warn); }
.badge { display: inline-flex; align-items: center; gap: var(--sp-1); height: 20px; padding: 0 7px; border-radius: var(--radius-lg); font-size: var(--fs-2xs); font-weight: var(--fw-medium); background: var(--c-hover); color: var(--c-text-2); white-space: nowrap; vertical-align: middle; }
.badge-brand { background: var(--c-brand-soft); color: var(--c-brand-text); }
.badge-warn { background: var(--c-warn-soft); color: var(--c-warn); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-ok { background: var(--c-ok-soft); color: var(--c-ok); }

/* Заглушки при загрузке */
.sk { display: block; border-radius: var(--radius-xs); background: linear-gradient(90deg, var(--c-sk-1) 0%, var(--c-sk-2) 50%, var(--c-sk-1) 100%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sk-line { height: 10px; margin: 6px 0; }
.sk-title { height: 24px; width: 200px; margin-bottom: var(--sp-5); }

.callout { display: flex; gap: var(--sp-3); align-items: flex-start; padding: 10px var(--sp-3); border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg-subtle); font-size: var(--fs-sm); margin-bottom: var(--sp-4); }
.callout .i { margin-top: 2px; color: var(--c-text-2); }
.callout-warn { background: var(--c-warn-soft); border-color: var(--c-warn-line); }
.callout-warn .i { color: var(--c-warn); }
.callout-danger { background: var(--c-danger-soft); border-color: var(--c-danger-line); }
.callout-danger .i { color: var(--c-danger); }
.callout-brand { background: var(--c-brand-soft); border-color: var(--c-brand-line); }
.callout-brand .i { color: var(--c-brand); }

/* ---------- 5. Показатели и таблица ---------- */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: var(--sp-6); overflow: hidden; }
.kpi { display: block; padding: var(--sp-3) var(--sp-4); border-left: 1px solid var(--c-border); color: inherit; transition: background var(--dur) var(--ease); }
.kpi:first-child { border-left: 0; }
a.kpi:hover { background: var(--c-bg-subtle); text-decoration: none; }
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--c-text-2); font-weight: var(--fw-medium); }
.kpi-label .go { margin-left: auto; color: var(--c-text-3); opacity: 0; transition: opacity var(--dur) var(--ease); }
a.kpi:hover .go { opacity: 1; }
.kpi-value { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.015em; margin-top: var(--sp-1); font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-value small { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--c-text-3); letter-spacing: 0; }
.kpi-foot { font-size: var(--fs-xs); color: var(--c-text-2); margin-top: var(--sp-1); display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.kpi-foot .status { font-size: var(--fs-xs); }
.kpi.is-warn .kpi-value { color: var(--c-warn); }
.meter { display: block; height: 4px; min-width: 80px; border-radius: 2px; background: var(--c-hover); margin-top: var(--sp-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--c-brand); border-radius: 2px; }
.meter.is-warning > span { background: var(--c-danger); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.panel { border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-bg); }
.panel + .panel { margin-top: var(--sp-6); }
.panel-head { display: flex; align-items: center; gap: var(--sp-2); height: 42px; padding: 0 var(--sp-4); border-bottom: 1px solid var(--c-border); }
.panel-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); margin: 0; }
.panel-head .link { margin-left: auto; font-size: var(--fs-xs); color: var(--c-text-2); display: inline-flex; align-items: center; gap: 2px; }
.panel-head .link:hover { color: var(--c-text); text-decoration: none; }
.panel-body { padding: var(--sp-4); }
.panel-empty { padding: var(--sp-6) var(--sp-4); color: var(--c-text-3); font-size: var(--fs-sm); text-align: center; }

.feed { list-style: none; margin: 0; padding: var(--sp-1) 0; }
.feed li { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--sp-3); align-items: start; padding: 7px var(--sp-4); font-size: var(--fs-sm); }
.feed li:hover { background: var(--c-bg-subtle); }
.feed-icon { width: 24px; height: 24px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--c-hover); color: var(--c-text-2); }
.feed-icon.is-system { background: var(--c-warn-soft); color: var(--c-warn); }
.feed-text { min-width: 0; }
.feed-text b { font-weight: var(--fw-medium); }
.feed-detail { color: var(--c-text-3); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-time { color: var(--c-text-3); font-size: var(--fs-xs); white-space: nowrap; padding-top: 2px; }

.list { list-style: none; margin: 0; padding: var(--sp-1) 0; }
.list-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); font-size: var(--fs-sm); color: inherit; }
a.list-row:hover { background: var(--c-bg-subtle); text-decoration: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: var(--fw-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .sub { font-size: var(--fs-xs); color: var(--c-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toolbar { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.toolbar .input-icon { width: 260px; }
.toolbar .spacer, .toolbar-spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-h); padding: 0 10px; border: 1px dashed var(--c-border-strong);
  border-radius: var(--radius-sm); background: var(--c-bg); color: var(--c-text-2); font-size: var(--fs-sm); cursor: pointer;
}
.chip:hover { background: var(--c-hover); color: var(--c-text); }
.chip.is-set { border-style: solid; border-color: var(--c-brand); background: var(--c-brand-soft); color: var(--c-brand-text); }
.chip .x { display: inline-grid; place-items: center; margin-right: -4px; border-radius: var(--radius-xs); }
.chip .x:hover { background: var(--c-chip-x-hover); }

/* Таблица DataTable (admin-ui.js) с prefsKey, rowMenu или bulk: закреплённая шапка внутри .table-wrap */
.table-wrap { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: auto; max-height: calc(100vh - 230px); position: relative; background: var(--c-bg); }
.table-wrap.is-free { max-height: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.table th {
  position: sticky; top: 0; z-index: 1; height: var(--head-h); padding: 0 var(--sp-3); background: var(--c-bg-subtle); border-bottom: 1px solid var(--c-border);
  text-align: left; font-weight: var(--fw-medium); font-size: var(--fs-xs); color: var(--c-text-2); white-space: nowrap; user-select: none;
}
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--c-text); }
.th-inner { display: inline-flex; align-items: center; gap: var(--sp-1); }
.table th .sort-icon { color: var(--c-text-3); opacity: 0; }
.table th.sortable:hover .sort-icon, .table th.sortable:focus-visible .sort-icon { opacity: 1; }
.table th.is-sorted .sort-icon { opacity: 1; color: var(--c-brand); }
.table td { height: var(--row-h); padding: 0 var(--sp-3); border-bottom: 1px solid var(--c-border); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--c-bg-subtle); }
.table tbody tr.is-selected { background: var(--c-brand-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:focus-visible { outline: 2px solid var(--c-brand); outline-offset: -2px; }
.table td.is-flex { max-width: 0; width: 25%; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num .th-inner { flex-direction: row-reverse; }
.table td.is-wrap { white-space: normal; }
.table .col-check { width: 36px; padding-right: 0; }
.table .col-menu { width: 40px; padding: 0 var(--sp-2); text-align: right; }
.table .row-menu { opacity: 0; }
.table tr:hover .row-menu, .table tr:focus-within .row-menu, .table .row-menu[aria-expanded="true"] { opacity: 1; }
.density-compact .table td, .table.is-compact td { height: var(--row-h-compact); }
.density-compact .table th, .table.is-compact th { height: var(--head-h-compact); }
.cell-main { font-weight: var(--fw-medium); color: var(--c-text); }
.cell-sub { color: var(--c-text-3); margin-left: 6px; }
.avatars { display: inline-flex; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--c-bg); }
.avatars .avatar + .avatar { margin-left: -6px; }
.table-foot { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 2px 0; color: var(--c-text-3); font-size: var(--fs-xs); }

.bulkbar {
  position: fixed; left: 50%; bottom: var(--sp-6); transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: var(--sp-2); padding: 6px 6px 6px 14px; background: var(--c-inverse); color: var(--c-inverse-text);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); z-index: var(--z-bulk);
  max-width: calc(100vw - 2 * var(--sp-4)); flex-wrap: wrap;
}
.bulkbar.is-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.bulkbar .sep { width: 1px; height: 18px; background: var(--c-inverse-line); margin: 0 var(--sp-1); }
.bulkbar .btn { background: transparent; border-color: var(--c-inverse-line); color: var(--c-inverse-text); height: var(--control-h-sm); }
.bulkbar .btn:hover { background: var(--c-inverse-hover); }
.bulkbar .btn.is-danger { color: var(--c-inverse-danger); }
.bulkbar .icon-btn { color: var(--c-inverse-muted); }
.bulkbar .icon-btn:hover { background: var(--c-inverse-hover); color: var(--c-inverse-text); }

/* ---------- 6. Меню, всплывающие панели, поиск ---------- */

.menu {
  position: fixed; z-index: var(--z-menu); min-width: 200px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto;
  padding: var(--sp-1); background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: var(--fs-sm);
  animation: pop var(--dur) var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; height: 30px; padding: 0 var(--sp-2); border: 0; border-radius: 5px; background: none; text-align: left; cursor: pointer; color: var(--c-text); white-space: nowrap; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--c-hover); outline: none; text-decoration: none; }
.menu-item:disabled { color: var(--c-text-3); cursor: default; }
.menu-item:disabled:hover { background: none; }
.menu-item .i { color: var(--c-text-2); }
.menu-item .kbd, .menu-item .menu-hint { margin-left: auto; }
.menu-hint { color: var(--c-text-3); font-size: var(--fs-xs); }
.menu-item.is-danger, .menu-item.is-danger .i { color: var(--c-danger); }
.menu-item.is-danger:hover { background: var(--c-danger-soft); }
.menu-sep { height: 1px; background: var(--c-border); margin: var(--sp-1) calc(-1 * var(--sp-1)); }
.menu-label { padding: 6px var(--sp-2) var(--sp-1); font-size: var(--fs-2xs); color: var(--c-text-3); font-weight: var(--fw-medium); }
.menu-check { display: flex; align-items: center; gap: var(--sp-2); height: 30px; padding: 0 6px 0 var(--sp-2); border-radius: 5px; cursor: grab; }
.menu-check:hover { background: var(--c-hover); }
.menu-check .grip { color: var(--c-text-3); margin-left: auto; }
.menu-check.is-dragging { opacity: .5; }
.menu-check.is-over { box-shadow: inset 0 2px 0 var(--c-brand); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-bg-subtle); }
.seg :is(button, a) { height: 24px; padding: 0 var(--sp-2); border: 0; border-radius: var(--radius-xs); background: none; color: var(--c-text-2); font-size: var(--fs-xs); cursor: pointer; display: inline-flex; align-items: center; gap: var(--sp-1); }
.seg :is(button, a):hover { color: var(--c-text); text-decoration: none; }
.seg :is(button, a).is-on { background: var(--c-bg); color: var(--c-text); box-shadow: 0 0 0 1px var(--c-border); }

.toasts { position: fixed; right: var(--sp-5); bottom: var(--sp-5); display: grid; gap: var(--sp-2); z-index: var(--z-toast); }
.toast { display: flex; align-items: center; gap: var(--sp-2); min-width: 260px; max-width: 380px; padding: 10px var(--sp-3); background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-pop); font-size: var(--fs-sm); animation: pop var(--dur) var(--ease); }
.toast > .i { color: var(--c-ok); }
.toast.is-info > .i { color: var(--c-brand); }
.toast.is-error > .i { color: var(--c-danger); }
.toast-text { flex: 1; min-width: 0; }
.toast .btn { margin-left: var(--sp-1); }
.toast.is-leaving { opacity: 0; transform: translateY(4px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }

/* Глобальный поиск (ui-palette.js) — на <dialog>: фокус внутри, Esc закрывает */
.palette {
  width: min(var(--palette-w), calc(100vw - 2 * var(--sp-4))); max-width: none; margin: 14vh auto auto; padding: 0;
  background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); overflow: hidden; animation: pop var(--dur) var(--ease);
}
.palette::backdrop { background: var(--c-scrim); }
.palette-input { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-4); height: 48px; border-bottom: 1px solid var(--c-border); }
.palette-input .i { color: var(--c-text-3); }
.palette-input input { flex: 1; min-width: 0; height: auto; padding: 0; border: 0; outline: none; box-shadow: none; font-size: var(--fs-md); background: none; }
.palette-input input:focus-visible { box-shadow: none; }
.palette-list { max-height: min(380px, 60vh); overflow: auto; padding: var(--sp-1); }
.palette-group { padding: var(--sp-2) var(--sp-2) var(--sp-1); font-size: var(--fs-2xs); color: var(--c-text-3); font-weight: var(--fw-medium); }
.palette-item { display: flex; align-items: center; gap: var(--sp-3); height: var(--control-h-lg); padding: 0 var(--sp-2); border-radius: var(--radius-sm); font-size: var(--fs-sm); cursor: pointer; }
.palette-item > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.palette-item .i { color: var(--c-text-2); }
.palette-item .sub { color: var(--c-text-3); font-size: var(--fs-xs); margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.palette-item.is-active { background: var(--c-hover); }
.palette-item mark { background: none; color: var(--c-brand-text); font-weight: var(--fw-semibold); }
.palette-status { padding: var(--sp-6) var(--sp-4); color: var(--c-text-3); font-size: var(--fs-sm); text-align: center; }
.palette-foot { display: flex; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--c-border); font-size: var(--fs-2xs); color: var(--c-text-3); background: var(--c-bg-subtle); }
.palette-foot span { display: inline-flex; align-items: center; gap: var(--sp-1); }

/* ---------- 7. Карточка объекта, вкладки, сканы, записи ---------- */

.object-head { padding-bottom: var(--sp-4); }
.object-kicker { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--c-text-3); margin-bottom: 6px; }
.object-title-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.object-title { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-semibold); letter-spacing: -.015em; }
.object-actions { margin-left: auto; display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.props { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-6); padding: var(--sp-4) 0; border-top: 1px solid var(--c-border); }
.prop-label { font-size: var(--fs-xs); color: var(--c-text-3); margin-bottom: 2px; }
.prop-value { font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; }
.prop-value.is-empty { color: var(--c-text-3); }

.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--c-border); margin-bottom: var(--sp-5); position: sticky; top: 0; background: var(--c-bg); z-index: var(--z-sticky); overflow-x: auto; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border: 0; background: none; color: var(--c-text-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); cursor: pointer; border-radius: var(--radius-sm) var(--radius-sm) 0 0; white-space: nowrap; }
.tab:hover { color: var(--c-text); }
.tab.is-active { color: var(--c-text); }
.tab.is-active::after { content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: -1px; height: 2px; background: var(--c-text); border-radius: 2px; }
.tab .count { font-size: var(--fs-2xs); color: var(--c-text-3); font-variant-numeric: tabular-nums; }

/* Перестановка мышью (sortable.js): копия элемента, которая едет под указателем. Место и размер
   ставит модуль (position: fixed, transform), здесь — только вид: приподнята и в рамке бренда */
.sort-ghost {
  z-index: var(--z-toast); list-style: none; border-radius: var(--radius); background: var(--c-bg);
  box-shadow: 0 0 0 2px var(--c-brand), var(--shadow-pop); opacity: .97; scale: 1.03; cursor: grabbing;
}

.slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--sp-3); }
.slide { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; color: inherit; background: var(--c-bg); transition: border-color var(--dur) var(--ease); position: relative; }
.slide:hover { border-color: var(--c-border-strong); text-decoration: none; }
.slide-thumb { aspect-ratio: 4 / 3; background: var(--c-thumb) center / cover no-repeat; border-bottom: 1px solid var(--c-border); position: relative; }
.slide-thumb .badge { position: absolute; top: 6px; left: 6px; }
.slide-body { padding: var(--sp-2) 10px; }
.slide-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); display: flex; align-items: center; gap: 6px; }
.slide-meta { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 2px; }
.slide.is-expired .slide-thumb { filter: grayscale(1); opacity: .55; }

.notes { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.note { display: grid; grid-template-columns: 28px 1fr; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--c-border); }
.note-head { display: flex; gap: var(--sp-2); align-items: baseline; font-size: var(--fs-sm); }
.note-head b { font-weight: var(--fw-medium); }
.note-body { font-size: var(--fs-sm); margin-top: 2px; white-space: pre-wrap; }

/* ---------- 8. Слой совместимости: разметка dialog.js и admin-ui.js ---------- */

/* Окно dialog.js (<dialog class="modal">): по центру, как подтверждение макета */
.modal {
  width: min(var(--dialog-w), calc(100vw - 2 * var(--sp-4))); max-width: none; padding: 0;
  border: 1px solid var(--c-border); border-radius: var(--radius-lg); background: var(--c-bg); color: var(--c-text);
  box-shadow: var(--shadow-pop);
}
.modal[open] { animation: pop var(--dur) var(--ease); }
.modal::backdrop { background: var(--c-scrim-strong); }
.modal form { display: grid; gap: var(--sp-4); padding: var(--sp-5); }
.modal h2 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.modal-body { display: grid; gap: var(--sp-3); max-height: 60vh; overflow-y: auto; font-size: var(--fs-sm); }
.modal-text { margin: 0; white-space: pre-line; color: var(--c-text-2); font-size: var(--fs-sm); }
.modal-field { display: grid; gap: 6px; font-size: var(--fs-sm); }
.modal-field > span:first-child, .modal-radio legend { font-weight: var(--fw-medium); }
.modal-field :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { width: 100%; }
.modal-field .muted, .modal-check .muted, .modal-radio .muted, .modal-section .muted { font-size: var(--fs-xs); color: var(--c-text-3); }
.modal-field .field-error { margin-top: -2px; }
.modal-check { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); }
.modal-check > span:first-of-type { font-weight: var(--fw-medium); }
.modal-check .muted { flex-basis: 100%; padding-left: 23px; }
.modal-radio { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.modal-radio legend { padding: 0; margin-bottom: var(--sp-1); }
.modal-radio .check { flex-wrap: wrap; }
.modal-radio .check .muted { flex-basis: 100%; padding-left: 23px; }
.modal-static .modal-text { font-weight: var(--fw-semibold); color: var(--c-text); }
.modal-subtitle { font-size: var(--fs-sm); color: var(--c-text-2); font-weight: var(--fw-semibold); margin: var(--sp-1) 0 0; }
.modal-section { display: grid; gap: 6px; padding-top: var(--sp-2); border-top: 1px solid var(--c-border); }
.modal-section:first-child { border-top: 0; padding-top: 0; }
.modal-section-title { margin: 0; font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.modal-error { margin: 0; min-height: 18px; color: var(--c-danger); font-size: var(--fs-sm); }
.modal-error:empty { min-height: 0; margin-top: calc(-1 * var(--sp-4)); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap; }
.modal-head { display: flex; align-items: center; gap: var(--sp-2); }
.modal-head h2 { flex: 1; min-width: 0; }
.password-row { display: flex; gap: var(--sp-2); }
.password-row input { flex: 1; min-width: 0; font-family: var(--font-mono); }

/* Выдвижная панель справа: formDialog({variant: 'sheet'}) — тот же <dialog>, фокус внутри.
   Сдвиг только анимацией (без transform в покое): иначе fixed-меню внутри панели съедут */
.modal.modal-sheet {
  width: min(var(--sheet-w), 100vw); height: 100vh; height: 100dvh; max-height: none;
  margin: 0 0 0 auto; border-width: 0 0 0 1px; border-radius: 0;
}
.modal.modal-sheet[open] { animation: sheet-in var(--dur-slow) var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.modal.modal-sheet::backdrop { background: var(--c-scrim); }
.modal.modal-sheet form { display: flex; flex-direction: column; height: 100%; gap: 0; padding: 0; }
.modal.modal-sheet .modal-head { height: 52px; padding: 0 var(--sp-4) 0 var(--sp-5); border-bottom: 1px solid var(--c-border); flex: none; }
.modal.modal-sheet h2 { font-size: var(--fs-md); }
.modal.modal-sheet .modal-body { flex: 1; max-height: none; padding: var(--sp-5); gap: var(--sp-4); align-content: start; }
.modal.modal-sheet .modal-error { padding: 0 var(--sp-5); margin: 0; }
.modal.modal-sheet .modal-error:empty { display: none; }
.modal.modal-sheet .modal-actions { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--c-border); flex: none; }

/* Пары «название — значение»: сведения, карточки админки. Значению — не уже 8em: в узкой
   карточке переносится длинное название, а не значение (иначе «2,20 ГБ» вставало столбиком
   по букве, замечание владельца 2026-11-27) */
.info-list { display: grid; grid-template-columns: minmax(90px, max-content) minmax(8em, 1fr); gap: 6px var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.info-list dt { color: var(--c-text-3); }
.info-list dd { margin: 0; white-space: pre-line; min-width: 0; overflow-wrap: anywhere; }
.admin-info { max-width: 820px; margin-bottom: var(--sp-3); }

/* Выбор одной строки (chooseDialog) */
.choose-list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.choose-row {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 7px 10px; text-align: left;
  color: var(--c-text); background: var(--c-bg); border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
}
.choose-row:hover, .choose-row:focus-visible { background: var(--c-hover); outline: none; }
.choose-row:focus-visible { box-shadow: 0 0 0 3px var(--c-focus); }
.choose-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choose-hint { color: var(--c-text-3); font-size: var(--fs-xs); white-space: nowrap; }
.choose-badge { flex: none; min-width: 30px; color: var(--c-text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
/* Широкое окно выбора (второй скан во вьювере, этап 17): тянется за угол, названия целиком */
.modal.modal-choose-wide { width: min(720px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); min-width: 320px; min-height: 180px; resize: both; overflow: auto; }
.modal-choose-wide .choose-list { max-height: none; overflow: visible; }
.modal-choose-wide .choose-label { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

/* Плашки состояний admin-ui.js badge(kind): .badge.badge-pill.badge-<вид> */
.badge.badge-pill { background: var(--c-hover); color: var(--c-text-2); }
.badge-pill.badge-active, .badge-pill.badge-done, .badge-pill.badge-mail_sent { background: var(--c-ok-soft); color: var(--c-ok); }
.badge-pill.badge-blocked, .badge-pill.badge-revoked, .badge-pill.badge-mail_failed, .badge-pill.badge-deleting { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-pill.badge-invited, .badge-pill.badge-new, .badge-pill.badge-mail_held, .badge-pill.badge-mail_queued { background: var(--c-brand-soft); color: var(--c-brand-text); }
.badge-pill.badge-in_work, .badge-pill.badge-processing, .badge-pill.badge-reset_requested, .badge-pill.badge-superadmin { background: var(--c-warn-soft); color: var(--c-warn); }
.badge-pill.badge-invite_expired, .badge-pill.badge-expired, .badge-pill.badge-mail_canceled { background: var(--c-bg-subtle); color: var(--c-text-3); box-shadow: inset 0 0 0 1px var(--c-border); }

/* Кнопка-ссылка в строке таблицы */
.link-btn { border: 0; background: none; padding: 0; font-size: var(--fs-sm); color: var(--c-brand-text); cursor: pointer; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.link-btn.is-danger { color: var(--c-danger); }
.link-btn.is-attention { color: var(--c-warn); font-weight: var(--fw-semibold); }
.copy-fallback { width: 260px; height: var(--control-h-sm); font-family: var(--font-mono); font-size: var(--fs-xs); }

/* Строка сообщения и пустой список */
.catalog-note { margin: 0 0 var(--sp-3); color: var(--c-text-2); font-size: var(--fs-sm); }
.catalog-note.is-error { color: var(--c-danger); }
.admin-note:empty { display: none; }
.admin-empty { margin-top: var(--sp-2); padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--c-text-3); border: 1px dashed var(--c-border); border-radius: var(--radius); }

/* Панель над таблицей admin-ui.js Toolbar: поиск, фильтры-подписи, действия справа */
.toolbar > input[type="search"] { width: 280px; }
.toolbar-filter { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); }
.toolbar-filter .muted { font-size: var(--fs-xs); }
.toolbar-filter select { max-width: 220px; }

/* Таблица DataTable по умолчанию (.grid-table.admin-table) — в новом стиле */
.admin-table-wrap { overflow-x: auto; }
.grid-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); }
.grid-table th, .grid-table td { text-align: left; padding: 7px var(--sp-3); border-bottom: 1px solid var(--c-border); vertical-align: top; }
.grid-table th { background: var(--c-bg-subtle); color: var(--c-text-2); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.grid-table tr.is-muted td { color: var(--c-text-3); }
.grid-table td.is-error { color: var(--c-danger); }
.admin-table { border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.admin-table th:first-child { border-top-left-radius: var(--radius); }
.admin-table th:last-child { border-top-right-radius: var(--radius); }
.admin-table th.is-sortable { cursor: pointer; user-select: none; }
.admin-table th.is-sortable:hover { color: var(--c-text); }
.admin-table th[data-sort="asc"]::after { content: " ↑"; color: var(--c-brand); }
.admin-table th[data-sort="desc"]::after { content: " ↓"; color: var(--c-brand); }
.admin-table tr.is-clickable { cursor: pointer; }
.admin-table tbody tr:hover td { background: var(--c-bg-subtle); }
.admin-table tr.is-selected td { background: var(--c-brand-soft); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table td.num, .admin-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table .col-check { width: 32px; }
.admin-table select { height: var(--control-h-sm); font-size: var(--fs-sm); }

/* «Показать ещё» (MorePager) */
.show-more { display: flex; justify-content: center; padding: var(--sp-2) 0; }
.admin-more { padding-top: 10px; }

/* ---------- 9. Страницы-карточки, индикатор загрузки, язык ---------- */

/* Вход, приглашение, сброс, ознакомление, гость: карточка по центру.
   <body><main class="auth"><div class="auth-card">
     <div class="auth-brand"><img class="auth-logo" …></div>
     <h1 class="auth-title">…</h1><p class="auth-sub">…</p> … поля .field … <button class="btn btn-primary btn-lg btn-block">
     <p class="auth-error" role="alert"></p>
   </div><p class="auth-foot">…</p></main><div class="auth-lang"><button data-lang-switch …></div> */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--sp-4); padding: var(--sp-10) var(--sp-4); background: var(--c-bg-subtle); }
.auth-card { width: min(var(--auth-w), calc(100vw - 2 * var(--sp-4))); display: grid; gap: var(--sp-4); padding: var(--sp-8) var(--sp-6) var(--sp-6); background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
.auth-card.is-wide { width: min(var(--auth-w-wide), calc(100vw - 2 * var(--sp-4))); }
.auth-brand { display: flex; align-items: center; justify-content: center; padding-bottom: var(--sp-2); }
.auth-logo { display: block; width: 200px; max-width: 100%; height: auto; }

/* Логотип, который собирается при первом открытии (главная и вход; решение владельца 2026-11-26).
   Знак — пять квадратов SVG в координатах картинки логотипа 960×192, надпись — вырезка из неё же:
   собранный логотип совпадает с scantessera-*.png. Ширину задаёт класс страницы (.home-logo,
   .auth-logo). Анимация идёт, только когда сервер поставил <html class="intro"> — один раз за
   посещение на каждой из двух страниц (server/main.py, intro_page); без класса логотип стоит.
   <span class="brand-anim …" role="img" aria-label="ScanTessera"><svg viewBox="0 0 200 192">
     <rect class="tile tile-1" …/> … <rect class="tile tile-accent" …/></svg>
     <img class="brand-anim-word" …></span> */
.brand-anim { position: relative; display: block; aspect-ratio: 960 / 192; }
.brand-anim svg { position: absolute; left: 0; top: 0; width: 20.833%; height: 100%; overflow: visible; }
.brand-anim-word { position: absolute; left: 22.396%; top: 0; width: 77.604%; height: 100%; }
.brand-anim .tile { fill: var(--c-logo-blue); transform-box: fill-box; transform-origin: center; }
.brand-anim .tile-accent { fill: var(--c-logo-accent); }
/* Откуда прилетает каждый квадрат (в точках знака) и его очередь */
.brand-anim .tile-1 { --ox: -18px; --oy: -13px; --i: 0; }
.brand-anim .tile-2 { --ox: 10px; --oy: -18px; --i: 1; }
.brand-anim .tile-3 { --ox: -16px; --oy: 13px; --i: 2; }
.brand-anim .tile-4 { --ox: 10px; --oy: 18px; --i: 3; }
.brand-anim .tile-accent { --ox: 13px; --oy: -16px; --i: 4; }
/* Вся сборка — около 1,8 с: быстрее на странице входа её не замечали (замечание 2026-11-26) */
.intro .brand-anim .tile { animation: brand-tile 950ms cubic-bezier(.22, 1, .36, 1) calc(var(--i) * 180ms) both; }
.intro .brand-anim-word { animation: brand-word 900ms cubic-bezier(.22, 1, .36, 1) 900ms both; }
@keyframes brand-tile {
  from { opacity: 0; transform: translate(var(--ox), var(--oy)) scale(.7); }
  to { opacity: 1; transform: none; }
}
@keyframes brand-word {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .intro .brand-anim .tile, .intro .brand-anim-word { animation: none; }
}
.auth-title { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.01em; text-align: center; }
.auth-sub { margin: -8px 0 0; color: var(--c-text-2); font-size: var(--fs-sm); text-align: center; }
.auth-card .field { margin-bottom: 0; }
.auth-card .input, .auth-card :where(input:not([type="checkbox"]):not([type="radio"]), select) { width: 100%; height: var(--control-h-lg); }
.auth-error { margin: 0; min-height: 18px; color: var(--c-danger); font-size: var(--fs-sm); }
.auth-error:empty { min-height: 0; }
.auth-done { margin: 0; padding: var(--sp-2) var(--sp-3); background: var(--c-brand-soft); color: var(--c-brand-text); border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.auth-foot { margin: 0; color: var(--c-text-3); font-size: var(--fs-xs); text-align: center; max-width: var(--auth-w); }
.auth-lang, .page-lang { position: fixed; top: var(--sp-3); right: var(--sp-3); display: flex; align-items: center; gap: var(--sp-1); }

/* Переключатель языка (lang-switch.js): код другого языка, «EN» или «RU» */
.lang-switch {
  display: inline-grid; place-items: center; min-width: 36px; height: var(--control-h-sm); padding: 0 var(--sp-2);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-bg); color: var(--c-text-2);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: .04em; cursor: pointer;
}
.lang-switch:hover { background: var(--c-hover); color: var(--c-text); }
.lang-switch[aria-disabled="true"] { color: var(--c-text-3); cursor: not-allowed; }
/* Подсказка «идёт загрузка — язык сменить нельзя» под кнопкой */
.lang-tip {
  position: fixed; z-index: var(--z-toast); max-width: 280px; padding: 6px 10px; font-size: var(--fs-xs); color: var(--c-text);
  background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
}

/* Индикатор загрузки страницы (этап 8; с этапа 12 — и для вьювера).
   Разметку вставляет сервер сразу после <body> (server/assets.py, loading_markup); скрипт
   страницы снимает её, когда готов (pageReady в api.js: <html class="is-ready">). Только CSS:
   работает, даже если скрипты не пришли. Полоска — через 0,45 с, чтобы не мелькать при
   обычной загрузке; сообщение о долгой загрузке — через 12 с. */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10000;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  animation: page-loading-show 0s linear 0.45s forwards;
}
.page-loading::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 35%;
  background: var(--c-brand);
  animation: page-loading-run 1.1s ease-in-out infinite;
}
.page-slow {
  display: block !important;   /* в разметке display:none — на случай, если стили не пришли */
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  z-index: 10001;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  box-shadow: var(--shadow-pop);
  color: var(--c-text);
  font-size: var(--fs-sm);
  line-height: 1.4;
  visibility: hidden;
  animation: page-loading-reveal 0s linear 12s forwards;
}
.page-slow a { color: var(--c-brand); font-weight: 600; }
html.is-ready .page-loading,
html.is-ready .page-slow { display: none !important; }
@keyframes page-loading-show { to { opacity: 1; } }
@keyframes page-loading-reveal { to { visibility: visible; } }
@keyframes page-loading-run { from { left: -35%; } to { left: 100%; } }

/* ---------- 10. Узкий экран ---------- */

/* До 900 px боковая панель выезжает поверх страницы по кнопке в шапке (ui-shell.js) */
@media (max-width: 899.98px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(var(--sidebar-w), 85vw); z-index: var(--z-sidebar);
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--dur-slow) var(--ease), visibility 0s linear var(--dur-slow);
  }
  .app.is-nav-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-pop); transition: transform var(--dur-slow) var(--ease); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: calc(var(--z-sidebar) - 1); background: var(--c-scrim); opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease); }
  .app.is-nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar-head [data-shell="collapse"] { display: none; }
  .topbar { padding: 0 var(--sp-3); gap: var(--sp-2); }
  .topbar .topbar-menu { display: inline-grid; }
  .search-trigger { width: auto; padding: 0 var(--sp-2); }
  .search-trigger > span { display: none; }
  .page { padding: var(--sp-4) var(--sp-4) var(--sp-6); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--c-border); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .props { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar .input-icon, .toolbar > input[type="search"] { width: 100%; }
  .table-wrap { max-height: none; }
  .object-actions { margin-left: 0; }
}
@media (min-width: 900px) { .sidebar-scrim { display: none; } }
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { border-left: 0; }
  .kpi + .kpi { border-top: 1px solid var(--c-border); }
  .props, .field-row { grid-template-columns: minmax(0, 1fr); }
  .toasts { left: var(--sp-3); right: var(--sp-3); }
  .toast { min-width: 0; max-width: none; }
  .crumbs a, .crumbs > .i { display: none; }
  .auth-card { padding: var(--sp-6) var(--sp-4) var(--sp-4); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .page-loading::before { left: 0; width: 100%; opacity: 0.6; animation: none; }
}

/* ---------- Дополнения по разделам админки (пакет 2б) ---------- */
.table-wrap.is-flush { border: 0; border-radius: 0; max-height: none; }
.panel > .table-wrap.is-flush { border-top: 0; }
.meter-inline { display: inline-block; width: 96px; height: 4px; margin: 0 0 0 var(--sp-2); vertical-align: middle; }
.panel-danger { border-color: var(--c-danger-line); }
.panel-danger .panel-head { background: var(--c-danger-soft); border-bottom-color: var(--c-danger-line); border-radius: var(--radius) var(--radius) 0 0; }
.panel-danger .panel-title { color: var(--c-danger); }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.table tbody tr.is-muted td { color: var(--c-text-3); }
.table tbody tr.is-muted .cell-main { color: var(--c-text-2); }

/* Справочник обозначений окрасок (этап 15, stain-aliases-ui.js): страница загрузки и админка */
.alias-own, .alias-builtin { display: grid; gap: 4px; }
.alias-builtin { max-height: 45vh; overflow: auto; padding-right: var(--sp-1); }
.alias-search { width: 100%; }
.alias-row, label.alias-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.4fr) auto; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); }
.alias-own .alias-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr) auto; }
.alias-own > .btn { justify-self: start; margin-top: var(--sp-1); }
.alias-name { font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.alias-arrow { color: var(--c-text-3); }
.alias-target { color: var(--c-text-2); overflow-wrap: anywhere; }
.alias-actions { display: inline-flex; gap: 2px; }
.alias-row.is-off :is(.alias-name, .alias-target) { color: var(--c-text-3); text-decoration: line-through; }
.alias-about { margin: 0; }
