/* ============================================================================
   ОБЛИК ПАНЕЛИ ХОСТИНГА — поверх base-theme.css.

   Инструмент инженера: спокойный холодный нейтральный с лёгким сдвигом в синеву,
   плотные строки, состояние точкой + словом + значком, технические значения
   моноширинным. Акцент кабинета НЕ задаётся здесь: его даёт провайдер
   (`accent()`) через палитру Filament `--primary-*`. Акцентом красится ровно
   одна главная кнопка экрана и активный пункт меню — больше ничего.

   Тёмная тема — свои значения, не инверсия.
   ========================================================================== */

/* ── 1. Токены ────────────────────────────────────────────────────────────── */
:root, body {
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --r-xs: 4px; --r-sm: 8px; --r-md: 8px; --r-lg: 12px;

  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 26px;
  --font-ui: "Onest", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --row-h: 40px;      /* строка таблицы */
  --nav-h: 32px;      /* пункт меню */
  --ctl-h: 32px;      /* кнопка, поле */

  --skin-bg:   #f5f6f8;
  --surface:   #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --rail:      #f5f6f8;

  --ink:   #0f1419;
  --body:  #29313b;
  --mute:  #5b6572;   /* 5.9:1 на белом */
  --faint: #6b7480;   /* 4.8:1 на белом */

  --line:        #e4e7ec;
  --line-soft:   #edf0f3;
  --line-strong: #d2d7de;

  /* смысловые: хорошо, внимание, ошибка, неактивно, в работе */
  --ok:   #137a4b; --warn: #975a00; --bad: #b42332; --off: #6b7480; --info: #2f5f96;
  --ok-soft: #e6f4ec; --warn-soft: #fbf0db; --bad-soft: #fbe9eb; --off-soft: #eef0f3; --info-soft: #e8eff7;

  /* 700: белый текст на кнопке ≥ 4.5:1 у всех трёх акцентов (600 давал ~3.5) */
  --accent:       var(--primary-700);
  --accent-hover: var(--primary-800);
  --accent-ink:   var(--primary-700);
  --accent-soft:  color-mix(in srgb, var(--primary-500) 10%, var(--surface));
  --accent-line:  color-mix(in srgb, var(--primary-500) 35%, var(--surface));
  --on-accent:    #ffffff;

  /* тень только у всплывающего; карточки отделяются линией */
  --sh-card:  none;
  --sh-raise: none;
  --sh-pop:   0 12px 32px rgba(15, 20, 25, .14), 0 2px 6px rgba(15, 20, 25, .06);
  --sh-modal: 0 24px 64px rgba(15, 20, 25, .22);
  --scrim:    rgba(15, 20, 25, .42);

  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, var(--primary-500) 55%, transparent);

  /* активный пункт меню — подложкой акцента, без полосы (ось характера base-theme) */
  --nav-active-bg: var(--accent-soft); --nav-active-ink: var(--accent-ink); --nav-active-bar: transparent;
  --rail-ink: var(--body); --rail-mute: var(--mute); --hover: var(--surface-2);

  --term-bg: #0d1117; --term-bar: #161b22; --term-ink: #d6dde6; --term-mute: #8b96a5; --term-line: #262e38;

  --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-4: #eda100;
  --viz-other: #9aa3ad; --viz-free: #e6e9ee;

  --radius: var(--r-md); --radius-sm: var(--r-sm); --radius-lg: var(--r-lg);
  --shadow-sm: none; --shadow: var(--sh-pop);
}
.dark, body.dark, .dark body {
  --skin-bg:   #0d1117;
  --surface:   #151b23;
  --surface-2: #1b222c;
  --surface-3: #232b36;
  --rail:      #0d1117;

  --ink:   #e6eaf0;
  --body:  #c3cbd5;
  --mute:  #8b96a5;
  --faint: #7d8896;

  --line:        #262e38;
  --line-soft:   #1f2630;
  --line-strong: #323b47;

  --ok:   #45bd7f; --warn: #e2a548; --bad: #f0767f; --off: #7d8896; --info: #7fb0ea;
  --ok-soft: #10261b; --warn-soft: #2a2112; --bad-soft: #2e171b; --off-soft: #1b222c; --info-soft: #132234;

  /* в тёмной — светлый акцент и тёмный текст на нём, а не белое на среднем */
  --accent:       var(--primary-500);
  --accent-hover: var(--primary-400);
  --accent-ink:   var(--primary-300);
  --on-accent:    #0d1117;
  --accent-soft:  color-mix(in srgb, var(--primary-400) 15%, var(--surface));
  --accent-line:  color-mix(in srgb, var(--primary-400) 40%, var(--surface));

  --sh-pop:   0 16px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .05);
  --sh-modal: 0 24px 64px rgba(0, 0, 0, .7);
  --scrim:    rgba(1, 4, 9, .62);

  --term-bg: #0a0e13; --term-bar: #111720;

  --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-4: #c98500;
  --viz-other: #5d6671; --viz-free: #262e38;
}

