:root {
  color-scheme: dark;
  --bg: #07080c;
  --bg-side: #0b1018;
  --card: #161b27;
  --card-hover: #1b2230;
  --deep: #0b1018;
  --border: #1e293b;
  --text: #f4f7fb;
  --muted: #93a4bb;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --ok: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --pill: rgba(255, 255, 255, .12);
  --action: rgba(59, 130, 246, .13);
  --action-fg: #93c5fd;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
  --radius: 14px;
  --side: 232px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; min-height: 100%; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: Roboto, system-ui, Segoe UI, sans-serif;
}
button, input, select { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Login — centered auth card (Vercel / Linear) */
body.is-login { overflow: auto; }
.auth {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(59, 130, 246, .18), transparent 55%),
    var(--bg);
}
.auth-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 26px 24px;
  box-shadow: var(--shadow);
}
.auth-card h1 {
  margin: 18px 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em;
}
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.auth-card label { display: block; margin-bottom: 12px; }
.auth-card label span,
.form-grid label span {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.auth-card input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--deep); color: var(--text); font-size: 15px;
}
.auth-card button[type="submit"] {
  width: 100%; margin-top: 8px; height: 46px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 700;
}
.auth-card button[type="submit"]:hover { background: var(--accent-2); }
.form-err { margin: 12px 0 0; color: var(--danger); font-size: 13px; font-weight: 600; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 16px;
  flex: none;
}
.brand-name { font-weight: 750; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* Shell — sidebar + workspace */
.shell {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  height: 100dvh;
  overflow: hidden;
}
.side {
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex; flex-direction: column; gap: 22px;
  min-height: 0; overflow: auto;
}
.side .brand { padding: 4px 8px 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  appearance: none; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 12px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 650;
}
    .nav-item svg {
      width: 16px; height: 16px; fill: currentColor; flex: none;
    }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.on { background: var(--accent); color: #fff; }
.nav-count {
  margin-left: auto;
  min-width: 20px; padding: 1px 7px; border-radius: 999px;
  background: var(--pill); font-size: 11px; font-weight: 700;
  text-align: center;
}
.nav-item.on .nav-count { background: rgba(255,255,255,.2); }
.side-foot {
  display: flex; flex-direction: column; gap: 10px;
  padding: 8px;
}
.side-foot .muted { font-size: 12px; font-variant-numeric: tabular-nums; }
.side-user { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#admin-who { font-weight: 600; color: var(--text, #e8eaef); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.settings-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px 18px;
  background: var(--deep, rgba(0,0,0,.2));
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.settings-form label { display: block; }
.settings-form label span {
  display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px;
}
.settings-form input, .settings-form select {
  width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg, #0b0d12); color: inherit; font: inherit;
}
.settings-form button[type="submit"] {
  align-self: flex-start; margin-top: 4px;
  height: 36px; padding: 0 14px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.settings-user-add {
  flex-direction: row; flex-wrap: wrap; align-items: center;
}
.settings-user-add input, .settings-user-add select { width: auto; min-width: 120px; flex: 1; }
.settings-user-add button[type="submit"] { margin-top: 0; }
.settings-users-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.settings-users-actions button { font-size: 12px; }
body.role-viewer .write-only,
body.role-viewer #btn-issue-open,
body.role-viewer #btn-map-rebuild,
body.role-viewer #btn-probe-run,
body.role-viewer #btn-probe-pause,
body.role-viewer #alias-draft-publish { display: none !important; }
body:not(.role-owner) #settings-users-card { display: none; }
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 22px 28px 8px;
  flex: none;
}
.top h1 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -.03em; }
.top .muted { margin: 4px 0 0; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.play-box-pick {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--deep);
}
.play-box-pick span { font-size: 11px; font-weight: 700; white-space: nowrap; }
.play-box-pick select {
  min-width: 160px; max-width: 260px; height: 34px;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text); font-size: 13px; font-weight: 600;
}
.btn-play {
  flex: none; width: 34px; height: 34px; padding: 0;
  border: 1px solid rgba(52, 211, 153, .35); border-radius: 10px;
  background: rgba(52, 211, 153, .12); color: var(--ok);
  font-size: 13px; line-height: 1; cursor: pointer;
}
.btn-play:hover { background: rgba(52, 211, 153, .22); }
.ins-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-ch .btn-play { margin-left: auto; margin-right: 4px; }
.pulse {
  font-size: 12px; font-weight: 700; color: var(--ok);
  padding: 6px 10px; border-radius: 999px;
  background: rgba(52, 211, 153, .12);
}
.pulse.off { color: var(--muted); background: var(--pill); }

.content {
  padding: 12px 28px 40px; flex: 1; min-height: 0;
  overflow: auto; display: flex; flex-direction: column;
}
.content > section:not(.hidden) {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
body.dock-work .top { padding: 12px 20px 6px; }
body.dock-work .top h1 { font-size: 20px; }
body.dock-work #page-sub { display: none; }
body.dock-work .content { padding: 8px 20px 12px; overflow: hidden; }
body.dock-work .content > section:not(.hidden) { overflow: hidden; }

/* Секция — flex-колонка с min-height:0: без этого длинные таблицы схлопываются. */
#view-downloads > * { flex-shrink: 0; }
#view-downloads > * + * { margin-top: 14px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat .k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat .v { margin-top: 8px; font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.stat .s { margin-top: 4px; font-size: 12px; color: var(--muted); }

/* ---- Dashboard ---------------------------------------------------------- */
.dash { gap: 0; overflow: auto; padding-bottom: 32px; }
.dash-status {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 4px 0 20px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.dash-status.run, .dash-status.warn, .dash-status.err {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin: 0 0 8px; background: var(--card);
}
.dash-status.run { border-color: rgba(251, 191, 36, .35); }
.dash-status.warn { border-color: rgba(251, 191, 36, .4); }
.dash-status.err { border-color: rgba(248, 113, 113, .45); }
.dash-dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 8px;
  background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
}
.dash-status.run .dash-dot {
  background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 36, .16);
  animation: dashPulse 1.4s ease-in-out infinite;
}
.dash-status.warn .dash-dot {
  background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 36, .16);
}
.dash-status.err .dash-dot {
  background: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, .16);
}
@keyframes dashPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.dash-status-copy { min-width: 0; flex: 1; }
.dash-status-copy h2 {
  margin: 0; font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15;
}
.dash-status-copy p {
  margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45;
}
.dash-job-bar { margin-top: 12px; height: 4px; }
.dash-wait { margin: 10px 0 0; font-size: 12px; }
.dash-status-copy .text-btn { margin-top: 8px; }
.dash-kpi {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0; margin: 4px 0 8px;
  border-bottom: 1px solid var(--border);
}
.dash-metric {
  appearance: none; cursor: pointer; text-align: left;
  background: transparent; border: 0; border-right: 1px solid var(--border);
  color: inherit; font: inherit; padding: 18px 18px 18px 0;
}
.dash-metric:last-child { border-right: 0; }
.dash-metric:hover .v { color: #fff; }
.dash-metric .v {
  display: block; font-size: 28px; font-weight: 650; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.dash-metric .k {
  display: block; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text);
}
.dash-metric .s { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.dash-split {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr);
  gap: 32px; padding-top: 18px;
}
.dash-col-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 8px;
}
.dash-col-h h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dash-tr {
  display: grid; grid-template-columns: 14px minmax(0, 1.4fr) 72px 64px auto;
  gap: 10px; align-items: center; width: 100%;
  appearance: none; cursor: pointer; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--border);
  color: inherit; font: inherit; padding: 10px 4px;
}
.dash-tr:hover { background: var(--card-hover); }
.dash-tr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tr-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dash-q {
  display: flex; align-items: center; gap: 12px; width: 100%;
  appearance: none; cursor: pointer; text-align: left;
  background: transparent; border: 0; border-bottom: 1px solid var(--border);
  color: inherit; font: inherit; padding: 11px 2px;
}
.dash-q:hover { background: var(--card-hover); }
.dash-q-n {
  flex: none; min-width: 44px; font-size: 18px; font-weight: 650;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.dash-q-copy { min-width: 0; flex: 1; }
.dash-q-copy b { display: block; font-weight: 600; font-size: 13px; }
.dash-q-copy span { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.dash-q-go { color: var(--muted); font-size: 14px; }
.dash-q.hot .dash-q-n { color: var(--danger); }
.dash-q.warn .dash-q-n { color: var(--warn); }
.dash-quiet { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.dash-subh {
  margin: 16px 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.dash-mini {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-radius: 8px; cursor: pointer;
}
.dash-mini:hover { background: var(--card-hover); }
.dash-mini-main { min-width: 0; flex: 1; }
.dash-mini-title { font-weight: 650; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-mini-sub { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.split {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px;
}
.panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  min-height: 220px;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.text-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--action-fg); font-size: 13px; font-weight: 700; cursor: pointer; padding: 4px 0;
}
.text-btn:hover { color: #fff; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.empty {
  padding: 28px 8px; text-align: center; color: var(--muted); font-size: 14px;
}

.toolbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px;
}
.toolbar input[type="search"] {
  flex: 1; min-width: 200px; height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text); font-size: 14px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 0; cursor: pointer;
  height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--card); color: var(--muted); font-size: 13px; font-weight: 700;
}
.chip.on, .chip:hover { background: var(--accent); color: #fff; }

.list { display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.row:hover { background: var(--card-hover); }
.row-top {
  display: flex; align-items: center; gap: 12px;
}
.row-copy { min-width: 0; flex: 1; }
.row-copy h3 {
  margin: 0; font-size: 16px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-copy p {
  margin: 3px 0 0; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.row-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px;
}
.row-extra {
  display: none; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 8px; align-items: center;
}
.row.open .row-extra { display: flex; flex-wrap: wrap; }
.row-extra input { flex: 1; min-width: 180px; }

.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted); flex: none;
  box-shadow: 0 0 0 4px rgba(147, 164, 187, .12);
}
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, .16); }
.status-dot.off { background: #55657d; box-shadow: none; }

.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11px; font-weight: 750; letter-spacing: .02em;
  background: var(--pill); color: var(--muted);
}
.badge.lite { background: var(--action); color: var(--action-fg); }
.badge.client { background: rgba(251, 191, 36, .14); color: var(--warn); }
.badge.ok { background: rgba(52, 211, 153, .14); color: var(--ok); }
.badge.warn { background: rgba(251, 191, 36, .14); color: var(--warn); }
.badge.danger { background: rgba(248, 113, 113, .14); color: var(--danger); }

