/* Вид страниц приложения — по утверждённому макету docs/design/mockup.html (стиль KeeBooks / accounting-ai-vow): переменные, боковое
   меню в два блока, шапка с крошками, карточки, грид с прокруткой внутри таблицы, массовые действия, окна. Страницы входа — app.css. */
:root {
  --primary: #2ed38a; --primary-dark: #20b874; --primary-soft: #e7faf1;
  --fg: #111827; --text: #374151; --muted: #6b7280; --line: #e5e7eb; --line-strong: #d1d5db; --field-line: #cad5e2;
  --surface: #fff; --canvas: #f9fafb; --panel: #f3f4f6; --accent: #059669;
  --danger: #dc2626; --ok: #16a34a; --warn: #d97706;
  --radius: .5rem; --shadow: 0 1px 2px rgba(0,0,0,.05);
  --sidebar-w: 16rem; --banner-h: 0px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--fg); -webkit-text-size-adjust: 100%;
}
html.dark {
  --fg: #f1f5f9; --text: #cad5e2; --muted: #90a1b9; --line: #314158; --line-strong: #45556c; --field-line: #45556c;
  --surface: #1d293d; --canvas: #0f172b; --panel: #314158; --primary-soft: #0f3d2a; --accent: #4ade80;
  color-scheme: dark;
}
html.collapsed { --sidebar-w: 4rem; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); min-height: 100vh; padding-inline-start: var(--sidebar-w); padding-top: var(--banner-h); transition: padding .3s; color: var(--fg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8125rem; }