/* ── 2. Основа ───────────────────────────────────────────────────────────── */
.dark { color-scheme: dark; }
html body { background: var(--skin-bg) !important; color: var(--body); font-family: var(--font-ui); font-size: var(--fs-md); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: none; box-shadow: var(--focus-ring) !important; border-radius: var(--r-xs); }
.hm-mono, .pn-code, .pn-mono, code, kbd, pre { font-family: var(--font-mono) !important; letter-spacing: 0; }
.hm-mono, .pn-code, .pn-mono { font-size: .93em; }
.fi-ta-cell, .hm-num, .pn-table td { font-variant-numeric: tabular-nums; }
[x-cloak] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── 3. Боковое меню: плоское, группы — чертой ───────────────────────────── */
body .fi-sidebar { background: var(--rail) !important; border-inline-end: 1px solid var(--line) !important; }
body.bf-density-compact .fi-sidebar, body.bf-density-compact .fi-main-sidebar { width: 232px !important; }
body .fi-sidebar-header {
  min-height: 52px !important; height: 52px !important; padding: 0 16px !important;
  border-bottom: 0; background: transparent !important; box-shadow: none !important;
}
body .fi-sidebar-header .fi-logo {
  font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
/* Знак кабинета — квадрат акцента: вкладки трёх кабинетов не путаются. */
body .fi-sidebar-header .fi-logo::before {
  content: ''; flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--accent);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--accent) 60%, #fff), inset 0 0 0 7px var(--accent);
}
body .fi-sidebar-header { align-items: center !important; padding-block: 0 !important; border-bottom: 0 !important; }
/* Поиск по меню Filament заменён ⌘K над содержимым. */
body .fi-sidebar-header-controls { display: none !important; }
body .fi-sidebar-nav { padding: 4px 8px 16px !important; row-gap: 0 !important; gap: 0 !important; }
body .fi-sidebar-nav-groups { gap: 0 !important; row-gap: 0 !important; margin: 0 !important; }
body .fi-sidebar-group { padding: 8px 0 !important; gap: 0 !important; }
body .fi-sidebar-group + .fi-sidebar-group { border-top: 1px solid var(--line); }
body .fi-sidebar-group-items { gap: 1px !important; row-gap: 1px !important; }
body .fi-sidebar-group-btn { display: none !important; }
body .fi-sidebar-item-btn {
  min-height: var(--nav-h) !important; height: var(--nav-h) !important; padding: 0 10px !important; gap: 10px !important; align-items: center !important;
  font-size: var(--fs-md) !important; font-weight: 450 !important; color: var(--body) !important; border-radius: var(--r-sm) !important;
  transition: background-color .12s ease, color .12s ease;
}
body .fi-sidebar-item-btn .fi-sidebar-item-label { font-size: var(--fs-md) !important; color: inherit !important; font-weight: inherit !important; }
body .fi-sidebar-item-btn:hover { background: var(--surface-2) !important; color: var(--ink) !important; }
body .fi-sidebar-item-icon { width: 18px !important; height: 18px !important; flex-basis: 18px !important; color: var(--mute) !important; }
body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background: var(--accent-soft) !important; color: var(--accent-ink) !important; font-weight: 600 !important; box-shadow: none !important; }
body .fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon { color: var(--accent-ink) !important; }
body .fi-sidebar-footer, body .fi-sidebar .fi-user-menu { border-top: 1px solid var(--line); }
body .fi-sidebar-footer .fi-sidebar-database-notifications-btn { min-height: var(--nav-h) !important; }

/* Вкладки сгенерированных кластеров: второй уровень, который плоское меню
   убрало. Разделы сборки — по своим адресам и в ⌘K. */
body .fi-page-sub-navigation-tabs, body .fi-page-sub-navigation-select, body .fi-page-sub-navigation-sidebar-ctn { display: none !important; }
body .fi-page-has-sub-navigation .fi-page-main { display: block !important; }

/* ── 4. Полоса над содержимым: вкладки · сервер · ⌘K ─────────────────────── */
.sh-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-3);
  height: 52px; padding: 0 24px; background: var(--skin-bg); border-bottom: 1px solid var(--line);
}
.sh-tabs-wrap { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.sh-tabs {
  display: flex; align-items: center; gap: 2px; min-width: 0; flex: 1 1 auto; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-behavior: smooth;
  --fade: 28px;
}
.sh-tabs::-webkit-scrollbar { display: none; }
/* Края затухают только там, где за ними есть ещё вкладки. */
.sh-tabs.is-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, #000 calc(100% - var(--fade)), transparent); }
.sh-tabs.is-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade)); mask-image: linear-gradient(to right, transparent, #000 var(--fade)); }
.sh-tabs.is-l.is-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent); }
.sh-more { position: relative; flex: none; }
.sh-more-btn { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--body); font-size: var(--fs-sm); font-weight: 550; cursor: pointer; white-space: nowrap; }
.sh-more-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.sh-more-icon { width: 14px; height: 14px; color: var(--faint); }
.sh-more-menu { left: auto; right: 0; width: 260px; }
.sh-menu-item.sh-more-item { grid-template-columns: minmax(0, 1fr); }
.sh-tab {
  position: relative; display: inline-flex; align-items: center; flex: none; height: 32px; max-width: 200px;
  border-radius: var(--r-sm); color: var(--mute); font-size: var(--fs-sm); font-weight: 500;
  transition: background-color .12s ease, color .12s ease;
}
.sh-tab:hover { background: var(--surface-2); color: var(--ink); }
.sh-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.sh-tab--home { width: 32px; justify-content: center; }
.sh-tab-link { display: inline-flex; align-items: center; gap: 7px; height: 100%; padding: 0 4px 0 10px; min-width: 0; color: inherit; text-decoration: none; }
.sh-tab-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-tab-icon { width: 16px; height: 16px; flex: none; }
.sh-tab-x { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border-radius: 5px; color: var(--faint); opacity: 0; cursor: pointer; }
.sh-tab:hover .sh-tab-x, .sh-tab.is-active .sh-tab-x, .sh-tab-x:focus-visible { opacity: 1; }
.sh-tab-x:hover { background: var(--surface-3); color: var(--ink); }
.sh-tab-x-icon { width: 14px; height: 14px; }
.sh-tools { display: flex; align-items: center; gap: var(--sp-2); flex: none; }

.sh-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--off); }
.sh-dot--ok { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.sh-dot--warn { background: var(--warn); }
.sh-dot--bad { background: var(--bad); }
.sh-dot--info { background: var(--info); }
.sh-tone--ok { color: var(--ok); } .sh-tone--warn { color: var(--warn); } .sh-tone--bad { color: var(--bad); } .sh-tone--info { color: var(--info); } .sh-tone--off { color: var(--off); }

.sh-server { position: relative; }
.sh-server-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 12px; max-width: 460px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer;
  font-size: var(--fs-sm); color: var(--body); transition: border-color .12s ease;
}
.sh-server-btn:hover { border-color: var(--line-strong); }
.sh-server-name { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.sh-server-ip { color: var(--mute); font-size: 12px; }
.sh-server-state { font-size: var(--fs-xs); font-weight: 600; }
.sh-server-caret { width: 16px; height: 16px; color: var(--faint); }
.sh-menu {
  position: absolute; right: 0; top: calc(100% + 6px); width: 380px; max-width: calc(100vw - 24px); z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-pop); overflow: hidden;
}
.sh-menu-search { padding: 8px; border-bottom: 1px solid var(--line); }
.sh-menu-search input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); }
.sh-menu-list { list-style: none; margin: 0; padding: 4px; max-height: 320px; overflow-y: auto; }
.sh-menu-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--body); font-size: var(--fs-sm); text-decoration: none; }
.sh-menu-item:hover { background: var(--surface-2); }
.sh-menu-item.is-current { background: var(--surface-2); }
.sh-menu-name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-menu-ip { color: var(--mute); font-size: 12px; }
.sh-menu-state { font-size: var(--fs-xs); font-weight: 600; min-width: 64px; text-align: right; }
.sh-menu-foot { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-top: 1px solid var(--line); }
button.sh-menu-link { flex-basis: 100%; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.sh-menu-link { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 550; color: var(--body); text-decoration: none; }
.sh-menu-link:hover { background: var(--surface-2); color: var(--ink); }
.sh-menu-link-icon { width: 16px; height: 16px; color: var(--mute); }

.sh-search {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 10px; min-width: 180px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--mute); font-size: var(--fs-sm); cursor: pointer;
}
.sh-search:hover { border-color: var(--line-strong); color: var(--ink); }
.sh-search-icon { width: 16px; height: 16px; }
.sh-search-label { flex: 1; text-align: left; }
.sh-kbd, .pal-kbd { font-family: var(--font-mono); font-size: 11px; line-height: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface-2); color: var(--mute); }