.table-wrap {
  overflow: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
.table th {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.table tr:last-child td { border-bottom: 0; }
.catalog-hint { margin: -4px 0 14px; font-size: 13px; }
.table .mono { font-variant-numeric: tabular-nums; font-size: 13px; }
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px; letter-spacing: .04em; color: #c7d2fe;
}
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

button.primary, .top-actions > button:last-child {
  appearance: none; border: 0; cursor: pointer;
  height: 40px; padding: 0 16px; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 700;
}
button.primary:hover, .top-actions > button:last-child:hover { background: var(--accent-2); }
button.ghost, .row-actions button, .cell-actions button, .row-extra button {
  appearance: none; cursor: pointer;
  height: 34px; padding: 0 12px; border-radius: 10px;
  background: #1c2738; color: var(--text);
  border: 1px solid var(--border); font-size: 13px; font-weight: 650;
}
button.ghost:hover, .row-actions button:hover, .cell-actions button:hover {
  background: var(--accent); color: #fff; border-color: transparent;
}
button.danger:hover { background: #dc2626; color: #fff; border-color: transparent; }
.icon-btn {
  appearance: none; border: 0; background: var(--pill); color: var(--text);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px;
}

input, select {
  height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--deep); color: var(--text);
  font-size: 14px; width: 100%;
}

.modal {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(7, 8, 12, .72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 24px;
}
.modal-card {
  width: min(640px, 100%);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px 22px 18px;
  box-shadow: var(--shadow);
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px;
}
.form-grid .span2 { grid-column: 1 / -1; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px;
}
.modal-actions .ghost, .modal-actions button { height: 40px; min-width: 96px; }

.toast {
  position: fixed; top: 18px; right: 18px; z-index: 60;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 14px; border-radius: 12px;
  background: var(--card); border: 1px solid rgba(59, 130, 246, .45);
  color: var(--text); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
}
.toast.err { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.toast.ok { border-color: rgba(52, 211, 153, .5); color: #bbf7d0; }
.ins-work {
  flex: none;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ins-work[hidden] { display: none; }
.ins-work.run { color: var(--warn); background: rgba(251, 191, 36, .1); }
.ins-work.ok { color: var(--ok); background: rgba(52, 211, 153, .1); }
.ins-work.err { color: var(--danger); background: rgba(248, 113, 113, .1); }
.ins-work .text-btn { color: inherit; }
.map-ch.just-bound { box-shadow: inset 3px 0 0 var(--ok); }
.ins-form.is-busy .ins-foot button { opacity: .7; }

@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; overflow: visible; }
  .side {
    flex-direction: row; align-items: center; gap: 12px;
    padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .side { flex-wrap: wrap; }
  .nav { flex-direction: row; flex: 1 0 100%; order: 3; min-width: 0; overflow-x: auto; }
  .nav-item { width: auto; }
  .nav-count { display: none; }
  .side-foot { flex-direction: row; align-items: center; padding: 0; }
  .stats, .split, .form-grid, .dash-kpi { grid-template-columns: 1fr 1fr; }
  .dash-split { grid-template-columns: 1fr; gap: 20px; }
  .dash-metric { padding: 14px 12px 14px 0; }
  .dash-status-copy h2 { font-size: 22px; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
  .workspace { overflow: visible; }
  body.dock-work .content { overflow: visible; }
  body.dock-work .content > section:not(.hidden) { overflow: visible; min-height: 70vh; }
}
@media (max-width: 640px) {
  .stats, .split, .form-grid, .dash-kpi { grid-template-columns: 1fr; }
  .dash-metric { border-right: 0; border-bottom: 1px solid var(--border); }
  .dash-tr { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .dash-tr-meta { display: none; }
  .row-top { flex-wrap: wrap; }
}

/* ---- Пробер -------------------------------------------------------------- */
.probe-state { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.probe-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); flex: none;
}
.probe-dot.on {
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .55);
  animation: probe-pulse 1.6s ease-out infinite;
}
.probe-dot.hold {
  background: #f0a35e;
  box-shadow: 0 0 0 0 rgba(240, 163, 94, .45);
  animation: none;
}
@keyframes probe-pulse {
  70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.probe-live {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.probe-bar-wrap { margin-bottom: 16px; }
.probe-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--deep); border: 1px solid var(--border);
}
.probe-bar > span {
  display: block; height: 100%; width: 0;
  background: var(--muted); transition: width .4s ease;
}
.probe-bar > span.run { background: linear-gradient(90deg, var(--accent), var(--ok)); }
.section-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px;
}
/* ---- Пробер: шапка-статус ------------------------------------------------ */
#view-probe > * { flex: none; }
.pr-hero {
  --pr-tone: var(--muted);
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px; align-items: center;
  padding: 20px 24px; margin-bottom: 14px;
  background:
    radial-gradient(520px 200px at 0% 0%, color-mix(in srgb, var(--pr-tone) 16%, transparent), transparent 70%),
    var(--card);
  border: 1px solid var(--border); border-radius: 18px;
}
.pr-hero.run { --pr-tone: var(--ok); }
.pr-hero.hold { --pr-tone: var(--warn); }
.pr-hero.idle { --pr-tone: var(--accent); }
.pr-ring { position: relative; width: 112px; height: 112px; flex: none; }
.pr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.pr-ring circle { fill: none; stroke-width: 8; }
.pr-ring-bg { stroke: var(--deep); }
.pr-ring-arc {
  stroke: var(--pr-tone); stroke-linecap: round;
  transition: stroke-dashoffset .8s cubic-bezier(.3, .7, .2, 1), stroke .3s;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--pr-tone) 55%, transparent));
}
.pr-ring-txt {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.pr-ring-txt b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pr-ring-txt span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-top: 1px; }
.pr-hero-main { min-width: 0; }
.pr-status { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.pr-badge {
  font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  color: var(--pr-tone);
  background: color-mix(in srgb, var(--pr-tone) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--pr-tone) 35%, transparent);
}
.pr-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.pr-sub { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.pr-seg {
  display: flex; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--deep); border: 1px solid var(--border);
}
.pr-seg > span { display: block; height: 100%; width: 0; transition: width .6s ease; }
.pr-seg .ok { background: linear-gradient(90deg, var(--accent), var(--ok)); }
.pr-seg .fail { background: var(--danger); }
.pr-seg.cov .ok { background: var(--accent); }
.pr-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.pr-chip {
  font-size: 12px; color: var(--muted);
  padding: 4px 10px; border-radius: 999px;
  background: var(--deep); border: 1px solid var(--border);
  white-space: nowrap;
}
.pr-chip b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.pr-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 168px; }
.pr-actions button { height: 38px; }
.pr-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; color: var(--muted); cursor: pointer; user-select: none;
}
.pr-switch input { position: absolute; opacity: 0; pointer-events: none; }
.pr-switch i {
  order: 2; position: relative; width: 36px; height: 20px; border-radius: 999px;
  background: var(--deep); border: 1px solid var(--border); transition: background .2s;
}
.pr-switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s;
}
.pr-switch input:checked + i { background: color-mix(in srgb, var(--accent) 35%, var(--deep)); }
.pr-switch input:checked + i::after { transform: translateX(16px); background: var(--accent); }
.pr-switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- Пробер: метрики ----------------------------------------------------- */
.pr-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
  margin-bottom: 14px;
}
.pr-kpi {
  --kc: var(--accent);
  padding: 14px 16px 13px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--border);
}
.pr-kpi.ok { --kc: var(--ok); }
.pr-kpi.bad { --kc: var(--danger); }
.pr-kpi .k { font-size: 12px; font-weight: 650; color: var(--muted); }
.pr-kpi .v {
  font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin: 3px 0 8px;
  font-variant-numeric: tabular-nums;
}
.pr-kpi .s { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.pr-mini { height: 5px; border-radius: 999px; background: var(--deep); overflow: hidden; }
.pr-mini > span { display: block; height: 100%; background: var(--kc); border-radius: inherit; transition: width .6s ease; }

/* ---- Пробер: панели, нити, лента ------------------------------------------ */
.pr-panel {
  margin: 0 0 14px; padding: 14px 16px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.pr-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.pr-panel-head .section-label { margin: 0; }
.pr-none { margin: 4px 0; font-size: 13px; }
.pr-lanes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pr-lane {
  padding: 11px 13px 12px; border-radius: 12px;
  background: var(--deep); border: 1px solid var(--border);
  min-width: 0;
}
.pr-lane.busy { border-color: color-mix(in srgb, var(--ok) 28%, var(--border)); }
.pr-lane.busy.slow { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.pr-lane.idle { border-style: dashed; opacity: .7; }
.pr-lane-top { display: flex; align-items: baseline; gap: 8px; font-size: 11px; }
.pr-lane .slot { font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pr-lane .kind { color: var(--action-fg); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.pr-lane .ms { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
.pr-lane-name { margin-top: 7px; font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-lane-url {
  margin-top: 2px; font-size: 11.5px; color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pr-lane-bar { margin-top: 10px; height: 4px; border-radius: 999px; background: var(--card); overflow: hidden; }
.pr-lane-bar > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; transition: width 1s linear, background .3s; }
.pr-lane.slow .pr-lane-bar > span { background: var(--warn); }
.pr-hosts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.pr-hosts:empty { display: none; }
.pr-hosts .lbl { font-size: 12px; color: var(--muted); margin-right: 2px; }
.pr-host {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.pr-host b { color: var(--warn); }
.pr-seg-ctl {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: var(--deep); border: 1px solid var(--border);
}
.pr-seg-ctl button {
  height: 28px; padding: 0 11px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.pr-seg-ctl button i { font-style: normal; opacity: .65; margin-left: 4px; font-variant-numeric: tabular-nums; }
.pr-seg-ctl button:hover { color: var(--text); }
.pr-seg-ctl button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.pr-feed { display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow: auto; }
.pr-row {
  display: grid; grid-template-columns: 20px minmax(120px, 1.2fr) 74px minmax(140px, 1.6fr);
  gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px; font-size: 13px;
}
.pr-row:nth-child(odd) { background: color-mix(in srgb, var(--deep) 55%, transparent); }
.pr-row .mark { font-weight: 800; text-align: center; }
.pr-row.ok .mark { color: var(--ok); }
.pr-row.fail .mark { color: var(--danger); }
.pr-row .who { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pr-row .who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-row .who em { font-style: normal; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); flex: none; }
.pr-row .lat {
  justify-self: end; font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.pr-row .lat.fast { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pr-row .lat.mid { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.pr-row .lat.slow { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pr-row .url {
  color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px;
}
.pr-charts .chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart-val { font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--text); font-variant-numeric: tabular-nums; white-space: pre; }
.chart-val.good { color: var(--ok); }
.chart-val.bad { color: var(--danger); }
.pr-help { margin: 16px 0 4px; font-size: 13px; color: var(--muted); }
.pr-help summary { cursor: pointer; font-weight: 650; width: fit-content; }
.pr-help summary:hover { color: var(--text); }
.pr-help p { margin: 8px 0 0; max-width: 78ch; line-height: 1.5; }
.pr-help b { color: var(--text); }
@media (max-width: 1100px) {
  .pr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pr-hero { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 16px; }
  .pr-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; min-width: 0; }
  .pr-actions .pr-switch { margin-right: auto; gap: 10px; }
  .pr-ring { width: 88px; height: 88px; }
  .pr-ring-txt b { font-size: 21px; }
  .pr-title { font-size: 18px; }
  .pr-row { grid-template-columns: 18px minmax(0, 1fr) 70px; }
  .pr-row .url { display: none; }
}
@media (max-width: 520px) {
  .pr-kpis { grid-template-columns: minmax(0, 1fr); }
  .pr-hero { grid-template-columns: minmax(0, 1fr); }
  .pr-ring { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .pr-ring-arc, .pr-seg > span, .pr-mini > span, .pr-lane-bar > span { transition: none; }
}

.charts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.chart {
  margin: 0; padding: 14px 16px 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chart figcaption {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
.chart canvas { display: block; width: 100%; }

@media (max-width: 900px) {
  .charts { grid-template-columns: minmax(0, 1fr); }
}

.src-add {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px;
}
.src-add input, .src-add button { height: 40px; }
.src-add input[type="text"], .src-add input:not([type="file"]) {
  flex: 1; min-width: 160px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text);
}
.src-add input[type="file"] { max-width: 220px; color: var(--muted); font-size: 12px; }

.map-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
  flex: none;
}
.map-toolbar input[type="search"] {
  flex: 1; min-width: 200px; height: 40px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text);
}
#view-map .catalog-hint, #view-inbox .catalog-hint { flex: none; }
.map-layout, .inbox-layout, .src-layout, .epg-layout, .fleet-layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr) minmax(400px, 28vw);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px; align-items: stretch;
  flex: 1; min-height: 0; overflow: hidden;
}
.fleet-layout {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 34vw);
}
.chip .chip-n {
  display: inline-block; min-width: 1.4em; margin-left: 4px;
  padding: 0 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .14); font-size: 11px;
}
.chip.on .chip-n { background: rgba(255, 255, 255, .22); }
.ins-scroll-fleet {
  flex: 1; min-height: 0; overflow: auto; padding: 14px 16px 18px;
}
.ins-section { margin-bottom: 18px; }
.ins-section:last-child { margin-bottom: 0; }
.ins-section-h {
  margin: 0 0 8px; font-size: 11px; font-weight: 750;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.ins-kv {
  display: grid; grid-template-columns: 108px minmax(0, 1fr);
  gap: 6px 12px; font-size: 13px; align-items: start;
}
.ins-kv dt { margin: 0; color: var(--muted); font-size: 12px; }
.ins-kv dd { margin: 0; min-width: 0; word-break: break-word; }
.ins-hero-fleet {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px;
}
.ins-hero-fleet h3 { margin: 0 0 6px; font-size: 18px; font-weight: 750; }
.ins-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ins-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.ins-actions button { flex: none; }
.ins-link {
  appearance: none; border: 0; background: transparent; padding: 0;
  color: var(--action-fg); font: inherit; font-weight: 650; cursor: pointer;
  text-align: left; word-break: break-all;
}
.ins-link:hover { color: #fff; text-decoration: underline; }
.ins-danger { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.ins-field { display: block; margin-top: 8px; }
.ins-field span {
  display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.ins-field input {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--deep); color: var(--text); font-size: 13px;
}
.src-layout {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 1.35fr);
}
.inbox-layout {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 22vw) minmax(400px, 28vw);
}
.map-col {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 0; max-height: 100%; height: 100%;
  display: flex; flex-direction: column; overflow: hidden;
}
.map-inspector {
  position: relative; z-index: 2; min-height: 0;
}
.map-col-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px 10px 14px; font-size: 13px; font-weight: 700;
  border-bottom: 1px solid var(--border); color: var(--muted);
  flex: none; background: var(--card);
}
.map-col-head > span:first-child {
  text-transform: uppercase; letter-spacing: .04em; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-col-head .text-btn { flex: none; font-size: 12px; padding: 0; }
.map-cats, .map-list, .map-inspector #map-ins-body, .map-inspector #inbox-ins-body,
.map-inspector #src-ins-body, .map-inspector #epg-ins-body {
  overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain;
}
.map-inspector #map-ins-body, .map-inspector #inbox-ins-body,
.map-inspector #src-ins-body, .map-inspector #epg-ins-body {
  display: flex; flex-direction: column;
}
.map-cat, .map-ch, .inbox-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.map-cat:hover, .map-ch:hover, .inbox-row:hover { background: var(--card-hover); }
.map-cat.on, .map-ch.on, .inbox-row.on { background: var(--action); color: var(--action-fg); }
.map-ch.sel:not(.on) { background: rgba(59, 130, 246, .08); }
.map-ch input[data-sel-key] {
  flex: none; width: 15px; height: 15px; margin: 0;
  accent-color: var(--accent); cursor: pointer;
}
.ch-ico-slot {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px; overflow: hidden;
  background: #111827; border: 1px solid var(--border);
}
.ch-ico-slot img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.ch-ico-slot.empty { border-style: dashed; background: #0f1622; }
.ch-ico-sm { width: 22px; height: 22px; border-radius: 5px; }
.ins-logo { width: 56px; height: 56px; border-radius: 12px; }
.map-ch-meta { min-width: 0; flex: 1; overflow: hidden; }
.map-ch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-ch-sub { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list-btns { display: flex; gap: 10px; flex: none; }
.map-cat .n, .map-ch .n { margin-left: auto; color: var(--muted); font-size: 12px; }
.map-cat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-cat-x {
  appearance: none; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1;
  padding: 4px 6px; flex: none; min-width: 28px; min-height: 28px;
  position: relative; z-index: 2; user-select: none; -webkit-user-drag: none;
}
.map-cat-x:hover { color: var(--danger); }
.map-cat[draggable="true"], .map-ch[draggable="true"] { cursor: grab; }
.map-col-head.ins-head > #map-ins-head,
.map-col-head.ins-head > #src-ins-head,
.map-col-head.ins-head > #inbox-ins-head,
.map-col-head.ins-head > #epg-ins-head {
  text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text);
}
.ins-del-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--danger); font-size: 12px; font-weight: 700;
  cursor: pointer; padding: 4px 8px; flex: none; border-radius: 8px;
}
.ins-del-btn:hover { background: rgba(248, 113, 113, .16); color: #fecaca; }
.ins-hero {
  display: flex; align-items: flex-start; gap: 12px;
}
.ins-hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ins-hero-name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.ins-hero-main > button { height: 30px; font-size: 12px; padding: 0 10px; }
.ins-url-preview {
  font-size: 12px; color: var(--muted); word-break: break-all; line-height: 1.35;
}
.ins-grid {
  display: flex; flex-direction: column; gap: 10px;
}
.ins-grid .span2 { width: 100%; }
.ins-grid label { min-width: 0; display: block; }
.ins-grid .muted { font-size: 12px; line-height: 1.4; }
.ins-field-row {
  position: relative; display: block;
}
.ins-field-row > input {
  width: 100%; padding-right: 36px; box-sizing: border-box;
}
.ins-field-clear {
  appearance: none; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0;
  font-size: 18px; line-height: 1; border-radius: 8px;
}
.ins-field-clear:hover { color: var(--danger); background: rgba(248, 113, 113, .12); }
.ins-row-2 {
  display: grid; grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px 10px;
}
.ins-tabs {
  display: flex; gap: 2px; padding: 0 10px;
  border-bottom: 1px solid var(--border); flex: none;
  background: var(--card);
}
.ins-tab {
  appearance: none; border: 0; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 700;
  padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent;
}
.ins-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.ins-tab:hover { color: var(--text); }
.ins-pane { display: none; flex-direction: column; gap: 12px; }
.ins-pane.on { display: flex; }
.src-tools {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 10px; flex: none; border-bottom: 1px solid var(--border);
}
.src-tools input[type="search"] {
  width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--deep); color: var(--text);
}
.src-tools .chips { flex-wrap: wrap; }
.src-compact { flex: none; }
body[data-view="catalog"] #page-sub { display: none !important; }
body[data-view="catalog"] .top { padding: 8px 20px 2px; }
body[data-view="catalog"] .top h1 { font-size: 18px; }
#view-catalog {
  min-height: 0;
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}
body.dock-work #view-catalog { overflow: hidden; }
#view-catalog .src-chrome { flex: none; min-width: 0; }
#view-catalog .src-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  margin: 0 0 6px;
}
#view-catalog .src-status .probe-state { min-width: 0; flex: 1; font-size: 13px; font-weight: 600; }
#view-catalog .src-metrics { display: none; }
#view-catalog .probe-bar-wrap {
  margin: 0 0 6px;
}
#view-catalog:not(.is-building) .probe-bar-wrap { display: none; }
#view-catalog .probe-state,
#view-catalog #catalog-phase,
#view-catalog #catalog-bar-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#view-catalog .src-workbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 0 8px;
}
#view-catalog .src-workbar > input[type="search"] {
  flex: 0 0 160px;
  width: 160px;
  min-width: 120px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
}
#view-catalog .src-workbar .chips {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  gap: 6px;
}
#view-catalog .src-workbar .chip {
  flex: none;
  white-space: nowrap;
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
#view-catalog .src-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 420px;
  min-width: 220px;
  margin: 0;
}
#view-catalog .src-add input, #view-catalog .src-add button { height: 32px; }
#view-catalog .src-add #src-new-id { flex: 0 0 88px; min-width: 72px; }
#view-catalog .src-add #src-new-url { flex: 1 1 140px; min-width: 100px; }
#view-catalog .src-add button { padding: 0 12px; flex: none; }
#view-catalog .src-file {
  position: relative;
  flex: none;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}
