/* ADR-010 / SPEC-v0_10 — admin section styles.
 * Извлечено из prototype/admin-canaries.html и prototype/admin-proxies.html
 * (объединены, дубликаты убраны). Подключается через extra_head только в
 * admin templates.
 */

/* ============ admin layout ============ */
.ad-main {
  max-width: min(1380px, calc(100vw - 32px));
  padding: 24px 16px 64px;
}

.ad-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}
.ad-head h1 { font-size: 30px; margin-bottom: 4px; }
.ad-head .sub { color: var(--ink-3); font-size: 13px; max-width: 520px; }
.ad-actions { display: flex; gap: 8px; }

/* Постоянная шапка-меню админки: full-width sticky-полоса под топбаром.
   Подключается из base.html только для админа, на всех страницах. */
.admin-navbar {
  position: sticky;
  top: 52px;        /* под sticky-топбаром (52px), тем же оффсетом, что .form-progress */
  z-index: 8;       /* ниже топбара (10), выше липких ячеек таблиц (1-3) */
  background: var(--page-bg);  /* непрозрачный фон — контент не просвечивает при скролле */
  border-bottom: 1px solid var(--line-soft);  /* линия шапки во всю ширину */
}
.admin-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  /* Вкладки выровнены по ширине контента (.ad-main): same max-width + padding. */
  max-width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 16px;
}
.admin-tab {
  padding: 11px 16px 12px;
  font-size: 13px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 120ms;
  margin-bottom: -1px;
  /* На узких экранах строка вкладок скроллится по горизонтали: вкладки не
     ужимаются и не переносятся (иначе счётчик/длинный текст уходит на 2-ю
     строку и появляется лишний вертикальный скроллбар). */
  flex: 0 0 auto;
  white-space: nowrap;
}
.admin-tab a { color: inherit; text-decoration: none; }
.admin-tab.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.admin-tab:hover { color: var(--ink-2); }
.admin-tab .ct {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  margin-left: 6px;
}

/* ============ role chip ============ */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  background: #c8364e;
  color: var(--paper);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-left: 8px;
}
.role-chip::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--paper);
}
/* ============ topbar health dots ============ */
.system-health-strip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: 12px;
}
.system-health-dot {
  position: relative;
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #8d8678;
  border: 1px solid rgba(246, 239, 223, 0.34);
  box-shadow: 0 0 0 1px rgba(31, 26, 20, 0.4);
  cursor: help;
  flex: 0 0 auto;
}
.system-health-dot.ok {
  background: #25c43b;
  border-color: rgba(161, 255, 174, 0.72);
}
.system-health-dot.warn {
  background: #e2aa23;
  border-color: rgba(255, 224, 126, 0.78);
}
.system-health-dot.down {
  background: #d94336;
  border-color: rgba(255, 156, 146, 0.78);
}
.system-health-dot.off {
  background: #7f7a70;
  border-color: rgba(246, 239, 223, 0.32);
}
.system-health-dot::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-2px);
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 28px -14px rgba(31, 26, 20, 0.55);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 120ms ease, transform 120ms ease;
}
.system-health-dot::before {
  content: '';
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--paper);
  opacity: 0;
  pointer-events: none;
  z-index: 31;
  transition: opacity 120ms ease;
}
.system-health-dot:hover::after,
.system-health-dot:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.system-health-dot:hover::before,
.system-health-dot:focus-visible::before {
  opacity: 1;
}
.system-health-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 1px;
  padding: 0;
  border: 1px solid rgba(246, 239, 223, 0.22);
  border-radius: 999px;
  background: transparent;
  color: rgba(246, 239, 223, 0.7);
  font: 15px/1 var(--sans);
  cursor: pointer;
}
.system-health-refresh:hover,
.system-health-refresh:focus-visible {
  background: rgba(246, 239, 223, 0.1);
  color: var(--paper);
  outline: none;
}
.system-health-refresh.htmx-request {
  opacity: 0.58;
  pointer-events: none;
}