/* ⌘K */
.pal-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--scrim); }
.pal {
  position: fixed; z-index: 61; left: 50%; top: 12vh; transform: translateX(-50%); width: 620px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-modal); overflow: hidden;
}
.pal-input { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.pal-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: var(--fs-lg); box-shadow: none !important; }
.pal-input-icon { width: 18px; height: 18px; color: var(--mute); }
.pal-busy { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: pn-spin .7s linear infinite; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.pal-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 38px; padding: 0 10px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-md); color: var(--ink); }
.pal-item.is-active { background: var(--surface-2); }
.pal-item-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item-hint { flex: none; font-size: var(--fs-xs); color: var(--mute); }
.pal-empty { padding: 20px 10px; font-size: var(--fs-sm); color: var(--mute); text-align: center; }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--mute); }
.pal-foot .pal-kbd { margin-right: 3px; }
@keyframes pn-spin { to { transform: rotate(360deg); } }

/* ── 5. Страница и шапка ─────────────────────────────────────────────────── */
body.bf-density-compact .fi-main { padding: 20px 24px 32px !important; }
body .fi-page-header-main-ctn, body .fi-page-main { row-gap: 16px !important; }
body .fi-header { align-items: center !important; }
body.bf-density-compact .fi-header-heading, body .fi-header-heading {
  font-size: var(--fs-xl) !important; font-weight: 650 !important; letter-spacing: -.015em !important; color: var(--ink) !important;
}
body .fi-header-subheading { font-size: var(--fs-sm) !important; color: var(--mute) !important; }
/* ОДНА главная кнопка на экране: первое действие шапки главное, остальные тихие. */
body .fi-header-actions-ctn .fi-ac > .fi-btn:not(:first-child),
body .fi-header-actions-ctn .fi-ac > .fi-dropdown:not(:first-child) .fi-btn {
  background: var(--surface) !important; color: var(--body) !important; box-shadow: inset 0 0 0 1px var(--line-strong) !important;
}
body .fi-header-actions-ctn .fi-ac > .fi-btn:not(:first-child):hover { background: var(--surface-2) !important; color: var(--ink) !important; }
body .fi-header-actions-ctn .fi-ac > .fi-btn:not(:first-child) .fi-icon { color: var(--mute) !important; }