#view-catalog .src-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
#view-catalog > .src-layout {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}
#src-list-wrap, #src-entries-wrap, #src-ins {
  min-height: 0;
}
#src-list .map-ch {
  min-height: 0;
  flex-wrap: nowrap;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
}
#src-list .src-row-actions {
  width: auto;
  flex: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 0;
}
body[data-view="catalog"] .job-strip { padding: 4px 20px 0; }
@media (max-width: 1180px) {
  #view-catalog .src-workbar { flex-wrap: wrap; }
  #view-catalog .src-add { flex: 1 1 100%; min-width: 0; }
}
body.dock-work #view-epg .stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 8px;
}
.url-card, .epg-id-row {
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.tz-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tz-chips .badge { cursor: pointer; }
.ins-form button:disabled, .ins-form button[disabled] {
  opacity: .35; cursor: default;
}
.ins-form button:disabled:hover, .ins-form button[disabled]:hover {
  background: #1c2738; color: var(--text); border-color: var(--border);
}
.url-card input { width: 100%; }
.url-card-addr, .epg-id-val {
  font-size: 12px; word-break: break-all; line-height: 1.35;
}
.url-card-meta, .epg-id-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
/* Вкладка «Потоки»: один список, у каждого потока видно плейлист, строку и канон. */
.st { display: flex; flex-direction: column; gap: 14px; }
.st-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.st-sum b { font-size: 20px; font-weight: 650; color: var(--text); margin-right: 2px; }
.st-flt { display: flex; flex-wrap: wrap; gap: 6px; }
.ins-form .st-chip {
  height: 28px; padding: 0 11px; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 12px; font-weight: 550;
}
.ins-form .st-chip i { font-style: normal; opacity: .7; margin-left: 3px; }
.ins-form .st-chip:hover { background: var(--action); color: var(--action-fg); border-color: #3b6bb5; }
.ins-form .st-chip.on { background: var(--action); color: var(--action-fg); border-color: #3b6bb5; }
.st-hint { margin: 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
.st-list { display: flex; flex-direction: column; gap: 8px; }
.st-empty {
  display: block; padding: 12px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--muted); font-size: 12px; text-align: center;
}
.st-card {
  padding: 10px; gap: 8px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--deep);
}
.st-card[data-ok="0"] { border-color: rgba(248, 113, 113, .4); }
.st-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.st-grow { flex: 1; }
.st-src {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 10px;
  border-radius: 8px; border-left: 3px solid #72a5ff; background: rgba(114, 165, 255, .08);
}
.st-src-none { border-left-color: var(--border); background: rgba(255, 255, 255, .04); color: var(--muted); font-size: 12px; }
.st-o + .st-o { padding-top: 6px; border-top: 1px dashed var(--border); }
.st-o-r {
  display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px;
  align-items: baseline; font-size: 12px; line-height: 1.45;
}
.st-k { color: var(--muted); }
.st-v { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.st-pl { font-weight: 650; color: #9cc2ff; }
.st-canon {
  padding: 1px 6px; border-radius: 4px; background: rgba(255, 212, 121, .12); color: #ffd479;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
}
.st-via { margin-left: 6px; font-size: 11px; color: var(--muted); }
.st-addr { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--muted); line-height: 1.4; }
.st-host { font-size: 11px; color: var(--muted); }
.st-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ins-form .st-foot button { height: 28px; padding: 0 10px; font-size: 12px; }
.ins-form .st-foot button.st-del:hover { background: #7f1d1d; color: #fff; border-color: transparent; }
.st-hide { display: none !important; }
.epg-preview { display: flex; flex-direction: column; gap: 6px; }
.epg-prog {
  font-size: 13px; padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.epg-prog .t { font-size: 11px; color: var(--muted); }
.src-row-actions { display: flex; gap: 8px; flex: none; }
.src-url-form { display: flex; gap: 6px; padding: 8px 10px 0; }
.src-url-form[hidden] { display: none; }
.src-url-form input { flex: 1; min-width: 0; height: 32px; }
.src-url-form button { height: 32px; flex: none; padding: 0 10px; }
#src-list .map-ch, #epg-feeds .map-ch { align-items: flex-start; }
.ins-block {
  display: flex; flex-direction: column; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.ins-block-h {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.ins-empty {
  margin: auto; padding: 28px 18px; text-align: center;
  color: var(--muted); font-size: 13px; line-height: 1.45;
}
.ins-form {
  padding: 0; display: flex; flex-direction: column; gap: 0;
  flex: 1; min-height: 0;
}
.ins-scroll {
  padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 12px;
  overflow: auto; flex: 1; min-height: 0;
}
.ins-foot {
  flex: none; display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  background: var(--card);
  position: relative; z-index: 50;
}
.ins-foot > button[type="submit"], .ins-foot-split > button { flex: 1; min-width: 0; }
.ins-form button {
  appearance: none; cursor: pointer;
  height: 34px; padding: 0 12px; border-radius: 10px;
  background: #1c2738; color: var(--text);
  border: 1px solid var(--border); font-size: 13px; font-weight: 650;
}
.ins-form button:hover { background: var(--accent); color: #fff; border-color: transparent; }
.ins-form button.danger { color: var(--danger); border-color: rgba(248, 113, 113, .35); }
.ins-form button.danger:hover { background: #7f1d1d; color: #fff; border-color: transparent; }
.ins-form button[type="submit"], .ins-foot > button:not(.ghost):not(.danger) {
  background: var(--accent); color: #fff; border-color: transparent;
}
.ins-form label { position: relative; display: block; }
.ins-form label > span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ins-field-wrap { position: relative; }
.ins-field-wrap > .suggest { top: 100%; }
.ins-form input, .ins-form select, .ins-form textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--deep); color: var(--text);
}
.ins-form textarea { min-height: 72px; resize: vertical; font-size: 12px; }
.alias-row, .url-row {
  display: flex; gap: 6px; align-items: center; margin: 0;
}
.ins-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.alias-row input { flex: 1; min-width: 0; }
.alias-row button, .url-row button { flex: none; height: 32px; padding: 0 10px; }
.ins-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  max-height: min(280px, 45vh); overflow: auto;
  border: 1px solid var(--border); border-radius: 8px;
  margin-top: 4px; background: var(--card);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.suggest div { padding: 7px 10px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.suggest div:hover { background: var(--card-hover); }
@media (max-width: 1100px) {
  .map-layout:not(.src-layout):not(.epg-layout) {
    grid-template-columns: 160px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(240px, 38vh);
  }
  .map-layout:not(.src-layout):not(.epg-layout) > .map-inspector {
    grid-column: 1 / -1; grid-row: 2;
    position: sticky; bottom: 0; top: auto; height: 38vh; max-height: 38vh;
  }
  .fleet-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 42vh) minmax(280px, 1fr);
  }
  .inbox-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 1fr) minmax(140px, 28vh) minmax(240px, 42vh);
  }
  #inbox-thin-wrap {
    grid-row: 2;
  }
  #inbox-ins {
    grid-row: 3; height: 42vh; max-height: 42vh;
    position: sticky; bottom: 0; top: auto;
  }
}

/* ---- Устройства: один список токенов и устройств ------------------------ */
#view-devices { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.fleet-toolbar { align-items: center; }
.fleet-toolbar input[type="search"] { flex: 1 1 260px; min-width: 200px; }
.fleet-toolbar select { width: auto; min-width: 140px; max-width: 200px; }
.fleet-toolbar > button { flex: none; height: 40px; }
#view-devices .fleet-layout { grid-template-columns: minmax(0, 1fr) clamp(340px, 31vw, 460px); }
#dev-list-wrap { min-width: 0; }
.fleet-table-wrap {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  container: fleet / inline-size;
}
.fleet-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.fleet-table thead th {
  position: sticky; top: 0; z-index: 2; height: 36px; padding: 0 10px;
  background: var(--card); border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.fleet-table th.c-sel, .fleet-table td.c-sel { width: 38px; padding-right: 0; }
.fleet-table th.c-status { width: 132px; }
.fleet-table th.c-kind { width: 124px; }
.fleet-table th.c-seen { width: 104px; }
.fleet-table th.c-exp { width: 164px; }
.fleet-table th.c-act, .fleet-table td.c-act { width: 40px; padding-left: 0; text-align: right; }
.th-sort {
  appearance: none; border: 0; background: transparent; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
}
.th-sort:hover, .th-sort.on { color: var(--text); }
.th-arrow { width: 10px; font-size: 9px; }
.fleet-table input[type="checkbox"] {
  width: 15px; height: 15px; padding: 0; margin: 0; cursor: pointer; accent-color: var(--accent);
}
.fleet-tr { cursor: pointer; scroll-margin-top: 36px; }
.fleet-tr td {
  padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fleet-tr:hover { background: var(--card-hover); }
.fleet-tr.sel { background: rgba(59, 130, 246, .08); }
.fleet-tr.on { background: var(--action); box-shadow: inset 3px 0 #62a9ff; }
.fleet-name { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.fleet-name .badge { height: 18px; margin-left: 6px; padding: 0 6px; font-size: 10px; vertical-align: 1px; }
.fleet-sub { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--muted); }
.fleet-ver { font-size: 11px; color: var(--muted); }
.c-status .status-dot { display: inline-block; margin-right: 9px; vertical-align: middle; }
.st-text { vertical-align: middle; font-weight: 600; }
.st-online { color: var(--ok); }
.st-offline { color: var(--muted); }
.st-free { color: var(--action-fg); }
.st-frozen { color: var(--warn); }
.st-blocked, .st-expired { color: var(--danger); }
.c-seen, .c-exp { font-size: 12px; font-variant-numeric: tabular-nums; }
.c-exp.warn { color: var(--warn); }
.c-exp.bad { color: var(--danger); }
.c-exp.muted { color: var(--muted); }
.row-copy {
  appearance: none; display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0;
}
.row-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fleet-tr:hover .row-copy, .fleet-tr.on .row-copy, .row-copy:focus-visible { opacity: 1; }
.row-copy:hover { background: var(--pill); color: var(--text); }
.fleet-sub .sub-kind { display: none; }
@container fleet (max-width: 820px) { .fleet-table .c-kind { display: none; } .fleet-sub .sub-kind { display: inline; } }
@container fleet (max-width: 660px) { .fleet-table .c-exp { display: none; } }
@container fleet (max-width: 520px) { .fleet-table .c-seen { display: none; } }
.fleet-empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.fleet-empty h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--text); }
.fleet-empty p { margin: 0 0 16px; font-size: 13px; }

/* Панель массовых действий: липнет к низу списка, пока что-то выбрано */
.fleet-bulk {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 14px; border-top: 1px solid var(--border); background: var(--card);
  box-shadow: 0 -12px 24px rgba(0, 0, 0, .22);
}
.bulk-n { font-size: 13px; color: var(--muted); }
.bulk-n b { color: var(--text); }
.bulk-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fleet-bulk button, .fleet-bulk select { height: 32px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.fleet-bulk select { width: auto; background: #1c2738; font-weight: 650; cursor: pointer; }
.fleet-bulk button:disabled { opacity: .45; cursor: default; }
.fleet-bulk .text-btn { margin-left: auto; height: auto; }

/* Состояния: серый — просто не в сети, красный — только когда что-то не так */
.status-dot.s-on { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .16); }
.status-dot.s-off { background: #55657d; box-shadow: none; }
.status-dot.s-free { background: transparent; border: 2px solid var(--action-fg); box-shadow: none; }
.status-dot.s-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .16); }
.status-dot.s-bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(248, 113, 113, .14); }
.badge.info { background: var(--action); color: var(--action-fg); }

/* Панель деталей */
#dev-ins-body .ins-scroll-fleet { padding: 16px 18px 20px; }
.ins-notice {
  margin: 0 0 18px; padding: 9px 12px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.45; background: var(--pill); color: var(--text);
  border-left: 3px solid var(--muted);
}
.ins-notice.warn { background: rgba(251, 191, 36, .09); color: #fde68a; border-left-color: var(--warn); }
.ins-notice.bad { background: rgba(248, 113, 113, .09); color: #fecaca; border-left-color: var(--danger); }
.ins-notice.info { background: rgba(59, 130, 246, .09); color: #bfdbfe; border-left-color: var(--accent); }
.dev-card {
  margin-bottom: 10px; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--deep);
}
.dev-card:last-child { margin-bottom: 0; }
.dev-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.dev-card-head b { min-width: 0; overflow-wrap: anywhere; }
.ins-kv dd.sm { font-size: 11px; }
.tok-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--deep);
}
.tok-big { font-size: 20px; font-weight: 700; letter-spacing: .12em; color: #e0e7ff; }
.ins-sub { margin: 16px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
.date-row { display: flex; gap: 6px; margin-top: 6px; }
.date-row input { flex: 1; min-width: 0; height: 34px; border-radius: 8px; font-size: 13px; color-scheme: dark; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
  appearance: none; height: 32px; padding: 0 12px; border: 0; border-radius: 0;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button:hover { background: var(--card-hover); color: var(--text); }
.seg button.on { background: var(--action); color: var(--action-fg); }
.seg button.on[data-arg="frozen"] { background: rgba(251, 191, 36, .16); color: var(--warn); }
.seg button.on[data-arg="blocked"] { background: rgba(248, 113, 113, .16); color: var(--danger); }
.hint { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--muted); }
#dev-ins-body button.danger, .fleet-bulk button.danger, .confirm-card button.danger {
  appearance: none; height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--danger); border: 1px solid rgba(248, 113, 113, .4);
  font-size: 13px; font-weight: 650;
}
#dev-ins-body button.danger:hover, .fleet-bulk button.danger:hover { background: #b91c1c; color: #fff; border-color: transparent; }
.confirm-card button.danger { background: #b91c1c; color: #fff; border-color: transparent; }
.confirm-card button.danger:hover { background: #dc2626; }
#dev-ins-body button.primary { height: 34px; padding: 0 14px; border-radius: 8px; font-size: 13px; }
#dev-ins-body .ins-foot button.ghost { height: 34px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Окна: выдача токенов и подтверждение */
#confirm-modal { z-index: 50; }
.confirm-card { width: min(440px, 100%); }
.confirm-card h2 { margin: 0 0 10px; font-size: 17px; font-weight: 650; }
.confirm-card p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; }
.issue-term { display: flex; flex-direction: column; gap: 8px; }
.issue-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.issue-hint { margin: -4px 0 0; font-size: 12px; }
.issue-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; margin-top: 8px; overflow: auto; }
.issue-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--deep);
}
.issue-row .tok-big { font-size: 18px; }
.issue-row-sub { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.issue-row button { height: 30px; font-size: 12px; }

@media (max-width: 1100px) {
  #view-devices .fleet-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(240px, 46vh) minmax(300px, 1fr);
  }
  #view-devices .fleet-layout > .map-inspector {
    grid-column: 1; grid-row: 2; border-left: 0; border-top: 1px solid var(--border);
  }
}