/* ============ metric strip ============ */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--paper);
  overflow: hidden;
  margin-bottom: 24px;
}
.metric-cell {
  padding: 16px 18px;
  border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.metric-cell:last-child { border-right: none; }
.metric-label { font-size: 11px; color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.05em; }
.metric-value { font-size: 26px; font-weight: 500; color: var(--ink); font-family: var(--serif); font-variant-numeric: tabular-nums; }
.metric-foot { font-size: 11px; color: var(--ink-3); }
.metric-foot.ok { color: #2e8b3e; }
.metric-foot.warn { color: #b75d2a; }
.booking-metric-strip {
  margin-bottom: 14px;
}
.booking-metric-strip .metric-cell {
  padding: 10px 14px;
  gap: 2px;
}
.booking-metric-strip .metric-label {
  font-size: 10px;
}
.booking-metric-strip .metric-value {
  font-size: 21px;
}
.booking-metric-strip .metric-foot {
  font-size: 10px;
}

/* ============ booking v2 test panel ============ */
.captcha-pool-panel,
.booking-test-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--paper);
  margin-bottom: 24px;
}
.captcha-pool-monitor {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.captcha-pool-monitor > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}
.captcha-pool-monitor > div:last-child { border-right: none; }
.captcha-pool-settings {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) repeat(6, minmax(86px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.captcha-pool-settings .form-row {
  margin-bottom: 0;
}
.captcha-pool-toggle {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--ink-2);
}
.captcha-pool-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.general-settings-form .captcha-pool-toggle {
  width: fit-content;
  margin-bottom: 14px;
}
.captcha-provider-table tbody tr {
  cursor: default;
}
/* Крайние колонки таблицы провайдеров отступают от краёв панели на 16px —
   как заголовок секции (фон шапки и разделители строк остаются full-width). */
.captcha-provider-table th:first-child,
.captcha-provider-table td:first-child {
  padding-left: 16px;
}
.captcha-provider-table th:last-child,
.captcha-provider-table td:last-child {
  padding-right: 16px;
}
.captcha-provider-table .col-provider {
  font-weight: 500;
  color: var(--ink);
}
.captcha-provider-table .col-balance,
.captcha-provider-table .col-outcomes {
  font-variant-numeric: tabular-nums;
}
.captcha-provider-table .col-outcomes {
  color: var(--ink-3);
}
.captcha-provider-table .prio-input {
  width: 54px;
  padding: 6px 8px;
  text-align: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  color: var(--ink);
}
.captcha-provider-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.captcha-provider-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.captcha-provider-off {
  opacity: 0.55;
}
/* Кнопка «Сохранить набор» — футер с отступами, не прилипает к краям панели. */
.captcha-provider-actions {
  margin-top: 0;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}
/* Контент верхней секции пула не должен прилипать к краям панели (заголовок,
   метрики, форма настроек идут с горизонтальным отступом, как заголовки таблиц). */
.captcha-pool-panel > .booking-test-head {
  padding: 14px 16px 0;
  margin-bottom: 0;
}
.captcha-pool-panel > .booking-test-notice {
  margin: 12px 16px 0;
}
.captcha-pool-panel > .captcha-pool-monitor {
  margin: 14px 16px;
}
.captcha-pool-panel > .captcha-pool-settings {
  padding: 0 16px 16px;
}
.captcha-pool-panel > .general-settings-form {
  padding: 14px 16px 16px;
}
.booking-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.booking-test-head h2 {
  font-size: 16px;
  margin-bottom: 4px;
}
.booking-test-flags,
.booking-test-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.booking-test-controls {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 110px 110px 140px minmax(260px, auto);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}
.booking-test-controls .form-row {
  margin-bottom: 0;
}
.booking-test-safety {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin-bottom: 14px;
  font-size: 12px;
  line-height: 1.45;
}
.booking-test-safety code {
  font-family: var(--mono);
}
.booking-test-safety.safe {
  background: rgba(46,139,62,0.09);
  border: 1px solid rgba(46,139,62,0.22);
  color: #2e6f39;
}
.booking-test-safety.danger {
  background: rgba(200,54,78,0.1);
  border: 1px solid rgba(200,54,78,0.3);
  color: #9f2035;
}
.booking-test-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  margin: 4px 0 14px;
}
.booking-test-summary-item {
  padding: 10px 12px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}
.booking-test-summary-item:last-child {
  border-right: none;
}
.booking-test-summary-label {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
}
.booking-test-summary-value {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.booking-test-timing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0 0 14px;
  background: var(--line-soft);
}
.booking-test-timing-item {
  min-width: 0;
  padding: 10px 12px;
  background: var(--paper);
}
.booking-test-timing-label,
.booking-test-timing-detail {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.booking-test-timing-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}
.booking-test-timing-value {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.booking-test-timing-detail {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-4);
}
.booking-test-log {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0 0 14px;
  background: #fbfaf7;
}
.booking-test-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.booking-test-log-head h3 {
  margin: 0;
  font-size: 13px;
}
.booking-test-log-head span {
  font-size: 11px;
  color: var(--ink-4);
}
.booking-test-log-lines {
  max-height: 360px;
  overflow: auto;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}
.booking-test-log-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.booking-test-log-line time {
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.booking-test-log-line span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink-2);
}
.booking-test-foot {
  font-size: 11px;
  color: var(--ink-4);
}
.booking-test-table {
  margin-bottom: 12px;
}
.booking-test-table tbody tr {
  cursor: default;
}
.booking-test-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  line-height: 1.5;
}
.booking-test-foot code {
  font-family: var(--mono);
}
.booking-test-notice {
  margin-bottom: 14px;
}
.test-application-panel {
  margin-top: 16px;
  margin-bottom: 14px;
  padding: 0;
}
.booking-test-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.booking-test-summary::-webkit-details-marker {
  display: none;
}
.booking-test-summary::before {
  content: '▸';
  color: var(--ink-4);
  font-size: 12px;
  line-height: 22px;
}
.booking-test-panel[open] .booking-test-summary {
  border-bottom: 1px solid var(--line-soft);
}
.booking-test-panel[open] .booking-test-summary::before {
  content: '▾';
}
.booking-test-body {
  padding: 16px;
}
.test-application-form {
  display: grid;
  grid-template-columns: 110px minmax(150px, 1fr) minmax(120px, 0.8fr) 160px 150px auto;
  gap: 12px;
  align-items: end;
}
.test-application-form .form-row {
  margin-bottom: 0;
}
.test-application-submit {
  display: flex;
  align-items: end;
}
.test-application-submit .btn {
  height: 36px;
}
.test-application-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
}
.test-application-note strong {
  color: var(--ink-2);
}