/* ── 6. Кнопки и поля Filament ───────────────────────────────────────────── */
body .fi-btn { border-radius: var(--r-sm) !important; font-weight: 550 !important; min-height: var(--ctl-h); transition: background-color .12s ease, box-shadow .12s ease; }
body .fi-btn.fi-color-primary:not(.fi-outlined) { background: var(--accent) !important; color: var(--on-accent) !important; }
body .fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon { color: var(--on-accent) !important; }
body .fi-btn.fi-color-primary:not(.fi-outlined):hover { background: var(--accent-hover) !important; }
body .fi-btn.fi-color-danger:not(.fi-outlined) { background: var(--bad) !important; color: #fff !important; }
.dark body .fi-btn.fi-color-danger:not(.fi-outlined) { color: var(--skin-bg) !important; }
body .fi-input-wrp { border-radius: var(--r-sm) !important; transition: box-shadow .12s ease; }
body .fi-input-wrp:focus-within { box-shadow: var(--focus-ring) !important; }

/* ── 7. Реестр Filament (сгенерированные разделы) ────────────────────────── */
body .fi-ta-ctn { border-radius: var(--r-lg) !important; border: 1px solid var(--line) !important; box-shadow: none !important; background: var(--surface) !important; overflow: hidden; }
body .fi-ta-header-toolbar { background: var(--surface) !important; border-bottom: 1px solid var(--line) !important; padding: 8px 12px !important; min-height: 48px; gap: 8px !important; }
body .fi-ta-header-toolbar .fi-input-wrp { background: var(--surface) !important; min-width: 240px; }
body .fi-ta-header-cell {
  background: var(--surface-2) !important; font-size: var(--fs-xs) !important; font-weight: 600 !important;
  color: var(--mute) !important; text-transform: none !important; letter-spacing: 0 !important;
  border-bottom: 1px solid var(--line) !important; white-space: nowrap; padding-top: 9px !important; padding-bottom: 9px !important;
}
body .fi-ta-cell { font-size: var(--fs-sm) !important; }
/* Высоту строки держит base-theme от `--row-h` (40px выше): своих отступов не добавляем. */
body .fi-ta-row { transition: background-color .1s ease; }
body .fi-ta-row:hover { background: var(--surface-2) !important; }
body .fi-ta-row.fi-selected, body .fi-ta-row:has(.fi-ta-record-checkbox:checked) { background: var(--accent-soft) !important; }
body .fi-ta-row + .fi-ta-row > .fi-ta-cell, body .fi-ta-row > .fi-ta-cell { border-top-color: var(--line-soft) !important; }
body .fi-ta-cell .fi-ta-text-item { color: var(--body); font-size: var(--fs-sm) !important; }
body .fi-badge[data-tone] * { color: inherit !important; }
body .fi-ta-cell:nth-child(2) .fi-ta-text-item { color: var(--ink); font-weight: 550; }
body .fi-pagination { border-top: 1px solid var(--line) !important; background: var(--surface) !important; }
body .fi-pagination-overview { font-size: var(--fs-xs) !important; color: var(--mute) !important; }
body .fi-ta-empty-state { padding: 40px 24px !important; }
body .fi-ta-empty-state-icon-bg { background: var(--surface-2) !important; border-radius: var(--r-lg) !important; }
body .fi-ta-empty-state-icon-bg .fi-icon { color: var(--mute) !important; }
body .fi-ta-empty-state-heading { font-size: var(--fs-lg) !important; font-weight: 650 !important; color: var(--ink) !important; }
body .fi-ta-empty-state-description { max-width: 52ch; margin-inline: auto; color: var(--mute) !important; font-size: var(--fs-sm) !important; }

/* ── 8. Состояние: значок + слово ────────────────────────────────────────── */
:root {
  --ic-ok:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm3.2 4.3a.8.8 0 0 0-1.1 0L7 8.4 5.9 7.3a.8.8 0 1 0-1.1 1.1l1.6 1.7c.3.3.8.3 1.1 0l3.7-3.7a.8.8 0 0 0 0-1.1Z'/%3E%3C/svg%3E");
  --ic-bad:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 3a.9.9 0 0 0-.9.9v3.4a.9.9 0 0 0 1.8 0V4.9A.9.9 0 0 0 8 4Zm0 6.6a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z'/%3E%3C/svg%3E");
  --ic-warn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 2.5a.8.8 0 0 0-.8.8V8c0 .2.1.4.2.6l2.2 2.2a.8.8 0 0 0 1.1-1.1L8.8 7.7V4.3A.8.8 0 0 0 8 3.5Z'/%3E%3C/svg%3E");
  --ic-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 2a5 5 0 1 0 0 10A5 5 0 0 0 8 3Zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z'/%3E%3C/svg%3E");
  --ic-off:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 1 1 0 14A7 7 0 0 1 8 1Zm0 1.8a5.2 5.2 0 1 0 0 10.4A5.2 5.2 0 0 0 8 2.8ZM5.2 7.2h5.6a.8.8 0 0 1 0 1.6H5.2a.8.8 0 0 1 0-1.6Z'/%3E%3C/svg%3E");
}
.st, body .fi-badge[data-tone], body .pn-badge[data-tone] {
  display: inline-flex !important; align-items: center; gap: 5px; white-space: nowrap;
  font-size: var(--fs-xs) !important; font-weight: 600 !important; line-height: 20px !important;
  padding: 0 7px 0 5px !important; border-radius: var(--r-xs) !important; margin: 0 !important;
  background: var(--surface-2) !important; color: var(--body) !important;
}
.st::before, body .fi-badge[data-tone]::before, body .pn-badge[data-tone]::before {
  content: '' !important; flex: none; width: 13px !important; height: 13px !important; border-radius: 0 !important;
  background: currentColor !important; -webkit-mask: var(--ic-info) center / contain no-repeat; mask: var(--ic-info) center / contain no-repeat;
}
.st--ok, body [data-tone="ok"]     { background: var(--ok-soft) !important;   color: var(--ok) !important; }
.st--warn, body [data-tone="warn"] { background: var(--warn-soft) !important; color: var(--warn) !important; }
.st--bad, body [data-tone="bad"]   { background: var(--bad-soft) !important;  color: var(--bad) !important; }
.st--info, body [data-tone="info"] { background: var(--info-soft) !important; color: var(--info) !important; }
.st--off, .st--muted, body [data-tone="off"] { background: var(--off-soft) !important; color: var(--off) !important; }
.st--ok::before, body [data-tone="ok"]::before     { -webkit-mask-image: var(--ic-ok) !important;   mask-image: var(--ic-ok) !important; }
.st--warn::before, body [data-tone="warn"]::before { -webkit-mask-image: var(--ic-warn) !important; mask-image: var(--ic-warn) !important; }
.st--bad::before, body [data-tone="bad"]::before   { -webkit-mask-image: var(--ic-bad) !important;  mask-image: var(--ic-bad) !important; }
.st--off::before, .st--muted::before, body [data-tone="off"]::before { -webkit-mask-image: var(--ic-off) !important; mask-image: var(--ic-off) !important; }
body .fi-badge[data-tone="none"]::before, body .pn-badge[data-tone="none"]::before { display: none; }
body .fi-badge[data-tone="none"] { padding-left: 7px !important; }
/* В строке списка состояние тише: без подложки, значок и слово. Заливка
   остаётся только у беды — то, ради чего список открывают. */
body .fi-ta-cell .fi-badge[data-tone]:not([data-tone="bad"]), .ob-table .st:not(.st--bad) { background: transparent !important; padding-left: 0 !important; }
.st--dot { width: 8px; height: 8px; padding: 0 !important; border-radius: 50% !important; background: currentColor !important; }
.st--dot::before { display: none; }

/* ── 9. Секции, инфолист, формы, всплывающее ─────────────────────────────── */
body .fi-section { border-radius: var(--r-lg) !important; box-shadow: none !important; border: 1px solid var(--line) !important; background: var(--surface) !important; }
body .fi-section-header { padding: 12px 16px !important; border-bottom: 1px solid var(--line-soft); }
body .fi-section-header-heading { font-size: var(--fs-md) !important; font-weight: 650 !important; color: var(--ink) !important; }
body .fi-in-entry { display: grid !important; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px !important; align-items: baseline; }
body .fi-in-entry-label { font-size: var(--fs-sm) !important; color: var(--mute) !important; font-weight: 500 !important; }
body .fi-in-entry-content, body .fi-in-entry .fi-in-text-item { font-size: var(--fs-md) !important; color: var(--ink) !important; }
body .fi-fo-field-label-content { font-weight: 550 !important; color: var(--ink) !important; }
body .fi-modal-window { border-radius: var(--r-lg) !important; box-shadow: var(--sh-modal) !important; }
body .fi-dropdown-panel { border-radius: var(--r-md) !important; box-shadow: var(--sh-pop) !important; border: 1px solid var(--line) !important; }
body .fi-wi-stats-overview-stat, body .fi-wi-widget .fi-section { box-shadow: none !important; }

/* ── 10. Общие узлы рукописных экранов (pn-*) ────────────────────────────── */
.pn-card, .hm-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: none !important; padding: var(--sp-4); min-width: 0;
}
.pn-card { margin-bottom: var(--sp-4); }
.pn-card-title { font-size: var(--fs-md) !important; font-weight: 650; color: var(--ink); margin-bottom: var(--sp-3); }
.pn-muted, .pn-note { font-size: var(--fs-sm) !important; color: var(--mute) !important; line-height: 1.55; }
.pn-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm) !important; }
.pn-table th { text-align: left; font-weight: 600; font-size: var(--fs-xs) !important; color: var(--mute); height: 36px; padding: 0 12px !important; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.pn-table td { height: var(--row-h); padding: 0 12px !important; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--body); }
.pn-card > .pn-table { margin: 0 calc(-1 * var(--sp-4)); width: calc(100% + 2 * var(--sp-4)); }
.pn-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.pn-input, .pn-select { padding: 0 10px; border: 1px solid var(--line-strong); height: var(--ctl-h) !important; border-radius: var(--r-sm) !important; font-size: var(--fs-sm) !important; border-color: var(--line-strong) !important; background: var(--surface) !important; color: var(--ink) !important; }
.pn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; cursor: pointer;
  height: var(--ctl-h) !important; border-radius: var(--r-sm) !important; font-size: var(--fs-sm) !important; font-weight: 550 !important;
  border: 1px solid var(--line-strong) !important; background: var(--surface) !important; color: var(--ink) !important; text-decoration: none; white-space: nowrap;
}
.pn-btn:hover { background: var(--surface-2) !important; }
.pn-btn--primary { background: var(--accent) !important; border-color: transparent !important; color: var(--on-accent) !important; }
.pn-btn--primary:hover { background: var(--accent-hover) !important; }
.pn-btn--danger { color: var(--bad) !important; border-color: color-mix(in srgb, var(--bad) 35%, var(--surface)) !important; }
.pn-btn--danger:hover { background: var(--bad-soft) !important; }
.pn-badge--ok { background: var(--ok-soft) !important; color: var(--ok) !important; }
.pn-badge--warn { background: var(--warn-soft) !important; color: var(--warn) !important; }
.pn-badge--danger { background: var(--bad-soft) !important; color: var(--bad) !important; }
.pn-badge--muted { background: var(--off-soft) !important; color: var(--off) !important; }
.pn-bar-fill { background: var(--mute) !important; }
.pn-bar-fill.is-warn { background: var(--warn) !important; } .pn-bar-fill.is-full { background: var(--bad) !important; }

