/* Тема интерфейса. Белая этикетка: акцент и производные цвета задаёт оформление
   (/ui/brand.css — считает сервер с проверкой контраста), остальное — нейтральное. Светлая и тёмная тема —
   по системе или по выбору пользователя (data-theme на <html>). */

:root {
  --accent: #2f6fed;
  --accent-ink: #ffffff;                      /* текст на заливке акцентом */
  --accent-text: #2456c4;                     /* текст и ссылки акцентом (≥4.5:1 к фону) */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--bg));
  --accent-strong: color-mix(in srgb, var(--accent) 82%, #000);

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dde1e7;
  --border-strong: #c3c9d2;
  --text: #1b1f24;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --ok: #1a7f37;
  --ok-soft: #e6f4ea;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --bad: #c62828;
  --bad-soft: #fde8e8;
  --focus: color-mix(in srgb, var(--accent) 55%, transparent);

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 232px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #2a313b;
    --border-strong: #3a4350; --text: #e6e9ee; --text-2: #b4bcc8; --text-3: #8b95a3; --ok: #4ac26b; --ok-soft: #12261a;
    --warn: #e3b341; --warn-soft: #2b2310; --bad: #f47067; --bad-soft: #2d1515; --shadow: none;
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); color-scheme: dark; }
}
/* .theme-dark — та же тёмная палитра для предпросмотра оформления на светлой странице */
:root[data-theme="dark"], .theme-dark { --bg: #0f1216; --surface: #171b21; --surface-2: #1d222a; --border: #2a313b;
  --border-strong: #3a4350; --text: #e6e9ee; --text-2: #b4bcc8; --text-3: #8b95a3; --ok: #4ac26b; --ok-soft: #12261a;
  --warn: #e3b341; --warn-soft: #2b2310; --bad: #f47067; --bad-soft: #2d1515; --shadow: none;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ каркас */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; min-height: 60px; }
.brand img { max-height: 32px; max-width: 120px; object-fit: contain; }
.brand .brand-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.brand .brand-sub { color: var(--text-3); font-size: 12px; }
.nav { padding: 4px 8px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav-group { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-2); }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
:root[data-theme="dark"] .nav a[aria-current="page"] { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a[aria-current="page"] { color: var(--text); } }
.nav .count { margin-left: auto; font-size: 12px; color: var(--text-3); }
.sidebar-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar .spacer { flex: 1; }
/* кнопка меню — только на узком экране; .topbar в селекторе — чтобы .btn ниже по файлу её не показал */
.topbar .menu-btn { display: none; }
.content { padding: 24px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .spacer { flex: 1; }
.page-head .sub { color: var(--text-3); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  /* закрытое меню — вне порядка Tab и диктора (visibility), открытое — сразу видно */
  .sidebar { position: fixed; z-index: 20; left: 0; top: 0; width: 264px; transform: translateX(-100%); visibility: hidden;
    transition: transform .15s, visibility 0s .15s; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: none; visibility: visible; transition: transform .15s, visibility 0s; }
  .topbar .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ------------------------------------------------------------ элементы */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 34px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--bad); }
.input, select.input, textarea.input { height: 34px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; width: 100%; min-width: 0; }
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.input[aria-invalid="true"] { border-color: var(--bad); }
.input:disabled { background: var(--surface-2); color: var(--text-3); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { width: auto; min-width: 140px; }
.toolbar .search { min-width: 220px; flex: 1; max-width: 360px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface); position: sticky; top: 0; white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.clickable { cursor: pointer; }
.table tr.inactive td { color: var(--text-3); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-foot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--text-3); font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); margin-bottom: 12px; }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--text); }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.banner > svg { flex-shrink: 0; margin-top: 2px; }

.stat { padding: 16px; }
.stat .label { color: var(--text-3); font-size: 12.5px; }
.stat .value { font-size: 26px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .note { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }

.empty { text-align: center; padding: 40px 16px; color: var(--text-3); }
.muted { color: var(--text-3); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }

/* ------------------------------------------------------------ окна */
.overlay { position: fixed; inset: 0; background: rgba(15, 18, 22, .45); z-index: 30; display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 640px;
  border: 1px solid var(--border); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  max-width: 420px; }
.toast.bad { background: var(--bad); color: #fff; }

.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); font-family: var(--mono); overflow-wrap: anywhere; }
.secret code { flex: 1; font-size: 14px; }
/* действующий SIP-пароль в карточке (components/sippass.js): на узком экране кнопки — под паролем */
.sippass code { overflow-wrap: anywhere; min-width: 0; }
.sippass .err { font-size: 12px; color: var(--bad); }

.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 10; }
.menu-pop button, .menu-pop a { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none;
  color: var(--text); border-radius: var(--radius-sm); font: inherit; cursor: pointer; }
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface-2); text-decoration: none; }
.menu-pop .sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-pop .who { padding: 6px 10px 8px; color: var(--text-3); font-size: 12.5px; }