/* ============ booking queue ============ */
.booking-queue-panel {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--paper);
  overflow: hidden;
  margin-bottom: 24px;
}
.booking-queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.booking-queue-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
}
.booking-queue-head .sub {
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.45;
  max-width: 720px;
}
.booking-queue-search,
.booking-queue-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
}
.booking-queue-search input,
.booking-queue-filters input,
.booking-queue-filters select {
  width: min(360px, 100%);
}
.booking-queue-filters .form-row {
  margin-bottom: 0;
  min-width: 132px;
}
.booking-queue-filters .form-row:first-child {
  min-width: 220px;
  flex: 1 1 240px;
}
.booking-queue-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}
.booking-queue-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
}
.booking-queue-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
.booking-queue-table {
  table-layout: fixed;
  min-width: 1180px;
}
.booking-queue-table tbody tr {
  cursor: default;
}
.booking-queue-table tbody tr.is-archived {
  opacity: 0.68;
}
.booking-queue-table th,
.booking-queue-table td {
  text-align: center;
  border-right: 1px solid rgba(211, 204, 185, 0.36);
  vertical-align: middle;
}
.booking-queue-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper-2);
}
.booking-queue-table th:last-child,
.booking-queue-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--paper);
  box-shadow: -1px 0 0 rgba(211, 204, 185, 0.56);
}
.booking-queue-table thead th:last-child {
  z-index: 3;
  background: var(--paper-2);
}
.booking-queue-table th:last-child,
.booking-queue-table td:last-child {
  border-right: none;
}
.booking-queue-table th:nth-child(1) { width: 92px; }
.booking-queue-table th:nth-child(2) { width: 180px; }
.booking-queue-table th:nth-child(3) { width: 150px; }
.booking-queue-table th:nth-child(4) { width: 100px; }
.booking-queue-table th:nth-child(5) { width: 130px; }
.booking-queue-table th:nth-child(6) { width: 140px; }
.booking-queue-table th:nth-child(7) { width: 145px; }
.booking-queue-table th:nth-child(8) { width: 155px; }
.booking-queue-table th:nth-child(9) { width: 150px; }
.booking-queue-client,
.booking-queue-reason {
  text-align: left;
}
.booking-queue-table .cell-main,
.booking-queue-table .cell-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.booking-queue-table .cell-main {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}
.booking-queue-table .cell-sub {
  margin-top: 4px;
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.35;
}
.booking-queue-table .italyvms-usage-exhausted {
  color: var(--bad);
  font-weight: 700;
}
.booking-queue-table .italyvms-usage-low {
  color: var(--warn);
  font-weight: 600;
}
.booking-queue-client strong,
.booking-queue-client span,
.booking-queue-sub,
.booking-queue-reason span {
  display: block;
  overflow-wrap: anywhere;
}
.booking-queue-client strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}
.booking-queue-client span,
.booking-queue-sub {
  margin-top: 4px;
  color: var(--ink-4);
  font-size: 11px;
  line-height: 1.35;
}
.booking-queue-reason {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.45;
}
.booking-queue-reason span {
  margin-top: 4px;
  color: var(--ink-4);
}
.booking-queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  white-space: normal;
}
.booking-queue-actions .btn + .btn {
  margin-left: 0;
}
.booking-queue-actions .btn {
  padding-left: 8px;
  padding-right: 8px;
}
.booking-queue-actions .icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.booking-queue-actions .icon-btn.danger {
  color: #b54141;
}
.booking-queue-actions .icon-btn.danger:hover {
  background: #fff0f0;
  border-color: #d9aaaa;
}
.booking-queue-empty {
  text-align: center;
  padding: 28px;
  color: var(--ink-4);
}
.booking-queue-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
}
.target-policy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.target-policy-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.3fr) repeat(7, minmax(76px, 1fr)) minmax(130px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
}
.target-policy-row .form-row {
  margin-bottom: 0;
}
.target-policy-name {
  min-width: 0;
  padding-bottom: 2px;
}
.target-policy-name strong,
.target-policy-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.target-policy-name strong {
  font-size: 13px;
  color: var(--ink);
}
.target-policy-name span {
  margin-top: 4px;
  font: 11px/1.3 var(--mono);
  color: var(--ink-4);
}