/* ── 11. Образец экрана объекта: панель действий · список с флажками · карточка сбоку ── */
.ob-screen { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ob-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; min-height: 52px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ob-tool {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--body); font-size: var(--fs-sm); font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background-color .12s ease, color .12s ease;
}
.ob-tool:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.ob-tool:disabled { color: var(--faint); opacity: .55; cursor: not-allowed; }
.ob-tool-icon { width: 16px; height: 16px; flex: none; color: var(--mute); }
.ob-tool:disabled .ob-tool-icon { color: var(--faint); }
.ob-tool--primary { background: var(--accent); color: var(--on-accent); padding: 0 12px; margin-right: 4px; }
.ob-tool--primary .ob-tool-icon { color: currentColor; }
.ob-tool--primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.ob-tool--danger:not(:disabled) { color: var(--bad); } .ob-tool--danger:not(:disabled) .ob-tool-icon { color: var(--bad); }
.ob-tool--danger:hover:not(:disabled) { background: var(--bad-soft); color: var(--bad); }
.ob-sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.ob-spacer { flex: 1 1 auto; }
.ob-find { position: relative; display: inline-flex; align-items: center; flex: 0 1 220px; min-width: 120px; }
.ob-find input { height: 32px; width: 100%; padding: 0 10px 0 30px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); }
.ob-find input:focus { outline: 0; border-color: var(--line-strong); box-shadow: var(--focus-ring); }
.ob-find-icon { position: absolute; left: 9px; width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.ob-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-xs); color: var(--mute); background: var(--surface-2); }
.ob-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ob-table th { height: 36px; padding: 0 12px; text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--mute); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ob-table td { height: var(--row-h); padding: 0 12px; border-bottom: 1px solid var(--line-soft); color: var(--body); vertical-align: middle; white-space: nowrap; }
.ob-table tbody tr { cursor: pointer; transition: background-color .1s ease; }
.ob-table tbody tr:hover td { background: var(--surface-2); }
.ob-table tbody tr.is-checked td { background: var(--accent-soft); }
.ob-table tbody tr.is-open td { background: var(--surface-2); }
.ob-table tbody tr.is-open td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
.ob-table tbody tr:last-child td { border-bottom: 0; }
.ob-table .ob-check { width: 40px; padding: 0 0 0 16px; }
.ob-table .ob-main { color: var(--ink); font-weight: 550; }
.ob-table .ob-sub { display: block; font-size: var(--fs-xs); color: var(--mute); font-weight: 400; }
.ob-cb { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); accent-color: var(--ink); cursor: pointer; vertical-align: middle; }
.ob-foot { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--mute); }
.ob-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--body); font-weight: 600; }
.ob-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; }
.ob-empty-icon { width: 40px; height: 40px; padding: 9px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--mute); }
.ob-empty-title { margin: 4px 0 0; font-size: var(--fs-lg); font-weight: 650; color: var(--ink); }
.ob-empty-text { margin: 0 0 8px; max-width: 56ch; font-size: var(--fs-sm); color: var(--mute); line-height: 1.55; }
@media (max-width: 1280px) { .ob-toolbar { flex-wrap: wrap; } }
@media (max-width: 760px) {
  .ob-table .ob-hide-sm { display: none; }
  .ob-tool-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ob-tool--primary .ob-tool-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .ob-find { flex: 1 1 100%; order: 10; } .ob-find input { width: 100%; }
  .ob-table td { white-space: normal; }
}

/* карточка объекта сбоку: список остаётся на месте */
.ob-drawer-scrim { position: fixed; inset: 0; z-index: 45; background: var(--scrim); }
.ob-drawer {
  position: fixed; z-index: 46; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100vw; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--sh-modal);
  animation: ob-slide .18s ease-out;
}
@keyframes ob-slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ob-drawer-head { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); }
.ob-drawer-title { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-lg); font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ob-drawer-x { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--mute); cursor: pointer; }
.ob-drawer-x:hover { background: var(--surface-2); color: var(--ink); }
.ob-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.ob-drawer-body > .pn-card-title:first-child { display: none; }