/* ---- Кнопка в работе ------------------------------------------------------
   .is-pending ставит admin.js на кнопку, по клику которой ушёл запрос. */
button.is-pending { cursor: progress; pointer-events: none; opacity: .82; }
button.is-pending::before {
  content: ""; display: inline-block; flex: none;
  width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
button.stx-btn.is-pending::before { margin-right: 0; }
button.icon-btn.is-pending::before { margin: 0; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  button.is-pending::before { animation-duration: 2s; }
}

/* ---- Крестик очистки в конце строки ----------------------------------------
   Один вид для всех текстовых полей: рисуется фоном самого поля, виден, пока в нём есть
   текст (admin.js следит, чтобы у поля был placeholder: так :placeholder-shown отличает
   пустое от заполненного). Клик по правым 30px очищает; data-no-clear отключает. */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
input:is([type="text"], [type="search"], [type="url"], [type="email"], :not([type])):not(:placeholder-shown):not(:disabled):not([readonly]):not([data-no-clear]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23334155'/%3E%3Cpath d='M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6' stroke='%23c7d2e3' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  background-size: 16px 16px !important;
  padding-right: 34px !important;
}
input.clr-hot:is([type="text"], [type="search"], [type="url"], [type="email"], :not([type])):not(:placeholder-shown) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23ef4444'/%3E%3Cpath d='M5.2 5.2l5.6 5.6M10.8 5.2l-5.6 5.6' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  cursor: pointer;
}