/* ============ direction-first canary operations ============ */
.direction-stack {
  display: grid;
  gap: 16px;
}
.direction-empty {
  padding: 32px;
  text-align: center;
  color: var(--ink-3);
}
.booking-mode-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--paper);
}
.booking-mode-panel h2 {
  margin: 0 0 4px;
  font-size: 16px;
}
.booking-mode-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.booking-mode-form label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.direction-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--paper);
  overflow: hidden;
}
.direction-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.direction-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.direction-title-row h2 {
  font-size: 18px;
  margin: 0;
}
.direction-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
}
.direction-metric {
  padding: 14px 20px;
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}
.direction-metric:last-child {
  border-right: none;
}
.direction-metric span,
.direction-metric small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.direction-metric span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.direction-metric strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-bottom: 3px;
}
.direction-metric small {
  font: 11px/1.3 var(--mono);
  color: var(--ink-4);
}
.direction-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.direction-last-nearest {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
  min-width: 0;
}
.direction-last-nearest span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
}
.direction-last-nearest strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}
.direction-settings {
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.direction-settings summary {
  cursor: pointer;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}
.direction-policy-form {
  display: grid;
  grid-template-columns: repeat(8, minmax(94px, 1fr)) minmax(120px, auto) auto;
  gap: 10px;
  align-items: end;
  padding: 0 20px 16px;
}
.direction-policy-form .form-row {
  margin-bottom: 0;
}
.direction-consumables {
  padding: 16px 20px 20px;
  overflow-x: auto;
}
.direction-diagnostics {
  padding: 0;
}
.direction-diagnostics summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.direction-diagnostics summary small {
  font: 11px/1.3 var(--mono);
  color: var(--ink-4);
}
.direction-diagnostics .direction-section-title,
.direction-diagnostics .direction-canary-table {
  margin-left: 20px;
  margin-right: 20px;
}
.direction-diagnostics .direction-canary-table {
  margin-bottom: 20px;
}
.direction-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.direction-section-title h3 {
  font-size: 15px;
  margin: 0;
}
.direction-section-title span {
  font: 11px/1.3 var(--mono);
  color: var(--ink-4);
}
.direction-canary-table tbody tr {
  cursor: default;
}
.direction-canary-table tbody tr:hover {
  background: transparent;
}
.direction-canary-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .direction-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .direction-metric:nth-child(2n) {
    border-right: none;
  }
  .direction-metric:nth-child(-n+2) {
    border-bottom: 1px solid var(--line-soft);
  }
  .direction-policy-form {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }
}