/* ── 12. Знакомство (пустой кабинет) ─────────────────────────────────────── */
.ob { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 24px 8px; }
.ob-head { max-width: 720px; margin-bottom: 20px; }
.ob-title { margin: 0; font-size: var(--fs-xl); font-weight: 650; letter-spacing: -.015em; color: var(--ink); }
.ob-lead { margin: 6px 0 0; font-size: var(--fs-md); color: var(--mute); line-height: 1.55; }
.ob-steps { list-style: none; margin: 0; padding: 0; }
.ob-step { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 16px; padding-bottom: 24px; }
.ob-step:not(:last-child)::before { content: ''; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--line); }
.ob-step.is-done:not(:last-child)::before { background: var(--ok); opacity: .45; }
.ob-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font: 600 13px/1 var(--font-mono); background: var(--surface-2); color: var(--mute); box-shadow: inset 0 0 0 1px var(--line); }
.ob-step.is-current .ob-mark, .ob-step.is-attention .ob-mark, .ob-step.is-running .ob-mark { background: var(--ink); color: var(--surface); box-shadow: none; }
.ob-step.is-done .ob-mark { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.ob-step.is-failed .ob-mark { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.ob-mark-icon { width: 16px; height: 16px; }
.ob-body { min-width: 0; padding-top: 5px; }
.ob-step-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: var(--fs-lg); font-weight: 650; color: var(--ink); }
.ob-step.is-todo .ob-step-title { color: var(--mute); font-weight: 600; }
.ob-text { margin: 4px 0 0; font-size: var(--fs-md); color: var(--mute); line-height: 1.55; max-width: 72ch; }
.ob-body .pn-row { margin-top: 12px; }
.ob-term { margin-top: 14px; max-width: 880px; border-radius: var(--r-lg); overflow: hidden; background: var(--term-bg); border: 1px solid var(--term-line); }
.ob-term-bar { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 6px 0 14px; background: var(--term-bar); border-bottom: 1px solid var(--term-line); }
.ob-term-dots { display: inline-flex; gap: 6px; } .ob-term-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2d3540; }
.ob-term-meta { flex: 1; font-size: var(--fs-xs); color: var(--term-mute); }
.ob-term-meta .hm-mono { color: var(--term-ink); }
.ob-copy { height: 32px !important; }
.ob-copy-icon { width: 16px; height: 16px; }
.ob-term-code { margin: 0; padding: 16px; display: flex; gap: 12px; overflow-x: auto; color: var(--term-ink); font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }
.ob-prompt { color: var(--term-mute); user-select: none; }
.ob-note { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--mute); }
.ob-linkbtn { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ob-live { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; padding: 12px 14px; max-width: 880px; border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); color: var(--mute); line-height: 1.5; }
.ob-pulse { position: relative; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--info); }
.ob-pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--info); opacity: 0; animation: ob-ping 1.6s ease-out infinite; }
@keyframes ob-ping { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.6); opacity: 0; } }
.ob-found { margin-top: 14px; padding: 14px 16px; max-width: 880px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.ob-found-id { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ob-found-fp { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ob-found-fp code { padding: 4px 8px; border-radius: var(--r-xs); background: var(--surface-2); color: var(--ink); font-size: 12.5px; word-break: break-all; }
.ob-label { font-size: var(--fs-xs); font-weight: 600; color: var(--mute); }
/* короткий вид — полоса из трёх шагов над сводкой */
.ob--compact { padding: 16px 16px 0; }
.ob--compact .ob-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ob--compact .ob-step { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.ob--compact .ob-step::before { display: none; }
.ob--compact .ob-mark { width: 28px; height: 28px; }
.ob--compact .ob-body { padding-top: 3px; }
.ob--compact .ob-step-title { font-size: var(--fs-md); }
.ob--compact .ob-text { font-size: var(--fs-sm); }
.ob--compact .ob-found { padding: 10px 12px; }
@media (max-width: 900px) { .ob--compact .ob-steps { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ── 13. Главная, карточка сервера (panel/home/*) ─────────────────────────── */
.hm { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.hm a { text-decoration: none; }
.hm-dim { color: var(--mute); }
.hm-strong { font-weight: 600; color: var(--ink); }
.hm-grow { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-link { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); text-decoration: underline !important; text-decoration-color: var(--line-strong) !important; text-underline-offset: 3px; }
.hm-link:hover { text-decoration-color: currentColor !important; }
.hm-section { font-size: var(--fs-sm); font-weight: 650; color: var(--mute); margin: var(--sp-2) 0 calc(-1 * var(--sp-1)); }

.hm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: var(--sp-2); }
.hm-action {
  display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink);
  transition: border-color .12s ease, background-color .12s ease;
}
.hm-action:hover { border-color: var(--line-strong); background: var(--surface-2); }
.hm-action-icon { width: 20px; height: 20px; flex: none; color: var(--mute); }
.hm-action-text { display: flex; flex-direction: column; min-width: 0; }
.hm-action-label { font-size: var(--fs-md); font-weight: 600; line-height: 1.25; }
.hm-action-hint { font-size: var(--fs-xs); color: var(--mute); line-height: 1.35; }
.hm-action.is-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.hm-action.is-primary .hm-action-icon, .hm-action.is-primary .hm-action-hint { color: color-mix(in srgb, var(--on-accent) 80%, transparent); }
.hm-action.is-primary:hover { background: var(--accent-hover); }

.hm-grid { display: grid; gap: var(--sp-4); }
.hm-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hm-grid--1 { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1200px) { .hm-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .hm-grid--3 { grid-template-columns: minmax(0, 1fr); } }

.hm-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.hm-card-title { font-size: var(--fs-md); font-weight: 650; color: var(--ink); margin: 0; }
.hm-card-meta { font-size: var(--fs-xs); color: var(--mute); text-align: right; }
.hm-empty { font-size: var(--fs-sm); color: var(--mute); line-height: 1.55; margin: 0; max-width: 60ch; }
.hm-empty--ok { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.hm-nodata { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); color: var(--mute); line-height: 1.5; }
.hm-nodata strong { color: var(--ink); font-weight: 600; }
.hm-nodata-icon { width: 20px; height: 20px; flex: none; color: var(--faint); margin-top: 1px; }

.hm-disk { display: grid; grid-template-columns: 132px 1fr; gap: var(--sp-4); align-items: center; }
.hm-donut { width: 132px; height: 132px; }
.hm-donut-track { fill: none; stroke: var(--viz-free); stroke-width: 16; }
.hm-arc { fill: none; stroke-width: 16; stroke-linecap: butt; transition: stroke-width .15s ease; }
.hm-arc:hover { stroke-width: 19; }
.hm-arc--sites, .hm-sw--sites { stroke: var(--viz-1); background: var(--viz-1); }
.hm-arc--databases, .hm-sw--databases { stroke: var(--viz-2); background: var(--viz-2); }
.hm-arc--logs, .hm-sw--logs { stroke: var(--viz-3); background: var(--viz-3); }
.hm-arc--backups, .hm-sw--backups { stroke: var(--viz-4); background: var(--viz-4); }
.hm-arc--other, .hm-sw--other { stroke: var(--viz-other); background: var(--viz-other); }
.hm-arc--free, .hm-sw--free { stroke: var(--viz-free); background: var(--viz-free); box-shadow: inset 0 0 0 1px var(--line-strong); }
.hm-donut-big { font: 700 22px/1 var(--font-ui); fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.hm-donut-small { font: 500 11px/1 var(--font-ui); fill: var(--mute); text-anchor: middle; }
.hm-legend { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.hm-legend td { padding: 3px 0; color: var(--body); }
.hm-legend td + td { text-align: right; padding-left: 10px; }
.hm-legend-total td { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 600; color: var(--ink); }
.hm-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }
@media (max-width: 420px) { .hm-disk { grid-template-columns: 1fr; justify-items: center; } }

.hm-limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.hm-limit-head { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-sm); color: var(--body); margin-bottom: 5px; }
.hm-limit-head .hm-num { color: var(--ink); font-weight: 600; }
.hm-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hm-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--mute); min-width: 2px; }
.hm-limit--warn .hm-bar > span, .hm-meter.is-hot .hm-bar > span { background: var(--warn); }
.hm-limit--bad .hm-bar > span { background: var(--bad); }
.hm-limit-note { margin-top: 5px; font-size: var(--fs-xs); }
.hm-limit-note.st { display: inline-flex; }
.hm-limit-note .hm-link { margin-left: 6px; font-size: inherit; }
.hm-limit-note .hm-link--inline { margin-left: 0; white-space: nowrap; }
.hm-limit-note .st + .hm-dim { margin-left: 6px; }

.hm-kv { margin: 0; display: flex; flex-direction: column; }
.hm-kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.hm-kv > div:last-child { border-bottom: 0; }
.hm-kv dt { color: var(--mute); }
.hm-kv dd { margin: 0; color: var(--ink); text-align: right; }

.hm-list { list-style: none; margin: 0; padding: 0; }
.hm-list li { display: flex; align-items: center; gap: 10px; min-height: var(--row-h); border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); min-width: 0; }
.hm-list li:last-child { border-bottom: 0; }
.hm-list a:hover { text-decoration: underline; }
.hm-list li > a, .hm-list li > .hm-strong, .hm-list li > .st { flex: none; white-space: nowrap; }
.hm-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.hm-table th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--mute); height: 32px; padding: 0 12px 0 0; border-bottom: 1px solid var(--line); }
.hm-table td { height: var(--row-h); padding: 0 12px 0 0; border-bottom: 1px solid var(--line-soft); color: var(--body); }
.hm-table tr:last-child td { border-bottom: 0; }

.hm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.4fr); gap: var(--sp-3); }
@media (max-width: 1200px) { .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hm-kpi--load { grid-column: 1 / -1; } }
.hm-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.hm-kpi-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--mute); }
.hm-kpi-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.hm-kpi--ok .hm-kpi-label::before { background: var(--ok); }
.hm-kpi--warn .hm-kpi-label::before { background: var(--warn); }
.hm-kpi--bad .hm-kpi-label::before { background: var(--bad); }
.hm-kpi--load .hm-kpi-label::before { display: none; }
.hm-kpi-value { font-size: var(--fs-2xl); font-weight: 700; color: var(--ink); letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hm-kpi-value .hm-dim { font-size: var(--fs-lg); font-weight: 500; letter-spacing: 0; }
.hm-kpi-note { font-size: var(--fs-xs); color: var(--mute); }
.hm-kpi--bad .hm-kpi-value { color: var(--bad); }
.hm-mini { display: grid; grid-template-columns: 58px 1fr 40px; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--body); margin-top: 5px; }
.hm-mini i { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hm-mini b { display: block; height: 100%; background: var(--mute); border-radius: inherit; }
.hm-mini.is-hot b { background: var(--warn); }
.hm-mini .hm-num { text-align: right; font-weight: 600; color: var(--ink); }

.hm-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); }
.hm-hero-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: var(--fs-md); }
.hm-meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
@media (max-width: 760px) { .hm-meters { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); } }
.hm-meter-note { font-size: var(--fs-xs); margin-top: 5px; min-height: 1em; }