/* ------------------------------------------------------------ вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login .card { width: 100%; max-width: 380px; }
.login .card-body { padding: 28px; }
.login .brand { padding: 0 0 18px; justify-content: center; flex-direction: column; text-align: center; }
.login .brand img { max-height: 48px; max-width: 200px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%;
  animation: sk 1.2s infinite; border-radius: 4px; height: 14px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .sidebar, .app.nav-open .sidebar { transition: none; } }
.grow { flex: 1; }
.mt { margin-top: 16px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ обзор */
.attn { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attn-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); border-left: 4px solid var(--border-strong); background: var(--surface); color: var(--text); }
a.attn-item:hover { text-decoration: none; box-shadow: var(--shadow); }
a.attn-item:hover .attn-title { text-decoration: underline; }
.attn-item.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); border-left-color: var(--bad); }
.attn-item.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); border-left-color: var(--warn); }
.attn-icon { display: inline-flex; flex: none; color: var(--text-3); }
.attn-item.bad .attn-icon { color: var(--bad); }
.attn-item.warn .attn-icon { color: var(--warn); }
.attn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.attn-title { font-weight: 500; }
.attn-sub { color: var(--text-2); font-size: 12.5px; }
.attn-count { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.attn-go { flex: none; color: var(--text-3); font-size: 20px; line-height: 1; }
@media (max-width: 700px) {
  /* узко: число — под заголовком, стрелка — справа во всю высоту */
  .attn-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; }
  .attn-icon { grid-row: 1 / span 2; }
  .attn-text { grid-column: 2; grid-row: 1; }
  .attn-count { grid-column: 2; grid-row: 2; }
  .attn-go { grid-column: 3; grid-row: 1 / span 2; }
}