@media (max-width: 760px) {
  .direction-card-head {
    display: grid;
  }
  .booking-mode-panel {
    display: grid;
  }
  .direction-last-nearest {
    grid-template-columns: 1fr;
  }
  .direction-metrics,
  .direction-policy-form {
    grid-template-columns: 1fr;
  }
  .direction-metric {
    border-right: none;
    border-bottom: 1px solid var(--line-soft);
  }
  .direction-metric:last-child {
    border-bottom: none;
  }
}

.slot-observation-panel {
  margin-top: 16px;
}
.slot-observation-filters {
  align-items: end;
}
.slot-analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.slot-analytics-block {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper);
}
.slot-analytics-wide {
  grid-column: 1 / -1;
}
.slot-analytics-block h3 {
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.slot-analytics-table {
  margin: 0;
}
.slot-appearance-details {
  margin: 14px 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
  overflow: hidden;
}
.slot-appearance-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--paper-2);
}
.slot-observation-table td {
  vertical-align: top;
}
.slot-observation-text {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .slot-analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ canary master-detail grid ============ */
.cn-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  align-items: start;
}

.cn-list-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cn-list-head h2 { font-size: 16px; }
.cn-list-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }

.cn-table {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--paper);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.cn-table thead th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  padding: 10px 14px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-soft);
  font-weight: 500;
}
.cn-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--ink-2);
  vertical-align: middle;
}
.cn-table tbody tr:last-child td { border-bottom: none; }
.cn-table tbody tr { cursor: pointer; transition: background 120ms; }
.cn-table tbody tr:hover { background: var(--paper-2); }
.cn-table tbody tr.selected { background: var(--accent-soft); }
.cn-table .name {
  font-weight: 500;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cn-table .name-meta {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
}

/* ============ state pills ============ */
.pill-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.pill-state::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
}
.pill-state.active { background: rgba(46,139,62,0.12); color: #2e8b3e; }
.pill-state.active::before { background: #2e8b3e; }
.pill-state.paused { background: rgba(183,93,42,0.12); color: #b75d2a; }
.pill-state.paused::before { background: #b75d2a; }
.pill-state.booking_in_progress, .pill-state.booking { background: rgba(95,82,200,0.12); color: #5f52c8; }
.pill-state.booking_in_progress::before, .pill-state.booking::before { background: #5f52c8; }
.pill-state.ready { background: var(--paper-2); color: var(--ink-3); }
.pill-state.ready::before { background: var(--ink-4); }
.pill-state.preparing { background: rgba(183,93,42,0.12); color: #8a4a20; }
.pill-state.preparing::before { background: #b75d2a; }
.pill-state.failed { background: rgba(200,54,78,0.12); color: #c8364e; }
.pill-state.failed::before { background: #c8364e; }
.pill-state.retired { background: var(--paper-2); color: var(--ink-4); }
.pill-state.retired::before { background: var(--ink-4); }
.pill-state.idle { background: var(--paper-2); color: var(--ink-3); }
.pill-state.idle::before { background: var(--ink-3); }
.pill-state.disabled { background: var(--paper-2); color: var(--ink-4); }
.pill-state.disabled::before { background: var(--ink-4); }

.stats-inline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.stats-inline strong { color: var(--ink); }
.stats-inline .ban { color: #c8364e; }

/* ============ canary detail card ============ */
.cn-detail {
  position: sticky;
  top: 16px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cn-detail-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.cn-detail-title {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px;
}
.cn-detail-title h3 { font-size: 18px; }
.cn-detail-title .id { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.cn-detail-sub {
  font-size: 12px;
  color: var(--ink-3);
  display: flex; gap: 12px; flex-wrap: wrap;
}
.cn-detail-sub strong { color: var(--ink-2); font-weight: 500; }

.stat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-bottom: 1px solid var(--line-soft);
}
.stat-grid .cell {
  padding: 14px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.stat-grid .cell:nth-child(2n) { border-right: none; }
.stat-grid .cell:nth-last-child(-n+2) { border-bottom: none; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 3px; }
.stat-value { font-size: 16px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-value.mono { font-family: var(--mono); font-size: 13px; }

.action-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.action-row .btn-block {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; border-radius: var(--r-md);
  background: var(--paper-2); border: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-2);
  cursor: pointer; text-decoration: none;
  transition: background 120ms;
  padding: 0;
  font-family: inherit;
}
.action-row .btn-block:hover { background: var(--paper); border-color: var(--ink-4); color: var(--ink); }
.action-row .btn-block.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.action-row .btn-block.primary:hover { background: var(--ink); color: var(--paper); }
.action-row .btn-block.danger { color: #c8364e; }
.action-row .btn-block.danger:hover { background: rgba(200,54,78,0.06); border-color: rgba(200,54,78,0.3); }
.action-row .broker-session { grid-column: 1 / -1; }

/* ============ event timeline ============ */
.timeline-head {
  padding: 12px 20px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: center;
}
.timeline-head a { color: var(--ink-3); font-size: 11px; text-transform: none; letter-spacing: 0; text-decoration: none; }
.timeline-head a:hover { color: var(--ink); }
.timeline {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  max-height: 280px;
  overflow-y: auto;
}
.timeline li {
  padding: 8px 20px;
  display: grid; grid-template-columns: 64px 1fr; gap: 10px;
  font-size: 12px;
  border-bottom: 1px dashed var(--line-soft);
}
.timeline li:last-child { border-bottom: none; }
.timeline .ts { font-family: var(--mono); font-size: 10px; color: var(--ink-4); padding-top: 2px; }
.timeline .ev-name { color: var(--ink-2); font-weight: 500; }
.timeline .ev-name.warn { color: #b75d2a; }
.timeline .ev-name.error { color: #c8364e; }
.timeline .ev-name.ok { color: #2e8b3e; }
.timeline .ev-meta { color: var(--ink-4); font-size: 11px; }

/* ============ proxy card grid ============ */
.px-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}
.px-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.px-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.px-title {
  display: flex; align-items: baseline; gap: 8px;
}
.px-title h3 { font-size: 17px; }
.px-title .id { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.px-sub {
  margin-top: 5px;
  font-size: 12px; color: var(--ink-3);
  display: flex; gap: 12px; flex-wrap: wrap;
}
.px-sub strong { color: var(--ink-2); font-weight: 500; font-family: var(--mono); }

.px-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line-soft);
}
.px-stats .cell {
  padding: 12px 18px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.px-stats .cell:nth-child(2n) { border-right: none; }
.px-stats .cell:nth-last-child(-n+2) { border-bottom: none; }

.px-canaries {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper-2);
}
.px-canaries-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 6px; }
.px-canaries ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.px-canaries li { font-size: 12px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; }
.px-canaries li a { color: var(--accent); text-decoration: none; font-weight: 500; }
.px-canaries .empty { color: var(--ink-4); font-style: italic; font-size: 12px; }

.px-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 12px 18px;
}
.px-actions .btn-block {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; border-radius: var(--r-md);
  background: var(--paper-2); border: 1px solid var(--line-soft);
  font-size: 12px; color: var(--ink-2);
  cursor: pointer; text-decoration: none;
  transition: background 120ms;
  padding: 0;
  font-family: inherit;
}
.px-actions .btn-block:hover { background: var(--paper); border-color: var(--ink-4); color: var(--ink); }
.px-actions .btn-block.danger { color: #c8364e; }

/* "Add new" card */
.px-add {
  border: 2px dashed var(--line-soft);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  min-height: 260px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink-3);
  transition: border-color 120ms, color 120ms;
}
.px-add:hover { border-color: var(--accent); color: var(--accent); }
.px-add-inner { text-align: center; padding: 24px; }
.px-add-icon { font-size: 28px; margin-bottom: 8px; }
.px-add-title { font-size: 15px; font-weight: 500; }
.px-add-sub { font-size: 11px; color: var(--ink-4); margin-top: 4px; }

/* ============ modal ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,26,20,0.46);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--paper);
  border-radius: var(--r-lg);
  width: 560px;
  max-width: 92vw;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.4);
  overflow: hidden;
}
.modal-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; justify-content: space-between; align-items: baseline;
}
.modal-head h3 { font-size: 18px; }
.modal-head .step-mark { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.modal-body { padding: 18px 22px; max-height: 60vh; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px;
  background: var(--paper-2);
  display: flex; gap: 8px; justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
}

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); margin-bottom: 5px; }
.form-row .hint { font-size: 11px; color: var(--ink-4); margin-top: 4px; font-style: italic; }
.form-row select, .form-row input {
  width: 100%; height: 36px;
  border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: 0 12px; font-family: inherit; font-size: 13px;
  background: var(--paper); color: var(--ink);
}
.form-row input[type=password] { font-family: var(--mono); }

@media (max-width: 900px) {
  .role-chip,
  .system-health-strip {
    display: none;
  }
}

@media (max-width: 760px) {
  .ad-head,
  .booking-queue-head,
  .booking-test-head {
    display: grid;
    align-items: start;
    gap: 12px;
  }

  .ad-actions,
  .booking-test-actions {
    flex-wrap: wrap;
  }

  .admin-tabs {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .role-chip,
  .system-health-strip {
    margin-left: 0;
    margin-right: 0;
  }

  .system-health-strip {
    order: 5;
    gap: 7px;
  }

  .topbar-user {
    order: 6;
  }

  .captcha-pool-monitor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .captcha-pool-settings,
  .booking-test-controls,
  .test-application-form,
  .direction-policy-form,
  .cn-grid {
    grid-template-columns: 1fr;
  }
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.preview-card {
  background: var(--paper-2);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}
.preview-card .lbl { color: var(--ink-4); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.preview-card strong { color: var(--ink); font-weight: 500; }
.regen-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

/* ============ admin badges in operator/list.html ============ */
.badge-canary {
  display: inline-flex; align-items: center; height: 18px; padding: 0 8px;
  background: rgba(95,82,200,0.12); color: #5f52c8;
  border-radius: 999px; font-size: 10px; font-weight: 500;
  letter-spacing: 0.02em;
}
.badge-fake {
  display: inline-flex; align-items: center; height: 18px; padding: 0 8px;
  background: rgba(183,93,42,0.10); color: #b75d2a;
  border-radius: 999px; font-size: 10px; font-weight: 500;
}

/* ============ informational helper block ============ */
.helper-block {
  margin-top: 32px;
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}
.helper-block strong { color: var(--ink); font-size: 13px; }

/* ============ Эпик 15: live phase block ============ */
.canary-live-status {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, rgba(46,139,62,0.06), rgba(46,139,62,0.0));
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
  transition: background 200ms;
}
.canary-live-status.proxy-status {
  background: linear-gradient(90deg, rgba(95,82,200,0.06), rgba(95,82,200,0.0));
  border-radius: 0;
  margin: 0;
}
.canary-live-status .phase-icon {
  font-size: 22px;
  line-height: 1;
  text-align: center;
}
.canary-live-status .phase-text strong {
  font-size: 13px;
  color: var(--ink);
  display: block;
  line-height: 1.3;
}
.canary-live-status .phase-text .phase-detail {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--mono);
  margin-top: 2px;
}
.canary-live-status .phase-countdown {
  font-size: 11px;
  color: var(--ink-4);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.canary-live-status .phase-stale {
  color: #c8364e;
}

/* ============ restart-required banner ============ */
.banner-warn {
  padding: 12px 16px;
  background: rgba(183,93,42,0.08);
  border: 1px solid rgba(183,93,42,0.25);
  border-radius: var(--r-md);
  color: #8a4a20;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.banner-warn code {
  background: var(--paper);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
}

/* ============ integrations / external budget ============ */
.integration-metric-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.integration-metric-strip .metric-value {
  font-size: 21px;
  overflow-wrap: anywhere;
  line-height: 1.1;
}
.integration-panel {
  margin-top: 16px;
}
.integration-table th,
.integration-table td {
  vertical-align: top;
}
.integration-table td {
  font-size: 12px;
}
.integration-table .name {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.integration-table .name:hover {
  text-decoration: underline;
}
.integration-risk {
  max-width: 360px;
  color: var(--ink-2);
  line-height: 1.45;
}

.email-import-form .form-row:first-child {
  min-width: 260px;
  flex: 1 1 320px;
}
.email-import-form .form-row {
  min-width: 150px;
}
.email-import-file input[type=file] {
  padding: 7px 10px;
  height: 36px;
}
.email-import-issues {
  margin: 8px 0 0 18px;
  padding: 0;
}
.email-policy-panel {
  margin-bottom: 16px;
}
.email-metric-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.email-bulk-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
}
.email-select-all {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  font-size: 12px;
  white-space: nowrap;
}
.email-selection-state {
  color: var(--ink-3);
  font-size: 12px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.email-bulk-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 12px;
}
.email-bulk-progress[hidden] {
  display: none;
}
.email-bulk-progress progress {
  width: min(340px, 45vw);
  height: 12px;
}
.email-bulk-actions select {
  width: 220px;
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 0 10px;
  background: var(--paper);
  color: var(--ink);
}
.email-pool-table {
  min-width: 1280px;
}
.email-pool-table .mono-cell {
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
}
.email-pool-table td:first-child {
  min-width: 170px;
  width: 170px;
}
.email-pool-table td:last-child {
  width: 150px;
  white-space: nowrap;
}
.email-num-cell {
  vertical-align: top;
}
.email-select-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
}
.email-canary-mini {
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.35;
}
.email-canary-mini .pill-state {
  margin-bottom: 4px;
}
.email-canary-mini.muted {
  color: var(--ink-4);
}
.email-row-details {
  margin-top: 5px;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.45;
  max-width: 360px;
}
.email-row-details summary {
  cursor: pointer;
  color: var(--accent);
}
.email-row-details .warn {
  color: #c8364e;
  overflow-wrap: anywhere;
}
.email-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.email-row-actions .btn {
  min-width: 30px;
  padding: 0 8px;
}

@media (max-width: 900px) {
  .integration-table {
    min-width: 860px;
  }
  .email-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