/* ── 14. Рукописные экраны: операции, файлы, терминал ─────────────────────── */
body .ops-split { grid-template-columns: minmax(380px, 5fr) minmax(420px, 7fr); gap: var(--sp-4); }
@media (max-width: 1100px) { body .ops-split { grid-template-columns: minmax(0, 1fr); } }
body .ops-row td { white-space: nowrap; }
body .ops-row td:nth-child(2) { white-space: normal; }
body .ops-row.is-selected td { background: var(--surface-2) !important; }
body .ops-row.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--ink); }
body .ops-row:hover td { background: var(--surface-2); }
body .ops-log:empty::before { content: 'Строк журнала пока нет: агент пришлёт их, как только начнёт работу.'; color: var(--term-mute); }
body .ops-log, body .fm-editor, body .term-screen {
  background: var(--term-bg) !important; color: var(--term-ink) !important; border: 1px solid var(--term-line);
  border-radius: var(--r-md) !important; font-family: var(--font-mono) !important; font-size: 13px !important;
  line-height: 1.6 !important; padding: 12px 14px !important;
}

/* ── 15. Телефон ─────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  /* Кнопка меню встаёт в полосу над содержимым, а не отдельной строкой над ней. */
  body .fi-layout-sidebar-toggle-btn-ctn { position: fixed; top: 8px; left: 10px; z-index: 30; padding: 0 !important; margin: 0 !important; }
  .sh-bar { padding: 0 16px 0 60px; height: 56px; }
  .sh-server-ip, .sh-server-state { display: none; }
}
@media (max-width: 640px) {
  body.bf-density-compact .fi-main { padding: 16px 16px 24px !important; }
  body .fi-header { flex-wrap: wrap; gap: 8px !important; }
  body .fi-header-heading { font-size: 18px !important; }
  /* На телефоне вкладки — второй строкой во всю ширину, листаются пальцем. */
  .sh-bar { flex-wrap: wrap; height: auto; padding: 8px 16px; row-gap: 8px; }
  /* первая строка — переключатель и поиск (слева место под кнопкой меню), вторая — вкладки */
  .sh-tools { flex: 0 0 100%; box-sizing: border-box; padding-left: 44px; justify-content: flex-end; order: 1; }
  .sh-tab--home { order: 2; }
  .sh-tabs-wrap { order: 3; flex: 1 1 0; }
  .sh-tab { height: 36px; }
  .sh-tab-x { opacity: 1; }
  .sh-more-menu { right: 0; }
  .sh-search { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  .sh-search-label, .sh-kbd { display: none; }
  .sh-server-btn { height: 40px; }
  .sh-server-name { max-width: 150px; }
  .hm-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-action { min-height: 52px; padding: 8px 10px; gap: 8px; }
  .hm-action-hint { display: none; }
  .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hm-kpi-value { font-size: 22px; }
  body .fi-in-entry { grid-template-columns: minmax(0, 1fr); gap: 2px !important; }
  body .fi-ta-header-toolbar .fi-input-wrp { min-width: 0; }
  .ob { padding: 16px 16px 4px; }
  .ob-step { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .ob-step:not(:last-child)::before { left: 13px; top: 32px; }
  .ob-mark { width: 28px; height: 28px; }
  .ob-term-meta { display: none; }
  .ob-term-bar { justify-content: space-between; }
  .ob-drawer { width: 100vw; border-left: 0; }
  .pn-btn, .ob-tool { height: 40px !important; }
}

/* Имя сервера: небольшое окно поверх (App\Panel\Shell\ServerName). */
.sn-dialog { width: 440px; top: 16vh; }
.sn-body { padding: 20px; }
.sn-title { margin: 0; font-size: var(--fs-lg); font-weight: 650; color: var(--ink); }
.sn-text { margin: 6px 0 16px; font-size: var(--fs-sm); line-height: 1.55; color: var(--mute); }
.sn-label { font-size: var(--fs-xs); font-weight: 600; color: var(--mute); }
.sn-dialog .pn-field { display: flex; flex-direction: column; gap: 6px; }
.sn-dialog .pn-input { width: 100%; min-width: 0; }
.sn-hint { margin: 6px 0 0; min-height: 18px; font-size: var(--fs-xs); color: var(--mute); }
.sn-error { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--bad); }
.sn-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Журнал/стенограмма в карточке сбоку и на экранах: тёмный блок, как терминал. */
.ob-log { margin: 0; padding: 12px 14px; border-radius: var(--r-md); max-height: 60vh; overflow: auto; background: var(--term-bg); color: var(--term-ink); border: 1px solid var(--term-line); font: 12.5px/1.55 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.ob-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0 0 16px; font-size: var(--fs-sm); }
.ob-dl dt { color: var(--mute); }
.ob-dl dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.ob-section { margin: 20px 0 8px; font-size: var(--fs-sm); font-weight: 650; color: var(--ink); }
select.ob-inline { width: auto; max-width: 190px; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); padding: 0 28px 0 10px; }
.ob-field-label { font-size: var(--fs-xs); color: var(--mute); margin-right: 4px; white-space: nowrap; }
.ob-empty-form { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Наблюдение: плитки «сейчас» и малые графики за сутки (по одному ряду). */
.mn-asked { font-size: var(--fs-xs); padding-right: 4px; }
.mn-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.mn-tile { padding: 16px; min-width: 0; }
.mn-tile + .mn-tile { border-left: 1px solid var(--line-soft); }
.mn-label { font-size: var(--fs-xs); font-weight: 600; color: var(--mute); }
.mn-value { margin: 4px 0 10px; font-size: 24px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.mn-meter { height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--viz-1) 16%, var(--surface)); overflow: hidden; }
.mn-meter > span { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--viz-1); }
.mn-meter.is-warn > span { background: var(--warn); } .mn-meter.is-warn { background: var(--warn-soft); }
.mn-meter.is-bad > span { background: var(--bad); } .mn-meter.is-bad { background: var(--bad-soft); }
.mn-note { margin-top: 8px; font-size: var(--fs-xs); color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mn-chart { margin: 0; padding: 16px 16px 12px; min-width: 0; }
.mn-chart + .mn-chart { border-left: 1px solid var(--line-soft); }
.mn-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; font-size: var(--fs-sm); flex-wrap: wrap; }
.mn-chart-now .hm-num { font-weight: 650; color: var(--ink); }
.mn-chart-now .hm-dim { font-size: var(--fs-xs); }
.mn-plot-wrap { display: flex; gap: 6px; }
.mn-yaxis { display: flex; flex-direction: column; justify-content: space-between; height: 132px; margin-top: -6px; font: 10.5px/12px var(--font-mono); color: var(--faint); text-align: right; min-width: 20px; }
.mn-plot { position: relative; flex: 1; height: 120px; cursor: crosshair; }
.mn-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mn-grid, .mn-base { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mn-line { fill: none; stroke: var(--viz-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mn-area { fill: var(--viz-1); opacity: .1; stroke: none; }
.mn-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--viz-1); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.mn-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-strong); pointer-events: none; }
.mn-tip { position: absolute; top: -8px; transform: translate(8px, -100%); padding: 4px 8px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-card); font-size: var(--fs-xs); white-space: nowrap; pointer-events: none; z-index: 2; }
.mn-tip.is-left { transform: translate(calc(-100% - 8px), -100%); }
.mn-tip b { color: var(--ink); margin-left: 4px; }
.mn-xaxis { display: flex; justify-content: space-between; margin: 6px 0 0 26px; font-size: 10.5px; font-family: var(--font-mono); }
.mn-table { border-top: 1px solid var(--line); }
.mn-table summary { padding: 10px 16px; font-size: var(--fs-sm); color: var(--mute); cursor: pointer; }
.mn-table summary:hover { color: var(--ink); }
.mn-table .ob-table { border-top: 1px solid var(--line); }
.ob-table--static tbody tr { cursor: default; }