/* ------------------------------------------------------------ клиники: часы работы и особые дни */
.input.time { width: 5.2em; padding: 0 6px; text-align: center; font-variant-numeric: tabular-nums; }
.input.date { width: auto; min-width: 10.5em; }
.iv { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.exc { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.kv.week { gap: 10px 16px; }
.kv.week dt { padding-top: 7px; }
details.fold > summary { cursor: pointer; color: var(--text-2); padding: 4px 0; }
details.fold[open] > summary { margin-bottom: 8px; }

/* ------------------------------------------------------------ звонки */
.call-dir { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.call-dir svg { flex: none; color: var(--text-3); }
.call-dir.in svg { color: var(--accent-text); }
.call-dir.emergency { color: var(--bad); font-weight: 600; }
.call-dir.emergency svg { color: var(--bad); }
.rec audio { width: 100%; max-width: 480px; display: block; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 72px 12px minmax(0, 1fr); gap: 0 10px; position: relative; padding-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; left: 87px; top: 14px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .tl-time { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.timeline .tl-off { display: block; font-size: 12px; color: var(--text-3); }
.timeline .tl-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: var(--surface);
  border: 2px solid var(--border-strong); position: relative; z-index: 1; }
.timeline .tl-dot.ok { background: var(--ok); border-color: var(--ok); }
.timeline .tl-dot.warn { background: var(--warn); border-color: var(--warn); }
.timeline .tl-dot.bad { background: var(--bad); border-color: var(--bad); }
.timeline .tl-dot.accent { background: var(--accent); border-color: var(--accent); }
.timeline .tl-text { min-width: 0; overflow-wrap: anywhere; }
.toolbar input[type="date"] { min-width: 0; width: 150px; }

/* ------------------------------------------------------------ журнал изменений */
.table tr.detail > td { background: var(--surface-2); }
.table.diff { margin-top: 4px; }
.table.diff td { vertical-align: top; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ оформление */
/* Предпросмотр обеих тем рядом при любой теме страницы: тёмная — .theme-dark в правиле
   тёмной темы выше, светлая — здесь (те же значения, что в :root); акцент — из brand.css. */
.theme-light { --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5; --border: #dde1e7; --border-strong: #c3c9d2;
  --text: #1b1f24; --text-2: #4b5563; --text-3: #6b7280; --ok: #1a7f37; --ok-soft: #e6f4ea; --warn: #9a6700;
  --warn-soft: #fff4d6; --bad: #c62828; --bad-soft: #fde8e8; color-scheme: light; }
.brand-preview { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); }
.brand-preview .brand { padding: 0; min-height: 0; }
.brand-preview .nav { padding: 0; }
.color-pick { flex: none; width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; }
.logo-view { display: flex; justify-content: center; align-items: center; min-height: 72px; padding: 12px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.logo-view img { max-width: 100%; max-height: 96px; object-fit: contain; }

/* ------------------------------------------------------------ вкладки */
/* на узком экране вкладки прокручиваются вбок, страница — нет */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.tabs button { flex: none; height: 36px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------ номерной план и страны */
.np-intro { margin-bottom: 12px; }
.np-list { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
/* строка формы (пул, короткий номер, правило набора): поля в сетке, на телефоне — по два в ряд */
.np-rows { display: flex; flex-direction: column; gap: 8px; }
.np-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: 8px 12px; align-items: end;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.np-row .wide { grid-column: 1 / -1; }
.np-err { font-size: 12.5px; color: var(--bad); overflow-wrap: anywhere; }
.np-del { justify-self: start; margin-bottom: 3px; }
.np-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.np-lock { display: inline-flex; color: var(--text-3); }
.np-impact + .np-impact { border-top: 1px solid var(--border); padding-top: 12px; }
.np-result { box-shadow: none; }
/* подвал окна правки: «ничего не изменилось» и кнопки — переносятся на узком экране */
.np-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; width: 100%; }

/* ------------------------------------------------------------ сеть сервера */
/* только для диктора: состояние проверки словами рядом со значком */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; }
.net-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.net-head h2 { margin: 0; }
.net-stack { display: flex; flex-direction: column; gap: 6px; }
.net-list, .net-addrs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.net-list li, .net-uses { display: flex; gap: 8px; align-items: flex-start; min-width: 0; overflow-wrap: anywhere; }
.net-list li > svg, .net-uses > svg { flex: none; margin-top: 2px; color: var(--text-3); }
.net-list .st-ok > svg { color: var(--ok); }
.net-list .st-fail > svg { color: var(--bad); }
.net-list .st-warn > svg { color: var(--warn); }
.net-addrs { gap: 4px; }
.net-addrs li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.net-addrs .badge { white-space: normal; height: auto; min-height: 22px; }
/* «Сейчас» и «В настройке» — по половине карточки: подписи уже, чем у .kv на всю ширину */
.net-cols .kv { grid-template-columns: minmax(0, 10em) minmax(0, 1fr); }
@media (max-width: 700px) { .net-cols .kv { grid-template-columns: 1fr; } }
.net-lock { display: inline-flex; color: var(--text-3); }
.net-file { overflow-wrap: anywhere; margin-bottom: 8px; }
.net-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
/* поле адреса растёт, кнопка «Убрать» — рядом, на узком экране переносится */
.net-grow { flex: 1 1 12em; width: auto; }
.net-routes .input { min-width: 9em; }
.net-routes .input.net-metric { min-width: 5em; width: 6em; }
/* кнопки подвала окна переносятся на узком экране, а не вылезают за край */
.net-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.net-left { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* разница файла настроек: прокрутка внутри блока, не страницы */
.net-udiff { margin: 0; padding: 6px 0; max-height: 50vh; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: 12.5px/1.5 var(--mono); }
.net-udiff span { display: block; min-width: max-content; padding: 0 10px; white-space: pre; }
.net-udiff .add { background: var(--ok-soft); color: var(--ok); }
.net-udiff .del { background: var(--bad-soft); color: var(--bad); }
.net-udiff .hunk, .net-udiff .meta { color: var(--text-3); }

/* ------------------------------------------------------------ номер в филиале, группы, памятка */
/* подсказки поля номера — по строке: свободный номер, полный номер, чем не подходит */
.field .hint .hint-line { display: block; }
.warn-text { color: var(--warn); }
/* участники группы: отметки в несколько колонок, на телефоне — в одну */
.grp-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(14em, 1fr)); gap: 4px 16px; max-height: 40vh;
  overflow-y: auto; padding: 4px 0; }
.grp-members .check { align-items: flex-start; overflow-wrap: anywhere; }
.grp-members .check input { flex: none; margin-top: 2px; }
.memo-head h1 { margin-bottom: 4px; }
.memo .memo-num { width: 6em; font-size: 14px; font-weight: 600; }
.memo section h2 { margin-bottom: 8px; }
.memo p { margin: 0 0 8px; }

/* ------------------------------------------------------------ голосовые фразы */
/* текст в таблице — до трёх строк (целиком — в подсказке и в окне правки) */
.phrase-text { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 42ch; overflow-wrap: anywhere; }
.phrase-audio { display: block; width: 100%; max-width: 320px; height: 36px; }
.music-list { margin: 0; padding-left: 1.4em; }
.music-list li { margin: 2px 0; }
.music-list .btn { margin-left: 4px; }
progress { width: 100%; max-width: 420px; }
@media (max-width: 700px) { .phrase-text { max-width: 24ch; } }

/* печать (памятка филиала): без меню, шапки и кнопок; светлая палитра при любой теме */
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --surface-2: #f3f3f3;
    --border: #999; --border-strong: #777; --text: #000; --text-2: #222; --text-3: #444; --warn: #000; --warn-soft: #fff;
    --shadow: none; color-scheme: light; }
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .app { display: block; min-height: 0; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  .table th { position: static; }
  .table tbody tr:hover { background: none; }
  a { color: inherit; }
}

/* звонилка в МИС (components/misphone.js) */
.row-between { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.mb { margin-bottom: 16px; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
ul.plain li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.label { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.mis-err { font-size: 12px; color: var(--bad); }