.country-pick {
  height: 40px; padding: 0 10px; max-width: 220px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--text); font-size: 13px;
}
.src-tools .country-pick { width: 100%; max-width: none; height: 34px; border-radius: 10px; background: var(--deep); }

#wp-modal { padding-top: 5vh; }
.wp-card { width: min(920px, 100%); }
.wp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.wp-title { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-video { display: block; width: 100%; max-height: 62vh; background: #000; border-radius: 12px; }
.wp-status { margin-top: 10px; font-size: 13px; line-height: 1.4; min-height: 1.4em; }
.wp-status.ok { color: var(--ok); }
.wp-status.err { color: var(--danger); }
.wp-url { margin-top: 4px; font-size: 12px; word-break: break-all; }
.wp-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wp-bar .ghost { height: 36px; min-width: 44px; }
.wp-gap { flex: 1; }


/* ---- Система → Сервер (мониторинг) ---- */
.srv-health { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--deep); margin-bottom: 12px; }
.srv-health-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: var(--muted); }
.srv-health.ok .srv-health-dot { background: var(--ok); }
.srv-health.warn { border-color: var(--warn); }
.srv-health.warn .srv-health-dot { background: var(--warn); }
.srv-health.danger { border-color: var(--danger); }
.srv-health.danger .srv-health-dot { background: var(--danger); }
.srv-health ul { margin: 4px 0 0; padding-left: 18px; font-size: 13px; }
.srv-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.srv-toolbar p { margin: 0; font-size: 12.5px; }
.srv-live input { width: auto; min-width: 0; margin: 0; }
.srv-live { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.srv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.srv-tile { background: var(--panel, var(--deep)); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 8px; min-width: 0; }
.srv-tile h3 { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.srv-big { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.srv-sub { font-size: 12px; color: var(--muted); min-height: 1.3em; font-variant-numeric: tabular-nums; }
.srv-tile.warn .srv-big { color: var(--warn); }
.srv-tile.danger .srv-big { color: var(--danger); }
.srv-spark { width: 100%; height: 48px; margin-top: 6px; display: block; }
.srv-spark path.area { fill: var(--accent); opacity: .16; stroke: none; }
.srv-spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.srv-spark path.line2 { fill: none; stroke: var(--warn); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