/* ---- Боковая панель ---- */
.sidebar { position: fixed; top: var(--banner-h); bottom: 0; inset-inline-start: 0; width: var(--sidebar-w); z-index: 40; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1f2937 0%, #111827 50%, #000 100%); color: #fff; border-inline-end: 1px solid #4b5563; transition: width .3s; overflow: hidden; }
.sidebar .logo { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem; color: #fff; font-weight: 700; min-height: 3.5rem; }
.sidebar .logo:hover { text-decoration: none; }
.logo-mark { width: 2rem; height: 2rem; border-radius: .5rem; background: var(--primary); color: #0b2a1c; display: grid; place-items: center; font-weight: 800; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.logo-text small { color: #90a1b9; font-weight: 500; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: .25rem .75rem 1rem; display: flex; flex-direction: column; gap: .125rem; }
.nav-block { color: #6b7280; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: .9rem .75rem .35rem; white-space: nowrap; }
.sidebar nav a { display: flex; align-items: center; gap: .75rem; padding: .4rem .75rem; border-radius: var(--radius); color: #fff; font-size: .875rem; font-weight: 500; white-space: nowrap; }
.sidebar nav a:hover { background: rgba(75,85,99,.25); text-decoration: none; }
.sidebar nav a[aria-current='page'] { background: rgba(75,85,99,.35); border-inline-start: 4px solid #9ca3af; margin-inline-start: -.25rem; }
.sidebar nav a .count { margin-inline-start: auto; font-size: .7rem; font-style: normal; background: rgba(255,255,255,.12); padding: .05rem .45rem; border-radius: 1rem; }
.sidebar nav a .count.bad { background: #b91c1c; }
.sidebar .side-foot { padding: .75rem; border-top: 1px solid #374151; font-size: .75rem; color: #90a1b9; white-space: nowrap; overflow: hidden; }
html.collapsed .sidebar .logo-text, html.collapsed .nav-block, html.collapsed .sidebar nav a span, html.collapsed .sidebar nav a .count, html.collapsed .side-foot { display: none; }
html.collapsed .sidebar .logo { justify-content: center; padding-inline: 0; }
.sidebar-toggle { position: fixed; bottom: 1.25rem; inset-inline-start: calc(var(--sidebar-w) - .875rem); z-index: 50; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  border: 1px solid #4b5563; background: rgba(17,24,39,.95); color: #d1d5db; display: grid; place-items: center; cursor: pointer; transition: inset-inline-start .3s; padding: 0; }
.sidebar-toggle .icon { width: 1rem; height: 1rem; }
html.collapsed .sidebar-toggle .icon { transform: scaleX(-1); }

/* ---- Шапка ---- */
header.top { position: sticky; top: var(--banner-h); z-index: 30; height: 3.5rem; display: flex; align-items: center; gap: .75rem; padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--line); }
html.dark header.top { background: linear-gradient(90deg, #1d293d, #0f172b 50%, #000); }
header.top .menu-toggle { display: none; }
.crumbs { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.crumbs a { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.crumbs .sep { color: var(--line-strong); }
.crumbs h1 { margin: 0; font-size: 1.25rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tools { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.search { position: relative; }
.search input { width: 16rem; padding-inline-start: 2rem; background: var(--canvas); }
.search .icon { position: absolute; inset-inline-start: .55rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted); }
.icon-btn { background: none; border: 0; padding: .45rem; border-radius: var(--radius); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; position: relative; }
.icon-btn:hover { background: var(--panel); color: var(--fg); }
.icon-btn .dot { position: absolute; top: .3rem; inset-inline-end: .3rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--danger); }
.avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: #86efac; color: #14532d; display: grid; place-items: center; font-weight: 600; font-size: .85rem; border: 0; cursor: pointer; padding: 0; }
.avatar.admin { background: #fde68a; color: #78350f; }

/* ---- Содержимое ---- */
main { padding: 1rem; max-width: 84rem; margin: 0 auto; }
h2 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .75rem; }
p { color: var(--text); line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid2 > *, .grid3 > *, .stack > * { min-width: 0; }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); min-width: 0; }
.box-head { display: flex; align-items: center; gap: .625rem; padding: .875rem 1.25rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.box-head .icon { color: var(--primary-dark); }
.box-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.box-head .desc { flex-basis: 100%; margin: -.25rem 0 0 1.875rem; font-size: .8125rem; color: var(--muted); }
.box-head .tools { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.box-body { padding: 1rem 1.25rem; overflow-x: auto; }
.box-body.flush { padding: 0; }
.box-foot { padding: .75rem 1.25rem; border-top: 1px solid var(--line); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { color: var(--muted); font-size: .8125rem; display: flex; align-items: center; gap: .375rem; }
.kpi .label .icon { width: 1rem; height: 1rem; }
.kpi .value { font-size: 1.625rem; font-weight: 600; margin: .35rem 0 .2rem; }
.kpi .value small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.kpi .sub { font-size: .8125rem; color: var(--muted); }
.meter { height: .375rem; background: var(--panel); border-radius: 1rem; overflow: hidden; margin-top: .5rem; }
.meter > i { display: block; height: 100%; background: var(--primary); border-radius: 1rem; }
.meter > i.warn { background: var(--warn); } .meter > i.bad { background: var(--danger); }
.spark { display: block; width: 100%; height: 2.5rem; margin-top: .5rem; }

.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: flex; align-items: center; gap: .75rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); }
.lines li:last-child { border-bottom: 0; }
.lines .main { min-width: 0; flex: 1; }
.lines .main b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lines .main span { font-size: .8125rem; color: var(--muted); }
.lines .end { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; font-size: .8125rem; color: var(--muted); white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.empty .icon { width: 2.5rem; height: 2.5rem; color: var(--line-strong); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .125rem .55rem; border-radius: 1rem; font-size: .75rem; font-weight: 600; background: var(--panel); color: var(--text); white-space: nowrap; }
.badge .icon { width: .85rem; height: .85rem; }
.badge.ok { background: #dcfce7; color: #166534; } .badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; } .badge.info { background: #dbeafe; color: #1e40af; }
.badge.plan { background: #ede9fe; color: #5b21b6; }
html.dark .badge.ok { background: #14532d; color: #bbf7d0; } html.dark .badge.warn { background: #78350f; color: #fde68a; }
html.dark .badge.bad { background: #7f1d1d; color: #fecaca; } html.dark .badge.info { background: #1e3a8a; color: #bfdbfe; }
html.dark .badge.plan { background: #4c1d95; color: #ddd6fe; }
.state { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 500; white-space: nowrap; }
.state::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--muted); }
.state.running::before, .state.active::before { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.state.sleeping::before { background: #60a5fa; } .state.static::before { background: var(--primary); }
.state.stopped::before, .state.suspended::before { background: #9ca3af; } .state.failed::before { background: var(--danger); }
.state.warn::before { background: var(--warn); }

button, .btn { font: inherit; font-size: .875rem; font-weight: 500; display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .75rem; border-radius: .375rem;
  border: 1px solid var(--field-line); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; line-height: 1.25rem; }
button:hover, .btn:hover { background: var(--canvas); text-decoration: none; }
button .icon, .btn .icon { width: 1rem; height: 1rem; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.primary:hover, .btn.primary:hover { background: var(--primary-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:disabled:hover { background: var(--surface); } button.primary:disabled:hover { background: var(--primary); }
button.danger { color: var(--danger); border-color: #fca5a5; }
button.danger:hover { background: #fef2f2; }
html.dark button.danger:hover { background: #3b1111; }
button.ghost { border-color: transparent; background: none; }
button.small, .btn.small { padding: .2rem .55rem; font-size: .8rem; }
button.big { padding: .6rem 1rem; font-size: .9375rem; }
input, select, textarea { font: inherit; font-size: .875rem; padding: .375rem .625rem; border: 1px solid var(--field-line); border-radius: .375rem; background: var(--surface); color: var(--fg); min-height: 2.25rem; min-width: 0; width: 100%; }
input[type='checkbox'], input[type='radio'] { width: auto; min-height: 0; accent-color: var(--primary); }
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
input:disabled { background: var(--canvas); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.field label { font-size: .875rem; font-weight: 500; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form .wide { grid-column: 1 / -1; }
.sub-label { grid-column: 1 / -1; font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: .25rem; }
.inline { display: flex; gap: .5rem; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .875rem; }
.switch input { appearance: none; width: 2.25rem; height: 1.25rem; min-height: 0; border-radius: 1rem; background: var(--line-strong); position: relative; border: 0; padding: 0; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ''; position: absolute; top: .125rem; inset-inline-start: .125rem; width: 1rem; height: 1rem; border-radius: 50%; background: #fff; transition: inset-inline-start .2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { inset-inline-start: 1.125rem; }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--field-line); border-radius: .5rem; padding: .125rem; background: var(--canvas); }
.seg button { border: 0; background: none; padding: .3rem .75rem; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); color: var(--fg); }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
.choice { border: 1.5px solid var(--line); border-radius: .75rem; padding: 1rem; cursor: pointer; background: var(--surface); display: flex; gap: .75rem; align-items: flex-start; }
.choice:hover { border-color: var(--field-line); }
.choice.on { border-color: var(--primary); background: var(--primary-soft); }
.choice .icon { width: 1.75rem; height: 1.75rem; color: var(--primary-dark); }
.choice b { display: block; margin-bottom: .2rem; }
.choice span { font-size: .8125rem; color: var(--muted); }
.steps { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.steps span { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--muted); }
.steps span i { width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-style: normal; font-size: .75rem; font-weight: 600; }
.steps span.on { color: var(--fg); font-weight: 500; } .steps span.on i { border-color: var(--primary); background: var(--primary); color: #fff; }
.steps .line { width: 2rem; height: 1px; background: var(--line-strong); align-self: center; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { text-align: start; font-weight: 500; color: var(--muted); font-size: .8125rem; padding: .625rem 1rem; background: var(--canvas); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--canvas); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
td .sub { display: block; font-size: .8rem; color: var(--muted); }
td.actions { text-align: end; white-space: nowrap; }
td.actions > * + * { margin-inline-start: .25rem; }
.inf { font-size: 1.1rem; line-height: 1; color: var(--muted); }

.site-hero { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem 1.25rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.site-hero .ava { width: 3rem; height: 3rem; border-radius: .75rem; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 1.1rem; }
.site-hero .ava .icon { width: 1.5rem; height: 1.5rem; }
.site-hero h2 { margin: 0 0 .2rem; font-size: 1.125rem; }
.site-hero .meta { display: flex; gap: .875rem; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); align-items: center; }
.site-hero .tools { margin-inline-start: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .125rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .7rem; color: var(--muted); font-weight: 500; font-size: .875rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a .icon { width: 1rem; height: 1rem; }
.tabs a:hover { color: var(--fg); text-decoration: none; }
.tabs a.on { color: var(--fg); border-bottom-color: var(--primary); }

/* настройки — как у KeeBooks: вкладки сверху, разделы слева, карточки справа, сохранение внизу */
.set-top { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 0 1rem; margin-bottom: 1rem; }
.set-top .tabs { border: 0; margin: 0; }
.set-top .tabs a { padding: .85rem .8rem; }
.set-top .search { margin-inline-start: auto; }
.set-top .search input { width: 13rem; }
.set-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: start; padding-bottom: 4.5rem; }
.set-nav { position: sticky; top: calc(var(--banner-h) + 4.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: .5rem; }
.set-nav .nav-block { color: var(--muted); padding: .5rem .5rem .35rem; }
.set-nav a { display: block; padding: .5rem .625rem; border-radius: .5rem; color: var(--fg); font-size: .875rem; font-weight: 500; }
.set-nav a span { display: block; font-size: .75rem; color: var(--muted); font-weight: 400; }
.set-nav a:hover { background: var(--canvas); text-decoration: none; }
.set-nav a.on { background: var(--primary-soft); color: var(--accent); }
.save-bar { position: fixed; bottom: 0; inset-inline-start: var(--sidebar-w); inset-inline-end: 0; z-index: 35; background: var(--surface); border-top: 1px solid var(--line); padding: .625rem 1.5rem; display: flex; align-items: center; gap: 1rem; font-size: .875rem; transition: inset-inline-start .3s; }

.kv { display: grid; grid-template-columns: 11rem 1fr; gap: .55rem 1rem; font-size: .875rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.drop { border: 2px dashed var(--field-line); border-radius: .75rem; padding: 2rem 1rem; text-align: center; color: var(--muted); background: var(--canvas); }
.drop .icon { width: 2.25rem; height: 2.25rem; color: var(--primary-dark); }
.drop b { color: var(--fg); display: block; margin: .5rem 0 .25rem; }
.console { background: #0b1220; color: #d1e7dd; border-radius: .5rem; padding: .875rem 1rem; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; line-height: 1.6; overflow-x: auto; white-space: pre; max-height: 26rem; }
.console .e { color: #fca5a5; } .console .w { color: #fde68a; } .console .d { color: #64748b; }
.copy { display: flex; gap: .5rem; align-items: center; background: var(--canvas); border: 1px solid var(--line); border-radius: .375rem; padding: .375rem .375rem .375rem .75rem; }
.copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.note { display: flex; gap: .625rem; padding: .75rem 1rem; border-radius: .5rem; font-size: .875rem; background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; line-height: 1.5; }
.note.warn { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.note.bad { background: #fef2f2; color: #7f1d1d; border-color: #fecaca; }
.note.plan { background: #f5f3ff; color: #4c1d95; border-color: #ddd6fe; }
.note.ok { background: #f0fdf4; color: #14532d; border-color: #bbf7d0; }
html.dark .note { background: #172554; color: #bfdbfe; border-color: #1e3a8a; }
html.dark .note.warn { background: #422006; color: #fde68a; border-color: #78350f; }
html.dark .note.bad { background: #450a0a; color: #fecaca; border-color: #7f1d1d; }
html.dark .note.plan { background: #2e1065; color: #ddd6fe; border-color: #4c1d95; }
html.dark .note.ok { background: #052e16; color: #bbf7d0; border-color: #14532d; }
.note .icon { flex: none; margin-top: .05rem; }
.danger-zone { border-color: #fecaca; }
.danger-zone .box-head .icon { color: var(--danger); }
.filters { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
.filters input, .filters select { width: auto; }

/* генератор расписания — как в HestiaCP */
.cron-gen { background: var(--canvas); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; }
.cron-gen .tabs { margin-bottom: .875rem; }
.cron-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; }
.cron-fields input { text-align: center; font-family: ui-monospace, Consolas, monospace; }
.cron-human { display: flex; gap: .5rem; align-items: center; padding: .75rem 1rem; border-radius: .5rem; background: var(--primary-soft); color: var(--fg); font-size: .9375rem; }
.cron-human .icon { color: var(--primary-dark); }
.when-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; font-size: .875rem; }
.when-row select, .when-row input { width: auto; }

/* модальное окно и уведомление */
dialog { border: 0; border-radius: .75rem; padding: 0; width: min(34rem, calc(100vw - 2rem)); box-shadow: 0 25px 50px -12px rgba(0,0,0,.35); background: var(--surface); color: var(--fg); }
dialog::backdrop { background: rgba(15,23,42,.5); }
dialog .box-body { display: flex; flex-direction: column; gap: .875rem; max-height: 70vh; overflow-y: auto; }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%) translateY(150%); background: #111827; color: #fff; padding: .6rem 1rem; border-radius: .5rem; font-size: .875rem; transition: transform .25s; z-index: 90; display: flex; gap: .5rem; align-items: center; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast .icon { color: var(--primary); }



@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid3 { grid-template-columns: 1fr 1fr; } .form.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .grid2, .grid3, .form, .form.three { grid-template-columns: 1fr; } .search input { width: 10rem; } .kv { grid-template-columns: 1fr; gap: .15rem .5rem; } .kv dd { margin-bottom: .5rem; }
  .set-layout { grid-template-columns: 1fr; } .set-nav { position: static; display: flex; overflow-x: auto; } .set-nav .nav-block { display: none; } .set-nav a { white-space: nowrap; } .set-nav a span { display: none; }
  .cron-fields { grid-template-columns: repeat(5, minmax(3rem, 1fr)); } }
@media (max-width: 767px) {
  body { padding-inline-start: 0; }
  .sidebar, .sidebar-toggle { display: none; }
  body.menu-open .sidebar { display: flex; width: 17rem; box-shadow: 0 0 3rem rgba(0,0,0,.5); }
  header.top .menu-toggle { display: inline-grid; }
  header.top.has-back .menu-toggle { display: none; }
  .search { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .site-hero .tools { margin-inline-start: 0; width: 100%; }
  .save-bar { inset-inline-start: 0; }
  .set-top .search { display: none; }
  button, .btn { white-space: normal; text-align: start; }
}

/* ---- Грид списка — как у KeeBooks: поиск, «Колонки», «Фильтры», справа действия; сортировка по заголовку ---- */
.grid-bar { display: flex; gap: .5rem; align-items: center; padding: .625rem .75rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.grid-bar .q { position: relative; width: 16rem; max-width: 100%; }
.grid-bar .q input { padding-inline-start: 2rem; background: var(--canvas); }
.grid-bar .q .icon { position: absolute; inset-inline-start: .55rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted); }
.tool { border-color: transparent; background: none; color: var(--text); position: relative; }
.tool:hover { background: var(--panel); }
.tool .cnt { min-width: 1.1rem; height: 1.1rem; border-radius: 1rem; background: var(--primary); color: #fff; font-size: .6875rem; display: inline-grid; place-items: center; padding: 0 .3rem; }
.tool.on { background: var(--primary-soft); color: var(--accent); }
.grid-bar .right { margin-inline-start: auto; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.cols { position: relative; }
.cols > summary { list-style: none; }
.cols > summary::-webkit-details-marker { display: none; }
.cols-menu { position: absolute; top: calc(100% + .25rem); inset-inline-start: 0; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; box-shadow: 0 10px 25px rgba(0,0,0,.12); padding: .375rem; min-width: 14rem; }
.cols-menu label { display: flex; gap: .5rem; align-items: center; padding: .35rem .5rem; border-radius: .375rem; font-size: .875rem; cursor: pointer; white-space: nowrap; }
.cols-menu label:hover { background: var(--canvas); }
.grid-filters { display: none; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .75rem; padding: .75rem; border-bottom: 1px solid var(--line); background: var(--canvas); }
.grid-filters.open { display: grid; }
.grid-filters .field label { font-size: .8125rem; color: var(--muted); font-weight: 500; }
table.list th.sortable { cursor: pointer; user-select: none; }
table.list th.sortable:hover { color: var(--fg); }
table.list th .arr { display: inline-block; margin-inline-start: .3rem; font-size: .65rem; color: var(--line-strong); }
table.list th[aria-sort] .arr { color: var(--fg); }
table.list tbody tr:nth-child(even) td { background: var(--canvas); }
table.list tbody tr.click:hover td { background: var(--primary-soft); }
table.list th.ic { text-align: center; }
table.list th.ic .icon { width: 1.1rem; height: 1.1rem; vertical-align: middle; }
table.list td.c { text-align: center; }
.grid-foot { display: flex; align-items: center; gap: .75rem; padding: .625rem 1rem; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); flex-wrap: wrap; }
.grid-foot .pages { margin-inline-start: auto; display: flex; gap: .25rem; align-items: center; }
.title-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.4rem; padding: 0 .45rem; border-radius: 1rem; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 600; margin-inline-start: .5rem; vertical-align: middle; }
.dots { border-color: transparent; background: none; padding: .2rem .4rem; }
.legend { display: flex; gap: .25rem 1rem; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.legend span { display: inline-flex; gap: .3rem; align-items: center; }
.legend .icon { width: 1rem; height: 1rem; }

/* «Требует внимания» на обзоре — компактнее, чтобы не кричал */
.lines.compact li { padding: .55rem 1.25rem; gap: .625rem; }
.lines.compact .icon { width: 1rem; height: 1rem; color: var(--muted); }
.lines.compact .main b { font-size: .8125rem; font-weight: 500; }
.lines.compact .main span { font-size: .75rem; }
.lines.compact .lvl { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.lvl.bad { background: var(--danger); } .lvl.warn { background: var(--warn); } .lvl.info { background: #60a5fa; }

/* страница редактирования — как у KeeBooks: стрелка назад, одна карточка на всю ширину, разделы, полоса сохранения */
.edit-card { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); margin-bottom: 4.5rem; }
.edit-card .edit-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 0 1rem; }
.edit-card .edit-tabs .tabs { border: 0; margin: 0; }
.edit-card .edit-tabs .tools { margin-inline-start: auto; }
.edit-sec { padding: 1.25rem 1.25rem .5rem; }
[hidden] { display: none !important; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.hc svg { width: 100%; height: 13.5rem; display: block; }
@media (max-width: 1024px) { .hc svg { height: 9.5rem; } }
.hc-bar { fill: var(--primary); opacity: .5; transition: opacity .15s; } .hc-bar:hover { opacity: 1; } .hc-bar.peak { fill: var(--primary-dark); opacity: 1; }
.hc-sleep { fill: #60a5fa; opacity: .13; }
.hc-grid { stroke: var(--line); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.hc-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .4rem; }
.hc-legend { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: .85rem; }
.hc-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.hc-k { width: .7rem; height: .7rem; border-radius: .2rem; display: inline-block; } .hc-k.bar { background: var(--primary); opacity: .5; } .hc-k.peak { background: var(--primary-dark); } .hc-k.sleep { background: #60a5fa; opacity: .35; }
.health { list-style: none; margin: 0; padding: 0; }
.health li + li { border-top: 1px solid var(--line); }
.health a { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; color: inherit; text-decoration: none; }
.health a:hover { background: var(--canvas); }
.health .main { flex: 1; min-width: 0; } .health .main b { display: block; font-weight: 500; font-size: .875rem; color: var(--fg); } .health .main span { font-size: .8rem; color: var(--muted); }
.health a > .icon { width: 1rem; height: 1rem; color: var(--muted); flex: none; }
.hico { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; flex: none; } .hico .icon { width: 1rem; height: 1rem; }
.hico.ok { background: #dcfce7; color: var(--ok); } .hico.warn { background: #fef3c7; color: var(--warn); } .hico.bad { background: #fee2e2; color: var(--danger); } .hico.off { background: var(--panel); color: var(--muted); }
html.dark .hico.ok { background: #14532d; color: #bbf7d0; } html.dark .hico.warn { background: #78350f; color: #fde68a; } html.dark .hico.bad { background: #7f1d1d; color: #fecaca; }
@media (max-width: 1024px) { .ov-grid { grid-template-columns: 1fr; } }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--hover, rgba(127,127,127,.06)); }
.edit-sec + .edit-sec { border-top: 1px solid var(--line); }
.edit-sec h3 { margin: 0 0 .25rem; font-size: 1rem; font-weight: 600; }
.edit-sec > p { margin: 0 0 1rem; font-size: .8125rem; color: var(--muted); }
.form.four { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: .75rem; }
.lim { display: flex; flex-direction: column; gap: .375rem; }
.lim .inline input { flex: 1; }
.lim .unl { font-size: .8rem; color: var(--muted); display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; }
.title-back { display: inline-grid; place-items: center; padding: .3rem; color: var(--muted); border-radius: .375rem; }
.title-back:hover { background: var(--panel); color: var(--fg); }

/* статистика файрвола */
.bars { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: 9rem 1fr 4rem; gap: .75rem; align-items: center; font-size: .8125rem; }
.bar-row .track { height: .5rem; background: var(--panel); border-radius: 1rem; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--danger); opacity: .75; border-radius: 1rem; }
.bar-row .n { text-align: end; font-variant-numeric: tabular-nums; color: var(--muted); }
.src { font-size: .75rem; color: var(--muted); }
.pick-list { display: flex; flex-direction: column; gap: .5rem; }
.pick-list label { display: flex; gap: .6rem; align-items: flex-start; font-size: .875rem; cursor: pointer; }
.pick-list label span { color: var(--muted); font-size: .8rem; display: block; }
.radio-rows { display: flex; flex-direction: column; gap: .5rem; }
.radio-rows label { display: flex; gap: .6rem; align-items: center; font-size: .875rem; flex-wrap: wrap; }
.radio-rows label > input[type='text'], .radio-rows label > select { flex: 1; min-width: 12rem; width: auto; }

@media (max-width: 1100px) { .form.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .form.four { grid-template-columns: 1fr; } .bar-row { grid-template-columns: 6rem 1fr 3rem; } .grid-bar .q { width: 100%; } }
.grid2.mbx { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 860px) { .grid2.mbx { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: .375rem; align-items: center; padding: .375rem; border: 1px solid var(--field-line); border-radius: .375rem; background: var(--surface); }
.chips .chip { display: inline-flex; align-items: center; gap: .2rem; background: var(--panel); border-radius: .375rem; padding: .1rem .15rem .1rem .5rem; }
.chips .chip button { border: 0; background: none; padding: .1rem; color: var(--muted); }
.chips .chip button:hover { color: var(--danger); background: none; }
.chips .chip .icon { width: .85rem; height: .85rem; }
.chips input { flex: 1; min-width: 8rem; border: 0; min-height: 1.75rem; padding: 0 .25rem; box-shadow: none; }
.chips input:focus { box-shadow: none; }
.chips:focus-within { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.chips.need { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
#wafed .choices .choice { padding: .75rem; }
.opts { border: 1px solid var(--line); border-radius: .625rem; background: var(--canvas); margin-bottom: 1rem; }
.opt { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: center; padding: .875rem 1rem; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt-l { font-size: .875rem; font-weight: 500; color: var(--fg); }
.opt-l span { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); margin-top: .15rem; }
.opt-c .seg { background: var(--surface); }
@media (max-width: 860px) { .opt { grid-template-columns: 1fr; gap: .5rem; } }
/* пояснение к полю — «?» у подписи, текст при наведении (или фокусе с клавиатуры) */
.help { display: inline-grid; place-items: center; width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--muted);
  font-size: .6875rem; font-weight: 600; line-height: 1; margin-inline-start: .35rem; cursor: help; position: relative; vertical-align: .05rem; user-select: none; }
.help:hover, .help:focus { color: var(--fg); border-color: var(--muted); outline: none; }
.help:hover::after, .help:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + .45rem); left: -.5rem; z-index: 60;
  background: #111827; color: #f9fafb; padding: .45rem .65rem; border-radius: .375rem; font-size: .75rem; font-weight: 400; line-height: 1.45; width: max-content; max-width: 17rem; white-space: normal; text-align: start; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.help:hover::before, .help:focus::before { content: ''; position: absolute; bottom: calc(100% + .1rem); left: .2rem; border: .3rem solid transparent; border-top-color: #111827; z-index: 61; }
dialog.wide { width: min(46rem, calc(100vw - 2rem)); }
.preset { border: 1px solid var(--line); border-radius: .5rem; padding: .75rem; align-items: flex-start; }
.preset:hover { border-color: var(--field-line); }
.preset.have { background: var(--canvas); }
.preset input { margin-top: .2rem; }
.preset .badge { display: inline-flex; vertical-align: .05rem; margin-inline-start: .25rem; }
.preset b { font-weight: 600; }
.re-box { display: flex; align-items: center; border: 1px solid var(--field-line); border-radius: .375rem; background: var(--surface); padding: 0 .5rem; }
.re-box:focus-within { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.re-box input { border: 0; box-shadow: none !important; padding-inline: .25rem; }
.re-slash { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 1rem; }
.re-status { font-size: .8125rem; color: var(--muted); display: flex; gap: .35rem; align-items: center; min-height: 1.25rem; flex-wrap: wrap; }
.re-status .icon { width: 1rem; height: 1rem; }
.re-status.ok { color: var(--ok); } .re-status.bad { color: var(--danger); }
.re-status .mono { color: var(--fg); }
.re-hits { max-height: 18rem; overflow: auto; }
.re-row { display: flex; gap: .5rem; align-items: center; padding: .15rem 0; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.re-row .icon { width: .9rem; height: .9rem; flex: none; color: var(--ok); }
.re-row.on { color: var(--fg); } .re-row.on .icon { color: var(--danger); }
mark { background: #fde68a; color: #111827; border-radius: .15rem; padding: 0 .1rem; }
table.vals { border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; border-collapse: separate; border-spacing: 0; }
table.vals th { padding: .45rem .75rem; }
table.vals td { padding: .35rem .75rem; }
table.vals td.actions { width: 1%; }
table.vals tr.add-row td { background: var(--canvas); border-top: 1px solid var(--line); }
table.vals tr.add-row input { min-height: 2rem; }
table.vals.need { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.opt.opt-top { align-items: start; }
.rcards { display: flex; flex-direction: column; gap: .5rem; }
.rcard { display: flex; gap: .625rem; align-items: center; padding: .6rem .75rem; border: 1.5px solid var(--line); border-radius: .5rem; background: var(--surface); cursor: pointer; }
.rcard:hover { border-color: var(--field-line); }
.rcard .icon { width: 1.1rem; height: 1.1rem; color: var(--muted); flex: none; }
.rcard b { display: block; font-size: .875rem; font-weight: 600; }
.rcard div span { font-size: .78rem; color: var(--muted); }
.rcard .rdot { width: 1rem; height: 1rem; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.rcard.on { border-color: var(--primary); background: var(--primary-soft); }
.rcard.on .rdot { border-color: var(--primary); }
.rcard.on .rdot::after { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--primary); }
.rcard.on .icon { color: var(--primary-dark); }
.opt-c .seg button.on { background: var(--primary); color: #fff; box-shadow: none; }
.ord { display: inline-flex; align-items: center; gap: .1rem; } .ord button { padding: .1rem; } .ord .icon { width: .85rem; height: .85rem; } .ord b { min-width: 1.2rem; text-align: center; }
.ord { display: inline-flex; align-items: center; gap: .35rem; cursor: grab; color: var(--muted); }
.ord .icon { width: 1rem; height: 1rem; }
.ord b { color: var(--fg); min-width: 1.1rem; }
tr[draggable] { cursor: grab; }
tr.dragging td { opacity: .4; }
tr.drop-on td { box-shadow: inset 0 2px 0 var(--primary); }
.preset-g { font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: .25rem 0 -.25rem; }
.hero-stat { margin-inline-start: auto; display: grid; grid-template-columns: auto 7rem; grid-template-rows: auto auto; column-gap: .75rem; align-items: center; padding: .25rem .75rem; border-inline-start: 1px solid var(--line); }
.hero-stat span { grid-column: 1; font-size: .75rem; color: var(--muted); }
.hero-stat b { grid-column: 1; font-size: 1.25rem; font-weight: 600; line-height: 1.2; }
.hero-stat .spark { grid-column: 2; grid-row: 1 / span 2; height: 2rem; margin: 0; }
.site-hero .hero-stat + .tools { margin-inline-start: 0; }
@media (max-width: 767px) { .hero-stat { margin-inline-start: 0; border: 0; padding: 0; } }
.site-hero .meta { font-size: .875rem; gap: .625rem 1rem; }
.flow-total b { font-size: 1.5rem; font-weight: 600; }
.flow-bar { display: flex; height: .75rem; border-radius: 1rem; overflow: hidden; margin: .5rem 0 .875rem; background: var(--panel); }
.flow-bar i { display: block; height: 100%; }
.flow-legend { display: grid; grid-template-columns: 1fr; gap: .3rem; font-size: .8125rem; color: var(--text); }
.flow-legend div { display: flex; align-items: center; gap: .5rem; }
.flow-legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.flow-legend .sw { width: .7rem; height: .7rem; border-radius: .2rem; flex: none; }
h2 .title-count { font-size: .7rem; }

/* ---- vow-errors: дополнительно к стилю макета vowhost ---- */
.srcb { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 1rem; white-space: nowrap; }
.srcb .icon { width: .85rem; height: .85rem; }
.srcb.app { background: #e0f2fe; color: #075985; } .srcb.docker { background: #e0e7ff; color: #3730a3; } .srcb.host { background: #fae8ff; color: #86198f; } .srcb.sdk { background: var(--panel); color: var(--text); }
html.dark .srcb.app { background: #0c4a6e; color: #bae6fd; } html.dark .srcb.docker { background: #312e81; color: #c7d2fe; } html.dark .srcb.host { background: #701a75; color: #f5d0fe; }
.lvlb { display: inline-block; width: .25rem; align-self: stretch; border-radius: .2rem; }
.issue-t { display: flex; gap: .625rem; align-items: stretch; min-width: 18rem; }
.issue-t b { font-weight: 600; display: block; color: var(--fg); }
.issue-t .sub { font-size: .78rem; color: var(--muted); display: block; margin-top: .1rem; }
.issue-t .id { font-size: .72rem; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.lvl-fatal { background: #7f1d1d; } .lvl-error { background: var(--danger); } .lvl-warning { background: var(--warn); } .lvl-info { background: #60a5fa; }
.spark.mini { width: 6rem; height: 1.5rem; margin: 0; }
.conf { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.conf i { display: inline-flex; gap: 2px; } .conf i b { width: .3rem; height: .75rem; border-radius: 1px; background: var(--line-strong); display: block; }
.conf.high i b { background: var(--ok); } .conf.mid i b:nth-child(-n+2) { background: var(--warn); } .conf.low i b:first-child { background: var(--danger); }
.diff { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; line-height: 1.55; border: 1px solid var(--line); border-radius: .5rem; overflow-x: auto; background: var(--surface); }
.diff .fh { padding: .45rem .75rem; background: var(--canvas); border-bottom: 1px solid var(--line); font-weight: 600; display: flex; gap: .5rem; align-items: center; }
.diff .ln { display: grid; grid-template-columns: 2.75rem 2.75rem 1.25rem max-content; white-space: pre; }
.diff .ln span:nth-child(-n+2) { color: var(--muted); text-align: end; padding-inline-end: .5rem; user-select: none; }
.diff .add { background: #e6ffec; } .diff .del { background: #ffebe9; } .diff .hunk { background: var(--panel); color: var(--muted); }
html.dark .diff .add { background: #12361f; } html.dark .diff .del { background: #4a1418; }
.frames { border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; }
.frame + .frame { border-top: 1px solid var(--line); }
.frame > summary { list-style: none; display: flex; gap: .625rem; align-items: center; padding: .55rem .875rem; cursor: pointer; font-size: .8125rem; flex-wrap: wrap; }
.frame > summary::-webkit-details-marker { display: none; }
.frame > summary:hover { background: var(--canvas); }
.frame > summary .fn { font-weight: 600; color: var(--fg); }
.frame > summary .file { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--muted); }
.frame > summary .tools { margin-inline-start: auto; display: flex; gap: .375rem; align-items: center; }
.frame.lib > summary { color: var(--muted); } .frame.lib > summary .fn { color: var(--muted); font-weight: 500; }
.frame .code { border-top: 1px solid var(--line); background: var(--canvas); font-family: ui-monospace, Consolas, monospace; font-size: .78rem; line-height: 1.6; overflow-x: auto; }
.frame .code div { display: grid; grid-template-columns: 3rem max-content; white-space: pre; padding-inline-end: 1rem; }
.frame .code div span:first-child { color: var(--muted); text-align: end; padding-inline-end: .75rem; user-select: none; }
.frame .code div.hl { background: #fef3c7; } html.dark .frame .code div.hl { background: #422006; }
.libs-toggle { padding: .45rem .875rem; font-size: .78rem; color: var(--muted); background: var(--canvas); border-top: 1px solid var(--line); }
.crumbs-tl td { font-size: .8125rem; padding: .45rem .875rem; }
.crumbs-tl td:first-child { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
.crumbs-tl tr.err td { background: #fef2f2; } html.dark .crumbs-tl tr.err td { background: #450a0a; }
.pipe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pipe li { display: flex; gap: .75rem; align-items: flex-start; padding: .5rem 0; position: relative; }
.pipe li:not(:last-child)::before { content: ''; position: absolute; inset-inline-start: .95rem; top: 2.25rem; bottom: -.5rem; width: 2px; background: var(--line); }
.pipe .hico { width: 2rem; height: 2rem; }
.pipe .main { flex: 1; min-width: 0; } .pipe .main b { display: block; font-weight: 500; font-size: .875rem; } .pipe .main span { font-size: .8rem; color: var(--muted); }
.pipe .t { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.checks li { display: flex; gap: .5rem; align-items: center; font-size: .875rem; }
.checks li .icon { width: 1.1rem; height: 1.1rem; }
.checks li.ok .icon { color: var(--ok); } .checks li.bad .icon { color: var(--danger); } .checks li.skip .icon { color: var(--muted); }
.checks li .n { margin-inline-start: auto; color: var(--muted); font-size: .8rem; }
.bigq { font-size: .9375rem; line-height: 1.6; color: var(--text); margin: 0; }
.issue-hero h2 { font-size: 1.125rem; margin: 0 0 .25rem; }
.issue-hero .culprit { font-family: ui-monospace, Consolas, monospace; font-size: .8125rem; color: var(--muted); }
.statbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); margin: 1rem -1.25rem -1rem; }
.statbar div { padding: .75rem 1.25rem; border-inline-end: 1px solid var(--line); min-width: 0; }
.statbar div:last-child { border: 0; }
.statbar span { display: block; font-size: .75rem; color: var(--muted); }
.statbar b { font-size: 1.05rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ev-bars svg { width: 100%; height: 7rem; display: block; }
.ev-bars rect { fill: var(--danger); opacity: .55; } .ev-bars rect.rel { fill: var(--primary-dark); opacity: 1; }
.tagcloud { display: flex; flex-wrap: wrap; gap: .375rem; }
.tag { display: inline-flex; border: 1px solid var(--line); border-radius: .375rem; font-size: .78rem; overflow: hidden; }
.tag span { padding: .15rem .5rem; background: var(--canvas); color: var(--muted); } .tag b { padding: .15rem .5rem; font-weight: 500; }
.srcgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.srccard { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.srccard .h { display: flex; gap: .5rem; align-items: center; font-weight: 600; margin-bottom: .35rem; }
.srccard .h .icon { color: var(--primary-dark); }
.srccard p { margin: 0 0 .5rem; font-size: .8125rem; color: var(--muted); }
.srccard .n { font-size: 1.5rem; font-weight: 600; }
/* часть 9c: «Источники» — четыре вида (приложения, Docker, vowhost, SDK); строка карточки — число и «требуют внимания» */
.srcgrid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.srccard .row { display: flex; align-items: baseline; gap: .5rem; }
.rcard > div { flex: 1; min-width: 0; text-align: start; }
button.rcard, div.rcard[role="button"] { width: 100%; font: inherit; color: inherit; }
@media (max-width: 1100px) { .srcgrid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .srcgrid.four { grid-template-columns: 1fr; } }
.ov-grid > * { min-width: 0; }
.lines li.click:hover { background: var(--canvas); }
@media (max-width: 860px) { .lines li { flex-wrap: wrap; } .lines .end { flex-wrap: wrap; white-space: normal; margin-inline-start: 0; } }
@media (max-width: 1100px) { .statbar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .srcgrid { grid-template-columns: 1fr; } .statbar { grid-template-columns: 1fr 1fr; } .issue-t { min-width: 14rem; } }
.proj-pick { padding: 0 .75rem .5rem; }
.proj-pick select { background: #1f2937; color: #fff; border-color: #4b5563; font-weight: 600; }
.proj-pick small { display: block; color: #6b7280; font-size: .7rem; margin-top: .3rem; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.collapsed .proj-pick { display: none; }
.radio-rows label { flex-wrap: nowrap; align-items: flex-start; }
.radio-rows label > input[type='radio'] { margin-top: .2rem; flex: none; }
/* таблицы: прокрутка внутри, шапка закреплена, строки подгружаются при прокрутке */
.table-wrap.scroll { overflow: auto; }
.table-wrap.scroll thead th { position: sticky; top: 0; z-index: 2; }
tr.more td { text-align: center; color: var(--muted); font-size: .8125rem; padding: .875rem; }
.spin { display: inline-block; width: .875rem; height: .875rem; border: 2px solid var(--line-strong); border-top-color: var(--primary); border-radius: 50%; margin-inline-end: .5rem; vertical-align: -.15rem; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* подсказка у значка в шапке таблицы — сразу при наведении, под шапкой (сверху её обрезала бы прокрутка таблицы) */
th[data-tip] { position: relative; cursor: help; }
.table-wrap.scroll thead th[data-tip] { position: sticky; }
th[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + .3rem); left: 50%; transform: translateX(-50%); z-index: 30;
  background: #111827; color: #f9fafb; padding: .35rem .6rem; border-radius: .375rem; font-size: .75rem; font-weight: 500; line-height: 1.4; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.2); pointer-events: none; }
th[data-tip]:last-child:hover::after { left: auto; right: 0; transform: none; }
.danger-sec h3 { color: var(--danger); display: flex; align-items: center; gap: .4rem; }
.danger-sec h3 .icon { width: 1.1rem; height: 1.1rem; }
html.settings-page main { padding-bottom: 4.5rem; }
/* выбор строк и массовые действия */
table.list th.sel, table.list td.sel { width: 2.5rem; padding-inline: 1rem .25rem; }
table.list td.sel input, table.list th.sel input { cursor: pointer; width: 1rem; height: 1rem; }
table.list tbody tr.on td { background: var(--primary-soft) !important; }
.bulk { position: fixed; bottom: 1rem; left: calc(var(--sidebar-w) + 1rem); right: 1rem; z-index: 75; background: #111827; color: #f9fafb;
  border-radius: .75rem; padding: .5rem .5rem .5rem 1rem; display: none; align-items: center; gap: .5rem; flex-wrap: wrap; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.bulk.show { display: flex; }
.bulk b { font-weight: 600; margin-inline-end: .5rem; white-space: nowrap; }
.bulk button, .bulk select { background: #1f2937; border-color: #374151; color: #e5e7eb; }
.bulk button:hover { background: #374151; } .bulk button:disabled { opacity: .45; cursor: not-allowed; }
.bulk button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.bulk button.ghost { background: none; border-color: transparent; }
.bulk .spacer { flex: 1; }
@media (max-width: 767px) { .bulk { left: .5rem; right: .5rem; } }
/* значок «показатели» у заголовка страницы */
.stats-btn { margin-inline-start: .25rem; position: relative; }
.stats-btn.on { background: var(--primary-soft); color: var(--accent); }
.stats-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; top: calc(100% + .3rem); left: 50%; transform: translateX(-50%); z-index: 40;
  background: #111827; color: #f9fafb; padding: .35rem .6rem; border-radius: .375rem; font-size: .75rem; font-weight: 500; white-space: nowrap; pointer-events: none; }
/* строки списков в карточках — мельче заголовка карточки */
.lines li { padding-block: .6rem; }
.lines .main b { font-size: .8125rem; font-weight: 500; }
.lines .main span { font-size: .75rem; }
.lines .end { font-size: .75rem; }
.lines .end .badge, .lines .end .conf { font-size: .6875rem; }
.lines .end .btn.small, .lines .end button.small { font-size: .75rem; }

/* ---- дополнительно к макету: страницы на Alpine и общий грид (assets/js/grid.js) ---- */
[x-cloak] { display: none !important; }
.sidebar nav a:focus-visible, .icon-btn:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.nav-block.proj { display: flex; align-items: center; gap: .5rem; }
.proj-pick label { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.avatar { text-decoration: none; }
.avatar:hover { text-decoration: none; }
.top-tools a.icon-btn { color: var(--muted); }
body.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 35; }
.error-line { color: var(--danger); font-size: .875rem; padding: .5rem 1rem; }
.grid-box { display: flex; flex-direction: column; }
.grid-box .table-wrap.scroll { min-height: 10rem; }
table.list td .sub { display: block; font-size: .78rem; color: var(--muted); }
table.list th .icon { width: 1.05rem; height: 1.05rem; vertical-align: middle; }
table.list td.nowrap { white-space: nowrap; }
.cols-menu { max-height: 60vh; overflow-y: auto; }
.grid-filters select { width: 100%; }
.toast.bad .icon { color: #fca5a5; }
.dlg-radios { display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.dlg-radios label { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; color: var(--fg); }
.dlg-radios input[type='number'] { width: 6rem; min-height: 2rem; }
dialog .box-head { border-bottom: 1px solid var(--line); }
dialog p { margin: 0; }
.soon { text-align: center; padding: 3rem 1rem; }
.soon .icon { width: 3rem; height: 3rem; color: var(--primary-dark); }
.soon h2 { margin: 1rem 0 .5rem; font-size: 1.125rem; }
.hint-note { margin-bottom: 1rem; align-items: center; }
.hint-note > div { flex: 1; min-width: 12rem; }
.hint-note > .row { flex: none; min-width: 0; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.empty-box { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; }
.kpi .value { font-variant-numeric: tabular-nums; }
.ev-bars rect.peak { fill: var(--primary-dark); opacity: 1; }
.lines li.click { cursor: pointer; }
.lines li a.main { color: inherit; text-decoration: none; }
.health li > div { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.25rem; }
@media (max-width: 767px) {
  header.top { padding: 0 .5rem; gap: .5rem; }
  .crumbs h1 { font-size: 1.05rem; }
  .crumbs > a:not(.title-back), .crumbs > .sep { display: none; }
  main { padding: .75rem; }
}
.bulk select { width: auto; min-height: 2.1rem; }
.hc-legend .hc-k.ev { background: var(--danger); opacity: .55; }
.table-wrap.scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
/* страница группы (часть 3b): шапка, заметка о событии, пустой автофикс, подпись под гридом */
.issue-hero .hero-row { align-items: flex-start; flex-wrap: nowrap; }
.issue-hero .lvlb { height: 3.25rem; width: .3rem; align-self: flex-start; flex: none; }
.issue-hero .hero-main { flex: 1; min-width: 0; }
.issue-hero h2 { overflow-wrap: anywhere; }
.issue-hero .culprit { overflow-wrap: anywhere; }
.issue-hero .hero-badges { margin-top: .5rem; gap: .5rem; }
.issue-hero .hero-acts { gap: .5rem; flex-wrap: nowrap; }
.issue-hero .hero-acts select { width: auto; max-width: 14rem; }
.bigq.exc { margin-bottom: .75rem; overflow-wrap: anywhere; }
.bigq.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.m0 { margin: 0; }
.ev-note { margin-bottom: 1rem; }
.ev-note a { font-weight: 500; }
.empty-text { margin: .5rem 0 1rem; }
.grid-note { margin: .5rem .25rem 0; }
.crumbs-tl td:last-child { overflow-wrap: anywhere; }
.frame .code div.stub { grid-template-columns: 3rem minmax(0, 1fr); white-space: normal; }
.frame .code div.stub .muted { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
@media (max-width: 1100px) { .issue-hero .hero-row { flex-wrap: wrap; } .issue-hero .hero-acts { flex-wrap: wrap; width: 100%; padding-inline-start: .85rem; } }
@media (max-width: 767px) { .issue-hero .hero-acts select { max-width: 100%; flex: 1 1 100%; } }
.box-foot > input[type="text"] { flex: 1 1 12rem; width: auto; min-width: 0; }
.issue-t a.issue-link { color: inherit; text-decoration: none; }
.issue-t a.issue-link:hover b { text-decoration: underline; }

/* часть 4: выпуски и оповещения */
.gap { height: 1rem; }
.sec-title { margin: 1.5rem 0 .75rem; }
.form.one { grid-template-columns: 1fr; }
.stack-sm { display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; min-width: 0; }
.stack-sm > .field { align-self: stretch; }
.opt-c .row select { width: auto; min-width: 10rem; }
.quiet-box { margin-top: 1rem; margin-bottom: 1rem; }
.form.quiet-form { margin: 1rem 0 .5rem; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.srccard .row .badge { white-space: nowrap; }
.edit-card .note, main > .note { margin-bottom: 1rem; }
@media (max-width: 1100px) { .form.quiet-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) { .form.quiet-form { grid-template-columns: 1fr; } }
.show-sm { display: none; }
@media (max-width: 600px) { .hide-sm { display: none; } .show-sm { display: inline; } .save-bar #save-state { display: none; } }
button.rcard { width: 100%; text-align: start; font: inherit; color: inherit; min-height: 0; }
button.rcard:disabled { cursor: default; opacity: 1; }

/* часть 5a: жизнь проекта — подсказка «похож», окно объединения, ключ, настройки проекта (CSP: без style в разметке) */
.m0 { margin: 0; }
.mt0 { margin-top: 0; }
.row.gap-sm { gap: .5rem; flex-wrap: wrap; }
.note .switch.remember { margin-top: .5rem; align-items: flex-start; }
.note .switch.remember input { flex: none; }

/* часть 6: репозиторий и ссылки на код */
.rcards.row-cards { flex-direction: row; flex-wrap: wrap; margin-bottom: 1rem; }
.rcards.row-cards .rcard { flex: 1; min-width: 14rem; }
.checks li.warn .icon { color: var(--warn); }
.checks li .what { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.checks li .icon { flex: none; }
.checks li .n { text-align: end; overflow-wrap: anywhere; }
.checked-at { margin: .75rem 0 0; }
.field .label-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.field .label-row label { margin: 0; }
.token-state .badge { font-weight: 500; }
.frame .blame { display: flex; gap: .5rem; align-items: flex-start; padding: .5rem .875rem; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); line-height: 1.5; }
.frame .blame .icon { width: .95rem; height: .95rem; flex: none; margin-top: .15rem; }
.frame .blame span { min-width: 0; overflow-wrap: anywhere; }
.frame .blame b { color: var(--fg); font-weight: 600; }
.frame > summary .tools .badge.warn { white-space: nowrap; }
.lines li a.sha { flex: none; text-decoration: none; }
@media (max-width: 767px) { .checks li { flex-wrap: wrap; } .checks li .n { margin-inline-start: 1.6rem; flex-basis: 100%; text-align: start; } }

/* Вход (D-0042, как у ByteCraft Hosting): логотип, карточка, одна кнопка «Войти через GitLab» */
body.p-login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--canvas); }
.login-wrap { width: 100%; max-width: 400px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: 1.75rem; }
.login-brand .logo-mark { width: 2.5rem; height: 2.5rem; border-radius: .75rem; font-size: 1.05rem; }
.login-title { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; color: var(--fg); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; box-shadow: var(--shadow); padding: 1.75rem; }
.login-card h1 { font-size: 1.25rem; font-weight: 600; text-align: center; margin: 0 0 1.5rem; color: var(--fg); }
.login-gitlab { width: 100%; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1rem; font-size: .9375rem; }
.login-error { margin: 0 0 1rem; font-size: .875rem; text-align: center; color: var(--danger); }
.login-note { margin: 0 0 1rem; font-size: .875rem; text-align: center; color: var(--muted); }
.login-hint { margin: 1rem 0 0; font-size: .875rem; text-align: center; color: var(--muted); }

/* часть 7: автофикс — то, что придёт в части 8 (уверенность, правила MR), приглушено */
.opts.is-later { opacity: .75; }
.opt-c input.w-18 { max-width: 18rem; }
.edit-sec h3 .badge { margin-inline-start: .4rem; vertical-align: middle; }
.set-top { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: .75rem; padding: 0 1rem; margin-bottom: 1rem; }
.set-top .tabs { border: 0; margin: 0; }
.set-top .tabs a { padding: .85rem .8rem; }