@media (max-width: 1100px) { .mn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mn-tile:nth-child(3) { border-left: 0; } .mn-tile:nth-child(n+3) { border-top: 1px solid var(--line-soft); } .mn-charts { grid-template-columns: 1fr; } .mn-chart + .mn-chart { border-left: 0; border-top: 1px solid var(--line-soft); } }
@media (max-width: 640px) { .mn-tiles { grid-template-columns: 1fr 1fr; } .mn-value { font-size: 20px; } .mn-note { white-space: normal; } .mn-tile { padding: 14px 12px; } }

/* Журнал операций: карточка сбоку. */
.ops-live { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 600; color: var(--ok); }
.ops-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ops-pulse 1.6s ease-in-out infinite; }
@keyframes ops-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ops-live::before { animation: none; } }
.op-steps { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.op-steps li { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.op-steps li:last-child { border-bottom: 0; }
.op-steps .st, .op-steps .hm-dim:first-child { flex: none; min-width: 96px; }
.op-step-name { flex: 1; min-width: 0; color: var(--body); }
.op-step-id { flex: none; font-size: var(--fs-xs); }
.op-more { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.op-more summary { font-size: var(--fs-sm); color: var(--mute); cursor: pointer; }
@media (max-width: 640px) { .ob-toolbar .ob-hide-sm { display: none; } .ob-inline { flex: 1 1 40%; } }

/* Журнал посещений на телефоне: без адреса, почта переносится. */
@media (max-width: 640px) { .hm-hide-sm { display: none; } .hm-table .hm-wrap { max-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
